[librasterlite2] 01/02: Imported Upstream version 1.0.0~rc0
Bas Couwenberg
sebastic at xs4all.nl
Fri Nov 21 15:59:41 UTC 2014
This is an automated email from the git hooks/post-receive script.
sebastic-guest pushed a commit to branch master
in repository librasterlite2.
commit c6f208eb3d69ac05b95f314699649dc6868c110e
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Fri Nov 21 11:49:38 2014 +0100
Imported Upstream version 1.0.0~rc0
---
AUTHORS | 3 +
Android_R4.2.0.mk | 50 +
COPYING | 473 +
ChangeLog | Bin 0 -> 232 bytes
Doxyfile.in | 1681 ++
INSTALL | 183 +
Makefile-static-MinGW | 76 +
Makefile.am | 20 +
Makefile.in | 888 +
NEWS | 0
README | 34 +
aclocal.m4 | 1324 ++
config.guess | 1558 ++
config.h.in | 177 +
config.sub | 1788 ++
configure | 20716 +++++++++++++++++++
configure.ac | 154 +
depcomp | 791 +
examples/Makefile.am | 8 +
examples/Makefile.in | 597 +
examples/examples.doxy | 152 +
examples/sample1.c | 68 +
headers/Makefile.am | 9 +
headers/Makefile.in | 577 +
headers/rasterlite2/rasterlite2.h | 3714 ++++
headers/rasterlite2/rl2graphics.h | 801 +
headers/rasterlite2/rl2svg.h | 138 +
headers/rasterlite2/rl2tiff.h | 290 +
headers/rasterlite2/rl2wms.h | 1934 ++
headers/rasterlite2/sqlite.h | 55 +
headers/rasterlite2_private.h | 1325 ++
headers/rl2svg_private.h | 678 +
install-sh | 527 +
ltmain.sh | 9655 +++++++++
m4/libtool.m4 | 7986 +++++++
m4/ltoptions.m4 | 384 +
m4/ltsugar.m4 | 123 +
m4/ltversion.m4 | 23 +
m4/lt~obsolete.m4 | 98 +
mainpage.doxy | 547 +
missing | 215 +
rasterlite2-4.2.0.mk | 86 +
rasterlite2.pc.in | 12 +
src/Makefile.am | 48 +
src/Makefile.in | 921 +
src/rasterlite2.c | 2837 +++
src/rl2ascii.c | 1398 ++
src/rl2auxrender.c | 1213 ++
src/rl2codec.c | 7137 +++++++
src/rl2dbms.c | 5010 +++++
src/rl2gif.c | 828 +
src/rl2import.c | 3204 +++
src/rl2jpeg.c | 1344 ++
src/rl2paint.c | 1715 ++
src/rl2png.c | 1057 +
src/rl2pyramid.c | 6522 ++++++
src/rl2rastersym.c | 4405 ++++
src/rl2raw.c | 1604 ++
src/rl2sql.c | 7040 +++++++
src/rl2sqlaux.c | 4410 ++++
src/rl2svg.c | 2064 ++
src/rl2svgaux.c | 2059 ++
src/rl2svgxml.c | 2676 +++
src/rl2symbolizer.c | 2244 ++
src/rl2tiff.c | 7729 +++++++
src/rl2version.c | 66 +
src/rl2webp.c | 559 +
src/rl2wms.c | 7560 +++++++
test-driver | 127 +
test/Car_Yellow.svg | 7483 +++++++
test/Circle_and_quadratic_bezier.svg | 35 +
test/Coat_of_arms_Holy_See.svg | 3454 ++++
test/Flag_of_the_United_Kingdom.svg | 10 +
test/Flag_of_the_United_States.svg | 12 +
test/Makefile.am | 106 +
test/Makefile.in | 2001 ++
...gative_and_positive_skew_diagrams_(English).svg | 152 +
test/Netherlands_roundel.svg | 13 +
...of_the_Royal_Canadian_Air_Force_(1946-1965).svg | 104 +
test/Roundel_of_the_Syrian_Air_Force.svg | 10 +
test/Royal_Coat_of_Arms_of_the_United_Kingdom.svg | 3909 ++++
test/asprintf4win.h | 80 +
test/bicycle.svg | 149 +
test/car_repair.svg | 210 +
test/check_sql_stmt.c | 672 +
test/doctors.svg | 418 +
test/fastfood.svg | 138 +
test/fnmatch4win.h | 63 +
test/fnmatch_impl4win.h | 193 +
test/gif1.gif | Bin 0 -> 8291 bytes
test/gray-striped.tif | Bin 0 -> 81103 bytes
test/gray-tiled.tif | Bin 0 -> 93951 bytes
test/gray_gamma.xml | 12 +
test/gray_gamma2.xml | 17 +
test/gray_histogram.xml | 12 +
test/gray_histogram2.xml | 17 +
test/gray_normalize.xml | 12 +
test/gray_normalize2.xml | 17 +
test/group_style_1.xml | 17 +
test/group_style_2.xml | 19 +
test/hospital.svg | 429 +
test/ir_false_color1.xml | 20 +
test/ir_false_color1_gamma.xml | 23 +
test/ir_false_color2.xml | 20 +
test/ir_false_color2_gamma.xml | 23 +
test/ir_gray.xml | 14 +
test/ir_gray_gamma.xml | 17 +
test/jewelry.svg | 175 +
test/jpeg1.jpg | Bin 0 -> 54565 bytes
test/jpeg2.jpg | Bin 0 -> 48584 bytes
test/map_samples/ascii/ascii1.asc | 606 +
test/map_samples/ascii/ascii2.asc | 606 +
test/map_samples/ctrt/cap1.tif | Bin 0 -> 78730 bytes
test/map_samples/ctrt/cap2.tif | Bin 0 -> 69490 bytes
test/map_samples/orbview3-orbetello/orbetello1.tif | Bin 0 -> 4719468 bytes
test/map_samples/orbview3-orbetello/orbetello2.tfw | 6 +
test/map_samples/orbview3-orbetello/orbetello2.tif | Bin 0 -> 2899450 bytes
test/map_samples/orbview3-trieste/trieste1.tif | Bin 0 -> 1180280 bytes
test/map_samples/orbview3-trieste/trieste2.tif | Bin 0 -> 1180280 bytes
test/map_samples/trento-gray/trento-gray1.jgw | 6 +
test/map_samples/trento-gray/trento-gray1.jpg | Bin 0 -> 137664 bytes
test/map_samples/trento-gray/trento-gray2.jgw | 6 +
test/map_samples/trento-gray/trento-gray2.jpg | Bin 0 -> 135811 bytes
test/map_samples/trento-rgb/trento-rgb1.jgw | 6 +
test/map_samples/trento-rgb/trento-rgb1.jpg | Bin 0 -> 148638 bytes
test/map_samples/trento-rgb/trento-rgb2.jgw | 6 +
test/map_samples/trento-rgb/trento-rgb2.jpg | Bin 0 -> 146585 bytes
test/map_samples/tuscany-infrared/infrared1.tif | Bin 0 -> 2360172 bytes
test/map_samples/tuscany-infrared/infrared2.tfw | 6 +
test/map_samples/tuscany-infrared/infrared2.tif | Bin 0 -> 1459475 bytes
test/map_samples/usgs-gray/gray1.tif | Bin 0 -> 68846 bytes
test/map_samples/usgs-gray/gray2.tif | Bin 0 -> 71242 bytes
test/map_samples/usgs-indiana/indiana1.tif | Bin 0 -> 94098 bytes
test/map_samples/usgs-indiana/indiana2.tif | Bin 0 -> 139490 bytes
test/map_samples/usgs-nile-32/nile1-int32.tif | Bin 0 -> 285444 bytes
test/map_samples/usgs-nile-32/nile2-int32.tif | Bin 0 -> 388714 bytes
test/map_samples/usgs-nile-8/nile1-int8.tif | Bin 0 -> 187236 bytes
test/map_samples/usgs-nile-8/nile2-int8.tif | Bin 0 -> 191122 bytes
test/map_samples/usgs-nile-dbl/nile1-dbl.tif | Bin 0 -> 312594 bytes
test/map_samples/usgs-nile-dbl/nile2-dbl.tif | Bin 0 -> 403348 bytes
test/map_samples/usgs-nile-flt/nile1-flt.tif | Bin 0 -> 295024 bytes
test/map_samples/usgs-nile-flt/nile2-flt.tif | Bin 0 -> 386536 bytes
test/map_samples/usgs-nile-u16/nile1-uint16.tif | Bin 0 -> 248172 bytes
test/map_samples/usgs-nile-u16/nile2-uint16.tif | Bin 0 -> 331814 bytes
test/map_samples/usgs-nile-u32/nile1-uint32.tif | Bin 0 -> 285326 bytes
test/map_samples/usgs-nile-u32/nile2-uint32.tif | Bin 0 -> 383100 bytes
test/map_samples/usgs-nile-u8/nile1-uint8.tif | Bin 0 -> 212386 bytes
test/map_samples/usgs-nile-u8/nile2-uint8.tif | Bin 0 -> 284558 bytes
test/map_samples/usgs-rgb/rgb1.tif | Bin 0 -> 151816 bytes
test/map_samples/usgs-rgb/rgb2.tif | Bin 0 -> 180850 bytes
test/map_samples/usgs-srtm/srtm1.tif | Bin 0 -> 404232 bytes
test/map_samples/usgs-srtm/srtm2.tif | Bin 0 -> 427758 bytes
test/mask1.png | Bin 0 -> 2206 bytes
test/mono3s.tif | Bin 0 -> 18298 bytes
test/mono3t.tif | Bin 0 -> 30712 bytes
test/mono4s.tif | Bin 0 -> 14200 bytes
test/mono4t.tif | Bin 0 -> 16967 bytes
test/motorcycle.svg | 365 +
test/pharmacy.svg | 432 +
test/photo.svg | 206 +
test/plt-striped.tif | Bin 0 -> 77003 bytes
test/plt-tiled.tif | Bin 0 -> 86303 bytes
test/png1.png | Bin 0 -> 4113 bytes
test/raster_symbolizer_1.xml | 55 +
test/raster_symbolizer_2.xml | 45 +
test/raster_symbolizer_3.xml | 12 +
test/raster_symbolizer_4.xml | 61 +
test/raster_symbolizer_5.xml | 56 +
test/raster_symbolizer_6.xml | 20 +
test/restaurant.svg | 79 +
test/rgb-striped.tif | Bin 0 -> 992505 bytes
test/rgb-tiled.tif | Bin 0 -> 1444537 bytes
test/rgb_gamma.xml | 29 +
test/rgb_histogram.xml | 23 +
test/rgb_histogram2.xml | 29 +
test/rgb_normalize.xml | 23 +
test/rgb_normalize2.xml | 29 +
test/scandir4win.h | 168 +
test/sql_stmt_security_tests/Makefile.am | 242 +
test/sql_stmt_security_tests/Makefile.in | 684 +
test/sql_stmt_security_tests/loadraster1.testcase | 7 +
test/sql_stmt_security_tests/loadraster10.testcase | 7 +
test/sql_stmt_security_tests/loadraster11.testcase | 7 +
test/sql_stmt_security_tests/loadraster12.testcase | 7 +
test/sql_stmt_security_tests/loadraster13.testcase | 7 +
test/sql_stmt_security_tests/loadraster14.testcase | 7 +
test/sql_stmt_security_tests/loadraster15.testcase | 7 +
test/sql_stmt_security_tests/loadraster16.testcase | 7 +
test/sql_stmt_security_tests/loadraster17.testcase | 7 +
test/sql_stmt_security_tests/loadraster18.testcase | 7 +
test/sql_stmt_security_tests/loadraster19.testcase | 7 +
test/sql_stmt_security_tests/loadraster2.testcase | 7 +
test/sql_stmt_security_tests/loadraster20.testcase | 7 +
test/sql_stmt_security_tests/loadraster21.testcase | 7 +
test/sql_stmt_security_tests/loadraster22.testcase | 7 +
test/sql_stmt_security_tests/loadraster23.testcase | 7 +
test/sql_stmt_security_tests/loadraster24.testcase | 7 +
test/sql_stmt_security_tests/loadraster3.testcase | 7 +
test/sql_stmt_security_tests/loadraster4.testcase | 7 +
test/sql_stmt_security_tests/loadraster5.testcase | 7 +
test/sql_stmt_security_tests/loadraster6.testcase | 7 +
test/sql_stmt_security_tests/loadraster7.testcase | 7 +
test/sql_stmt_security_tests/loadraster8.testcase | 7 +
test/sql_stmt_security_tests/loadraster9.testcase | 7 +
.../loadrasterdir1.testcase | 7 +
.../loadrasterdir10.testcase | 7 +
.../loadrasterdir11.testcase | 7 +
.../loadrasterdir12.testcase | 7 +
.../loadrasterdir13.testcase | 7 +
.../loadrasterdir14.testcase | 7 +
.../loadrasterdir15.testcase | 7 +
.../loadrasterdir16.testcase | 7 +
.../loadrasterdir17.testcase | 7 +
.../loadrasterdir18.testcase | 7 +
.../loadrasterdir19.testcase | 7 +
.../loadrasterdir2.testcase | 7 +
.../loadrasterdir20.testcase | 7 +
.../loadrasterdir21.testcase | 7 +
.../loadrasterdir22.testcase | 7 +
.../loadrasterdir23.testcase | 7 +
.../loadrasterdir24.testcase | 7 +
.../loadrasterdir25.testcase | 7 +
.../loadrasterdir26.testcase | 7 +
.../loadrasterdir27.testcase | 7 +
.../loadrasterdir28.testcase | 7 +
.../loadrasterdir3.testcase | 7 +
.../loadrasterdir4.testcase | 7 +
.../loadrasterdir5.testcase | 7 +
.../loadrasterdir6.testcase | 7 +
.../loadrasterdir7.testcase | 7 +
.../loadrasterdir8.testcase | 7 +
.../loadrasterdir9.testcase | 7 +
.../loadrasterwms1.testcase | 7 +
.../loadrasterwms10.testcase | 7 +
.../loadrasterwms11.testcase | 7 +
.../loadrasterwms12.testcase | 7 +
.../loadrasterwms13.testcase | 7 +
.../loadrasterwms14.testcase | 7 +
.../loadrasterwms15.testcase | 7 +
.../loadrasterwms16.testcase | 7 +
.../loadrasterwms17.testcase | 7 +
.../loadrasterwms18.testcase | 7 +
.../loadrasterwms19.testcase | 7 +
.../loadrasterwms2.testcase | 7 +
.../loadrasterwms3.testcase | 7 +
.../loadrasterwms4.testcase | 7 +
.../loadrasterwms5.testcase | 7 +
.../loadrasterwms6.testcase | 7 +
.../loadrasterwms7.testcase | 7 +
.../loadrasterwms8.testcase | 7 +
.../loadrasterwms9.testcase | 7 +
test/sql_stmt_security_tests/writeascii1.testcase | 7 +
test/sql_stmt_security_tests/writeascii10.testcase | 7 +
test/sql_stmt_security_tests/writeascii11.testcase | 7 +
test/sql_stmt_security_tests/writeascii12.testcase | 7 +
test/sql_stmt_security_tests/writeascii13.testcase | 7 +
test/sql_stmt_security_tests/writeascii14.testcase | 7 +
test/sql_stmt_security_tests/writeascii15.testcase | 7 +
test/sql_stmt_security_tests/writeascii16.testcase | 7 +
test/sql_stmt_security_tests/writeascii17.testcase | 7 +
test/sql_stmt_security_tests/writeascii18.testcase | 7 +
test/sql_stmt_security_tests/writeascii2.testcase | 7 +
test/sql_stmt_security_tests/writeascii3.testcase | 7 +
test/sql_stmt_security_tests/writeascii4.testcase | 7 +
test/sql_stmt_security_tests/writeascii5.testcase | 7 +
test/sql_stmt_security_tests/writeascii6.testcase | 7 +
test/sql_stmt_security_tests/writeascii7.testcase | 7 +
test/sql_stmt_security_tests/writeascii9.testcase | 7 +
.../writebandgeotiff1.testcase | 7 +
.../writebandgeotiff10.testcase | 7 +
.../writebandgeotiff11.testcase | 7 +
.../writebandgeotiff12.testcase | 7 +
.../writebandgeotiff13.testcase | 7 +
.../writebandgeotiff14.testcase | 7 +
.../writebandgeotiff15.testcase | 7 +
.../writebandgeotiff16.testcase | 7 +
.../writebandgeotiff17.testcase | 7 +
.../writebandgeotiff18.testcase | 7 +
.../writebandgeotiff19.testcase | 7 +
.../writebandgeotiff2.testcase | 7 +
.../writebandgeotiff20.testcase | 7 +
.../writebandgeotiff21.testcase | 7 +
.../writebandgeotiff22.testcase | 7 +
.../writebandgeotiff23.testcase | 7 +
.../writebandgeotiff24.testcase | 7 +
.../writebandgeotiff25.testcase | 7 +
.../writebandgeotiff26.testcase | 7 +
.../writebandgeotiff27.testcase | 7 +
.../writebandgeotiff28.testcase | 7 +
.../writebandgeotiff3.testcase | 7 +
.../writebandgeotiff4.testcase | 7 +
.../writebandgeotiff5.testcase | 7 +
.../writebandgeotiff6.testcase | 7 +
.../writebandgeotiff7.testcase | 7 +
.../writebandgeotiff8.testcase | 7 +
.../writebandgeotiff9.testcase | 7 +
.../writebandtiff1.testcase | 7 +
.../writebandtiff10.testcase | 7 +
.../writebandtiff11.testcase | 7 +
.../writebandtiff12.testcase | 7 +
.../writebandtiff13.testcase | 7 +
.../writebandtiff14.testcase | 7 +
.../writebandtiff15.testcase | 7 +
.../writebandtiff16.testcase | 7 +
.../writebandtiff17.testcase | 7 +
.../writebandtiff18.testcase | 7 +
.../writebandtiff19.testcase | 7 +
.../writebandtiff2.testcase | 7 +
.../writebandtiff20.testcase | 7 +
.../writebandtiff21.testcase | 7 +
.../writebandtiff22.testcase | 7 +
.../writebandtiff23.testcase | 7 +
.../writebandtiff24.testcase | 7 +
.../writebandtiff25.testcase | 7 +
.../writebandtiff26.testcase | 7 +
.../writebandtiff27.testcase | 7 +
.../writebandtiff3.testcase | 7 +
.../writebandtiff4.testcase | 7 +
.../writebandtiff5.testcase | 7 +
.../writebandtiff6.testcase | 7 +
.../writebandtiff7.testcase | 7 +
.../writebandtiff8.testcase | 7 +
.../writebandtiff9.testcase | 7 +
.../sql_stmt_security_tests/writegeotiff1.testcase | 7 +
.../writegeotiff10.testcase | 7 +
.../writegeotiff11.testcase | 7 +
.../writegeotiff12.testcase | 7 +
.../writegeotiff13.testcase | 7 +
.../writegeotiff14.testcase | 7 +
.../writegeotiff15.testcase | 7 +
.../writegeotiff16.testcase | 7 +
.../writegeotiff17.testcase | 7 +
.../writegeotiff18.testcase | 7 +
.../writegeotiff19.testcase | 7 +
.../sql_stmt_security_tests/writegeotiff2.testcase | 7 +
.../sql_stmt_security_tests/writegeotiff3.testcase | 7 +
.../sql_stmt_security_tests/writegeotiff4.testcase | 7 +
.../sql_stmt_security_tests/writegeotiff5.testcase | 7 +
.../sql_stmt_security_tests/writegeotiff6.testcase | 7 +
.../sql_stmt_security_tests/writegeotiff7.testcase | 7 +
.../sql_stmt_security_tests/writegeotiff8.testcase | 7 +
.../sql_stmt_security_tests/writegeotiff9.testcase | 7 +
test/sql_stmt_security_tests/writejpeg1.testcase | 7 +
test/sql_stmt_security_tests/writejpeg10.testcase | 7 +
test/sql_stmt_security_tests/writejpeg11.testcase | 7 +
test/sql_stmt_security_tests/writejpeg12.testcase | 7 +
test/sql_stmt_security_tests/writejpeg13.testcase | 7 +
test/sql_stmt_security_tests/writejpeg14.testcase | 7 +
test/sql_stmt_security_tests/writejpeg15.testcase | 7 +
test/sql_stmt_security_tests/writejpeg2.testcase | 7 +
test/sql_stmt_security_tests/writejpeg3.testcase | 7 +
test/sql_stmt_security_tests/writejpeg4.testcase | 7 +
test/sql_stmt_security_tests/writejpeg5.testcase | 7 +
test/sql_stmt_security_tests/writejpeg6.testcase | 7 +
test/sql_stmt_security_tests/writejpeg7.testcase | 7 +
test/sql_stmt_security_tests/writejpeg8.testcase | 7 +
test/sql_stmt_security_tests/writejpeg9.testcase | 7 +
.../writemonogeotiff1.testcase | 7 +
.../writemonogeotiff10.testcase | 7 +
.../writemonogeotiff11.testcase | 7 +
.../writemonogeotiff12.testcase | 7 +
.../writemonogeotiff13.testcase | 7 +
.../writemonogeotiff14.testcase | 7 +
.../writemonogeotiff15.testcase | 7 +
.../writemonogeotiff16.testcase | 7 +
.../writemonogeotiff17.testcase | 7 +
.../writemonogeotiff18.testcase | 7 +
.../writemonogeotiff19.testcase | 7 +
.../writemonogeotiff2.testcase | 7 +
.../writemonogeotiff20.testcase | 7 +
.../writemonogeotiff21.testcase | 7 +
.../writemonogeotiff22.testcase | 7 +
.../writemonogeotiff3.testcase | 7 +
.../writemonogeotiff4.testcase | 7 +
.../writemonogeotiff5.testcase | 7 +
.../writemonogeotiff6.testcase | 7 +
.../writemonogeotiff7.testcase | 7 +
.../writemonogeotiff8.testcase | 7 +
.../writemonogeotiff9.testcase | 7 +
.../writemonotiff1.testcase | 7 +
.../writemonotiff10.testcase | 7 +
.../writemonotiff11.testcase | 7 +
.../writemonotiff12.testcase | 7 +
.../writemonotiff13.testcase | 7 +
.../writemonotiff14.testcase | 7 +
.../writemonotiff15.testcase | 7 +
.../writemonotiff16.testcase | 7 +
.../writemonotiff17.testcase | 7 +
.../writemonotiff18.testcase | 7 +
.../writemonotiff19.testcase | 7 +
.../writemonotiff2.testcase | 7 +
.../writemonotiff20.testcase | 7 +
.../writemonotiff21.testcase | 7 +
.../writemonotiff3.testcase | 7 +
.../writemonotiff4.testcase | 7 +
.../writemonotiff5.testcase | 7 +
.../writemonotiff6.testcase | 7 +
.../writemonotiff7.testcase | 7 +
.../writemonotiff8.testcase | 7 +
.../writemonotiff9.testcase | 7 +
test/sql_stmt_security_tests/writetiff1.testcase | 7 +
test/sql_stmt_security_tests/writetiff10.testcase | 7 +
test/sql_stmt_security_tests/writetiff11.testcase | 7 +
test/sql_stmt_security_tests/writetiff12.testcase | 7 +
test/sql_stmt_security_tests/writetiff13.testcase | 7 +
test/sql_stmt_security_tests/writetiff14.testcase | 7 +
test/sql_stmt_security_tests/writetiff15.testcase | 7 +
test/sql_stmt_security_tests/writetiff16.testcase | 7 +
test/sql_stmt_security_tests/writetiff17.testcase | 7 +
test/sql_stmt_security_tests/writetiff18.testcase | 7 +
test/sql_stmt_security_tests/writetiff2.testcase | 7 +
test/sql_stmt_security_tests/writetiff3.testcase | 7 +
test/sql_stmt_security_tests/writetiff4.testcase | 7 +
test/sql_stmt_security_tests/writetiff5.testcase | 7 +
test/sql_stmt_security_tests/writetiff6.testcase | 7 +
test/sql_stmt_security_tests/writetiff7.testcase | 7 +
test/sql_stmt_security_tests/writetiff8.testcase | 7 +
test/sql_stmt_security_tests/writetiff9.testcase | 7 +
test/sql_stmt_tests/Makefile.am | 447 +
test/sql_stmt_tests/Makefile.in | 892 +
test/sql_stmt_tests/createcov_16_mband.testcase | 7 +
test/sql_stmt_tests/createcov_16_mband1.testcase | 7 +
.../createcov_16_mband_deflate.testcase | 7 +
.../createcov_16_mband_fax3.testcase | 7 +
.../createcov_16_mband_fax4.testcase | 7 +
.../sql_stmt_tests/createcov_16_mband_gif.testcase | 7 +
.../createcov_16_mband_jpeg.testcase | 7 +
.../createcov_16_mband_lzma.testcase | 7 +
.../sql_stmt_tests/createcov_16_mband_png.testcase | 7 +
.../createcov_16_mband_webp1.testcase | 7 +
.../createcov_16_mband_webp2.testcase | 7 +
test/sql_stmt_tests/createcov_1bit_mono.testcase | 7 +
test/sql_stmt_tests/createcov_1bit_mono1.testcase | 7 +
.../createcov_1bit_mono_deflate.testcase | 7 +
.../createcov_1bit_mono_fax3.testcase | 7 +
.../createcov_1bit_mono_fax4.testcase | 7 +
.../createcov_1bit_mono_gif.testcase | 7 +
.../createcov_1bit_mono_jpeg.testcase | 7 +
.../createcov_1bit_mono_lzma.testcase | 7 +
.../createcov_1bit_mono_png.testcase | 7 +
.../createcov_1bit_mono_webp1.testcase | 7 +
.../createcov_1bit_mono_webp2.testcase | 7 +
.../sql_stmt_tests/createcov_1bit_palette.testcase | 7 +
.../createcov_1bit_palette1.testcase | 7 +
.../createcov_1bit_palette_gif.testcase | 7 +
.../createcov_1bit_palette_png.testcase | 7 +
test/sql_stmt_tests/createcov_2bit_gray.testcase | 7 +
test/sql_stmt_tests/createcov_2bit_gray1.testcase | 7 +
.../createcov_2bit_gray_gif.testcase | 7 +
.../createcov_2bit_gray_jpeg.testcase | 7 +
.../createcov_2bit_gray_png.testcase | 7 +
.../createcov_2bit_gray_webp1.testcase | 7 +
.../createcov_2bit_gray_webp2.testcase | 7 +
.../sql_stmt_tests/createcov_2bit_palette.testcase | 7 +
.../createcov_2bit_palette1.testcase | 7 +
.../createcov_2bit_palette_gif.testcase | 7 +
.../createcov_2bit_palette_png.testcase | 7 +
test/sql_stmt_tests/createcov_4bit_gray.testcase | 7 +
test/sql_stmt_tests/createcov_4bit_gray1.testcase | 7 +
.../createcov_4bit_gray_gif.testcase | 7 +
.../createcov_4bit_gray_jpeg.testcase | 7 +
.../createcov_4bit_gray_png.testcase | 7 +
.../createcov_4bit_gray_webp1.testcase | 7 +
.../createcov_4bit_gray_webp2.testcase | 7 +
.../sql_stmt_tests/createcov_4bit_palette.testcase | 7 +
.../createcov_4bit_palette1.testcase | 7 +
.../createcov_4bit_palette_gif.testcase | 7 +
.../createcov_4bit_palette_png.testcase | 7 +
test/sql_stmt_tests/createcov_8_mband.testcase | 7 +
test/sql_stmt_tests/createcov_8_mband1.testcase | 7 +
.../createcov_8_mband_deflate.testcase | 7 +
.../sql_stmt_tests/createcov_8_mband_fax3.testcase | 7 +
.../sql_stmt_tests/createcov_8_mband_fax4.testcase | 7 +
test/sql_stmt_tests/createcov_8_mband_gif.testcase | 7 +
.../sql_stmt_tests/createcov_8_mband_jpeg.testcase | 7 +
.../sql_stmt_tests/createcov_8_mband_lzma.testcase | 7 +
test/sql_stmt_tests/createcov_8_mband_png.testcase | 7 +
.../createcov_8_mband_webp1.testcase | 7 +
.../createcov_8_mband_webp2.testcase | 7 +
test/sql_stmt_tests/createcov_double_grid.testcase | 7 +
.../sql_stmt_tests/createcov_double_grid1.testcase | 7 +
.../createcov_double_grid_deflate.testcase | 7 +
.../createcov_double_grid_lzma.testcase | 7 +
test/sql_stmt_tests/createcov_err1.testcase | 7 +
test/sql_stmt_tests/createcov_err10.testcase | 7 +
test/sql_stmt_tests/createcov_err11.testcase | 7 +
test/sql_stmt_tests/createcov_err12.testcase | 7 +
test/sql_stmt_tests/createcov_err2.testcase | 7 +
test/sql_stmt_tests/createcov_err3.testcase | 7 +
test/sql_stmt_tests/createcov_err4.testcase | 7 +
test/sql_stmt_tests/createcov_err5.testcase | 7 +
test/sql_stmt_tests/createcov_err6.testcase | 7 +
test/sql_stmt_tests/createcov_err7.testcase | 7 +
test/sql_stmt_tests/createcov_err8.testcase | 7 +
test/sql_stmt_tests/createcov_err9.testcase | 7 +
test/sql_stmt_tests/createcov_float_grid.testcase | 7 +
test/sql_stmt_tests/createcov_float_grid1.testcase | 7 +
.../createcov_float_grid_deflate.testcase | 7 +
.../createcov_float_grid_lzma.testcase | 7 +
test/sql_stmt_tests/createcov_int16_grid.testcase | 7 +
test/sql_stmt_tests/createcov_int16_grid1.testcase | 7 +
.../createcov_int16_grid_deflate.testcase | 7 +
.../createcov_int16_grid_lzma.testcase | 7 +
test/sql_stmt_tests/createcov_int32_grid.testcase | 7 +
test/sql_stmt_tests/createcov_int32_grid1.testcase | 7 +
.../createcov_int32_grid_deflate.testcase | 7 +
.../createcov_int32_grid_gif.testcase | 7 +
.../createcov_int32_grid_jpeg.testcase | 7 +
.../createcov_int32_grid_lzma.testcase | 7 +
.../createcov_int32_grid_png.testcase | 7 +
.../createcov_int32_grid_webp1.testcase | 7 +
.../createcov_int32_grid_webp2.testcase | 7 +
test/sql_stmt_tests/createcov_int8_grid.testcase | 7 +
test/sql_stmt_tests/createcov_int8_grid1.testcase | 7 +
.../createcov_int8_grid_deflate.testcase | 7 +
.../createcov_int8_grid_lzma.testcase | 7 +
test/sql_stmt_tests/createcov_uint16_grid.testcase | 7 +
.../sql_stmt_tests/createcov_uint16_grid1.testcase | 7 +
.../createcov_uint16_grid_deflate.testcase | 7 +
.../createcov_uint16_grid_lzma.testcase | 7 +
test/sql_stmt_tests/createcov_uint32_grid.testcase | 7 +
.../sql_stmt_tests/createcov_uint32_grid1.testcase | 7 +
.../createcov_uint32_grid_deflate.testcase | 7 +
.../createcov_uint32_grid_lzma.testcase | 7 +
test/sql_stmt_tests/createcov_uint8_gray.testcase | 7 +
.../createcov_uint8_gray_deflate.testcase | 7 +
.../createcov_uint8_gray_fax3.testcase | 7 +
.../createcov_uint8_gray_fax4.testcase | 7 +
.../createcov_uint8_gray_gif.testcase | 7 +
.../createcov_uint8_gray_jpeg.testcase | 7 +
.../createcov_uint8_gray_lzma.testcase | 7 +
.../createcov_uint8_gray_png.testcase | 7 +
.../createcov_uint8_gray_webp1.testcase | 7 +
.../createcov_uint8_gray_webp2.testcase | 7 +
test/sql_stmt_tests/createcov_uint8_grid.testcase | 7 +
test/sql_stmt_tests/createcov_uint8_grid1.testcase | 7 +
.../createcov_uint8_grid_deflate.testcase | 7 +
.../createcov_uint8_grid_lzma.testcase | 7 +
.../createcov_uint8_palette.testcase | 7 +
.../createcov_uint8_palette_deflate.testcase | 7 +
.../createcov_uint8_palette_fax3.testcase | 7 +
.../createcov_uint8_palette_fax4.testcase | 7 +
.../createcov_uint8_palette_gif.testcase | 7 +
.../createcov_uint8_palette_jpeg.testcase | 7 +
.../createcov_uint8_palette_lzma.testcase | 7 +
.../createcov_uint8_palette_png.testcase | 7 +
.../createcov_uint8_palette_webp1.testcase | 7 +
.../createcov_uint8_palette_webp2.testcase | 7 +
test/sql_stmt_tests/createcov_uint8_rgb.testcase | 7 +
test/sql_stmt_tests/createcov_uint8_rgb1.testcase | 7 +
.../createcov_uint8_rgb_deflate.testcase | 7 +
.../createcov_uint8_rgb_fax3.testcase | 7 +
.../createcov_uint8_rgb_fax4.testcase | 7 +
.../createcov_uint8_rgb_gif.testcase | 7 +
.../createcov_uint8_rgb_jpeg.testcase | 7 +
.../createcov_uint8_rgb_lzma.testcase | 7 +
.../createcov_uint8_rgb_png.testcase | 7 +
.../createcov_uint8_rgb_webp1.testcase | 7 +
.../createcov_uint8_rgb_webp2.testcase | 7 +
test/sql_stmt_tests/createpixel1.testcase | 7 +
test/sql_stmt_tests/createpixel10.testcase | 7 +
test/sql_stmt_tests/createpixel11.testcase | 7 +
test/sql_stmt_tests/createpixel12.testcase | 7 +
test/sql_stmt_tests/createpixel13.testcase | 7 +
test/sql_stmt_tests/createpixel2.testcase | 7 +
test/sql_stmt_tests/createpixel3.testcase | 7 +
test/sql_stmt_tests/createpixel4.testcase | 7 +
test/sql_stmt_tests/createpixel5.testcase | 7 +
test/sql_stmt_tests/createpixel6.testcase | 7 +
test/sql_stmt_tests/createpixel7.testcase | 7 +
test/sql_stmt_tests/createpixel8.testcase | 7 +
test/sql_stmt_tests/createpixel9.testcase | 7 +
test/sql_stmt_tests/deletesection1.testcase | 7 +
test/sql_stmt_tests/deletesection2.testcase | 7 +
test/sql_stmt_tests/deletesection3.testcase | 7 +
test/sql_stmt_tests/deletesection4.testcase | 7 +
test/sql_stmt_tests/depyramidize1.testcase | 7 +
test/sql_stmt_tests/depyramidize10.testcase | 7 +
test/sql_stmt_tests/depyramidize11.testcase | 7 +
test/sql_stmt_tests/depyramidize12.testcase | 7 +
test/sql_stmt_tests/depyramidize2.testcase | 7 +
test/sql_stmt_tests/depyramidize3.testcase | 7 +
test/sql_stmt_tests/depyramidize4.testcase | 7 +
test/sql_stmt_tests/depyramidize5.testcase | 7 +
test/sql_stmt_tests/depyramidize6.testcase | 7 +
test/sql_stmt_tests/depyramidize7.testcase | 7 +
test/sql_stmt_tests/depyramidize8.testcase | 7 +
test/sql_stmt_tests/depyramidize9.testcase | 7 +
test/sql_stmt_tests/dropcoverage1.testcase | 7 +
test/sql_stmt_tests/dropcoverage2.testcase | 7 +
test/sql_stmt_tests/dropcoverage3.testcase | 7 +
test/sql_stmt_tests/getbandhistogram1.testcase | 7 +
test/sql_stmt_tests/getbandhistogram2.testcase | 7 +
test/sql_stmt_tests/getbandhistogram3.testcase | 7 +
test/sql_stmt_tests/getbandhistogram4.testcase | 7 +
test/sql_stmt_tests/getbandtileimage1.testcase | 7 +
test/sql_stmt_tests/getbandtileimage10.testcase | 7 +
test/sql_stmt_tests/getbandtileimage11.testcase | 7 +
test/sql_stmt_tests/getbandtileimage12.testcase | 7 +
test/sql_stmt_tests/getbandtileimage2.testcase | 7 +
test/sql_stmt_tests/getbandtileimage3.testcase | 7 +
test/sql_stmt_tests/getbandtileimage4.testcase | 7 +
test/sql_stmt_tests/getbandtileimage5.testcase | 7 +
test/sql_stmt_tests/getbandtileimage6.testcase | 7 +
test/sql_stmt_tests/getbandtileimage7.testcase | 7 +
test/sql_stmt_tests/getbandtileimage8.testcase | 7 +
test/sql_stmt_tests/getbandtileimage9.testcase | 7 +
test/sql_stmt_tests/getmapimage1.testcase | 7 +
test/sql_stmt_tests/getmapimage10.testcase | 7 +
test/sql_stmt_tests/getmapimage12.testcase | 7 +
test/sql_stmt_tests/getmapimage13.testcase | 7 +
test/sql_stmt_tests/getmapimage14.testcase | 7 +
test/sql_stmt_tests/getmapimage15.testcase | 7 +
test/sql_stmt_tests/getmapimage16.testcase | 7 +
test/sql_stmt_tests/getmapimage17.testcase | 7 +
test/sql_stmt_tests/getmapimage18.testcase | 7 +
test/sql_stmt_tests/getmapimage19.testcase | 7 +
test/sql_stmt_tests/getmapimage2.testcase | 7 +
test/sql_stmt_tests/getmapimage20.testcase | 7 +
test/sql_stmt_tests/getmapimage3.testcase | 7 +
test/sql_stmt_tests/getmapimage4.testcase | 7 +
test/sql_stmt_tests/getmapimage5.testcase | 7 +
test/sql_stmt_tests/getmapimage6.testcase | 7 +
test/sql_stmt_tests/getmapimage7.testcase | 7 +
test/sql_stmt_tests/getmapimage8.testcase | 7 +
test/sql_stmt_tests/getmapimage9.testcase | 7 +
test/sql_stmt_tests/getmonotileimage1.testcase | 7 +
test/sql_stmt_tests/getmonotileimage2.testcase | 7 +
test/sql_stmt_tests/getmonotileimage3.testcase | 7 +
test/sql_stmt_tests/getmonotileimage4.testcase | 7 +
test/sql_stmt_tests/getmonotileimage5.testcase | 7 +
test/sql_stmt_tests/getmonotileimage6.testcase | 7 +
test/sql_stmt_tests/getmonotileimage7.testcase | 7 +
test/sql_stmt_tests/getmonotileimage8.testcase | 7 +
test/sql_stmt_tests/getpalettecolorentry1.testcase | 7 +
test/sql_stmt_tests/getpalettecolorentry2.testcase | 7 +
test/sql_stmt_tests/getpalettecolorentry3.testcase | 7 +
test/sql_stmt_tests/getpalettenumentries1.testcase | 7 +
test/sql_stmt_tests/getpalettenumentries2.testcase | 7 +
test/sql_stmt_tests/getpixelnumbands1.testcase | 7 +
test/sql_stmt_tests/getpixelnumbands2.testcase | 7 +
test/sql_stmt_tests/getpixelnumbands3.testcase | 7 +
test/sql_stmt_tests/getpixelnumbands4.testcase | 7 +
test/sql_stmt_tests/getpixelnumbands5.testcase | 7 +
test/sql_stmt_tests/getpixelnumbands6.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype1.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype10.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype11.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype12.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype13.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype14.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype15.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype16.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype2.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype3.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype4.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype5.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype6.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype7.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype8.testcase | 7 +
test/sql_stmt_tests/getpixelsampletype9.testcase | 7 +
test/sql_stmt_tests/getpixeltype1.testcase | 7 +
test/sql_stmt_tests/getpixeltype10.testcase | 7 +
test/sql_stmt_tests/getpixeltype11.testcase | 7 +
test/sql_stmt_tests/getpixeltype2.testcase | 7 +
test/sql_stmt_tests/getpixeltype3.testcase | 7 +
test/sql_stmt_tests/getpixeltype4.testcase | 7 +
test/sql_stmt_tests/getpixeltype5.testcase | 7 +
test/sql_stmt_tests/getpixeltype6.testcase | 7 +
test/sql_stmt_tests/getpixeltype7.testcase | 7 +
test/sql_stmt_tests/getpixeltype8.testcase | 7 +
test/sql_stmt_tests/getpixeltype9.testcase | 7 +
test/sql_stmt_tests/getpixelvalue1.testcase | 7 +
test/sql_stmt_tests/getpixelvalue10.testcase | 7 +
test/sql_stmt_tests/getpixelvalue2.testcase | 7 +
test/sql_stmt_tests/getpixelvalue3.testcase | 7 +
test/sql_stmt_tests/getpixelvalue4.testcase | 7 +
test/sql_stmt_tests/getpixelvalue5.testcase | 7 +
test/sql_stmt_tests/getpixelvalue6.testcase | 7 +
test/sql_stmt_tests/getpixelvalue7.testcase | 7 +
test/sql_stmt_tests/getpixelvalue8.testcase | 7 +
test/sql_stmt_tests/getpixelvalue9.testcase | 7 +
test/sql_stmt_tests/getrasterstats1.testcase | 7 +
test/sql_stmt_tests/getrasterstats10.testcase | 7 +
test/sql_stmt_tests/getrasterstats11.testcase | 7 +
test/sql_stmt_tests/getrasterstats12.testcase | 7 +
test/sql_stmt_tests/getrasterstats13.testcase | 7 +
test/sql_stmt_tests/getrasterstats14.testcase | 7 +
test/sql_stmt_tests/getrasterstats15.testcase | 7 +
test/sql_stmt_tests/getrasterstats16.testcase | 7 +
test/sql_stmt_tests/getrasterstats17.testcase | 7 +
test/sql_stmt_tests/getrasterstats18.testcase | 7 +
test/sql_stmt_tests/getrasterstats19.testcase | 7 +
test/sql_stmt_tests/getrasterstats2.testcase | 7 +
test/sql_stmt_tests/getrasterstats20.testcase | 7 +
test/sql_stmt_tests/getrasterstats21.testcase | 7 +
test/sql_stmt_tests/getrasterstats22.testcase | 7 +
test/sql_stmt_tests/getrasterstats23.testcase | 7 +
test/sql_stmt_tests/getrasterstats24.testcase | 7 +
test/sql_stmt_tests/getrasterstats25.testcase | 7 +
test/sql_stmt_tests/getrasterstats26.testcase | 7 +
test/sql_stmt_tests/getrasterstats3.testcase | 7 +
test/sql_stmt_tests/getrasterstats4.testcase | 7 +
test/sql_stmt_tests/getrasterstats5.testcase | 7 +
test/sql_stmt_tests/getrasterstats6.testcase | 7 +
test/sql_stmt_tests/getrasterstats7.testcase | 7 +
test/sql_stmt_tests/getrasterstats8.testcase | 7 +
test/sql_stmt_tests/getrasterstats9.testcase | 7 +
test/sql_stmt_tests/gettileimage1.testcase | 7 +
test/sql_stmt_tests/gettileimage2.testcase | 7 +
test/sql_stmt_tests/gettileimage3.testcase | 7 +
test/sql_stmt_tests/gettileimage4.testcase | 7 +
test/sql_stmt_tests/gettileimage5.testcase | 7 +
test/sql_stmt_tests/gettileimage6.testcase | 7 +
test/sql_stmt_tests/ispixelopaque1.testcase | 7 +
test/sql_stmt_tests/ispixelopaque2.testcase | 7 +
test/sql_stmt_tests/ispixelopaque3.testcase | 7 +
test/sql_stmt_tests/ispixelopaque4.testcase | 7 +
test/sql_stmt_tests/ispixelopaque5.testcase | 7 +
test/sql_stmt_tests/ispixeltransparent1.testcase | 7 +
test/sql_stmt_tests/ispixeltransparent2.testcase | 7 +
test/sql_stmt_tests/ispixeltransparent3.testcase | 7 +
test/sql_stmt_tests/ispixeltransparent4.testcase | 7 +
test/sql_stmt_tests/ispixeltransparent5.testcase | 7 +
test/sql_stmt_tests/isvalidpalette1.testcase | 7 +
test/sql_stmt_tests/isvalidpalette10.testcase | 7 +
test/sql_stmt_tests/isvalidpalette2.testcase | 7 +
test/sql_stmt_tests/isvalidpalette3.testcase | 7 +
test/sql_stmt_tests/isvalidpalette4.testcase | 7 +
test/sql_stmt_tests/isvalidpalette5.testcase | 7 +
test/sql_stmt_tests/isvalidpalette6.testcase | 7 +
test/sql_stmt_tests/isvalidpalette7.testcase | 7 +
test/sql_stmt_tests/isvalidpalette8.testcase | 7 +
test/sql_stmt_tests/isvalidpalette9.testcase | 7 +
test/sql_stmt_tests/isvalidpixel1.testcase | 7 +
test/sql_stmt_tests/isvalidpixel10.testcase | 7 +
test/sql_stmt_tests/isvalidpixel11.testcase | 7 +
test/sql_stmt_tests/isvalidpixel12.testcase | 7 +
test/sql_stmt_tests/isvalidpixel13.testcase | 7 +
test/sql_stmt_tests/isvalidpixel14.testcase | 7 +
test/sql_stmt_tests/isvalidpixel15.testcase | 7 +
test/sql_stmt_tests/isvalidpixel16.testcase | 7 +
test/sql_stmt_tests/isvalidpixel17.testcase | 7 +
test/sql_stmt_tests/isvalidpixel18.testcase | 7 +
test/sql_stmt_tests/isvalidpixel19.testcase | 7 +
test/sql_stmt_tests/isvalidpixel2.testcase | 7 +
test/sql_stmt_tests/isvalidpixel20.testcase | 7 +
test/sql_stmt_tests/isvalidpixel21.testcase | 7 +
test/sql_stmt_tests/isvalidpixel22.testcase | 7 +
test/sql_stmt_tests/isvalidpixel23.testcase | 7 +
test/sql_stmt_tests/isvalidpixel3.testcase | 7 +
test/sql_stmt_tests/isvalidpixel4.testcase | 7 +
test/sql_stmt_tests/isvalidpixel5.testcase | 7 +
test/sql_stmt_tests/isvalidpixel6.testcase | 7 +
test/sql_stmt_tests/isvalidpixel7.testcase | 7 +
test/sql_stmt_tests/isvalidpixel8.testcase | 7 +
test/sql_stmt_tests/isvalidpixel9.testcase | 7 +
test/sql_stmt_tests/isvalidstats1.testcase | 7 +
test/sql_stmt_tests/isvalidstats10.testcase | 7 +
test/sql_stmt_tests/isvalidstats11.testcase | 7 +
test/sql_stmt_tests/isvalidstats12.testcase | 7 +
test/sql_stmt_tests/isvalidstats13.testcase | 7 +
test/sql_stmt_tests/isvalidstats14.testcase | 7 +
test/sql_stmt_tests/isvalidstats15.testcase | 7 +
test/sql_stmt_tests/isvalidstats16.testcase | 7 +
test/sql_stmt_tests/isvalidstats17.testcase | 7 +
test/sql_stmt_tests/isvalidstats18.testcase | 7 +
test/sql_stmt_tests/isvalidstats2.testcase | 7 +
test/sql_stmt_tests/isvalidstats3.testcase | 7 +
test/sql_stmt_tests/isvalidstats4.testcase | 7 +
test/sql_stmt_tests/isvalidstats5.testcase | 7 +
test/sql_stmt_tests/isvalidstats6.testcase | 7 +
test/sql_stmt_tests/isvalidstats7.testcase | 7 +
test/sql_stmt_tests/isvalidstats8.testcase | 7 +
test/sql_stmt_tests/isvalidstats9.testcase | 7 +
test/sql_stmt_tests/isvalidtile1.testcase | 7 +
test/sql_stmt_tests/isvalidtile2.testcase | 7 +
test/sql_stmt_tests/isvalidtile3.testcase | 7 +
test/sql_stmt_tests/isvalidtile4.testcase | 7 +
test/sql_stmt_tests/paletteequals1.testcase | 7 +
test/sql_stmt_tests/paletteequals2.testcase | 7 +
test/sql_stmt_tests/paletteequals3.testcase | 7 +
test/sql_stmt_tests/pixelequals1.testcase | 7 +
test/sql_stmt_tests/pixelequals2.testcase | 7 +
test/sql_stmt_tests/pixelequals3.testcase | 7 +
test/sql_stmt_tests/pixelequals4.testcase | 7 +
test/sql_stmt_tests/pixelequals5.testcase | 7 +
test/sql_stmt_tests/pixelequals6.testcase | 7 +
test/sql_stmt_tests/pixelequals7.testcase | 7 +
test/sql_stmt_tests/pixelequals8.testcase | 7 +
test/sql_stmt_tests/pyramidize1.testcase | 7 +
test/sql_stmt_tests/pyramidize10.testcase | 7 +
test/sql_stmt_tests/pyramidize11.testcase | 7 +
test/sql_stmt_tests/pyramidize12.testcase | 7 +
test/sql_stmt_tests/pyramidize13.testcase | 7 +
test/sql_stmt_tests/pyramidize14.testcase | 7 +
test/sql_stmt_tests/pyramidize15.testcase | 7 +
test/sql_stmt_tests/pyramidize16.testcase | 7 +
test/sql_stmt_tests/pyramidize2.testcase | 7 +
test/sql_stmt_tests/pyramidize3.testcase | 7 +
test/sql_stmt_tests/pyramidize4.testcase | 7 +
test/sql_stmt_tests/pyramidize5.testcase | 7 +
test/sql_stmt_tests/pyramidize6.testcase | 7 +
test/sql_stmt_tests/pyramidize7.testcase | 7 +
test/sql_stmt_tests/pyramidize8.testcase | 7 +
test/sql_stmt_tests/pyramidize9.testcase | 7 +
test/sql_stmt_tests/setcoverageinfos1.testcase | 7 +
test/sql_stmt_tests/setcoverageinfos2.testcase | 7 +
test/sql_stmt_tests/setcoverageinfos3.testcase | 7 +
test/sql_stmt_tests/setcoverageinfos4.testcase | 7 +
test/sql_stmt_tests/setpalettecolorentry1.testcase | 7 +
test/sql_stmt_tests/setpalettecolorentry2.testcase | 7 +
test/sql_stmt_tests/setpalettecolorentry3.testcase | 7 +
test/sql_stmt_tests/setpalettecolorentry4.testcase | 7 +
test/sql_stmt_tests/setpixelopaque1.testcase | 7 +
test/sql_stmt_tests/setpixelopaque2.testcase | 7 +
test/sql_stmt_tests/setpixeltransparent1.testcase | 7 +
test/sql_stmt_tests/setpixeltransparent2.testcase | 7 +
test/sql_stmt_tests/setpixelvalue1.testcase | 7 +
test/sql_stmt_tests/setpixelvalue10.testcase | 7 +
test/sql_stmt_tests/setpixelvalue11.testcase | 7 +
test/sql_stmt_tests/setpixelvalue12.testcase | 7 +
test/sql_stmt_tests/setpixelvalue13.testcase | 7 +
test/sql_stmt_tests/setpixelvalue14.testcase | 7 +
test/sql_stmt_tests/setpixelvalue15.testcase | 7 +
test/sql_stmt_tests/setpixelvalue16.testcase | 7 +
test/sql_stmt_tests/setpixelvalue17.testcase | 7 +
test/sql_stmt_tests/setpixelvalue18.testcase | 7 +
test/sql_stmt_tests/setpixelvalue19.testcase | 7 +
test/sql_stmt_tests/setpixelvalue2.testcase | 7 +
test/sql_stmt_tests/setpixelvalue20.testcase | 7 +
test/sql_stmt_tests/setpixelvalue21.testcase | 7 +
test/sql_stmt_tests/setpixelvalue22.testcase | 7 +
test/sql_stmt_tests/setpixelvalue23.testcase | 7 +
test/sql_stmt_tests/setpixelvalue24.testcase | 7 +
test/sql_stmt_tests/setpixelvalue25.testcase | 7 +
test/sql_stmt_tests/setpixelvalue3.testcase | 7 +
test/sql_stmt_tests/setpixelvalue4.testcase | 7 +
test/sql_stmt_tests/setpixelvalue5.testcase | 7 +
test/sql_stmt_tests/setpixelvalue6.testcase | 7 +
test/sql_stmt_tests/setpixelvalue7.testcase | 7 +
test/sql_stmt_tests/setpixelvalue8.testcase | 7 +
test/sql_stmt_tests/setpixelvalue9.testcase | 7 +
test/sql_stmt_tests/targetcpu.testcase | 7 +
test/sql_stmt_tests/testpixel_1bit_mono.testcase | 7 +
test/sql_stmt_tests/testpixel_1bit_plt.testcase | 7 +
test/sql_stmt_tests/testpixel_2bit_gray.testcase | 7 +
test/sql_stmt_tests/testpixel_2bit_plt.testcase | 7 +
test/sql_stmt_tests/testpixel_4bit_gray.testcase | 7 +
test/sql_stmt_tests/testpixel_4bit_plt.testcase | 7 +
test/sql_stmt_tests/testpixel_double_grid.testcase | 7 +
test/sql_stmt_tests/testpixel_float_grid.testcase | 7 +
test/sql_stmt_tests/testpixel_int16_grid.testcase | 7 +
test/sql_stmt_tests/testpixel_int32_grid.testcase | 7 +
test/sql_stmt_tests/testpixel_int8_grid.testcase | 7 +
test/sql_stmt_tests/testpixel_uint16_grid.testcase | 7 +
.../sql_stmt_tests/testpixel_uint16_mband.testcase | 7 +
test/sql_stmt_tests/testpixel_uint16_rgb.testcase | 7 +
test/sql_stmt_tests/testpixel_uint32_grid.testcase | 7 +
test/sql_stmt_tests/testpixel_uint8_gray.testcase | 7 +
test/sql_stmt_tests/testpixel_uint8_grid.testcase | 7 +
test/sql_stmt_tests/testpixel_uint8_mband.testcase | 7 +
test/sql_stmt_tests/testpixel_uint8_plt.testcase | 7 +
test/sql_stmt_tests/testpixel_uint8_rgb.testcase | 7 +
test/srtm_brightness.xml | 77 +
test/srtm_categ.xml | 47 +
test/srtm_interp.xml | 74 +
test/srtm_relief_25.xml | 77 +
test/srtm_relief_75.xml | 77 +
test/supermarket.svg | 143 +
test/test1.c | 1352 ++
test/test10.c | 607 +
test/test11.c | 387 +
test/test12.c | 387 +
test/test13.c | 462 +
test/test14.c | 463 +
test/test15.c | 456 +
test/test16.c | 457 +
test/test17.c | 460 +
test/test18.c | 460 +
test/test19.c | 588 +
test/test2.c | 988 +
test/test20.c | 588 +
test/test3.c | 627 +
test/test4.c | 896 +
test/test5.c | 881 +
test/test6.c | 637 +
test/test7.c | 841 +
test/test8.c | 661 +
test/test9.c | 608 +
test/test_coverage.c | 1299 ++
test/test_gif.c | 79 +
test/test_load_wms.c | 429 +
test/test_map_ascii.c | 1461 ++
test/test_map_gray.c | 1168 ++
test/test_map_indiana.c | 924 +
test/test_map_infrared.c | 1644 ++
test/test_map_mono.c | 1177 ++
test/test_map_nile_32.c | 417 +
test/test_map_nile_8.c | 416 +
test/test_map_nile_dbl.c | 416 +
test/test_map_nile_flt.c | 416 +
test/test_map_nile_u16.c | 417 +
test/test_map_nile_u32.c | 417 +
test/test_map_nile_u8.c | 417 +
test/test_map_noref.c | 859 +
test/test_map_orbetello.c | 1989 ++
test/test_map_rgb.c | 1360 ++
test/test_map_srtm.c | 2056 ++
test/test_map_trento.c | 1039 +
test/test_map_trieste.c | 898 +
test/test_mask.c | 1157 ++
test/test_paint.c | 534 +
test/test_palette.c | 813 +
test/test_raster.c | 1862 ++
test/test_raster_symbolizer.c | 1643 ++
test/test_section.c | 340 +
test/test_svg.c | 282 +
test/test_tifin.c | 618 +
test/test_under_valgrind.sh | 6 +
test/test_webp.c | 641 +
test/test_wms1.c | 1811 ++
test/test_wms2.c | 664 +
test/test_wr_tiff.c | 6051 ++++++
test/tobacco.svg | 382 +
test/webp_no_alpha.webp | Bin 0 -> 4928 bytes
tools/Makefile.am | 32 +
tools/Makefile.in | 666 +
tools/rl2tool.c | 4241 ++++
tools/wmslite.c | 4228 ++++
930 files changed, 224240 insertions(+)
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..bf74b02
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,3 @@
+Original Author:
+Alessandro Furieri <a.furieri at lqt.it>
+
diff --git a/Android_R4.2.0.mk b/Android_R4.2.0.mk
new file mode 100644
index 0000000..37e6bfc
--- /dev/null
+++ b/Android_R4.2.0.mk
@@ -0,0 +1,50 @@
+# -------------------
+# Android_R4.2.0.mk
+# ndk-build clean
+# ndk-build
+# -------------------
+LOCAL_PATH := $(call my-dir)
+JSQLITE_PATH := javasqlite-20120209
+SPATIALITE_PATH := libspatialite-4.2.0-rc1
+GEOS_PATH := geos-3.4.2
+PROJ4_PATH := proj-4.8.0
+SQLITE_PATH := sqlite-amalgamation-3080403
+ICONV_PATH := libiconv-1.13.1
+RASTERLITE2_PATH := librasterlite2-4.2.0
+GEOTIFF_PATH := libgeotiff-1.4.0
+TIFF_PATH := tiff-4.0.3/libtiff
+JPEG_PATH := jpeg-8d
+GIF_PATH := giflib-5.0.6/lib
+CAIRO_PATH := cairo-1.12.14/src
+FREETYPE_PATH := freetype-2.5.3
+FONTCONFIG_PATH := fontconfig-2.11.1
+EXPAT_PATH := expat-2.1.0
+PIXMAN_PATH := pixman-0.32.4
+PNG_PATH := libpng-1.6.10
+WEBP_PATH := libwebp-0.4.0
+XML2_PATH := libxml2-2.9.1
+CURL_PATH := curl-7.36.0
+LZMA_PATH := xz-5.1.3alpha
+
+include $(LOCAL_PATH)/jsqlite-R4.2.0.mk
+include $(LOCAL_PATH)/iconv-1.13.1.mk
+include $(LOCAL_PATH)/sqlite-3080403.mk
+include $(LOCAL_PATH)/proj4-4.8.0.mk
+include $(LOCAL_PATH)/geos-3.4.2.mk
+include $(LOCAL_PATH)/spatialite-4.2.0.mk
+include $(LOCAL_PATH)/libjpeg-8d.mk
+include $(LOCAL_PATH)/giflib-5.0.6.mk
+include $(LOCAL_PATH)/libpng-1.6.10.mk
+include $(LOCAL_PATH)/libtiff-4.0.3.mk
+include $(LOCAL_PATH)/libwebp-0.4.0.mk
+include $(LOCAL_PATH)/pixman-0.32.4.mk
+include $(LOCAL_PATH)/freetype-2.5.3.mk
+include $(LOCAL_PATH)/fontconfig-2.11.1.mk
+include $(LOCAL_PATH)/expat-2.1.0.mk
+include $(LOCAL_PATH)/cairo-1.12.14.mk
+include $(LOCAL_PATH)/libgeotiff-1.4.0.mk
+include $(LOCAL_PATH)/libxml2-2.9.1.mk
+include $(LOCAL_PATH)/libcurl-7.36.0.mk
+include $(LOCAL_PATH)/lzma-xz-5.1.3a.mk
+include $(LOCAL_PATH)/rasterlite2-4.2.0.mk
+$(call import-module,android/cpufeatures)
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..c4777aa
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,473 @@
+ MOZILLA PUBLIC LICENSE
+ Version 1.1
+
+ ---------------
+
+1. Definitions.
+
+ 1.0.1. "Commercial Use" means distribution or otherwise making the
+ Covered Code available to a third party.
+
+ 1.1. "Contributor" means each entity that creates or contributes to
+ the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the Original
+ Code, prior Modifications used by a Contributor, and the Modifications
+ made by that particular Contributor.
+
+ 1.3. "Covered Code" means the Original Code or Modifications or the
+ combination of the Original Code and Modifications, in each case
+ including portions thereof.
+
+ 1.4. "Electronic Distribution Mechanism" means a mechanism generally
+ accepted in the software development community for the electronic
+ transfer of data.
+
+ 1.5. "Executable" means Covered Code in any form other than Source
+ Code.
+
+ 1.6. "Initial Developer" means the individual or entity identified
+ as the Initial Developer in the Source Code notice required by Exhibit
+ A.
+
+ 1.7. "Larger Work" means a work which combines Covered Code or
+ portions thereof with code not governed by the terms of this License.
+
+ 1.8. "License" means this document.
+
+ 1.8.1. "Licensable" means having the right to grant, to the maximum
+ extent possible, whether at the time of the initial grant or
+ subsequently acquired, any and all of the rights conveyed herein.
+
+ 1.9. "Modifications" means any addition to or deletion from the
+ substance or structure of either the Original Code or any previous
+ Modifications. When Covered Code is released as a series of files, a
+ Modification is:
+ A. Any addition to or deletion from the contents of a file
+ containing Original Code or previous Modifications.
+
+ B. Any new file that contains any part of the Original Code or
+ previous Modifications.
+
+ 1.10. "Original Code" means Source Code of computer software code
+ which is described in the Source Code notice required by Exhibit A as
+ Original Code, and which, at the time of its release under this
+ License is not already Covered Code governed by this License.
+
+ 1.10.1. "Patent Claims" means any patent claim(s), now owned or
+ hereafter acquired, including without limitation, method, process,
+ and apparatus claims, in any patent Licensable by grantor.
+
+ 1.11. "Source Code" means the preferred form of the Covered Code for
+ making modifications to it, including all modules it contains, plus
+ any associated interface definition files, scripts used to control
+ compilation and installation of an Executable, or source code
+ differential comparisons against either the Original Code or another
+ well known, available Covered Code of the Contributor's choice. The
+ Source Code can be in a compressed or archival form, provided the
+ appropriate decompression or de-archiving software is widely available
+ for no charge.
+
+ 1.12. "You" (or "Your") means an individual or a legal entity
+ exercising rights under, and complying with all of the terms of, this
+ License or a future version of this License issued under Section 6.1.
+ For legal entities, "You" includes any entity which controls, is
+ controlled by, or is under common control with You. For purposes of
+ this definition, "control" means (a) the power, direct or indirect,
+ to cause the direction or management of such entity, whether by
+ contract or otherwise, or (b) ownership of more than fifty percent
+ (50%) of the outstanding shares or beneficial ownership of such
+ entity.
+
+2. Source Code License.
+
+ 2.1. The Initial Developer Grant.
+ The Initial Developer hereby grants You a world-wide, royalty-free,
+ non-exclusive license, subject to third party intellectual property
+ claims:
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Initial Developer to use, reproduce,
+ modify, display, perform, sublicense and distribute the Original
+ Code (or portions thereof) with or without Modifications, and/or
+ as part of a Larger Work; and
+
+ (b) under Patents Claims infringed by the making, using or
+ selling of Original Code, to make, have made, use, practice,
+ sell, and offer for sale, and/or otherwise dispose of the
+ Original Code (or portions thereof).
+
+ (c) the licenses granted in this Section 2.1(a) and (b) are
+ effective on the date Initial Developer first distributes
+ Original Code under the terms of this License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent license is
+ granted: 1) for code that You delete from the Original Code; 2)
+ separate from the Original Code; or 3) for infringements caused
+ by: i) the modification of the Original Code or ii) the
+ combination of the Original Code with other software or devices.
+
+ 2.2. Contributor Grant.
+ Subject to third party intellectual property claims, each Contributor
+ hereby grants You a world-wide, royalty-free, non-exclusive license
+
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Contributor, to use, reproduce, modify,
+ display, perform, sublicense and distribute the Modifications
+ created by such Contributor (or portions thereof) either on an
+ unmodified basis, with other Modifications, as Covered Code
+ and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using, or
+ selling of Modifications made by that Contributor either alone
+ and/or in combination with its Contributor Version (or portions
+ of such combination), to make, use, sell, offer for sale, have
+ made, and/or otherwise dispose of: 1) Modifications made by that
+ Contributor (or portions thereof); and 2) the combination of
+ Modifications made by that Contributor with its Contributor
+ Version (or portions of such combination).
+
+ (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+ effective on the date Contributor first makes Commercial Use of
+ the Covered Code.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent license is
+ granted: 1) for any code that Contributor has deleted from the
+ Contributor Version; 2) separate from the Contributor Version;
+ 3) for infringements caused by: i) third party modifications of
+ Contributor Version or ii) the combination of Modifications made
+ by that Contributor with other software (except as part of the
+ Contributor Version) or other devices; or 4) under Patent Claims
+ infringed by Covered Code in the absence of Modifications made by
+ that Contributor.
+
+3. Distribution Obligations.
+
+ 3.1. Application of License.
+ The Modifications which You create or to which You contribute are
+ governed by the terms of this License, including without limitation
+ Section 2.2. The Source Code version of Covered Code may be
+ distributed only under the terms of this License or a future version
+ of this License released under Section 6.1, and You must include a
+ copy of this License with every copy of the Source Code You
+ distribute. You may not offer or impose any terms on any Source Code
+ version that alters or restricts the applicable version of this
+ License or the recipients' rights hereunder. However, You may include
+ an additional document offering the additional rights described in
+ Section 3.5.
+
+ 3.2. Availability of Source Code.
+ Any Modification which You create or to which You contribute must be
+ made available in Source Code form under the terms of this License
+ either on the same media as an Executable version or via an accepted
+ Electronic Distribution Mechanism to anyone to whom you made an
+ Executable version available; and if made available via Electronic
+ Distribution Mechanism, must remain available for at least twelve (12)
+ months after the date it initially became available, or at least six
+ (6) months after a subsequent version of that particular Modification
+ has been made available to such recipients. You are responsible for
+ ensuring that the Source Code version remains available even if the
+ Electronic Distribution Mechanism is maintained by a third party.
+
+ 3.3. Description of Modifications.
+ You must cause all Covered Code to which You contribute to contain a
+ file documenting the changes You made to create that Covered Code and
+ the date of any change. You must include a prominent statement that
+ the Modification is derived, directly or indirectly, from Original
+ Code provided by the Initial Developer and including the name of the
+ Initial Developer in (a) the Source Code, and (b) in any notice in an
+ Executable version or related documentation in which You describe the
+ origin or ownership of the Covered Code.
+
+ 3.4. Intellectual Property Matters
+ (a) Third Party Claims.
+ If Contributor has knowledge that a license under a third party's
+ intellectual property rights is required to exercise the rights
+ granted by such Contributor under Sections 2.1 or 2.2,
+ Contributor must include a text file with the Source Code
+ distribution titled "LEGAL" which describes the claim and the
+ party making the claim in sufficient detail that a recipient will
+ know whom to contact. If Contributor obtains such knowledge after
+ the Modification is made available as described in Section 3.2,
+ Contributor shall promptly modify the LEGAL file in all copies
+ Contributor makes available thereafter and shall take other steps
+ (such as notifying appropriate mailing lists or newsgroups)
+ reasonably calculated to inform those who received the Covered
+ Code that new knowledge has been obtained.
+
+ (b) Contributor APIs.
+ If Contributor's Modifications include an application programming
+ interface and Contributor has knowledge of patent licenses which
+ are reasonably necessary to implement that API, Contributor must
+ also include this information in the LEGAL file.
+
+ (c) Representations.
+ Contributor represents that, except as disclosed pursuant to
+ Section 3.4(a) above, Contributor believes that Contributor's
+ Modifications are Contributor's original creation(s) and/or
+ Contributor has sufficient rights to grant the rights conveyed by
+ this License.
+
+ 3.5. Required Notices.
+ You must duplicate the notice in Exhibit A in each file of the Source
+ Code. If it is not possible to put such notice in a particular Source
+ Code file due to its structure, then You must include such notice in a
+ location (such as a relevant directory) where a user would be likely
+ to look for such a notice. If You created one or more Modification(s)
+ You may add your name as a Contributor to the notice described in
+ Exhibit A. You must also duplicate this License in any documentation
+ for the Source Code where You describe recipients' rights or ownership
+ rights relating to Covered Code. You may choose to offer, and to
+ charge a fee for, warranty, support, indemnity or liability
+ obligations to one or more recipients of Covered Code. However, You
+ may do so only on Your own behalf, and not on behalf of the Initial
+ Developer or any Contributor. You must make it absolutely clear than
+ any such warranty, support, indemnity or liability obligation is
+ offered by You alone, and You hereby agree to indemnify the Initial
+ Developer and every Contributor for any liability incurred by the
+ Initial Developer or such Contributor as a result of warranty,
+ support, indemnity or liability terms You offer.
+
+ 3.6. Distribution of Executable Versions.
+ You may distribute Covered Code in Executable form only if the
+ requirements of Section 3.1-3.5 have been met for that Covered Code,
+ and if You include a notice stating that the Source Code version of
+ the Covered Code is available under the terms of this License,
+ including a description of how and where You have fulfilled the
+ obligations of Section 3.2. The notice must be conspicuously included
+ in any notice in an Executable version, related documentation or
+ collateral in which You describe recipients' rights relating to the
+ Covered Code. You may distribute the Executable version of Covered
+ Code or ownership rights under a license of Your choice, which may
+ contain terms different from this License, provided that You are in
+ compliance with the terms of this License and that the license for the
+ Executable version does not attempt to limit or alter the recipient's
+ rights in the Source Code version from the rights set forth in this
+ License. If You distribute the Executable version under a different
+ license You must make it absolutely clear that any terms which differ
+ from this License are offered by You alone, not by the Initial
+ Developer or any Contributor. You hereby agree to indemnify the
+ Initial Developer and every Contributor for any liability incurred by
+ the Initial Developer or such Contributor as a result of any such
+ terms You offer.
+
+ 3.7. Larger Works.
+ You may create a Larger Work by combining Covered Code with other code
+ not governed by the terms of this License and distribute the Larger
+ Work as a single product. In such a case, You must make sure the
+ requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+ If it is impossible for You to comply with any of the terms of this
+ License with respect to some or all of the Covered Code due to
+ statute, judicial order, or regulation then You must: (a) comply with
+ the terms of this License to the maximum extent possible; and (b)
+ describe the limitations and the code they affect. Such description
+ must be included in the LEGAL file described in Section 3.4 and must
+ be included with all distributions of the Source Code. Except to the
+ extent prohibited by statute or regulation, such description must be
+ sufficiently detailed for a recipient of ordinary skill to be able to
+ understand it.
+
+5. Application of this License.
+
+ This License applies to code to which the Initial Developer has
+ attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+ 6.1. New Versions.
+ Netscape Communications Corporation ("Netscape") may publish revised
+ and/or new versions of the License from time to time. Each version
+ will be given a distinguishing version number.
+
+ 6.2. Effect of New Versions.
+ Once Covered Code has been published under a particular version of the
+ License, You may always continue to use it under the terms of that
+ version. You may also choose to use such Covered Code under the terms
+ of any subsequent version of the License published by Netscape. No one
+ other than Netscape has the right to modify the terms applicable to
+ Covered Code created under this License.
+
+ 6.3. Derivative Works.
+ If You create or use a modified version of this License (which you may
+ only do in order to apply it to code which is not already Covered Code
+ governed by this License), You must (a) rename Your license so that
+ the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+ "MPL", "NPL" or any confusingly similar phrase do not appear in your
+ license (except to note that your license differs from this License)
+ and (b) otherwise make it clear that Your version of the license
+ contains terms which differ from the Mozilla Public License and
+ Netscape Public License. (Filling in the name of the Initial
+ Developer, Original Code or Contributor in the notice described in
+ Exhibit A shall not of themselves be deemed to be modifications of
+ this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+ DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+ THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+ IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+ YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+ COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+ OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+ 8.1. This License and the rights granted hereunder will terminate
+ automatically if You fail to comply with terms herein and fail to cure
+ such breach within 30 days of becoming aware of the breach. All
+ sublicenses to the Covered Code which are properly granted shall
+ survive any termination of this License. Provisions which, by their
+ nature, must remain in effect beyond the termination of this License
+ shall survive.
+
+ 8.2. If You initiate litigation by asserting a patent infringement
+ claim (excluding declatory judgment actions) against Initial Developer
+ or a Contributor (the Initial Developer or Contributor against whom
+ You file such action is referred to as "Participant") alleging that:
+
+ (a) such Participant's Contributor Version directly or indirectly
+ infringes any patent, then any and all rights granted by such
+ Participant to You under Sections 2.1 and/or 2.2 of this License
+ shall, upon 60 days notice from Participant terminate prospectively,
+ unless if within 60 days after receipt of notice You either: (i)
+ agree in writing to pay Participant a mutually agreeable reasonable
+ royalty for Your past and future use of Modifications made by such
+ Participant, or (ii) withdraw Your litigation claim with respect to
+ the Contributor Version against such Participant. If within 60 days
+ of notice, a reasonable royalty and payment arrangement are not
+ mutually agreed upon in writing by the parties or the litigation claim
+ is not withdrawn, the rights granted by Participant to You under
+ Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+ the 60 day notice period specified above.
+
+ (b) any software, hardware, or device, other than such Participant's
+ Contributor Version, directly or indirectly infringes any patent, then
+ any rights granted to You by such Participant under Sections 2.1(b)
+ and 2.2(b) are revoked effective as of the date You first made, used,
+ sold, distributed, or had made, Modifications made by that
+ Participant.
+
+ 8.3. If You assert a patent infringement claim against Participant
+ alleging that such Participant's Contributor Version directly or
+ indirectly infringes any patent where such claim is resolved (such as
+ by license or settlement) prior to the initiation of patent
+ infringement litigation, then the reasonable value of the licenses
+ granted by such Participant under Sections 2.1 or 2.2 shall be taken
+ into account in determining the amount or value of any payment or
+ license.
+
+ 8.4. In the event of termination under Sections 8.1 or 8.2 above,
+ all end user license agreements (excluding distributors and resellers)
+ which have been validly granted by You or any distributor hereunder
+ prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+ (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+ DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+ OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+ ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+ CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+ WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+ COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+ INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+ LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+ RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+ PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+ EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+ THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+ The Covered Code is a "commercial item," as that term is defined in
+ 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+ software" and "commercial computer software documentation," as such
+ terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+ C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+ all U.S. Government End Users acquire Covered Code with only those
+ rights set forth herein.
+
+11. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the extent
+ necessary to make it enforceable. This License shall be governed by
+ California law provisions (except to the extent applicable law, if
+ any, provides otherwise), excluding its conflict-of-law provisions.
+ With respect to disputes in which at least one party is a citizen of,
+ or an entity chartered or registered to do business in the United
+ States of America, any litigation relating to this License shall be
+ subject to the jurisdiction of the Federal Courts of the Northern
+ District of California, with venue lying in Santa Clara County,
+ California, with the losing party responsible for costs, including
+ without limitation, court costs and reasonable attorneys' fees and
+ expenses. The application of the United Nations Convention on
+ Contracts for the International Sale of Goods is expressly excluded.
+ Any law or regulation which provides that the language of a contract
+ shall be construed against the drafter shall not apply to this
+ License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is
+ responsible for claims and damages arising, directly or indirectly,
+ out of its utilization of rights under this License and You agree to
+ work with Initial Developer and Contributors to distribute such
+ responsibility on an equitable basis. Nothing herein is intended or
+ shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+ Initial Developer may designate portions of the Covered Code as
+ "Multiple-Licensed". "Multiple-Licensed" means that the Initial
+ Developer permits you to utilize portions of the Covered Code under
+ Your choice of the NPL or the alternative licenses, if any, specified
+ by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+ ``The contents of this file are subject to the Mozilla Public License
+ Version 1.1 (the "License"); you may not use this file except in
+ compliance with the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ License for the specific language governing rights and limitations
+ under the License.
+
+ The Original Code is the FreeXL library.
+
+ The Initial Developer of the Original Code is Alessandro Furieri.
+ Portions created by the Initial Developer are Copyright (C) 2011
+ the Initial Developer. All Rights Reserved.
+
+ Contributor(s):
+ Brad Hards <bradh at frogmouth.net>
+
+
+ Alternatively, the contents of this file may be used under the terms of
+ either the GNU General Public License Version 2 or later (the "GPL"), or
+ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ in which case the provisions of the GPL or the LGPL are applicable instead
+ of those above. If you wish to allow use of your version of this file only
+ under the terms of either the GPL or the LGPL, and not to allow others to
+ use your version of this file under the terms of the MPL, indicate your
+ decision by deleting the provisions above and replace them with the notice
+ and other provisions required by the GPL or the LGPL. If you do not delete
+ the provisions above, a recipient may use your version of this file under
+ the terms of any one of the MPL, the GPL or the LGPL.
+
+ [NOTE: The text of this Exhibit A may differ slightly from the text of
+ the notices in the Source Code files of the Original Code. You should
+ use the text of this Exhibit A rather than the text found in the
+ Original Code Source Code for Your Modifications.]
+
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..c0725dd
Binary files /dev/null and b/ChangeLog differ
diff --git a/Doxyfile.in b/Doxyfile.in
new file mode 100644
index 0000000..00d7214
--- /dev/null
+++ b/Doxyfile.in
@@ -0,0 +1,1681 @@
+# Doxyfile 1.7.3
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = RasterLite2
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = @VERSION@
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description for a project that appears at the top of each page and should give viewer a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY =
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even if there is only one candidate or it is obvious which candidate to choose by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = headers/rasterlite2.h \
+ examples/examples.doxy \
+ mainpage.doxy
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH = examples
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH = images
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the stylesheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [0,1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+# Note that a value of 0 will completely suppress the enum values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the mathjax.org site, so you can quickly see the result without installing
+# MathJax, but it is strongly recommended to install a local copy of MathJax
+# before deployment.
+
+MATHJAX_RELPATH = http://www.mathjax.org/mathjax
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
+# By default doxygen will write a font called Helvetica to the output
+# directory and reference it in all dot files that doxygen generates.
+# When you want a differently looking font you can specify the font name
+# using DOT_FONTNAME. You need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, svg, gif or svg.
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = YES
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..50dbe43
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,183 @@
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/Makefile-static-MinGW b/Makefile-static-MinGW
new file mode 100644
index 0000000..8e593e9
--- /dev/null
+++ b/Makefile-static-MinGW
@@ -0,0 +1,76 @@
+# SandroFurieri (c) 2014
+# Makefile RasterLite2 statically linked CLI-tools [Win MSYS/MinGW]
+
+CFLAGS = -Wall -Wextra -Wunused -pedantic -I/usr/local/include
+GG = g++
+CC = gcc
+
+all: ./static_bin/rl2tool.exe ./static_bin/wmslite.exe
+
+./static_bin/rl2tool.exe: ./tools/rl2tool.o
+ $(GG) ./tools/rl2tool.o -o ./static_bin/rl2tool.exe \
+ /usr/local/lib/librasterlite2.a \
+ /usr/local/lib/libspatialite.a \
+ /usr/local/lib/libsqlite3.a \
+ /usr/local/lib/liblwgeom.a \
+ /usr/local/lib/libproj.a \
+ /usr/local/lib/libgeos_c.a \
+ /usr/local/lib/libgeos.a \
+ /usr/local/lib/libfreexl.a \
+ /usr/local/lib/libcairo.a \
+ /usr/local/lib/libpixman-1.a \
+ /usr/local/lib/libfontconfig.a \
+ /usr/local/lib/libfreetype.a \
+ /usr/local/lib/libgif.a \
+ /usr/local/lib/libwebp.a \
+ /usr/local/lib/libjpeg.a \
+ /usr/local/lib/libgeotiff.a \
+ /usr/local/lib/libtiff.a \
+ /usr/local/lib/libpng.a \
+ /usr/local/lib/libcurl.a \
+ /usr/local/lib/libssl.a \
+ /usr/local/lib/libcrypto.a \
+ /usr/local/lib/libxml2.a \
+ /usr/local/lib/libexpat.a \
+ /usr/local/lib/liblzma.a \
+ /usr/local/lib/libz.a \
+ /usr/local/lib/libiconv.a \
+ -lm -lmsimg32 -lws2_32 -lgdi32 -lwldap32 -static-libstdc++ -static-libgcc
+ strip --strip-all ./static_bin/rl2tool.exe
+
+./static_bin/wmslite.exe: ./tools/wmslite.o
+ $(GG) ./tools/wmslite.o -o ./static_bin/wmslite.exe \
+ /usr/local/lib/librasterlite2.a \
+ /usr/local/lib/libspatialite.a \
+ /usr/local/lib/libsqlite3.a \
+ /usr/local/lib/liblwgeom.a \
+ /usr/local/lib/libproj.a \
+ /usr/local/lib/libgeos_c.a \
+ /usr/local/lib/libgeos.a \
+ /usr/local/lib/libfreexl.a \
+ /usr/local/lib/libcairo.a \
+ /usr/local/lib/libpixman-1.a \
+ /usr/local/lib/libfontconfig.a \
+ /usr/local/lib/libfreetype.a \
+ /usr/local/lib/libgif.a \
+ /usr/local/lib/libwebp.a \
+ /usr/local/lib/libjpeg.a \
+ /usr/local/lib/libgeotiff.a \
+ /usr/local/lib/libtiff.a \
+ /usr/local/lib/libpng.a \
+ /usr/local/lib/libcurl.a \
+ /usr/local/lib/libssl.a \
+ /usr/local/lib/libcrypto.a \
+ /usr/local/lib/libxml2.a \
+ /usr/local/lib/libexpat.a \
+ /usr/local/lib/liblzma.a \
+ /usr/local/lib/libz.a \
+ /usr/local/lib/libiconv.a \
+ -lm -lmsimg32 -lws2_32 -lgdi32 -lwldap32 -static-libstdc++ -static-libgcc
+ strip --strip-all ./static_bin/wmslite.exe
+
+./tools/rl2tool.o:
+ $(CC) $(CFLAGS) ./tools/rl2tool.c -c
+
+./tools/wmslite.o:
+ $(CC) $(CFLAGS) ./tools/wmslite.c -c
\ No newline at end of file
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..dba724a
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,20 @@
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS = headers src test tools examples
+
+EXTRA_DIST = mainpage.doxy Android_R4.2.0.mk rasterlite2-4.2.0.mk \
+ Makefile-static-MinGW
+
+AUTOMAKE_OPTIONS = dist-zip
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = rasterlite2.pc
+
+coverage-init:
+ lcov --directory src --capture --initial --output-file rasterlite2_cov.info
+
+coverage::
+ lcov --directory src --output-file rasterlite2_cov.info --capture
+ genhtml -o covresults rasterlite2_cov.info
+
+MOSTLYCLEANFILES = rasterlite2_cov.info
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..2e54ff3
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,888 @@
+# Makefile.in generated by automake 1.13.4 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.
+
+ at 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@
+pkgincludedir = $(includedir)/@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 = .
+DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
+ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/configure $(am__configure_deps) \
+ $(srcdir)/config.h.in $(srcdir)/Doxyfile.in \
+ $(srcdir)/rasterlite2.pc.in COPYING config.guess config.sub \
+ depcomp install-sh missing ltmain.sh
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(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)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = Doxyfile rasterlite2.pc
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+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)$(pkgconfigdir)"
+DATA = $(pkgconfig_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.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
+CSCOPE = cscope
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).zip
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip dist-zip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAIRO_CFLAGS = @LIBCAIRO_CFLAGS@
+LIBCAIRO_LIBS = @LIBCAIRO_LIBS@
+LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@
+LIBLZMA_LIBS = @LIBLZMA_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
+LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
+LIBTOOL = @LIBTOOL@
+LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@
+LIBWEBP_LIBS = @LIBWEBP_LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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_CXX = @ac_ct_CXX@
+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@
+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@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = headers src test tools examples
+EXTRA_DIST = mainpage.doxy Android_R4.2.0.mk rasterlite2-4.2.0.mk \
+ Makefile-static-MinGW
+
+AUTOMAKE_OPTIONS = dist-zip
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = rasterlite2.pc
+MOSTLYCLEANFILES = rasterlite2_cov.info
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @if test ! -f $@; then rm -f stamp-h1; else :; fi
+ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+rasterlite2.pc: $(top_builddir)/config.status $(srcdir)/rasterlite2.pc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+install-pkgconfigDATA: $(pkgconfig_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || 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_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
+ done
+
+uninstall-pkgconfigDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(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-recursive
+
+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"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+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
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @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
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+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:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+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)
+
+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-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-pkgconfigDATA
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-pkgconfigDATA
+
+.MAKE: $(am__recursive_targets) all install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--refresh check check-am clean clean-cscope clean-generic \
+ clean-libtool cscope cscopelist-am ctags ctags-am dist \
+ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
+ dist-xz dist-zip distcheck distclean distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags distcleancheck \
+ distdir distuninstallcheck 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-pkgconfigDATA \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am uninstall-pkgconfigDATA
+
+
+coverage-init:
+ lcov --directory src --capture --initial --output-file rasterlite2_cov.info
+
+coverage::
+ lcov --directory src --output-file rasterlite2_cov.info --capture
+ genhtml -o covresults rasterlite2_cov.info
+
+# 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:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
diff --git a/README b/README
new file mode 100644
index 0000000..dfe4e18
--- /dev/null
+++ b/README
@@ -0,0 +1,34 @@
+librasterlite2 is an open source library that stores and retrieves huge
+raster coverages using a SpatiaLite DBMS.
+
+Important notice: this is a brand new project intended to completely
+replace the superseded librasterlite.
+The two projects are completely unrelated: the unique similarity
+between both is just in covering the same identical application area.
+
+License: librasterlite2 (the library itself) is licensed under the
+MPL tri-license terms; you are free to choose the best-fit license
+between:
+
+ the MPL 1.1
+ the GPL v2.0 or any subsequent version
+ the LGPL v2.1 or any subsequent version
+
+Please note well: anyway the tools supporting the library (both
+rl2tool and wmslite are licensed under the GPL v3 (or any subsequent
+version) terms.
+
+
+Coverage testing
+----------------
+librasterlite2 has coverage testing support.
+You need to have gcov and lcov installed.
+
+Process:
+1. Use --enable-gcov=yes with configure script
+2. Clean and rebuild.
+3. make coverage-init
+4. make check (or whatever other tests you want to check coverage for)
+5. make coverage
+6. check summary on command line output.
+7. review detailed coverage results in covresults/index.html
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..f209970
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,1324 @@
+# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+#
+# Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
+
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.13'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.13.4], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.13.4])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well. Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+ [enable], [m4_define([am_maintainer_other], [disable])],
+ [disable], [m4_define([am_maintainer_other], [enable])],
+ [m4_define([am_maintainer_other], [enable])
+ m4_warn([syntax], [unexpected argument to AM@&t at _MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+ AC_ARG_ENABLE([maintainer-mode],
+ [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+ am_maintainer_other[ make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer])],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST([MAINT])dnl
+]
+)
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# -*- Autoconf -*-
+# Obsolete and "removed" macros, that must however still report explicit
+# error messages when used, to smooth transition.
+#
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([AM_CONFIG_HEADER],
+[AC_DIAGNOSE([obsolete],
+['$0': this macro is obsolete.
+You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl
+AC_CONFIG_HEADERS($@)])
+
+AC_DEFUN([AM_PROG_CC_STDC],
+[AC_PROG_CC
+am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
+AC_DIAGNOSE([obsolete],
+['$0': this macro is obsolete.
+You should simply use the 'AC][_PROG_CC' macro instead.
+Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
+but upon 'ac_cv_prog_cc_stdc'.])])
+
+AC_DEFUN([AM_C_PROTOTYPES],
+ [AC_FATAL([automatic de-ANSI-fication support has been removed])])
+AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
diff --git a/config.guess b/config.guess
new file mode 100755
index 0000000..b79252d
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,1558 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright 1992-2013 Free Software Foundation, Inc.
+
+timestamp='2013-06-10'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2013 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ ;;
+esac
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ cris:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ crisv32:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ frv:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:Linux:*:*)
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ ;;
+ or1k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ or32:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-${LIBC}
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-${LIBC}
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ exit ;;
+ x86_64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel at ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes at openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf at swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green at stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green at stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
+ exit ;;
+esac
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..ff3f40c
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,177 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define to 1 if you have the <geotiff/geotiff.h> header file. */
+#undef HAVE_GEOTIFF_GEOTIFF_H
+
+/* Define to 1 if you have the <geotiff.h> header file. */
+#undef HAVE_GEOTIFF_H
+
+/* Define to 1 if you have the <gif_lib.h> header file. */
+#undef HAVE_GIF_LIB_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <jerror.h> header file. */
+#undef HAVE_JERROR_H
+
+/* Define to 1 if you have the <jpeglib.h> header file. */
+#undef HAVE_JPEGLIB_H
+
+/* Define to 1 if you have the `geotiff' library (-lgeotiff). */
+#undef HAVE_LIBGEOTIFF
+
+/* Define to 1 if you have the <libgeotiff/geotiff.h> header file. */
+#undef HAVE_LIBGEOTIFF_GEOTIFF_H
+
+/* Define to 1 if you have the `gif' library (-lgif). */
+#undef HAVE_LIBGIF
+
+/* Define to 1 if you have the `jpeg' library (-ljpeg). */
+#undef HAVE_LIBJPEG
+
+/* Define to 1 if you have the `tiff' library (-ltiff). */
+#undef HAVE_LIBTIFF
+
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
+
+/* Define to 1 if `lstat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+#undef HAVE_LSTAT_EMPTY_STRING_BUG
+
+/* Define to 1 if you have the <lzma.h> header file. */
+#undef HAVE_LZMA_H
+
+/* Define to 1 if you have the <math.h> header file. */
+#undef HAVE_MATH_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <png.h> header file. */
+#undef HAVE_PNG_H
+
+/* Define to 1 if you have the `sqrt' function. */
+#undef HAVE_SQRT
+
+/* Define to 1 if `stat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+#undef HAVE_STAT_EMPTY_STRING_BUG
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the `strftime' function. */
+#undef HAVE_STRFTIME
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <zlib.h> header file. */
+#undef HAVE_ZLIB_H
+
+/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+ slash. */
+#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Must be defined in order to disable debug mode. */
+#undef NDEBUG
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Should contain a text-string describing the intended target CPU */
+#undef TARGET_CPU
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
+/* Version number of package */
+#undef VERSION
+
+/* Must be =64 in order to enable huge-file support. */
+#undef _FILE_OFFSET_BITS
+
+/* Must be defined in order to enable huge-file support. */
+#undef _LARGEFILE_SOURCE
+
+/* Must be defined in order to enable huge-file support. */
+#undef _LARGE_FILE
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+#undef volatile
diff --git a/config.sub b/config.sub
new file mode 100755
index 0000000..c765b34
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1788 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright 1992-2013 Free Software Foundation, Inc.
+
+timestamp='2013-04-24'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2013 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze*)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | be32 | be64 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | epiphany \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 | nios2eb | nios2el \
+ | ns16k | ns32k \
+ | open8 \
+ | or1k | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pyramid \
+ | rl78 | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | we32k \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | be32-* | be64-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | le32-* | le64-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pyramid-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16 | cr16-*)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze*)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ msys)
+ basic_machine=i386-pc
+ os=-msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc | ppcbe) basic_machine=powerpc-unknown
+ ;;
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tile*)
+ basic_machine=$basic_machine-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or1k-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure b/configure
new file mode 100755
index 0000000..143bf13
--- /dev/null
+++ b/configure
@@ -0,0 +1,20716 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for librasterlite2 1.0.0-rc0.
+#
+# Report bugs to <a.furieri at lqt.it>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf at gnu.org and a.furieri at lqt.it
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='librasterlite2'
+PACKAGE_TARNAME='librasterlite2'
+PACKAGE_VERSION='1.0.0-rc0'
+PACKAGE_STRING='librasterlite2 1.0.0-rc0'
+PACKAGE_BUGREPORT='a.furieri at lqt.it'
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+MINGW_FALSE
+MINGW_TRUE
+LIBXML2_LIBS
+LIBXML2_CFLAGS
+LIBCURL_LIBS
+LIBCURL_CFLAGS
+LIBCAIRO_LIBS
+LIBCAIRO_CFLAGS
+LIBSPATIALITE_LIBS
+LIBSPATIALITE_CFLAGS
+LIBLZMA_LIBS
+LIBLZMA_CFLAGS
+LIBWEBP_LIBS
+LIBWEBP_CFLAGS
+LIBPNG_LIBS
+LIBPNG_CFLAGS
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
+LIBOBJS
+CXXCPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+SED
+LIBTOOL
+OBJDUMP
+DLLTOOL
+AS
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+LN_S
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_maintainer_mode
+enable_dependency_tracking
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+enable_gcov
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CXX
+CXXFLAGS
+CCC
+CXXCPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+LIBPNG_CFLAGS
+LIBPNG_LIBS
+LIBWEBP_CFLAGS
+LIBWEBP_LIBS
+LIBLZMA_CFLAGS
+LIBLZMA_LIBS
+LIBSPATIALITE_CFLAGS
+LIBSPATIALITE_LIBS
+LIBCAIRO_CFLAGS
+LIBCAIRO_LIBS
+LIBCURL_CFLAGS
+LIBCURL_LIBS
+LIBXML2_CFLAGS
+LIBXML2_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures librasterlite2 1.0.0-rc0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/librasterlite2]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of librasterlite2 1.0.0-rc0:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --enable-maintainer-mode
+ enable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-gcov turn on code coverage analysis tools
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ CXXCPP C++ preprocessor
+ PKG_CONFIG path to pkg-config utility
+ PKG_CONFIG_PATH
+ directories to add to pkg-config's search path
+ PKG_CONFIG_LIBDIR
+ path overriding pkg-config's built-in search path
+ LIBPNG_CFLAGS
+ C compiler flags for LIBPNG, overriding pkg-config
+ LIBPNG_LIBS linker flags for LIBPNG, overriding pkg-config
+ LIBWEBP_CFLAGS
+ C compiler flags for LIBWEBP, overriding pkg-config
+ LIBWEBP_LIBS
+ linker flags for LIBWEBP, overriding pkg-config
+ LIBLZMA_CFLAGS
+ C compiler flags for LIBLZMA, overriding pkg-config
+ LIBLZMA_LIBS
+ linker flags for LIBLZMA, overriding pkg-config
+ LIBSPATIALITE_CFLAGS
+ C compiler flags for LIBSPATIALITE, overriding pkg-config
+ LIBSPATIALITE_LIBS
+ linker flags for LIBSPATIALITE, overriding pkg-config
+ LIBCAIRO_CFLAGS
+ C compiler flags for LIBCAIRO, overriding pkg-config
+ LIBCAIRO_LIBS
+ linker flags for LIBCAIRO, overriding pkg-config
+ LIBCURL_CFLAGS
+ C compiler flags for LIBCURL, overriding pkg-config
+ LIBCURL_LIBS
+ linker flags for LIBCURL, overriding pkg-config
+ LIBXML2_CFLAGS
+ C compiler flags for LIBXML2, overriding pkg-config
+ LIBXML2_LIBS
+ linker flags for LIBXML2, overriding pkg-config
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <a.furieri at lqt.it>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+librasterlite2 configure 1.0.0-rc0
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ------------------------------- ##
+## Report this to a.furieri at lqt.it ##
+## ------------------------------- ##"
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_cpp
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by librasterlite2 $as_me 1.0.0-rc0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_aux_dir=
+for ac_dir in . "$srcdir"/.; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+
+am__api_version='1.13'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='librasterlite2'
+ VERSION='1.0.0-rc0'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+# enabling huge-file support (64 bit file pointers)
+
+$as_echo "#define _LARGE_FILE 1" >>confdefs.h
+
+
+$as_echo "#define _FILE_OFFSET_BITS 64" >>confdefs.h
+
+
+$as_echo "#define _LARGEFILE_SOURCE 1" >>confdefs.h
+
+
+# disablibg debug support
+
+$as_echo "#define NDEBUG 1" >>confdefs.h
+
+
+
+
+# Checks for header files.
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in stdlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find stdlib.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+for ac_header in stdio.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdio_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STDIO_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find stdio.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+for ac_header in string.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
+if test "x$ac_cv_header_string_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRING_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find string.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+for ac_header in memory.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "memory.h" "ac_cv_header_memory_h" "$ac_includes_default"
+if test "x$ac_cv_header_memory_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MEMORY_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find memory.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+for ac_header in math.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default"
+if test "x$ac_cv_header_math_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_MATH_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find math.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+for ac_header in float.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default"
+if test "x$ac_cv_header_float_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_FLOAT_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find float.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+for ac_header in jpeglib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
+if test "x$ac_cv_header_jpeglib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_JPEGLIB_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find jpeglib.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+for ac_header in jerror.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "jerror.h" "ac_cv_header_jerror_h" "$ac_includes_default"
+if test "x$ac_cv_header_jerror_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_JERROR_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find jerror.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+for ac_header in png.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default"
+if test "x$ac_cv_header_png_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PNG_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find png.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+for ac_header in zlib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find zlib.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+for ac_header in gif_lib.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default"
+if test "x$ac_cv_header_gif_lib_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GIF_LIB_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find gif_lib.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+for ac_header in lzma.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
+if test "x$ac_cv_header_lzma_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LZMA_H 1
+_ACEOF
+
+else
+ as_fn_error $? "cannot find lzma.h, bailing out" "$LINENO" 5
+fi
+
+done
+
+
+#
+# testing GeoTiff headers
+# on some systems they are located on -/include
+# on other systems they are on -/include/geotiff
+# or even on -/include/libgeotiff
+#
+# this patch was kindly contributed by Brad Hards
+# 2011-09-02
+#
+for ac_header in geotiff/geotiff.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "geotiff/geotiff.h" "ac_cv_header_geotiff_geotiff_h" "$ac_includes_default"
+if test "x$ac_cv_header_geotiff_geotiff_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GEOTIFF_GEOTIFF_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in libgeotiff/geotiff.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "libgeotiff/geotiff.h" "ac_cv_header_libgeotiff_geotiff_h" "$ac_includes_default"
+if test "x$ac_cv_header_libgeotiff_geotiff_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGEOTIFF_GEOTIFF_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in geotiff.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "geotiff.h" "ac_cv_header_geotiff_h" "$ac_includes_default"
+if test "x$ac_cv_header_geotiff_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GEOTIFF_H 1
+_ACEOF
+
+fi
+
+done
+
+if test x"$ac_cv_header_geotiff_geotiff_h" != x"yes" &&
+ test x"$ac_cv_header_libgeotiff_geotiff_h" != x"yes" &&
+ test x"$ac_cv_header_geotiff_h" != x"yes";
+then
+ as_fn_error $? "'libgeotiff' is required but the header (geotiff.h) doesn't seem to be installed on this system" "$LINENO" 5
+fi
+
+
+# Checks for programs.
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+ if test -n "$CCC"; then
+ CXX=$CCC
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CXX" && break
+done
+
+ if test "x$ac_ct_CXX" = x; then
+ CXX="g++"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CXX=$ac_ct_CXX
+ fi
+fi
+
+ fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+ ac_cxx_werror_flag=yes
+ ac_cv_prog_cxx_g=no
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+else
+ CXXFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AS"; then
+ ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AS="${ac_tool_prefix}as"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
+$as_echo "$AS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AS"; then
+ ac_ct_AS=$AS
+ # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AS"; then
+ ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AS="as"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
+$as_echo "$ac_ct_AS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AS" = x; then
+ AS="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AS=$ac_ct_AS
+ fi
+else
+ AS="$ac_cv_prog_AS"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+ ;;
+esac
+
+test -z "$AS" && AS=as
+
+
+
+
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.2'
+macro_revision='1.3337'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case "$ECHO" in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_FGREP" || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD="${LD-ld}_sol2"
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&5
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&5
+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+
+
+
+
+
+# Set options
+
+
+
+ enable_dlopen=no
+
+
+
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ if test -n "$lt_prog_compiler_pic"; then
+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Intel*\ [CF]*Compiler*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *Portland\ Group*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='${wl}--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[23].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Add ABI-specific directories to the system library path.
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report which library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+ if ${ac_cv_prog_CXXCPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+else
+ _lt_caught_CXX_error=yes
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+ # save warnings/boilerplate of simple test code
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ compiler_CXX=$CC
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+ else
+ lt_prog_compiler_no_builtin_flag_CXX=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_CXX=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ ld_shlibs_CXX=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_CXX=''
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ file_list_spec_CXX='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_CXX=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_CXX=yes
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_libdir_separator_CXX=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec_CXX='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ always_export_symbols_CXX=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_CXX='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_CXX="-z nodefs"
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_CXX=' ${wl}-bernotok'
+ allow_undefined_flag_CXX=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_CXX='$convenience'
+ fi
+ archive_cmds_need_lc_CXX=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_CXX=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX=' '
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=yes
+ file_list_spec_CXX='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+ enable_shared_with_static_runtimes_CXX=yes
+ # Don't use ranlib
+ old_postinstall_cmds_CXX='chmod 644 $oldlib'
+ postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=no
+ enable_shared_with_static_runtimes_CXX=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc_CXX=no
+ hardcode_direct_CXX=no
+ hardcode_automatic_CXX=yes
+ hardcode_shlibpath_var_CXX=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+ else
+ whole_archive_flag_spec_CXX=''
+ fi
+ link_all_deplibs_CXX=yes
+ allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+
+ else
+ ld_shlibs_CXX=no
+ fi
+
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ freebsd2.*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ ld_shlibs_CXX=no
+ ;;
+
+ freebsd-elf*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ ld_shlibs_CXX=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ link_all_deplibs_CXX=yes
+ ;;
+
+ hpux9*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ ;;
+ *)
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+ ;;
+ esac
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ inherit_rpath_CXX=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ archive_cmds_need_lc_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+ prelink_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ old_archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object_CXX=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ ld_shlibs_CXX=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ ld_shlibs_CXX=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ hardcode_direct_absolute_CXX=yes
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ allow_undefined_flag_CXX=' -expect_unresolved \*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ ;;
+ esac
+
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ archive_cmds_need_lc_CXX=yes
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_shlibpath_var_CXX=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ link_all_deplibs_CXX=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_CXX='${wl}-z,text'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_CXX='${wl}-z,text'
+ allow_undefined_flag_CXX='${wl}-z,nodefs'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ export_dynamic_flag_spec_CXX='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+ '"$old_archive_cmds_CXX"
+ reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+ '"$reload_cmds_CXX"
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+ test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+ GCC_CXX="$GXX"
+ LD_CXX="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_path_CXX="${prev}${p}"
+ else
+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_CXX"; then
+ postdeps_CXX="${prev}${p}"
+ else
+ postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$predep_objects_CXX"; then
+ predep_objects_CXX="$p"
+ else
+ predep_objects_CXX="$predep_objects_CXX $p"
+ fi
+ else
+ if test -z "$postdep_objects_CXX"; then
+ postdep_objects_CXX="$p"
+ else
+ postdep_objects_CXX="$postdep_objects_CXX $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ predep_objects_CXX=
+ postdep_objects_CXX=
+ postdeps_CXX=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static_CXX=
+ ;;
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[4-9]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fpic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-qpic'
+ lt_prog_compiler_static_CXX='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
+else
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works_CXX=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+ :
+else
+ lt_prog_compiler_static_CXX=
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ case $host_os in
+ aix[4-9]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*)
+ exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ ;;
+ esac
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+with_gnu_ld_CXX=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_CXX=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_CXX in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_CXX
+ pic_flag=$lt_prog_compiler_pic_CXX
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+ allow_undefined_flag_CXX=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc_CXX=no
+ else
+ lt_cv_archive_cmds_need_lc_CXX=yes
+ fi
+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+ archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[23].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Add ABI-specific directories to the system library path.
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+ test -n "$runpath_var_CXX" ||
+ test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct_CXX" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+ test "$hardcode_minus_L_CXX" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_CXX=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_CXX=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink ||
+ test "$inherit_rpath_CXX" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this sort of thing. */
+ typedef int charset[2];
+ const charset cs = { 0, 0 };
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this sort of thing. */
+ char tx;
+ char *t = &tx;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; } bx;
+ struct s *b = &bx; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
+else
+ ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if ${ac_cv_struct_tm+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <time.h>
+
+int
+main ()
+{
+struct tm tm;
+ int *p = &tm.tm_sec;
+ return !p;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_struct_tm=time.h
+else
+ ac_cv_struct_tm=sys/time.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+$as_echo "$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
+
+$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5
+$as_echo_n "checking for working volatile... " >&6; }
+if ${ac_cv_c_volatile+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+volatile int x;
+int * volatile y = (int *) 0;
+return !x && !y;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_volatile=yes
+else
+ ac_cv_c_volatile=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5
+$as_echo "$ac_cv_c_volatile" >&6; }
+if test $ac_cv_c_volatile = no; then
+
+$as_echo "#define volatile /**/" >>confdefs.h
+
+fi
+
+
+# Checks for library functions.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
+$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
+if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f conftest.sym conftest.file
+echo >conftest.file
+if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+struct stat sbuf;
+ /* Linux will dereference the symlink and fail, as required by POSIX.
+ That is better in the sense that it means we will not
+ have to compile and use the lstat wrapper. */
+ return lstat ("conftest.sym/", &sbuf) == 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_lstat_dereferences_slashed_symlink=yes
+else
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+else
+ # If the `ln -s' command failed, then we probably don't even
+ # have an lstat function.
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+rm -f conftest.sym conftest.file
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
+$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+
+test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+
+cat >>confdefs.h <<_ACEOF
+#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+_ACEOF
+
+
+if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
+ case " $LIBOBJS " in
+ *" lstat.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
+ ;;
+esac
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat accepts an empty string" >&5
+$as_echo_n "checking whether lstat accepts an empty string... " >&6; }
+if ${ac_cv_func_lstat_empty_string_bug+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_lstat_empty_string_bug=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+struct stat sbuf;
+ return lstat ("", &sbuf) == 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_lstat_empty_string_bug=no
+else
+ ac_cv_func_lstat_empty_string_bug=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_empty_string_bug" >&5
+$as_echo "$ac_cv_func_lstat_empty_string_bug" >&6; }
+if test $ac_cv_func_lstat_empty_string_bug = yes; then
+ case " $LIBOBJS " in
+ *" lstat.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
+ ;;
+esac
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LSTAT_EMPTY_STRING_BUG 1
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
+$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
+if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f conftest.sym conftest.file
+echo >conftest.file
+if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+struct stat sbuf;
+ /* Linux will dereference the symlink and fail, as required by POSIX.
+ That is better in the sense that it means we will not
+ have to compile and use the lstat wrapper. */
+ return lstat ("conftest.sym/", &sbuf) == 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_lstat_dereferences_slashed_symlink=yes
+else
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+else
+ # If the `ln -s' command failed, then we probably don't even
+ # have an lstat function.
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+rm -f conftest.sym conftest.file
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
+$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+
+test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+
+cat >>confdefs.h <<_ACEOF
+#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+_ACEOF
+
+
+if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
+ case " $LIBOBJS " in
+ *" lstat.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
+ ;;
+esac
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
+$as_echo_n "checking for working memcmp... " >&6; }
+if ${ac_cv_func_memcmp_working+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_memcmp_working=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Some versions of memcmp are not 8-bit clean. */
+ char c0 = '\100', c1 = '\200', c2 = '\201';
+ if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
+ return 1;
+
+ /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
+ or more and with at least one buffer not starting on a 4-byte boundary.
+ William Lewis provided this test program. */
+ {
+ char foo[21];
+ char bar[21];
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ char *a = foo + i;
+ char *b = bar + i;
+ strcpy (a, "--------01111111");
+ strcpy (b, "--------10000000");
+ if (memcmp (a, b, 16) >= 0)
+ return 1;
+ }
+ return 0;
+ }
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_memcmp_working=yes
+else
+ ac_cv_func_memcmp_working=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5
+$as_echo "$ac_cv_func_memcmp_working" >&6; }
+test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
+ *" memcmp.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
+ ;;
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5
+$as_echo_n "checking whether stat accepts an empty string... " >&6; }
+if ${ac_cv_func_stat_empty_string_bug+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_stat_empty_string_bug=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+struct stat sbuf;
+ return stat ("", &sbuf) == 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_stat_empty_string_bug=no
+else
+ ac_cv_func_stat_empty_string_bug=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5
+$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; }
+if test $ac_cv_func_stat_empty_string_bug = yes; then
+ case " $LIBOBJS " in
+ *" stat.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS stat.$ac_objext"
+ ;;
+esac
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STAT_EMPTY_STRING_BUG 1
+_ACEOF
+
+fi
+
+for ac_func in strftime
+do :
+ ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
+if test "x$ac_cv_func_strftime" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRFTIME 1
+_ACEOF
+
+else
+ # strftime is in -lintl on SCO UNIX.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
+$as_echo_n "checking for strftime in -lintl... " >&6; }
+if ${ac_cv_lib_intl_strftime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char strftime ();
+int
+main ()
+{
+return strftime ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_intl_strftime=yes
+else
+ ac_cv_lib_intl_strftime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
+$as_echo "$ac_cv_lib_intl_strftime" >&6; }
+if test "x$ac_cv_lib_intl_strftime" = xyes; then :
+ $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
+
+LIBS="-lintl $LIBS"
+fi
+
+fi
+done
+
+for ac_func in sqrt strcasecmp strerror strncasecmp strstr strerror
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# gcov support
+# Check whether --enable-gcov was given.
+if test "${enable_gcov+set}" = set; then :
+ enableval=$enable_gcov;
+fi
+
+if test "x$enable_gcov" = "xyes"; then
+ CFLAGS=$CFLAGS" -fprofile-arcs -ftest-coverage -g"
+ GCOV_FLAGS="-lgcov"
+fi
+
+ac_config_files="$ac_config_files Makefile headers/Makefile src/Makefile test/Makefile test/sql_stmt_tests/Makefile test/sql_stmt_security_tests/Makefile tools/Makefile examples/Makefile Doxyfile rasterlite2.pc"
+
+
+# exporting the TARGET_CPU string
+rl2_cpu=`$CC -dumpmachine`
+cat >>confdefs.h <<_ACEOF
+#define TARGET_CPU "$rl2_cpu"
+_ACEOF
+
+
+# Checks for installed libraries
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateInit_ in -lz" >&5
+$as_echo_n "checking for inflateInit_ in -lz... " >&6; }
+if ${ac_cv_lib_z_inflateInit_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inflateInit_ ();
+int
+main ()
+{
+return inflateInit_ ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_z_inflateInit_=yes
+else
+ ac_cv_lib_z_inflateInit_=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateInit_" >&5
+$as_echo "$ac_cv_lib_z_inflateInit_" >&6; }
+if test "x$ac_cv_lib_z_inflateInit_" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+ LIBS="-lz $LIBS"
+
+else
+ as_fn_error $? "'libz' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_start_compress in -ljpeg" >&5
+$as_echo_n "checking for jpeg_start_compress in -ljpeg... " >&6; }
+if ${ac_cv_lib_jpeg_jpeg_start_compress+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ljpeg -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char jpeg_start_compress ();
+int
+main ()
+{
+return jpeg_start_compress ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_jpeg_jpeg_start_compress=yes
+else
+ ac_cv_lib_jpeg_jpeg_start_compress=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_start_compress" >&5
+$as_echo "$ac_cv_lib_jpeg_jpeg_start_compress" >&6; }
+if test "x$ac_cv_lib_jpeg_jpeg_start_compress" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBJPEG 1
+_ACEOF
+
+ LIBS="-ljpeg $LIBS"
+
+else
+ as_fn_error $? "'libjpeg' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifSlurp in -lgif" >&5
+$as_echo_n "checking for DGifSlurp in -lgif... " >&6; }
+if ${ac_cv_lib_gif_DGifSlurp+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgif -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char DGifSlurp ();
+int
+main ()
+{
+return DGifSlurp ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_gif_DGifSlurp=yes
+else
+ ac_cv_lib_gif_DGifSlurp=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifSlurp" >&5
+$as_echo "$ac_cv_lib_gif_DGifSlurp" >&6; }
+if test "x$ac_cv_lib_gif_DGifSlurp" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGIF 1
+_ACEOF
+
+ LIBS="-lgif $LIBS"
+
+else
+ as_fn_error $? "'libpng' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFClientOpen in -ltiff" >&5
+$as_echo_n "checking for TIFFClientOpen in -ltiff... " >&6; }
+if ${ac_cv_lib_tiff_TIFFClientOpen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltiff -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char TIFFClientOpen ();
+int
+main ()
+{
+return TIFFClientOpen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_tiff_TIFFClientOpen=yes
+else
+ ac_cv_lib_tiff_TIFFClientOpen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFClientOpen" >&5
+$as_echo "$ac_cv_lib_tiff_TIFFClientOpen" >&6; }
+if test "x$ac_cv_lib_tiff_TIFFClientOpen" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBTIFF 1
+_ACEOF
+
+ LIBS="-ltiff $LIBS"
+
+else
+ as_fn_error $? "'libtiff' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTIFSetFromProj4 in -lgeotiff" >&5
+$as_echo_n "checking for GTIFSetFromProj4 in -lgeotiff... " >&6; }
+if ${ac_cv_lib_geotiff_GTIFSetFromProj4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgeotiff -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char GTIFSetFromProj4 ();
+int
+main ()
+{
+return GTIFSetFromProj4 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_geotiff_GTIFSetFromProj4=yes
+else
+ ac_cv_lib_geotiff_GTIFSetFromProj4=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_geotiff_GTIFSetFromProj4" >&5
+$as_echo "$ac_cv_lib_geotiff_GTIFSetFromProj4" >&6; }
+if test "x$ac_cv_lib_geotiff_GTIFSetFromProj4" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGEOTIFF 1
+_ACEOF
+
+ LIBS="-lgeotiff $LIBS"
+
+else
+ as_fn_error $? "'libgeotiff' >= v.1.2.5 is required but it doesn't seems to be installed on this system." "$LINENO" 5
+fi
+
+
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBPNG" >&5
+$as_echo_n "checking for LIBPNG... " >&6; }
+
+if test -n "$LIBPNG_CFLAGS"; then
+ pkg_cv_LIBPNG_CFLAGS="$LIBPNG_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libpng") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBPNG_CFLAGS=`$PKG_CONFIG --cflags "libpng" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBPNG_LIBS"; then
+ pkg_cv_LIBPNG_LIBS="$LIBPNG_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libpng") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBPNG_LIBS=`$PKG_CONFIG --libs "libpng" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBPNG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpng" 2>&1`
+ else
+ LIBPNG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpng" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBPNG_PKG_ERRORS" >&5
+
+ as_fn_error $? "'libpng' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "'libpng' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+else
+ LIBPNG_CFLAGS=$pkg_cv_LIBPNG_CFLAGS
+ LIBPNG_LIBS=$pkg_cv_LIBPNG_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBWEBP" >&5
+$as_echo_n "checking for LIBWEBP... " >&6; }
+
+if test -n "$LIBWEBP_CFLAGS"; then
+ pkg_cv_LIBWEBP_CFLAGS="$LIBWEBP_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libwebp\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libwebp") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBWEBP_CFLAGS=`$PKG_CONFIG --cflags "libwebp" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBWEBP_LIBS"; then
+ pkg_cv_LIBWEBP_LIBS="$LIBWEBP_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libwebp\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libwebp") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBWEBP_LIBS=`$PKG_CONFIG --libs "libwebp" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBWEBP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libwebp" 2>&1`
+ else
+ LIBWEBP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libwebp" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBWEBP_PKG_ERRORS" >&5
+
+ as_fn_error $? "'libwebp' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "'libwebp' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+else
+ LIBWEBP_CFLAGS=$pkg_cv_LIBWEBP_CFLAGS
+ LIBWEBP_LIBS=$pkg_cv_LIBWEBP_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBLZMA" >&5
+$as_echo_n "checking for LIBLZMA... " >&6; }
+
+if test -n "$LIBLZMA_CFLAGS"; then
+ pkg_cv_LIBLZMA_CFLAGS="$LIBLZMA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblzma\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "liblzma") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBLZMA_CFLAGS=`$PKG_CONFIG --cflags "liblzma" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBLZMA_LIBS"; then
+ pkg_cv_LIBLZMA_LIBS="$LIBLZMA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblzma\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "liblzma") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBLZMA_LIBS=`$PKG_CONFIG --libs "liblzma" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBLZMA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liblzma" 2>&1`
+ else
+ LIBLZMA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liblzma" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBLZMA_PKG_ERRORS" >&5
+
+ as_fn_error $? "'liblzma' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "'liblzma' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+else
+ LIBLZMA_CFLAGS=$pkg_cv_LIBLZMA_CFLAGS
+ LIBLZMA_LIBS=$pkg_cv_LIBLZMA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSPATIALITE" >&5
+$as_echo_n "checking for LIBSPATIALITE... " >&6; }
+
+if test -n "$LIBSPATIALITE_CFLAGS"; then
+ pkg_cv_LIBSPATIALITE_CFLAGS="$LIBSPATIALITE_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spatialite\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "spatialite") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBSPATIALITE_CFLAGS=`$PKG_CONFIG --cflags "spatialite" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBSPATIALITE_LIBS"; then
+ pkg_cv_LIBSPATIALITE_LIBS="$LIBSPATIALITE_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"spatialite\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "spatialite") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBSPATIALITE_LIBS=`$PKG_CONFIG --libs "spatialite" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBSPATIALITE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "spatialite" 2>&1`
+ else
+ LIBSPATIALITE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "spatialite" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBSPATIALITE_PKG_ERRORS" >&5
+
+ as_fn_error $? "'libspatialite' is required but it doesn't seem to be installed on this system." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "'libspatialite' is required but it doesn't seem to be installed on this system." "$LINENO" 5
+else
+ LIBSPATIALITE_CFLAGS=$pkg_cv_LIBSPATIALITE_CFLAGS
+ LIBSPATIALITE_LIBS=$pkg_cv_LIBSPATIALITE_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCAIRO" >&5
+$as_echo_n "checking for LIBCAIRO... " >&6; }
+
+if test -n "$LIBCAIRO_CFLAGS"; then
+ pkg_cv_LIBCAIRO_CFLAGS="$LIBCAIRO_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "cairo") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBCAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBCAIRO_LIBS"; then
+ pkg_cv_LIBCAIRO_LIBS="$LIBCAIRO_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "cairo") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBCAIRO_LIBS=`$PKG_CONFIG --libs "cairo" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBCAIRO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo" 2>&1`
+ else
+ LIBCAIRO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBCAIRO_PKG_ERRORS" >&5
+
+ as_fn_error $? "'libcairo' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "'libcairo' is required but it doesn't seems to be installed on this system." "$LINENO" 5
+else
+ LIBCAIRO_CFLAGS=$pkg_cv_LIBCAIRO_CFLAGS
+ LIBCAIRO_LIBS=$pkg_cv_LIBCAIRO_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCURL" >&5
+$as_echo_n "checking for LIBCURL... " >&6; }
+
+if test -n "$LIBCURL_CFLAGS"; then
+ pkg_cv_LIBCURL_CFLAGS="$LIBCURL_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBCURL_CFLAGS=`$PKG_CONFIG --cflags "libcurl" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBCURL_LIBS"; then
+ pkg_cv_LIBCURL_LIBS="$LIBCURL_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBCURL_LIBS=`$PKG_CONFIG --libs "libcurl" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBCURL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcurl" 2>&1`
+ else
+ LIBCURL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcurl" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBCURL_PKG_ERRORS" >&5
+
+ as_fn_error $? "'libcurl' is required but it doesn't seem to be installed on this system." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "'libcurl' is required but it doesn't seem to be installed on this system." "$LINENO" 5
+else
+ LIBCURL_CFLAGS=$pkg_cv_LIBCURL_CFLAGS
+ LIBCURL_LIBS=$pkg_cv_LIBCURL_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML2" >&5
+$as_echo_n "checking for LIBXML2... " >&6; }
+
+if test -n "$LIBXML2_CFLAGS"; then
+ pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBXML2_LIBS"; then
+ pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBXML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0" 2>&1`
+ else
+ LIBXML2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBXML2_PKG_ERRORS" >&5
+
+ as_fn_error $? "'libxml2' is required but it doesn't seem to be installed on this system." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "'libxml2' is required but it doesn't seem to be installed on this system." "$LINENO" 5
+else
+ LIBXML2_CFLAGS=$pkg_cv_LIBXML2_CFLAGS
+ LIBXML2_LIBS=$pkg_cv_LIBXML2_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
+# Checking for MinGW
+ if test "$target_alias" = "mingw32"; then
+ MINGW_TRUE=
+ MINGW_FALSE='#'
+else
+ MINGW_TRUE='#'
+ MINGW_FALSE=
+fi
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MINGW_TRUE}" && test -z "${MINGW_FALSE}"; then
+ as_fn_error $? "conditional \"MINGW\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by librasterlite2 $as_me 1.0.0-rc0, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <a.furieri at lqt.it>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+librasterlite2 config.status 1.0.0-rc0
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in AS \
+DLLTOOL \
+OBJDUMP \
+SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+reload_flag_CXX \
+compiler_CXX \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_static_CXX \
+lt_cv_prog_compiler_c_o_CXX \
+export_dynamic_flag_spec_CXX \
+whole_archive_flag_spec_CXX \
+compiler_needs_object_CXX \
+with_gnu_ld_CXX \
+allow_undefined_flag_CXX \
+no_undefined_flag_CXX \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_separator_CXX \
+exclude_expsyms_CXX \
+include_expsyms_CXX \
+file_list_spec_CXX \
+compiler_lib_search_dirs_CXX \
+predep_objects_CXX \
+postdep_objects_CXX \
+predeps_CXX \
+postdeps_CXX \
+compiler_lib_search_path_CXX; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
+old_archive_cmds_CXX \
+old_archive_from_new_cmds_CXX \
+old_archive_from_expsyms_cmds_CXX \
+archive_cmds_CXX \
+archive_expsym_cmds_CXX \
+module_cmds_CXX \
+module_expsym_cmds_CXX \
+export_symbols_cmds_CXX \
+prelink_cmds_CXX \
+postlink_cmds_CXX; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "headers/Makefile") CONFIG_FILES="$CONFIG_FILES headers/Makefile" ;;
+ "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
+ "test/sql_stmt_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_tests/Makefile" ;;
+ "test/sql_stmt_security_tests/Makefile") CONFIG_FILES="$CONFIG_FILES test/sql_stmt_security_tests/Makefile" ;;
+ "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
+ "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
+ "Doxyfile") CONFIG_FILES="$CONFIG_FILES Doxyfile" ;;
+ "rasterlite2.pc") CONFIG_FILES="$CONFIG_FILES rasterlite2.pc" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named 'Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running 'make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "$am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="CXX "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Assembler program.
+AS=$lt_AS
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Object dumper program.
+OBJDUMP=$lt_OBJDUMP
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+
+ cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
+
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..14723ec
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,154 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.61)
+AC_INIT(librasterlite2, 1.0.0-rc0, a.furieri at lqt.it)
+AC_LANG(C)
+AC_CONFIG_AUX_DIR([.])
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE
+AM_MAINTAINER_MODE
+AM_CONFIG_HEADER(config.h)
+
+# enabling huge-file support (64 bit file pointers)
+AH_TEMPLATE([_LARGE_FILE],
+ [Must be defined in order to enable huge-file support.])
+AC_DEFINE(_LARGE_FILE)
+AH_TEMPLATE([_FILE_OFFSET_BITS],
+ [Must be =64 in order to enable huge-file support.])
+AC_DEFINE(_FILE_OFFSET_BITS, 64)
+AH_TEMPLATE([_LARGEFILE_SOURCE],
+ [Must be defined in order to enable huge-file support.])
+AC_DEFINE(_LARGEFILE_SOURCE)
+
+# disablibg debug support
+AH_TEMPLATE([NDEBUG],
+ [Must be defined in order to disable debug mode.])
+AC_DEFINE(NDEBUG)
+AH_TEMPLATE([TARGET_CPU],
+ [Should contain a text-string describing the intended target CPU])
+
+
+# Checks for header files.
+AC_CHECK_HEADERS(stdlib.h,, [AC_MSG_ERROR([cannot find stdlib.h, bailing out])])
+AC_CHECK_HEADERS(stdio.h,, [AC_MSG_ERROR([cannot find stdio.h, bailing out])])
+AC_CHECK_HEADERS(string.h,, [AC_MSG_ERROR([cannot find string.h, bailing out])])
+AC_CHECK_HEADERS(memory.h,, [AC_MSG_ERROR([cannot find memory.h, bailing out])])
+AC_CHECK_HEADERS(math.h,,[AC_MSG_ERROR([cannot find math.h, bailing out])])
+AC_CHECK_HEADERS(float.h,,[AC_MSG_ERROR([cannot find float.h, bailing out])])
+AC_CHECK_HEADERS(jpeglib.h,, [AC_MSG_ERROR([cannot find jpeglib.h, bailing out])])
+AC_CHECK_HEADERS(jerror.h,, [AC_MSG_ERROR([cannot find jerror.h, bailing out])])
+AC_CHECK_HEADERS(png.h,, [AC_MSG_ERROR([cannot find png.h, bailing out])])
+AC_CHECK_HEADERS(zlib.h,, [AC_MSG_ERROR([cannot find zlib.h, bailing out])])
+AC_CHECK_HEADERS(gif_lib.h,, [AC_MSG_ERROR([cannot find gif_lib.h, bailing out])])
+AC_CHECK_HEADERS(lzma.h,, [AC_MSG_ERROR([cannot find lzma.h, bailing out])])
+
+#
+# testing GeoTiff headers
+# on some systems they are located on -/include
+# on other systems they are on -/include/geotiff
+# or even on -/include/libgeotiff
+#
+# this patch was kindly contributed by Brad Hards
+# 2011-09-02
+#
+AC_CHECK_HEADERS(geotiff/geotiff.h)
+AC_CHECK_HEADERS(libgeotiff/geotiff.h)
+AC_CHECK_HEADERS(geotiff.h)
+if test x"$ac_cv_header_geotiff_geotiff_h" != x"yes" &&
+ test x"$ac_cv_header_libgeotiff_geotiff_h" != x"yes" &&
+ test x"$ac_cv_header_geotiff_h" != x"yes";
+then
+ AC_MSG_ERROR(['libgeotiff' is required but the header (geotiff.h) doesn't seem to be installed on this system])
+fi
+
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_LIBTOOL_WIN32_DLL
+AC_PROG_LIBTOOL
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+AC_STRUCT_TM
+AC_C_VOLATILE
+
+# Checks for library functions.
+AC_FUNC_LSTAT
+AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+AC_FUNC_MEMCMP
+AC_FUNC_STAT
+AC_FUNC_STRFTIME
+AC_CHECK_FUNCS([sqrt strcasecmp strerror strncasecmp strstr strerror])
+
+# gcov support
+AC_ARG_ENABLE(gcov, AC_HELP_STRING([--enable-gcov],[turn on code coverage analysis tools]))
+if test "x$enable_gcov" = "xyes"; then
+ dnl Check for -fprofile-arcs and -ftest-coverage option
+ CFLAGS=$CFLAGS" -fprofile-arcs -ftest-coverage -g"
+ GCOV_FLAGS="-lgcov"
+fi
+
+AC_CONFIG_FILES([Makefile \
+ headers/Makefile \
+ src/Makefile \
+ test/Makefile \
+ test/sql_stmt_tests/Makefile \
+ test/sql_stmt_security_tests/Makefile \
+ tools/Makefile \
+ examples/Makefile \
+ Doxyfile \
+ rasterlite2.pc])
+
+# exporting the TARGET_CPU string
+rl2_cpu=`$CC -dumpmachine`
+AC_DEFINE_UNQUOTED([TARGET_CPU], ["$rl2_cpu"])
+
+# Checks for installed libraries
+AC_CHECK_LIB(z,inflateInit_,,AC_MSG_ERROR(['libz' is required but it doesn't seems to be installed on this system.]),-lm)
+AC_CHECK_LIB(jpeg,jpeg_start_compress,,AC_MSG_ERROR(['libjpeg' is required but it doesn't seems to be installed on this system.]),-lm)
+AC_CHECK_LIB(gif,DGifSlurp,,AC_MSG_ERROR(['libpng' is required but it doesn't seems to be installed on this system.]),-lm)
+AC_CHECK_LIB(tiff,TIFFClientOpen,,AC_MSG_ERROR(['libtiff' is required but it doesn't seems to be installed on this system.]),-lm)
+AC_CHECK_LIB(geotiff,GTIFSetFromProj4,,AC_MSG_ERROR(['libgeotiff' [>= v.1.2.5] is required but it doesn't seems to be installed on this system.]),-lm)
+
+PKG_CHECK_MODULES([LIBPNG], [libpng], , AC_MSG_ERROR(['libpng' is required but it doesn't seems to be installed on this system.]))
+AC_SUBST(LIBPNG_CFLAGS)
+AC_SUBST(LIBPNG_LIBS)
+
+PKG_CHECK_MODULES([LIBWEBP], [libwebp], , AC_MSG_ERROR(['libwebp' is required but it doesn't seems to be installed on this system.]))
+AC_SUBST(LIBWEBP_CFLAGS)
+AC_SUBST(LIBWEBP_LIBS)
+
+PKG_CHECK_MODULES([LIBLZMA], [liblzma], , AC_MSG_ERROR(['liblzma' is required but it doesn't seems to be installed on this system.]))
+AC_SUBST(LIBLZMA_CFLAGS)
+AC_SUBST(LIBLZMA_LIBS)
+
+PKG_CHECK_MODULES([LIBSPATIALITE], [spatialite], , AC_MSG_ERROR(['libspatialite' is required but it doesn't seem to be installed on this system.]))
+AC_SUBST(LIBSPATIALITE_CFLAGS)
+AC_SUBST(LIBSPATIALITE_LIBS)
+
+PKG_CHECK_MODULES([LIBCAIRO], [cairo], , AC_MSG_ERROR(['libcairo' is required but it doesn't seems to be installed on this system.]))
+AC_SUBST(LIBCAIRO_CFLAGS)
+AC_SUBST(LIBCAIRO_LIBS)
+
+PKG_CHECK_MODULES([LIBCURL], [libcurl], , AC_MSG_ERROR(['libcurl' is required but it doesn't seem to be installed on this system.]))
+AC_SUBST(LIBCURL_CFLAGS)
+AC_SUBST(LIBCURL_LIBS)
+
+PKG_CHECK_MODULES([LIBXML2], [libxml-2.0], , AC_MSG_ERROR(['libxml2' is required but it doesn't seem to be installed on this system.]))
+AC_SUBST(LIBXML2_CFLAGS)
+AC_SUBST(LIBXML2_LIBS)
+
+# Checking for MinGW
+AM_CONDITIONAL([MINGW], [test "$target_alias" = "mingw32"])
+
+AC_OUTPUT
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..4ebd5b3
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2013-05-30.07; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by 'PROGRAMS ARGS'.
+ object Object file output by 'PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputting dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'. Note that this directory component will
+# be either empty or ending with a '/' character. This is deliberate.
+set_dir_from ()
+{
+ case $1 in
+ */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+ *) dir=;;
+ esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+ base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+ echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+ # If the compiler actually managed to produce a dependency file,
+ # post-process it.
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependency.h'.
+ # Do two passes, one to just change these to
+ # $object: dependency.h
+ # and one to simply output
+ # dependency.h:
+ # which is needed to avoid the deleted-header problem.
+ { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+ sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+ } > "$depfile"
+ rm -f "$tmpdepfile"
+ else
+ make_dummy_depfile
+ fi
+}
+
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say). Also, it might not be
+## supported by the other compilers which use the 'gcc' depmode.
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The second -e expression handles DOS-style file names with drive
+ # letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+## Some versions of gcc put a space before the ':'. On the theory
+## that the space means something, we add a space to the output as
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like '#:fec' to the end of the
+ # dependency line.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+ | tr "$nl" ' ' >> "$depfile"
+ echo >> "$depfile"
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+xlc)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts '$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ aix_post_process_depfile
+ ;;
+
+tcc)
+ # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+ # FIXME: That version still under development at the moment of writing.
+ # Make that this statement remains true also for stable, released
+ # versions.
+ # It will wrap lines (doesn't matter whether long or short) with a
+ # trailing '\', as in:
+ #
+ # foo.o : \
+ # foo.c \
+ # foo.h \
+ #
+ # It will put a trailing '\' even on the last line, and will use leading
+ # spaces rather than leading tabs (at least since its commit 0394caf7
+ # "Emit spaces for -MD").
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+ # We have to change lines of the first kind to '$object: \'.
+ sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+ # And for each line of the second kind, we have to emit a 'dep.h:'
+ # dummy dependency, to avoid the deleted-header problem.
+ sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file. A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+ # Portland's C compiler understands '-MD'.
+ # Will always output deps to 'file.d' where file is the root name of the
+ # source file under compilation, even if file resides in a subdirectory.
+ # The object file name does not affect the name of the '.d' file.
+ # pgcc 10.2 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using '\' :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+ set_dir_from "$object"
+ # Use the source, not the object, to determine the base name, since
+ # that's sadly what pgcc will do too.
+ set_base_from "$source"
+ tmpdepfile=$base.d
+
+ # For projects that build the same source file twice into different object
+ # files, the pgcc approach of using the *source* file root name can cause
+ # problems in parallel builds. Use a locking strategy to avoid stomping on
+ # the same $tmpdepfile.
+ lockdir=$base.d-lock
+ trap "
+ echo '$0: caught signal, cleaning up...' >&2
+ rmdir '$lockdir'
+ exit 1
+ " 1 2 13 15
+ numtries=100
+ i=$numtries
+ while test $i -gt 0; do
+ # mkdir is a portable test-and-set.
+ if mkdir "$lockdir" 2>/dev/null; then
+ # This process acquired the lock.
+ "$@" -MD
+ stat=$?
+ # Release the lock.
+ rmdir "$lockdir"
+ break
+ else
+ # If the lock is being held by a different process, wait
+ # until the winning process is done or we timeout.
+ while test -d "$lockdir" && test $i -gt 0; do
+ sleep 1
+ i=`expr $i - 1`
+ done
+ fi
+ i=`expr $i - 1`
+ done
+ trap - 1 2 13 15
+ if test $i -le 0; then
+ echo "$0: failed to acquire lock after $numtries attempts" >&2
+ echo "$0: check lockdir '$lockdir'" >&2
+ exit 1
+ fi
+
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add 'dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ set_dir_from "$object"
+ set_base_from "$object"
+
+ if test "$libtool" = yes; then
+ # Libtool generates 2 separate objects for the 2 libraries. These
+ # two compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir$base.o.d # libtool 1.5
+ tmpdepfile2=$dir.libs/$base.o.d # Likewise.
+ tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ # Same post-processing that is required for AIX mode.
+ aix_post_process_depfile
+ ;;
+
+msvc7)
+ if test "$libtool" = yes; then
+ showIncludes=-Wc,-showIncludes
+ else
+ showIncludes=-showIncludes
+ fi
+ "$@" $showIncludes > "$tmpdepfile"
+ stat=$?
+ grep -v '^Note: including file: ' "$tmpdepfile"
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The first sed program below extracts the file names and escapes
+ # backslashes for cygpath. The second sed program outputs the file
+ # name when reading, but also accumulates all include files in the
+ # hold buffer in order to output them again at the end. This only
+ # works with sed implementations that can handle large buffers.
+ sed < "$tmpdepfile" -n '
+/^Note: including file: *\(.*\)/ {
+ s//\1/
+ s/\\/\\\\/g
+ p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+ s/.*/'"$tab"'/
+ G
+ p
+}' >> "$depfile"
+ echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7msys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for ':'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+ "$@" $dashmflag |
+ sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this sed invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process the last invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed '1,2d' "$tmpdepfile" \
+ | tr ' ' "$nl" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E \
+ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ | sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+ echo "$tab" >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/examples/Makefile.am b/examples/Makefile.am
new file mode 100644
index 0000000..c1dfd5d
--- /dev/null
+++ b/examples/Makefile.am
@@ -0,0 +1,8 @@
+noinst_PROGRAMS = sample1
+
+AM_CFLAGS = -I at srcdir@/../headers
+AM_LDFLAGS = -L../src -lrasterlite2 -ljpeg -lpng -lm $(GCOV_FLAGS)
+
+MOSTLYCLEANFILES = *.gcna *.gcno *.gcda
+
+EXTRA_DIST = examples.doxy
diff --git a/examples/Makefile.in b/examples/Makefile.in
new file mode 100644
index 0000000..c729f4b
--- /dev/null
+++ b/examples/Makefile.in
@@ -0,0 +1,597 @@
+# Makefile.in generated by automake 1.13.4 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.
+
+ at 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@
+pkgincludedir = $(includedir)/@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@
+noinst_PROGRAMS = sample1$(EXEEXT)
+subdir = examples
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(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)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+sample1_SOURCES = sample1.c
+sample1_OBJECTS = sample1.$(OBJEXT)
+sample1_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = sample1.c
+DIST_SOURCES = sample1.c
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# 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)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAIRO_CFLAGS = @LIBCAIRO_CFLAGS@
+LIBCAIRO_LIBS = @LIBCAIRO_LIBS@
+LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@
+LIBLZMA_LIBS = @LIBLZMA_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
+LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
+LIBTOOL = @LIBTOOL@
+LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@
+LIBWEBP_LIBS = @LIBWEBP_LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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_CXX = @ac_ct_CXX@
+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@
+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@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = -I at srcdir@/../headers
+AM_LDFLAGS = -L../src -lrasterlite2 -ljpeg -lpng -lm $(GCOV_FLAGS)
+MOSTLYCLEANFILES = *.gcna *.gcno *.gcda
+EXTRA_DIST = examples.doxy
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(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) --gnu examples/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu examples/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):
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+sample1$(EXEEXT): $(sample1_OBJECTS) $(sample1_DEPENDENCIES) $(EXTRA_sample1_DEPENDENCIES)
+ @rm -f sample1$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(sample1_OBJECTS) $(sample1_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sample1.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+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:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+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)
+
+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 clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+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 -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
+ ctags-am distclean distclean-compile distclean-generic \
+ 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-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am
+
+
+# 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:
diff --git a/examples/examples.doxy b/examples/examples.doxy
new file mode 100644
index 0000000..7275914
--- /dev/null
+++ b/examples/examples.doxy
@@ -0,0 +1,152 @@
+/** \example test_xl.c
+
+test_xl.c is a simple demonstration and diagnostic tool for the Excel (.xls)
+file format.
+
+This sample code provides an example of:
+ - opening the .xls file
+ - querying general information
+ - querying Workbooks, SST entries and FAT entries
+ - error handling
+ - closing the .xls file when no further operations are required
+
+Here is an example of a typical run:
+\verbatim
+./test_xl multi.xls
+
+Excel document: multi.xls
+==========================================================
+CFBF Version ........: 3
+CFBF Sector size ....: 512
+CFBF FAT entries ....: 128
+BIFF Version ........: 8 [Excel 98/XP/2003/2007/2010]
+BIFF Max record size : 8224
+BIFF DateMode .......: 0 [day#1 = '1900-01-01']
+BIFF Password/Crypted: NO, clear data
+BIFF CodePage .......: UTF-16LE [Unicode]
+BIFF Worksheets .....: 2
+BIFF SST entries ....: 24
+BIFF Formats ........: 2
+BIFF eXtendedFormats : 24
+
+Worksheets:
+=========================================================
+ 0] I'm a Worsheet
+ ok, Worksheet succesfully selected: currently active: 0
+ 12 Rows X 7 Columns
+
+ 1] Yet another
+ ok, Worksheet succesfully selected: currently active: 1
+ 302 Rows X 4 Columns
+\endverbatim
+
+Here is another example. Note that this earlier version (Excel 3.0) format
+does not use the CFBF container, so no information is provided for the first
+three entries.
+\verbatim
+# ./test_xl v3sample.xls
+
+Excel document: v3sample.xls
+==========================================================
+CFBF Version ........: UNKNOWN
+CFBF Sector size ....: UNKNOWN
+CFBF FAT entries ....: 0
+BIFF Version ........: 3 [Excel 3.0]
+BIFF Max record size : UNKNOWN
+BIFF DateMode .......: 0 [day#1 = '1900-01-01']
+BIFF Password/Crypted: NO, clear data
+BIFF CodePage .......: CP1252 [Windows Latin 1]
+BIFF Worksheets .....: 1
+BIFF Formats ........: 21
+BIFF eXtendedFormats : 25
+
+Worksheets:
+=========================================================
+ 0] Worksheet
+ ok, Worksheet succesfully selected: currently active: 0
+ 17 Rows X 6 Columns
+\endverbatim
+
+For more information, or to aid with debugging, you can specify a -verbose
+flag, as shown in this example:
+\verbatim
+# ./test_xl multi.xls -verbose
+
+Excel document: multi.xls
+==========================================================
+...
+
+Worksheets:
+=========================================================
+...
+
+SST [Shared String Table]:
+=========================================================
+ 0] uno
+ 1] one
+ 2] due
+ 3] two
+ 4] tre
+ 5] three
+...
+ 18] dieci
+ 19] ten
+ 20] undici
+ 21] eleven
+ 22] dodici
+ 23] twelve
+
+FAT entries [File Allocation Table]:
+=========================================================
+ 0 -> 0xfffffffe FATSECT
+ 1 -> 0xffffffff FREESECT
+ 2 -> 3
+ 3 -> 4
+...
+ 36 -> 37
+ 37 -> 38
+ 38 -> 0xfffffffe ENDOFCHAIN
+ 39 -> 0xfffffffe ENDOFCHAIN
+ 40 -> 41
+ 41 -> 0xfffffffe ENDOFCHAIN
+ 42 -> 43
+ 43 -> 0xfffffffe ENDOFCHAIN
+ 44 -> 0xffffffff FREESECT
+...
+ 127 -> 0xffffffff FREESECT
+\endverbatim
+
+*/
+
+/** \example xl2sql.c
+
+xl2sql a simple tool that takes an .xls file as input, and generates a SQL
+script as output. You can then use the SQL script to load the extracted data
+info a SQLite / SpatiaLite database.
+
+Here is a typical usage example:
+\verbatim
+./xl2sql comuni_italiani.xls >comuni.sql
+spatialite italy.sqlite <comuni.sql
+\endverbatim
+
+The first command will parse the .xls document, extracting any data and
+generating the corresponding SQL script. The second command will create and
+populate a database from the SQL script. When using xl2sql this way, the first
+worksheet will become database table xl_table_00, the second worksheet will
+become database table xl_table_01 and so on.
+
+As an alternative, if you pass a second argument to xl2sql, this argument will
+be used as the table prefix. For example:
+\verbatim
+./xl2sql comuni_italiani.xls italia >comuni.sql
+spatialite italy2.sqlite <comuni.sql
+\endverbatim
+
+This will result in the tables being named italia_00, italia_01 and so on.
+
+This sample code provides an example of:
+ - selecting a worksheet to be active
+ - retrieving cell values
+
+*/
\ No newline at end of file
diff --git a/examples/sample1.c b/examples/sample1.c
new file mode 100644
index 0000000..f235b13
--- /dev/null
+++ b/examples/sample1.c
@@ -0,0 +1,68 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static void
+test_rgb_jpeg(const char *path)
+{
+ rl2SectionPtr img = rl2_section_from_jpeg(path);
+fprintf(stderr, "read=%d\n", img);
+ if (img == NULL)
+ return;
+
+ if (rl2_section_to_png(img, "./dsc_1470.png") != RL2_OK)
+fprintf(stderr, "png-out-error\n");
+
+ rl2_destroy_section(img);
+}
+
+static void
+test_gray_jpeg(const char *path)
+{
+ rl2SectionPtr img = rl2_section_from_jpeg(path);
+fprintf(stderr, "read=%d\n", img);
+ if (img == NULL)
+ return;
+
+ if (rl2_section_to_png(img, "./dsc_1470gray.png") != RL2_OK)
+fprintf(stderr, "png-out-error\n");
+
+ rl2_destroy_section(img);
+}
+
+static void
+test_palette_png(const char *path)
+{
+ rl2SectionPtr img = rl2_section_from_png(path);
+fprintf(stderr, "read=%d\n", img);
+ if (img == NULL)
+ return;
+
+ if (rl2_section_to_jpeg(img, "./fig-8.jpg", 20) != RL2_OK)
+fprintf(stderr, "jpg-out-error\n");
+
+ rl2_destroy_section(img);
+}
+
+static void
+test_gray_png(const char *path)
+{
+ rl2SectionPtr img = rl2_section_from_png(path);
+fprintf(stderr, "read=%d\n", img);
+ if (img == NULL)
+ return;
+
+ if (rl2_section_to_jpeg(img, "./dsc_1470gr16.jpg", 70) != RL2_OK)
+fprintf(stderr, "jpg-out-error\n");
+
+ rl2_destroy_section(img);
+}
+
+int main(int argc, char *argv[])
+{
+ test_rgb_jpeg("./DSC_1470.JPG");
+ test_gray_jpeg("./DSC_1470gray.jpg");
+ test_palette_png("./fig-8.png");
+ return 0;
+}
diff --git a/headers/Makefile.am b/headers/Makefile.am
new file mode 100644
index 0000000..60124de
--- /dev/null
+++ b/headers/Makefile.am
@@ -0,0 +1,9 @@
+
+noinst_HEADERS = rasterlite2_private.h rl2svg_private.h
+nobase_include_HEADERS = rasterlite2/rasterlite2.h \
+ rasterlite2/sqlite.h \
+ rasterlite2/rl2wms.h \
+ rasterlite2/rl2tiff.h \
+ rasterlite2/rl2graphics.h \
+ rasterlite2/rl2svg.h
+
diff --git a/headers/Makefile.in b/headers/Makefile.in
new file mode 100644
index 0000000..cf95b82
--- /dev/null
+++ b/headers/Makefile.in
@@ -0,0 +1,577 @@
+# Makefile.in generated by automake 1.13.4 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.
+
+ at 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@
+pkgincludedir = $(includedir)/@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 = headers
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(nobase_include_HEADERS) $(noinst_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(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)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ 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)$(includedir)"
+HEADERS = $(nobase_include_HEADERS) $(noinst_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# 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)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAIRO_CFLAGS = @LIBCAIRO_CFLAGS@
+LIBCAIRO_LIBS = @LIBCAIRO_LIBS@
+LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@
+LIBLZMA_LIBS = @LIBLZMA_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
+LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
+LIBTOOL = @LIBTOOL@
+LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@
+LIBWEBP_LIBS = @LIBWEBP_LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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_CXX = @ac_ct_CXX@
+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@
+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@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+noinst_HEADERS = rasterlite2_private.h rl2svg_private.h
+nobase_include_HEADERS = rasterlite2/rasterlite2.h \
+ rasterlite2/sqlite.h \
+ rasterlite2/rl2wms.h \
+ rasterlite2/rl2tiff.h \
+ rasterlite2/rl2graphics.h \
+ rasterlite2/rl2svg.h
+
+all: 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) --gnu headers/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu headers/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):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-nobase_includeHEADERS: $(nobase_include_HEADERS)
+ @$(NORMAL_INSTALL)
+ @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+ fi; \
+ $(am__nobase_list) | while read dir files; do \
+ xfiles=; for file in $$files; do \
+ if test -f "$$file"; then xfiles="$$xfiles $$file"; \
+ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
+ test -z "$$xfiles" || { \
+ test "x$$dir" = x. || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \
+ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \
+ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \
+ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \
+ done
+
+uninstall-nobase_includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \
+ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
+ dir='$(DESTDIR)$(includedir)'; $(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
+all-am: Makefile $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(includedir)"; 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)
+
+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-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-nobase_includeHEADERS
+
+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-nobase_includeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+ clean-libtool cscopelist-am ctags ctags-am distclean \
+ distclean-generic 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-nobase_includeHEADERS install-pdf install-pdf-am \
+ 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-nobase_includeHEADERS
+
+
+# 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:
diff --git a/headers/rasterlite2/rasterlite2.h b/headers/rasterlite2/rasterlite2.h
new file mode 100644
index 0000000..fb5ea05
--- /dev/null
+++ b/headers/rasterlite2/rasterlite2.h
@@ -0,0 +1,3714 @@
+/*
+
+ rasterlite2 -- main header file
+
+ version 0.1, 2013 March 29
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the RasterLite2 library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+/**
+ \file rasterlite2.h
+
+ Main RasterLite2 header file
+ */
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+#ifdef _WIN32
+#ifdef DLL_EXPORT
+#define RL2_DECLARE __declspec(dllexport)
+#else
+#define RL2_DECLARE extern
+#endif
+#else
+#define RL2_DECLARE __attribute__ ((visibility("default")))
+#endif
+#endif
+
+#ifndef _RASTERLITE2_H
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+#define _RASTERLITE2_H
+#endif
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#ifdef SPATIALITE_AMALGAMATION
+#include <spatialite/sqlite3.h>
+#else
+#include <sqlite3.h>
+#endif
+
+#include <spatialite/gaiageo.h>
+
+/** RasterLite2 flag: FALSE */
+#define RL2_FALSE 0
+/** RasterLite2 flag: TRUE */
+#define RL2_TRUE 1
+
+/** RasterLite2 ret-value: OK (success) */
+#define RL2_OK 0
+/** RasterLite2 ret-value: ERROR (failure) */
+#define RL2_ERROR -1
+
+/** RasterLite2 constant: INVALID/UNDEFINED Pyramid Level */
+#define RL_INVALID_PYRAMID_LEVEL -1
+
+/** RasterLite2 constant: Sample Type UNKNOWN */
+#define RL2_SAMPLE_UNKNOWN 0xa0
+/** RasterLite2 constant: Sample Type 1-bit */
+#define RL2_SAMPLE_1_BIT 0xa1
+/** RasterLite2 constant: Sample Type 2-bit */
+#define RL2_SAMPLE_2_BIT 0xa2
+/** RasterLite2 constant: Sample Type 4-bit */
+#define RL2_SAMPLE_4_BIT 0xa3
+/** RasterLite2 constant: Sample Type 8 bit Integer */
+#define RL2_SAMPLE_INT8 0xa4
+/** RasterLite2 constant: Sample Type 8 bit Unsigned Integer */
+#define RL2_SAMPLE_UINT8 0xa5
+/** RasterLite2 constant: Sample Type 16 bit Integer */
+#define RL2_SAMPLE_INT16 0xa6
+/** RasterLite2 constant: Sample Type 16 bit Unsigned Integer */
+#define RL2_SAMPLE_UINT16 0xa7
+/** RasterLite2 constant: Sample Type 32 bit Integer */
+#define RL2_SAMPLE_INT32 0xa8
+/** RasterLite2 constant: Sample Type 32 bit Unsigned Integer */
+#define RL2_SAMPLE_UINT32 0xa9
+/** RasterLite2 constant: Sample Type Floating Point Single Precision */
+#define RL2_SAMPLE_FLOAT 0xaa
+/** RasterLite2 constant: Sample Type Floating Point Double Precision */
+#define RL2_SAMPLE_DOUBLE 0xab
+
+/** RasterLite2 constant: Pixel Type UNKNOWN */
+#define RL2_PIXEL_UNKNOWN 0x10
+/** RasterLite2 constant: Pixel Type Monochrome - Bilevel */
+#define RL2_PIXEL_MONOCHROME 0x11
+/** RasterLite2 constant: Pixel Type Palette based */
+#define RL2_PIXEL_PALETTE 0x12
+/** RasterLite2 constant: Pixel Type Grayscale */
+#define RL2_PIXEL_GRAYSCALE 0x13
+/** RasterLite2 constant: Pixel Type Red-Green-Blue */
+#define RL2_PIXEL_RGB 0x14
+/** RasterLite2 constant: Pixel Type Multiband (arbitrary) */
+#define RL2_PIXEL_MULTIBAND 0x15
+/** RasterLite2 constant: Pixel Type Data-Grid */
+#define RL2_PIXEL_DATAGRID 0x16
+
+/** RasterLite2 constant: Opaque Pixel */
+#define RL2_PIXEL_OPAQUE 0x80
+/** RasterLite2 constant: Transparent Pixel */
+#define RL2_PIXEL_TRANSPARENT 0x40
+
+/** RasterLite2 constant: Compression UNKNOWN */
+#define RL2_COMPRESSION_UNKNOWN 0x20
+/** RasterLite2 constant: Compression None */
+#define RL2_COMPRESSION_NONE 0x21
+/** RasterLite2 constant: Compression Deflate (zip) */
+#define RL2_COMPRESSION_DEFLATE 0x22
+/** RasterLite2 constant: Compression LZMA */
+#define RL2_COMPRESSION_LZMA 0x23
+/** RasterLite2 constant: Compression GIF */
+#define RL2_COMPRESSION_GIF 0x24
+/** RasterLite2 constant: Compression PNG */
+#define RL2_COMPRESSION_PNG 0x25
+/** RasterLite2 constant: Compression JPEG */
+#define RL2_COMPRESSION_JPEG 0x26
+/** RasterLite2 constant: Compression WEBP (lossy mode) */
+#define RL2_COMPRESSION_LOSSY_WEBP 0x27
+/** RasterLite2 constant: Compression WEBP (lossless mode) */
+#define RL2_COMPRESSION_LOSSLESS_WEBP 0x28
+/** RasterLite2 constant: Compression CCITTFAX3 */
+#define RL2_COMPRESSION_CCITTFAX3 0x29
+/** RasterLite2 constant: Compression CCITTFAX4 */
+#define RL2_COMPRESSION_CCITTFAX4 0x30
+/** RasterLite2 constant: Compression LZW */
+#define RL2_COMPRESSION_LZW 0x31
+
+/** RasterLite2 constant: UNKNOWN number of Bands */
+#define RL2_BANDS_UNKNOWN 0x00
+
+/** RasterLite2 constant: Red Band */
+#define RL2_RED_BAND 0
+/** RasterLite2 constant: Green Band */
+#define RL2_GREEN_BAND 1
+/** RasterLite2 constant: Blue Band */
+#define RL2_BLUE_BAND 2
+/** RasterLite2 constant: Grayscale Band */
+#define RL2_GRAYSCALE_BAND 0
+/** RasterLite2 constant: Data-Grid Band */
+#define RL2_DATAGRID_BAND 0
+/** RasterLite2 constant: Monochrome Band */
+#define RL2_MONOCHROME_BAND 0
+/** RasterLite2 constant: Palette Band */
+#define RL2_PALETTE_BAND 0
+
+/** RasterLite2 constant: No Georeferencing infos */
+#define RL2_GEOREFERENCING_NONE -1
+
+/** RasterLite2 constant: Undefined Tile size */
+#define RL2_TILESIZE_UNDEFINED 0
+
+/** RasterLite2 constant: reproduction scale 1:1 */
+#define RL2_SCALE_1 0x31
+/** RasterLite2 constant: reproduction scale 1:2 */
+#define RL2_SCALE_2 0x32
+/** RasterLite2 constant: reproduction scale 1:4 */
+#define RL2_SCALE_4 0x33
+/** RasterLite2 constant: reproduction scale 1:8 */
+#define RL2_SCALE_8 0x34
+
+/** RasterLite2 constant: output format UNKNOWN */
+#define RL2_OUTPUT_FORMAT_UNKNOWN 0x70
+/** RasterLite2 constant: output format JPEG */
+#define RL2_OUTPUT_FORMAT_JPEG 0x71
+/** RasterLite2 constant: output format PNG */
+#define RL2_OUTPUT_FORMAT_PNG 0x72
+/** RasterLite2 constant: output format TIFF */
+#define RL2_OUTPUT_FORMAT_TIFF 0x73
+/** RasterLite2 constant: output format PDF */
+#define RL2_OUTPUT_FORMAT_PDF 0x74
+
+/** RasterLite2 constant: contrast enhancement NONE */
+#define RL2_CONTRAST_ENHANCEMENT_NONE 0x90
+/** RasterLite2 constant: contrast enhancement NORMALIZE */
+#define RL2_CONTRAST_ENHANCEMENT_NORMALIZE 0x91
+/** RasterLite2 constant: contrast enhancement HISTOGRAM */
+#define RL2_CONTRAST_ENHANCEMENT_HISTOGRAM 0x92
+/** RasterLite2 constant: contrast enhancement GAMMA-VALUE */
+#define RL2_CONTRAST_ENHANCEMENT_GAMMA 0x93
+
+/** ResterLite2 constant: GroupRenderer - RasterLayer */
+#define RL2_GROUP_RENDERER_RASTER_LAYER 0xba
+/** ResterLite2 constant: GroupRenderer - VectorLayer */
+#define RL2_GROUP_RENDERER_VECTOR_LAYER 0xbb
+
+/**
+ Typedef for RL2 Pixel object (opaque, hidden)
+
+ \sa rl2PixelPtr
+ */
+ typedef struct rl2_pixel rl2Pixel;
+/**
+ Typedef for RL2 Pixel object pointer (opaque, hidden)
+
+ \sa rl2Pixel
+ */
+ typedef rl2Pixel *rl2PixelPtr;
+
+/**
+ Typedef for RL2 Palette object (opaque, hidden)
+
+ \sa rl2PalettePtr
+ */
+ typedef struct rl2_palette rl2Palette;
+/**
+ Typedef for RL2 Pixel object pointer (opaque, hidden)
+
+ \sa rl2Palette
+ */
+ typedef rl2Palette *rl2PalettePtr;
+
+/**
+ Typedef for RL2 Raster object (opaque, hidden)
+
+ \sa rl2RasterPtr
+ */
+ typedef struct rl2_raster rl2Raster;
+/**
+ Typedef for RL2 Raster object pointer (opaque, hidden)
+
+ \sa rl2Raster
+ */
+ typedef rl2Raster *rl2RasterPtr;
+
+/**
+ Typedef for RL2 Section object (opaque, hidden)
+
+ \sa rl2SectionPtr
+ */
+ typedef struct rl2_section rl2Section;
+/**
+ Typedef for RL2 Section object pointer (opaque, hidden)
+
+ \sa rl2Section
+ */
+ typedef rl2Section *rl2SectionPtr;
+
+/**
+ Typedef for RL2 Coverage object (opaque, hidden)
+
+ \sa rl2CoveragePtr
+ */
+ typedef struct rl2_coverage rl2Coverage;
+/**
+ Typedef for RL2 Coverage object pointer (opaque, hidden)
+
+ \sa rl2Coverage
+ */
+ typedef rl2Coverage *rl2CoveragePtr;
+
+/**
+ Typedef for RL2 RasterStyle object (opaque, hidden)
+
+ \sa rl2RasterStylePtr
+ */
+ typedef struct rl2_raster_style rl2RasterStyle;
+/**
+ Typedef for RL2 RasterStyle object pointer (opaque, hidden)
+
+ \sa rl2RasterStyle
+ */
+ typedef rl2RasterStyle *rl2RasterStylePtr;
+
+/**
+ Typedef for RL2 GroupStyle object (opaque, hidden)
+
+ \sa rl2GroupStylePtr
+ */
+ typedef struct rl2_group_style rl2GroupStyle;
+/**
+ Typedef for RL2 GroupStyle object pointer (opaque, hidden)
+
+ \sa rl2GroupStyle
+ */
+ typedef rl2GroupStyle *rl2GroupStylePtr;
+
+/**
+ Typedef for RL2 GroupRender object (opaque, hidden)
+
+ \sa rl2GroupRendererPtr
+ */
+ typedef struct rl2_group_renderer rl2GroupRenderer;
+/**
+ Typedef for RL2 GroupRenderer object pointer (opaque, hidden)
+
+ \sa rl2GroupRenderer
+ */
+ typedef rl2GroupRenderer *rl2GroupRendererPtr;
+
+/**
+ Typedef for RL2 TIFF Origin object (opaque, hidden)
+
+ \sa rl2TiffOriginPtr
+ */
+ typedef struct rl2_tiff_origin rl2TiffOrigin;
+/**
+ Typedef for RL2 TIFF Origin object pointer (opaque, hidden)
+
+ \sa rl2TiffOrigin
+ */
+ typedef rl2TiffOrigin *rl2TiffOriginPtr;
+
+/**
+ Typedef for RL2 TIFF Destination object (opaque, hidden)
+
+ \sa rl2TiffDestinationPtr
+ */
+ typedef struct rl2_tiff_destination rl2TiffDestination;
+
+/**
+ Typedef for RL2 TIFF Destination object pointer (opaque, hidden)
+
+ \sa rl2TiffDestination
+ */
+ typedef rl2TiffDestination *rl2TiffDestinationPtr;
+
+/**
+ Typedef for RL2 ASCII Grid Origin object (opaque, hidden)
+
+ \sa rl2AsciiGridOriginPtr
+ */
+ typedef struct rl2_ascii_origin rl2AsciiGridOrigin;
+/**
+ Typedef for RL2 ASCII Grid Origin object pointer (opaque, hidden)
+
+ \sa rl2AsciiGridOrigin
+ */
+ typedef rl2AsciiGridOrigin *rl2AsciiGridOriginPtr;
+
+/**
+ Typedef for RL2 ASCII Grid Destination object (opaque, hidden)
+
+ \sa rl2AsciiGridDestinationPtr
+ */
+ typedef struct rl2_ascii_destination rl2AsciiGridDestination;
+/**
+ Typedef for RL2 ASCII Grid Destination object pointer (opaque, hidden)
+
+ \sa rl2AsciiHridDestination
+ */
+ typedef rl2AsciiGridOrigin *rl2AsciiGridDestinationPtr;
+
+/**
+ Typedef for RL2 Raster Statistics object (opaque, hidden)
+
+ \sa rl2RasterStatisticsPtr
+ */
+ typedef struct rl2_raster_statistics rl2RasterStatistics;
+
+/**
+ Typedef for RL2 Raster Statistics object pointer (opaque, hidden)
+
+ \sa rl2RasterStatistics
+ */
+ typedef rl2RasterStatistics *rl2RasterStatisticsPtr;
+
+/**
+ Typedef for RL2 in-memory PDF target object
+
+ \sa rl2MemPtrPtr
+ */
+ typedef struct rl2_mem_pdf_target rl2MemPdf;
+
+/**
+ Typedef for RL2 in-memory PDF target
+
+ \sa rl2MemPtr
+ */
+ typedef rl2MemPdf *rl2MemPdfPtr;
+
+/**
+ Releases (frees) dynamic memory allocated by RasterLite2
+
+ \param p pointer to the dynamic memory block to be released.
+ */
+ RL2_DECLARE void rl2_free (void *ptr);
+
+/**
+ Return the target CPU name.
+
+ \return the target CPU string.
+ */
+ RL2_DECLARE const char *rl2_target_cpu (void);
+
+/**
+ Return the current library version.
+
+ \return the version string.
+ */
+ RL2_DECLARE const char *rl2_version (void);
+
+#ifdef LOADABLE_EXTENSION
+ RL2_DECLARE int
+ sqlite3_rasterlite_init (sqlite3 * db, char **pzErrMsg,
+ const sqlite3_api_routines * pApi);
+#endif
+
+/**
+ Initializes the library
+
+ \param db_handle handle to the current SQLite connection
+ \param verbose if TRUE a short start-up message is shown on stderr
+
+ \note you are always expected to explicitly call this function
+ before attempting to call any RasterLite-2 own function.
+ */
+ RL2_DECLARE void rl2_init (sqlite3 * db_handle, int verbose);
+
+/**
+ Allocates and initializes a new Pixel object
+
+ \param sample_type one of RL2_SAMPLE_1_BIT, RL2_SAMPLE_2_BIT, RL2_SAMPLE_4_BIT,
+ RL2_SAMPLE_INT8, RL2_SAMPLE_UINT8, RL2_SAMPLE_INT16, RL2_SAMPLE_UINT16,
+ RL2_SAMPLE_INT32, RL2_SAMPLE_UINT32, RL2_SAMPLE_FLOAT or RL2_SAMPLE_DOUBLE.
+ \param pixel_type one of RL2_PIXEL_MONOCHROME, RL2_PIXEL_PALETTE, RL2_PIXEL_GRAYSCALE,
+ RL2_PIXEL_RGB, RL2_PIXEL_MULTIBAND, RL2_PIXEL_DATAGRID.
+ \param num_samples number of samples per pixel (aka Bands)
+
+ \return the pointer to newly created Coverage Object: NULL on failure.
+
+ \sa rl2_destroy_pixel, rl2_compare_pixels, rl2_get_pixel_type,
+ rl2_get_pixel_sample_1bit,
+ rl2_set_pixel_sample_1bit, rl2_get_pixel_sample_2bit,
+ rl2_set_pixel_sample_2bit, rl2_get_pixel_sample_4bit,
+ rl2_set_pixel_sample_4bit, rl2_get_pixel_sample_int8,
+ rl2_set_pixel_sample_uint8, rl2_get_pixel_sample_int16,
+ rl2_set_pixel_sample_uint16, rl2_get_pixel_sample_int32,
+ rl2_set_pixel_sample_uint32, rl2_get_pixel_sample_float,
+ rl2_set_pixel_sample_float, rl2_get_pixel_sample_double,
+ rl2_set_pixel_sample_double, rl2_is_pixel_transparent,
+ rl2_is_pixel_opaque, rl2_set_pixel_transparent,
+ rl2_set_pixel_opaque
+
+ \note you are responsible to destroy (before or after) any allocated
+ Pixel object.
+ */
+ RL2_DECLARE rl2PixelPtr
+ rl2_create_pixel (unsigned char sample_type, unsigned char pixel_type,
+ unsigned char num_samples);
+
+ RL2_DECLARE rl2PixelPtr rl2_clone_pixel (rl2PixelPtr org);
+
+ RL2_DECLARE rl2PixelPtr rl2_create_triple_band_pixel (rl2PixelPtr org,
+ unsigned char
+ red_band,
+ unsigned char
+ green_band,
+ unsigned char
+ blue_band);
+
+ RL2_DECLARE rl2PixelPtr rl2_create_mono_band_pixel (rl2PixelPtr org,
+ unsigned char
+ mono_band);
+
+/**
+ Destroys a Pixel Object
+
+ \param pxl pointer to object to be destroyed
+
+ \sa rl2_create_pixel
+ */
+ RL2_DECLARE void rl2_destroy_pixel (rl2PixelPtr pxl);
+
+/**
+ Testing if two different Pixels are exactly the same
+
+ \param pxl1 pointer to the first Pixel Object.
+ \param pxl2 pointer to the second Pixel Object.
+
+ \return RL2_TRUE or RL2_FALSE; RL2_ERROR if any error is encountered.
+
+ \sa rl2_create_pixel
+ */
+ RL2_DECLARE int rl2_compare_pixels (rl2PixelPtr pxl1, rl2PixelPtr pxl2);
+
+/**
+ Retrieving the Sample Type from a Pixel Object
+
+ \param pxl pointer to the Pixel Object.
+ \param sample_type on completion the variable referenced by this
+ pointer will contain the Sampe Type.
+ \param pixel_type on completion the variable referenced by this
+ pointer will contain the Pixel Type.
+ \param num_bands on completion the variable referenced by this
+ pointer will contain the Number of Bands.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_pixel
+ */
+ RL2_DECLARE int rl2_get_pixel_type (rl2PixelPtr pxl,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *num_bands);
+
+/**
+ Retrieving the Pixel/Sample value from a Pixel Object [1 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample on completion the variable referenced by this
+ pointer will contain the Pixel/Sampe Value.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including querying a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_set_pixel_sample_1bit
+ */
+ RL2_DECLARE int rl2_get_pixel_sample_1bit (rl2PixelPtr pxl,
+ unsigned char *sample);
+
+/**
+ Assigning the Pixel/Sample value to a Pixel Object [1 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample the Pixel/Sampe Value to be set.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_get_pixel_sample_1bit
+ */
+ RL2_DECLARE int rl2_set_pixel_sample_1bit (rl2PixelPtr pxl,
+ unsigned char sample);
+
+/**
+ Retrieving the Pixel/Sample value from a Pixel Object [2 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample on completion the variable referenced by this
+ pointer will contain the Pixel/Sampe Value.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including querying a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_set_pixel_sample_2bit
+ */
+ RL2_DECLARE int rl2_get_pixel_sample_2bit (rl2PixelPtr pxl,
+ unsigned char *sample);
+
+/**
+ Assigning the Pixel/Sample value to a Pixel Object [2 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample the Pixel/Sampe Value to be set.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_get_pixel_sample_2bit
+ */
+ RL2_DECLARE int rl2_set_pixel_sample_2bit (rl2PixelPtr pxl,
+ unsigned char sample);
+
+/**
+ Retrieving the Pixel/Sample value from a Pixel Object [4 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample on completion the variable referenced by this
+ pointer will contain the Pixel/Sampe Value.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including querying a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_set_pixel_sample_4bit
+ */
+ RL2_DECLARE int rl2_get_pixel_sample_4bit (rl2PixelPtr pxl,
+ unsigned char *sample);
+
+/**
+ Assigning the Pixel/Sample value to a Pixel Object [4 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample the Pixel/Sampe Value to be set.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_get_pixel_sample_4bit
+ */
+ RL2_DECLARE int rl2_set_pixel_sample_4bit (rl2PixelPtr pxl,
+ unsigned char sample);
+
+/**
+ Retrieving the Pixel/Sample value from a Pixel Object [integer, 8 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample on completion the variable referenced by this
+ pointer will contain the Pixel/Sampe Value.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including querying a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_set_pixel_sample_int8
+ */
+ RL2_DECLARE int rl2_get_pixel_sample_int8 (rl2PixelPtr pxl, char *sample);
+
+/**
+ Assigning the Pixel/Sample value to a Pixel Object [integer, 8 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample the Pixel/Sampe Value to be set.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_get_pixel_sample_int8
+ */
+ RL2_DECLARE int rl2_set_pixel_sample_int8 (rl2PixelPtr pxl, char sample);
+
+/**
+ Retrieving the Pixel/Sample value from a Pixel Object [unsigned integer, 8 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param band the Sample/Band index (the first sample corresponds to index ZERO).
+ \param sample on completion the variable referenced by this
+ pointer will contain the Pixel/Sampe Value.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including querying a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_set_pixel_sample_uint8
+ */
+ RL2_DECLARE int rl2_get_pixel_sample_uint8 (rl2PixelPtr pxl, int band,
+ unsigned char *sample);
+
+/**
+ Assigning the Pixel/Sample value to a Pixel Object [unsigned integer, 8 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param band the Sample/Band index (the first sample corresponds to index ZERO).
+ \param sample the Pixel/Sampe Value to be set.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_get_pixel_sample_uint8
+ */
+ RL2_DECLARE int rl2_set_pixel_sample_uint8 (rl2PixelPtr pxl, int band,
+ unsigned char sample);
+
+/**
+ Retrieving the Pixel/Sample value from a Pixel Object [integer, 16 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample on completion the variable referenced by this
+ pointer will contain the Pixel/Sampe Value.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including querying a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_set_pixel_sample_int16
+ */
+ RL2_DECLARE int rl2_get_pixel_sample_int16 (rl2PixelPtr pxl, short *sample);
+
+/**
+ Assigning the Pixel/Sample value to a Pixel Object [integer, 16 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample the Pixel/Sampe Value to be set.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_get_pixel_sample_int16
+ */
+ RL2_DECLARE int rl2_set_pixel_sample_int16 (rl2PixelPtr pxl, short sample);
+
+/**
+ Retrieving the Pixel/Sample value from a Pixel Object [unsigned integer, 16 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param band the Sample/Band index (the first sample corresponds to index ZERO).
+ \param sample on completion the variable referenced by this
+ pointer will contain the Pixel/Sampe Value.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including querying a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_set_pixel_sample_uint16
+ */
+ RL2_DECLARE int rl2_get_pixel_sample_uint16 (rl2PixelPtr pxl, int band,
+ unsigned short *sample);
+
+/**
+ Assigning the Pixel/Sample value to a Pixel Object [unsigned integer, 16 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param band the Sample/Band index (the first sample corresponds to index ZERO).
+ \param sample the Pixel/Sampe Value to be set.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_get_pixel_sample_uint16
+ */
+ RL2_DECLARE int rl2_set_pixel_sample_uint16 (rl2PixelPtr pxl, int band,
+ unsigned short sample);
+
+/**
+ Retrieving the Pixel/Sample value from a Pixel Object [integer, 32 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample on completion the variable referenced by this
+ pointer will contain the Pixel/Sampe Value.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including querying a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_set_pixel_sample_int32
+ */
+ RL2_DECLARE int rl2_get_pixel_sample_int32 (rl2PixelPtr pxl, int *sample);
+
+/**
+ Assigning the Pixel/Sample value to a Pixel Object [integer, 32 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample the Pixel/Sampe Value to be set.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_get_pixel_sample_int32
+ */
+ RL2_DECLARE int rl2_set_pixel_sample_int32 (rl2PixelPtr pxl, int sample);
+
+/**
+ Retrieving the Pixel/Sample value from a Pixel Object [unsigned integer, 32 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample on completion the variable referenced by this
+ pointer will contain the Pixel/Sampe Value.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including querying a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_set_pixel_sample_uint32
+ */
+ RL2_DECLARE int rl2_get_pixel_sample_uint32 (rl2PixelPtr pxl,
+ unsigned int *sample);
+
+/**
+ Assigning the Pixel/Sample value to a Pixel Object [unsigned integer, 32 bit sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample the Pixel/Sampe Value to be set.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_get_pixel_sample_uint32
+ */
+ RL2_DECLARE int rl2_set_pixel_sample_uint32 (rl2PixelPtr pxl,
+ unsigned int sample);
+
+/**
+ Retrieving the Pixel/Sample value from a Pixel Object [floating point, single precision sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample on completion the variable referenced by this
+ pointer will contain the Pixel/Sampe Value.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including querying a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_set_pixel_sample_float
+ */
+ RL2_DECLARE int rl2_get_pixel_sample_float (rl2PixelPtr pxl, float *sample);
+
+/**
+ Assigning the Pixel/Sample value to a Pixel Object [floating point, single precision sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample the Pixel/Sampe Value to be set.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_get_pixel_sample_float
+ */
+ RL2_DECLARE int rl2_set_pixel_sample_float (rl2PixelPtr pxl, float sample);
+
+/**
+ Retrieving the Pixel/Sample value from a Pixel Object [floating point, double precision sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample on completion the variable referenced by this
+ pointer will contain the Pixel/Sampe Value.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including querying a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_set_pixel_sample_double
+ */
+ RL2_DECLARE int rl2_get_pixel_sample_double (rl2PixelPtr pxl,
+ double *sample);
+
+/**
+ Assigning the Pixel/Sample value to a Pixel Object [floating point, double precision sample]
+
+ \param pxl pointer to the Pixel Object.
+ \param sample the Pixel/Sampe Value to be set.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing a Pixel of mismatching PixelType).
+
+ \sa rl2_create_pixel, rl2_get_pixel_type, rl2_get_pixel_sample_double
+ */
+ RL2_DECLARE int rl2_set_pixel_sample_double (rl2PixelPtr pxl,
+ double sample);
+
+/**
+ Testing if a Pixel Object is Transparent
+
+ \param pxl pointer to the Pixel Object.
+ \param is_transparent on completion the variable referenced by this
+ pointer will contain RL2_TRUE or RL2_FALSE.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_pixel, rl2_is_pixel_opaque, rl2_set_pixel_transparent,
+ rl2_set_pixel_opaque
+ */
+ RL2_DECLARE int rl2_is_pixel_transparent (rl2PixelPtr pxl,
+ int *is_transparent);
+
+/**
+ Testing if a Pixel Object is Opaque
+
+ \param pxl pointer to the Pixel Object.
+ \param is_opaque on completion the variable referenced by this
+ pointer will contain RL2_TRUE or RL2_FALSE.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_pixel, rl2_is_pixel_transparent, rl2_set_pixel_transparent,
+ rl2_set_pixel_opaque
+ */
+ RL2_DECLARE int rl2_is_pixel_opaque (rl2PixelPtr pxl, int *is_opaque);
+
+/**
+ Forcing a Pixel Object to be Transparent
+
+ \param pxl pointer to the Pixel Object.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_pixel, rl2_is_pixel_opaque, rl2_is_pixel_transparent,
+ rl2_set_pixel_opaque
+ */
+ RL2_DECLARE int rl2_set_pixel_transparent (rl2PixelPtr pxl);
+
+/**
+ Forcing a Pixel Object to be Opaque
+
+ \param pxl pointer to the Pixel Object.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_pixel, rl2_is_pixel_opaque, rl2_is_pixel_transparent,
+ rl2_set_pixel_transparent
+ */
+ RL2_DECLARE int rl2_set_pixel_opaque (rl2PixelPtr pxl);
+
+/**
+ Allocates and initializes a new Palette object
+
+ \param num_entries total number of color entries for this Palette:
+ any valid palette should contain at least one entry and no more than 256 entries.
+
+ \return the pointer to newly created Palette Object: NULL on failure.
+
+ \sa rl2_destroy_palette, rl2_set_palette_color, rl2_get_palette_index,
+ rl2_set_palette_hexrgb, rl2_get_palette_entries, rl2_get_palette_colors,
+ rl2_get_palette_type
+
+ \note you are responsible to destroy (before or after) any allocated
+ Palette object.
+ */
+ RL2_DECLARE rl2PalettePtr rl2_create_palette (int num_entries);
+
+/**
+ Destroys a Palette Object
+
+ \param plt pointer to object to be destroyed
+
+ \sa rl2_create_palette
+ */
+ RL2_DECLARE void rl2_destroy_palette (rl2PalettePtr plt);
+
+/**
+ Assigns a Palette Color
+
+ \param plt pointer to the Palette Object
+ \param index references a Palette Entry [first Entry has index ZERO]
+ \param r Red component
+ \param g Green component
+ \param b Blue component
+
+ \return RL2_OK on success: RL2_ERROR on failure (invald Palette or invalid Index).
+
+ \sa rl2_create_palette, rl2_set_palette_hexrgb, rl2_get_palette_index,
+ rl2_get_palette_colors, rl2_get_palette_entries
+ */
+ RL2_DECLARE int
+ rl2_set_palette_color (rl2PalettePtr plt, int index,
+ unsigned char r, unsigned char g,
+ unsigned char b);
+
+/**
+ Assigns a Palette Color (Hex RGB)
+
+ \param plt pointer to the Palette Object
+ \param index references a Palette Entry [first Entry has index ZERO]
+ \param rgb an Hex RGB Color: "#ff0000" corresponds to Red, "#0000ff"
+ corresponds to Blue and so on.
+
+ \return RL2_OK on success: RL2_ERROR on failure (invald Palette or invalid Index).
+
+ \sa rl2_create_palette, rl2_set_palette_color, rl2_get_palette_index,
+ rl2_get_palette_colors, rl2_get_palette_entries
+ */
+ RL2_DECLARE int
+ rl2_set_palette_hexrgb (rl2PalettePtr plt, int index, const char *rgb);
+
+/**
+ Return the Palette Index corresponding to a given Color
+
+ \param plt pointer to the Palette Object
+ \param index on completion the variable referenced by this
+ pointer will contain the Index corresponding to the matching Entry.
+ \param r Red component
+ \param g Green component
+ \param b Blue component
+
+ \return RL2_OK on success: RL2_ERROR on failure (invald Palette or no matching Entry).
+
+ \sa rl2_create_palette
+ */
+ RL2_DECLARE int
+ rl2_get_palette_index (rl2PalettePtr plt, unsigned char *index,
+ unsigned char r, unsigned char g,
+ unsigned char b);
+
+/**
+ Retrieving the total number of Palette Entries
+
+ \param plt pointer to the Palette Object.
+ \param num_entries on completion the variable referenced by this
+ pointer will contain the total count of Colors.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_palette, rl2_get_palette_colors, rl2_set_palette_color,
+ rl2_set_palette_hexrgb
+ */
+ RL2_DECLARE int rl2_get_palette_entries (rl2PalettePtr plt,
+ unsigned short *num_entries);
+
+/**
+ Exports all Palette Colors as separate arrays for each component
+
+ \param plt pointer to the Palette Object
+ \param num_entries on completion the variable referenced by this
+ pointer will contain the total count of Colors (i.e. the size of each
+ one of the following arrays).
+ \param r on completion will point to an array of Red components
+ \param g on completion will point to an array of Green components
+ \param b on completion will point to an array of Blue components
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_palette
+
+ \note you are responsible to destroy (before or after) any array
+ created by rl2_get_palette_colors() by invoking rl2_free().
+ */
+ RL2_DECLARE int
+ rl2_get_palette_colors (rl2PalettePtr plt, unsigned short *num_entries,
+ unsigned char **r, unsigned char **g,
+ unsigned char **b);
+
+/**
+ Return the best fit Sample Type and Pixel Type for a given Palette Object
+
+ \param plt pointer to the Palette Object
+ \param sample_type on completion the variable referenced by this
+ pointer will contain the Sample Type corresponding to the Palette Object
+ (one of RL2_SAMPLE_1_BIT, RL2_SAMPLE_2_BIT, RL2_SAMPLE_4_BIT or RL2_SAMPLE_UINT8)
+ \param pixel_type on completion the variable referenced by this
+ pointer will contain the Pixel Type corresponding to the Palette Object
+ (one of RL2_PIXEL_PALETTE, RL2_PIXEL_MONOCHROME or RL2_PIXEL_GRAYSCALE)
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_palette
+ */
+ RL2_DECLARE int
+ rl2_get_palette_type (rl2PalettePtr plt, unsigned char *sample_type,
+ unsigned char *pixel_type);
+
+/**
+ Allocates and initializes a new Coverage object
+
+ \param name a text string intended to be the symbolic Coverage name.
+ \param sample_type one of RL2_SAMPLE_1_BIT, RL2_SAMPLE_2_BIT, RL2_SAMPLE_4_BIT,
+ RL2_SAMPLE_INT8, RL2_SAMPLE_UINT8, RL2_SAMPLE_INT16, RL2_SAMPLE_UINT16,
+ RL2_SAMPLE_INT32, RL2_SAMPLE_UINT32, RL2_SAMPLE_FLOAT or RL2_SAMPLE_DOUBLE.
+ \param pixel_type one of RL2_PIXEL_MONOCHROME, RL2_PIXEL_PALETTE, RL2_PIXEL_GRAYSCALE,
+ RL2_PIXEL_RGB, RL2_PIXEL_MULTIBAND, RL2_PIXEL_DATAGRID.
+ \param num_samples number of samples per pixel (aka Bands)
+ \param compression one of RL2_COMPRESSION_NONE, RL2_COMPRESSION_DEFLATE,
+ RL2_COMPRESSION_LZMA, RL2_COMPRESSION_GIF, RL2_COMPRESSION_PNG,
+ RL2_COMPRESSION_JPEG, RL2_COMPRESSION_LOSSY_WEBP or
+ RL2_COMPRESSION_LOSSLESS_WEBP
+ \param quality compression quality factor (0-100); only meaningfull for
+ JPEG or WEBP lossy compressions, ignored in any other case.
+ \param tile_width the individual tile width in pixels.
+ \param tile_height the individual tile height in pixels.
+ \param no_data pointer to a Pixel Object indented as NO-DATA value;
+ could be eventually NULL if not required.
+
+ \return the pointer to newly created Coverage Object: NULL on failure.
+
+ \sa rl2_destroy_coverage, rl2_coverage_georeference, rl2_get_coverage_name,
+ rl2_get_coverage_type, rl2_get_coverage_compression,
+ rl2_is_coverage_uncompressed, rl2_is_coverage_compression_lossless,
+ rl2_is_coverage_compression_lossy, rl2_get_coverage_tile_size,
+ rl2_get_coverage_no_data, rl2_create_coverage_pixel,
+ rl2_get_coverage_srid, rl2_get_coverage_resolution
+
+ \note you are responsible to destroy (before or after) any allocated
+ Coverage object.
+ */
+ RL2_DECLARE rl2CoveragePtr
+ rl2_create_coverage (const char *name, unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_samples,
+ unsigned char compression, int quality,
+ unsigned int tile_width,
+ unsigned int tile_height, rl2PixelPtr no_data);
+
+/**
+ Destroys a Coverage Object
+
+ \param cvg pointer to object to be destroyed
+
+ \sa rl2_create_coverage
+ */
+ RL2_DECLARE void rl2_destroy_coverage (rl2CoveragePtr cvg);
+
+/**
+ Assigns GeoReferencing parameters to a Coverage Object
+
+ \param cvg pointer to the Coverage Object.
+ \param srid a valid SRID identifier
+ \param horz_res horizontal pixel resolution: the size (measured
+ in map units) corresponding to a single Pixel at full
+ resolution.
+ \param vert_res vertical pixel resolution.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_coverage
+ */
+ RL2_DECLARE int
+ rl2_coverage_georeference (rl2CoveragePtr cvg, int srid,
+ double horz_res, double vert_res);
+
+/**
+ Retrieving the Name from a Coverage Object
+
+ \param cvg pointer to the Coverage Object.
+
+ \return pointer to the Name text string; NULL if any error is encountered.
+
+ \sa rl2_create_coverage
+ */
+ RL2_DECLARE const char *rl2_get_coverage_name (rl2CoveragePtr cvg);
+
+/**
+ Retrieving the Sample Type from a Coverage Object
+
+ \param cvg pointer to the Coverage Object.
+ \param sample_type on completion the variable referenced by this
+ pointer will contain the Sampe Type.
+ \param pixel_type on completion the variable referenced by this
+ pointer will contain the Pixel Type.
+ \param num_bands on completion the variable referenced by this
+ pointer will contain the Number of Bands.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_coverage
+ */
+ RL2_DECLARE int rl2_get_coverage_type (rl2CoveragePtr cvg,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *num_bands);
+
+/**
+ Retrieving the Compression Type from a Coverage Object
+
+ \param cvg pointer to the Coverage Object.
+ \param compression on completion the variable referenced by this
+ pointer will contain the Compression Type.
+ \param quality on completion the variable referenced by this
+ pointer will contain the Compression Quality.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_coverage
+ */
+ RL2_DECLARE int rl2_get_coverage_compression (rl2CoveragePtr cvg,
+ unsigned char *compression,
+ int *quality);
+
+/**
+ Testing if a Coverage Object is uncompressed or compressed
+
+ \param cvg pointer to the Coverage Object.
+ \param is_uncompressed on completion the variable referenced by this
+ pointer will contain RL2_TRUE or RL2_FALSE.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_coverage
+ */
+ RL2_DECLARE int rl2_is_coverage_uncompressed (rl2CoveragePtr cvg,
+ int *is_uncompressed);
+
+/**
+ Testing if a Coverage Object adopts a lossless compression
+
+ \param cvg pointer to the Coverage Object.
+ \param is_lossless on completion the variable referenced by this
+ pointer will contain RL2_TRUE or RL2_FALSE.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_coverage
+ */
+ RL2_DECLARE int rl2_is_coverage_compression_lossless (rl2CoveragePtr cvg,
+ int *is_lossless);
+
+/**
+ Testing if a Coverage Object adopts a lossy compression
+
+ \param cvg pointer to the Coverage Object.
+ \param is_lossy on completion the variable referenced by this
+ pointer will contain RL2_TRUE or RL2_FALSE.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_coverage
+ */
+ RL2_DECLARE int rl2_is_coverage_compression_lossy (rl2CoveragePtr cvg,
+ int *is_lossy);
+
+/**
+ Retrieving the Tile Size from a Coverage Object
+
+ \param cvg pointer to the Coverage Object.
+ \param tile_width on completion the variable referenced by this
+ pointer will contain the coverage's Tile Width.
+ \param tile_height on completion the variable referenced by this
+ pointer will contain the coverage's Tile Height.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_coverage
+ */
+ RL2_DECLARE int rl2_get_coverage_tile_size (rl2CoveragePtr cvg,
+ unsigned int *tile_width,
+ unsigned int *tile_height);
+
+/**
+ Retrieving the NO-DATA Pixel value from a Coverage Object
+
+ \param cvg pointer to the Coverage Object.
+
+ \return pointer to the Pixel Object representing NO-DATA value;
+ NULL if any error is encountered or if the Coverage has no NO-DATA value.
+
+ \sa rl2_create_coverage
+ */
+ RL2_DECLARE rl2PixelPtr rl2_get_coverage_no_data (rl2CoveragePtr cvg);
+
+/**
+ Creates a new Pixel Object suitable for a given Coverage Object
+
+ \param cvg pointer to the Coverage Object.
+
+ \return pointer to the newly created Pixel Object; NULL if any error is encountered.
+
+ \sa rl2_create_coverage, rl2_create_pixel, rl2_destroy_pixel
+
+ \note you are responsible to destroy (before or after) the allocated
+ Pixel object.
+ */
+ RL2_DECLARE rl2PixelPtr rl2_create_coverage_pixel (rl2CoveragePtr rst);
+
+/**
+ Retrieving the SRID from a Coverage Object
+
+ \param cvg pointer to the Coverage Object.
+ \param srid on completion the variable referenced by this
+ pointer will contain the coverage's SRID.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_coverage, rl2_get_coverage_resolution
+ */
+ RL2_DECLARE int rl2_get_coverage_srid (rl2CoveragePtr cvg, int *srid);
+
+/**
+ Retrieving the base resolution from a Coverage Object
+
+ \param cvg pointer to the Coverage Object.
+ \param hResolution on completion the variable referenced by this
+ pointer will contain the coverage's horizontal resolution.
+ \param vResolution on completion the variable referenced by this
+ pointer will contain the coverage's vertical resolution.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_coverage, rl2_get_coverage_srid
+ */
+ RL2_DECLARE int rl2_get_coverage_resolution (rl2CoveragePtr cvg,
+ double *hResolution,
+ double *vResolution);
+
+/**
+ Allocates and initializes a new Section object
+
+ \param name a text string intended to be the symbolic Section name.
+ \param compression one of RL2_COMPRESSION_NONE, RL2_COMPRESSION_DEFLATE,
+ RL2_COMPRESSION_LZMA, RL2_COMPRESSION_GIF, RL2_COMPRESSION_PNG,
+ RL2_COMPRESSION_JPEG, RL2_COMPRESSION_LOSSY_WEBP or
+ RL2_COMPRESSION_LOSSLESS_WEBP
+ \param tile_width the individual tile width in pixels.
+ \param tile_height the individual tile height in pixels.
+ \param rst pointer to a Raster Object.
+
+ \return the pointer to newly created Section Object: NULL on failure.
+
+ \sa rl2_destroy_section, rl2_get_section_name, rl2_get_section_compression,
+ rl2_is_section_uncompressed, rl2_is_section_compression_lossless,
+ rl2_is_section_compression_lossy, rl2_get_section_tile_width,
+ rl2_get_section_tile_height, rl2_get_section_raster,
+ rl2_section_from_gif, rl2_section_from_png, rl2_section_from_jpeg,
+ rl2_section_from_webp, rl2_section_to_gif, rl2_section_to_png,
+ rl2_section_to_jpeg, rl2_section_to_lossy_webp,
+ rl2_section_to_lossless_webp
+
+ \note you are responsible to destroy (before or after) any allocated
+ Section object.
+ */
+ RL2_DECLARE rl2SectionPtr
+ rl2_create_section (const char *name, unsigned char compression,
+ unsigned int tile_width,
+ unsigned int tile_height, rl2RasterPtr rst);
+
+/**
+ Allocates and initializes a new Section object from an external GIF image
+
+ \param path pathname leading to the external GIF image.
+
+ \return the pointer to newly created Section Object: NULL on failure.
+
+ \sa rl2_destroy_section, rl2_create_section, rl2_section_to_gif
+
+ \note you are responsible to destroy (before or after) any allocated
+ Section object.
+ */
+ RL2_DECLARE rl2SectionPtr rl2_section_from_gif (const char *path);
+
+/**
+ Allocates and initializes a new Section object from an external PMG image
+
+ \param path pathname leading to the external PNG image.
+
+ \return the pointer to newly created Section Object: NULL on failure.
+
+ \sa rl2_destroy_section, rl2_create_section, rl2_section_to_png
+
+ \note you are responsible to destroy (before or after) any allocated
+ Section object.
+ */
+ RL2_DECLARE rl2SectionPtr rl2_section_from_png (const char *path);
+
+/**
+ Allocates and initializes a new Section object from an external JPEG image
+
+ \param path pathname leading to the external JPEG image.
+
+ \return the pointer to newly created Section Object: NULL on failure.
+
+ \sa rl2_destroy_section, rl2_create_section, rl2_section_to_jpeg
+
+ \note you are responsible to destroy (before or after) any allocated
+ Section object.
+ */
+ RL2_DECLARE rl2SectionPtr rl2_section_from_jpeg (const char *path);
+
+/**
+ Allocates and initializes a new Section object from an external WEBP image
+
+ \param path pathname leading to the external WEBP image.
+
+ \return the pointer to newly created Section Object: NULL on failure.
+
+ \sa rl2_destroy_section, rl2_create_section, rl2_section_to_lossy_webp,
+ rl2_section_to_lossless_webp
+
+ \note you are responsible to destroy (before or after) any allocated
+ Section object.
+ */
+ RL2_DECLARE rl2SectionPtr rl2_section_from_webp (const char *path);
+
+/**
+ Exports a Section object as an external GIF image
+
+ \param scn pointer to the Section Object.
+ \param path pathname leading to the external GIF image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_section, rl2_section_from_gif
+ */
+ RL2_DECLARE int rl2_section_to_gif (rl2SectionPtr scn, const char *path);
+
+/**
+ Exports a Section object as an external PNG image
+
+ \param scn pointer to the Section Object.
+ \param path pathname leading to the external PNG image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_section, rl2_section_from_png
+ */
+ RL2_DECLARE int rl2_section_to_png (rl2SectionPtr scn, const char *path);
+
+/**
+ Exports a Section object as an external JPEG image
+
+ \param scn pointer to the Section Object.
+ \param path pathname leading to the external JPEG image.
+ \param quality compression quality factor (0-100).
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_section, rl2_section_from_jpeg
+ */
+ RL2_DECLARE int
+ rl2_section_to_jpeg (rl2SectionPtr scn, const char *path, int quality);
+
+/**
+ Exports a Section object as an external WEBP (lossy) image
+
+ \param scn pointer to the Section Object.
+ \param path pathname leading to the external JPEG image.
+ \param quality compression quality factor (0-100).
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_section, rl2_section_from_jpeg
+ */
+ RL2_DECLARE int rl2_section_to_lossy_webp (rl2SectionPtr scn,
+ const char *path, int quality);
+
+/**
+ Exports a Section object as an external WEBP (lossless) image
+
+ \param scn pointer to the Section Object.
+ \param path pathname leading to the external WEBP image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_section, rl2_section_from_webp
+ */
+ RL2_DECLARE int rl2_section_to_lossless_webp (rl2SectionPtr scn,
+ const char *path);
+
+/**
+ Destroys a Section Object
+
+ \param scn pointer to object to be destroyed
+
+ \sa rl2_create_section
+ */
+ RL2_DECLARE void rl2_destroy_section (rl2SectionPtr scn);
+
+/**
+ Retrieving the Name from a Section Object
+
+ \param scn pointer to the Section Object.
+
+ \return pointer to the Name text string; NULL if any error is encountered.
+
+ \sa rl2_create_section
+ */
+ RL2_DECLARE const char *rl2_get_section_name (rl2SectionPtr scn);
+
+/**
+ Retrieving the Compression Type from a Section Object
+
+ \param scn pointer to the Section Object.
+ \param compression on completion the variable referenced by this
+ pointer will contain the section's Compression Type.
+ \param rst pointer to the Raster Object.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_section
+ */
+ RL2_DECLARE int rl2_get_section_compression (rl2SectionPtr scn,
+ unsigned char *compression);
+
+/**
+ Testing if a Section Object is uncompressed or compressed
+
+ \param scn pointer to the Section Object.
+ \param is_uncompressed on completion the variable referenced by this
+ pointer will contain RL2_TRUE or RL2_FALSE.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_section
+ */
+ RL2_DECLARE int rl2_is_section_uncompressed (rl2SectionPtr scn,
+ int *is_uncompressed);
+
+/**
+ Testing if a Section Object adopts a lossless compression
+
+ \param scn pointer to the Section Object.
+ \param is_lossless on completion the variable referenced by this
+ pointer will contain RL2_TRUE or RL2_FALSE.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_section
+ */
+ RL2_DECLARE int rl2_is_section_compression_lossless (rl2SectionPtr scn,
+ int *is_lossless);
+
+/**
+ Testing if a Section Object adopts a lossy compression
+
+ \param scn pointer to the Section Object.
+ \param is_lossy on completion the variable referenced by this
+ pointer will contain RL2_TRUE or RL2_FALSE.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_section
+ */
+ RL2_DECLARE int rl2_is_section_compression_lossy (rl2SectionPtr scn,
+ int *is_lossy);
+
+/**
+ Retrieving the Tile Size from a Section Object
+
+ \param scn pointer to the Section Object.
+ \param tile_width on completion the variable referenced by this
+ pointer will contain the section's Tile Width.
+ \param tile_height on completion the variable referenced by this
+ pointer will contain the section's Tile Height.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_section
+ */
+ RL2_DECLARE int rl2_get_section_tile_size (rl2SectionPtr scn,
+ unsigned int *tile_width,
+ unsigned int *tile_height);
+
+/**
+ Return a reference to the Raster Object encapsulated within a Section Object
+
+ \param cvg pointer to the Section Object.
+
+ \return pointer to the Raster Object; NULL if any error is encountered.
+
+ \sa rl2_create_section
+
+ \note full ownership of the referenced Raster Object will still belong to the Section Object.
+ */
+ RL2_DECLARE rl2RasterPtr rl2_get_section_raster (rl2SectionPtr scn);
+
+/**
+ Allocates and initializes a new Raster object
+
+ \param width Raster Width (in pixels).
+ \param height Raster Height (in pixels).
+ \param sample_type one of RL2_SAMPLE_1_BIT, RL2_SAMPLE_2_BIT, RL2_SAMPLE_4_BIT,
+ RL2_SAMPLE_INT8, RL2_SAMPLE_UINT8, RL2_SAMPLE_INT16, RL2_SAMPLE_UINT16,
+ RL2_SAMPLE_INT32, RL2_SAMPLE_UINT32, RL2_SAMPLE_FLOAT or RL2_SAMPLE_DOUBLE.
+ \param pixel_type one of RL2_PIXEL_MONOCHROME, RL2_PIXEL_PALETTE, RL2_PIXEL_GRAYSCALE,
+ RL2_PIXEL_RGB, RL2_PIXEL_MULTIBAND, RL2_PIXEL_DATAGRID.
+ \param num_samples number of samples per pixel (aka Bands)
+ \param bufpix pointer to the Buffer containing all Pixels
+ \param bufpix_size size (in bytes) of the above Buffer
+ \param palette pointer to a Palette object (NULL is the Pixel Type doesn't require a Palette)
+ \param mask pointer to an optional Transparency Mask (may be NULL if no Mask is required)
+ \param mask_size size (in bytes) of the above Mask (ZERO if no Mask is required)
+ \param no_data pointer to a Pixel Object indented as NO-DATA value;
+ could be eventually NULL if not required.
+
+ \return the pointer to newly created Raster Object: NULL on failure.
+
+ \sa rl2_destroy_raster, rl2_get_raster_size,
+ rl2_get_raster_raster_type, rl2_get_raster_pixel_type,
+ rl2_get_raster_bands, rl2_get_raster_no_data, rl2_get_raster_srid,
+ rl2_get_raster_horizontal_resolution, rl2_get_raster_vertical_resolution,
+ rl2_get_raster_minX, rl2_get_raster_minY, rl2_get_raster_maxX,
+ rl2_get_raster_maxY, rl2_create_raster_pixel,
+ rl2_raster_georeference_center, rl2_raster_georeference_upper_left,
+ rl2_raster_georeference_lower_left, rl2_raster_georeference_upper_right,
+ rl2_raster_georeference_lower_right, rl2_raster_georeference_frame,
+ rl2_raster_data_to_1bit, rl2_raster_data_to_2bit, rl2_raster_data_to_4bit,
+ rl2_raster_data_to_int8, rl2_raster_data_to_uint8, rl2_raster_data_to_int16,
+ rl2_raster_data_to_uint16, rl2_raster_data_to_int32, rl2_raster_data_to_uint32,
+ rl2_raster_data_to_float, rl2_raster_data_to_double, rl2_raster_band_to_uint8,
+ rl2_raster_band_to_uint16, rl2_raster_bands_to_RGB, rl2_raster_to_gif,
+ rl2_raster_to_png, rl2_raster_to_jpeg, rl2_raster_to_lossless_webp,
+ rl2_raster_to_lossy_webp, rl2_raster_from_gif, rl2_raster_from_png,
+ rl2_raster_from_jpeg, rl2_raster_from_webp, rl2_raster_from_tiff
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster object.
+ */
+ RL2_DECLARE rl2RasterPtr
+ rl2_create_raster (unsigned int width, unsigned int height,
+ unsigned char sample_type, unsigned char pixel_type,
+ unsigned char num_samples, unsigned char *bufpix,
+ int bufpix_size, rl2PalettePtr palette,
+ unsigned char *mask, int mask_size,
+ rl2PixelPtr no_data);
+
+/**
+ Destroys a Raster Object
+
+ \param rst pointer to object to be destroyed
+
+ \sa rl2_create_raster
+ */
+ RL2_DECLARE void rl2_destroy_raster (rl2RasterPtr rst);
+
+/**
+ Retrieving the Width/height dimensions from a Raster Object
+
+ \param rst pointer to the Raster Object.
+ \param width on completion the variable referenced by this
+ pointer will contain the raster's Width.
+ \param height on completion the variable referenced by this
+ pointer will contain the raster's Height.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster
+ */
+ RL2_DECLARE int rl2_get_raster_size (rl2RasterPtr rst,
+ unsigned int *width,
+ unsigned int *height);
+
+/**
+ Retrieving the Sample Type from a Raster Object
+
+ \param rst pointer to the Raster Object.
+ \param sample_type on completion the variable referenced by this
+ pointer will contain the Sampe Type.
+ \param pixel_type on completion the variable referenced by this
+ pointer will contain the Pixel Type.
+ \param num_bands on completion the variable referenced by this
+ pointer will contain the Number of Bands.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster
+ */
+ RL2_DECLARE int rl2_get_raster_type (rl2RasterPtr rst,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *num_bands);
+
+/**
+ Explicitly sets the NO-DATA Pixel value for a Raster Object
+
+ \param rst pointer to the Raster Object.
+ \param no_data pointer to a Pixel Object
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_get_raster_no_data
+ */
+ RL2_DECLARE int rl2_set_raster_no_data (rl2RasterPtr rst,
+ rl2PixelPtr no_data);
+
+/**
+ Retrieving the NO-DATA Pixel value from a Raster Object
+
+ \param rst pointer to the Raster Object.
+
+ \return pointer to the Pixel Object representing NO-DATA value;
+ NULL if any error is encountered or if the Raster has no NO-DATA value.
+
+ \sa rl2_create_raster, rl2_set_raster_no_data
+ */
+ RL2_DECLARE rl2PixelPtr rl2_get_raster_no_data (rl2RasterPtr rst);
+
+/**
+ Retrieving the SRID from a Raster Object
+
+ \param rst pointer to the Raster Object.
+ \param srid on completion the variable referenced by this
+ pointer will contain the raster's SRID.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster
+ */
+ RL2_DECLARE int rl2_get_raster_srid (rl2RasterPtr rst, int *srid);
+
+/**
+ Retrieving the Pixel resolution from a Raster Object
+
+ \param rst pointer to the Raster Object.
+ \param hResolution on completion the variable referenced by this
+ pointer will contain the raster's Horizontal Resolution.
+ \param vResolution on completion the variable referenced by this
+ pointer will contain the raster's Vertical Resolution.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster
+ */
+ RL2_DECLARE int rl2_get_raster_resolution (rl2RasterPtr rst,
+ double *hResolution,
+ double *vResolution);
+
+/**
+ Retrieving the full extent from a Raster Object
+
+ \param rst pointer to the Raster Object.
+ \param minX on completion the variable referenced by this
+ pointer will contain the raster's minimum X coordinate.
+ \param minY on completion the variable referenced by this
+ pointer will contain the raster's minimum Y coordinate.
+ \param maxX on completion the variable referenced by this
+ pointer will contain the raster's maximum X coordinate.
+ \param maxY on completion the variable referenced by this
+ pointer will contain the raster's maximum Y coordinate.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster
+ */
+ RL2_DECLARE int rl2_get_raster_extent (rl2RasterPtr rst,
+ double *minX, double *minY,
+ double *maxX, double *maxY);
+
+/**
+ Retrieving the bounding box from a Raster Object
+
+ \param rst pointer to the Raster Object.
+
+ \return a Geometry Object (rectangle) corresponding to the Raster's BBox;
+ NULL if any error is encountered or if the Raster doesn't support any GeoReferencing.
+
+ \sa rl2_create_raster
+ */
+ RL2_DECLARE gaiaGeomCollPtr rl2_get_raster_bbox (rl2RasterPtr rst);
+
+/**
+ Creates a new Pixel Object suitable for a given Raster Object
+
+ \param rst pointer to the Raster Object.
+
+ \return pointer to the newly created Pixel Object; NULL if any error is encountered.
+
+ \sa rl2_create_raster, rl2_create_pixel, rl2_destroy_pixel
+
+ \note you are responsible to destroy (before or after) the allocated
+ Pixel object.
+ */
+ RL2_DECLARE rl2PixelPtr rl2_create_raster_pixel (rl2RasterPtr rst);
+
+/**
+ Georeferencing a Raster Object (by specifying its Center Point)
+
+ \param rst pointer to the Raster Object.
+ \param srid the SRID value
+ \param horz_res horizontal pixel resolution: the size (measured
+ in map units) corresponding to a single Pixel.
+ \param vert_res vertical pixel resolution.
+ \param cx map X coordinate corresponding to the Raster's center point.
+ \param cy map Y coordinate corresponding to the Raster's center point.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_georeference_upper_left,
+ rl2_raster_georeference_lower_left, rl2_raster_georeference_upper_right,
+ rl2_raster_georeference_lower_right, rl2_raster_georeference_frame
+ */
+ RL2_DECLARE int
+ rl2_raster_georeference_center (rl2RasterPtr rst, int srid,
+ double horz_res, double vert_res,
+ double cx, double cy);
+
+/**
+ Georeferencing a Raster Object (by specifying its Upper-Left Corner)
+
+ \param rst pointer to the Raster Object.
+ \param srid the SRID value
+ \param horz_res horizontal pixel resolution: the size (measured
+ in map units) corresponding to a single Pixel.
+ \param vert_res vertical pixel resolution.
+ \param x map X coordinate corresponding to the Raster's upper-left corner.
+ \param y map Y coordinate corresponding to the Raster's upper-left corner.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_georeference_center,
+ rl2_raster_georeference_lower_left, rl2_raster_georeference_upper_right,
+ rl2_raster_georeference_lower_right, rl2_raster_georeference_frame
+ */
+ RL2_DECLARE int
+ rl2_raster_georeference_upper_left (rl2RasterPtr rst, int srid,
+ double horz_res, double vert_res,
+ double x, double y);
+
+
+/**
+ Georeferencing a Raster Object (by specifying its Lower-Left Corner)
+
+ \param rst pointer to the Raster Object.
+ \param srid the SRID value
+ \param horz_res horizontal pixel resolution: the size (measured
+ in map units) corresponding to a single Pixel.
+ \param vert_res vertical pixel resolution.
+ \param x map X coordinate corresponding to the Raster's lower-left corner.
+ \param y map Y coordinate corresponding to the Raster's lower-left corner.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_georeference_center,
+ rl2_raster_georeference_upper_left, rl2_raster_georeference_upper_right,
+ rl2_raster_georeference_lower_right, rl2_raster_georeference_frame
+ */
+ RL2_DECLARE int
+ rl2_raster_georeference_lower_left (rl2RasterPtr rst, int srid,
+ double horz_res, double vert_res,
+ double x, double y);
+
+
+/**
+ Georeferencing a Raster Object (by specifying its Upper-Right Corner)
+
+ \param rst pointer to the Raster Object.
+ \param srid the SRID value
+ \param horz_res horizontal pixel resolution: the size (measured
+ in map units) corresponding to a single Pixel.
+ \param vert_res vertical pixel resolution.
+ \param x map X coordinate corresponding to the Raster's upper-right corner.
+ \param y map Y coordinate corresponding to the Raster's upper-right corner.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_georeference_center, rl2_raster_georeference_upper_left,
+ rl2_raster_georeference_lower_left, rl2_raster_georeference_lower_right,
+ rl2_raster_georeference_frame
+ */
+ RL2_DECLARE int
+ rl2_raster_georeference_upper_right (rl2RasterPtr rst, int srid,
+ double horz_res, double vert_res,
+ double x, double y);
+
+/**
+ Georeferencing a Raster Object (by specifying its Lower-Right Corner)
+
+ \param rst pointer to the Raster Object.
+ \param srid the SRID value
+ \param horz_res horizontal pixel resolution: the size (measured
+ in map units) corresponding to a single Pixel.
+ \param vert_res vertical pixel resolution.
+ \param x map X coordinate corresponding to the Raster's lower-right corner.
+ \param y map Y coordinate corresponding to the Raster's lower-right corner.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_georeference_center, rl2_raster_georeference_upper_left,
+ rl2_raster_georeference_upper_right, rl2_raster_georeference_lower_left,
+ rl2_raster_georeference_frame
+ */
+ RL2_DECLARE int
+ rl2_raster_georeference_lower_right (rl2RasterPtr rst, int srid,
+ double horz_res, double vert_res,
+ double x, double y);
+
+/**
+ Georeferencing a Raster Object (by specifying its Corners)
+
+ \param rst pointer to the Raster Object.
+ \param srid the SRID value
+ \param min_x map X coordinate corresponding to the Raster's lower-left corner.
+ \param min_y map Y coordinate corresponding to the Raster's lower-letf corner.
+ \param max_x map X coordinate corresponding to the Raster's upper-right corner.
+ \param max_y map Y coordinate corresponding to the Raster's upper-right corner.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_georeference_center, rl2_raster_georeference_upper_left,
+ rl2_raster_georeference_upper_right, rl2_raster_georeference_lower_left,
+ rl2_raster_georeference_lower_right
+ */
+ RL2_DECLARE int
+ rl2_raster_georeference_frame (rl2RasterPtr rst, int srid, double min_x,
+ double min_y, double max_x,
+ double max_y);
+
+/**
+ Retrieves a Pixel from a Raster Object
+
+ \param rst pointer to the Raster Object.
+ \param pxl pointer to an already allocated Pixel Object receiving the pixel's
+ values from the raster.
+ \param row pixel's row number.
+ \param col pixel's column numer: pixels are structured as a rectangular array.
+ Pixel [0,0] is always positioned on the raster's left-upper corner.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_create_pixel, rl2_get_raster_size,
+ rl2_set_raster_pixel
+ */
+ RL2_DECLARE int
+ rl2_get_raster_pixel (rl2RasterPtr rst, rl2PixelPtr pxl,
+ unsigned int row, unsigned int col);
+
+/**
+ Retrieves a Pixel from a Raster Object
+
+ \param rst pointer to the Raster Object.
+ \param pxl pointer to a Pixel Object containing the pixel's
+ values to be stored within the raster.
+ \param row pixel's row number.
+ \param col pixel's column numer: pixels are structured as a rectangular array.
+ Pixel [0,0] is always positioned on the raster's left-upper corner.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_create_pixel, rl2_get_raster_size,
+ rl2_get_raster_pixel
+ */
+ RL2_DECLARE int
+ rl2_set_raster_pixel (rl2RasterPtr rst, rl2PixelPtr pxl,
+ unsigned int row, unsigned int col);
+
+/**
+ Encodes a Raster Object into the corresponding BLOB serialized format
+
+ \param rst pointer to the Raster Object.
+ \param compression one of RL2_COMPRESSION_NONE, RL2_COMPRESSION_DEFLATE,
+ RL2_COMPRESSION_LZMA, RL2_COMPRESSION_GIF, RL2_COMPRESSION_PNG,
+ RL2_COMPRESSION_JPEG, RL2_COMPRESSION_LOSSY_WEBP or
+ RL2_COMPRESSION_LOSSLESS_WEBP
+ \param blob_odd on completion will point to the created encoded BLOB ("odd" half).
+ \param blob_odd_sz on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the "odd" BLOB.
+ \param blob_even on completion will point to the created encoded BLOB ("even" half).
+ \param blob_even_sz on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the "even" BLOB.
+ \param quality compression quality factor (0-100); only meaningfull for
+ JPEG or WEBP lossy compressions, ignored in any other case.
+ \param litte_endian (boolean) accordingly to required BLOB endianness.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_decode, rl2_get_raster_statistics
+
+ \note both "odd" and "even" BLOB objects corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocations in
+ the most appropriate way.
+
+ \note some specific encoding doesn't require the "even" BLOB; so be prepared
+ to get a NULL pointer in this case.
+ */
+ RL2_DECLARE int
+ rl2_raster_encode (rl2RasterPtr rst, int compression,
+ unsigned char **blob_odd, int *blob_odd_sz,
+ unsigned char **blob_even, int *blob_even_sz,
+ int quality, int little_endian);
+
+/**
+ Tests a Raster Tile Object for validity - BLOB serialized format
+
+ \param level Pyramid level index (full resolution always corresponds to the ZERO index)
+ \param tile_width the individual tile width in pixels.
+ \param tile_height the individual tile height in pixels.
+ \param blob_odd pointer to the encoded BLOB ("odd" half).
+ \param blob_odd_sz size (in bytes) of the "odd" BLOB.
+ \param blob_even pointer to the encoded BLOB ("even" half): could be NULL.
+ \param blob_even_sz size (in bytes) of the "even" BLOB: could be ZERO.
+ \param sample_type sample type of the belonging Coverage
+ \param pixel_type pixel type of the belonging Coverage
+ \param num_bands number of bands of the belonging Coverage
+ \param compression of the belonging Coverage
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_encode, rl2_get_raster_statistics
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster object.
+
+ \note some specific encoding doesn't require the "even" BLOB; in this case
+ you should set blob_even to NULL and blob_even_sz to ZERO.
+ */
+ RL2_DECLARE int
+ rl2_is_valid_dbms_raster_tile (unsigned short level,
+ unsigned int tile_width,
+ unsigned int tile_height,
+ const unsigned char *blob_odd,
+ int blob_odd_sz,
+ const unsigned char *blob_even,
+ int blob_even_sz,
+ unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_bands,
+ unsigned char compression);
+
+/**
+ Decodes a Raster Object from the corresponding BLOB serialized format
+
+ \param scale image ratio: one of RL2_SCALE_1 (1:1), RL2_SCALE_2 (1:2),
+ RL2_SCALE_4 (1:4) or RL2_SCALE_8 (1:8)
+ \param blob_odd pointer to the encoded BLOB ("odd" half).
+ \param blob_odd_sz size (in bytes) of the "odd" BLOB.
+ \param blob_even pointer to the encoded BLOB ("even" half): could be NULL.
+ \param blob_even_sz size (in bytes) of the "even" BLOB: could be ZERO.
+ \param palette pointer to a Palette object (could be NULL, but it could
+ be strictly required by Palette-based tiles)
+
+ \return the pointer to newly created Raster Object: NULL on failure.
+
+ \sa rl2_create_raster, rl2_raster_encode, rl2_get_raster_statistics,
+ rl2_is_valid_dbms_raster_tile
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster object.
+
+ \note some specific encoding doesn't require the "even" BLOB; in this case
+ you should set blob_even to NULL and blob_even_sz to ZERO.
+ */
+ RL2_DECLARE rl2RasterPtr
+ rl2_raster_decode (int scale, const unsigned char *blob_odd,
+ int blob_odd_sz, const unsigned char *blob_even,
+ int blob_even_sz, rl2PalettePtr palette);
+
+/**
+ Allocates and initializes a new Raster Statistics object
+
+ \param sample_type one of RL2_SAMPLE_1_BIT, RL2_SAMPLE_2_BIT, RL2_SAMPLE_4_BIT,
+ RL2_SAMPLE_INT8, RL2_SAMPLE_UINT8, RL2_SAMPLE_INT16, RL2_SAMPLE_UINT16,
+ RL2_SAMPLE_INT32, RL2_SAMPLE_UINT32, RL2_SAMPLE_FLOAT or RL2_SAMPLE_DOUBLE.
+ \param num_samples number of samples per pixel (aka Bands)
+
+ \return the pointer to newly created Raster Statistics Object: NULL on failure.
+
+ \sa rl2_destroy_raster_statistic, rl2_get_raster_statistics
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster Statistics object.
+ */
+ RL2_DECLARE rl2RasterStatisticsPtr rl2_create_raster_statistics (unsigned
+ char
+ sample_type,
+ unsigned
+ char
+ num_samples);
+
+/**
+ Destroys a Raster Statistics Object
+
+ \param stats pointer to object to be destroyed
+
+ \sa rl2_create_raster_statistics
+ */
+ RL2_DECLARE void rl2_destroy_raster_statistics (rl2RasterStatisticsPtr
+ stats);
+
+/**
+ Computes the Raster Statistics from BLOB serialized format
+
+ \param blob_odd pointer to the encoded BLOB ("odd" half).
+ \param blob_odd_sz size (in bytes) of the "odd" BLOB.
+ \param blob_even pointer to the encoded BLOB ("even" half): could be NULL.
+ \param blob_even_sz size (in bytes) of the "even" BLOB: could be ZERO.
+ \param palette pointer to a Palette object (could be NULL, but it could
+ be strictly required by Palette-based tiles)
+ \param no_data NO-DATA pixel value (could be eventually NULL)
+
+ \return the pointer to newly created Raster Statistics Object: NULL on failure.
+
+ \sa rl2_destroy_raster_statistics, rl2_aggregate_raster_statistics,
+ rl2_serialize_dbms_raster_statistics, rl2_deserialize_dbms_raster_statistics,
+ rl2_get_raster_statistics_summary, rl2_get_band_statistics
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster Statistics object.
+ */
+ RL2_DECLARE rl2RasterStatisticsPtr
+ rl2_get_raster_statistics (const unsigned char *blob_odd,
+ int blob_odd_sz,
+ const unsigned char *blob_even,
+ int blob_even_sz, rl2PalettePtr palette,
+ rl2PixelPtr no_data);
+
+/**
+ Computes the Raster Statistics from a Raster object
+
+ \param raster pointer to a valid Raster object
+
+ \return the pointer to newly created Raster Statistics Object: NULL on failure.
+
+ \sa rl2_destroy_raster_statistics, rl2_get_band_statistics
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster Statistics object.
+ */
+ RL2_DECLARE rl2RasterStatisticsPtr rl2_build_raster_statistics (rl2RasterPtr
+ raster,
+ rl2PixelPtr
+ noData);
+
+/**
+ Encodes a Raster Statistics Object into the corresponding BLOB serialized format
+
+ \param stats pointer to the Raster Statistics Object.
+ \param blob on completion will point to the created encoded BLOB.
+ \param blob_sz on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the BLOB.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster_statistics, rl2_get_raster_statistics,
+ rl2_deserialize_dbms_raster_statistics, rl2_is_valid_dbms_raster_statistics
+
+ \note the returned BLOB object corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+ */
+ RL2_DECLARE int
+ rl2_serialize_dbms_raster_statistics (rl2RasterStatisticsPtr stats,
+ unsigned char **blob,
+ int *blob_sz);
+
+/**
+ Tests a Raster Statistics Object for validity - BLOB serialized format
+
+ \param blob pointer to the encoded BLOB encoded object.
+ \param blob_sz size (in bytes) of the BLOB encoded object.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster_statistics, rl2_get_raster_statistics,
+ rl2_deserialize_dbms_raster_statistics, rl2_is_valid_dbms_raster_statistics
+
+ \note the returned BLOB object corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+ */
+ RL2_DECLARE int
+ rl2_is_valid_dbms_raster_statistics (const unsigned char *blob,
+ int blob_sz,
+ unsigned char sample_type,
+ unsigned char num_bands);
+
+/**
+ Decodes a Raster Statistics Object from the corresponding BLOB serialized format
+
+ \param blob pointer to the encoded BLOB encoded object.
+ \param blob_sz size (in bytes) of the BLOB encoded object.
+
+ \return the pointer to newly created Raster Statistics Object: NULL on failure.
+
+ \sa rl2_create_raster_statistics, rl2_serialize_dbms_raster_statistics,
+ rl2_get_raster_statistics_summary, rl2_get_band_statistics
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster Statistics object.
+ */
+ RL2_DECLARE rl2RasterStatisticsPtr
+ rl2_deserialize_dbms_raster_statistics (const unsigned char *blob,
+ int blob_sz);
+
+/**
+ Encodes a Raster Statistics Object into the corresponding BLOB serialized format
+
+ \param stats_in pointer to the input Raster Statistics Object.
+ \param stats_out pointer to the output Raster Statistics Object.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster_statistics, rl2_get_raster_statistics,
+ rl2_get_raster_statistics_summary, rl2_get_band_statistics
+ */
+ RL2_DECLARE int
+ rl2_aggregate_raster_statistics (rl2RasterStatisticsPtr stats_in,
+ rl2RasterStatisticsPtr stats_out);
+
+/**
+ Return summary values from a Raster Statistics Object
+
+ \param stats pointer to the input Raster Statistics Object.
+ \param no_data on completion the variable referenced by this
+ pointer will contain the total count of NO-DATA pixels.
+ \param count on completion the variable referenced by this
+ pointer will contain the total count of valid pixels.
+ \param sample_type on completion the variable referenced by this
+ pointer will contain the Sampe Type.
+ \param num_bands on completion the variable referenced by this
+ pointer will contain the Number of Bands.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster_statistics, rl2_get_raster_statistics,
+ rl2_aggregate_raster_statistics, rl2_get_band_statistics
+ */
+ RL2_DECLARE int
+ rl2_get_raster_statistics_summary (rl2RasterStatisticsPtr stats,
+ double *no_data, double *count,
+ unsigned char *sample_type,
+ unsigned char *num_bands);
+
+/**
+ Return summary values from a single Band (Raster Statistics Object)
+
+ \param stats pointer to the input Raster Statistics Object.
+ \param band Band index.
+ \param min on completion the variable referenced by this
+ pointer will contain the minimum pixel value.
+ \param max on completion the variable referenced by this
+ pointer will contain the maximum pixel value.
+ \param mean on completion the variable referenced by this
+ pointer will contain the mean of all pixel values.
+ \param variance on completion the variable referenced by this
+ pointer will contain the Variance.
+ \param standard_deviation on completion the variable referenced by this
+ pointer will contain the Standard Deviation.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster_statistics, rl2_get_raster_statistics,
+ rl2_aggregate_raster_statistics, rl2_get_raster_statistics_summary
+ */
+ RL2_DECLARE int
+ rl2_get_band_statistics (rl2RasterStatisticsPtr stats,
+ unsigned char band, double *min, double *max,
+ double *mean, double *variance,
+ double *standard_deviation);
+
+/**
+ Creates an RGB pixel array from a Raster
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_RGBA, rl2_raster_data_to_ARGB,
+ rl2_raster_data_to_BGR, rl2_raster_data_to_BGRA
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Pixel components are always organized as RGBRGBRGB....RGB
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_RGB (rl2RasterPtr rst, unsigned char **buffer,
+ int *buf_size);
+
+/**
+ Creates an RGBA pixel array from a Raster
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_RGB, rl2_raster_data_to_ARGB,
+ rl2_raster_data_to_BGR, rl2_raster_data_to_BGRA
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Pixel components are always organized as RGBARGBARGBA....RGBA
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_RGBA (rl2RasterPtr rst, unsigned char **buffer,
+ int *buf_size);
+
+/**
+ Creates an ARGB pixel array from a Raster
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_RGB, rl2_raster_data_to_RGBA,
+ rl2_raster_data_to_BGR, rl2_raster_data_to_BGRA
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Pixel components are always organized as ARGBARGBARGB....ARGB
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_ARGB (rl2RasterPtr rst, unsigned char **buffer,
+ int *buf_size);
+
+/**
+ Creates an BGR pixel array from a Raster
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_RGB, rl2_raster_data_to_RGBA,
+ rl2_raster_data_to_ARGB, rl2_raster_data_to_BGRA
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Pixel components are always organized as BGRBGRBGR...BGR
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_BGR (rl2RasterPtr rst, unsigned char **buffer,
+ int *buf_size);
+
+/**
+ Creates an BGRA pixel array from a Raster
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_RGB, rl2_raster_data_to_RGBA,
+ rl2_raster_data_to_ARGB, rl2_raster_data_to_BGR
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Pixel components are always organized as BGRABGRABGRA...BGRA
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_BGRA (rl2RasterPtr rst, unsigned char **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Raster (1 bit per sample)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_2bit, rl2_raster_data_to_4bit,
+ rl2_raster_data_to_int8, rl2_raster_data_to_uint8, rl2_raster_data_to_int16,
+ rl2_raster_data_to_uint16, rl2_raster_data_to_int32, rl2_raster_data_to_uint32,
+ rl2_raster_data_to_float, rl2_raster_data_to_double
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_1bit (rl2RasterPtr rst, unsigned char **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Raster (2 bit per sample)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_1bit, rl2_raster_data_to_4bit,
+ rl2_raster_data_to_int8, rl2_raster_data_to_uint8, rl2_raster_data_to_int16,
+ rl2_raster_data_to_uint16, rl2_raster_data_to_int32, rl2_raster_data_to_uint32,
+ rl2_raster_data_to_float, rl2_raster_data_to_double
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_2bit (rl2RasterPtr rst, unsigned char **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Raster (4 bit per sample)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_1bit, rl2_raster_data_to_2bit,
+ rl2_raster_data_to_int8, rl2_raster_data_to_uint8, rl2_raster_data_to_int16,
+ rl2_raster_data_to_uint16, rl2_raster_data_to_int32, rl2_raster_data_to_uint32,
+ rl2_raster_data_to_float, rl2_raster_data_to_double
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_4bit (rl2RasterPtr rst, unsigned char **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Raster (Integer, 8 bit sample)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_1bit, rl2_raster_data_to_2bit,
+ rl2_raster_data_to_4bit, rl2_raster_data_to_uint8, rl2_raster_data_to_int16,
+ rl2_raster_data_to_uint16, rl2_raster_data_to_int32, rl2_raster_data_to_uint32,
+ rl2_raster_data_to_float, rl2_raster_data_to_double
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Endianness will always correspond to CPU natural architecture.
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_int8 (rl2RasterPtr rst, char **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Raster (unsigned Integer, 8 bit sample)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_1bit, rl2_raster_data_to_2bit,
+ rl2_raster_data_to_4bit, rl2_raster_data_to_int8, rl2_raster_data_to_int16,
+ rl2_raster_data_to_uint16, rl2_raster_data_to_int32, rl2_raster_data_to_uint32,
+ rl2_raster_data_to_float, rl2_raster_data_to_double, rl2_raster_band_to_uint8
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Endianness will always correspond to CPU natural architecture.
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_uint8 (rl2RasterPtr rst, unsigned char **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Raster (Integer, 16 bit sample)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_1bit, rl2_raster_data_to_2bit,
+ rl2_raster_data_to_4bit, rl2_raster_data_to_int8, rl2_raster_data_to_uint8,
+ rl2_raster_data_to_uint16, rl2_raster_data_to_int32, rl2_raster_data_to_uint32,
+ rl2_raster_data_to_float, rl2_raster_data_to_double
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Endianness will always correspond to CPU natural architecture.
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_int16 (rl2RasterPtr rst, short **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Raster (unsigned Integer, 16 bit sample)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_1bit, rl2_raster_data_to_2bit,
+ rl2_raster_data_to_4bit, rl2_raster_data_to_int8, rl2_raster_data_to_uint8,
+ rl2_raster_data_to_int16, rl2_raster_data_to_int32, rl2_raster_data_to_uint32,
+ rl2_raster_data_to_float, rl2_raster_data_to_double, rl2_raster_band_to_uint16
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Endianness will always correspond to CPU natural architecture.
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_uint16 (rl2RasterPtr rst, unsigned short **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Raster (Integer, 32 bit sample)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_1bit, rl2_raster_data_to_2bit,
+ rl2_raster_data_to_4bit, rl2_raster_data_to_int8, rl2_raster_data_to_uint8,
+ rl2_raster_data_to_int16, rl2_raster_data_to_uint16, rl2_raster_data_to_uint32,
+ rl2_raster_data_to_float, rl2_raster_data_to_double
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Endianness will always correspond to CPU natural architecture.
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_int32 (rl2RasterPtr rst, int **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Raster (unsigned Integer, 32 bit sample)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_1bit, rl2_raster_data_to_2bit,
+ rl2_raster_data_to_4bit, rl2_raster_data_to_int8, rl2_raster_data_to_uint8,
+ rl2_raster_data_to_int16, rl2_raster_data_to_uint16, rl2_raster_data_to_int32,
+ rl2_raster_data_to_float, rl2_raster_data_to_double
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Endianness will always correspond to CPU natural architecture.
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_uint32 (rl2RasterPtr rst, unsigned int **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Raster (floating point, single precision sample)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_1bit, rl2_raster_data_to_2bit,
+ rl2_raster_data_to_4bit, rl2_raster_data_to_int8, rl2_raster_data_to_uint8,
+ rl2_raster_data_to_int16, rl2_raster_data_to_uint16, rl2_raster_data_to_int32,
+ rl2_raster_data_to_uint32, rl2_raster_data_to_double
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Endianness will always correspond to CPU natural architecture.
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_float (rl2RasterPtr rst, float **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Raster (floating point, double precision sample)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_1bit, rl2_raster_data_to_2bit,
+ rl2_raster_data_to_4bit, rl2_raster_data_to_int8, rl2_raster_data_to_uint8,
+ rl2_raster_data_to_int16, rl2_raster_data_to_uint16, rl2_raster_data_to_int32,
+ rl2_raster_data_to_uint32, rl2_raster_data_to_float
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Endianness will always correspond to CPU natural architecture.
+ */
+ RL2_DECLARE int
+ rl2_raster_data_to_double (rl2RasterPtr rst, double **buffer,
+ int *buf_size);
+
+/**
+ Creates a pixel array from a Multiband Raster (unsigned Integer, 8 bit sample, single Band)
+
+ \param rst pointer to the Raster Object.
+ \param band the selected Sample/Band index (the first sample corresponds to index ZERO).
+ \param buffer on completion will point to the created pixel/Band array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel/Band array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_uint8, rl2_raster_band_to_uint16,
+ rl2_raster_bands_to_RGB
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Endianness will always correspond to CPU natural architecture.
+ */
+ RL2_DECLARE int
+ rl2_raster_band_to_uint8 (rl2RasterPtr rst, int band,
+ unsigned char **buffer, int *buf_size);
+
+/**
+ Creates a pixel array from a Multiband Raster (unsigned Integer, 16 bit sample, single Band)
+
+ \param rst pointer to the Raster Object.
+ \param band the selected Sample/Band index (the first sample corresponds to index ZERO).
+ \param buffer on completion will point to the created pixel/Band array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel/Band array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_uint16, rl2_raster_band_to_uint8,
+ rl2_raster_bands_to_RGB
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Endianness will always correspond to CPU natural architecture.
+ */
+ RL2_DECLARE int
+ rl2_raster_band_to_uint16 (rl2RasterPtr rst, int band,
+ unsigned short **buffer, int *buf_size);
+
+/**
+ Creates an RGB pixel array from a Multiband Raster
+
+ \param rst pointer to the Raster Object.
+ \param bandR an arbitrary Sample/Band index assumed to represent the Red Band
+ (the first sample corresponds to index ZERO).
+ \param bandG an arbitrary Sample/Band index assumed to represent the Green Band.
+ \param bandB an arbitrary Sample/Band index assumed to represent the Blue Band.
+ \param buffer on completion will point to the created pixel array.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the pixel array.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_data_to_uint8, rl2_raster_band_to_uint8,
+
+ \note the arrays returned by this function corresponds to dynamic memory;
+ you are responsible for properly freeing such dynamic allocation in
+ the most appropriate way.
+
+ \note pixels into the returned array will be tightly packed and will be
+ organized by increasing rows and columns; the first pixel will correspond
+ to Row=0,Column=0, the second pixel to Row=0,Column=1 and so on.
+ Pixel components are always organized as RGBRGBRGB....RGB
+ */
+ RL2_DECLARE int
+ rl2_raster_bands_to_RGB (rl2RasterPtr rst, int bandR, int bandG,
+ int bandB, unsigned char **buffer,
+ int *buf_size);
+
+/**
+ Exports a Raster object as an in-memory stored GIF image
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the memory block storing the created GIF image.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the GIF image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_from_gif
+ */
+ RL2_DECLARE int
+ rl2_raster_to_gif (rl2RasterPtr rst, unsigned char **gif,
+ int *gif_size);
+
+/**
+ Allocates and initializes a new Raster object from an in-memory stored GIF image
+
+ \param gif pointer to the memory block storing the input GIF image.
+ \param gif_size size (in bytes) of the GIF image.
+
+ \return the pointer to newly created Raster Object: NULL on failure.
+
+ \sa rl2_destroy_raster, rl2_create_raster, rl2_raster_to_gif
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster object.
+ */
+ RL2_DECLARE rl2RasterPtr rl2_raster_from_gif (const unsigned char *gif,
+ int gif_size);
+
+/**
+ Exports a Raster object as an in-memory stored PNG image
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the memory block storing the created PNG image.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the PNG image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_from_png
+ */
+ RL2_DECLARE int
+ rl2_raster_to_png (rl2RasterPtr rst, unsigned char **png,
+ int *png_size);
+
+/**
+ Allocates and initializes a new Raster object from an in-memory stored PNG image
+
+ \param png pointer to the memory block storing the input PNG image.
+ \param png_size size (in bytes) of the PNG image.
+
+ \return the pointer to newly created Raster Object: NULL on failure.
+
+ \sa rl2_destroy_raster, rl2_create_raster, rl2_raster_to_png
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster object.
+ */
+ RL2_DECLARE rl2RasterPtr rl2_raster_from_png (const unsigned char *png,
+ int png_size);
+
+/**
+ Exports a Raster object as an in-memory stored JPEG image
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the memory block storing the created JPEG image.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the JPEG image.
+ \param quality compression quality factor (0-100)
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_from_jpeg
+ */
+ RL2_DECLARE int
+ rl2_raster_to_jpeg (rl2RasterPtr rst, unsigned char **jpeg,
+ int *jpeg_size, int quality);
+
+/**
+ Allocates and initializes a new Raster object from an in-memory stored JPEG image
+
+ \param jpeg pointer to the memory block storing the input JPEG image.
+ \param jpeg_size size (in bytes) of the JPEG image.
+
+ \return the pointer to newly created Raster Object: NULL on failure.
+
+ \sa rl2_destroy_raster, rl2_create_raster, rl2_raster_to_jpeg
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster object.
+ */
+ RL2_DECLARE rl2RasterPtr
+ rl2_raster_from_jpeg (const unsigned char *jpeg, int jpeg_size);
+
+/**
+ Exports a Raster object as an in-memory stored WEBP image (lossy compressed)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the memory block storing the created WEBP image.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the WEBP image.
+ \param quality compression quality factor (0-100)
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_from_webp, rl2_raster_to_lossless_webp
+ */
+ RL2_DECLARE int
+ rl2_raster_to_lossy_webp (rl2RasterPtr rst, unsigned char **webp,
+ int *webp_size, int quality);
+
+/**
+ Exports a Raster object as an in-memory stored WEBP image (lossless compressed)
+
+ \param rst pointer to the Raster Object.
+ \param buffer on completion will point to the memory block storing the created WEBP image.
+ \param buf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the WEBP image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster, rl2_raster_from_webp, rl2_raster_to_lossy_webp
+ */
+ RL2_DECLARE int
+ rl2_raster_to_lossless_webp (rl2RasterPtr rst, unsigned char **webp,
+ int *webp_size);
+
+/**
+ Allocates and initializes a new Raster object from an in-memory stored WEBP image
+
+ \param webp pointer to the memory block storing the input WEBP image.
+ \param webp_size size (in bytes) of the WEBP image.
+
+ \return the pointer to newly created Raster Object: NULL on failure.
+
+ \sa rl2_destroy_raster, rl2_create_raster, rl2_raster_to_lossy_webp,
+ rl2_raster_to_lossless_webp
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster object.
+ */
+ RL2_DECLARE rl2RasterPtr
+ rl2_raster_from_webp (const unsigned char *webp, int webp_size);
+
+/**
+ Allocates and initializes a new Raster object from an in-memory stored TIFF image
+
+ \param webp pointer to the memory block storing the input TIFF image.
+ \param webp_size size (in bytes) of the WEBP image.
+
+ \return the pointer to newly created Raster Object: NULL on failure.
+
+ \sa rl2_destroy_raster, rl2_create_raster
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster object. Not all TIFF images are supported, but only the ones
+ actually corresponding to a visible image (RGB, Grayscale, Palette
+ and Monochrome).
+ */
+ RL2_DECLARE rl2RasterPtr
+ rl2_raster_from_tiff (const unsigned char *tiff, int tiff_size);
+
+ RL2_DECLARE rl2PalettePtr rl2_get_raster_palette (rl2RasterPtr raster);
+
+ RL2_DECLARE rl2PalettePtr rl2_clone_palette (rl2PalettePtr palette);
+
+ RL2_DECLARE rl2CoveragePtr
+ rl2_create_coverage_from_dbms (sqlite3 * handle, const char *coverage);
+
+ RL2_DECLARE int
+ rl2_find_matching_resolution (sqlite3 * handle, rl2CoveragePtr cvg,
+ double *x_res, double *y_res,
+ unsigned char *level,
+ unsigned char *scale);
+
+ RL2_DECLARE int
+ rl2_get_raw_raster_data (sqlite3 * handle, rl2CoveragePtr cvg,
+ unsigned int width, unsigned int height,
+ double minx, double miny, double maxx,
+ double maxy, double x_res, double y_res,
+ unsigned char **buffer, int *buf_size,
+ rl2PalettePtr * palette,
+ unsigned char out_pixel);
+
+ RL2_DECLARE int
+ rl2_get_triple_band_raw_raster_data (sqlite3 * handle,
+ rl2CoveragePtr cvg,
+ unsigned int width,
+ unsigned int height,
+ double minx, double miny,
+ double maxx, double maxy,
+ double x_res, double y_res,
+ unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band,
+ unsigned char **buffer,
+ int *buf_size,
+ rl2PixelPtr no_data);
+
+ RL2_DECLARE int
+ rl2_get_mono_band_raw_raster_data (sqlite3 * handle,
+ rl2CoveragePtr cvg,
+ unsigned int width,
+ unsigned int height,
+ double minx, double miny,
+ double maxx, double maxy,
+ double x_res, double y_res,
+ unsigned char mono_band,
+ unsigned char **buffer,
+ int *buf_size, rl2PixelPtr no_data);
+
+ RL2_DECLARE int
+ rl2_get_raw_raster_data_bgcolor (sqlite3 * handle, rl2CoveragePtr cvg,
+ unsigned int width,
+ unsigned int height, double minx,
+ double miny, double maxx, double maxy,
+ double x_res, double y_res,
+ unsigned char **buffer, int *buf_size,
+ rl2PalettePtr * palette,
+ unsigned char *out_pixel,
+ unsigned char bg_red,
+ unsigned char bg_green,
+ unsigned char bg_blue,
+ rl2RasterStylePtr style,
+ rl2RasterStatisticsPtr stats);
+
+ RL2_DECLARE int
+ rl2_create_dbms_coverage (sqlite3 * handle, const char *coverage,
+ unsigned char sample, unsigned char pixel,
+ unsigned char num_bands,
+ unsigned char compression, int quality,
+ unsigned int tile_width,
+ unsigned int tile_height, int srid,
+ double x_res, double y_res,
+ rl2PixelPtr no_data, rl2PalettePtr palette);
+
+ RL2_DECLARE int
+ rl2_delete_dbms_section (sqlite3 * handle, const char *coverage,
+ sqlite3_int64 section_id);
+
+ RL2_DECLARE int
+ rl2_get_dbms_section_id (sqlite3 * handle, const char *coverage,
+ const char *section,
+ sqlite3_int64 * section_id);
+
+ RL2_DECLARE int
+ rl2_drop_dbms_coverage (sqlite3 * handle, const char *coverage);
+
+ RL2_DECLARE int
+ rl2_update_dbms_coverage (sqlite3 * handle, const char *coverage);
+
+ RL2_DECLARE int
+ rl2_serialize_dbms_palette (rl2PalettePtr palette, unsigned char **blob,
+ int *blob_size);
+
+ RL2_DECLARE int
+ rl2_is_valid_dbms_palette (const unsigned char *blob, int blob_size,
+ unsigned char sample_type);
+
+ RL2_DECLARE rl2PalettePtr
+ rl2_deserialize_dbms_palette (const unsigned char *blob, int blob_size);
+
+ RL2_DECLARE rl2PalettePtr
+ rl2_get_dbms_palette (sqlite3 * handle, const char *coverage);
+
+ RL2_DECLARE int
+ rl2_update_dbms_palette (sqlite3 * handle, const char *coverage,
+ rl2PalettePtr palette);
+
+ RL2_DECLARE int
+ rl2_compare_palettes (rl2PalettePtr palette_1, rl2PalettePtr palette_2);
+
+ RL2_DECLARE int
+ rl2_check_dbms_palette (sqlite3 * handle, rl2CoveragePtr cvg,
+ rl2TiffOriginPtr tiff);
+
+ RL2_DECLARE int
+ rl2_serialize_dbms_pixel (rl2PixelPtr pixel, unsigned char **blob,
+ int *blob_size);
+
+ RL2_DECLARE int
+ rl2_is_valid_dbms_pixel (const unsigned char *blob, int blob_size,
+ unsigned char sample_type,
+ unsigned char num_bands);
+
+ RL2_DECLARE rl2PixelPtr
+ rl2_deserialize_dbms_pixel (const unsigned char *blob, int blob_size);
+
+ RL2_DECLARE rl2AsciiGridOriginPtr rl2_create_ascii_grid_origin (const char
+ *path,
+ int srid,
+ unsigned
+ char
+ sample_type);
+
+ RL2_DECLARE void rl2_destroy_ascii_grid_origin (rl2AsciiGridOriginPtr
+ ascii);
+
+ RL2_DECLARE int
+ rl2_eval_ascii_grid_origin_compatibility (rl2CoveragePtr cvg,
+ rl2AsciiGridOriginPtr ascii);
+
+ RL2_DECLARE const char
+ *rl2_get_ascii_grid_origin_path (rl2AsciiGridOriginPtr ascii);
+
+ RL2_DECLARE int
+ rl2_get_ascii_grid_origin_size (rl2AsciiGridOriginPtr ascii,
+ unsigned int *width,
+ unsigned int *height);
+
+ RL2_DECLARE int
+ rl2_get_ascii_grid_origin_type (rl2AsciiGridOriginPtr ascii,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *num_bands);
+
+ RL2_DECLARE int rl2_get_ascii_grid_origin_srid (rl2AsciiGridOriginPtr ascii,
+ int *srid);
+
+ RL2_DECLARE int rl2_get_ascii_grid_origin_resolution (rl2AsciiGridOriginPtr
+ ascii,
+ double *res_horz,
+ double *res_vert);
+
+ RL2_DECLARE int
+ rl2_get_ascii_grid_origin_extent (rl2AsciiGridOriginPtr ascii,
+ double *minX, double *minY,
+ double *maxX, double *maxY);
+
+ RL2_DECLARE int
+ rl2_get_ascii_origin_resolution (rl2AsciiGridOriginPtr ascii,
+ double *hResolution,
+ double *vResolution);
+
+ RL2_DECLARE rl2RasterPtr
+ rl2_get_tile_from_ascii_grid_origin (rl2CoveragePtr cvg,
+ rl2AsciiGridOriginPtr ascii,
+ unsigned int startRow,
+ unsigned int startCol);
+
+ RL2_DECLARE rl2AsciiGridDestinationPtr
+ rl2_create_ascii_grid_destination (const char *path,
+ unsigned int width,
+ unsigned int height,
+ double resolution, double x,
+ double y, int is_centered,
+ double no_data, int decimal_digits,
+ void *pixels, int pixels_size,
+ unsigned char sample_type);
+
+ RL2_DECLARE void
+ rl2_destroy_ascii_grid_destination (rl2AsciiGridDestinationPtr ascii);
+
+ RL2_DECLARE const char
+ *rl2_get_ascii_grid_destination_path (rl2AsciiGridDestinationPtr ascii);
+
+ RL2_DECLARE int
+ rl2_get_ascii_grid_destination_size (rl2AsciiGridDestinationPtr ascii,
+ unsigned int *width,
+ unsigned int *height);
+
+ RL2_DECLARE int
+ rl2_get_ascii_grid_destination_type (rl2AsciiGridDestinationPtr ascii,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *num_bands);
+
+ RL2_DECLARE int
+ rl2_get_ascii_grid_destination_tiepoint (rl2AsciiGridDestinationPtr
+ ascii, double *X, double *Y);
+
+ RL2_DECLARE int
+ rl2_get_ascii_grid_destination_resolution (rl2AsciiGridDestinationPtr
+ ascii, double *resolution);
+
+ RL2_DECLARE int
+ rl2_write_ascii_grid_header (rl2AsciiGridDestinationPtr ascii);
+
+ RL2_DECLARE int
+ rl2_write_ascii_grid_scanline (rl2AsciiGridDestinationPtr ascii,
+ unsigned int *line_no);
+
+ RL2_DECLARE rl2RasterPtr
+ rl2_get_tile_from_jpeg_origin (rl2CoveragePtr cvg, rl2RasterPtr rst,
+ unsigned int startRow,
+ unsigned int startCol,
+ unsigned char forced_conversion);
+
+ RL2_DECLARE int
+ rl2_load_raster_into_dbms (sqlite3 * handle, const char *src_path,
+ rl2CoveragePtr coverage, int worldfile,
+ int force_srid, int pyramidize);
+
+ RL2_DECLARE int
+ rl2_load_mrasters_into_dbms (sqlite3 * handle, const char *dir_path,
+ const char *file_ext,
+ rl2CoveragePtr coverage, int worldfile,
+ int force_srid, int pyramidize);
+
+ RL2_DECLARE int
+ rl2_export_geotiff_from_dbms (sqlite3 * handle, const char *dst_path,
+ rl2CoveragePtr coverage, double x_res,
+ double y_res, double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char compression,
+ unsigned int tile_sz, int with_worldfile);
+
+ RL2_DECLARE int
+ rl2_export_tiff_worldfile_from_dbms (sqlite3 * handle,
+ const char *dst_path,
+ rl2CoveragePtr coverage,
+ double x_res, double y_res,
+ double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char compression,
+ unsigned int tile_sz);
+
+ RL2_DECLARE int
+ rl2_export_tiff_from_dbms (sqlite3 * handle, const char *dst_path,
+ rl2CoveragePtr coverage, double x_res,
+ double y_res, double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char compression,
+ unsigned int tile_sz);
+
+ RL2_DECLARE int
+ rl2_export_triple_band_geotiff_from_dbms (sqlite3 * handle,
+ const char *dst_path,
+ rl2CoveragePtr coverage,
+ double x_res, double y_res,
+ double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band,
+ unsigned char compression,
+ unsigned int tile_sz,
+ int with_worldfile);
+
+ RL2_DECLARE int
+ rl2_export_mono_band_geotiff_from_dbms (sqlite3 * handle,
+ const char *dst_path,
+ rl2CoveragePtr coverage,
+ double x_res, double y_res,
+ double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char mono_band,
+ unsigned char compression,
+ unsigned int tile_sz,
+ int with_worldfile);
+
+ RL2_DECLARE int
+ rl2_export_triple_band_tiff_worldfile_from_dbms (sqlite3 * handle,
+ const char *dst_path,
+ rl2CoveragePtr
+ coverage,
+ double x_res,
+ double y_res,
+ double minx,
+ double miny,
+ double maxx,
+ double maxy,
+ unsigned int width,
+ unsigned int
+ height,
+ unsigned char
+ red_band,
+ unsigned char
+ green_band,
+ unsigned char
+ blue_band,
+ unsigned char
+ compression,
+ unsigned int tile_sz);
+
+ RL2_DECLARE int
+ rl2_export_mono_band_tiff_worldfile_from_dbms (sqlite3 * handle,
+ const char *dst_path,
+ rl2CoveragePtr
+ coverage,
+ double x_res,
+ double y_res,
+ double minx,
+ double miny,
+ double maxx,
+ double maxy,
+ unsigned int width,
+ unsigned int
+ height,
+ unsigned char
+ mono_band,
+ unsigned char
+ compression,
+ unsigned int tile_sz);
+
+ RL2_DECLARE int
+ rl2_export_triple_band_tiff_from_dbms (sqlite3 * handle,
+ const char *dst_path,
+ rl2CoveragePtr coverage,
+ double x_res, double y_res,
+ double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band,
+ unsigned char compression,
+ unsigned int tile_sz);
+
+ RL2_DECLARE int
+ rl2_export_mono_band_tiff_from_dbms (sqlite3 * handle,
+ const char *dst_path,
+ rl2CoveragePtr coverage,
+ double x_res, double y_res,
+ double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char mono_band,
+ unsigned char compression,
+ unsigned int tile_sz);
+
+ RL2_DECLARE int
+ rl2_export_ascii_grid_from_dbms (sqlite3 * handle, const char *dst_path,
+ rl2CoveragePtr coverage, double res,
+ double minx, double miny, double maxx,
+ double maxy, unsigned int width,
+ unsigned int height, int is_centered,
+ int decimal_digits);
+
+ RL2_DECLARE int
+ rl2_export_jpeg_from_dbms (sqlite3 * handle, const char *dst_path,
+ rl2CoveragePtr coverage, double x_res,
+ double y_res, double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width, unsigned int height,
+ int quality, int with_worldfile);
+
+ RL2_DECLARE int
+ rl2_build_section_pyramid (sqlite3 * handle, const char *coverage,
+ const char *section, int forced_rebuild);
+
+ RL2_DECLARE int
+ rl2_build_monolithic_pyramid (sqlite3 * handle, const char *coverage,
+ int virtual_levels);
+
+ RL2_DECLARE int
+ rl2_build_all_section_pyramids (sqlite3 * handle, const char *coverage,
+ int forced_rebuild);
+
+ RL2_DECLARE int
+ rl2_delete_section_pyramid (sqlite3 * handle, const char *coverage,
+ const char *section);
+
+ RL2_DECLARE int
+ rl2_delete_all_pyramids (sqlite3 * handle, const char *coverage);
+
+/**
+ Exports an RGB buffer as an in-memory stored PNG image
+
+ \param width the PNG image width.
+ \param height the PNG image height.
+ \param rgb pointer to the RGB buffer.
+ \param png on completion will point to the memory block storing the created PNG image.
+ \param png_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the PNG image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_rgb_alpha_to_png, rl2_rgb_to_jpeg, rl2_rgb_to_tiff,
+ rl2_rgb_to_geotiff, rl2_rgba_to_pdf
+ */
+ RL2_DECLARE int
+ rl2_rgb_to_png (unsigned int width, unsigned int height,
+ const unsigned char *rgb, unsigned char **png,
+ int *png_size);
+
+/**
+ Exports two separate RGB + Alpha buffers as an in-memory stored PNG image
+
+ \param width the PNG image width.
+ \param height the PNG image height.
+ \param rgb pointer to the RGB buffer.
+ \param alpha pointer to the Alpha channel buffer.
+ \param png on completion will point to the memory block storing the created PNG image.
+ \param png_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the PNG image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_rgb_to_png, rl2_rgb_to_jpeg, rl2_rgb_to_tiff, rl2_rgb_to_geotiff
+ */
+ RL2_DECLARE int
+ rl2_rgb_alpha_to_png (unsigned int width, unsigned int height,
+ const unsigned char *rgb,
+ const unsigned char *alpha, unsigned char **png,
+ int *png_size, double opacity);
+
+/**
+ Exports an RGB buffer as an in-memory stored JPEG image
+
+ \param width the JPEG image width.
+ \param height the JPEG image height.
+ \param rgb pointer to the RGB buffer.
+ \param quality compression quality factor (0-100)
+ \param jpeg on completion will point to the memory block storing the created JPEG image.
+ \param jpeg_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the JPEG image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_rgb_to_png, rl2_rgb_alpha_to_png, rl2_rgb_to_tiff,
+ rl2_rgb_to_geotiff, rl2_rgba_to_pdf
+ */
+ RL2_DECLARE int
+ rl2_rgb_to_jpeg (unsigned int width, unsigned int height,
+ const unsigned char *rgb, int quality,
+ unsigned char **jpeg, int *jpeg_size);
+
+/**
+ Exports an RGB buffer as an in-memory stored TIFF image
+
+ \param width the TIFF image width.
+ \param height the TIFF image height.
+ \param rgb pointer to the RGB buffer.
+ \param tiff on completion will point to the memory block storing the created TIFF image.
+ \param tiff_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the TIFF image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_rgb_to_png, rl2_rgb_alpha_to_png, rl2_rgb_to_jpeg,
+ rl2_rgb_to_geotiff, rl2_rgba_to_pdf
+ */
+ RL2_DECLARE int
+ rl2_rgb_to_tiff (unsigned int width, unsigned int height,
+ const unsigned char *rgb, unsigned char **tiff,
+ int *tiff_size);
+
+/**
+ Exports an RGB buffer as an in-memory stored GeoTIFF image
+
+ \param width the GeoTIFF image width.
+ \param height the GeoTIFF image height.
+ \param minx minimum X coordinate (BBOX - georeferencing).
+ \param miny minimum Y coordinate (BBOX - georeferencing).
+ \param maxx maximum X coordinate (BBOX - georeferencing).
+ \param maxx maximum Y coordinate (BBOX - georeferencing).
+ \param srid SRID code.
+ \param rgb pointer to the RGB buffer.
+ \param geotiff on completion will point to the memory block storing the created GeoTIFF image.
+ \param geotiff_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the GeoTIFF image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_rgb_to_png, rl2_rgb_alpha_to_png, rl2_rgb_to_jpeg,
+ rl2_rgb_to_tiff, rl2_rgba_to_pdf
+ */
+ RL2_DECLARE int
+ rl2_rgb_to_geotiff (unsigned int width, unsigned int height,
+ sqlite3 * handle, double minx, double miny,
+ double maxx, double maxy, int srid,
+ const unsigned char *rgb, unsigned char **geotiff,
+ int *geotiff_size);
+
+/**
+ Exports a Grayscale buffer as an in-memory stored PNG image
+
+ \param width the PNG image width.
+ \param height the PNG image height.
+ \param gray pointer to the Grayscale buffer.
+ \param png on completion will point to the memory block storing the created PNG image.
+ \param png_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the PNG image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_gray_alpha_to_png, rl2_gray_to_jpeg, rl2_gray_to_tiff,
+ rl2_gray_to_geotiff, rl2_rgba_to_pdf
+ */
+ RL2_DECLARE int
+ rl2_gray_to_png (unsigned int width, unsigned int height,
+ const unsigned char *gray, unsigned char **png,
+ int *png_size);
+
+/**
+ Exports two separate Grayscale + Alpha buffers as an in-memory stored PNG image
+
+ \param width the PNG image width.
+ \param height the PNG image height.
+ \param gray pointer to the Grayscale buffer.
+ \param alpha pointer to the Alpha channel buffer.
+ \param png on completion will point to the memory block storing the created PNG image.
+ \param png_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the PNG image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_gray_to_png, rl2_gray_to_jpeg, rl2_gray_to_tiff
+ rl2_gray_to_geotiff, rl2_rgba_to_pdf
+ */
+ RL2_DECLARE int
+ rl2_gray_alpha_to_png (unsigned int width, unsigned int height,
+ const unsigned char *gray,
+ const unsigned char *alpha, unsigned char **png,
+ int *png_size, double opacity);
+
+/**
+ Exports a Grayscale buffer as an in-memory stored JPEG image
+
+ \param width the JPEG image width.
+ \param height the JPEG image height.
+ \param gray pointer to the Grayscale buffer.
+ \param quality compression quality factor (0-100)
+ \param jpeg on completion will point to the memory block storing the created JPEG image.
+ \param jpeg_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the JPEG image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_gray_to_png, rl2_gray_alpha_to_png, rl2_gray_to_tiff
+ rl2_gray_to_geotiff, rl2_rgba_to_pdf
+ */
+ RL2_DECLARE int
+ rl2_gray_to_jpeg (unsigned int width, unsigned int height,
+ const unsigned char *gray, int quality,
+ unsigned char **jpeg, int *jpeg_size);
+
+/**
+ Exports a Grayscale buffer as an in-memory stored TIFF image
+
+ \param width the TIFF image width.
+ \param height the TIFF image height.
+ \param gray pointer to the Grayscale buffer.
+ \param tiff on completion will point to the memory block storing the created TIFF image.
+ \param tiff_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the TIFF image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_gray_to_png, rl2_gray_alpha_to_png, rl2_gray_to_jpeg,
+ rl2_gray_to_geotiff, rl2_rgba_to_pdf
+ */
+ RL2_DECLARE int
+ rl2_gray_to_tiff (unsigned int width, unsigned int height,
+ const unsigned char *gray, unsigned char **tiff,
+ int *tiff_size);
+
+/**
+ Exports a Grayscale buffer as an in-memory stored GeoTIFF image
+
+ \param width the GeoTIFF image width.
+ \param height the GeoTIFF image height.
+ \param minx minimum X coordinate (BBOX - georeferencing).
+ \param miny minimum Y coordinate (BBOX - georeferencing).
+ \param maxx maximum X coordinate (BBOX - georeferencing).
+ \param maxx maximum Y coordinate (BBOX - georeferencing).
+ \param srid SRID code.
+ \param gray pointer to the Grayscale buffer.
+ \param geotiff on completion will point to the memory block storing the created GeoTIFF image.
+ \param geotiff_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the GeoTIFF image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_gray_to_png, rl2_gray_alpha_to_png, rl2_gray_to_jpeg,
+ rl2_gray_to_tiff, rl2_rgba_to_pdf
+ */
+ RL2_DECLARE int
+ rl2_gray_to_geotiff (unsigned int width, unsigned int height,
+ sqlite3 * handle, double minx, double miny,
+ double maxx, double maxy, int srid,
+ const unsigned char *gray, unsigned char **geotiff,
+ int *geotiff_size);
+
+/**
+ Exports an RGBA buffer as an in-memory stored PDF document
+
+ \param width the PDF image width.
+ \param height the PDF image height.
+ \param rgba pointer to the RGBA buffer.
+ \param pdf on completion will point to the memory block storing the created PDF image.
+ \param pdf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the TIFF image.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_rgb_to_png, rl2_rgb_alpha_to_png, rl2_rgb_to_jpeg,
+ rl2_rgb_to_tiff, rl2_rgb_to_geotiff, rl2_gray_to_pdf
+
+ \note ownership of the rgba buffer will be definitely acquired by the
+ internal PDF writer.
+ */
+ RL2_DECLARE int
+ rl2_rgba_to_pdf (unsigned int width, unsigned int height,
+ unsigned char *rgba, unsigned char **pdf,
+ int *pdf_size);
+
+/**
+ Exports an all-Gray PDF document
+
+ \param width the PDF image width.
+ \param height the PDF image height.
+ \param pdf on completion will point to the memory block storing the created PDF document.
+ \param pdf_size on completion the variable referenced by this
+ pointer will contain the size (in bytes) of the PDF document.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_rl2_rgba_to_pdf
+ */
+ RL2_DECLARE int
+ rl2_gray_pdf (unsigned int width, unsigned int height,
+ unsigned char **pdf, int *pdf_size);
+
+ RL2_DECLARE int
+ rl2_parse_hexrgb (const char *hex, unsigned char *red,
+ unsigned char *green, unsigned char *blue);
+
+ RL2_DECLARE rl2RasterStylePtr
+ rl2_create_raster_style_from_dbms (sqlite3 * handle,
+ const char *coverage,
+ const char *style);
+
+ RL2_DECLARE rl2RasterStatisticsPtr
+ rl2_create_raster_statistics_from_dbms (sqlite3 * handle,
+ const char *coverage);
+
+ RL2_DECLARE void rl2_destroy_raster_style (rl2RasterStylePtr style);
+
+ RL2_DECLARE const char *rl2_get_raster_style_name (rl2RasterStylePtr style);
+
+ RL2_DECLARE const char *rl2_get_raster_style_title (rl2RasterStylePtr
+ style);
+
+ RL2_DECLARE const char *rl2_get_raster_style_abstract (rl2RasterStylePtr
+ style);
+
+ RL2_DECLARE int rl2_get_raster_style_opacity (rl2RasterStylePtr style,
+ double *opacity);
+
+ RL2_DECLARE int rl2_is_raster_style_mono_band_selected (rl2RasterStylePtr
+ style,
+ int *selected);
+
+ RL2_DECLARE int rl2_get_raster_style_mono_band_selection (rl2RasterStylePtr
+ style,
+ unsigned char
+ *gray_band);
+
+ RL2_DECLARE int rl2_is_raster_style_triple_band_selected (rl2RasterStylePtr
+ style,
+ int *selected);
+
+ RL2_DECLARE int
+ rl2_get_raster_style_triple_band_selection (rl2RasterStylePtr style,
+ unsigned char *red_band,
+ unsigned char *green_band,
+ unsigned char *blue_band);
+
+ RL2_DECLARE int
+ rl2_get_raster_style_overall_contrast_enhancement (rl2RasterStylePtr
+ style,
+ unsigned char
+ *contrast_enhancement,
+ double *gamma_value);
+
+ RL2_DECLARE int
+ rl2_get_raster_style_red_band_contrast_enhancement (rl2RasterStylePtr
+ style,
+ unsigned char
+ *contrast_enhancement,
+ double
+ *gamma_value);
+
+ RL2_DECLARE int
+ rl2_get_raster_style_green_band_contrast_enhancement (rl2RasterStylePtr
+ style,
+ unsigned char
+ *contrast_enhancement,
+ double
+ *gamma_value);
+
+ RL2_DECLARE int
+ rl2_get_raster_style_blue_band_contrast_enhancement (rl2RasterStylePtr
+ style,
+ unsigned char
+ *contrast_enhancement,
+ double
+ *gamma_value);
+
+ RL2_DECLARE int
+ rl2_get_raster_style_gray_band_contrast_enhancement (rl2RasterStylePtr
+ style,
+ unsigned char
+ *contrast_enhancement,
+ double
+ *gamma_value);
+
+ RL2_DECLARE int
+ rl2_has_raster_style_color_map_interpolated (rl2RasterStylePtr style,
+ int *interpolated);
+
+ RL2_DECLARE int
+ rl2_has_raster_style_color_map_categorized (rl2RasterStylePtr style,
+ int *categorized);
+
+ RL2_DECLARE int rl2_get_raster_style_color_map_default (rl2RasterStylePtr
+ style,
+ unsigned char *red,
+ unsigned char
+ *green,
+ unsigned char
+ *blue);
+
+ RL2_DECLARE int
+ rl2_get_raster_style_color_map_category_base (rl2RasterStylePtr style,
+ unsigned char *red,
+ unsigned char *green,
+ unsigned char *blue);
+
+ RL2_DECLARE int rl2_get_raster_style_color_map_count (rl2RasterStylePtr
+ style, int *count);
+
+ RL2_DECLARE int rl2_get_raster_style_color_map_entry (rl2RasterStylePtr
+ style, int index,
+ double *value,
+ unsigned char *red,
+ unsigned char *green,
+ unsigned char *blue);
+
+ RL2_DECLARE int rl2_has_raster_style_shaded_relief (rl2RasterStylePtr style,
+ int *shaded_relief);
+
+ RL2_DECLARE int rl2_get_raster_style_shaded_relief (rl2RasterStylePtr style,
+ int *brightness_only,
+ double *relief_factor);
+
+ RL2_DECLARE rl2GroupStylePtr
+ rl2_create_group_style_from_dbms (sqlite3 * handle, const char *group,
+ const char *style);
+
+ RL2_DECLARE void rl2_destroy_group_style (rl2GroupStylePtr style);
+
+ RL2_DECLARE const char *rl2_get_group_style_name (rl2GroupStylePtr style);
+
+ RL2_DECLARE const char *rl2_get_group_style_title (rl2GroupStylePtr style);
+
+ RL2_DECLARE const char *rl2_get_group_style_abstract (rl2GroupStylePtr
+ style);
+
+ RL2_DECLARE int rl2_is_valid_group_style (rl2GroupStylePtr style,
+ int *valid);
+
+ RL2_DECLARE int rl2_get_group_style_count (rl2GroupStylePtr style,
+ int *count);
+
+ RL2_DECLARE const char *rl2_get_group_named_layer (rl2GroupStylePtr style,
+ int index);
+
+ RL2_DECLARE const char *rl2_get_group_named_style (rl2GroupStylePtr style,
+ int index);
+
+ RL2_DECLARE int rl2_is_valid_group_named_layer (rl2GroupStylePtr style,
+ int index, int *valid);
+
+ RL2_DECLARE int rl2_is_valid_group_named_style (rl2GroupStylePtr style,
+ int index, int *valid);
+
+ RL2_DECLARE rl2GroupRendererPtr rl2_create_group_renderer (sqlite3 * sqlite,
+ rl2GroupStylePtr
+ style);
+
+ RL2_DECLARE void rl2_destroy_group_renderer (rl2GroupRendererPtr group);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RASTERLITE2_H */
diff --git a/headers/rasterlite2/rl2graphics.h b/headers/rasterlite2/rl2graphics.h
new file mode 100644
index 0000000..97abd0a
--- /dev/null
+++ b/headers/rasterlite2/rl2graphics.h
@@ -0,0 +1,801 @@
+/*
+ rl2graphics.h -- RasterLite2 common graphics support
+
+ version 2.0, 2013 September 29
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the RasterLite2 library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+/**
+ \file rl2graphics.h
+
+ Graphics (Cairo) support
+ */
+
+#ifndef _RL2GRAPHICS_H
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+#define _RL2GRAPHICS_H
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define RL2_PENSTYLE_SOLID 5001
+#define RL2_PENSTYLE_DOT 5002
+#define RL2_PENSTYLE_LONG_DASH 5003
+#define RL2_PENSTYLE_SHORT_DASH 5004
+#define RL2_PENSTYLE_DOT_DASH 5005
+
+#define RL2_FONTSTYLE_NORMAL 5101
+#define RL2_FONTSTYLE_ITALIC 5102
+
+#define RL2_FONTWEIGHT_NORMAL 5201
+#define RL2_FONTWEIGHT_BOLD 5202
+
+#define RL2_CLEAR_PATH 5100
+#define RL2_PRESERVE_PATH 5101
+
+ typedef struct rl2_graphics_context rl2GraphicsContext;
+ typedef rl2GraphicsContext *rl2GraphicsContextPtr;
+
+ typedef struct rl2_graphics_pattern rl2GraphicsPattern;
+ typedef rl2GraphicsPattern *rl2GraphicsPatternPtr;
+
+ typedef struct rl2_graphics_font rl2GraphicsFont;
+ typedef rl2GraphicsFont *rl2GraphicsFontPtr;
+
+ typedef struct rl2_graphics_bitmap rl2GraphicsBitmap;
+ typedef rl2GraphicsBitmap *rl2GraphicsBitmapPtr;
+
+/**
+ Creates a generic Graphics Context
+
+ \param width canvass width (in pixels)
+ \param height canvass height (in pixels)
+
+ \return the pointer to the corresponding Graphics Context object: NULL on failure
+
+ \sa rl2_graph_destroy_context, rl2_graph_create_svg_context,
+ rl2_graph_create_pdf_context, rl2_graph_create_mem_pdf_context
+
+ \note you are responsible to destroy (before or after) any Graphics Context
+ returned by rl2_graph_create_context() by invoking rl2_graph_destroy_context().
+ */
+ RL2_DECLARE rl2GraphicsContextPtr rl2_graph_create_context (int width,
+ int height);
+
+/**
+ Destroys a Graphics Context object freeing any allocated resource
+
+ \param handle the pointer to a valid Graphics Context returned by a previous call
+ to rl2_graph_create_context()
+
+ \sa rl2_graph_create_context
+ */
+ RL2_DECLARE void rl2_graph_destroy_context (rl2GraphicsContextPtr context);
+
+/**
+ Creates an SVG Graphics Context
+
+ \param path pathname of the target SVG output file
+ \param width canvass width (in pixels)
+ \param height canvass height (in pixels)
+
+ \return the pointer to the corresponding Graphics Context object: NULL on failure
+
+ \sa rl2_graph_create_context, rl2_graph_destroy_context, rl2_graph_create_pdf_context,
+ rl2_graph_create_mem_pdf_context
+
+ \note you are responsible to destroy (before or after) any SVG Graphics Context
+ returned by rl2_graph_create_svg_context() by invoking rl2_graph_destroy_context().
+ */
+ RL2_DECLARE rl2GraphicsContextPtr rl2_graph_create_svg_context (const char
+ *path,
+ int width,
+ int height);
+
+/**
+ Creates a PDF Graphics Context
+
+ \param path pathname of the target PDF output file
+ \param dpi the PDF printing resolution measured in DPI
+ \param page_width total page width (in inches) including any margin
+ \param page_height total page height (in inches) including any margin
+ \param margin_width horizontal margin width (in inches)
+ \param margin_height vertical margin height (in inches)
+
+ \return the pointer to the corresponding Graphics Context object: NULL on failure
+
+ \sa rl2_graph_create_context, rl2_graph_create_svg_context, rl2_graph_create_mem_pdf_context,
+ rl2_graph_destroy_context
+
+ \note you are responsible to destroy (before or after) any PDF Graphics Context
+ returned by rl2_graph_create_pdf_context() by invoking rl2_graph_destroy_context().
+ */
+ RL2_DECLARE rl2GraphicsContextPtr rl2_graph_create_pdf_context (const char
+ *path,
+ int dpi,
+ double
+ page_width,
+ double
+ page_height,
+ double
+ margin_width,
+ double
+ margin_height);
+
+/**
+ Creates an in-memory PDF Graphics Context
+
+ \param mem handle to an in-memory PDF target create by rl2_create_mem_pdf_target()
+ \param dpi the PDF printing resolution measured in DPI
+ \param page_width total page width (in inches) including any margin
+ \param page_height total page height (in inches) including any margin
+ \param margin_width horizontal margin width (in inches)
+ \param margin_height vertical margin height (in inches)
+
+ \return the pointer to the corresponding Graphics Context object: NULL on failure
+
+ \sa rl2_graph_create_context, rl2_graph_create_svg_context, rl2_graph_create_pdf_context,
+ rl2_graph_destroy_context, rl2_create_mem_pdf_target
+
+ \note you are responsible to destroy (before or after) any PDF Graphics Context
+ returned by rl2_graph_create_mem_pdf_context() by invoking rl2_graph_destroy_context().
+ */
+ RL2_DECLARE rl2GraphicsContextPtr
+ rl2_graph_create_mem_pdf_context (rl2MemPdfPtr pdf, int dpi,
+ double page_width, double page_height,
+ double margin_width,
+ double margin_height);
+
+/**
+ Create an in-memory PDF target
+
+ \return the handle to an initially empty in-memory PDF target: NULL on failure
+
+ \sa rl2_graph_create_mem_pdf_context, rl2_destroy_mem_pdf_target,
+ rl2_get_mem_pdf_buffer
+
+ \note you are responsible to destroy (before or after) any in-memory PDF target
+ returned by rl2_create_mem_pdf_target() by invoking rl2_destroy_mem_pdf_target().
+ */
+ RL2_DECLARE rl2MemPdfPtr rl2_create_mem_pdf_target (void);
+
+/**
+ Destroys an in-memory PDF target freeing any allocated resource
+
+ \param handle the pointer to a valid in-memory PDF target returned by a previous call
+ to rl2_create_mem_pdf_target()
+
+ \sa rl2_create_mem_pdf_target, rl2_destroy_mem_pdf_target
+ */
+ RL2_DECLARE void rl2_destroy_mem_pdf_target (rl2MemPdfPtr target);
+
+/**
+ Transfers the ownership of the memory buffer contained into a in-memory PDF target
+
+ \param handle the pointer to a valid in-memory PDF target returned by a previous call
+ to rl2_create_mem_pdf_target()
+ \param buffer on completion this variable will point to the a memory block
+ containing the PDF document (may be NULL if any error occurred).
+ \param size on completion this variable will contain the size (in bytes)
+ of the memory block containing the PDF document.
+
+ \return RL2_OK on success; RL2_ERROR if any error is encountered (this
+ including referencing an empty in-memory PDF target).
+
+ \sa rl2_create_mem_pdf_target
+
+ \note after invoking rl2_get_mem_pdf_buffer() the in-memory PDF target
+ will be reset to its initial empty state-
+ */
+ RL2_DECLARE int rl2_get_mem_pdf_buffer (rl2MemPdfPtr target,
+ unsigned char **buffer, int *size);
+
+/**
+ Selects the currently set Pen for a Graphics Context
+
+ \param context the pointer to a valid Graphics Context returned by a previous call
+ to rl2_graph_create_context(), rl2_graph_create_svg_context() or
+ rl2_graph_create_pdf_context()
+ \param red Pen color: red component.
+ \param green Pen color: green component.
+ \param blue Pen color: blue component.
+ \param alpha Pen transparency (0 full transparent; 255 full opaque).
+ \param width Pen width
+ \param style one of RL2_PENSTYLE_SOLID, RL2_PENSTYLE_DOT, RL2_PENSTYLE_LONG_DASH,
+ RL2_PENSTYLE_SHORT_DASH, RL2_PENSTYLE_DOT_DASH
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_create_context, rl2_graph_create_svg_context,
+ rl2_graph_create_pdf_context, rl2_graph_set_brush,
+ rl2_graph_set_linear_gradient_brush, rl2_graph_set_pattern_brush,
+ rl2_graph_set_font
+ */
+ RL2_DECLARE int rl2_graph_set_pen (rl2GraphicsContextPtr context,
+ unsigned char red, unsigned char green,
+ unsigned char blue, unsigned char alpha,
+ double width, int style);
+
+/**
+ Selects the currently set Brush for a Graphics Context
+
+ \param context the pointer to a valid Graphics Context returned by a previous call
+ to rl2_graph_create_context(), rl2_graph_create_svg_context() or
+ rl2_graph_create_pdf_context()
+ \param red Brush color: red component.
+ \param green Brush color: green component.
+ \param blue Brush color: blue component.
+ \param alpha Brush transparency (0 full transparent; 255 full opaque).
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_create_context, rl2_graph_create_svg_context,
+ rl2_graph_create_pdf_context, rl2_graph_set_pen,
+ rl2_graph_set_linear_gradient_brush, rl2_graph_set_pattern_brush,
+ rl2_graph_set_font
+
+ \note a Brush created by this function always is a solid Brush, may be
+ supporting transparency.
+ */
+ RL2_DECLARE int rl2_graph_set_brush (rl2GraphicsContextPtr context,
+ unsigned char red, unsigned char green,
+ unsigned char blue,
+ unsigned char alpha);
+
+/**
+ Selects the currently set Brush for a Graphics Context
+
+ \param context the pointer to a valid Graphics Context returned by a previous call
+ to rl2_graph_create_context(), rl2_graph_create_svg_context() or
+ rl2_graph_create_pdf_context()
+ \param x start point (X coord, in pixels) of the Gradient.
+ \param y start point (Y coord, in pixels) of the Gradient.
+ \param width the Gradient width.
+ \param height the Gradient height.
+ \param red1 first Gradient color: red component.
+ \param green1 first Gradient color: green component.
+ \param blue1 first Gradient color: blue component.
+ \param alpha1 first Gradient color transparency (0 full transparent; 255 full opaque).
+ \param red2 second Gradient color: red component.
+ \param green2 second Gradient color: green component.
+ \param blue2 second Gradient color: blue component.
+ \param alpha2 second Gradient color transparency (0 full transparent; 255 full opaque).
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_create_context, rl2_graph_create_svg_context,
+ rl2_graph_create_pdf_context, rl2_graph_set_pen,
+ rl2_graph_set_brush, rl2_graph_set_pattern_brush,
+ rl2_graph_set_font
+
+ \note a Brush created by this function always is a Linear Gradient Brush.
+ */
+ RL2_DECLARE int rl2_graph_set_linear_gradient_brush (rl2GraphicsContextPtr,
+ double x, double y,
+ double width,
+ double height,
+ unsigned char red1,
+ unsigned char green1,
+ unsigned char blue1,
+ unsigned char alpha1,
+ unsigned char red2,
+ unsigned char green2,
+ unsigned char blue2,
+ unsigned char alpha2);
+
+/**
+ Selects the currently set Brush for a Graphics Context
+
+ \param context the pointer to a valid Graphics Context returned by a previous call
+ to rl2_graph_create_context(), rl2_graph_create_svg_context() or
+ rl2_graph_create_pdf_context()
+ \param brush the pointer to a valid Graphics Pattern returned by a previous
+ call to rl2_graph_create_pattern().
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_create_context, rl2_graph_create_svg_context,
+ rl2_graph_create_pdf_context, rl2_graph_set_pen,
+ rl2_graph_set_brush, rl2_graph_set_linear_gradient_brush,
+ rl2_graph_set_font, rl2_create_pattern
+
+ \note a Brush created by this function always is a Pattern Brush,
+ i.e. a Brush repeatedly using a small bitmap as a filling source.
+ */
+ RL2_DECLARE int rl2_graph_set_pattern_brush (rl2GraphicsContextPtr context,
+ rl2GraphicsPatternPtr brush);
+
+/**
+ Selects the currently set Font for a Graphics Context
+
+ \param context the pointer to a valid Graphics Context returned by a previous call
+ to rl2_graph_create_context(), rl2_graph_create_svg_context() or
+ rl2_graph_create_pdf_context()
+ \param font the pointer to a valid Graphics Font returned by a previous call
+ to rl2_create_font().
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_create_context, rl2_graph_create_svg_context,
+ rl2_graph_create_pdf_context, rl2_graph_set_pen, rl2_graph_set_brush,
+ rl2_graph_set_linear_gradient_brush, rl2_graph_set_pattern_brush,
+ rl2_create_font
+ */
+ RL2_DECLARE int rl2_graph_set_font (rl2GraphicsContextPtr context,
+ rl2GraphicsFontPtr font);
+
+/**
+ Creates a Pattern Brush
+
+ \param rgbaArray pointer to an array of RGBA pixels representing the bitmap
+ supporting the Pattern Brush to be created.
+ \param width Pattern width (in pixels)
+ \param height Pattern height (in pixels)
+
+ \return the pointer to the corresponding Pattern Brush object: NULL on failure
+
+ \sa rl2_graph_set_pattern_brush, rl2_graph_destroy_brush
+
+ \note you are responsible to destroy (before or after) any Pattern Brush
+ returned by rl2_graph_create_pattern() by invoking rl2_graph_destroy_pattern().
+ */
+ RL2_DECLARE rl2GraphicsPatternPtr rl2_graph_create_pattern (unsigned char
+ *rgbaArray,
+ int width,
+ int height);
+
+/**
+ Destroys a Pattern Brush object freeing any allocated resource
+
+ \param handle the pointer to a valid Pattern Brush returned by a previous call
+ to rl2_graph_create_pattern()
+
+ \sa rl2_graph_create_pattern
+ */
+ RL2_DECLARE void rl2_graph_destroy_pattern (rl2GraphicsPatternPtr pattern);
+
+/**
+ Creates a Graphics Font Object
+
+ \param size the Graphics Font size (in points).
+ \param style one of RL2_FONTSTYLE_NORMAL or RL2_FONTSTYLE_ITALIC
+ \param weight one of RL2_FONTWEIGHT_NORMAL or RL2_FONTWEIGHT_BOLD
+
+ \return the pointer to the corresponding Font object: NULL on failure
+
+ \sa rl2_graph_set_font, rl2_graph_destroy_font, rl2_graph_font_set_color,
+ rl2_graph_font_set_color, rl2_graph_font_set_outline
+
+ \note you are responsible to destroy (before or after) any Pattern Brush
+ returned by rl2_graph_create_font() by invoking rl2_graph_destroy_font().
+ */
+ RL2_DECLARE rl2GraphicsFontPtr rl2_graph_create_font (double size,
+ int style,
+ int weight);
+
+/**
+ Destroys a Graphics Font object freeing any allocated resource
+
+ \param handle the pointer to a valid Font returned by a previous call
+ to rl2_graph_create_font()
+
+ \sa rl2_graph_create_font
+ */
+ RL2_DECLARE void rl2_graph_destroy_font (rl2GraphicsFontPtr font);
+
+/**
+ Selects the currently set Color for a Graphics Font
+
+ \param font the pointer to a valid Graphics Font returned by a previous call
+ to rl2_graph_create_font()
+ \param red Font color: red component.
+ \param green Font color: green component.
+ \param blue Font color: blue component.
+ \param alpha Font transparency (0 full transparent; 255 full opaque).
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_create_font, rl2_graph_font_set_outline,
+ rl2_graph_set_font
+ */
+ RL2_DECLARE int rl2_graph_font_set_color (rl2GraphicsFontPtr font,
+ unsigned char red,
+ unsigned char green,
+ unsigned char blue,
+ unsigned char alpha);
+
+/**
+ Selects the currently set Outline for a Graphics Font
+
+ \param font the pointer to a valid Graphics Font returned by a previous call
+ to rl2_graph_create_font()
+ \param width the outline width (in points); declaring a zero or negative value
+ will remove any outline from the Font.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_create_font, rl2_graph_font_set_color,
+ rl2_graph_set_font
+ */
+ RL2_DECLARE int rl2_graph_font_set_outline (rl2GraphicsFontPtr font,
+ double width);
+
+/**
+ Creates a Graphics Bitmap
+
+ \param rgbaArray pointer to an array of RGBA pixels representing the bitmap.
+ \param width Bitmap width (in pixels)
+ \param height Bitmap height (in pixels)
+
+ \return the pointer to the corresponding Graphics Bitmap object: NULL on failure
+
+ \sa rl2_graph_destroy_bitmap
+
+ \note you are responsible to destroy (before or after) any Graphics Bitmap
+ returned by rl2_graph_create_bitmap() by invoking rl2_graph_destroy_bitmap().
+ */
+ RL2_DECLARE rl2GraphicsBitmapPtr rl2_graph_create_bitmap (unsigned char
+ *rgbaArray,
+ int width,
+ int height);
+
+/**
+ Destroys a Graphics Bitmap object freeing any allocated resource
+
+ \param handle the pointer to a valid Font returned by a previous call
+ to rl2_graph_create_bitmap()
+
+ \sa rl2_graph_create_bitmap
+ */
+ RL2_DECLARE void rl2_graph_destroy_bitmap (rl2GraphicsBitmapPtr bitmap);
+
+/**
+ Drawing a Rectangle into a canvass
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param x the X coordinate of the top left corner of the rectangle.
+ \param y the Y coordinate of the top left corner of the rectangle.
+ \param width the width of the rectangle.
+ \param height the height of the rectangle.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_pen, rl2_graph_set_brush, rl2_graph, draw_rectangle,
+ rl2_graph_draw_ellipse, rl2_graph_draw_circle_sector, rl2_graph_stroke_line,
+ rl2_graph_fill_path, rl2_graph_stroke_path
+
+ \note the rectangle will be stroked using the current Pen and will
+ be filled using the current Brush.
+ */
+ RL2_DECLARE int rl2_graph_draw_rectangle (rl2GraphicsContextPtr context,
+ double x, double y, double width,
+ double height);
+
+/**
+ Drawing a Rectangle with rounded corners into a canvass
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param x the X coordinate of the top left corner of the rectangle.
+ \param y the Y coordinate of the top left corner of the rectangle.
+ \param width the width of the rectangle.
+ \param height the height of the rectangle.
+ \param radius used for rounded corners.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_pen, rl2_graph_set_brush, rl2_draw_rectangle,
+ rl2_graph_draw_ellipse, rl2_graph_draw_circle_sector, rl2_graph_stroke_line,
+ rl2_graph_fill_path, rl2_graph_stroke_path
+
+ \note the rectangle will be stroked using the current Pen and will
+ be filled using the current Brush.
+ */
+ RL2_DECLARE int rl2_graph_draw_rounded_rectangle (rl2GraphicsContextPtr
+ context, double x,
+ double y, double width,
+ double height,
+ double radius);
+
+/**
+ Drawing an Ellipse into a canvass
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param x the X coordinate of the top left corner of the rectangle
+ into which the ellipse is inscribed.
+ \param y the Y coordinate of the top left corner of the rectangle.
+ \param width the width of the rectangle.
+ \param height the height of the rectangle.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_pen, rl2_graph_set_brush, rl2_draw_rectangle,
+ rl2_graph_draw_rounded_rectangle, rl2_graph_draw_circle_sector,
+ rl2_graph_stroke_line, rl2_graph_fill_path, rl2_graph_stroke_path
+
+ \note the ellipse will be stroked using the current Pen and will
+ be filled using the current Brush.
+ */
+ RL2_DECLARE int rl2_graph_draw_ellipse (rl2GraphicsContextPtr context,
+ double x, double y, double width,
+ double height);
+
+/**
+ Drawing a Circular Sector into a canvass
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param center_x the X coordinate of the circle's centre.
+ \param center_y the Y coordinate of the circle's centre.
+ \param radius the circle's radius.
+ \param from_angle the angle (in degrees) at wich the sector starts.
+ \param to_angle the angle (in degrees) at wich the sector ends.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_pen, rl2_graph_set_brush, rl2_draw_rectangle,
+ rl2_graph_draw_rounded_rectangle, rl2_graph_draw_ellipse,
+ rl2_graph_stroke_line, rl2_graph_fill_path, rl2_graph_stroke_path
+
+ \note the Sector will be stroked using the current Pen and will
+ be filled using the current Brush.
+ */
+ RL2_DECLARE int rl2_graph_draw_circle_sector (rl2GraphicsContextPtr context,
+ double center_x,
+ double center_y,
+ double radius,
+ double from_angle,
+ double to_angle);
+
+/**
+ Drawing a straight Line into a canvass
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param x0 the X coordinate of the first point.
+ \param y0 the Y coordinate of the first point.
+ \param x1 the X coordinate of the second point.
+ \param y1 the Y coordinate of the second point.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_pen, rl2_graph_set_brush, rl2_draw_rectangle,
+ rl2_graph_draw_rounded_rectangle, rl2_graph_draw_ellipse,
+ rl2_graph_draw_circular_sector, rl2_graph_fill_path, rl2_graph_stroke_path
+
+ \note the Sector will be stroked using the current Pen and will
+ be filled using the current Brush.
+ */
+ RL2_DECLARE int rl2_graph_stroke_line (rl2GraphicsContextPtr context,
+ double x0, double y0, double x1,
+ double y1);
+
+/**
+ Begins a new SubPath
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param x the X coordinate of the point.
+ \param y the Y coordinate of the point.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_pen, rl2_graph_set_brush, rl2_graph_add_line_to_path,
+ rl2_graph_close_subpath, rl2_graph_fill_path, rl2_graph_stroke_path
+ */
+ RL2_DECLARE int rl2_graph_move_to_point (rl2GraphicsContextPtr context,
+ double x, double y);
+
+/**
+ Add a line into the current SubPath
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param x the X coordinate of the destination point.
+ \param y the Y coordinate of the destination point.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_pen, rl2_graph_set_brush, rl2_graph_move_to_point,
+ rl2_graph_close_subpath, rl2_graph_fill_path, rl2_graph_stroke_path
+ */
+ RL2_DECLARE int rl2_graph_add_line_to_path (rl2GraphicsContextPtr context,
+ double x, double y);
+
+/**
+ Terminates the current SubPath
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_pen, rl2_graph_set_brush, rl2_graph_move_to_point,
+ rl2_graph_add_line_to_path, rl2_graph_fill_path, rl2_graph_stroke_path
+ */
+ RL2_DECLARE int rl2_graph_close_subpath (rl2GraphicsContextPtr context);
+
+/**
+ Fills the current Path using the currently set Brush
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param preserve if true the current Path will be preserved into the
+ current Canvass, otherwise it will be definitely removed.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_pen, rl2_graph_set_brush, rl2_graph_move_to_point,
+ rl2_graph_add_line_to_path, rl2_graph_close_subpath, rl2_graph_stroke_path
+ */
+ RL2_DECLARE int rl2_graph_fill_path (rl2GraphicsContextPtr context,
+ int preserve);
+
+/**
+ Strokes the current Path using the currently set Pen
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param preserve if true the current Path will be preserved into the
+ current Canvass, otherwise it will be definitely removed.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_pen, rl2_graph_set_brush, rl2_graph_move_to_point,
+ rl2_graph_add_line_to_path, rl2_graph_close_subpath, rl2_graph_fill_path
+ */
+ RL2_DECLARE int rl2_graph_stroke_path (rl2GraphicsContextPtr context,
+ int preserve);
+
+/**
+ Draws a text into the Canvass using the currently set Font
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param text string to be printed into the canvass.
+ \param x the X coordinate of the top left corner of the text.
+ \param y the Y coordinate of the top left corner of the text.
+ \param angle an angle (in degrees) to rotate the text
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_font, rl2_graph_get_text_extent
+ */
+ RL2_DECLARE int rl2_graph_draw_text (rl2GraphicsContextPtr context,
+ const char *text, double x, double y,
+ double angle);
+
+/**
+ Computes the extent corresponding to a text into the Canvass using the currently set Font
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param text string to be printed into the canvass.
+ \param pre_x on completion this variable will contain the horizontal
+ spacing before the text.
+ \param pre_y on completion this variable will contain the vertical
+ spacing before the text.
+ \param width on completion this variable will contain the width of
+ the printed text.
+ \param width on completion this variable will contain the height of
+ the printed text.
+ \param post_x on completion this variable will contain the horizontal
+ spacing after the text.
+ \param post_y on completion this variable will contain the vertical
+ spacing after the text.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_set_font, rl2_graph_get_text_extent
+ */
+ RL2_DECLARE int rl2_graph_get_text_extent (rl2GraphicsContextPtr context,
+ const char *text, double *pre_x,
+ double *pre_y, double *width,
+ double *height, double *post_x,
+ double *post_y);
+
+/**
+ Draws a Bitmap into the Canvass
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param bitmap the pointer to a valid Graphics Bitmap to be rendered.
+ \param x the X coordinate of the top left corner of the image.
+ \param y the Y coordinate of the top left corner of the image.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_create_bitmap, rl2_graph_destroy_bitmap,
+ rl2_graph_draw_rescaled_bitmap
+ */
+ RL2_DECLARE int rl2_graph_draw_bitmap (rl2GraphicsContextPtr context,
+ rl2GraphicsBitmapPtr bitmap, int x,
+ int y);
+
+/**
+ Draws a Rescaled Bitmap into the Canvass
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+ \param bitmap the pointer to a valid Graphics Bitmap to be rendered.
+ \param scale_x the Scale Factor for X axis
+ \param scale_y the Scale Factor for Y axis
+ \param x the X coordinate of the top left corner of the image.
+ \param y the Y coordinate of the top left corner of the image.
+
+ \return 0 (false) on error, any other value on success.
+
+ \sa rl2_graph_create_bitmap, rl2_graph_destroy_bitmap,
+ rl2_graph_draw_bitmap
+ */
+ RL2_DECLARE int rl2_graph_draw_rescaled_bitmap (rl2GraphicsContextPtr
+ context,
+ rl2GraphicsBitmapPtr bitmap,
+ double scale_x,
+ double scale_y, int x,
+ int y);
+
+/**
+ Creates an RGB Array corresponding to the current Canvass
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+
+ \return the pointer to the RGB Array: NULL on failure.
+
+ \sa rl2_graph_get_context_alpha_array
+
+ \note you are responsible to destroy (before or after) any RGB Array
+ returned by rl2_graph_get_context_rgb_array() by invoking free().
+ */
+ RL2_DECLARE unsigned char
+ *rl2_graph_get_context_rgb_array (rl2GraphicsContextPtr context);
+
+/**
+ Creates an Array of Alpha values corresponding to the current Canvass
+
+ \param context the pointer to a valid Graphics Context (aka Canvass).
+
+ \return the pointer to the Array of Alpha Values: NULL on failure.
+
+ \sa rl2_graph_get_context_rgb_array
+
+ \note you are responsible to destroy (before or after) any RGB Array
+ returned by rl2_graph_get_context_alpha_array() by invoking free().
+ */
+ RL2_DECLARE unsigned char
+ *rl2_graph_get_context_alpha_array (rl2GraphicsContextPtr context);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RL2GPAPHICS_H */
diff --git a/headers/rasterlite2/rl2svg.h b/headers/rasterlite2/rl2svg.h
new file mode 100644
index 0000000..f63b3aa
--- /dev/null
+++ b/headers/rasterlite2/rl2svg.h
@@ -0,0 +1,138 @@
+/*
+ rl2svg.h -- RasterLite2 common SVG support
+
+ version 2.0, 2014 June 6
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the RasterLite2 library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2014
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+/**
+ \file rl2svg.h
+
+ WMS support
+ */
+
+#ifndef _RL2SVG_H
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+#define _RL2SVG_H
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+ Typedef for RL2 SVG object (opaque, hidden)
+
+ \sa rl2SvgPtr
+ */
+ typedef struct rl2_svg rl2Svg;
+/**
+ Typedef for RL2 SVG object pointer (opaque, hidden)
+
+ \sa rl2Svg
+ */
+ typedef rl2Svg *rl2SvgPtr;
+
+/**
+ Allocates and initializes a new SVG object
+
+ \param svg_document XML/SVG document to be parsed.
+ \param svg_bytes lenght (in bytes) of the XML/SVG document
+
+ \return the pointer to newly created SVG Object: NULL on failure.
+
+ \sa rl2_destroy_svg, rl2_get_svg_size, rl2_rgba_from_svg,
+ rl2_raster_from_svg
+
+ \note you are responsible to destroy (before or after) any allocated
+ SVG object.
+ */
+ RL2_DECLARE rl2SvgPtr rl2_create_svg (const unsigned char *svg_document,
+ int svg_bytes);
+
+/**
+ Destroys an SVG Object
+
+ \param svg_handle pointer to object to be destroyed
+
+ \sa rl2_create_svg
+ */
+ RL2_DECLARE void rl2_destroy_svg (rl2SvgPtr sgv_handle);
+
+/**
+ Retrieving the Width/height dimensions from an SVG Object
+
+ \param svg_handle pointer to the SVG Object.
+ \param width on completion the variable referenced by this
+ pointer will contain the SVG declared Width.
+ \param height on completion the variable referenced by this
+ pointer will contain the SVG declared Height.
+
+ \return RL2_OK on success: RL2_ERROR on failure.
+
+ \sa rl2_create_raster
+ */
+ RL2_DECLARE int rl2_get_svg_size (rl2SvgPtr svg_handle, double *width,
+ double *height);
+
+/**
+ Allocates and initializes a new Raster object from an in-memory stored SVG object
+
+ \param svg_handle pointer to the memory block storing the input SVG object.
+ \param size actual rescaled dimension.
+
+ \return the pointer to newly created Raster Object: NULL on failure.
+
+ \sa rl2_destroy_raster, rl2_create_raster
+
+ \note you are responsible to destroy (before or after) any allocated
+ Raster object.
+ */
+ RL2_DECLARE rl2RasterPtr rl2_raster_from_svg (rl2SvgPtr svg_handle,
+ double size);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RL2SVG_H */
diff --git a/headers/rasterlite2/rl2tiff.h b/headers/rasterlite2/rl2tiff.h
new file mode 100644
index 0000000..f96d292
--- /dev/null
+++ b/headers/rasterlite2/rl2tiff.h
@@ -0,0 +1,290 @@
+/*
+
+ rl2tiff.h -- RasterLite2 common TIFF support
+
+ version 0.1, 2013 November 20
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the RasterLite2 library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+/**
+ \file rl2tiff.h
+
+ TIFF support
+ */
+
+#ifndef _RL2TIFF_H
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+#define _RL2TIFF_H
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** RasterLite2 TIFF constant: No Geo-referencing */
+#define RL2_TIFF_NO_GEOREF 0xf1
+/** RasterLite2 TIFF constant: Auto Geo-referencing GeoTiff priority */
+#define RL2_TIFF_GEOTIFF 0xf2
+/** RasterLite2 TIFF constant: Auto Geo-referencing Worldfile priority */
+#define RL2_TIFF_WORLDFILE 0xf3
+
+ RL2_DECLARE rl2TiffOriginPtr rl2_create_tiff_origin (const char *path,
+ int georef_priority,
+ int srid,
+ unsigned char
+ force_sample_type,
+ unsigned char
+ force_pixel_type,
+ unsigned char
+ force_num_bands);
+
+ RL2_DECLARE rl2TiffOriginPtr rl2_create_geotiff_origin (const char *path,
+ int force_srid,
+ unsigned char
+ force_sample_type,
+ unsigned char
+ force_pixel_type,
+ unsigned char
+ force_num_bands);
+
+ RL2_DECLARE rl2TiffOriginPtr rl2_create_tiff_worldfile_origin (const char
+ *path,
+ int srid,
+ unsigned char
+ force_sample_type,
+ unsigned char
+ force_pixel_type,
+ unsigned char
+ force_num_bands);
+
+ RL2_DECLARE void rl2_destroy_tiff_origin (rl2TiffOriginPtr tiff);
+
+ RL2_DECLARE int rl2_is_geotiff_origin (rl2TiffOriginPtr tiff, int *geotiff);
+
+ RL2_DECLARE int rl2_is_tiff_worldfile_origin (rl2TiffOriginPtr
+ tiff, int *tiff_worldfile);
+
+ RL2_DECLARE const char *rl2_get_tiff_origin_path (rl2TiffOriginPtr tiff);
+
+ RL2_DECLARE const char
+ *rl2_get_tiff_origin_worldfile_path (rl2TiffOriginPtr tiff);
+
+ RL2_DECLARE int rl2_set_tiff_origin_not_referenced (rl2TiffOriginPtr tiff);
+
+ RL2_DECLARE int
+ rl2_get_tiff_origin_size (rl2TiffOriginPtr tiff, unsigned int *width,
+ unsigned int *height);
+
+ RL2_DECLARE int
+ rl2_get_tiff_origin_type (rl2TiffOriginPtr tiff,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *alias_pixel_type,
+ unsigned char *num_bands);
+
+ RL2_DECLARE int
+ rl2_get_tiff_origin_forced_type (rl2TiffOriginPtr tiff,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *num_bands);
+
+ RL2_DECLARE int rl2_get_tiff_origin_compression (rl2TiffOriginPtr tiff,
+ unsigned char
+ *compression);
+
+ RL2_DECLARE int rl2_get_tiff_origin_srid (rl2TiffOriginPtr tiff, int *srid);
+
+ RL2_DECLARE int
+ rl2_get_tiff_origin_extent (rl2TiffOriginPtr tiff, double *minX,
+ double *minY, double *maxX, double *maxY);
+
+ RL2_DECLARE int
+ rl2_get_tiff_origin_resolution (rl2TiffOriginPtr tiff,
+ double *hResolution,
+ double *vResolution);
+
+ RL2_DECLARE int
+ rl2_eval_tiff_origin_compatibility (rl2CoveragePtr cvg,
+ rl2TiffOriginPtr tiff,
+ int forced_srid);
+
+ RL2_DECLARE int rl2_is_tiled_tiff_origin (rl2TiffOriginPtr tiff,
+ int *is_tiled);
+
+ RL2_DECLARE int
+ rl2_get_tiff_origin_tile_size (rl2TiffOriginPtr tiff,
+ unsigned int *tile_width,
+ unsigned int *tile_height);
+
+ RL2_DECLARE int
+ rl2_get_tiff_origin_strip_size (rl2TiffOriginPtr tiff,
+ unsigned int *strip_size);
+
+ RL2_DECLARE rl2RasterPtr
+ rl2_get_tile_from_tiff_origin (rl2CoveragePtr cvg,
+ rl2TiffOriginPtr tiff,
+ unsigned int startRow,
+ unsigned int startCol, int force_srid);
+
+ RL2_DECLARE rl2TiffDestinationPtr
+ rl2_create_tiff_destination (const char *path, unsigned int width,
+ unsigned int height,
+ unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_bands, rl2PalettePtr plt,
+ unsigned char tiff_compression, int tiled,
+ unsigned int tile_size);
+
+ RL2_DECLARE rl2TiffDestinationPtr
+ rl2_create_geotiff_destination (const char *path, sqlite3 * handle,
+ unsigned int width,
+ unsigned int height,
+ unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_bands,
+ rl2PalettePtr plt,
+ unsigned char tiff_compression,
+ int tiles, unsigned int tile_size,
+ int srid, double minX, double minY,
+ double maxX, double maxY,
+ double hResolution, double vResolution,
+ int with_worldfile);
+
+ RL2_DECLARE rl2TiffDestinationPtr
+ rl2_create_tiff_worldfile_destination (const char *path,
+ unsigned int width,
+ unsigned int height,
+ unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_bands,
+ rl2PalettePtr plt,
+ unsigned char tiff_compression,
+ int tiles,
+ unsigned int tile_size, int srid,
+ double minX, double minY,
+ double maxX, double maxY,
+ double hResolution,
+ double vResolution);
+
+ RL2_DECLARE void rl2_destroy_tiff_destination (rl2TiffDestinationPtr tiff);
+
+ RL2_DECLARE int rl2_is_geotiff_destination (rl2TiffDestinationPtr tiff,
+ int *geotiff);
+
+ RL2_DECLARE int rl2_is_tiff_worldfile_destination (rl2TiffDestinationPtr
+ tiff,
+ int *tiff_worldfile);
+
+ RL2_DECLARE const char *rl2_get_tiff_destination_path (rl2TiffDestinationPtr
+ tiff);
+
+ RL2_DECLARE const char
+ *rl2_get_tiff_destination_worldfile_path (rl2TiffDestinationPtr tiff);
+
+ RL2_DECLARE int
+ rl2_get_tiff_destination_size (rl2TiffDestinationPtr tiff,
+ unsigned int *width,
+ unsigned int *height);
+
+ RL2_DECLARE int
+ rl2_get_tiff_destination_type (rl2TiffDestinationPtr tiff,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *alias_pixel_type,
+ unsigned char *num_bands);
+
+ RL2_DECLARE int rl2_get_tiff_destination_compression (rl2TiffDestinationPtr
+ tiff,
+ unsigned char
+ *compression);
+
+ RL2_DECLARE int rl2_get_tiff_destination_srid (rl2TiffDestinationPtr tiff,
+ int *srid);
+
+ RL2_DECLARE int
+ rl2_get_tiff_destination_extent (rl2TiffDestinationPtr tiff,
+ double *minX, double *minY,
+ double *maxX, double *maxY);
+
+ RL2_DECLARE int
+ rl2_get_tiff_destination_resolution (rl2TiffDestinationPtr tiff,
+ double *hResolution,
+ double *vResolution);
+
+ RL2_DECLARE int rl2_is_tiled_tiff_destination (rl2TiffDestinationPtr tiff,
+ int *is_tiled);
+
+ RL2_DECLARE int
+ rl2_get_tiff_destination_tile_size (rl2TiffDestinationPtr tiff,
+ unsigned int *tile_width,
+ unsigned int *tile_height);
+
+ RL2_DECLARE int
+ rl2_get_tiff_destination_strip_size (rl2TiffDestinationPtr tiff,
+ unsigned int *strip_size);
+
+ RL2_DECLARE int
+ rl2_write_tiff_tile (rl2TiffDestinationPtr tiff, rl2RasterPtr raster,
+ unsigned int startRow, unsigned int startCol);
+
+ RL2_DECLARE int
+ rl2_write_tiff_scanline (rl2TiffDestinationPtr tiff,
+ rl2RasterPtr raster, unsigned int row);
+
+ RL2_DECLARE int rl2_write_tiff_worldfile (rl2TiffDestinationPtr tiff);
+
+ RL2_DECLARE void
+ rl2_prime_void_tile (void *pixels, unsigned int width,
+ unsigned int height, unsigned char sample_type,
+ unsigned char num_bands, rl2PixelPtr no_data);
+
+ RL2_DECLARE void
+ rl2_prime_void_tile_palette (void *pixels, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data);
+
+ RL2_DECLARE int
+ rl2_raster_to_tiff_mono4 (rl2RasterPtr rst, unsigned char **tiff,
+ int *tiff_size);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RL2TIFF_H */
diff --git a/headers/rasterlite2/rl2wms.h b/headers/rasterlite2/rl2wms.h
new file mode 100644
index 0000000..19e98db
--- /dev/null
+++ b/headers/rasterlite2/rl2wms.h
@@ -0,0 +1,1934 @@
+/*
+ rl2wms.h -- RasterLite2 common WMS support
+
+ version 2.0, 2013 July 28
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the RasterLite2 library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+/**
+ \file rl2wms.h
+
+ WMS support
+ */
+
+#ifndef _RL2WMS_H
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+#define _RL2WMS_H
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ typedef struct rl2_wms_catalog rl2WmsCatalog;
+ typedef rl2WmsCatalog *rl2WmsCatalogPtr;
+
+ typedef struct rl2_wms_item rl2WmsLayer;
+ typedef rl2WmsLayer *rl2WmsLayerPtr;
+
+ typedef struct rl2_wms_tiled_item rl2WmsTiledLayer;
+ typedef rl2WmsTiledLayer *rl2WmsTiledLayerPtr;
+
+ typedef struct rl2_wms_tile_pattern rl2WmsTilePattern;
+ typedef rl2WmsTilePattern *rl2WmsTilePatternPtr;
+
+ typedef struct rl2_wms_feature_collection rl2WmsFeatureCollection;
+ typedef rl2WmsFeatureCollection *rl2WmsFeatureCollectionPtr;
+
+ typedef struct rl2_wms_feature_member rl2WmsFeatureMember;
+ typedef rl2WmsFeatureMember *rl2WmsFeatureMemberPtr;
+
+ typedef struct rl2_wms_cache rl2WmsCache;
+ typedef struct rl2_wms_cache *rl2WmsCachePtr;
+
+/**
+ Creates a Catalog for some WMS service
+
+ \param cache_handle handle to local WMS cache
+ \param url pointer to some WMS-GetCapabilities XML Document.
+ \param proxy pointer to some HTTP PROXY: may be NULL.
+ \param err_msg on completion will contain an error message (if any)
+
+ \return the pointer to the corresponding WMS-Catalog object: NULL on failure
+
+ \sa destroy_wms_catalog, get_wms_version, get_wms_name, get_wms_title, get_wms_abstract,
+ is_wms_tile_service, get_wms_catalog_count, get_wms_catalog_layer
+
+ \note an eventual error message returned via err_msg requires to be deallocated
+ by invoking free().\n
+ you are responsible to destroy (before or after) any WMS-Catalog returned by create_wms_catalog().
+ */
+ RL2_DECLARE rl2WmsCatalogPtr create_wms_catalog (rl2WmsCachePtr
+ cache_handle,
+ const char *url,
+ const char *proxy,
+ char **err_msg);
+
+/**
+ Destroys a WMS-Catalog object freeing any allocated resource
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \sa create_wms_catalog
+ */
+ RL2_DECLARE void destroy_wms_catalog (rl2WmsCatalogPtr handle);
+
+/**
+ Tests if a WMS-Catalog object actually corresponds to a TileService
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return 0 (false) if not, any other value if yes: a negative value on error.
+
+ \sa create_wms_catalog, get_wms_tile_service_name, get_wms_tile_service_title,
+ get_wms_tile_service_abstract, get_wms_tile_service_count, get_wms_catalog_tiled_layer
+ */
+ RL2_DECLARE int is_wms_tile_service (rl2WmsCatalogPtr handle);
+
+/**
+ Return the TileService name corresponding to some WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog (of the TileService type)
+ returned by a previous call to get_wms_catalog_layer().
+
+ \return the name corresponding to the WMS TileService (if any)
+
+ \sa get_wms_tile_service_title, get_wms_tile_service_abstract
+ */
+ RL2_DECLARE const char *get_wms_tile_service_name (rl2WmsCatalogPtr handle);
+
+/**
+ Return the TileService title corresponding to some WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog (of the TileService type)
+ returned by a previous call to get_wms_catalog_layer().
+
+ \return the title corresponding to the WMS TileService (if any)
+
+ \sa get_wms_tile_service_name, get_wms_tile_service_abstract
+ */
+ RL2_DECLARE const char *get_wms_tile_service_title (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the TileService abstract corresponding to some WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog (of the TileService type)
+ returned by a previous call to get_wms_catalog_layer().
+
+ \return the abstract corresponding to the WMS TileService (if any)
+
+ \sa get_wms_tile_service_title, get_wms_tile_service_title
+ */
+ RL2_DECLARE const char *get_wms_tile_service_abstract (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the total count of first-level Layers defined within a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the total count of first-level Layers defined within a WMS-Catalog object:
+ a negative number if the WMS-Catalog isn't valid
+
+ \sa create_wms_catalog, get_wms_catalog_layer, get_wms_format_count,
+ get_wms_tile_service_count
+ */
+ RL2_DECLARE int get_wms_catalog_count (rl2WmsCatalogPtr handle);
+
+/**
+ Return the total count of first-level Tiled Layers defined within a
+ WMS-Catalog [TileService] object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the total count of first-level Tiled Layers defined within a WMS-Catalog
+ [TileService] object:
+ a negative number if the WMS-Catalog isn't valid
+
+ \sa create_wms_catalog, get_wms_catalog_tiled, layer, get_wms_format_count,
+ get_wms_catalog_count
+ */
+ RL2_DECLARE int get_wms_tile_service_count (rl2WmsCatalogPtr handle);
+
+/**
+ Return the total count of Formats supported by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+ \param mode TRUE if only valid "image formats" should be considered;
+ if set to FALSE then any possible format will be considered.
+
+ \return the total count of Formats supported by a WMS-Catalog object:
+ ZERO or a a negative number if the WMS-Catalog isn't valid
+
+ \sa create_wms_catalog, get_wms_format, get_wms_catalog_count
+ */
+ RL2_DECLARE int get_wms_format_count (rl2WmsCatalogPtr handle, int mode);
+
+/**
+ Return the version string corresponding to some WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the version string corresponding to the WMS-Catalog object
+
+ \sa get_wms_name, get_wms_title, get_wms_abstract
+ */
+ RL2_DECLARE const char *get_wms_version (rl2WmsCatalogPtr handle);
+
+/**
+ Return the name corresponding to some WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the name corresponding to the WMS-Catalog object
+
+ \sa get_wms_version, get_wms_title, get_wms_abstract
+ */
+ RL2_DECLARE const char *get_wms_name (rl2WmsCatalogPtr handle);
+
+/**
+ Return the title corresponding to some WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the title corresponding to the WMS-Catalog object
+
+ \sa get_wms_version, get_wms_name, get_wms_abstract
+ */
+ RL2_DECLARE const char *get_wms_title (rl2WmsCatalogPtr handle);
+
+/**
+ Return the abstract corresponding to some WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the abstract corresponding to the WMS-Catalog object
+
+ \sa get_wms_version, get_wms_name, get_wms_title
+ */
+ RL2_DECLARE const char *get_wms_abstract (rl2WmsCatalogPtr handle);
+
+/**
+ Return the GetMap URL (method GET) from a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the corresponding URL: NULL if the URL is not defined or if any error is encountered.
+
+ \sa create_wms_catalog, get_wms_url_GetMap_post, get_wms_url_GetTileService_get,
+ get_wms_url_GetTileService_post, get_wms_url_GetFeatureInfo_get,
+ get_wms_url_GetFeatureInfo_post
+ */
+ RL2_DECLARE const char *get_wms_url_GetMap_get (rl2WmsCatalogPtr handle);
+
+/**
+ Return the GetMap URL (method POST) from a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the corresponding URL: NULL if the URL is not defined or if any error is encountered.
+
+ \sa create_wms_catalog, get_wms_url_GetMap_get, get_wms_url_GetTileService_get,
+ get_wms_url_GetTileService_post, get_wms_url_GetFeatureInfo_get,
+ get_wms_url_GetFeatureInfo_post
+ */
+ RL2_DECLARE const char *get_wms_url_GetMap_post (rl2WmsCatalogPtr handle);
+
+/**
+ Return the GetTileService URL (method GET) from a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the corresponding URL: NULL if the URL is not defined or if any error is encountered.
+
+ \sa create_wms_catalog, get_wms_url_GetMap_get, get_wms_url_GetMap_post,
+ get_wms_url_GetTileService_post, get_wms_url_GetFeatureInfo_get,
+ get_wms_url_GetFeatureInfo_post
+ */
+ RL2_DECLARE const char *get_wms_url_GetTileService_get (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the GetTileService URL (method POST) from a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the corresponding URL: NULL if the URL is not defined or if any error is encountered.
+
+ \sa create_wms_catalog, get_wms_url_GetMap_get, get_wms_url_GetMap_post,
+ get_wms_url_GetTileService_get, get_wms_url_GetFeatureInfo_get,
+ get_wms_url_GetFeatureInfo_post
+ */
+ RL2_DECLARE const char *get_wms_url_GetTileService_post (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the GetFeatureInfo URL (method GET) from a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the corresponding URL: NULL if the URL is not defined or if any error is encountered.
+
+ \sa create_wms_catalog, get_wms_url_GetMap_get, get_wms_url_GetMap_post,
+ get_wms_url_GetTileService_get, get_wms_url_GetTileService_post,
+ get_wms_url_GetFeatureInfo_post, get_wms_gml_mime_type, get_wms_xml_mime_type
+ */
+ RL2_DECLARE const char *get_wms_url_GetFeatureInfo_get (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the GetFeatureInfo URL (method POST) from a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the corresponding URL: NULL if the URL is not defined or if any error is encountered.
+
+ \sa create_wms_catalog, get_wms_url_GetMap_get, get_wms_url_GetMap_post,
+ get_wms_url_GetTileService_get, get_wms_url_GetTileService_post,
+ get_wms_url_GetFeatureInfo_get, get_wms_gml_mime_type, get_wms_xml_mime_type
+ */
+ RL2_DECLARE const char *get_wms_url_GetFeatureInfo_post (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the GML MIME type name from a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the MIME type corresponding to GML: NULL if it's not defined or if any error is encountered.
+
+ \sa create_wms_catalog, get_wms_url_GetFeatureInfo_get, get_wms_url_GetFeatureInfo_post,
+ get_wms_xml_mime_type
+ */
+ RL2_DECLARE const char *get_wms_gml_mime_type (rl2WmsCatalogPtr handle);
+
+/**
+ Return the XML MIME type name from a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the MIME type corresponding to XML: NULL if it's not defined or if any error is encountered.
+
+ \sa create_wms_catalog, get_wms_url_GetFeatureInfo_get, get_wms_url_GetFeatureInfo_post,
+ get_wms_gml_mime_type
+ */
+ RL2_DECLARE const char *get_wms_xml_mime_type (rl2WmsCatalogPtr handle);
+
+/**
+ Return the Contact Person defined by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the Contact Person: NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_contact_person (rl2WmsCatalogPtr handle);
+
+/**
+ Return the Contact Organization defined by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the Contact Organization: NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_contact_organization (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the Contact Position defined by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the Contact Position: NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_contact_position (rl2WmsCatalogPtr handle);
+
+/**
+ Return the Postal Address defined by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the Postal Address: NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_contact_postal_address (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the City (Postal Address) defined by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the City (Postal Address): NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_contact_city (rl2WmsCatalogPtr handle);
+
+/**
+ Return the State or Provicne (Postal Address) defined by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the State or Province (Postal Address): NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_contact_state_province (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the Post Code (Postal Address) defined by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the Post Code (Postal Address) : NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_contact_post_code (rl2WmsCatalogPtr handle);
+
+/**
+ Return the Country (Postal Address) defined by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the Country (Postal Address): NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_contact_country (rl2WmsCatalogPtr handle);
+
+/**
+ Return the Voice Telephone defined by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the Voice Telephone: NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_contact_voice_telephone (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the FAX Telephone defined by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the FAX Telephone: NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_contact_fax_telephone (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the e-mail Address defined by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the e-mail Address: NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_contact_email_address (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the Fees required by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the required Fees: NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_fees (rl2WmsCatalogPtr handle);
+
+/**
+ Return the Access Constraints supported by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the imposed Access Constraints: NULL if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_access_constraints (rl2WmsCatalogPtr
+ handle);
+
+/**
+ Return the Layer Limit supported by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the supported Layer Limit: a negative number if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE int get_wms_layer_limit (rl2WmsCatalogPtr handle);
+
+/**
+ Return the MaxWidth supported by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the MaxWidth measured in pixels: a negative number if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE int get_wms_max_width (rl2WmsCatalogPtr handle);
+
+/**
+ Return the MaxHeight supported by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+
+ \return the MaxHeight measured in pixels: a negative number if undeclared/unspecified.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE int get_wms_max_height (rl2WmsCatalogPtr handle);
+
+/**
+ Return one of the Formats supported by a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+ \param index the relative index identifying the required Format (the first
+ Format value supported by a WMS-Catalog object has index ZERO).
+ \param mode TRUE if only valid "image formats" should be considered;
+ if set to FALSE then any possible format will be considered.
+
+ \return the Format string: NULL if the required Format isn't defined.
+
+ \sa create_wms_catalog, get_wms_format_count
+ */
+ RL2_DECLARE const char *get_wms_format (rl2WmsCatalogPtr handle,
+ int index, int mode);
+
+/**
+ Return the pointer to some specific Layer defined within a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog returned by a previous call
+ to create_wms_catalog()
+ \param index the relative index identifying the required WMS-Layer (the first
+ Layer in the WMS-Catalaog object has index ZERO).
+
+ \return the pointer to the required WMS-Layer object: NULL if the passed index
+ isn't valid
+
+ \sa create_wms_catalog, get_wms_catalog_count, get_wms_layer_name, get_wms_layer_title,
+ get_wms_layer_abstract, get_wms_layer_crs_count, get_wms_layer_crs
+ */
+ RL2_DECLARE rl2WmsLayerPtr get_wms_catalog_layer (rl2WmsCatalogPtr
+ handle, int index);
+
+/**
+ Testing if some WMS-Layer object has Layer children
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return 0 (false) if not, any other value if yes
+
+ \sa get_wms_catalog_layer, get_wms_layer_children_count, get_wms_child_layer
+ */
+ RL2_DECLARE int wms_layer_has_children (rl2WmsLayerPtr handle);
+
+/**
+ Return the total count of children Layers defined within a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer
+
+ \return the total count of children Layers defined within a WMS-Layer object:
+ a negative number if the WMS-Layer isn't valid
+
+ \sa get_wms_catalog_layer, wms_layer_has_children, get_wms_child_layer
+ */
+ RL2_DECLARE int get_wms_layer_children_count (rl2WmsLayerPtr handle);
+
+/**
+ Return the pointer to some child Layer defined within a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer
+ \param index the relative index identifying the required WMS-Layer (the first
+ child Layer in the WMS-Layer object has index ZERO).
+
+ \return the pointer to the required WMS-Layer object: NULL if the passed index
+ isn't valid
+
+ \sa get_wms_catalog_layer, wms_layer_has_children, get_wms_layer_children_count
+ */
+ RL2_DECLARE rl2WmsLayerPtr get_wms_child_layer (rl2WmsLayerPtr
+ handle, int index);
+
+/**
+ Return the name corresponding to some WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the name corresponding to the WMS-Layer object
+
+ \sa get_wms_layer_title, get_wms_layer_abstract, get_wms_layer_crs_count, get_wms_layer_crs,
+ wms_layer_has_children
+ */
+ RL2_DECLARE const char *get_wms_layer_name (rl2WmsLayerPtr handle);
+
+/**
+ Return the title corresponding to some WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the title corresponding to the WMS-Layer object
+
+ \sa get_wms_layer_name, get_wms_layer_abstract, get_wms_layer_crs_count, get_wms_layer_crs
+ */
+ RL2_DECLARE const char *get_wms_layer_title (rl2WmsLayerPtr handle);
+
+/**
+ Return the abstract corresponding to some WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the abstract corresponding to the WMS-Layer object
+
+ \sa get_wms_layer_name, get_wms_layer_title, get_wms_layer_crs_count, get_wms_layer_crs
+ */
+ RL2_DECLARE const char *get_wms_layer_abstract (rl2WmsLayerPtr handle);
+
+/**
+ Return the total count of CRSs supported by a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the total count of CRSs supported by a WMS-Layer object:
+ ZERO or a negative number if the WMS-Layer isn't valid
+
+ \sa get_wms_layer_name, get_wms_layer_title, get_wms_layer_abstract,
+ get_wms_layer_crs, get_wms_layer_style_count
+ */
+ RL2_DECLARE int get_wms_layer_crs_count (rl2WmsLayerPtr handle);
+
+/**
+ Return one of the CRSs supported by a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+ \param index the relative index identifying the required CRS (the first
+ CRS value supported by a WMS-Layer object has index ZERO).
+
+ \return the CRS string: NULL if the required CRS isn't defined.
+
+ \sa get_wms_layer_name, get_wms_layer_title, get_wms_layer_abstract,
+ get_wms_layer_crs_count
+ */
+ RL2_DECLARE const char *get_wms_layer_crs (rl2WmsLayerPtr handle,
+ int index);
+
+/**
+ Tests if some WMS-Layer object declares the Opaque property
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return TRUE or FALSE: a negative number if undefined/unspecified or if
+ isn't a valid WMS-Layer.
+
+ \sa get_wms_layer_name, get_wms_layer_title, get_wms_layer_abstract,
+ is_wms_layer_queriable
+ */
+ RL2_DECLARE int is_wms_layer_opaque (rl2WmsLayerPtr handle);
+
+/**
+ Tests if some WMS-Layer object declares the Queryable property
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return TRUE or FALSE: a negative number if undefined/unspecified or if
+ isn't a valid WMS-Layer.
+
+ \sa get_wms_layer_name, get_wms_layer_title, get_wms_layer_abstract,
+ is_wms_layer_transparent
+ */
+ RL2_DECLARE int is_wms_layer_queryable (rl2WmsLayerPtr handle);
+
+/**
+ Return the total count of Styles supported by a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the total count of Styles supported by a WMS-Layer object:
+ ZERO or a negative number if the WMS-Layer isn't valid
+
+ \sa get_wms_layer_crs_count, get_wms_layer_style_name, get_wms_layer_style_title,
+ get_wms_layer_style_abstract
+ */
+ RL2_DECLARE int get_wms_layer_style_count (rl2WmsLayerPtr handle);
+
+/**
+ Return the Min Scale Denominator supported by a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the Min Scale Denominator declared by a WMS-Layer object:
+ DBL_MAX if undeclared or if the WMS-Layer isn't valid
+
+ \sa get_wms_layer_crs_count, get_wms_layer_max_scale_denominator
+ */
+ RL2_DECLARE double get_wms_layer_min_scale_denominator (rl2WmsLayerPtr
+ handle);
+
+/**
+ Return the Max Scale Denominator supported by a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the Max Scale Denominator declared by a WMS-Layer object:
+ DBL_MAX if undeclared or if the WMS-Layer isn't valid
+
+ \sa get_wms_layer_crs_count, get_wms_layer_min_scale_denominator
+ */
+ RL2_DECLARE double get_wms_layer_max_scale_denominator (rl2WmsLayerPtr
+ handle);
+
+/**
+ Return the Geographic Bounding Box (long/lat) declared by a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+ \param minx on successful completion will contain the Min Longitude
+ \param maxx on successful completion will contain the Max Longitude
+ \param miny on successful completion will contain the Min Latitude
+ \param maxy on successful completion will contain the Max Latitude
+
+ \return TRUE on success, FALSE if any error occurred
+
+ \sa get_wms_layer_bbbox
+ */
+ RL2_DECLARE int get_wms_layer_geo_bbox (rl2WmsLayerPtr handle, double *minx,
+ double *maxx, double *miny,
+ double *maxy);
+
+/**
+ Return the Bounding Box corresponding to some CRS declared by a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+ \param crs the string value identifying some specific CRS
+ \param minx on successful completion will contain the Min Longitude
+ \param maxx on successful completion will contain the Max Longitude
+ \param miny on successful completion will contain the Min Latitude
+ \param maxy on successful completion will contain the Max Latitude
+
+ \return TRUE on success, FALSE if any error occurred
+
+ \sa get_wms_layer_geo_bbox
+ */
+ RL2_DECLARE int get_wms_layer_bbox (rl2WmsLayerPtr handle, const char *crs,
+ double *minx, double *maxx,
+ double *miny, double *maxy);
+
+/**
+ Return the Name of some Style supported by a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+ \param index the relative index identifying the required Style (the first
+ Style supported by a WMS-Layer object has index ZERO).
+
+ \return the Style's Name: NULL if the required Style isn't defined.
+
+ \sa get_wms_layer_style_count, get_wms_layer_style_title, get_wms_layer_style_abstract
+ */
+ RL2_DECLARE const char *get_wms_layer_style_name (rl2WmsLayerPtr handle,
+ int index);
+
+/**
+ Return the Title of some Style supported by a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+ \param index the relative index identifying the required Style (the first
+ Style supported by a WMS-Layer object has index ZERO).
+
+ \return the Style's Title: NULL if the required Style isn't defined.
+
+ \sa get_wms_layer_style_count, get_wms_layer_style_name, get_wms_layer_style_abstract
+ */
+ RL2_DECLARE const char *get_wms_layer_style_title (rl2WmsLayerPtr handle,
+ int index);
+
+/**
+ Return the Abstract of some Style supported by a WMS-Layer object
+
+ \param handle the pointer to a valid WMS-Layer returned by a previous call
+ to get_wms_catalog_layer().
+ \param index the relative index identifying the required Style (the first
+ Style supported by a WMS-Layer object has index ZERO).
+
+ \return the Style's Abstract: NULL if the required Style isn't defined.
+
+ \sa get_wms_layer_style_count, get_wms_layer_style_name, get_wms_layer_style_title
+ */
+ RL2_DECLARE const char *get_wms_layer_style_abstract (rl2WmsLayerPtr handle,
+ int index);
+
+/**
+ Return the pointer to some specific Tiled Layer defined within a WMS-Catalog object
+
+ \param handle the pointer to a valid WMS-Catalog [of the TileService type]
+ returned by a previous call to create_wms_catalog()
+ \param index the relative index identifying the required WMS-TiledLayer (the first
+ Tiled Layer in the WMS-Catalaog object has index ZERO).
+
+ \return the pointer to the required WMS-TiledLayer object: NULL if the passed index
+ isn't valid
+
+ \sa create_wms_catalog, get_wms_tile_service_count, get_wms_tiled_layer_name,
+ get_wms_tiled_layer_title, get_wms_tiled_layer_abstract, get_wms_tiled_layer_crs
+ */
+ RL2_DECLARE rl2WmsTiledLayerPtr
+ get_wms_catalog_tiled_layer (rl2WmsCatalogPtr handle, int index);
+
+/**
+ Testing if some WMS-TiledLayer object has TiledLayer children
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_tiled_layer().
+
+ \return 0 (false) if not, any other value if yes
+
+ \sa get_wms_catalog_tiled_layer, get_wms_tiled_layer_children_count, get_wms_child_tiled_layer
+ */
+ RL2_DECLARE int wms_tiled_layer_has_children (rl2WmsTiledLayerPtr handle);
+
+/**
+ Return the total count of children TiledLayers defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer
+
+ \return the total count of children TiledLayers defined within a WMS-TiledLayer object:
+ a negative number if the WMS-TiledLayer isn't valid
+
+ \sa get_wms_catalog_tiled_layer, wms_tiled_layer_has_children, get_wms_child_layer
+ */
+ RL2_DECLARE int get_wms_tiled_layer_children_count (rl2WmsTiledLayerPtr
+ handle);
+
+/**
+ Return the pointer to some child TiledLayer defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer
+ \param index the relative index identifying the required WMS-TiledLayer (the first
+ child Layer in the WMS-TiledLayer object has index ZERO).
+
+ \return the pointer to the required WMS-TiledLayer object: NULL if the passed index
+ isn't valid
+
+ \sa get_wms_catalog_tiled_layer, wms_tiled_layer_has_children, get_wms_tiled_layer_children_count
+ */
+ RL2_DECLARE rl2WmsTiledLayerPtr
+ get_wms_child_tiled_layer (rl2WmsTiledLayerPtr handle, int index);
+
+/**
+ Return the name corresponding to some WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the name corresponding to the WMS-TiledLayer object
+
+ \sa get_wms_tiled_layer_title, get_wms_tiled_layer_abstract, get_wms_tiled_layer_crs,
+ get_wms_tiled_layer_format, get_wms_tiled_layer_style, get_wms_tiled_layer_pad,
+ get_wms_tiled_layer_bands, get_wms_tiled_layer_data_type, get_wms_tiled_layer_bbox,
+ wms_tiled_layer_has_children, get_wms_tile_pattern_count
+ */
+ RL2_DECLARE const char *get_wms_tiled_layer_name (rl2WmsTiledLayerPtr
+ handle);
+
+/**
+ Return the title corresponding to some WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the title corresponding to the WMS-TiledLayer object
+
+ \sa get_wms_tiled_layer_name, get_wms_tiled_layer_abstract, get_wms_tiled_layer_crs,
+ get_wms_tiled_layer_format, get_wms_tiled_layer_style, get_wms_tiled_layer_pad,
+ get_wms_tiled_layer_bands, get_wms_tiled_layer_data_type, get_wms_tiled_layer_bbox,
+ wms_tiled_layer_has_children, get_wms_tile_pattern_count
+ */
+ RL2_DECLARE const char *get_wms_tiled_layer_title (rl2WmsTiledLayerPtr
+ handle);
+
+/**
+ Return the abstract corresponding to some WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the abstract corresponding to the WMS-TiledLayer object
+
+ \sa get_wms_tiled_layer_name, get_wms_tiled_layer_title, get_wms_tiled_layer_crs,
+ get_wms_tiled_layer_format, get_wms_tiled_layer_style, get_wms_tiled_layer_pad,
+ get_wms_tiled_layer_bands, get_wms_tiled_layer_data_type, get_wms_tiled_layer_bbox,
+ wms_tiled_layer_has_children, get_wms_tile_pattern_count
+ */
+ RL2_DECLARE const char *get_wms_tiled_layer_abstract (rl2WmsTiledLayerPtr
+ handle);
+
+/**
+ Return the CRS corresponding to some WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the CRS corresponding to the WMS-TiledLayer object
+
+ \sa get_wms_tiled_layer_name, get_wms_tiled_layer_title, get_wms_tiled_layer_abstract,
+ get_wms_tiled_layer_format, get_wms_tiled_layer_style, get_wms_tiled_layer_pad,
+ get_wms_tiled_layer_bands, get_wms_tiled_layer_data_type, get_wms_tiled_layer_bbox,
+ wms_tiled_layer_has_children
+ */
+ RL2_DECLARE const char *get_wms_tiled_layer_crs (rl2WmsTiledLayerPtr
+ handle);
+
+/**
+ Return the Format corresponding to some WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the Format corresponding to the WMS-TiledLayer object
+
+ \sa get_wms_tiled_layer_name, get_wms_tiled_layer_title, get_wms_tiled_layer_abstract,
+ get_wms_tiled_layer_crs, get_wms_tiled_layer_style, get_wms_tiled_layer_pad,
+ get_wms_tiled_layer_bands, get_wms_tiled_layer_data_type, get_wms_tiled_layer_bbox,
+ wms_tiled_layer_has_children, get_wms_tile_pattern_count
+ */
+ RL2_DECLARE const char *get_wms_tiled_layer_format (rl2WmsTiledLayerPtr
+ handle);
+
+/**
+ Return the Style corresponding to some WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the Style corresponding to the WMS-TiledLayer object
+
+ \sa get_wms_tiled_layer_name, get_wms_tiled_layer_title, get_wms_tiled_layer_abstract,
+ get_wms_tiled_layer_crs, get_wms_tiled_layer_format, get_wms_tiled_layer_pad,
+ get_wms_tiled_layer_bands, get_wms_tiled_layer_data_type, get_wms_tiled_layer_bbox,
+ wms_tiled_layer_has_children, get_wms_tile_pattern_count
+ */
+ RL2_DECLARE const char *get_wms_tiled_layer_style (rl2WmsTiledLayerPtr
+ handle);
+
+/**
+ Return the Pad corresponding to some WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the Pad corresponding to the WMS-TiledLayer object
+
+ \sa get_wms_tiled_layer_name, get_wms_tiled_layer_title, get_wms_tiled_layer_abstract,
+ get_wms_tiled_layer_crs, get_wms_tiled_layer_format, get_wms_tiled_layer_style,
+ get_wms_tiled_layer_bands, get_wms_tiled_layer_data_type, get_wms_tiled_layer_bbox,
+ wms_tiled_layer_has_children
+ */
+ RL2_DECLARE const char *get_wms_tiled_layer_pad (rl2WmsTiledLayerPtr
+ handle);
+
+/**
+ Return the Bands corresponding to some WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the Bands corresponding to the WMS-TiledLayer object
+
+ \sa get_wms_tiled_layer_name, get_wms_tiled_layer_title, get_wms_tiled_layer_abstract,
+ get_wms_tiled_layer_crs, get_wms_tiled_layer_format, get_wms_tiled_layer_style,
+ get_wms_tiled_layer_pad, get_wms_tiled_layer_data_type, get_wms_tiled_layer_bbox,
+ wms_tiled_layer_has_children, get_wms_tile_pattern_count
+ */
+ RL2_DECLARE const char *get_wms_tiled_layer_bands (rl2WmsTiledLayerPtr
+ handle);
+
+/**
+ Return the DataType corresponding to some WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_layer().
+
+ \return the DataType corresponding to the WMS-TiledLayer object
+
+ \sa get_wms_tiled_layer_name, get_wms_tiled_layer_title, get_wms_tiled_layer_abstract,
+ get_wms_tiled_layer_crs, get_wms_tiled_layer_format, get_wms_tiled_layer_style,
+ get_wms_tiled_layer_pad, get_wms_tiled_layer_bands, get_wms_tiled_layer_bbox,
+ wms_tiled_layer_has_children, get_wms_tile_pattern_count
+ */
+ RL2_DECLARE const char *get_wms_tiled_layer_data_type (rl2WmsTiledLayerPtr
+ handle);
+
+/**
+ Return the BoundingBox corresponding to some WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_layer().
+ \param minx on successful completion will contain the Min Longitude
+ \param maxx on successful completion will contain the Max Longitude
+ \param miny on successful completion will contain the Min Latitude
+ \param maxy on successful completion will contain the Max Latitude
+
+ \return 0 on error, any other value on success
+
+ \sa get_wms_tiled_layer_name, get_wms_tiled_layer_title,
+ get_wms_tiled_layer_abstract, get_wms_tiled_layer_crs, get_wms_tiled_layer_format,
+ get_wms_tiled_layer_style, get_wms_tiled_layer_pad, get_wms_tiled_layer_bands,
+ get_wms_tiled_layer_data_type, wms_tiled_layer_has_children,
+ get_wms_tiled_layer_tile_size, get_wms_tile_pattern_count,
+ get_wms_tile_pattern_handle
+ */
+ RL2_DECLARE int get_wms_tiled_layer_bbox (rl2WmsTiledLayerPtr handle,
+ double *minx, double *miny,
+ double *maxx, double *maxy);
+
+/**
+ Return the Tile Size corresponding to some WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer returned by a previous call
+ to get_wms_catalog_layer().
+ \param width on successful completion will contain the Tile Width
+ \param height on successful completion will contain the Tile Height
+
+ \return 0 on error, any other value on success
+
+ \sa get_wms_tiled_layer_name, get_wms_tiled_layer_title,
+ get_wms_tiled_layer_abstract, get_wms_tiled_layer_crs, get_wms_tiled_layer_format,
+ get_wms_tiled_layer_style, get_wms_tiled_layer_pad, get_wms_tiled_layer_bands,
+ get_wms_tiled_layer_data_type, wms_tiled_layer_has_children,
+ get_wms_tiled_layer_bbox, get_wms_tile_pattern_count,
+ get_wms_tile_pattern_handle
+ */
+ RL2_DECLARE int get_wms_tiled_layer_tile_size (rl2WmsTiledLayerPtr handle,
+ int *width, int *height);
+
+/**
+ Return the total count of TiledPatterns defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer
+
+ \return the total count of TiledPatterns defined within a WMS-TiledLayer object:
+ a negative number if the WMS-TiledLayer isn't valid
+
+ \sa get_wms_tile_pattern_count, get_wms_tile_pattern_srs,
+ get_wms_tile_pattern_tile_width, get_wms_tile_pattern_tile_height,
+ get_wms_tile_pattern_base_x, get_wms_tile_pattern_base_y,
+ get_wms_tile_pattern_extent_x, get_wms_tile_pattern_handle
+ */
+ RL2_DECLARE int get_wms_tile_pattern_count (rl2WmsTiledLayerPtr handle);
+
+/**
+ Return the SRS from a TiledPattern defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer
+ \param index the relative index identifying the required WMS-TilePattern (the first
+ TilePattern Layer in the WMS-TiledLayer object has index ZERO).
+
+ \return the SRS defined within a WMS-TilePattern object:
+ NULL if the WMS-TilePattern isn't valid.
+
+ \sa get_wms_tile_pattern_count, get_wms_tile_pattern_tile_width,
+ get_wms_tile_pattern_tile_height, get_wms_tile_pattern_base_x,
+ get_wms_tile_pattern_base_y, get_wms_tile_pattern_extent_x,
+ get_wms_tile_pattern_extent_y, get_wms_tile_pattern_handle
+ */
+ RL2_DECLARE const char *get_wms_tile_pattern_srs (rl2WmsTiledLayerPtr
+ handle, int index);
+
+/**
+ Return the TileWidth from a TiledPattern defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer
+ \param index the relative index identifying the required WMS-TilePattern (the first
+ TilePattern Layer in the WMS-TiledLayer object has index ZERO).
+
+ \return the TileWidth defined within a WMS-TilePattern object:
+ a negative value if the WMS-TilePattern isn't valid.
+
+ \sa get_wms_tile_pattern_count, get_wms_tile_pattern_srs,
+ get_wms_tile_pattern_tile_height, get_wms_tile_pattern_base_x,
+ get_wms_tile_pattern_base_y, get_wms_tile_pattern_extent_x,
+ get_wms_tile_pattern_extent_y, get_wms_tile_pattern_handle
+ */
+ RL2_DECLARE int get_wms_tile_pattern_tile_width (rl2WmsTiledLayerPtr
+ handle, int index);
+
+/**
+ Return the TileHeight from a TiledPattern defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer
+ \param index the relative index identifying the required WMS-TilePattern (the first
+ TilePattern Layer in the WMS-TiledLayer object has index ZERO).
+
+ \return the TileHeight defined within a WMS-TilePattern object:
+ a negative value if the WMS-TilePattern isn't valid.
+
+ \sa get_wms_tile_pattern_count, get_wms_tile_pattern_srs,
+ get_wms_tile_pattern_tile_width, get_wms_tile_pattern_base_x,
+ get_wms_tile_pattern_base_y, get_wms_tile_pattern_extent_x,
+ get_wms_tile_pattern_extent_y, get_wms_tile_pattern_handle
+ */
+ RL2_DECLARE int get_wms_tile_pattern_tile_height (rl2WmsTiledLayerPtr
+ handle, int index);
+
+/**
+ Return the TileBaseX from a TiledPattern defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer
+ \param index the relative index identifying the required WMS-TilePattern (the first
+ TilePattern Layer in the WMS-TiledLayer object has index ZERO).
+
+ \return the TileBaseX (leftmost coord) defined within a WMS-TilePattern object:
+ DBL_MAX if the WMS-TilePattern isn't valid.
+
+ \sa get_wms_tile_pattern_count, get_wms_tile_pattern_srs,
+ get_wms_tile_pattern_tile_width, get_wms_tile_pattern_tile_height,
+ get_wms_tile_pattern_base_y, get_wms_tile_pattern_extent_x,
+ get_wms_tile_pattern_extent_y, get_wms_tile_pattern_handle
+ */
+ RL2_DECLARE double get_wms_tile_pattern_base_x (rl2WmsTiledLayerPtr
+ handle, int index);
+
+/**
+ Return the TileBaseY from a TiledPattern defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer
+ \param index the relative index identifying the required WMS-TilePattern (the first
+ TilePattern Layer in the WMS-TiledLayer object has index ZERO).
+
+ \return the TileBaseY (topmost coord) defined within a WMS-TilePattern object:
+ DBL_MAX if the WMS-TilePattern isn't valid.
+
+ \sa get_wms_tile_pattern_count, get_wms_tile_pattern_srs,
+ get_wms_tile_pattern_tile_width, get_wms_tile_pattern_tile_height,
+ get_wms_tile_pattern_base_x, get_wms_tile_pattern_extent_x,
+ get_wms_tile_pattern_extent_y, get_wms_tile_pattern_handle
+ */
+ RL2_DECLARE double get_wms_tile_pattern_base_y (rl2WmsTiledLayerPtr
+ handle, int index);
+
+/**
+ Return the TileExtentX from a TiledPattern defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer
+ \param index the relative index identifying the required WMS-TilePattern (the first
+ TilePattern Layer in the WMS-TiledLayer object has index ZERO).
+
+ \return the TileExtentX defined within a WMS-TilePattern object:
+ DBL_MAX if the WMS-TilePattern isn't valid.
+
+ \sa get_wms_tile_pattern_count, get_wms_tile_pattern_srs,
+ get_wms_tile_pattern_tile_width, get_wms_tile_pattern_tile_height,
+ get_wms_tile_pattern_base_x, get_wms_tile_pattern_base_y,
+ get_wms_tile_pattern_extent_y, get_wms_tile_pattern_handle
+ */
+ RL2_DECLARE double get_wms_tile_pattern_extent_x (rl2WmsTiledLayerPtr
+ handle, int index);
+
+/**
+ Return the TileExtentY from a TiledPattern defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer
+ \param index the relative index identifying the required WMS-TilePattern (the first
+ TilePattern Layer in the WMS-TiledLayer object has index ZERO).
+
+ \return the TileExtentX defined within a WMS-TilePattern object:
+ DBL_MAX if the WMS-TilePattern isn't valid.
+
+ \sa get_wms_tile_pattern_count, get_wms_tile_pattern_srs,
+ get_wms_tile_pattern_tile_width, get_wms_tile_pattern_tile_height,
+ get_wms_tile_pattern_base_x, get_wms_tile_pattern_base_y,
+ get_wms_tile_pattern_extent_x, get_wms_tile_pattern_handle
+ */
+ RL2_DECLARE double get_wms_tile_pattern_extent_y (rl2WmsTiledLayerPtr
+ handle, int index);
+
+/**
+ Return the handle for some TiledPattern defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TiledLayer
+ \param pattern_index the relative index identifying the required WMS-TilePattern (the first
+ TilePattern Layer in the WMS-TiledLayer object has index ZERO).
+
+ \return the handle for some TilePattern object inside
+ a WMS-TiledLayer object: NULL if any error is encountered.
+
+ \sa get_wms_tile_pattern_count, get_wms_tile_pattern_srs,
+ get_wms_tile_pattern_tile_width, get_wms_tile_pattern_tile_height,
+ get_wms_tile_pattern_base_x, get_wms_tile_pattern_base_y,
+ get_wms_tile_pattern_extent_x, get_wms_tile_pattern_extent_y
+ */
+ RL2_DECLARE rl2WmsTilePatternPtr
+ get_wms_tile_pattern_handle (rl2WmsTiledLayerPtr handle, int index);
+
+/**
+ Return a cloned copy of some TilePattern object
+
+ \param handle the pointer to a valid WMS-TilePattern returned by get_wms_tile_pattern_handle()
+
+ \return the handle to the new TilePattern: NULL if any error is encountered.
+
+ \sa get_wms_tile_pattern_handle, destroy_wms_tile_pattern,
+ get_wms_tile_pattern_sample_url, get_wms_tile_pattern_request_url
+
+ \note you are responsible to destroy before or after any WMS-TilePattern
+ object created by clone_wms_tile_pattern() by invoking destroy_wms_tile_pattern().
+ */
+ RL2_DECLARE rl2WmsTilePatternPtr
+ clone_wms_tile_pattern (rl2WmsTilePatternPtr handle);
+
+/**
+ Destroys a cloned copy of some TilePattern object
+
+ \param handle the pointer to a valid WMS-TilePattern returned by clone_wms_tile_pattern_handle()
+
+
+ \sa get_wms_tile_pattern_handle, clone_wms_tile_pattern,
+ get_wms_tile_pattern_sample_url, get_wms_tile_pattern_request_url
+ */
+ RL2_DECLARE void destroy_wms_tile_pattern (rl2WmsTilePatternPtr handle);
+
+/**
+ Return the sample URL representing a TiledPattern defined within a WMS-TiledLayer object
+
+ \param handle the pointer to a valid WMS-TilePattern returned by get_wms_tile_pattern_handle()
+
+ \return the sample URL representing a TilePattern object inside
+ a WMS-TiledLayer object: NULL if any error is encountered.
+
+ \sa get_wms_tile_pattern_handle, clone_wms_tile_pattern, destroy_wms_tile_pattern,
+ get_wms_tile_pattern_request_url
+
+ \note the returned sample URL corresponds to dynamically allocated memory,
+ and thus requires to be deallocated by invoking sqlite3_free().
+ */
+ RL2_DECLARE char *get_wms_tile_pattern_sample_url (rl2WmsTilePatternPtr
+ handle);
+
+/**
+ Return the full request URL for some TiledPattern defined within a WMS-TiledLayer object
+
+
+ \param handle the pointer to a valid WMS-TilePattern returned by get_wms_tile_pattern_handle()
+
+ \return the full request URL for some TilePattern object inside
+ a WMS-TiledLayer object: NULL if any error is encountered.
+
+ \sa get_wms_tile_pattern_handle, clone_wms_tile_pattern, destroy_wms_tile_pattern,
+ , get_wms_tile_pattern_sample_url
+
+ \note the returned full request URL corresponds to dynamically allocated memory,
+ and thus requires to be deallocated by invoking sqlite3_free().
+ */
+ RL2_DECLARE char *get_wms_tile_pattern_request_url (rl2WmsTilePatternPtr
+ handle,
+ const char *base_url,
+ double min_x,
+ double min_y);
+
+/**
+ Creates a WMS-Cache object
+
+ \return the pointer to the corresponding WMS-Cache object: NULL on failure
+
+ \sa destroy_wms_cache, reset_wms_cache, get_wms_cache_max_size, set_wms_cache_max_size,
+ get_wms_cache_items_count, get_wms_cache_current_size, get_wms_cache_hit_count,
+ get_wms_cache_miss_count, get_wms_cache_flushed_count, get_wms_total_download_size
+
+ \note you are responsible to destroy (before or after) any WMS-Cache created by create_wms_cache().
+ */
+ RL2_DECLARE rl2WmsCachePtr create_wms_cache (void);
+
+/**
+ Destroys a WMS-Cache object freeing any allocated resource
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+
+ \sa create_wms_cache, reset_wms_cache, get_wms_cache_max_size, set_wms_cache_max_size,
+ get_wms_cache_items_count, get_wms_cache_current_size, get_wms_cache_hit_count,
+ get_wms_cache_miss_count, get_wms_cache_flushed_count, get_wms_total_download_size
+ */
+ RL2_DECLARE void destroy_wms_cache (rl2WmsCachePtr handle);
+
+/**
+ Resets a WMS-Cache object to its initial empty state.
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+
+ \sa create_wms_cache, destroy_wms_cache, get_wms_cache_max_size, set_wms_cache_max_size,
+ get_wms_cache_items_count, get_wms_cache_current_size, get_wms_cache_hit_count,
+ get_wms_cache_miss_count, get_wms_cache_flushed_count, get_wms_total_download_size
+ */
+ RL2_DECLARE void reset_wms_cache (rl2WmsCachePtr handle);
+
+/**
+ Return the current Max-Size from a WMS-Cache object.
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+
+ \return the currently set MaxSize (in bytes) from some WMS-Cache object.
+
+ \sa create_wms_cache, destroy_wms_cache, reset_wms_cache, set_wms_cache_max_size,
+ get_wms_cache_items_count, get_wms_cache_current_size, get_wms_cache_hit_count,
+ get_wms_cache_miss_count, get_wms_cache_flushed_count, get_wms_total_download_size
+ */
+ RL2_DECLARE int get_wms_cache_max_size (rl2WmsCachePtr handle);
+
+/**
+ Chages the current Max Size for a WMS-Cache object.
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+ \param size the new Max Size (in bytes) to be set.
+
+ \sa create_wms_cache, destroy_wms_cache, reset_wms_cache, get_wms_cache_max_size,
+ get_wms_cache_items_count, get_wms_cache_current_size, get_wms_cache_hit_count,
+ get_wms_cache_miss_count, get_wms_cache_flushed_count, get_wms_total_download_size
+
+ \note if the WMS-Cache currently uses more memory than allowed by the new setting
+ any allocation in excess will be immediately freed.
+ */
+ RL2_DECLARE void set_wms_cache_max_size (rl2WmsCachePtr handle, int size);
+
+/**
+ Return the current number of cached items stored within a WMS-Cache object.
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+
+ \return the current number of cached items stored within a WMS-Cache object.
+
+ \sa create_wms_cache, destroy_wms_cache, reset_wms_cache, get_wms_cache_max_size,
+ set_wms_cache_max_size, get_wms_cache_current_size, get_wms_cache_hit_count,
+ get_wms_cache_miss_count, get_wms_cache_flushed_count, get_wms_total_download_size
+ */
+ RL2_DECLARE int get_wms_cache_items_count (rl2WmsCachePtr handle);
+
+/**
+ Return the current memory allocation used by a WMS-Cache object.
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+
+ \return the current memory allocation (in bytes) used by a WMS-Cache object.
+
+ \sa create_wms_cache, destroy_wms_cache, reset_wms_cache, get_wms_cache_max_size,
+ set_wms_cache_max_size, get_wms_cache_items_count, get_wms_cache_hit_count,
+ get_wms_cache_miss_count, get_wms_cache_flushed_count, get_wms_total_download_size
+ */
+ RL2_DECLARE int get_wms_cache_current_size (rl2WmsCachePtr handle);
+
+/**
+ Return the current total number of cache-hit events from a WMS-Cache object.
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+
+ \return the current total number of cache-hit events from a WMS-Cache object.
+
+ \sa create_wms_cache, destroy_wms_cache, reset_wms_cache, get_wms_cache_max_size,
+ set_wms_cache_max_size, get_wms_cache_items_count, get_wms_cache_current_size,
+ get_wms_cache_miss_count, get_wms_cache_flushed_count, get_wms_total_download_size
+ */
+ RL2_DECLARE int get_wms_cache_hit_count (rl2WmsCachePtr handle);
+
+/**
+ Return the current total number of cache-miss events from a WMS-Cache object.
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+
+ \return the current total number of cache-miss events from a WMS-Cache object.
+
+ \sa create_wms_cache, destroy_wms_cache, reset_wms_cache, get_wms_cache_max_size,
+ set_wms_cache_max_size, get_wms_cache_items_count, get_wms_cache_current_size,
+ get_wms_cache_hit_count, get_wms_cache_flushed_count, get_wms_total_download_size
+ */
+
+ RL2_DECLARE int get_wms_cache_miss_count (rl2WmsCachePtr handle);
+
+/**
+ Return the current size of memory allocations previously used by a WMS-Cache
+ object but now definitely released.
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+
+ \return the current size of memory allocations (in bytes) previously used
+ by a WMS-Cache object but now definitely released.
+
+ \sa create_wms_cache, destroy_wms_cache, reset_wms_cache, get_wms_cache_max_size,
+ set_wms_cache_max_size, get_wms_cache_items_count, get_wms_cache_current_size,
+ get_wms_cache_hit_count, get_wms_cache_miss_count, get_wms_total_download_size
+ */
+ RL2_DECLARE int get_wms_cache_flushed_count (rl2WmsCachePtr handle);
+
+/**
+ Return the total size (in bytes) of all cache items since the beginning of
+ the file cycle of some WMS-Cache.
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+
+ \return the total size (in bytes) of all cache items since the beginning of
+ the file cycle of some WMS-Cache object.
+
+ \sa create_wms_cache, destroy_wms_cache, reset_wms_cache, get_wms_cache_max_size,
+ set_wms_cache_max_size, get_wms_cache_items_count, get_wms_cache_current_size,
+ get_wms_cache_hit_count, get_wms_cache_miss_count, get_wms_cache_flushed_count
+ */
+
+ RL2_DECLARE double get_wms_total_download_size (rl2WmsCachePtr handle);
+
+/**
+ Performs a WMS GetMap request - HTTP GET
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+ \param url the WebServive base URL.
+ \param proxy an optional HTTP Proxy string: could be eventually NULL.
+ \param version a string identifying the version of the WMS protocol to be used.
+ \param layer name of the requested WMS-Layer.
+ \param a string identifying the CRS/SRS.
+ \param swap_xy a boolean value used to select between normal [XY] or flipped
+ [LatLon] axes ordering.
+ \param minx BoundingBox: X min coordinate.
+ \param miny BoundingBox: Y min coordinate.
+ \param maxx BoundingBox: X max coordinate.
+ \param maxy BoundingBox: Y max coordinate.
+ \param width horizontal dimension (in pixels) of the requested image.
+ \param height vertical dimension (in pixels) of the requested image.
+ \param style a string identifying some SLD Style; could be eventually NULL.
+ \param format a string indentifying the MIME type of the requested image.
+ \param opaque a boolean valued used to select if the requested image
+ should be either opaque or transparent.
+ \param from_cache boolean value: if TRUE simply an attempt to retrieve
+ the requested image from cached data will be performed.\n
+ Otherwise a full HTTP request will be forwarded for any uncached request.
+ \param err_msg on completion will contain an error message (if any)
+
+ \return a pointer to an RGBA buffer containing the requested image:
+ NULL if any error is encountered.
+
+ \sa do_wms_GetMap_post, do_wms_GetMap_TileService_get,
+ do_wms_GetMap_TileService_post, do_wms_GetFeatureInfo_get,
+ do_wms_GetFeatureInfo_post
+
+ \note the returned RGBA corresponds to dynamically allocated memory,
+ and thus requires to be deallocated before or after.\n
+ An eventual error message returned via err_msg requires to be deallocated
+ by invoking free().
+ */
+ RL2_DECLARE unsigned char *do_wms_GetMap_get (rl2WmsCachePtr handle,
+ const char *url,
+ const char *proxy,
+ const char *version,
+ const char *layer,
+ const char *crs, int swap_xy,
+ double minx, double miny,
+ double maxx, double maxy,
+ int width, int height,
+ const char *style,
+ const char *format,
+ int opaque, int from_cache,
+ char **err_msg);
+
+/**
+ Performs a WMS GetMap request - HTTP POST
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+ \param url the WebServive base URL.
+ \param proxy an optional HTTP Proxy string: could be eventually NULL.
+ \param version a string identifying the version of the WMS protocol to be used.
+ \param layer name of the requested WMS-Layer.
+ \param a string identifying the CRS/SRS
+ \param swap_xy a boolean value used to select between normal [XY] or flipped
+ [LatLon] axes ordering.
+ \param minx BoundingBox: X min coordinate.
+ \param miny BoundingBox: Y min coordinate.
+ \param maxx BoundingBox: X max coordinate.
+ \param maxy BoundingBox: Y max coordinate.
+ \param width horizontal dimension (in pixels) of the requested image.
+ \param height vertical dimension (in pixels) of the requested image.
+ \param style a string identifying some SLD Style; could be eventually NULL.
+ \param format a string indentifying the MIME type of the requested image.
+ \param opaque a boolean valued used to select if the requested image
+ should be either opaque or transparent.
+ \param from_cache boolean value: if TRUE simply an attempt to retrieve
+ the requested image from cached data will be performed.\n
+ Otherwise a full HTTP request will be forwarded for any uncached request.
+ \param err_msg on completion will contain an error message (if any)
+
+ \return a pointer to an RGBA buffer containing the requested image:
+ NULL if any error is encountered.\n
+ <bCurrently unimplemented: will always return NULL</b>
+
+ \sa do_wms_GetMap_get, do_wms_GetMap_TileService_get,
+ do_wms_GetMap_TileService_post, do_wms_GetFeatureInfo_get,
+ do_wms_GetFeatureInfo_post
+
+ \note the returned RGBA corresponds to dynamically allocated memory,
+ and thus requires to be deallocated before or after.\n
+ An eventual error message returned via err_msg requires to be deallocated
+ by invoking free().
+ */
+ RL2_DECLARE unsigned char *do_wms_GetMap_post (rl2WmsCachePtr handle,
+ const char *url,
+ const char *proxy,
+ const char *version,
+ const char *layer,
+ const char *crs, int swap_xy,
+ double minx, double miny,
+ double maxx, double maxy,
+ int width, int height,
+ const char *style,
+ const char *format,
+ int opaque, int from_cache,
+ char **err_msg);
+
+/**
+ Performs a WMS GetMap [TileService] request - HTTP GET
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+ \param url full TileService GetMap request URL.
+ \param proxy an optional HTTP Proxy string: could be eventually NULL.
+ \param width horizontal dimension (in pixels) of the requested image.
+ \param height vertical dimension (in pixels) of the requested image.
+ \param from_cache boolean value: if TRUE simply an attempt to retrieve
+ the requested image from cached data will be performed.\n
+ Otherwise a full HTTP request will be forwarded for any uncached request.
+ \param err_msg on completion will contain an error message (if any)
+
+ \return a pointer to an RGBA buffer containing the requested image:
+ NULL if any error is encountered.
+
+ \sa do_wms_GetMap_get, do_wms_GetMap_post,
+ do_wms_GetMap_TileService_post, do_wms_GetFeatureInfo_get,
+ do_wms_GetFeatureInfo_post
+
+ \note the returned RGBA corresponds to dynamically allocated memory,
+ and thus requires to be deallocated before or after.\n
+ An eventual error message returned via err_msg requires to be deallocated
+ by invoking free().
+ */
+ RL2_DECLARE unsigned char *do_wms_GetMap_TileService_get (rl2WmsCachePtr
+ handle,
+ const char *url,
+ const char *proxy,
+ int width,
+ int height,
+ int from_cache,
+ char **err_msg);
+
+/**
+ Performs a WMS GetMap [TileService] request - HTTP POST
+
+ \param handle the pointer to a valid WMS-Cache returned by a previous call
+ to create_wms_cache()
+ \param url full TileService GetMap request URL.
+ \param proxy an optional HTTP Proxy string: could be eventually NULL.
+ \param width horizontal dimension (in pixels) of the requested image.
+ \param height vertical dimension (in pixels) of the requested image.
+ \param from_cache boolean value: if TRUE simply an attempt to retrieve
+ the requested image from cached data will be performed.\n
+ Otherwise a full HTTP request will be forwarded for any uncached request.
+ \param err_msg on completion will contain an error message (if any)
+
+ \return a pointer to an RGBA buffer containing the requested image:
+ NULL if any error is encountered.\n
+ <bCurrently unimplemented: will always return NULL</b>
+
+ \sa do_wms_GetMap_get, do_wms_GetMap_post,
+ do_wms_GetMap_TileService_get, do_wms_GetFeatureInfo_get,
+ do_wms_GetFeatureInfo_post
+
+ \note the returned RGBA corresponds to dynamically allocated memory,
+ and thus requires to be deallocated before or after.\n
+ An eventual error message returned via err_msg requires to be deallocated
+ by invoking free().
+ */
+ RL2_DECLARE unsigned char *do_wms_GetMap_TileService_post (rl2WmsCachePtr
+ handle,
+ const char *url,
+ const char
+ *proxy,
+ int width,
+ int height,
+ int from_cache,
+ char **err_msg);
+
+/**
+ Performs a WMS GetFeatureInfo request - HTTP GET
+
+ \param url the WebServive base URL.
+ \param proxy an optional HTTP Proxy string: could be eventually NULL.
+ \param version a string identifying the version of the WMS protocol to be used.
+ \param format a string indentifying the MIME type of the requested image.
+ \param layer name of the requested WMS-Layer.
+ \param a string identifying the CRS/SRS
+ \param swap_xy a boolean value used to select between normal [XY] or flipped
+ [LatLon] axes ordering.
+ \param minx BoundingBox: X min coordinate.
+ \param miny BoundingBox: Y min coordinate.
+ \param maxx BoundingBox: X max coordinate.
+ \param maxy BoundingBox: Y max coordinate.
+ \param width horizontal dimension (in pixels) of the requested image.
+ \param height vertical dimension (in pixels) of the requested image.
+ \param img_x X coordinate (in pixels) of the point to be queryied.
+ \param img_y Y coordinate (in pixels) of the point to be queryied.
+ \param err_msg on completion will contain an error message (if any)
+
+ \return a pointer to a WMS-FeatureCollection object:
+ NULL if any error is encountered or if no result is available.
+
+ \sa do_wms_GetMap_get, do_wms_GetMap_post, do_wms_GetMap_TileService_get,
+ do_wms_GetMap_TileService_post, do_wms_GetFeatureInfo_post,
+ destroy_wms_feature_collection, wms_feature_collection_parse_geometries,
+ get_wms_feature_members_count
+
+ \note the returned WMS-FeatureCollection corresponds to dynamically allocated memory,
+ and thus requires to be deallocated before or after by invoking destroy_wms_feature_collection().\n
+ An eventual error message returned via err_msg requires to be deallocated
+ by invoking free().
+ */
+ RL2_DECLARE rl2WmsFeatureCollectionPtr
+ do_wms_GetFeatureInfo_get (const char *url,
+ const char *proxy,
+ const char *version,
+ const char *format,
+ const char *layer,
+ const char *crs,
+ int swap_xy,
+ double minx,
+ double miny,
+ double maxx,
+ double maxy,
+ int width, int height,
+ int img_x, int img_y, char **err_msg);
+
+/**
+ Performs a WMS GetFeatureInfo request - HTTP POST
+
+ \param url the WebServive base URL.
+ \param proxy an optional HTTP Proxy string: could be eventually NULL.
+ \param version a string identifying the version of the WMS protocol to be used.
+ \param format a string indentifying the MIME type of the requested image.
+ \param layer name of the requested WMS-Layer.
+ \param a string identifying the CRS/SRS
+ \param swap_xy a boolean value used to select between normal [XY] or flipped
+ [LatLon] axes ordering.
+ \param minx BoundingBox: X min coordinate.
+ \param miny BoundingBox: Y min coordinate.
+ \param maxx BoundingBox: X max coordinate.
+ \param maxy BoundingBox: Y max coordinate.
+ \param width horizontal dimension (in pixels) of the requested image.
+ \param height vertical dimension (in pixels) of the requested image.
+ \param img_x X coordinate (in pixels) of the point to be queried.
+ \param img_y Y coordinate (in pixels) of the point to be queried.
+ \param err_msg on completion will contain an error message (if any)
+
+ \return a pointer to a WMS-FeatureCollection object:
+ NULL if any error is encountered or if no result is available.\n
+ <bCurrently unimplemented: will always return NULL</b>
+
+ \sa do_wms_GetMap_get, do_wms_GetMap_post, do_wms_GetMap_TileService_get,
+ do_wms_GetMap_TileService_post, do_wms_GetFeatureInfo_get,
+ destroy_wms_feature_collection, wms_feature_collection_parse_geometries,
+ get_wms_feature_members_count
+
+ \note the returned WMS-FeatureCollection corresponds to dynamically allocated memory,
+ and thus requires to be deallocated before or after by invoking destroy_wms_feature_collection().\n
+ An eventual error message returned via err_msg requires to be deallocated
+ by invoking free().
+ */
+ RL2_DECLARE rl2WmsFeatureCollectionPtr
+ do_wms_GetFeatureInfo_post (const char *url,
+ const char *proxy,
+ const char *version,
+ const char *format,
+ const char *layer,
+ const char *crs,
+ int swap_xy,
+ double minx,
+ double miny,
+ double maxx,
+ double maxy,
+ int width, int height,
+ int img_x, int img_y, char **err_msg);
+
+/**
+ Destroys a WMS-FeatureCollection object freeing any allocated resource
+
+ \param handle the pointer to a valid WMS-FeatureCollection returned by a previous call
+ to do_wms_GetFeatureInfo_get() or do_wms_GetFeatureInfo_post()
+
+ \sa do_wms_GetFeatureInfo_get, do_wms_GetFeatureInfo_post,
+ wms_feature_collection_parse_geometries, get_wms_feature_members_count,
+ get_wms_feature_member, get_wms_feature_attributes_count,
+ get_wms_feature_attribute_name, get_wms_feature_attribute_value,
+ get_wms_feature_attribute_geometry
+ */
+ RL2_DECLARE void destroy_wms_feature_collection (rl2WmsFeatureCollectionPtr
+ handle);
+
+/**
+ Attempts to parse all GML Geometries from within a WMS-FeatureCollection object
+
+ \param handle the pointer to a valid WMS-FeatureCollection returned by a previous call
+ to do_wms_GetFeatureInfo_get() or do_wms_GetFeatureInfo_post()
+ \param srid the SRID value of the current Map
+ \param point_x X coordinate (in the Map CRS) identifying the queried Point.
+ \param point_y Y coordinate (in the Map CRS) identifying the queried Point.
+ \param sqlite handle to a valid SQLite connection - required in order to support
+ coordinate re-projections based on ST_Transform().
+
+ \sa do_wms_GetFeatureInfo_get, do_wms_GetFeatureInfo_post,
+ destroy_wms_feature_collection, get_wms_feature_members_count,
+ get_wms_feature_member, get_wms_feature_attributes_count,
+ get_wms_feature_attribute_name, get_wms_feature_attribute_value,
+ get_wms_feature_attribute_geometry
+ */
+ RL2_DECLARE void
+ wms_feature_collection_parse_geometries (rl2WmsFeatureCollectionPtr
+ handle, int srid,
+ double point_x, double point_y,
+ sqlite3 * sqlite);
+
+/**
+ Return the total count of WMS-FeatureMembers from within a WMS_FeatureCollection object
+
+ \param handle the pointer to a valid WMS-FeatureCollection returned by a previous call
+ to do_wms_GetFeatureInfo_get() or do_wms_GetFeatureInfo_post()
+
+ \return the total count of WMS-FeatureMembers from within a WMS_FeatureCollection object.
+
+ \sa do_wms_GetFeatureInfo_get, do_wms_GetFeatureInfo_post,
+ destroy_wms_feature_collection, wms_feature_collection_parse_geometries,
+ get_wms_feature_member, get_wms_feature_attributes_count,
+ get_wms_feature_attribute_name, get_wms_feature_attribute_value,
+ get_wms_feature_attribute_geometry
+ */
+ RL2_DECLARE int get_wms_feature_members_count (rl2WmsFeatureCollectionPtr
+ handle);
+
+/**
+ Return a pointer referencing the Nth WMS-FeatureMember from within a WMS_FeatureCollection object
+
+ \param handle the pointer to a valid WMS-FeatureCollection returned by a previous call
+ to do_wms_GetFeatureInfo_get() or do_wms_GetFeatureInfo_post()
+ \param index the relative index identifying the required FeatureMember (the first
+ Member supported by a WMS-FeatureCollection object has index ZERO).
+
+ \return a pointer referencing the Nth WMS-FeatureMember from within a WMS_FeatureCollection
+ object: NULL for empty/void collections or if any error occurs.
+
+ \sa do_wms_GetFeatureInfo_get, do_wms_GetFeatureInfo_post,
+ destroy_wms_feature_collection, wms_feature_collection_parse_geometries,
+ get_wms_feature_member, get_wms_feature_attributes_count,
+ get_wms_feature_attribute_name, get_wms_feature_attribute_value,
+ get_wms_feature_attribute_geometry
+ */
+ RL2_DECLARE rl2WmsFeatureMemberPtr
+ get_wms_feature_member (rl2WmsFeatureCollectionPtr handle, int index);
+
+/**
+ Return a pointer the Name string of some WMS-FeatureMember object
+
+ \param handle the pointer to a valid WMS-FeatureCollection returned by a previous call
+ to do_wms_GetFeatureInfo_get() or do_wms_GetFeatureInfo_post()
+
+ \return a pointer the Name string of some WMS-FeatureMember object:
+ NULL if any error occurs.
+
+ \sa do_wms_GetFeatureInfo_get, do_wms_GetFeatureInfo_post,
+ destroy_wms_feature_collection, wms_feature_collection_parse_geometries,
+ get_wms_feature_member, get_wms_feature_attributes_count,
+ get_wms_feature_attribute_name, get_wms_feature_attribute_value,
+ get_wms_feature_attribute_geometry
+ */
+ RL2_DECLARE int get_wms_feature_attributes_count (rl2WmsFeatureMemberPtr
+ handle);
+
+/**
+ Return a pointer the Nth AttributeName string from within some WMS-FeatureMember object
+
+ \param handle the pointer to a valid WMS-FeatureCollection returned by a previous call
+ to do_wms_GetFeatureInfo_get() or do_wms_GetFeatureInfo_post()
+ \param index the relative index identifying the required Attribute (the first
+ Attribute supported by a WMS-FeatureMember object has index ZERO).
+
+ \return a pointer the Nth AttributeName string of some WMS-FeatureMember object:
+ NULL if any error occurs.
+
+ \sa do_wms_GetFeatureInfo_get, do_wms_GetFeatureInfo_post,
+ destroy_wms_feature_collection, wms_feature_collection_parse_geometries,
+ get_wms_feature_member, get_wms_feature_attributes_count,
+ get_wms_feature_attributes_count, get_wms_feature_attribute_value,
+ get_wms_feature_attribute_geometry
+ */
+ RL2_DECLARE const char
+ *get_wms_feature_attribute_name (rl2WmsFeatureMemberPtr handle,
+ int index);
+
+/**
+ Return a pointer the Nth AttributeValue string from within some WMS-FeatureMember object
+
+ \param handle the pointer to a valid WMS-FeatureCollection returned by a previous call
+ to do_wms_GetFeatureInfo_get() or do_wms_GetFeatureInfo_post()
+ \param index the relative index identifying the required Attribute (the first
+ Attribute supported by a WMS-FeatureMember object has index ZERO).
+
+ \return a pointer the Nth AttributeValue string of some WMS-FeatureMember object:
+ NULL if any error occurs. (please note: an AttributeValue could eventually correspond
+ to a NULL value by itself)
+
+ \sa do_wms_GetFeatureInfo_get, do_wms_GetFeatureInfo_post,
+ destroy_wms_feature_collection, wms_feature_collection_parse_geometries,
+ get_wms_feature_member, get_wms_feature_attributes_count,
+ get_wms_feature_attributes_count, get_wms_feature_attribute_name,
+ get_wms_feature_attribute_geometry
+ */
+ RL2_DECLARE const char
+ *get_wms_feature_attribute_value (rl2WmsFeatureMemberPtr handle,
+ int index);
+
+/**
+ Return a pointer to a SpatiaLite's own Geometry object corresponding to the Nth AttributeValue
+ from within some WMS-FeatureMember object
+
+ \param handle the pointer to a valid WMS-FeatureCollection returned by a previous call
+ to do_wms_GetFeatureInfo_get() or do_wms_GetFeatureInfo_post()
+ \param index the relative index identifying the required Attribute (the first
+ Attribute supported by a WMS-FeatureMember object has index ZERO).
+
+ \return a pointer the Nth AttributeValue of some WMS-FeatureMember object if it actually
+ corresponds to some GML Geometry:
+ NULL if any error occurs or if the AttributeValue isn't a GML Geometry.
+
+ \sa do_wms_GetFeatureInfo_get, do_wms_GetFeatureInfo_post,
+ destroy_wms_feature_collection, wms_feature_collection_parse_geometries,
+ get_wms_feature_member, get_wms_feature_attributes_count,
+ get_wms_feature_attributes_count, get_wms_feature_attribute_name,
+ get_wms_feature_attribute_value
+
+ \note the returned Geometry object simply is a reference, and this must
+ absolutely not be destroyed by directly calling gaiaFreeGeomColl().
+ */
+ RL2_DECLARE gaiaGeomCollPtr
+ get_wms_feature_attribute_geometry (rl2WmsFeatureMemberPtr handle,
+ int index);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RL2WMS_H */
diff --git a/headers/rasterlite2/sqlite.h b/headers/rasterlite2/sqlite.h
new file mode 100644
index 0000000..6b99d13
--- /dev/null
+++ b/headers/rasterlite2/sqlite.h
@@ -0,0 +1,55 @@
+/*
+ sqlite.h -- supporting SQLite headers in a flexible way
+
+ version 0.1, 2013 December 22
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#ifndef _RL2_SQLITE_H
+#define _RL2_SQLITE_H
+
+#ifdef LOADABLE_EXTENSION /* loadable-extension only */
+#include <sqlite3ext.h>
+extern const sqlite3_api_routines *sqlite3_api;
+#else /* ordinary lib */
+#include <sqlite3.h>
+#endif
+
+#endif
diff --git a/headers/rasterlite2_private.h b/headers/rasterlite2_private.h
new file mode 100644
index 0000000..6ceb6c6
--- /dev/null
+++ b/headers/rasterlite2_private.h
@@ -0,0 +1,1325 @@
+/*
+
+ rasterlite2_private -- hidden internals
+
+ version 0.1, 2013 March 29
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the RasterLite2 library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+/**
+ \file rasterlite2_private.h
+
+ RasterLite2 private header file
+ */
+
+#include "config.h"
+
+/*
+/ the following patch supporting GeoTiff headers
+/ was kindly contributed by Brad Hards on 2011-09-02
+/ for libgaigraphics (the ancestor of librasterlite2)
+*/
+#ifdef HAVE_GEOTIFF_GEOTIFF_H
+#include <geotiff/geotiff.h>
+#include <geotiff/xtiffio.h>
+#include <geotiff/geo_tiffp.h>
+#include <geotiff/geo_keyp.h>
+#include <geotiff/geovalues.h>
+#include <geotiff/geo_normalize.h>
+#elif HAVE_LIBGEOTIFF_GEOTIFF_H
+#include <libgeotiff/geotiff.h>
+#include <libgeotiff/xtiffio.h>
+#include <libgeotiff/geo_tiffp.h>
+#include <libgeotiff/geo_keyp.h>
+#include <libgeotiff/geovalues.h>
+#include <libgeotiff/geo_normalize.h>
+#else
+#include <geotiff.h>
+#include <xtiffio.h>
+#include <geo_tiffp.h>
+#include <geo_keyp.h>
+#include <geovalues.h>
+#include <geo_normalize.h>
+#endif
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+#ifdef _WIN32
+#ifdef DLL_EXPORT
+#define RL2_PRIVATE
+#else
+#define RL2_PRIVATE
+#endif
+#else
+#define RL2_PRIVATE __attribute__ ((visibility("hidden")))
+#endif
+#endif
+
+#ifndef _RASTERLITE2_PRIVATE_H
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+#define _RASTERLITE2_PRIVATE_H
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* internal binary format markers */
+#define RL2_ODD_BLOCK_START 0xfa
+#define RL2_ODD_BLOCK_END 0xf0
+#define RL2_EVEN_BLOCK_START 0xdb
+#define RL2_EVEN_BLOCK_END 0xd0
+#define RL2_LITTLE_ENDIAN 0x01
+#define RL2_BIG_ENDIAN 0x00
+#define RL2_PALETTE_START 0xa4
+#define RL2_PALETTE_END 0xa5
+#define RL2_DATA_START 0xc8
+#define RL2_DATA_END 0xc9
+#define RL2_MASK_START 0xb6
+#define RL2_MASK_END 0xb7
+#define RL2_STATS_START 0x27
+#define RL2_STATS_END 0x2a
+#define RL2_BAND_STATS_START 0x37
+#define RL2_BAND_STATS_END 0x3a
+#define RL2_HISTOGRAM_START 0x47
+#define RL2_HISTOGRAM_END 0x4a
+#define RL2_NO_DATA_START 0x03
+#define RL2_NO_DATA_END 0x23
+#define RL2_SAMPLE_START 0x06
+#define RL2_SAMPLE_END 0x26
+
+/* internal ColorSpace forced conversions */
+#define RL2_CONVERT_NO 0x00
+#define RL2_CONVERT_MONOCHROME_TO_PALETTE 0x01
+#define RL2_CONVERT_PALETTE_TO_MONOCHROME 0x02
+#define RL2_CONVERT_RGB_TO_GRAYSCALE 0x03
+#define RL2_CONVERT_GRAYSCALE_TO_RGB 0x04
+#define RL2_CONVERT_PALETTE_TO_GRAYSCALE 0x05
+#define RL2_CONVERT_GRAYSCALE_TO_PALETTE 0x06
+#define RL2_CONVERT_PALETTE_TO_RGB 0x07
+#define RL2_CONVERT_GRID_INT8_TO_UINT8 0x08
+#define RL2_CONVERT_GRID_INT8_TO_INT16 0x09
+#define RL2_CONVERT_GRID_INT8_TO_UINT16 0x0a
+#define RL2_CONVERT_GRID_INT8_TO_INT32 0x0b
+#define RL2_CONVERT_GRID_INT8_TO_UINT32 0x0c
+#define RL2_CONVERT_GRID_INT8_TO_FLOAT 0x0d
+#define RL2_CONVERT_GRID_INT8_TO_DOUBLE 0x0e
+#define RL2_CONVERT_GRID_INT16_TO_INT8 0x0f
+#define RL2_CONVERT_GRID_INT16_TO_UINT8 0x10
+#define RL2_CONVERT_GRID_INT16_TO_UINT16 0x11
+#define RL2_CONVERT_GRID_INT16_TO_INT32 0x12
+#define RL2_CONVERT_GRID_INT16_TO_UINT32 0x13
+#define RL2_CONVERT_GRID_INT16_TO_FLOAT 0x14
+#define RL2_CONVERT_GRID_INT16_TO_DOUBLE 0x15
+#define RL2_CONVERT_GRID_INT32_TO_UINT8 0x16
+#define RL2_CONVERT_GRID_INT32_TO_INT8 0x17
+#define RL2_CONVERT_GRID_INT32_TO_UINT16 0x18
+#define RL2_CONVERT_GRID_INT32_TO_INT16 0x19
+#define RL2_CONVERT_GRID_INT32_TO_UINT32 0x1a
+#define RL2_CONVERT_GRID_INT32_TO_FLOAT 0x1b
+#define RL2_CONVERT_GRID_INT32_TO_DOUBLE 0x1c
+#define RL2_CONVERT_GRID_UINT8_TO_INT8 0x1d
+#define RL2_CONVERT_GRID_UINT8_TO_INT16 0x1e
+#define RL2_CONVERT_GRID_UINT8_TO_UINT16 0x1f
+#define RL2_CONVERT_GRID_UINT8_TO_INT32 0x20
+#define RL2_CONVERT_GRID_UINT8_TO_UINT32 0x21
+#define RL2_CONVERT_GRID_UINT8_TO_FLOAT 0x22
+#define RL2_CONVERT_GRID_UINT8_TO_DOUBLE 0x23
+#define RL2_CONVERT_GRID_UINT16_TO_INT8 0x24
+#define RL2_CONVERT_GRID_UINT16_TO_UINT8 0x25
+#define RL2_CONVERT_GRID_UINT16_TO_INT16 0x26
+#define RL2_CONVERT_GRID_UINT16_TO_INT32 0x27
+#define RL2_CONVERT_GRID_UINT16_TO_UINT32 0x28
+#define RL2_CONVERT_GRID_UINT16_TO_FLOAT 0x29
+#define RL2_CONVERT_GRID_UINT16_TO_DOUBLE 0x2a
+#define RL2_CONVERT_GRID_UINT32_TO_UINT8 0x2b
+#define RL2_CONVERT_GRID_UINT32_TO_INT8 0x2c
+#define RL2_CONVERT_GRID_UINT32_TO_UINT16 0x2d
+#define RL2_CONVERT_GRID_UINT32_TO_INT16 0x2e
+#define RL2_CONVERT_GRID_UINT32_TO_INT32 0x2f
+#define RL2_CONVERT_GRID_UINT32_TO_FLOAT 0x30
+#define RL2_CONVERT_GRID_UINT32_TO_DOUBLE 0x31
+#define RL2_CONVERT_GRID_FLOAT_TO_UINT8 0x32
+#define RL2_CONVERT_GRID_FLOAT_TO_INT8 0x33
+#define RL2_CONVERT_GRID_FLOAT_TO_UINT16 0x34
+#define RL2_CONVERT_GRID_FLOAT_TO_INT16 0x35
+#define RL2_CONVERT_GRID_FLOAT_TO_UINT32 0x36
+#define RL2_CONVERT_GRID_FLOAT_TO_INT32 0x37
+#define RL2_CONVERT_GRID_FLOAT_TO_DOUBLE 0x38
+#define RL2_CONVERT_GRID_DOUBLE_TO_UINT8 0x39
+#define RL2_CONVERT_GRID_DOUBLE_TO_INT8 0x3a
+#define RL2_CONVERT_GRID_DOUBLE_TO_UINT16 0x3b
+#define RL2_CONVERT_GRID_DOUBLE_TO_INT16 0x3c
+#define RL2_CONVERT_GRID_DOUBLE_TO_UINT32 0x3d
+#define RL2_CONVERT_GRID_DOUBLE_TO_INT32 0x3e
+#define RL2_CONVERT_GRID_DOUBLE_TO_FLOAT 0x3f
+
+/* internal RasterStyle constants */
+#define RL2_BAND_SELECTION_TRIPLE 0xd1
+#define RL2_BAND_SELECTION_MONO 0xd2
+
+ typedef union rl2_priv_sample
+ {
+ char int8;
+ unsigned char uint8;
+ short int16;
+ unsigned short uint16;
+ int int32;
+ unsigned int uint32;
+ float float32;
+ double float64;
+ } rl2PrivSample;
+ typedef rl2PrivSample *rl2PrivSamplePtr;
+
+ typedef struct rl2_priv_pixel
+ {
+ unsigned char sampleType;
+ unsigned char pixelType;
+ unsigned char nBands;
+ unsigned char isTransparent;
+ rl2PrivSamplePtr Samples;
+ } rl2PrivPixel;
+ typedef rl2PrivPixel *rl2PrivPixelPtr;
+
+ typedef struct rl2_priv_palette_entry
+ {
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ } rl2PrivPaletteEntry;
+ typedef rl2PrivPaletteEntry *rl2PrivPaletteEntryPtr;
+
+ typedef struct rl2_priv_palette
+ {
+ unsigned short nEntries;
+ rl2PrivPaletteEntryPtr entries;
+ } rl2PrivPalette;
+ typedef rl2PrivPalette *rl2PrivPalettePtr;
+
+ typedef struct rl2_priv_raster
+ {
+ unsigned char sampleType;
+ unsigned char pixelType;
+ unsigned char nBands;
+ unsigned int width;
+ unsigned int height;
+ double minX;
+ double minY;
+ double maxX;
+ double maxY;
+ int Srid;
+ double hResolution;
+ double vResolution;
+ unsigned char *rasterBuffer;
+ unsigned char *maskBuffer;
+ rl2PrivPalettePtr Palette;
+ rl2PrivPixelPtr noData;
+ } rl2PrivRaster;
+ typedef rl2PrivRaster *rl2PrivRasterPtr;
+
+ typedef struct rl2_priv_tile
+ {
+ unsigned short pyramidLevel;
+ unsigned short sectionRow;
+ unsigned short sectionColumn;
+ rl2PrivRasterPtr Raster;
+ } rl2PrivTile;
+ typedef rl2PrivTile *rl2PrivTilePtr;
+
+ typedef struct rl2_priv_section
+ {
+ char *sectionName;
+ unsigned char Compression;
+ unsigned int tileWidth;
+ unsigned int tileHeight;
+ rl2PrivRasterPtr Raster;
+ } rl2PrivSection;
+ typedef rl2PrivSection *rl2PrivSectionPtr;
+
+ typedef struct rl2_priv_coverage
+ {
+ char *coverageName;
+ unsigned char sampleType;
+ unsigned char pixelType;
+ unsigned char nBands;
+ unsigned char Compression;
+ int Quality;
+ unsigned int tileWidth;
+ unsigned int tileHeight;
+ int Srid;
+ double hResolution;
+ double vResolution;
+ rl2PrivPixelPtr noData;
+ } rl2PrivCoverage;
+ typedef rl2PrivCoverage *rl2PrivCoveragePtr;
+
+ typedef struct rl2_priv_tiff_origin
+ {
+ char *path;
+ char *tfw_path;
+ int isGeoTiff;
+ TIFF *in;
+ int isTiled;
+ uint32 width;
+ uint32 height;
+ uint32 tileWidth;
+ uint32 tileHeight;
+ uint32 rowsPerStrip;
+ uint16 bitsPerSample;
+ uint16 samplesPerPixel;
+ uint16 photometric;
+ uint16 compression;
+ uint16 sampleFormat;
+ uint16 planarConfig;
+ unsigned short maxPalette;
+ unsigned char *red;
+ unsigned char *green;
+ unsigned char *blue;
+ unsigned short remapMaxPalette;
+ unsigned char *remapRed;
+ unsigned char *remapGreen;
+ unsigned char *remapBlue;
+ int isGeoReferenced;
+ int Srid;
+ double hResolution;
+ double vResolution;
+ char *srsName;
+ char *proj4text;
+ double minX;
+ double minY;
+ double maxX;
+ double maxY;
+ unsigned char forced_sample_type;
+ unsigned char forced_pixel_type;
+ unsigned char forced_num_bands;
+ unsigned char forced_conversion;
+ } rl2PrivTiffOrigin;
+ typedef rl2PrivTiffOrigin *rl2PrivTiffOriginPtr;
+
+ typedef struct rl2_priv_tiff_destination
+ {
+ char *path;
+ char *tfw_path;
+ int isGeoTiff;
+ TIFF *out;
+ GTIF *gtif;
+ void *tiffBuffer;
+ uint32 width;
+ uint32 height;
+ int isTiled;
+ uint32 tileWidth;
+ uint32 tileHeight;
+ uint32 rowsPerStrip;
+ uint16 bitsPerSample;
+ uint16 samplesPerPixel;
+ uint16 photometric;
+ uint16 compression;
+ uint16 sampleFormat;
+ unsigned short maxPalette;
+ unsigned char *red;
+ unsigned char *green;
+ unsigned char *blue;
+ int isGeoReferenced;
+ int Srid;
+ double hResolution;
+ double vResolution;
+ char *srsName;
+ char *proj4text;
+ double minX;
+ double minY;
+ double maxX;
+ double maxY;
+ } rl2PrivTiffDestination;
+ typedef rl2PrivTiffDestination *rl2PrivTiffDestinationPtr;
+
+ typedef struct rl2_priv_ascii_origin
+ {
+ char *path;
+ FILE *tmp;
+ unsigned int width;
+ unsigned int height;
+ int Srid;
+ double hResolution;
+ double vResolution;
+ double minX;
+ double minY;
+ double maxX;
+ double maxY;
+ double noData;
+ unsigned char sample_type;
+ } rl2PrivAsciiOrigin;
+ typedef rl2PrivAsciiOrigin *rl2PrivAsciiOriginPtr;
+
+ typedef struct rl2_priv_ascii_destination
+ {
+ char *path;
+ FILE *out;
+ unsigned int width;
+ unsigned int height;
+ double Resolution;
+ double X;
+ double Y;
+ int isCentered;
+ double noData;
+ int decimalDigits;
+ unsigned int nextLineNo;
+ char headerDone;
+ void *pixels;
+ unsigned char sampleType;
+ } rl2PrivAsciiDestination;
+ typedef rl2PrivAsciiDestination *rl2PrivAsciiDestinationPtr;
+
+ typedef struct rl2_pool_variance
+ {
+ double variance;
+ double count;
+ struct rl2_pool_variance *next;
+ } rl2PoolVariance;
+ typedef rl2PoolVariance *rl2PoolVariancePtr;
+
+ typedef struct rl2_priv_band_statistics
+ {
+ double min;
+ double max;
+ double mean;
+ double sum_sq_diff;
+ unsigned short nHistogram;
+ double *histogram;
+ rl2PoolVariancePtr first;
+ rl2PoolVariancePtr last;
+ } rl2PrivBandStatistics;
+ typedef rl2PrivBandStatistics *rl2PrivBandStatisticsPtr;
+
+ typedef struct rl2_priv_raster_statistics
+ {
+ double no_data;
+ double count;
+ unsigned char sampleType;
+ unsigned char nBands;
+ rl2PrivBandStatisticsPtr band_stats;
+ } rl2PrivRasterStatistics;
+ typedef rl2PrivRasterStatistics *rl2PrivRasterStatisticsPtr;
+
+ typedef struct rl2_color_map_ref
+ {
+ double min;
+ double max;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ unsigned char maxRed;
+ unsigned char maxGreen;
+ unsigned char maxBlue;
+ struct rl2_color_map_ref *next;
+ } rl2ColorMapRef;
+ typedef rl2ColorMapRef *rl2ColorMapRefPtr;
+
+ typedef struct rl2_color_map_item
+ {
+ rl2ColorMapRefPtr first;
+ rl2ColorMapRefPtr last;
+ } rl2ColorMapItem;
+ typedef rl2ColorMapItem *rl2ColorMapItemPtr;
+
+ typedef struct rl2_color_map_locator
+ {
+ int interpolate;
+ rl2ColorMapItem look_up[256];
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ } rl2ColorMapLocator;
+ typedef rl2ColorMapLocator *rl2ColorMapLocatorPtr;
+
+ typedef struct rl2_band_handling
+ {
+ unsigned char contrastEnhancement;
+ unsigned char look_up[256];
+ double minValue;
+ double maxValue;
+ double scaleFactor;
+ rl2ColorMapLocatorPtr colorMap;
+ } rl2BandHandling;
+ typedef rl2BandHandling *rl2BandHandlingPtr;
+
+ typedef struct rl2_priv_band_selection
+ {
+ int selectionType;
+ unsigned char redBand;
+ unsigned char greenBand;
+ unsigned char blueBand;
+ unsigned char grayBand;
+ unsigned char redContrast;
+ double redGamma;
+ unsigned char greenContrast;
+ double greenGamma;
+ unsigned char blueContrast;
+ double blueGamma;
+ unsigned char grayContrast;
+ double grayGamma;
+ } rl2PrivBandSelection;
+ typedef rl2PrivBandSelection *rl2PrivBandSelectionPtr;
+
+ typedef struct rl2_priv_color_map_point
+ {
+ double value;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ struct rl2_priv_color_map_point *next;
+ } rl2PrivColorMapPoint;
+ typedef rl2PrivColorMapPoint *rl2PrivColorMapPointPtr;
+
+ typedef struct rl2_priv_color_map_categorize
+ {
+ unsigned char baseRed;
+ unsigned char baseGreen;
+ unsigned char baseBlue;
+ rl2PrivColorMapPointPtr first;
+ rl2PrivColorMapPointPtr last;
+ unsigned char dfltRed;
+ unsigned char dfltGreen;
+ unsigned char dfltBlue;
+ } rl2PrivColorMapCategorize;
+ typedef rl2PrivColorMapCategorize *rl2PrivColorMapCategorizePtr;
+
+ typedef struct rl2_priv_color_map_interpolate
+ {
+ rl2PrivColorMapPointPtr first;
+ rl2PrivColorMapPointPtr last;
+ unsigned char dfltRed;
+ unsigned char dfltGreen;
+ unsigned char dfltBlue;
+ } rl2PrivColorMapInterpolate;
+ typedef rl2PrivColorMapInterpolate *rl2PrivColorMapInterpolatePtr;
+
+ typedef struct rl2_priv_raster_style
+ {
+ char *name;
+ char *title;
+ char *abstract;
+ double opacity;
+ unsigned char contrastEnhancement;
+ double gammaValue;
+ rl2PrivBandSelectionPtr bandSelection;
+ rl2PrivColorMapCategorizePtr categorize;
+ rl2PrivColorMapInterpolatePtr interpolate;
+ int shadedRelief;
+ int brightnessOnly;
+ double reliefFactor;
+ } rl2PrivRasterStyle;
+ typedef rl2PrivRasterStyle *rl2PrivRasterStylePtr;
+
+ typedef struct rl2_priv_child_style
+ {
+ char *namedLayer;
+ char *namedStyle;
+ int validLayer;
+ int validStyle;
+ struct rl2_priv_child_style *next;
+ } rl2PrivChildStyle;
+ typedef rl2PrivChildStyle *rl2PrivChildStylePtr;
+
+ typedef struct rl2_priv_group_style
+ {
+ char *name;
+ char *title;
+ char *abstract;
+ rl2PrivChildStylePtr first;
+ rl2PrivChildStylePtr last;
+ int valid;
+ } rl2PrivGroupStyle;
+ typedef rl2PrivGroupStyle *rl2PrivGroupStylePtr;
+
+ typedef struct rl2_priv_group_renderer_layer
+ {
+ int layer_type;
+ char *layer_name;
+ rl2CoveragePtr coverage;
+ char *style_name;
+ rl2PrivRasterStylePtr raster_symbolizer;
+ rl2PrivRasterStatisticsPtr raster_stats;
+ } rl2PrivGroupRendererLayer;
+ typedef rl2PrivGroupRendererLayer *rl2PrivGroupRendererLayerPtr;
+
+ typedef struct rl2_priv_group_renderer
+ {
+ int count;
+ rl2PrivGroupRendererLayerPtr layers;
+ } rl2PrivGroupRenderer;
+ typedef rl2PrivGroupRenderer *rl2PrivGroupRendererPtr;
+
+ typedef struct wms_retry_item
+ {
+ int done;
+ int count;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ struct wms_retry_item *next;
+ } WmsRetryItem;
+ typedef WmsRetryItem *WmsRetryItemPtr;
+
+ typedef struct wms_retry_list
+ {
+ WmsRetryItemPtr first;
+ WmsRetryItemPtr last;
+ } WmsRetryList;
+ typedef WmsRetryList *WmsRetryListPtr;
+
+ typedef struct section_pyramid_tile_in
+ {
+ sqlite3_int64 tile_id;
+ double cx;
+ double cy;
+ struct section_pyramid_tile_in *next;
+ } SectionPyramidTileIn;
+ typedef SectionPyramidTileIn *SectionPyramidTileInPtr;
+
+ typedef struct section_pyramid_tile_ref
+ {
+ SectionPyramidTileInPtr child;
+ struct section_pyramid_tile_ref *next;
+ } SectionPyramidTileRef;
+ typedef SectionPyramidTileRef *SectionPyramidTileRefPtr;
+
+ typedef struct section_pyramid_tile_out
+ {
+ unsigned int row;
+ unsigned int col;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ SectionPyramidTileRefPtr first;
+ SectionPyramidTileRefPtr last;
+ struct section_pyramid_tile_out *next;
+ } SectionPyramidTileOut;
+ typedef SectionPyramidTileOut *SectionPyramidTileOutPtr;
+
+ typedef struct section_pyramid
+ {
+ sqlite3_int64 section_id;
+ int scale;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_samples;
+ unsigned char compression;
+ int quality;
+ int srid;
+ unsigned int full_width;
+ unsigned int full_height;
+ double res_x;
+ double res_y;
+ unsigned int scaled_width;
+ unsigned int scaled_height;
+ double tile_width;
+ double tile_height;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ SectionPyramidTileInPtr first_in;
+ SectionPyramidTileInPtr last_in;
+ SectionPyramidTileOutPtr first_out;
+ SectionPyramidTileOutPtr last_out;
+ } SectionPyramid;
+ typedef SectionPyramid *SectionPyramidPtr;
+
+ typedef struct resolution_level
+ {
+ int level;
+ int scale;
+ int real_scale;
+ double x_resolution;
+ double y_resolution;
+ struct resolution_level *prev;
+ struct resolution_level *next;
+ } ResolutionLevel;
+ typedef ResolutionLevel *ResolutionLevelPtr;
+
+ typedef struct resolutions_list
+ {
+ ResolutionLevelPtr first;
+ ResolutionLevelPtr last;
+ } ResolutionsList;
+ typedef ResolutionsList *ResolutionsListPtr;
+
+ typedef struct insert_wms
+ {
+ sqlite3 *sqlite;
+ unsigned char *rgba_tile;
+ rl2CoveragePtr coverage;
+ const char *sect_name;
+ double x;
+ double y;
+ int width;
+ int height;
+ double tilew;
+ double tileh;
+ int srid;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ unsigned char sample_type;
+ unsigned char num_bands;
+ unsigned char compression;
+ double horz_res;
+ double vert_res;
+ unsigned int tile_width;
+ unsigned int tile_height;
+ rl2PixelPtr no_data;
+ sqlite3_stmt *stmt_sect;
+ sqlite3_stmt *stmt_levl;
+ sqlite3_stmt *stmt_tils;
+ sqlite3_stmt *stmt_data;
+ } InsertWms;
+ typedef InsertWms *InsertWmsPtr;
+
+ typedef struct rl2_mem_pdf_target
+ {
+ unsigned char *buffer;
+ int write_offset;
+ int size;
+ } rl2PrivMemPdf;
+ typedef rl2PrivMemPdf *rl2PrivMemPdfPtr;
+
+ struct aux_renderer
+ {
+ /* helper struct for passing arguments to aux_render_image */
+ sqlite3 *sqlite;
+ int width;
+ int height;
+ int base_width;
+ int base_height;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ int srid;
+ double xx_res;
+ double yy_res;
+ int transparent;
+ double opacity;
+ int quality;
+ unsigned char format_id;
+ unsigned char bg_red;
+ unsigned char bg_green;
+ unsigned char bg_blue;
+ rl2CoveragePtr coverage;
+ rl2RasterStylePtr symbolizer;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *outbuf;
+ rl2PalettePtr palette;
+ unsigned char out_pixel;
+ };
+
+ struct aux_group_renderer
+ {
+ /* helper struct for passing arguments to aux_group_renderer */
+ sqlite3_context *context;
+ const char *group_name;
+ double minx;
+ double maxx;
+ double miny;
+ double maxy;
+ int width;
+ int height;
+ const char *style;
+ unsigned char format_id;
+ unsigned char bg_red;
+ unsigned char bg_green;
+ unsigned char bg_blue;
+ int transparent;
+ int quality;
+ int reaspect;
+ };
+
+ RL2_PRIVATE int
+ rl2_blob_from_file (const char *path, unsigned char **blob,
+ int *blob_size);
+
+ RL2_PRIVATE int
+ rl2_blob_to_file (const char *path, unsigned char *blob, int blob_size);
+
+ RL2_PRIVATE int
+ rl2_decode_jpeg_scaled (int scale, const unsigned char *jpeg,
+ int jpeg_sz, unsigned int *width,
+ unsigned int *height,
+ unsigned char *pixel_type,
+ unsigned char **pixels, int *pixels_sz);
+
+ RL2_PRIVATE int
+ rl2_decode_webp_scaled (int scale, const unsigned char *webp,
+ int webp_sz, unsigned int *width,
+ unsigned int *height,
+ unsigned char pixel_type,
+ unsigned char **pixels, int *pixels_sz,
+ unsigned char **mask, int *mask_sz);
+
+ RL2_PRIVATE int
+ rl2_data_to_png (const unsigned char *pixels, const unsigned char *mask,
+ double opacity, rl2PalettePtr plt,
+ unsigned int width, unsigned int height,
+ unsigned char sample_type, unsigned char pixel_type,
+ unsigned char **compr_data, int *compressed_size);
+
+ RL2_PRIVATE int
+ rl2_decode_png (const unsigned char *png, int png_sz,
+ unsigned int *width, unsigned int *height,
+ unsigned char *sample_type, unsigned char *pixel_type,
+ unsigned char *num_bands, unsigned char **pixels,
+ int *pixels_sz, unsigned char **mask, int *mask_sz,
+ rl2PalettePtr * palette);
+
+ RL2_PRIVATE int
+ rl2_data_to_gif (const unsigned char *pixels,
+ rl2PalettePtr plt, unsigned int width,
+ unsigned int height, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char **compr_data,
+ int *compressed_size);
+
+ RL2_PRIVATE int
+ rl2_decode_gif (const unsigned char *gif, int gif_sz,
+ unsigned int *width, unsigned int *height,
+ unsigned char *sample_type, unsigned char *pixel_type,
+ unsigned char **pixels, int *pixels_sz,
+ rl2PalettePtr * palette);
+
+ RL2_PRIVATE int
+ rl2_data_to_jpeg (const unsigned char *pixels,
+ const unsigned char *mask, rl2PalettePtr plt,
+ unsigned int width, unsigned int height,
+ unsigned char sample_type, unsigned char pixel_type,
+ unsigned char **jpeg, int *jpeg_size, int quality);
+
+ RL2_PRIVATE int
+ rl2_decode_tiff_mono4 (const unsigned char *tiff, int tiff_sz,
+ unsigned int *width, unsigned int *height,
+ unsigned char **pixels, int *pixels_sz);
+
+ RL2_PRIVATE char truncate_8 (double val);
+
+ RL2_PRIVATE unsigned char truncate_u8 (double val);
+
+ RL2_PRIVATE short truncate_16 (double val);
+
+ RL2_PRIVATE unsigned short truncate_u16 (double val);
+
+ RL2_PRIVATE int truncate_32 (double val);
+
+ RL2_PRIVATE unsigned int truncate_u32 (double val);
+
+ RL2_PRIVATE void void_raw_buffer_palette (unsigned char *buffer,
+ unsigned int width,
+ unsigned int height,
+ rl2PixelPtr no_data);
+
+ RL2_PRIVATE void void_raw_buffer (unsigned char *buffer,
+ unsigned int width,
+ unsigned int height,
+ unsigned char sample_type,
+ unsigned char num_bands,
+ rl2PixelPtr no_data);
+
+ RL2_PRIVATE int load_dbms_tiles (sqlite3 * handle,
+ sqlite3_stmt * stmt_tiles,
+ sqlite3_stmt * stmt_data,
+ unsigned char *outbuf,
+ unsigned int width,
+ unsigned int height,
+ unsigned char sample_type,
+ unsigned char num_bands, double x_res,
+ double y_res, double minx, double miny,
+ double maxx, double maxy, int level,
+ int scale, rl2PalettePtr palette,
+ rl2PixelPtr no_data,
+ rl2RasterStylePtr style,
+ rl2RasterStatisticsPtr stats);
+
+ RL2_PRIVATE int load_dbms_tiles_section (sqlite3 * handle,
+ sqlite3_int64 section_id,
+ sqlite3_stmt * stmt_tiles,
+ sqlite3_stmt * stmt_data,
+ unsigned char *outbuf,
+ unsigned int width,
+ unsigned int height,
+ unsigned char sample_type,
+ unsigned char num_bands,
+ double x_res, double y_res,
+ double minx, double maxy,
+ int scale, rl2PalettePtr palette,
+ rl2PixelPtr no_data);
+
+ RL2_PRIVATE void
+ compute_aggregate_sq_diff (rl2RasterStatisticsPtr aggreg_stats);
+
+ RL2_PRIVATE int get_coverage_sample_bands (sqlite3 * sqlite,
+ const char *coverage,
+ unsigned char *sample_type,
+ unsigned char *num_bands);
+
+ RL2_PRIVATE int get_coverage_defs (sqlite3 * sqlite, const char *coverage,
+ unsigned int *tile_width,
+ unsigned int *tile_height,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *num_bands,
+ unsigned char *compression);
+
+ RL2_PRIVATE rl2PixelPtr default_nodata (unsigned char sample,
+ unsigned char pixel,
+ unsigned char num_bands);
+
+ RL2_PRIVATE WmsRetryListPtr alloc_retry_list ();
+
+ RL2_PRIVATE void free_retry_list (WmsRetryListPtr lst);
+
+ RL2_PRIVATE void add_retry (WmsRetryListPtr lst, double minx, double miny,
+ double maxx, double maxy);
+
+ RL2_PRIVATE gaiaGeomCollPtr build_extent (int srid, double minx,
+ double miny, double maxx,
+ double maxy);
+
+ RL2_PRIVATE int do_insert_wms_tile (sqlite3 * handle,
+ unsigned char *blob_odd,
+ int blob_odd_sz,
+ unsigned char *blob_even,
+ int blob_even_sz,
+ sqlite3_int64 section_id, int srid,
+ double res_x, double res_y,
+ unsigned int tile_w,
+ unsigned int tile_h, double miny,
+ double maxx, double tile_minx,
+ double tile_miny, double tile_maxx,
+ double tile_maxy,
+ rl2PalettePtr aux_palette,
+ rl2PixelPtr no_data,
+ sqlite3_stmt * stmt_tils,
+ sqlite3_stmt * stmt_data,
+ rl2RasterStatisticsPtr section_stats);
+
+ RL2_PRIVATE int do_insert_levels (sqlite3 * handle, double base_res_x,
+ double base_res_y, double factor,
+ unsigned char sample_type,
+ sqlite3_stmt * stmt_levl);
+
+ RL2_PRIVATE int do_insert_stats (sqlite3 * handle,
+ rl2RasterStatisticsPtr section_stats,
+ sqlite3_int64 section_id,
+ sqlite3_stmt * stmt_upd_sect);
+
+ RL2_PRIVATE int do_insert_section (sqlite3 * handle, const char *src_path,
+ const char *section, int srid,
+ unsigned int width,
+ unsigned int height, double minx,
+ double miny, double maxx, double maxy,
+ sqlite3_stmt * stmt_sect,
+ sqlite3_int64 * id);
+
+ RL2_PRIVATE char *get_section_name (const char *src_path);
+
+ RL2_PRIVATE rl2RasterPtr build_wms_tile (rl2CoveragePtr coverage,
+ const unsigned char *rgba_tile);
+
+ RL2_PRIVATE int insert_wms_tile (InsertWmsPtr ptr, int *first,
+ rl2RasterStatisticsPtr * section_stats,
+ sqlite3_int64 * section_id);
+
+ RL2_PRIVATE int is_point (gaiaGeomCollPtr geom);
+
+ RL2_PRIVATE ResolutionsListPtr alloc_resolutions_list ();
+
+ RL2_PRIVATE void destroy_resolutions_list (ResolutionsListPtr list);
+
+ RL2_PRIVATE void add_base_resolution (ResolutionsListPtr list, int level,
+ int scale, double x_res,
+ double y_res);
+
+ RL2_PRIVATE int find_best_resolution_level (sqlite3 * handle,
+ const char *coverage,
+ double x_res, double y_res,
+ int *level_id, int *scale,
+ int *real_scale, double *xx_res,
+ double *yy_res);
+
+ RL2_PRIVATE unsigned char get_palette_format (rl2PrivPalettePtr plt);
+
+ RL2_PRIVATE int get_payload_from_monochrome_opaque (unsigned int width,
+ unsigned int height,
+ sqlite3 * handle,
+ double minx,
+ double miny,
+ double maxx,
+ double maxy, int srid,
+ unsigned char *pixels,
+ unsigned char format,
+ int quality,
+ unsigned char **image,
+ int *image_sz);
+
+ RL2_PRIVATE int get_payload_from_monochrome_transparent (unsigned int
+ width,
+ unsigned int
+ height,
+ unsigned char
+ *pixels,
+ unsigned char
+ format,
+ int quality,
+ unsigned char
+ **image,
+ int *image_sz,
+ double opacity);
+
+ RL2_PRIVATE int get_payload_from_palette_opaque (unsigned int width,
+ unsigned int height,
+ sqlite3 * handle,
+ double minx, double miny,
+ double maxx, double maxy,
+ int srid,
+ unsigned char *pixels,
+ rl2PalettePtr palette,
+ unsigned char format,
+ int quality,
+ unsigned char **image,
+ int *image_sz);
+
+ RL2_PRIVATE int get_payload_from_palette_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ rl2PalettePtr palette,
+ unsigned char format,
+ int quality,
+ unsigned char **image,
+ int *image_sz,
+ unsigned char bg_red,
+ unsigned char
+ bg_green,
+ unsigned char
+ bg_blue,
+ double opacity);
+
+ RL2_PRIVATE int get_payload_from_grayscale_opaque (unsigned int width,
+ unsigned int height,
+ sqlite3 * handle,
+ double minx, double miny,
+ double maxx, double maxy,
+ int srid,
+ unsigned char *pixels,
+ unsigned char format,
+ int quality,
+ unsigned char **image,
+ int *image_sz);
+
+ RL2_PRIVATE int get_payload_from_grayscale_transparent (unsigned int
+ width,
+ unsigned int
+ height,
+ unsigned char
+ *pixels,
+ unsigned char
+ format, int quality,
+ unsigned char
+ **image,
+ int *image_sz,
+ unsigned char
+ bg_gray,
+ double opacity);
+
+ RL2_PRIVATE int get_payload_from_rgb_opaque (unsigned int width,
+ unsigned int height,
+ sqlite3 * handle, double minx,
+ double miny, double maxx,
+ double maxy, int srid,
+ unsigned char *pixels,
+ unsigned char format,
+ int quality,
+ unsigned char **image,
+ int *image_sz);
+
+ RL2_PRIVATE int get_payload_from_rgb_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char format,
+ int quality,
+ unsigned char **image,
+ int *image_sz,
+ unsigned char bg_red,
+ unsigned char bg_green,
+ unsigned char bg_blue,
+ double opacity);
+
+ RL2_PRIVATE int get_rgba_from_monochrome_mask (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char *mask,
+ rl2PrivPixelPtr no_data,
+ unsigned char *rgba);
+
+ RL2_PRIVATE int get_rgba_from_monochrome_opaque (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char *rgba);
+
+ RL2_PRIVATE int get_rgba_from_monochrome_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char *rgba);
+
+ RL2_PRIVATE int get_rgba_from_palette_mask (unsigned int base_width,
+ unsigned int base_height,
+ unsigned char *pixels,
+ unsigned char *mask,
+ rl2PalettePtr palette,
+ rl2PrivPixelPtr no_data,
+ unsigned char *rgba);
+
+ RL2_PRIVATE int get_rgba_from_palette_opaque (unsigned int base_width,
+ unsigned int base_height,
+ unsigned char *pixels,
+ rl2PalettePtr palette,
+ unsigned char *rgba);
+
+ RL2_PRIVATE int get_rgba_from_palette_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ rl2PalettePtr palette,
+ unsigned char *rgba,
+ unsigned char bg_red,
+ unsigned char bg_green,
+ unsigned char bg_blue);
+
+ RL2_PRIVATE int get_rgba_from_grayscale_mask (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char *mask,
+ rl2PrivPixelPtr no_data,
+ unsigned char *rgba);
+
+ RL2_PRIVATE int get_rgba_from_grayscale_opaque (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char *rgba);
+
+ RL2_PRIVATE int get_rgba_from_grayscale_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char *rgba,
+ unsigned char bg_gray);
+
+ RL2_PRIVATE int get_rgba_from_rgb_mask (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char *mask,
+ rl2PrivPixelPtr no_data,
+ unsigned char *rgba);
+
+ RL2_PRIVATE int get_rgba_from_rgb_opaque (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char *rgba);
+
+ RL2_PRIVATE int get_rgba_from_rgb_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char *rgba,
+ unsigned char bg_red,
+ unsigned char bg_green,
+ unsigned char bg_blue);
+
+ RL2_PRIVATE int get_rgba_from_datagrid_mask (unsigned int width,
+ unsigned int height,
+ unsigned char sample_type,
+ void *pixels,
+ unsigned char *mask,
+ rl2PrivPixelPtr no_made,
+ unsigned char *rgba);
+
+ RL2_PRIVATE int get_payload_from_gray_rgba_opaque (unsigned int width,
+ unsigned int height,
+ sqlite3 * handle,
+ double minx, double miny,
+ double maxx, double maxy,
+ int srid,
+ unsigned char *rgb,
+ unsigned char format,
+ int quality,
+ unsigned char **image,
+ int *image_sz);
+
+ RL2_PRIVATE int get_payload_from_gray_rgba_transparent (unsigned int
+ width,
+ unsigned int
+ height,
+ unsigned char *rgb,
+ unsigned char
+ *alpha,
+ unsigned char
+ format, int quality,
+ unsigned char
+ **image,
+ int *image_sz,
+ double opacity);
+
+ RL2_PRIVATE int get_payload_from_rgb_rgba_opaque (unsigned int width,
+ unsigned int height,
+ sqlite3 * handle,
+ double minx, double miny,
+ double maxx, double maxy,
+ int srid,
+ unsigned char *rgb,
+ unsigned char format,
+ int quality,
+ unsigned char **image,
+ int *image_sz);
+
+ RL2_PRIVATE int get_payload_from_rgb_rgba_transparent (unsigned int width,
+ unsigned int
+ height,
+ unsigned char *rgb,
+ unsigned char *alpha,
+ unsigned char format,
+ int quality,
+ unsigned char
+ **image,
+ int *image_sz,
+ double opacity);
+
+ RL2_PRIVATE int build_rgb_alpha (unsigned int width,
+ unsigned int height, unsigned char *rgba,
+ unsigned char **rgb, unsigned char **alpha,
+ unsigned char bg_red,
+ unsigned char bg_green,
+ unsigned char bg_blue);
+
+ RL2_PRIVATE int get_rgba_from_multiband8 (unsigned int width,
+ unsigned int height,
+ unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band,
+ unsigned char num_bands,
+ unsigned char *pixels,
+ unsigned char *mask,
+ rl2PrivPixelPtr no_data,
+ unsigned char *rgba);
+
+ RL2_PRIVATE int get_rgba_from_multiband16 (unsigned int width,
+ unsigned int height,
+ unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band,
+ unsigned char num_bands,
+ unsigned short *pixels,
+ unsigned char *mask,
+ rl2PrivPixelPtr no_data,
+ unsigned char *rgba);
+ RL2_PRIVATE int parse_worldfile (FILE * in, double *px, double *py,
+ double *pres_x, double *pres_y);
+
+ RL2_PRIVATE rl2RasterStylePtr raster_style_from_sld_se_xml (char *name,
+ char *title,
+ char *abstract,
+ unsigned char
+ *xml);
+
+ RL2_PRIVATE rl2GroupStylePtr group_style_from_sld_xml (char *name,
+ char *title,
+ char *abstract,
+ unsigned char *xml);
+
+ RL2_PRIVATE int get_raster_band_histogram (rl2PrivBandStatisticsPtr band,
+ unsigned char **image,
+ int *image_sz);
+
+ RL2_PRIVATE int copy_raw_pixels (rl2RasterPtr raster, unsigned char *outbuf,
+ unsigned int width,
+ unsigned int height,
+ unsigned char sample_type,
+ unsigned char num_bands, double x_res,
+ double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ rl2PixelPtr no_data,
+ rl2RasterStylePtr style,
+ rl2RasterStatisticsPtr stats);
+
+ RL2_PRIVATE int rl2_build_shaded_relief_mask (sqlite3 * handle,
+ rl2CoveragePtr cvg,
+ double relief_factor,
+ double scale_factor,
+ unsigned int width,
+ unsigned int height,
+ double minx, double miny,
+ double maxx, double maxy,
+ double x_res, double y_res,
+ float **shaded_relief,
+ int *shaded_relief_sz);
+
+ RL2_PRIVATE int set_coverage_infos (sqlite3 * handle,
+ const char *coverage_name,
+ const char *title,
+ const char *abstract);
+
+ RL2_PRIVATE int rl2_test_layer_group (sqlite3 * handle,
+ const char *group_name);
+
+ RL2_PRIVATE int rl2_rgba_raster_data (sqlite3 * handle,
+ const char *coverage_name, void *ctx,
+ int level, double minx, double miny,
+ double maxx, double maxy,
+ rl2PalettePtr palette,
+ rl2PixelPtr no_data);
+
+ RL2_PRIVATE int rl2_aux_render_image (struct aux_renderer *aux,
+ unsigned char **ximage,
+ int *ximage_size);
+
+ RL2_PRIVATE void rl2_aux_group_renderer (struct aux_group_renderer *auxgrp);
+
+ RL2_PRIVATE double rl2_get_shaded_relief_scale_factor (sqlite3 * handle,
+ const char
+ *coverage);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RASTERLITE2_PRIVATE_H */
diff --git a/headers/rl2svg_private.h b/headers/rl2svg_private.h
new file mode 100644
index 0000000..926fd72
--- /dev/null
+++ b/headers/rl2svg_private.h
@@ -0,0 +1,678 @@
+/*
+
+ rl2svg_private -- hidden SVG internals
+
+ version 0.1, 2013 March 29
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the RasterLite2 library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+/**
+ \file rl2svg_private.h
+
+ RasterLite2 private SVG header file
+ */
+
+#include "config.h"
+
+#ifndef _RL2SVG_PRIVATE_H
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+#define _RL2SVG_PRIVATE_H
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* SVG constants */
+#define RL2_SVG_UNKNOWN 0
+
+/* SVG basic shapes */
+#define RL2_SVG_RECT 1
+#define RL2_SVG_CIRCLE 2
+#define RL2_SVG_ELLIPSE 3
+#define RL2_SVG_LINE 4
+#define RL2_SVG_POLYLINE 5
+#define RL2_SVG_POLYGON 6
+#define RL2_SVG_PATH 7
+
+/* SVG transformations */
+#define RL2_SVG_MATRIX 8
+#define RL2_SVG_TRANSLATE 9
+#define RL2_SVG_SCALE 10
+#define RL2_SVG_ROTATE 11
+#define RL2_SVG_SKEW_X 12
+#define RL2_SVG_SKEW_Y 13
+
+/* SVG Path actions */
+#define RL2_SVG_MOVE_TO 14
+#define RL2_SVG_LINE_TO 15
+#define RL2_SVG_CURVE_3 16
+#define RL2_SVG_CURVE_4 17
+#define RL2_SVG_ELLIPT_ARC 18
+#define RL2_SVG_CLOSE_PATH 19
+
+/* SGV Items */
+#define RL2_SVG_ITEM_GROUP 20
+#define RL2_SVG_ITEM_SHAPE 21
+#define RL2_SVG_ITEM_USE 22
+#define RL2_SVG_ITEM_CLIP 23
+
+/* SVG Gradients */
+#define RL2_SVG_LINEAR_GRADIENT 24
+#define RL2_SVG_RADIAL_GRADIENT 25
+#define RL2_SVG_USER_SPACE 26
+#define RL2_SVG_BOUNDING_BOX 27
+
+ typedef struct svg_matrix
+ {
+ /* SVG Matrix data */
+ double a;
+ double b;
+ double c;
+ double d;
+ double e;
+ double f;
+ } rl2PrivSvgMatrix;
+ typedef rl2PrivSvgMatrix *rl2PrivSvgMatrixPtr;
+
+ typedef struct svg_translate
+ {
+ /* SVG Translate data */
+ double tx;
+ double ty;
+ } rl2PrivSvgTranslate;
+ typedef rl2PrivSvgTranslate *rl2PrivSvgTranslatePtr;
+
+ typedef struct svg_scale
+ {
+ /* SVG Scale data */
+ double sx;
+ double sy;
+ } rl2PrivSvgScale;
+ typedef rl2PrivSvgScale *rl2PrivSvgScalePtr;
+
+ typedef struct svg_rotate
+ {
+ /* SVG Rotate data */
+ double angle;
+ double cx;
+ double cy;
+ } rl2PrivSvgRotate;
+ typedef rl2PrivSvgRotate *rl2PrivSvgRotatePtr;
+
+ typedef struct svg_skew
+ {
+ /* SVG Skew data */
+ double angle;
+ } rl2PrivSvgSkew;
+ typedef rl2PrivSvgSkew *rl2PrivSvgSkewPtr;
+
+ typedef struct svg_transform
+ {
+ /* SVG Transform (linked list) */
+ int type;
+ void *data;
+ struct svg_transform *next;
+ } rl2PrivSvgTransform;
+ typedef rl2PrivSvgTransform *rl2PrivSvgTransformPtr;
+
+ typedef struct svg_gradient_stop
+ {
+ /* SVG Gradient Stop */
+ char *id;
+ double offset;
+ double red;
+ double green;
+ double blue;
+ double opacity;
+ struct svg_gradient_stop *next;
+ } rl2PrivSvgGradientStop;
+ typedef rl2PrivSvgGradientStop *rl2PrivSvgGradientStopPtr;
+
+ typedef struct svg_gradient
+ {
+ /* SVG Gradient */
+ int type;
+ char *id;
+ char *xlink_href;
+ int gradient_units;
+ double x1;
+ double y1;
+ double x2;
+ double y2;
+ double cx;
+ double cy;
+ double fx;
+ double fy;
+ double r;
+ rl2PrivSvgGradientStopPtr first_stop;
+ rl2PrivSvgGradientStopPtr last_stop;
+ rl2PrivSvgTransformPtr first_trans;
+ rl2PrivSvgTransformPtr last_trans;
+ struct svg_gradient *prev;
+ struct svg_gradient *next;
+ } rl2PrivSvgGradient;
+ typedef rl2PrivSvgGradient *rl2PrivSvgGradientPtr;
+
+ typedef struct svg_rect
+ {
+ /* SVG Rect data */
+ double x;
+ double y;
+ double width;
+ double height;
+ double rx;
+ double ry;
+ } rl2PrivSvgRect;
+ typedef rl2PrivSvgRect *rl2PrivSvgRectPtr;
+
+ typedef struct svg_circle
+ {
+ /* SVG Circle data */
+ double cx;
+ double cy;
+ double r;
+ } rl2PrivSvgCircle;
+ typedef rl2PrivSvgCircle *rl2PrivSvgCirclePtr;
+
+ typedef struct svg_ellipse
+ {
+ /* SVG Ellipse data */
+ double cx;
+ double cy;
+ double rx;
+ double ry;
+ } rl2PrivSvgEllipse;
+ typedef rl2PrivSvgEllipse *rl2PrivSvgEllipsePtr;
+
+ typedef struct svg_line
+ {
+ /* SVG Line data */
+ double x1;
+ double y1;
+ double x2;
+ double y2;
+ } rl2PrivSvgLine;
+ typedef rl2PrivSvgLine *rl2PrivSvgLinePtr;
+
+ typedef struct svg_polyline
+ {
+ /* SVG Polyline data */
+ int points;
+ double *x;
+ double *y;
+ } rl2PrivSvgPolyline;
+ typedef rl2PrivSvgPolyline *rl2PrivSvgPolylinePtr;
+
+ typedef struct svg_polygon
+ {
+ /* SVG Polygon data */
+ int points;
+ double *x;
+ double *y;
+ } rl2PrivSvgPolygon;
+ typedef rl2PrivSvgPolygon *rl2PrivSvgPolygonPtr;
+
+ typedef struct svg_path_move
+ {
+ /* SVG Path: MoveTo and LineTo data */
+ double x;
+ double y;
+ } rl2PrivSvgPathMove;
+ typedef rl2PrivSvgPathMove *rl2PrivSvgPathMovePtr;
+
+ typedef struct svg_path_bezier
+ {
+ /* SVG Path: any Bezier Curve */
+ double x1;
+ double y1;
+ double x2;
+ double y2;
+ double x;
+ double y;
+ } rl2PrivSvgPathBezier;
+ typedef rl2PrivSvgPathBezier *rl2PrivSvgPathBezierPtr;
+
+ typedef struct svg_path_ellipt_arc
+ {
+ /* SVG Path: Elliptical Arc */
+ double rx;
+ double ry;
+ double rotation;
+ int large_arc;
+ int sweep;
+ double x;
+ double y;
+ } rl2PrivSvgPathEllipticArc;
+ typedef rl2PrivSvgPathEllipticArc *rl2PrivSvgPathEllipticArcPtr;
+
+ typedef struct svg_path_item
+ {
+ /* SVG Path item (linked list) */
+ int type;
+ void *data;
+ struct svg_path_item *next;
+ } rl2PrivSvgPathItem;
+ typedef rl2PrivSvgPathItem *rl2PrivSvgPathItemPtr;
+
+ typedef struct svg_path
+ {
+ /* SVG Path */
+ struct svg_path_item *first;
+ struct svg_path_item *last;
+ int error;
+ } rl2PrivSvgPath;
+ typedef rl2PrivSvgPath *rl2PrivSvgPathPtr;
+
+ typedef struct svg_style
+ {
+ /* SVG Style-related definitions */
+ char visibility;
+ double opacity;
+ char fill;
+ char no_fill;
+ int fill_rule;
+ char *fill_url;
+ rl2PrivSvgGradientPtr fill_pointer;
+ double fill_red;
+ double fill_green;
+ double fill_blue;
+ double fill_opacity;
+ char stroke;
+ char no_stroke;
+ double stroke_width;
+ int stroke_linecap;
+ int stroke_linejoin;
+ double stroke_miterlimit;
+ int stroke_dashitems;
+ double *stroke_dasharray;
+ double stroke_dashoffset;
+ char *stroke_url;
+ rl2PrivSvgGradientPtr stroke_pointer;
+ double stroke_red;
+ double stroke_green;
+ double stroke_blue;
+ double stroke_opacity;
+ char *clip_url;
+ struct svg_item *clip_pointer;
+ } rl2PrivSvgStyle;
+ typedef rl2PrivSvgStyle *rl2PrivSvgStylePtr;
+
+ typedef struct svg_shape
+ {
+ /* generic SVG shape container */
+ char *id;
+ int type;
+ void *data;
+ struct svg_group *parent;
+ rl2PrivSvgStyle style;
+ rl2PrivSvgTransformPtr first_trans;
+ rl2PrivSvgTransformPtr last_trans;
+ int is_defs;
+ int is_flow_root;
+ struct svg_shape *next;
+ } rl2PrivSvgShape;
+ typedef rl2PrivSvgShape *rl2PrivSvgShapePtr;
+
+ typedef struct svg_use
+ {
+ /* SVG Use (xlink:href) */
+ char *xlink_href;
+ double x;
+ double y;
+ double width;
+ double height;
+ rl2PrivSvgStyle style;
+ struct svg_group *parent;
+ rl2PrivSvgTransformPtr first_trans;
+ rl2PrivSvgTransformPtr last_trans;
+ struct svg_use *next;
+ } rl2PrivSvgUse;
+ typedef rl2PrivSvgUse *rl2PrivSvgUsePtr;
+
+ typedef struct svg_item
+ {
+ /* SVG generic item */
+ int type;
+ void *pointer;
+ struct svg_item *next;
+ } rl2PrivSvgItem;
+ typedef rl2PrivSvgItem *rl2PrivSvgItemPtr;
+
+ typedef struct svg_group
+ {
+ /* SVG group container: <g> */
+ char *id;
+ rl2PrivSvgStyle style;
+ struct svg_group *parent;
+ rl2PrivSvgItemPtr first;
+ rl2PrivSvgItemPtr last;
+ rl2PrivSvgTransformPtr first_trans;
+ rl2PrivSvgTransformPtr last_trans;
+ int is_defs;
+ int is_flow_root;
+ struct svg_group *next;
+ } rl2PrivSvgGroup;
+ typedef rl2PrivSvgGroup *rl2PrivSvgGroupPtr;
+
+ typedef struct svg_clip
+ {
+ /* SVG group container: <clipPath> */
+ char *id;
+ struct svg_item *first;
+ struct svg_item *last;
+ struct svg_clip *next;
+ } rl2PrivSvgClip;
+ typedef rl2PrivSvgClip *rl2PrivSvgClipPtr;
+
+
+ typedef struct svg_document
+ {
+ /* SVG document main container */
+ cairo_matrix_t matrix;
+ double width;
+ double height;
+ double viewbox_x;
+ double viewbox_y;
+ double viewbox_width;
+ double viewbox_height;
+ rl2PrivSvgItemPtr first;
+ rl2PrivSvgItemPtr last;
+ rl2PrivSvgGradientPtr first_grad;
+ rl2PrivSvgGradientPtr last_grad;
+ rl2PrivSvgGroupPtr current_group;
+ rl2PrivSvgShapePtr current_shape;
+ rl2PrivSvgClipPtr current_clip;
+ int defs_count;
+ int flow_root_count;
+ } rl2PrivSvgDocument;
+ typedef rl2PrivSvgDocument *rl2PrivSvgDocumentPtr;
+
+ RL2_PRIVATE rl2PrivSvgDocumentPtr svg_parse_doc (const unsigned char *svg,
+ int svg_len);
+
+ RL2_PRIVATE void svg_free_transform (rl2PrivSvgTransformPtr p);
+
+ RL2_PRIVATE void svg_free_polyline (rl2PrivSvgPolylinePtr p);
+
+ RL2_PRIVATE void svg_free_polyline (rl2PrivSvgPolylinePtr p);
+
+ RL2_PRIVATE void svg_free_path_item (rl2PrivSvgPathItemPtr p);
+
+ RL2_PRIVATE void svg_free_path (rl2PrivSvgPathPtr p);
+
+ RL2_PRIVATE void svg_free_shape (rl2PrivSvgShapePtr p);
+
+ RL2_PRIVATE void svg_free_use (rl2PrivSvgUsePtr p);
+
+ RL2_PRIVATE void svg_free_item (rl2PrivSvgItemPtr p);
+
+ RL2_PRIVATE void svg_free_clip (rl2PrivSvgClipPtr p);
+
+ RL2_PRIVATE void svg_free_group (rl2PrivSvgGroupPtr p);
+
+ RL2_PRIVATE void svg_free_gradient_stop (rl2PrivSvgGradientStopPtr p);
+
+ RL2_PRIVATE void svg_free_gradient (rl2PrivSvgGradient * p);
+
+ RL2_PRIVATE void svg_free_document (rl2PrivSvgDocument * p);
+
+ RL2_PRIVATE rl2PrivSvgMatrixPtr svg_alloc_matrix (double a, double b,
+ double c, double d,
+ double e, double f);
+
+ RL2_PRIVATE rl2PrivSvgMatrixPtr svg_clone_matrix (rl2PrivSvgMatrixPtr in);
+
+ RL2_PRIVATE rl2PrivSvgTranslatePtr svg_alloc_translate (double tx,
+ double ty);
+
+ RL2_PRIVATE rl2PrivSvgTranslatePtr
+ svg_clone_translate (rl2PrivSvgTranslatePtr in);
+
+ RL2_PRIVATE rl2PrivSvgScalePtr svg_alloc_scale (double sx, double sy);
+
+ RL2_PRIVATE rl2PrivSvgScalePtr svg_clone_scale (rl2PrivSvgScalePtr in);
+
+ RL2_PRIVATE rl2PrivSvgRotatePtr svg_alloc_rotate (double angle, double cx,
+ double cy);
+
+ RL2_PRIVATE rl2PrivSvgRotatePtr svg_clone_rotate (rl2PrivSvgRotatePtr in);
+
+ RL2_PRIVATE rl2PrivSvgSkewPtr svg_alloc_skew (double angle);
+
+ RL2_PRIVATE rl2PrivSvgSkewPtr svg_clone_skew (rl2PrivSvgSkewPtr in);
+
+ RL2_PRIVATE rl2PrivSvgTransformPtr svg_alloc_transform (int type,
+ void *data);
+
+ RL2_PRIVATE rl2PrivSvgTransformPtr
+ svg_clone_transform (rl2PrivSvgTransformPtr in);
+
+ RL2_PRIVATE rl2PrivSvgRectPtr svg_alloc_rect (double x, double y,
+ double width, double height,
+ double rx, double ry);
+
+ RL2_PRIVATE rl2PrivSvgRectPtr svg_clone_rect (rl2PrivSvgRectPtr in);
+
+ RL2_PRIVATE rl2PrivSvgCirclePtr svg_alloc_circle (double cx, double cy,
+ double r);
+
+ RL2_PRIVATE rl2PrivSvgCirclePtr svg_clone_circle (rl2PrivSvgCirclePtr in);
+
+ RL2_PRIVATE rl2PrivSvgEllipsePtr svg_alloc_ellipse (double cx, double cy,
+ double rx, double ry);
+
+ RL2_PRIVATE rl2PrivSvgEllipsePtr svg_clone_ellipse (rl2PrivSvgEllipsePtr
+ in);
+
+ RL2_PRIVATE rl2PrivSvgLinePtr svg_alloc_line (double x1, double y1,
+ double x2, double y2);
+
+ RL2_PRIVATE rl2PrivSvgLinePtr svg_clone_line (rl2PrivSvgLinePtr in);
+
+ RL2_PRIVATE rl2PrivSvgPolylinePtr svg_alloc_polyline (int points, double *x,
+ double *y);
+
+ RL2_PRIVATE rl2PrivSvgPolylinePtr svg_clone_polyline (rl2PrivSvgPolylinePtr
+ in);
+
+ RL2_PRIVATE rl2PrivSvgPolygonPtr svg_alloc_polygon (int points, double *x,
+ double *y);
+
+ RL2_PRIVATE rl2PrivSvgPolygonPtr svg_clone_polygon (rl2PrivSvgPolygonPtr
+ in);
+
+ RL2_PRIVATE rl2PrivSvgPathMovePtr svg_alloc_path_move (double x, double y);
+
+ RL2_PRIVATE rl2PrivSvgPathMovePtr svg_clone_path_move (rl2PrivSvgPathMovePtr
+ in);
+
+ RL2_PRIVATE rl2PrivSvgPathBezierPtr svg_alloc_path_bezier (double x1,
+ double y1,
+ double x2,
+ double y2,
+ double x,
+ double y);
+
+ RL2_PRIVATE rl2PrivSvgPathBezierPtr
+ svg_clone_path_bezier (rl2PrivSvgPathBezierPtr in);
+
+ RL2_PRIVATE rl2PrivSvgPathEllipticArcPtr svg_alloc_path_ellipt_arc (double
+ rx,
+ double
+ ry,
+ double
+ rotation,
+ int
+ large_arc,
+ int
+ sweep,
+ double
+ x,
+ double
+ y);
+
+ RL2_PRIVATE rl2PrivSvgPathEllipticArcPtr
+ svg_clone_path_ellipt_arc (rl2PrivSvgPathEllipticArcPtr in);
+
+ RL2_PRIVATE rl2PrivSvgPathItemPtr svg_alloc_path_item (int type,
+ void *data);
+
+ RL2_PRIVATE void svg_add_path_item (rl2PrivSvgPathPtr path, int type,
+ void *data);
+
+ RL2_PRIVATE rl2PrivSvgPathPtr svg_alloc_path (void);
+
+ RL2_PRIVATE rl2PrivSvgPathPtr svg_clone_path (rl2PrivSvgPathPtr in);
+
+ RL2_PRIVATE void svg_add_clip_url (rl2PrivSvgStylePtr style,
+ const char *url);
+
+ RL2_PRIVATE void svg_add_fill_gradient_url (rl2PrivSvgStylePtr style,
+ const char *url);
+
+ RL2_PRIVATE void svg_add_stroke_gradient_url (rl2PrivSvgStylePtr style,
+ const char *url);
+
+ RL2_PRIVATE rl2PrivSvgShapePtr svg_alloc_shape (int type, void *data,
+ rl2PrivSvgGroupPtr parent);
+
+ RL2_PRIVATE rl2PrivSvgShapePtr svg_clone_shape (rl2PrivSvgShapePtr in,
+ rl2PrivSvgUsePtr use);
+
+ RL2_PRIVATE void svg_add_shape_id (rl2PrivSvgShapePtr shape,
+ const char *id);
+
+ RL2_PRIVATE rl2PrivSvgUsePtr svg_alloc_use (void *parent,
+ const char *xlink_href,
+ double x, double y,
+ double width, double height);
+
+ RL2_PRIVATE rl2PrivSvgUsePtr svg_clone_use (rl2PrivSvgUsePtr in);
+
+ RL2_PRIVATE rl2PrivSvgGroupPtr svg_alloc_group (void);
+
+ RL2_PRIVATE rl2PrivSvgGroupPtr svg_clone_group (rl2PrivSvgGroupPtr in,
+ rl2PrivSvgUsePtr use);
+
+ RL2_PRIVATE rl2PrivSvgClipPtr svg_alloc_clip (void);
+
+ RL2_PRIVATE rl2PrivSvgClipPtr svg_clone_clip (rl2PrivSvgClipPtr in);
+
+ RL2_PRIVATE void svg_add_group_id (rl2PrivSvgGroupPtr group,
+ const char *id);
+
+ RL2_PRIVATE void svg_add_clip_id (rl2PrivSvgClipPtr clip, const char *id);
+
+ RL2_PRIVATE rl2PrivSvgItemPtr svg_alloc_item (int type, void *pointer);
+
+ RL2_PRIVATE rl2PrivSvgItemPtr svg_clone_item (rl2PrivSvgItemPtr in);
+
+ RL2_PRIVATE void svg_set_group_parent (rl2PrivSvgItemPtr item,
+ rl2PrivSvgGroupPtr grp);
+
+ RL2_PRIVATE rl2PrivSvgGradientStopPtr svg_alloc_gradient_stop (double
+ offset,
+ double red,
+ double green,
+ double blue,
+ double
+ opacity);
+
+ RL2_PRIVATE rl2PrivSvgGradientStopPtr
+ svg_clone_gradient_stop (rl2PrivSvgGradientStopPtr in);
+
+ RL2_PRIVATE rl2PrivSvgGradientPtr svg_alloc_gradient (void);
+
+ RL2_PRIVATE rl2PrivSvgGradientPtr svg_clone_gradient (rl2PrivSvgGradientPtr
+ in,
+ rl2PrivSvgGradientPtr
+ old);
+
+ RL2_PRIVATE rl2PrivSvgDocumentPtr svg_alloc_document (void);
+
+ RL2_PRIVATE void svg_close_group (rl2PrivSvgDocumentPtr svg_doc);
+
+ RL2_PRIVATE void svg_insert_group (rl2PrivSvgDocumentPtr svg_doc);
+
+ RL2_PRIVATE void svg_close_clip (rl2PrivSvgDocumentPtr svg_doc);
+
+ RL2_PRIVATE void svg_insert_clip (rl2PrivSvgDocumentPtr svg_doc);
+
+ RL2_PRIVATE rl2PrivSvgUsePtr svg_insert_use (rl2PrivSvgDocumentPtr svg_doc,
+ const char *xlink_href,
+ double x, double y,
+ double width, double height);
+
+ RL2_PRIVATE void svg_insert_shape (rl2PrivSvgDocumentPtr svg_doc, int type,
+ void *data);
+
+ RL2_PRIVATE void svg_insert_gradient_stop (rl2PrivSvgGradientPtr gradient,
+ double offset, double red,
+ double green, double blue,
+ double opacity);
+
+ RL2_PRIVATE rl2PrivSvgGradientPtr
+ svg_insert_linear_gradient (rl2PrivSvgDocumentPtr svg_doc,
+ const char *id, const char *xlink_href,
+ double x1, double y1, double x2, double y2,
+ int units);
+
+ RL2_PRIVATE rl2PrivSvgGradientPtr
+ svg_insert_radial_gradient (rl2PrivSvgDocumentPtr svg_doc,
+ const char *id, const char *xlink_href,
+ double cx, double cy, double fx, double fy,
+ double r, int units);
+
+ RL2_PRIVATE rl2PrivSvgGradientPtr
+ svg_insert_radial_gradient (rl2PrivSvgDocumentPtr svg_doc,
+ const char *id, const char *xlink_href,
+ double cx, double cy, double fx, double fy,
+ double r, int units);
+
+ RL2_PRIVATE void svg_init_style (rl2PrivSvgStylePtr style);
+
+ RL2_PRIVATE void svg_style_cleanup (rl2PrivSvgStylePtr style);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RL2SVG_PRIVATE_H */
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..377bb86
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,527 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-11-20.07; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# 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
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call 'install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names problematic for 'test' and other utilities.
+ case $src in
+ -* | [=\(\)!]) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+ dst=$dst_arg
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ltmain.sh b/ltmain.sh
new file mode 100644
index 0000000..63ae69d
--- /dev/null
+++ b/ltmain.sh
@@ -0,0 +1,9655 @@
+
+# libtool (GNU libtool) 2.4.2
+# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+# --config show all configuration variables
+# --debug enable verbose shell tracing
+# -n, --dry-run display commands without modifying any files
+# --features display basic configuration information and exit
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --no-quiet, --no-silent
+# print informational messages (default)
+# --no-warn don't display warning messages
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print more informational messages than default
+# --no-verbose don't print the extra informational messages
+# --version print version information
+# -h, --help, --help-all print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE. When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.4.2
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool at gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4.2
+TIMESTAMP=""
+package_revision=1.3337
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+ s@/\./@/@g
+ t dotsl
+ s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+# value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test "$func_normal_abspath_tpath" = / ; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result" ; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+# value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=${func_dirname_result}
+ if test "x$func_relative_path_tlibdir" = x ; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test "x$func_stripname_result" != x ; then
+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+ fi
+
+ # Normalisation. If bindir is libdir, return empty string,
+ # else relative path ending with a slash; either way, target
+ # file name can be directly appended.
+ if test ! -z "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result/"
+ func_relative_path_result=$func_stripname_result
+ fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=${PATH_SEPARATOR-:}
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$opt_dry_run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "$1" | $SED \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $opt_debug
+
+ $SED -n '/(C)/!b go
+ :more
+ /\./!{
+ N
+ s/\n# / /
+ b more
+ }
+ :go
+ /^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/^# *.*--help/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ echo
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ :print
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+ p
+ d
+ }
+ /^# .* home page:/b print
+ /^# General help using/b print
+ ' < "$progpath"
+ ret=$?
+ if test -z "$1"; then
+ exit $ret
+ fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ $opt_debug
+
+ func_error "missing argument for $1."
+ exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[^=]*=//'
+
+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "${2}"
+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly. This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+ # this just eases exit handling
+ while test $# -gt 0; do
+ opt="$1"
+ shift
+ case $opt in
+ --debug|-x) opt_debug='set -x'
+ func_echo "enabling shell trace mode"
+ $opt_debug
+ ;;
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+ --config)
+ opt_config=:
+func_config
+ ;;
+ --dlopen|-dlopen)
+ optarg="$1"
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+ shift
+ ;;
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=:
+ ;;
+ --features)
+ opt_features=:
+func_features
+ ;;
+ --finish)
+ opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ --help)
+ opt_help=:
+ ;;
+ --help-all)
+ opt_help_all=:
+opt_help=': help-all'
+ ;;
+ --mode)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_mode="$optarg"
+case $optarg in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+esac
+ shift
+ ;;
+ --no-silent|--no-quiet)
+ opt_silent=false
+func_append preserve_args " $opt"
+ ;;
+ --no-warning|--no-warn)
+ opt_warning=false
+func_append preserve_args " $opt"
+ ;;
+ --no-verbose)
+ opt_verbose=false
+func_append preserve_args " $opt"
+ ;;
+ --silent|--quiet)
+ opt_silent=:
+func_append preserve_args " $opt"
+ opt_verbose=false
+ ;;
+ --verbose|-v)
+ opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+ ;;
+ --tag)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+ --version) func_version ;;
+
+ # Separate optargs to long options:
+ --*=*)
+ func_split_long_opt "$opt"
+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-n*|-v*)
+ func_split_short_opt "$opt"
+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # Validate options:
+
+ # save first non-option argument
+ if test "$#" -gt 0; then
+ nonopt="$opt"
+ shift
+ fi
+
+ # preserve --debug
+ test "$opt_debug" = : || func_append preserve_args " --debug"
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$opt_mode' for more information."
+ }
+
+
+ # Bail if the options were screwed
+ $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case "$lt_sysroot:$1" in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result="=$func_stripname_result"
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $opt_debug
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case "$@ " in
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $opt_debug
+ func_convert_core_file_wine_to_w32_result="$1"
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $opt_debug
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=""
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $opt_debug
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $opt_debug
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $opt_debug
+ if test -z "$2" && test -n "$1" ; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " \`$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result="$1"
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $opt_debug
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " \`$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result="$3"
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $opt_debug
+ case $4 in
+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $opt_debug
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $opt_debug
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $opt_debug
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $opt_debug
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ func_append later " $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_append_quoted lastarg "$arg"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ func_append base_compile " $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+ ;;
+ esac
+
+ echo
+ $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test "$opt_help" = :; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ sed '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -* | *.la | *.lo ) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_append_quoted args "$file"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ echo "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "\`$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument \`$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
+
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
+ exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ case $nonopt in *shtool*) :;; *) false;; esac; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ no_mode=:
+ for arg
+ do
+ arg2=
+ if test -n "$dest"; then
+ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ if $install_cp; then :; else
+ prev=$arg
+ fi
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ func_append staticlibs " $file"
+ ;;
+
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ func_append dir "$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=""
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname" ; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename="$func_basename_result"
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename" ; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $opt_debug
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $opt_debug
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive which possess that section. Heuristic: eliminate
+ # all those which have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $opt_debug
+ if func_cygming_gnu_implib_p "$1" ; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1" ; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=""
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ if test "$lock_old_archive_extraction" = yes; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test "$lock_old_archive_extraction" = yes; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=${1-no}
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ case \" \$* \" in
+ *\\ --lt-*)
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done ;;
+ esac
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+ func_exec_program \${1+\"\$@\"}
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+*/
+EOF
+ cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+ cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ newargz = XMALLOC (char *, argc + 1);
+
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ lt_dump_script (stdout);
+ return 0;
+ }
+ if (strcmp (argv[i], debug_opt) == 0)
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/ fputs ("\1", f);/p
+g
+D'
+ cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $opt_debug
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ bindir=
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ bindir)
+ bindir="$arg"
+ prev=
+ continue
+ ;;
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ func_append dlfiles " $arg"
+ else
+ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -bindir)
+ prev=bindir
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
+ *)
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ func_append deplibs " System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ func_append objs " $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ func_resolve_sysroot "$arg"
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+ func_append deplibs " $func_resolve_sysroot_result"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_preserve_dup_deps ; then
+ case "$libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append libs " $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+ func_append pre_post_deps " $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ func_resolve_sysroot "$lib"
+ case $lib in
+ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append compiler_flags " $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ echo
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because the file extensions .$libext of this argument makes me believe"
+ echo "*** that it is just a static archive that I should not use here."
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ if test -n "$old_library" &&
+ { test "$prefer_static_libs" = yes ||
+ test "$prefer_static_libs,$installed" = "built,no"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ func_append dlprefiles " $lib $dependency_libs"
+ else
+ func_append newdlfiles " $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$lt_sysroot$libdir"
+ absdir="$lt_sysroot$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ case "$host" in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ func_append newlib_search_path " $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) func_append temp_rpath "$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ echo
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ echo
+ echo "*** And there doesn't seem to be a static archive available"
+ echo "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$absdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ echo "*** But as you try to build a module library, libtool will still create "
+ echo "*** a static module, that should work as long as the dlopening application"
+ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ func_append newlib_search_path " $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ path=
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) func_append lib_search_path " $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ func_append libobjs " $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ # correct linux to gnu/linux during the next big refactor
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux) # correct to gnu/linux during the next big refactor
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ func_append verstring ":${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ func_append libobjs " $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$opt_mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) func_append dlfiles " $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ func_append deplibs " System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ func_append deplibs " -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which I believe you do not have"
+ echo "*** because a test_compile did reveal that the linker did not use it for"
+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because a test_compile did reveal that the linker did not use this one"
+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test "$want_nocaseglob" = yes; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ done
+ fi
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ ;;
+ esac
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+ echo "*** it was explicitly requested with -no-undefined,"
+ echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ # Remove ${wl} instances when linking with ld.
+ # FIXME: should test the right _cmds variable.
+ case $archive_cmds in
+ *\$LD\ *) wl= ;;
+ esac
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd1 in $cmds; do
+ IFS="$save_ifs"
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test "$try_normal_branch" = yes \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=${output_objdir}/${output_la}.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ func_basename "$output"
+ output_la=$func_basename_result
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=" $obj"
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ func_append delfiles " $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # If we're not building shared, we need to use non_pic_objs
+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ func_append compile_command " ${wl}-bind_at_load"
+ func_append finalize_command " ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ func_append oldobjs " $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
+ ;;
+ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ func_resolve_sysroot "$deplib"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlfiles " $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlprefiles " $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test "x$bindir" != x ;
+ then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) func_append RM " $arg"; rmforce=yes ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ odir="$objdir"
+ else
+ odir="$dir/$objdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$opt_mode" = uninstall && odir="$dir"
+
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test "$opt_mode" = clean; then
+ case " $rmdirs " in
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ func_append rmfiles " $odir/$n"
+ done
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+ case "$opt_mode" in
+ clean)
+ case " $library_names " in
+ *" $dlname "*) ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ func_append rmfiles " $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$opt_mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ func_append rmfiles " $odir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/m4/libtool.m4 b/m4/libtool.m4
new file mode 100644
index 0000000..56666f0
--- /dev/null
+++ b/m4/libtool.m4
@@ -0,0 +1,7986 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_REPLACE_SHELLFNS
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Go], [_LT_LANG(GO)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_GO. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC], [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+ fi
+fi
+if test -z "$GOC"; then
+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+ [LT_LANG(GO)],
+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD="${LD-ld}_sol2"
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[23]].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Add ABI-specific directories to the system library path.
+ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t at _DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t at _DLSYM_CONST
+#else
+# define LT@&t at _DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t at _DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Intel*\ [[CF]]*Compiler*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*)
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd2.*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
new file mode 100644
index 0000000..5d9acd8
--- /dev/null
+++ b/m4/ltoptions.m4
@@ -0,0 +1,384 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
new file mode 100644
index 0000000..07a8602
--- /dev/null
+++ b/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3337 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.2'
+macro_revision='1.3337'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/mainpage.doxy b/mainpage.doxy
new file mode 100644
index 0000000..ab22ed7
--- /dev/null
+++ b/mainpage.doxy
@@ -0,0 +1,547 @@
+/** \mainpage notitle
+
+\section Introduction
+
+FreeXL is an open source library to extract valid data from within an Excel
+(.xls) spreadsheet.
+
+The FreeXL design goals are:
+ - to be simple and lightweight
+ - to be stable, robust and efficient
+ - to be easily and universally portable.
+ - completely ignore any GUI-related oddity
+
+Note that the final goal means that FreeXL ignores at all fonts, sizes and
+alignments, and most formats. It ignores Pivot Table, Charts, Formulas, Visual
+Basic macros and so on.
+
+FreeXL is structurally simple and quite light-weight (typically 40-80K of object
+code, stripped). FreeXL has one key dependency - GNU libiconv, which is used for
+character set conversions. This is often provided as part of the C library on
+Linux systems, and is widely available.
+
+Building and installing FreeXL is straightforward:
+\verbatim
+./configure
+make
+make install
+\endverbatim
+
+Linking FreeXL to your own code is usually simple:
+\verbatim
+gcc my_program.c -o my_program -lfreexl
+\endverbatim
+
+On some systems you may have to provide a slightly more complex arrangement:
+\verbatim
+gcc -I/usr/local/include my_program.c -o my_program \
+ -L/usr/local/lib -lfreexl -liconv -lm
+\endverbatim
+
+FreeXL also provides pkg-config support, so you can also do:
+\verbatim
+gcc -I/usr/local/include my_program.c -o my_program `pkg-config --libs freexl`
+\endverbatim
+
+I sincerely hope FreeXL could be useful to many of you. Excel *.xls spreadsheets
+are widespread, and although Microsoft itself is strongly pushing the new XML
+based formats, there is still a lot of legacy data stored in the older binary
+formats.
+
+So in an era of open data, a simple and easy way to extract data from .xls is
+surely useful. The original use of FreeXL was to support the SQLite /
+SpatiaLite VirtualXL driver (implementing direct access to .xls files via SQL).
+However there are many other possibilities, including use with shell scripts and
+simple wrappers for Python, Perl and other very high level languages.
+
+FreeXL is licensed under the MPL tri-license terms: you are free to choose the
+best-fit license between:
+ - the MPL 1.1
+ - the GPL v2.0 or any subsequent version
+ - the LGPL v2.1 or any subsequent version
+
+Enjoy, and happy coding
+*/
+
+/** \page Origins The background story for FreeXL
+
+Where, when and why a new free software library was born...
+
+At the end of April 2011 Markus Neteler
+[http://en.wikipedia.org/wiki/Markus_Neteler] and I (Sandro) were in Udine in
+Northern Italy, attending the annual Italian gvSIG Users conference. So, on a
+lovely hot and sunny spring evening, accompanied by a picturesque sunset, we
+were sitting in the town centre in the pleasant Piazza Matteotti aka Piazza San
+Giacomo, peacefully drinking some spritz while eating chips and peanuts.
+
+\image html piazza.jpg
+\image latex piazza.eps "Piazza" width=12cm
+
+You'll have to admit, it was a really dangerous situation: as a general safety
+rule, never let two developers sit idle for too long. Some odd and crazy idea
+will inevitably occur to them (of course, drinking too much spritz can
+contribute as well).
+
+Markus was desperately attempting to convince me that implementing a
+VirtualTable driver for SpatiaLite supporting direct SQL reading ofExcel .xls
+files was a good initiative. Surely it would be useful for many users. I
+strongly resisted, fiercely fighting and rejecting such idea, on the basis that
+attempting to read proprietary closed formats such as Excel was a complete
+nonsense, and probably a very difficult if not impossible task.
+
+At the end of this very animated discussion, Markus pronounced the magic spell
+that suddenly convinced me about the absolute validity of his suggestions:
+<em>I can raise some funding for this project</em> After hearing such wise and
+significant words from Markus I immediately realized that developing a new
+driver for accessing Excel .xls documents surely was an exciting and useful task
+after all.
+
+So FreeXL / VirtualXL was conceived at that exact moment, and slowly
+began its development cycle.
+*/
+
+/** \page Specs File format specifications and source information
+
+The .xls binary file format is extensively documented and is publicly available.
+The most authoritative source is made available by Microsoft at
+http://msdn.microsoft.com/en-us/library/cc313154%28v=office.12%29.aspx
+
+A simpler option is made available by Open Office:
+http://sc.openoffice.org/excelfileformat.pdf
+
+Searching the web you'll easily find several other valuable information sources.
+*/
+
+/** \page Format About the .xls binary format
+
+What a .xls binary file really is
+
+(Prepare yourself to be continuously surprised by many unexpected revelations
+...)
+
+You may already know that there are many different versions of .xls files.
+Different versions have different capabilities. So we'll start by
+reviewing the Excel evolutionary history and and we'll introduce some Microsoft
+jargon because it's central to understanding the underlying operations.
+
+\section CFBF CFBF
+
+Unexpected Revelation #1:
+<em>There is no .xls file format. Its really a common file suffix applied to
+many different things.</em>
+
+Recent Microsoft Office document files are based on a common container layout
+named CFBF (Compound File Binary Format). This container format is the same for
+Excel (.xls), Word (.doc_ and PowerPoint (.ppt) amongst other applications.
+More information:
+ - http://en.wikipedia.org/wiki/Compound_File_Binary_Format
+ - http://msdn.microsoft.com/en-us/library/dd942138%28v=prot.13%29.aspx
+
+Unexpected Revelation #2:
+<em>CFBF is more of a file system than a file format</em>
+
+A CFBF file is divided into many equal-sized blocks named sectors.
+Such sectors cannot be directly accessed. In order to retrieve sectors in the
+expected logical order a FAT (File Allocation Table) is allocated within
+the CFBF file. A CFBF file is internally organized as if it was a raw physical
+disk. The design is based on Microsoft own FAT file-system as used by MS-DOS and
+early versions of Windows. The first sector of the CFBF file acts as if it was a
+kind-of MBR (Master Boot Record) - this first sector provides information about
+the layout and type of the CFBF file, such as block/sector size and version.
+A FAT chain allows a reader to re-assemble the sectors in the required logical
+order. There is a list of free block, and very large files may use a
+double indirection (DIFAT - Double Indirection FAT). A CFBF file always has at
+least a root directory: but a complete directory tree can be provided.
+
+A CFBF file can contain many and many distinct independent files. Just to make
+things a little clearer, Microsoft calls such pseudo-files (I mean: the many
+fake ones contained within the real CFBF file) <em>streams</em>
+
+The practical consequence is that any software tool attempting to access an
+Excel binary document must first be able to correctly access this CFBF
+container format.
+
+\section BIFF BIFF
+Unexpected Revelation #3:
+<em>An Excel document will contain a stream (pseudo-file) named Workbook in
+the root directory of the CFBF file (filesystem).</em>
+
+The Workbook stream is internally structured accordingly to the BIFF (Binary
+Interchange File Format) specifications. You can think of the BIFF as the real
+Excel binary format (following more conventional naming rules). Several BIFF
+versions were introduced during the years: and there are significant differences
+between them.
+
+An useful correspondence table relating corresponding Excel and BIFF versions:
+
+<table>
+ <tr>
+ <th>
+ <b>Excel Version</b>
+ </th>
+ <th>
+ <b>Commercial Name</b>
+ </th>
+ <th>
+ <b>BIFF Version</b>
+ </th>
+ <th>
+ <b>Release Year</b>
+ </th>
+ <th>
+ <b>Notes</b>
+ </th>
+ </tr>
+ <tr>
+ <td>2.x</td>
+ <td>Excel 2.0</td>
+ <td>BIFF2</td>
+ <td>1987</td>
+ <td>Before CFBF. File is the BIFF stream, containing a single
+ worksheet.</td>
+ </tr>
+ <tr>
+ <td>3.0</td>
+ <td>Excel 3.0</td>
+ <td>BIFF3</td>
+ <td>1990</td>
+ <td>Before CFBF. File is the BIFF stream, containing a single
+ worksheet.</td>
+ </tr>
+ <tr>
+ <td>4.0</td>
+ <td>Excel 4.0</td>
+ <td>BIFF4</td>
+ <td>1992</td>
+ <td>Before CFBF. File is the BIFF stream, containing a single
+ worksheet.</td>
+ </tr>
+ <tr>
+ <td>5.0</td>
+ <td>Excel 5.0</td>
+ <td>BIFF5</td>
+ <td>1993</td>
+ <td>Starting with BIFF5, a single Workbook can internally store many
+ individual Worksheets. The BIFF stream is stored in the CFBF file
+ container.</td>
+ </tr>
+ <tr>
+ <td>7.0</td>
+ <td>Excel 95</td>
+ <td>BIFF5</td>
+ <td>1995</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>8.0</td>
+ <td>Excel 98</td>
+ <td>BIFF8</td>
+ <td>1998</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>9.0</td>
+ <td>Excel 2000</td>
+ <td>BIFF8</td>
+ <td>1999</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>10.0</td>
+ <td>Excel XP</td>
+ <td>BIFF8</td>
+ <td>2001</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>11.0</td>
+ <td>Excel 2003</td>
+ <td>BIFF8</td>
+ <td>2003</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>12.0</td>
+ <td>Excel 2007</td>
+ <td>BIFF8</td>
+ <td>2007</td>
+ <td>Introduced alternate XML format, which is usually the default
+ for new files.</td>
+ </tr>
+ <tr>
+ <td>14.0</td>
+ <td>Excel 2010</td>
+ <td>BIFF8</td>
+ <td>2010</td>
+ <td>XML format is usually the default for new files.</td>
+ </tr>
+</table>
+
+Note that FreeXL does not support the new XML format which is a completely
+different and unrelated format.
+
+Perhaps you are now expecting that BIFF will simply and directly encode your
+spreadsheet data. Unfortunately, you should have know better given the steps
+we took to get here...
+
+Unexpected Revelation #4:
+<em>Any BIFF stream (pseudo-file stored within a CFBF container file) is
+internally organized as a collection of variable-length records.</em>.
+
+Each record starts with
+ - a 16 bit unsigned integer specifying the record type
+ - another 16 bit unsigned integer specifies the record data length (in bytes)
+ excluding the standard type-size prefix.
+
+Note that there are many different record types, and the record size / layout
+may differ for different BIFF versions.
+
+Three record types have an absolutely special meaning:
+ - a BOF [Beginning Of File] record marks starting of a different sub-stream.
+ - an EOF [End Of File] record marks ending of current sub-stream.
+ - a CONTINUE record means that the previous record exceeded the maximum size
+ for a record, and the previous record data payload will be spanned on
+ following CONTINUE records for as many CONTINUE records as are required to
+ store the full data size.
+
+Unexpected Revelation #5:
+<em>So a BIFF stream (pseudo-file) isn't really a file - it's more like a
+collection of individual sub-streams, each one of which is enclosed between BOF
+/ EOF markers.</em>
+
+The most recent BIFF8 requires that at least the following internal
+sub-streams are be defined:
+ - the first sub-stream contains workbook level global data and metadata, such
+ as author, password protection, styles, formats, window settings and so on
+ - list of individual worksheets included into the Workbook, where each
+ worksheet is identified by a name and by a type (data Worksheet, Chart,
+ Visual Basic module ... visible, hidden ...), and relative offset position of
+ the corresponding BOF record allows for fast positioning.
+ - any text string is stored here into the SST [Shared String Table], so
+ individual text cells simply refer the corresponding SST entry by index (in all
+ previous BIFF version text strings are directly stored into the appropriate
+ cell).
+ - any subsequent sub-stream represents a single Worksheet, and the most
+ relevant data stored at Worksheet level are dimension (number of valid rows and
+ columns) and any cell value data.
+
+We will now see how BIFF encodes individual data types with several further
+amazing surprises are still to come. Be prepared!
+
+\section BIFF Supported data types and encoding
+
+Leaving aside special values such as images, OLE, COM, Visual Basic related
+items and so on, the basic data types are supported in BIFF:
+ - text strings
+ - numbers (both integers and decimals)
+ - dates, date-times and times
+ - NULL (empty cell)
+
+Note that any multi-byte value is stored in BIFF accordingly using Little Endian
+byte ordering (i.e. least significant byte comes first, most significant byte
+comes last).
+
+<table>
+ <tr>
+ <th><b>BIFF Record Type</b></th>
+ <th><b>BIFF Version</b></th>
+ <th><b>Content Type</b></th>
+ </tr>
+ <tr>
+ <td>INTEGER</td>
+ <td>BIFF2</td>
+ <td>16 bit unsigned integer</td>
+ </tr>
+ <tr>
+ <td>NUMBER</td>
+ <td>BIFF2 BIFF3 BIFF4 BIFF5 BIFF8</td>
+ <td>64 bit floating point (double precision)</td>
+ </tr>
+ <tr>
+ <td>RK</td>
+ <td>BIFF3 BIFF4 BIFF5 BIFF8</td>
+ <td>number, variant-type: INTEGER FLOAT DATE DATETIME TIME
+ (please see the corresponding detailed description)</td>
+ </tr>
+ <tr>
+ <td>MULRK</td>
+ <td>BIFF5 BIFF8</td>
+ <td>a variable-sized array of elementary RK values.
+ associated to a range of consecutive cells on the same row </td>
+ </tr>
+ <tr>
+ <td>LABEL</td>
+ <td>BIFF2 BIFF3 BIFF4 BIFF5 BIFF8</td>
+ <td>text string, variable-length.
+ (please see the corresponding detailed description)</td>
+ </tr>
+ <tr>
+ <td>LABELSST</td>
+ <td>BIFF8</td>
+ <td>text string, variable-length. based on the global SST
+ [Shared String Table] stored at the workbook level, so a LABELSST simply
+ requires providing the corresponding SST index.</td>
+ </tr>
+</table>
+
+So the BIFF record type that is easy to handle is NUMBER, which is essentially
+a C-style <em>double</em>. Other record types require additional handling.
+
+\subsection RK RK values
+
+An RK value is a 32 bit value.
+
+The least significant two bits are a bit-mask (in little endian order, so the
+least two significant bits in the first byte that is read):
+ - if 0x02 is set the RK value represents a 30 bit signed integer, otherwise it
+ represents a 64 bit floating point double precision number requiring special
+ reconstruction.
+ - if 0x01 is set the corresponding value needs to be divided by 100, so even an
+ integer actually becomes a floating point double precision.
+
+When interpreting RK values as a signed integer, right shifting two bits is
+required:
+\code
+int value = rk_value >> 2;
+\endcode
+
+When interpreting RK values as a 64 bit floating point, two steps are required:
+ - the RK value requires appropriate masking:
+\code
+int value = rk_value & 0xfffffffc;
+\endcode
+ - then the 32 bit value will be copied into a 64 bit buffer, and the least
+ significant four bytes need to be initialized as zeroes: 0x00000000.
+
+As a final step, if 0x01 was set into the bit-mask, now we have to divide by
+100 before returning the effective cell value. So for 32 bit integers:
+\code
+double final_value = (double)value / 100.0;
+\endcode
+and for 64 bit floats:
+\code
+double final_value = value / 100.0;
+\endcode
+
+\subsection Text Text values
+
+Any BIFF version from BIFF2 to BIFF5 simply supports CodePage based character
+encoding, i.e. each character simply requires 8 bits to be represented (single
+byte). Correct representation of characters requires knowing which one CodePage
+table has to be applied. This can be determined from the workbook or
+worksheet metadata (it is the CODEPAGE record).
+
+BIFF8 is much more sophisticated, since any text
+string is usually encoded as Unicode in UTF-16 Little Endian [UTF-16LE] format.
+This encoding is a multi-byte encoding (two bytes are required to represent a
+single character), but being universal no character table is required.
+
+BIFF text strings are never null-terminated. The actual length is always
+explicitly stated, as an 8 bit unsigned int or as a 16 bit unsigned int
+(depending on BIFF versions).
+
+FreeXL is intended to be strictly interoperable with SQLite and SpatiaLite, so
+any text string has to be converted to UTF-8 encoding. GNU libiconv can easily
+handle any required charset conversion. So we can simply fetch the appropriate
+bytes, then call iconv() as appropriate, and we'll immediately get back the
+corresponding UTF-8 encoded text string.
+
+Converting Unicode based text strings is a little more complex, because
+each Unicode string is prefixed by a mask byte, specifying how the string is
+encoded:
+ - if 0x01 is set, then the string really is 16 bit per character Unicode,
+ otherwise a stripped notation is used instead. Stripped notation means
+ that the characters are actually represented as single bytes, so already
+ have the UTF8 equivalent.
+ - if 0x04 and/or 0x08 are set, than some further variable-length data
+ (providing information on text decoration such as italics, bold, underline) is
+ inserted immediately before and after the text string itself, so we must
+ carefully skip over this extra data so to maintain the right byte alignment.
+
+Note that the string length is expressed in characters, not in bytes, so the
+actual length in bytes is twice the indicated length.
+
+\subsection Dates Retrieving Date, DateTime and Time values.
+
+Dates, DateTimes and Time values are also a little complicated. Any Date is
+expressed as an Integer (number of days since the conventional reference day):
+ - for Windows Excel the reference day (day 0) is 1900, January 1
+ - for Mac Excel the reference day (day 0) is 1904, January 2
+
+There is no possible ambiguity, because the DATEMODE metadata record
+specifies tells which reference day is to be used.
+
+An odd bug affects Excel, which (incorrectly) treats 1900 as a leap year.
+Therefore, the non-existent 29 February 1900 has to be included in the days
+calculation so to get the expected Date value.
+
+Any Time is expressed as a Fraction (percent of seconds since midnight).
+0.5 corresponds to 12:00:00 (midday), 0.25 corresponds to 06:00:00, 0.75
+corresponds to 18:00:00 and so on.
+
+So a DateTime is simply the sum of a Date value and of a Time value. Dates
+can be represented by Integers: but Times and DateTimes require a floating point
+number.
+
+The complication with Dates, DateTimes and Time values is that the data-type
+does not specify when a cell values has to be interpreted as a Date or Time -
+it is simply an Integer or Float numbers like any other. A further indirection
+has to applied so to correctly recognize Dates, DateTimes and Times:
+ - each NUMBER, RK or MULRK value exposes an index referencing the XF
+(Extended Format) entry associated with the corresponding cell.
+ - each XF record specifies an unique combination of font, alignment, color
+ and so on, however a further indirection specifies the corresponding FORMAT
+ entry
+ - each FORMAT record specifies an output format, such as M/D/YY, h:mm:ss AM/PM
+ or M/D/YY h:mm: and this finally gives us a good chance to guess which cell
+ values are intended to represent Date/Time values.
+
+Both XF and FORMAT records are globally stored at the Workbook level, and
+represent ordered arrays.
+
+If you haven't yet given up, if you aren't yet become totally mind-boggled,
+and if you are still awake and conscious, then you now know how .xls files
+are internally organized and structured.
+
+Be happy and feel proud of yourself.
+*/
+
+/** \page OtherTools Other tools and libraries
+There an impressively wide choice of Free and open source libraries and tools
+supporting the .xls format. A sample:
+
+ - Gnumeric [http://projects.gnome.org/gnumeric/] seems to be the pioneer of
+them all, and probably was the first FLOSS tool able to read and write .xls
+(circa 2001). Part of the Gnome Office project.
+ - KSpread / Caligra Tables [http://www.calligra-suite.org/tables/] / KCells
+[http://www.koffice.org/kcells/] are similar (but now distinct) programs
+from the KOffice and Calligra Office projects.
+ - Open Office Calc [http://www.openoffice.org/product/calc.html] and
+LibreOffice Calc [http://www.libreoffice.org/features/calc/] are similar
+(but now distinct) spreadsheet applications originally from the StartOffice
+code base. Probably the most comprehensive support in FLOSS.
+ - Apache POI-HSSF [http://poi.apache.org/spreadsheet/index.html] is a
+sophisticated Java library fully supporting .xls files.
+ - JExcelAPI [http://jexcelapi.sourceforge.net/] is another Java library
+(much simpler and lighter than POI-HSSF) supporting .xls files.
+ - several C or C++ libraries exist as well: quite curiously one is named
+libxls and another xlslib, but they are two absolutely distinct and unrelated
+packages
+ - There are other implementations are available based on .NET or PHP.
+
+A quick critical review:
+ - GUI tools implementations are difficult to re-use. They focus on import of
+ all formulas, GUI presentation and so on, which is really a different use.
+ - Java libraries seem to be really interesting, but Java is difficult to call
+ from a C or C++ program.
+ - Several C/C++ libraries exist, but none of them seems to be sufficient and
+ stable as required. Some are still marked to be “beta-stage” despite
+ being released some four or five years ago - project activity seems to be
+ very low, and download statistics are discouraging.
+
+Conclusion: a suitable C/C++ library supporting data extraction from .xls files
+doesn't seem to exists: or at least, there is no obvious reference choice.
+
+So we'll go on the hardest way, we'll develop yet another .xls reading
+library: FreeXL.
+*/
diff --git a/missing b/missing
new file mode 100755
index 0000000..cdea514
--- /dev/null
+++ b/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2012-06-26.16; # UTC
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+fi
+
+case $1 in
+
+ --is-lightweight)
+ # Used by our autoconf macros to check whether the available missing
+ # script is modern enough.
+ exit 0
+ ;;
+
+ --run)
+ # Back-compat with the calling convention used by older automake.
+ shift
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal autoconf autoheader autom4te automake makeinfo
+ bison yacc flex lex help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake at gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch. This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+ msg="probably too old"
+elif test $st -eq 127; then
+ # Program was missing.
+ msg="missing on your system"
+else
+ # Program was found and executed, but failed. Give up.
+ exit $st
+fi
+
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+ case $1 in
+ aclocal|automake)
+ echo "The '$1' program is part of the GNU Automake package:"
+ echo "<$gnu_software_URL/automake>"
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/autoconf>"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ autoconf|autom4te|autoheader)
+ echo "The '$1' program is part of the GNU Autoconf package:"
+ echo "<$gnu_software_URL/autoconf/>"
+ echo "It also requires GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ esac
+}
+
+give_advice ()
+{
+ # Normalize program name to check for.
+ normalized_program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+ printf '%s\n' "'$1' is $msg."
+
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ case $normalized_program in
+ autoconf*)
+ echo "You should only need it if you modified 'configure.ac',"
+ echo "or m4 files included by it."
+ program_details 'autoconf'
+ ;;
+ autoheader*)
+ echo "You should only need it if you modified 'acconfig.h' or"
+ echo "$configure_deps."
+ program_details 'autoheader'
+ ;;
+ automake*)
+ echo "You should only need it if you modified 'Makefile.am' or"
+ echo "$configure_deps."
+ program_details 'automake'
+ ;;
+ aclocal*)
+ echo "You should only need it if you modified 'acinclude.m4' or"
+ echo "$configure_deps."
+ program_details 'aclocal'
+ ;;
+ autom4te*)
+ echo "You might have modified some maintainer files that require"
+ echo "the 'automa4te' program to be rebuilt."
+ program_details 'autom4te'
+ ;;
+ bison*|yacc*)
+ echo "You should only need it if you modified a '.y' file."
+ echo "You may want to install the GNU Bison package:"
+ echo "<$gnu_software_URL/bison/>"
+ ;;
+ lex*|flex*)
+ echo "You should only need it if you modified a '.l' file."
+ echo "You may want to install the Fast Lexical Analyzer package:"
+ echo "<$flex_URL>"
+ ;;
+ help2man*)
+ echo "You should only need it if you modified a dependency" \
+ "of a man page."
+ echo "You may want to install the GNU Help2man package:"
+ echo "<$gnu_software_URL/help2man/>"
+ ;;
+ makeinfo*)
+ echo "You should only need it if you modified a '.texi' file, or"
+ echo "any other file indirectly affecting the aspect of the manual."
+ echo "You might want to install the Texinfo package:"
+ echo "<$gnu_software_URL/texinfo/>"
+ echo "The spurious makeinfo call might also be the consequence of"
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+ echo "want to install GNU make:"
+ echo "<$gnu_software_URL/make/>"
+ ;;
+ *)
+ echo "You might have modified some files without having the proper"
+ echo "tools for further handling them. Check the 'README' file, it"
+ echo "often tells you about the needed prerequisites for installing"
+ echo "this package. You may also peek at any GNU archive site, in"
+ echo "case some other package contains this missing '$1' program."
+ ;;
+ esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+ -e '2,$s/^/ /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/rasterlite2-4.2.0.mk b/rasterlite2-4.2.0.mk
new file mode 100644
index 0000000..581d961
--- /dev/null
+++ b/rasterlite2-4.2.0.mk
@@ -0,0 +1,86 @@
+include $(CLEAR_VARS)
+# ./configure --build=x86_64-pc-linux-gnu --host=arm-linux-eabi
+LOCAL_MODULE := rasterlite2
+
+# SQLite flags copied from ASOP [may not be needed for rasterlite2]
+common_sqlite_flags := \
+ -DHAVE_USLEEP=1 \
+ -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 \
+ -DSQLITE_THREADSAFE=1 \
+ -DNDEBUG=1 \
+ -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 \
+ -DSQLITE_DEFAULT_AUTOVACUUM=1 \
+ -DSQLITE_TEMP_STORE=3 \
+ -DSQLITE_ENABLE_FTS3 \
+ -DSQLITE_ENABLE_FTS3_BACKWARDS \
+ -DSQLITE_ENABLE_RTREE=1 \
+ -DSQLITE_DEFAULT_FILE_FORMAT=4
+
+# comment out TARGET_CPU in config.h - will be replaced with TARGET_ARCH_ABI
+spatialite_flags := \
+ -DOMIT_FREEXL \
+ -DTARGET_CPU=\"$(TARGET_ARCH_ABI)\" \
+ -Dfdatasync=fsync \
+ -DSQLITE_ENABLE_RTREE=1 \
+ -DSQLITE_OMIT_BUILTIN_TEST=1
+
+# comment out TARGET_CPU in config.h - will be replaced with TARGET_ARCH_ABI
+rasterlite2_flags := \
+ -DTARGET_CPU=\"$(TARGET_ARCH_ABI)\" \
+ -O
+
+LOCAL_CFLAGS := \
+ $(common_sqlite_flags) \
+ $(spatialite_flags) \
+ $(rasterlite2_flags)
+
+LOCAL_C_INCLUDES := \
+ $(SQLITE_PATH) \
+ $(GEOTIFF_PATH)/libxtiff \
+ $(GEOTIFF_PATH) \
+ $(TIFF_PATH) \
+ $(JPEG_PATH) \
+ $(GIF_PATH) \
+ $(PNG_PATH) \
+ $(WEBP_PATH)/src/webp \
+ $(WEBP_PATH)/src/dec \
+ $(WEBP_PATH)/src/dsp \
+ $(WEBP_PATH)/src/enc \
+ $(WEBP_PATH)/src/utils \
+ $(WEBP_PATH)/src \
+ $(WEBP_PATH) \
+ $(CAIRO_PATH) \
+ $(ICONV_PATH)/include \
+ $(ICONV_PATH)/libcharset/include \
+ $(XML2_PATH)/include \
+ $(CURL_PATH) \
+ $(CURL_PATH)/include \
+ $(CURL_PATH)/lib \
+ $(RASTERLITE2_PATH) \
+ $(RASTERLITE2_PATH)/headers \
+ $(SPATIALITE_PATH)/src/headers \
+ $(LZMA_PATH)/src/liblzma/api
+LOCAL_SRC_FILES := \
+ $(RASTERLITE2_PATH)/src/rasterlite2.c \
+ $(RASTERLITE2_PATH)/src/rl2ascii.c \
+ $(RASTERLITE2_PATH)/src/rl2codec.c \
+ $(RASTERLITE2_PATH)/src/rl2dbms.c \
+ $(RASTERLITE2_PATH)/src/rl2gif.c \
+ $(RASTERLITE2_PATH)/src/rl2import.c \
+ $(RASTERLITE2_PATH)/src/rl2jpeg.c \
+ $(RASTERLITE2_PATH)/src/rl2paint.c \
+ $(RASTERLITE2_PATH)/src/rl2png.c \
+ $(RASTERLITE2_PATH)/src/rl2rastersym.c \
+ $(RASTERLITE2_PATH)/src/rl2raw.c \
+ $(RASTERLITE2_PATH)/src/rl2sql.c \
+ $(RASTERLITE2_PATH)/src/rl2sqlaux.c \
+ $(RASTERLITE2_PATH)/src/rl2svg.c \
+ $(RASTERLITE2_PATH)/src/rl2svgaux.c \
+ $(RASTERLITE2_PATH)/src/rl2svgxml.c \
+ $(RASTERLITE2_PATH)/src/rl2symbolizer.c \
+ $(RASTERLITE2_PATH)/src/rl2tiff.c \
+ $(RASTERLITE2_PATH)/src/rl2version.c \
+ $(RASTERLITE2_PATH)/src/rl2webp.c \
+ $(RASTERLITE2_PATH)/src/rl2wms.c
+LOCAL_STATIC_LIBRARIES := libpng libwebp libxml2 spatialite libfreetype libcairo libcurl libgeotiff libtiff libgif libjpeg
+include $(BUILD_STATIC_LIBRARY)
diff --git a/rasterlite2.pc.in b/rasterlite2.pc.in
new file mode 100644
index 0000000..525786c
--- /dev/null
+++ b/rasterlite2.pc.in
@@ -0,0 +1,12 @@
+# Package Information for pkg-config
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: rasterlite2
+Description: a library supporting Rasters on DBMS
+Version: @VERSION@
+Libs: -L${libdir} -lrasterlite2 -lm
+Cflags: -I${includedir}
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..a16359b
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,48 @@
+
+AM_CFLAGS = @LIBPNG_CFLAGS@ @LIBWEBP_CFLAGS@ @LIBLZMA_CFLAGS@ \
+ @LIBSPATIALITE_CFLAGS@ @LIBCAIRO_CFLAGS@ @LIBCURL_CFLAGS@ \
+ @LIBXML2_CFLAGS@
+
+AM_CPPFLAGS = @CFLAGS@
+AM_CPPFLAGS += -I$(top_srcdir)/headers
+
+lib_LTLIBRARIES = librasterlite2.la mod_rasterlite2.la
+
+librasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
+ rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
+ rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
+ rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
+ rl2svgaux.c rl2symbolizer.c rl2rastersym.c rl2version.c
+
+if MINGW
+librasterlite2_la_LDFLAGS = -avoid-version -no-undefined
+else
+librasterlite2_la_LDFLAGS = -version-info 1:0:0
+endif
+
+librasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ \
+ @LIBLZMA_LIBS@ @LIBSPATIALITE_LIBS@ @LIBCAIRO_LIBS@ \
+ @LIBCURL_LIBS@ @LIBXML2_LIBS@
+
+mod_rasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
+ rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
+ rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
+ rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
+ rl2svgaux.c rl2symbolizer.c rl2rastersym.c rl2version.c
+
+mod_rasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ \
+ @LIBLZMA_LIBS@ @LIBSPATIALITE_LIBS@ @LIBCAIRO_LIBS@ \
+ @LIBCURL_LIBS@ @LIBXML2_LIBS@
+
+mod_rasterlite2_la_CPPFLAGS = @CFLAGS@
+mod_rasterlite2_la_CPPFLAGS += -I$(top_srcdir)/headers -I.
+mod_rasterlite2_la_CPPFLAGS += -DLOADABLE_EXTENSION
+mod_rasterlite2_la_LIBTOOLFLAGS = --tag=disable-static
+
+if MINGW
+mod_rasterlite2_la_LDFLAGS = -module -avoid-version -no-undefined
+else
+mod_rasterlite2_la_LDFLAGS = -module -version-info 1:0:0
+endif
+
+MOSTLYCLEANFILES = *.gcna *.gcno *.gcda
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..439348f
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,921 @@
+# Makefile.in generated by automake 1.13.4 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.
+
+ at 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@
+pkgincludedir = $(includedir)/@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 = src
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(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)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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)$(libdir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+librasterlite2_la_DEPENDENCIES =
+am_librasterlite2_la_OBJECTS = rasterlite2.lo rl2raw.lo rl2codec.lo \
+ rl2jpeg.lo rl2png.lo rl2gif.lo rl2webp.lo rl2tiff.lo rl2wms.lo \
+ rl2ascii.lo rl2paint.lo rl2dbms.lo rl2import.lo rl2pyramid.lo \
+ rl2sql.lo rl2sqlaux.lo rl2auxrender.lo rl2svg.lo rl2svgxml.lo \
+ rl2svgaux.lo rl2symbolizer.lo rl2rastersym.lo rl2version.lo
+librasterlite2_la_OBJECTS = $(am_librasterlite2_la_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+librasterlite2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(AM_CFLAGS) $(CFLAGS) $(librasterlite2_la_LDFLAGS) $(LDFLAGS) \
+ -o $@
+mod_rasterlite2_la_DEPENDENCIES =
+am_mod_rasterlite2_la_OBJECTS = mod_rasterlite2_la-rasterlite2.lo \
+ mod_rasterlite2_la-rl2raw.lo mod_rasterlite2_la-rl2codec.lo \
+ mod_rasterlite2_la-rl2jpeg.lo mod_rasterlite2_la-rl2png.lo \
+ mod_rasterlite2_la-rl2gif.lo mod_rasterlite2_la-rl2webp.lo \
+ mod_rasterlite2_la-rl2tiff.lo mod_rasterlite2_la-rl2wms.lo \
+ mod_rasterlite2_la-rl2ascii.lo mod_rasterlite2_la-rl2paint.lo \
+ mod_rasterlite2_la-rl2dbms.lo mod_rasterlite2_la-rl2import.lo \
+ mod_rasterlite2_la-rl2pyramid.lo mod_rasterlite2_la-rl2sql.lo \
+ mod_rasterlite2_la-rl2sqlaux.lo \
+ mod_rasterlite2_la-rl2auxrender.lo \
+ mod_rasterlite2_la-rl2svg.lo mod_rasterlite2_la-rl2svgxml.lo \
+ mod_rasterlite2_la-rl2svgaux.lo \
+ mod_rasterlite2_la-rl2symbolizer.lo \
+ mod_rasterlite2_la-rl2rastersym.lo \
+ mod_rasterlite2_la-rl2version.lo
+mod_rasterlite2_la_OBJECTS = $(am_mod_rasterlite2_la_OBJECTS)
+mod_rasterlite2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+ $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(mod_rasterlite2_la_LDFLAGS) \
+ $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(librasterlite2_la_SOURCES) $(mod_rasterlite2_la_SOURCES)
+DIST_SOURCES = $(librasterlite2_la_SOURCES) \
+ $(mod_rasterlite2_la_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# 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)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAIRO_CFLAGS = @LIBCAIRO_CFLAGS@
+LIBCAIRO_LIBS = @LIBCAIRO_LIBS@
+LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@
+LIBLZMA_LIBS = @LIBLZMA_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
+LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
+LIBTOOL = @LIBTOOL@
+LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@
+LIBWEBP_LIBS = @LIBWEBP_LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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_CXX = @ac_ct_CXX@
+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@
+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@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = @LIBPNG_CFLAGS@ @LIBWEBP_CFLAGS@ @LIBLZMA_CFLAGS@ \
+ @LIBSPATIALITE_CFLAGS@ @LIBCAIRO_CFLAGS@ @LIBCURL_CFLAGS@ \
+ @LIBXML2_CFLAGS@
+
+AM_CPPFLAGS = @CFLAGS@ -I$(top_srcdir)/headers
+lib_LTLIBRARIES = librasterlite2.la mod_rasterlite2.la
+librasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
+ rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
+ rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
+ rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
+ rl2svgaux.c rl2symbolizer.c rl2rastersym.c rl2version.c
+
+ at MINGW_FALSE@librasterlite2_la_LDFLAGS = -version-info 1:0:0
+ at MINGW_TRUE@librasterlite2_la_LDFLAGS = -avoid-version -no-undefined
+librasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ \
+ @LIBLZMA_LIBS@ @LIBSPATIALITE_LIBS@ @LIBCAIRO_LIBS@ \
+ @LIBCURL_LIBS@ @LIBXML2_LIBS@
+
+mod_rasterlite2_la_SOURCES = rasterlite2.c rl2raw.c rl2codec.c \
+ rl2jpeg.c rl2png.c rl2gif.c rl2webp.c rl2tiff.c rl2wms.c \
+ rl2ascii.c rl2paint.c rl2dbms.c rl2import.c rl2pyramid.c \
+ rl2sql.c rl2sqlaux.c rl2auxrender.c rl2svg.c rl2svgxml.c \
+ rl2svgaux.c rl2symbolizer.c rl2rastersym.c rl2version.c
+
+mod_rasterlite2_la_LIBADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ \
+ @LIBLZMA_LIBS@ @LIBSPATIALITE_LIBS@ @LIBCAIRO_LIBS@ \
+ @LIBCURL_LIBS@ @LIBXML2_LIBS@
+
+mod_rasterlite2_la_CPPFLAGS = @CFLAGS@ -I$(top_srcdir)/headers -I. \
+ -DLOADABLE_EXTENSION
+mod_rasterlite2_la_LIBTOOLFLAGS = --tag=disable-static
+ at MINGW_FALSE@mod_rasterlite2_la_LDFLAGS = -module -version-info 1:0:0
+ at MINGW_TRUE@mod_rasterlite2_la_LDFLAGS = -module -avoid-version -no-undefined
+MOSTLYCLEANFILES = *.gcna *.gcno *.gcda
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(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) --gnu src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/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):
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
+librasterlite2.la: $(librasterlite2_la_OBJECTS) $(librasterlite2_la_DEPENDENCIES) $(EXTRA_librasterlite2_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(librasterlite2_la_LINK) -rpath $(libdir) $(librasterlite2_la_OBJECTS) $(librasterlite2_la_LIBADD) $(LIBS)
+
+mod_rasterlite2.la: $(mod_rasterlite2_la_OBJECTS) $(mod_rasterlite2_la_DEPENDENCIES) $(EXTRA_mod_rasterlite2_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(mod_rasterlite2_la_LINK) -rpath $(libdir) $(mod_rasterlite2_la_OBJECTS) $(mod_rasterlite2_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rasterlite2.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2ascii.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2auxrender.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2codec.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2dbms.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2gif.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2import.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2jpeg.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2paint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2png.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2pyramid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2rastersym.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2raw.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2sql.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2sqlaux.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2svg.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2svgaux.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2svgxml.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2symbolizer.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2tiff.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2version.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2webp.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_rasterlite2_la-rl2wms.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rasterlite2.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2ascii.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2auxrender.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2codec.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2dbms.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2gif.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2import.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2jpeg.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2paint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2png.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2pyramid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2rastersym.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2raw.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2sql.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2sqlaux.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2svg.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2svgaux.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2svgxml.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2symbolizer.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2tiff.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2version.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2webp.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2wms.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mod_rasterlite2_la-rasterlite2.lo: rasterlite2.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rasterlite2.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rasterlite2.Tpo -c -o mod_rasterlite2_la-rasterlite2.lo `test -f 'rasterlite2.c' || echo '$(srcdir)/'`rasterlite2.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rasterlite2.Tpo $(DEPDIR)/mod_rasterlite2_la-rasterlite2.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rasterlite2.c' object='mod_rasterlite2_la-rasterlite2.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rasterlite2.lo `test -f 'rasterlite2.c' || echo '$(srcdir)/'`rasterlite2.c
+
+mod_rasterlite2_la-rl2raw.lo: rl2raw.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2raw.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2raw.Tpo -c -o mod_rasterlite2_la-rl2raw.lo `test -f 'rl2raw.c' || echo '$(srcdir)/'`rl2raw.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2raw.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2raw.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2raw.c' object='mod_rasterlite2_la-rl2raw.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2raw.lo `test -f 'rl2raw.c' || echo '$(srcdir)/'`rl2raw.c
+
+mod_rasterlite2_la-rl2codec.lo: rl2codec.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2codec.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2codec.Tpo -c -o mod_rasterlite2_la-rl2codec.lo `test -f 'rl2codec.c' || echo '$(srcdir)/'`rl2codec.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2codec.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2codec.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2codec.c' object='mod_rasterlite2_la-rl2codec.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2codec.lo `test -f 'rl2codec.c' || echo '$(srcdir)/'`rl2codec.c
+
+mod_rasterlite2_la-rl2jpeg.lo: rl2jpeg.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2jpeg.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2jpeg.Tpo -c -o mod_rasterlite2_la-rl2jpeg.lo `test -f 'rl2jpeg.c' || echo '$(srcdir)/'`rl2jpeg.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2jpeg.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2jpeg.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2jpeg.c' object='mod_rasterlite2_la-rl2jpeg.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2jpeg.lo `test -f 'rl2jpeg.c' || echo '$(srcdir)/'`rl2jpeg.c
+
+mod_rasterlite2_la-rl2png.lo: rl2png.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2png.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2png.Tpo -c -o mod_rasterlite2_la-rl2png.lo `test -f 'rl2png.c' || echo '$(srcdir)/'`rl2png.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2png.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2png.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2png.c' object='mod_rasterlite2_la-rl2png.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2png.lo `test -f 'rl2png.c' || echo '$(srcdir)/'`rl2png.c
+
+mod_rasterlite2_la-rl2gif.lo: rl2gif.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2gif.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2gif.Tpo -c -o mod_rasterlite2_la-rl2gif.lo `test -f 'rl2gif.c' || echo '$(srcdir)/'`rl2gif.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2gif.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2gif.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2gif.c' object='mod_rasterlite2_la-rl2gif.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2gif.lo `test -f 'rl2gif.c' || echo '$(srcdir)/'`rl2gif.c
+
+mod_rasterlite2_la-rl2webp.lo: rl2webp.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2webp.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2webp.Tpo -c -o mod_rasterlite2_la-rl2webp.lo `test -f 'rl2webp.c' || echo '$(srcdir)/'`rl2webp.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2webp.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2webp.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2webp.c' object='mod_rasterlite2_la-rl2webp.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2webp.lo `test -f 'rl2webp.c' || echo '$(srcdir)/'`rl2webp.c
+
+mod_rasterlite2_la-rl2tiff.lo: rl2tiff.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2tiff.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2tiff.Tpo -c -o mod_rasterlite2_la-rl2tiff.lo `test -f 'rl2tiff.c' || echo '$(srcdir)/'`rl2tiff.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2tiff.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2tiff.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2tiff.c' object='mod_rasterlite2_la-rl2tiff.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2tiff.lo `test -f 'rl2tiff.c' || echo '$(srcdir)/'`rl2tiff.c
+
+mod_rasterlite2_la-rl2wms.lo: rl2wms.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2wms.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2wms.Tpo -c -o mod_rasterlite2_la-rl2wms.lo `test -f 'rl2wms.c' || echo '$(srcdir)/'`rl2wms.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2wms.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2wms.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2wms.c' object='mod_rasterlite2_la-rl2wms.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2wms.lo `test -f 'rl2wms.c' || echo '$(srcdir)/'`rl2wms.c
+
+mod_rasterlite2_la-rl2ascii.lo: rl2ascii.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2ascii.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2ascii.Tpo -c -o mod_rasterlite2_la-rl2ascii.lo `test -f 'rl2ascii.c' || echo '$(srcdir)/'`rl2ascii.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2ascii.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2ascii.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2ascii.c' object='mod_rasterlite2_la-rl2ascii.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2ascii.lo `test -f 'rl2ascii.c' || echo '$(srcdir)/'`rl2ascii.c
+
+mod_rasterlite2_la-rl2paint.lo: rl2paint.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2paint.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2paint.Tpo -c -o mod_rasterlite2_la-rl2paint.lo `test -f 'rl2paint.c' || echo '$(srcdir)/'`rl2paint.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2paint.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2paint.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2paint.c' object='mod_rasterlite2_la-rl2paint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2paint.lo `test -f 'rl2paint.c' || echo '$(srcdir)/'`rl2paint.c
+
+mod_rasterlite2_la-rl2dbms.lo: rl2dbms.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2dbms.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2dbms.Tpo -c -o mod_rasterlite2_la-rl2dbms.lo `test -f 'rl2dbms.c' || echo '$(srcdir)/'`rl2dbms.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2dbms.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2dbms.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2dbms.c' object='mod_rasterlite2_la-rl2dbms.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2dbms.lo `test -f 'rl2dbms.c' || echo '$(srcdir)/'`rl2dbms.c
+
+mod_rasterlite2_la-rl2import.lo: rl2import.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2import.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2import.Tpo -c -o mod_rasterlite2_la-rl2import.lo `test -f 'rl2import.c' || echo '$(srcdir)/'`rl2import.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2import.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2import.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2import.c' object='mod_rasterlite2_la-rl2import.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2import.lo `test -f 'rl2import.c' || echo '$(srcdir)/'`rl2import.c
+
+mod_rasterlite2_la-rl2pyramid.lo: rl2pyramid.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2pyramid.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2pyramid.Tpo -c -o mod_rasterlite2_la-rl2pyramid.lo `test -f 'rl2pyramid.c' || echo '$(srcdir)/'`rl2pyramid.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2pyramid.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2pyramid.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2pyramid.c' object='mod_rasterlite2_la-rl2pyramid.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2pyramid.lo `test -f 'rl2pyramid.c' || echo '$(srcdir)/'`rl2pyramid.c
+
+mod_rasterlite2_la-rl2sql.lo: rl2sql.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2sql.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2sql.Tpo -c -o mod_rasterlite2_la-rl2sql.lo `test -f 'rl2sql.c' || echo '$(srcdir)/'`rl2sql.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2sql.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2sql.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2sql.c' object='mod_rasterlite2_la-rl2sql.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2sql.lo `test -f 'rl2sql.c' || echo '$(srcdir)/'`rl2sql.c
+
+mod_rasterlite2_la-rl2sqlaux.lo: rl2sqlaux.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2sqlaux.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2sqlaux.Tpo -c -o mod_rasterlite2_la-rl2sqlaux.lo `test -f 'rl2sqlaux.c' || echo '$(srcdir)/'`rl2sqlaux.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2sqlaux.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2sqlaux.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2sqlaux.c' object='mod_rasterlite2_la-rl2sqlaux.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2sqlaux.lo `test -f 'rl2sqlaux.c' || echo '$(srcdir)/'`rl2sqlaux.c
+
+mod_rasterlite2_la-rl2auxrender.lo: rl2auxrender.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2auxrender.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2auxrender.Tpo -c -o mod_rasterlite2_la-rl2auxrender.lo `test -f 'rl2auxrender.c' || echo '$(srcdir)/'`rl2auxrender.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2auxrender.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2auxrender.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2auxrender.c' object='mod_rasterlite2_la-rl2auxrender.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2auxrender.lo `test -f 'rl2auxrender.c' || echo '$(srcdir)/'`rl2auxrender.c
+
+mod_rasterlite2_la-rl2svg.lo: rl2svg.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2svg.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2svg.Tpo -c -o mod_rasterlite2_la-rl2svg.lo `test -f 'rl2svg.c' || echo '$(srcdir)/'`rl2svg.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2svg.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2svg.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2svg.c' object='mod_rasterlite2_la-rl2svg.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2svg.lo `test -f 'rl2svg.c' || echo '$(srcdir)/'`rl2svg.c
+
+mod_rasterlite2_la-rl2svgxml.lo: rl2svgxml.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2svgxml.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2svgxml.Tpo -c -o mod_rasterlite2_la-rl2svgxml.lo `test -f 'rl2svgxml.c' || echo '$(srcdir)/'`rl2svgxml.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2svgxml.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2svgxml.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2svgxml.c' object='mod_rasterlite2_la-rl2svgxml.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2svgxml.lo `test -f 'rl2svgxml.c' || echo '$(srcdir)/'`rl2svgxml.c
+
+mod_rasterlite2_la-rl2svgaux.lo: rl2svgaux.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2svgaux.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2svgaux.Tpo -c -o mod_rasterlite2_la-rl2svgaux.lo `test -f 'rl2svgaux.c' || echo '$(srcdir)/'`rl2svgaux.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2svgaux.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2svgaux.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2svgaux.c' object='mod_rasterlite2_la-rl2svgaux.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2svgaux.lo `test -f 'rl2svgaux.c' || echo '$(srcdir)/'`rl2svgaux.c
+
+mod_rasterlite2_la-rl2symbolizer.lo: rl2symbolizer.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2symbolizer.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2symbolizer.Tpo -c -o mod_rasterlite2_la-rl2symbolizer.lo `test -f 'rl2symbolizer.c' || echo '$(srcdir)/'`rl2symbolizer.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2symbolizer.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2symbolizer.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2symbolizer.c' object='mod_rasterlite2_la-rl2symbolizer.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2symbolizer.lo `test -f 'rl2symbolizer.c' || echo '$(srcdir)/'`rl2symbolizer.c
+
+mod_rasterlite2_la-rl2rastersym.lo: rl2rastersym.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2rastersym.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2rastersym.Tpo -c -o mod_rasterlite2_la-rl2rastersym.lo `test -f 'rl2rastersym.c' || echo '$(srcdir)/'`rl2rastersym.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2rastersym.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2rastersym.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2rastersym.c' object='mod_rasterlite2_la-rl2rastersym.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2rastersym.lo `test -f 'rl2rastersym.c' || echo '$(srcdir)/'`rl2rastersym.c
+
+mod_rasterlite2_la-rl2version.lo: rl2version.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_rasterlite2_la-rl2version.lo -MD -MP -MF $(DEPDIR)/mod_rasterlite2_la-rl2version.Tpo -c -o mod_rasterlite2_la-rl2version.lo `test -f 'rl2version.c' || echo '$(srcdir)/'`rl2version.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_rasterlite2_la-rl2version.Tpo $(DEPDIR)/mod_rasterlite2_la-rl2version.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rl2version.c' object='mod_rasterlite2_la-rl2version.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(mod_rasterlite2_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_rasterlite2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_rasterlite2_la-rl2version.lo `test -f 'rl2version.c' || echo '$(srcdir)/'`rl2version.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+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
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+ for dir in "$(DESTDIR)$(libdir)"; 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:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+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)
+
+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-libLTLIBRARIES clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+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 -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
+ ctags-am distclean distclean-compile distclean-generic \
+ 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-libLTLIBRARIES install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
+
+
+# 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:
diff --git a/src/rasterlite2.c b/src/rasterlite2.c
new file mode 100644
index 0000000..d63465e
--- /dev/null
+++ b/src/rasterlite2.c
@@ -0,0 +1,2837 @@
+/*
+
+ rasterlite2 -- main public functions
+
+ version 0.1, 2013 March 29
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2_private.h"
+
+static int
+is_valid_sample_type (unsigned char sample_type)
+{
+/* checking a sample-type for validity */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ case RL2_SAMPLE_DOUBLE:
+ return 1;
+ };
+ return 0;
+}
+
+static int
+is_valid_pixel_type (unsigned char pixel_type)
+{
+/* checking a pixel-type for validity */
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_PALETTE:
+ case RL2_PIXEL_GRAYSCALE:
+ case RL2_PIXEL_RGB:
+ case RL2_PIXEL_MULTIBAND:
+ case RL2_PIXEL_DATAGRID:
+ return 1;
+ };
+ return 0;
+}
+
+static int
+is_valid_compression (unsigned char compression)
+{
+/* checking a compression-type for validity */
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ case RL2_COMPRESSION_GIF:
+ case RL2_COMPRESSION_PNG:
+ case RL2_COMPRESSION_JPEG:
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ case RL2_COMPRESSION_CCITTFAX4:
+ return 1;
+ };
+ return 0;
+}
+
+static int
+check_coverage_self_consistency (unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_samples,
+ unsigned char compression)
+{
+/* checking overall self-consistency for coverage params */
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (sample_type != RL2_SAMPLE_1_BIT || num_samples != 1)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_PNG:
+ case RL2_COMPRESSION_CCITTFAX4:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 1)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_GIF:
+ case RL2_COMPRESSION_PNG:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 1)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ case RL2_COMPRESSION_GIF:
+ case RL2_COMPRESSION_PNG:
+ case RL2_COMPRESSION_JPEG:
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ case RL2_PIXEL_RGB:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_UINT16:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 3)
+ return 0;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ {
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ break;
+ default:
+ return 0;
+ };
+ }
+ else
+ {
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ case RL2_COMPRESSION_PNG:
+ case RL2_COMPRESSION_JPEG:
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ break;
+ default:
+ return 0;
+ };
+ }
+ break;
+ case RL2_PIXEL_MULTIBAND:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_UINT16:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples < 2)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ case RL2_PIXEL_DATAGRID:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ case RL2_SAMPLE_DOUBLE:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 1)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ };
+ return 1;
+}
+
+static int
+check_raster_self_consistency (unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_samples)
+{
+/* checking overall self-consistency for raster params */
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (sample_type != RL2_SAMPLE_1_BIT || num_samples != 1)
+ return 0;
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 1)
+ return 0;
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_UINT16:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 1)
+ return 0;
+ break;
+ case RL2_PIXEL_RGB:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_UINT16:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 3)
+ return 0;
+ break;
+ case RL2_PIXEL_MULTIBAND:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_UINT16:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples < 2)
+ return 0;
+ break;
+ case RL2_PIXEL_DATAGRID:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ case RL2_SAMPLE_DOUBLE:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 1)
+ return 0;
+ break;
+ };
+ return 1;
+}
+
+RL2_DECLARE void
+rl2_free (void *ptr)
+{
+/* memory cleanup - generic free */
+ if (ptr != NULL)
+ free (ptr);
+}
+
+static int
+check_coverage_no_data (rl2PrivPixelPtr pxl_no_data, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_samples)
+{
+/* checking if the NoData pixel is consistent with the Coverage */
+ if (pxl_no_data == NULL)
+ return 1;
+ if (pxl_no_data->sampleType != sample_type)
+ return 0;
+ if (pxl_no_data->pixelType != pixel_type)
+ return 0;
+ if (pxl_no_data->nBands != num_samples)
+ return 0;
+ return 1;
+}
+
+RL2_DECLARE rl2CoveragePtr
+rl2_create_coverage (const char *name, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_samples,
+ unsigned char compression, int quality,
+ unsigned int tile_width, unsigned int tile_height,
+ rl2PixelPtr no_data)
+{
+/* allocating and initializing a Coverage object */
+ int len;
+ rl2PrivPixelPtr pxl_no_data = (rl2PrivPixelPtr) no_data;
+ rl2PrivCoveragePtr cvg = NULL;
+ if (name == NULL)
+ return NULL;
+ if (!is_valid_sample_type (sample_type))
+ return NULL;
+ if (!is_valid_pixel_type (pixel_type))
+ return NULL;
+ if (!is_valid_compression (compression))
+ return NULL;
+ if (!check_coverage_self_consistency
+ (sample_type, pixel_type, num_samples, compression))
+ return NULL;
+ if (tile_width < 256 || tile_width > 1024)
+ return NULL;
+ if (tile_height < 256 || tile_height > 1024)
+ return NULL;
+ if ((tile_width % 16) != 0)
+ return NULL;
+ if ((tile_height % 16) != 0)
+ return NULL;
+ if (!check_coverage_no_data
+ (pxl_no_data, sample_type, pixel_type, num_samples))
+ return NULL;
+
+ cvg = malloc (sizeof (rl2PrivCoverage));
+ if (cvg == NULL)
+ return NULL;
+ len = strlen (name);
+ cvg->coverageName = malloc (len + 1);
+ strcpy (cvg->coverageName, name);
+ cvg->sampleType = sample_type;
+ cvg->pixelType = pixel_type;
+ cvg->nBands = num_samples;
+ cvg->Compression = compression;
+ if (quality < 0)
+ cvg->Quality = 0;
+ else if (quality > 100)
+ cvg->Quality = 100;
+ else
+ cvg->Quality = quality;
+ cvg->tileWidth = tile_width;
+ cvg->tileHeight = tile_height;
+ cvg->Srid = RL2_GEOREFERENCING_NONE;
+ cvg->hResolution = 1.0;
+ cvg->vResolution = 1.0;
+ cvg->noData = pxl_no_data;
+ return (rl2CoveragePtr) cvg;
+}
+
+RL2_DECLARE void
+rl2_destroy_coverage (rl2CoveragePtr ptr)
+{
+/* memory cleanup - destroying a Coverage object */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return;
+ if (cvg->coverageName != NULL)
+ free (cvg->coverageName);
+ if (cvg->noData != NULL)
+ rl2_destroy_pixel ((rl2PixelPtr) (cvg->noData));
+ free (cvg);
+}
+
+RL2_DECLARE int
+rl2_coverage_georeference (rl2CoveragePtr ptr, int srid, double horz_res,
+ double vert_res)
+{
+/* setting the Coverage's georeferencing infos */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return RL2_ERROR;
+ cvg->Srid = srid;
+ cvg->hResolution = horz_res;
+ cvg->vResolution = vert_res;
+ return RL2_OK;
+}
+
+RL2_DECLARE const char *
+rl2_get_coverage_name (rl2CoveragePtr ptr)
+{
+/* return the Coverage name */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return NULL;
+ return cvg->coverageName;
+}
+
+RL2_DECLARE int
+rl2_get_coverage_type (rl2CoveragePtr ptr, unsigned char *sample_type,
+ unsigned char *pixel_type, unsigned char *num_bands)
+{
+/* return the Coverage type */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return RL2_ERROR;
+ *sample_type = cvg->sampleType;
+ *pixel_type = cvg->pixelType;
+ *num_bands = cvg->nBands;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_coverage_compression (rl2CoveragePtr ptr, unsigned char *compression,
+ int *quality)
+{
+/* return the Coverage compression */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return RL2_ERROR;
+ *compression = cvg->Compression;
+ *quality = cvg->Quality;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_coverage_uncompressed (rl2CoveragePtr ptr, int *is_uncompressed)
+{
+/* tests if Coverage is compressed */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return RL2_ERROR;
+ if (cvg->Compression == RL2_COMPRESSION_NONE)
+ *is_uncompressed = RL2_TRUE;
+ else
+ *is_uncompressed = RL2_FALSE;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_coverage_compression_lossless (rl2CoveragePtr ptr, int *is_lossless)
+{
+/* tests if Coverage is lossless compressed */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return RL2_ERROR;
+ switch (cvg->Compression)
+ {
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ case RL2_COMPRESSION_GIF:
+ case RL2_COMPRESSION_PNG:
+ *is_lossless = RL2_TRUE;
+ break;
+ default:
+ *is_lossless = RL2_FALSE;
+ break;
+ };
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_coverage_compression_lossy (rl2CoveragePtr ptr, int *is_lossy)
+{
+/* tests if Coverage is lossy compressed */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return RL2_ERROR;
+ switch (cvg->Compression)
+ {
+ case RL2_COMPRESSION_JPEG:
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ *is_lossy = RL2_TRUE;
+ break;
+ default:
+ *is_lossy = RL2_FALSE;
+ break;
+ };
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_coverage_tile_size (rl2CoveragePtr ptr, unsigned int *tile_width,
+ unsigned int *tile_height)
+{
+/* return the Coverage tile width */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return RL2_ERROR;
+ *tile_width = cvg->tileWidth;
+ *tile_height = cvg->tileHeight;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2PixelPtr
+rl2_get_coverage_no_data (rl2CoveragePtr ptr)
+{
+/* return the Coverage NoData pixel (if any) */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return NULL;
+ return (rl2PixelPtr) (cvg->noData);
+}
+
+RL2_DECLARE rl2PixelPtr
+rl2_create_coverage_pixel (rl2CoveragePtr ptr)
+{
+/* creating a Pixel matching the given Coverage */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return NULL;
+ return rl2_create_pixel (cvg->sampleType, cvg->pixelType, cvg->nBands);
+}
+
+RL2_DECLARE int
+rl2_get_coverage_srid (rl2CoveragePtr ptr, int *srid)
+{
+/* return the Coverage SRID */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return RL2_ERROR;
+ *srid = cvg->Srid;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_coverage_resolution (rl2CoveragePtr ptr, double *hResolution,
+ double *vResolution)
+{
+/* return the Coverage SRID */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) ptr;
+ if (cvg == NULL)
+ return RL2_ERROR;
+ *hResolution = cvg->hResolution;
+ *vResolution = cvg->vResolution;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2SectionPtr
+rl2_create_section (const char *name, unsigned char compression,
+ unsigned int tile_width, unsigned int tile_height,
+ rl2RasterPtr rst)
+{
+/* allocating and initializing a Section object */
+ int len;
+ rl2PrivRasterPtr raster = (rl2PrivRasterPtr) rst;
+ rl2PrivSectionPtr scn = NULL;
+ if (name == NULL)
+ return NULL;
+ if (raster == NULL)
+ return NULL;
+ if (!check_coverage_self_consistency
+ (raster->sampleType, raster->pixelType, raster->nBands, compression))
+ return NULL;
+ if (tile_width == RL2_TILESIZE_UNDEFINED
+ && tile_height == RL2_TILESIZE_UNDEFINED)
+ ;
+ else
+ {
+ if (tile_width < 256 || tile_width > 1024)
+ return NULL;
+ if (tile_height < 256 || tile_height > 1024)
+ return NULL;
+ if ((tile_width % 16) != 0)
+ return NULL;
+ if ((tile_height % 16) != 0)
+ return NULL;
+ }
+
+ scn = malloc (sizeof (rl2PrivSection));
+ if (scn == NULL)
+ return NULL;
+ len = strlen (name);
+ scn->sectionName = malloc (len + 1);
+ strcpy (scn->sectionName, name);
+ scn->Compression = compression;
+ scn->tileWidth = tile_width;
+ scn->tileHeight = tile_height;
+ scn->Raster = raster;
+ return (rl2SectionPtr) scn;
+}
+
+RL2_DECLARE void
+rl2_destroy_section (rl2SectionPtr ptr)
+{
+/* memory cleanup - destroying a Section object */
+ rl2PrivSectionPtr scn = (rl2PrivSectionPtr) ptr;
+ if (scn == NULL)
+ return;
+ if (scn->sectionName != NULL)
+ free (scn->sectionName);
+ if (scn->Raster != NULL)
+ rl2_destroy_raster ((rl2RasterPtr) (scn->Raster));
+ free (scn);
+}
+
+RL2_DECLARE const char *
+rl2_get_section_name (rl2SectionPtr ptr)
+{
+/* return the Section name */
+ rl2PrivSectionPtr scn = (rl2PrivSectionPtr) ptr;
+ if (scn == NULL)
+ return NULL;
+ return scn->sectionName;
+}
+
+RL2_DECLARE int
+rl2_get_section_compression (rl2SectionPtr ptr, unsigned char *compression)
+{
+/* return the Section compression */
+ rl2PrivSectionPtr scn = (rl2PrivSectionPtr) ptr;
+ if (scn == NULL)
+ return RL2_ERROR;
+ *compression = scn->Compression;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_section_uncompressed (rl2SectionPtr ptr, int *is_uncompressed)
+{
+/* tests if Section is compressed */
+ rl2PrivSectionPtr scn = (rl2PrivSectionPtr) ptr;
+ if (scn == NULL)
+ return RL2_ERROR;
+ if (scn->Compression == RL2_COMPRESSION_NONE)
+ *is_uncompressed = RL2_TRUE;
+ else
+ *is_uncompressed = RL2_FALSE;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_section_compression_lossless (rl2SectionPtr ptr, int *is_lossless)
+{
+/* tests if Section is lossless compressed */
+ rl2PrivSectionPtr scn = (rl2PrivSectionPtr) ptr;
+ if (scn == NULL)
+ return RL2_ERROR;
+ switch (scn->Compression)
+ {
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ case RL2_COMPRESSION_GIF:
+ case RL2_COMPRESSION_PNG:
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ *is_lossless = RL2_TRUE;
+ break;
+ default:
+ *is_lossless = RL2_FALSE;
+ break;
+ };
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_section_compression_lossy (rl2SectionPtr ptr, int *is_lossy)
+{
+/* tests if Section is lossy compressed */
+ rl2PrivSectionPtr scn = (rl2PrivSectionPtr) ptr;
+ if (scn == NULL)
+ return RL2_ERROR;
+ switch (scn->Compression)
+ {
+ case RL2_COMPRESSION_JPEG:
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ *is_lossy = RL2_TRUE;
+ break;
+ default:
+ *is_lossy = RL2_FALSE;
+ break;
+ };
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_section_tile_size (rl2SectionPtr ptr, unsigned int *tile_width,
+ unsigned int *tile_height)
+{
+/* return the Section tile width */
+ rl2PrivSectionPtr scn = (rl2PrivSectionPtr) ptr;
+ if (scn == NULL)
+ return RL2_ERROR;
+ *tile_width = scn->tileWidth;
+ *tile_height = scn->tileHeight;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_get_section_raster (rl2SectionPtr ptr)
+{
+/* return the Section Raster */
+ rl2PrivSectionPtr scn = (rl2PrivSectionPtr) ptr;
+ if (scn == NULL)
+ return NULL;
+ return (rl2RasterPtr) (scn->Raster);
+}
+
+int
+compute_raster_buffer_size (unsigned short width, unsigned short height,
+ unsigned char sample_type,
+ unsigned char num_samples)
+{
+/* determining the pixel buffer size */
+ int pixel_size = 1;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pixel_size = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pixel_size = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pixel_size = 8;
+ break;
+ };
+ return width * height * pixel_size * num_samples;
+}
+
+static int
+check_raster_no_data (rl2PrivPixelPtr pxl_no_data, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_samples)
+{
+/* checking if the NoData pixel is consistent with the Raster */
+ if (pxl_no_data == NULL)
+ return 1;
+ if (pxl_no_data->sampleType != sample_type)
+ return 0;
+ if (pxl_no_data->pixelType != pixel_type)
+ return 0;
+ if (pxl_no_data->nBands != num_samples)
+ return 0;
+ return 1;
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_create_raster (unsigned int width, unsigned int height,
+ unsigned char sample_type, unsigned char pixel_type,
+ unsigned char num_samples, unsigned char *bufpix,
+ int bufpix_size, rl2PalettePtr palette, unsigned char *mask,
+ int mask_size, rl2PixelPtr no_data)
+{
+/* allocating and initializing a Raster object */
+ rl2PrivPixelPtr pxl_no_data = (rl2PrivPixelPtr) no_data;
+ unsigned char *p;
+ unsigned int row;
+ unsigned int col;
+ int raster_size;
+ rl2PrivRasterPtr rst = NULL;
+
+ if (!is_valid_sample_type (sample_type))
+ return NULL;
+ if (!is_valid_pixel_type (pixel_type))
+ return NULL;
+ if (!check_raster_self_consistency (sample_type, pixel_type, num_samples))
+ return NULL;
+ if (width < 1 || height < 1)
+ return NULL;
+ raster_size =
+ compute_raster_buffer_size (width, height, sample_type, num_samples);
+ if (bufpix == NULL)
+ return NULL;
+ if (raster_size != bufpix_size)
+ return NULL;
+ if (pixel_type == RL2_PIXEL_PALETTE && palette == NULL)
+ return NULL;
+ if (palette != NULL && pixel_type != RL2_PIXEL_PALETTE)
+ return NULL;
+ if (!check_raster_no_data
+ (pxl_no_data, sample_type, pixel_type, num_samples))
+ return NULL;
+ if (mask != NULL)
+ {
+ /* checking the mask size */
+ if (width * height != (unsigned int) mask_size)
+ return NULL;
+ p = mask;
+ for (row = 0; row < height; row++)
+ {
+ /* checking if sample doesn't exceed the max value */
+ for (col = 0; col < width; col++)
+ {
+ if (*p++ > 1)
+ return NULL;
+ }
+ }
+ }
+ if (palette != NULL)
+ {
+ /* checking the Palette for validity */
+ unsigned short max_palette;
+ rl2_get_palette_entries (palette, &max_palette);
+ p = bufpix;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (*p++ >= max_palette)
+ return NULL;
+ }
+ }
+ }
+ switch (sample_type)
+ {
+ /* checking if sample doesn't exceed the max value for #bits */
+ case RL2_SAMPLE_1_BIT:
+ p = bufpix;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (*p++ > 1)
+ return NULL;
+ }
+ }
+ break;
+ case RL2_SAMPLE_2_BIT:
+ p = bufpix;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (*p++ > 3)
+ return NULL;
+ }
+ }
+ break;
+ case RL2_SAMPLE_4_BIT:
+ p = bufpix;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (*p++ > 15)
+ return NULL;
+ }
+ }
+ break;
+ };
+
+ rst = malloc (sizeof (rl2PrivRaster));
+ if (rst == NULL)
+ return NULL;
+ rst->sampleType = sample_type;
+ rst->pixelType = pixel_type;
+ rst->nBands = num_samples;
+ rst->width = width;
+ rst->height = height;
+ rst->Srid = RL2_GEOREFERENCING_NONE;
+ rst->minX = 0.0;
+ rst->minY = 0.0;
+ rst->maxX = width;
+ rst->maxY = height;
+ rst->rasterBuffer = bufpix;
+ rst->maskBuffer = mask;
+ rst->Palette = (rl2PrivPalettePtr) palette;
+ rst->noData = pxl_no_data;
+ return (rl2RasterPtr) rst;
+}
+
+RL2_DECLARE void
+rl2_destroy_raster (rl2RasterPtr ptr)
+{
+/* memory cleanup - destroying a Raster object */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst == NULL)
+ return;
+ if (rst->rasterBuffer != NULL)
+ free (rst->rasterBuffer);
+ if (rst->maskBuffer != NULL)
+ free (rst->maskBuffer);
+ if (rst->Palette != NULL)
+ rl2_destroy_palette ((rl2PalettePtr) (rst->Palette));
+ if (rst->noData != NULL)
+ rl2_destroy_pixel ((rl2PixelPtr) (rst->noData));
+ free (rst);
+}
+
+RL2_DECLARE int
+rl2_set_raster_no_data (rl2RasterPtr ptr, rl2PixelPtr no_data)
+{
+/* explicitly sets the Raster NoData pixel */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ rl2PrivPixelPtr pxl_no_data = (rl2PrivPixelPtr) no_data;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_raster_no_data
+ (pxl_no_data, rst->sampleType, rst->pixelType, rst->nBands))
+ return RL2_ERROR;
+ if (rst->noData != NULL)
+ rl2_destroy_pixel ((rl2PixelPtr) (rst->noData));
+ rst->noData = pxl_no_data;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2PixelPtr
+rl2_get_raster_no_data (rl2RasterPtr ptr)
+{
+/* return the Raster NoData pixel (if any) */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst == NULL)
+ return NULL;
+ return (rl2PixelPtr) (rst->noData);
+}
+
+RL2_DECLARE int
+rl2_get_raster_type (rl2RasterPtr ptr, unsigned char *sample_type,
+ unsigned char *pixel_type, unsigned char *num_bands)
+{
+/* return the Raster type */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst == NULL)
+ return RL2_ERROR;
+ *sample_type = rst->sampleType;
+ *pixel_type = rst->pixelType;
+ *num_bands = rst->nBands;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_raster_size (rl2RasterPtr ptr, unsigned int *width,
+ unsigned int *height)
+{
+/* return the Raster width and height */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst == NULL)
+ return RL2_ERROR;
+ *width = rst->width;
+ *height = rst->height;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_raster_srid (rl2RasterPtr ptr, int *srid)
+{
+/* return the Raster SRID */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst == NULL)
+ return RL2_ERROR;
+ *srid = rst->Srid;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_raster_extent (rl2RasterPtr ptr, double *minX, double *minY,
+ double *maxX, double *maxY)
+{
+/* return the Raster Min X coord */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (rst->Srid == RL2_GEOREFERENCING_NONE)
+ {
+ *minX = 0.0;
+ *minY = 0.0;
+ *maxX = rst->width;
+ *maxY = rst->height;
+ return RL2_OK;
+ }
+ *minX = rst->minX;
+ *minY = rst->minY;
+ *maxX = rst->maxX;
+ *maxY = rst->maxY;
+ return RL2_OK;
+}
+
+RL2_DECLARE gaiaGeomCollPtr
+rl2_get_raster_bbox (rl2RasterPtr ptr)
+{
+/* return the Raster BBox [envelope] */
+ gaiaGeomCollPtr geom;
+ gaiaPolygonPtr pg;
+ gaiaRingPtr rng;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst == NULL)
+ return NULL;
+ if (rst->Srid == RL2_GEOREFERENCING_NONE)
+ return NULL;
+ geom = gaiaAllocGeomColl ();
+ geom->Srid = rst->Srid;
+ pg = gaiaAddPolygonToGeomColl (geom, 5, 0);
+ rng = pg->Exterior;
+ gaiaSetPoint (rng->Coords, 0, rst->minX, rst->minY);
+ gaiaSetPoint (rng->Coords, 1, rst->maxX, rst->minY);
+ gaiaSetPoint (rng->Coords, 2, rst->maxX, rst->maxY);
+ gaiaSetPoint (rng->Coords, 3, rst->minX, rst->maxY);
+ gaiaSetPoint (rng->Coords, 4, rst->minX, rst->minY);
+ return geom;
+}
+
+RL2_DECLARE int
+rl2_get_raster_resolution (rl2RasterPtr ptr, double *hResolution,
+ double *vResolution)
+{
+/* return the Raster resolution */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (rst->Srid == RL2_GEOREFERENCING_NONE)
+ return RL2_ERROR;
+ *hResolution = rst->hResolution;
+ *vResolution = rst->vResolution;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2PalettePtr
+rl2_get_raster_palette (rl2RasterPtr ptr)
+{
+/* return a pointer to the Raster palette */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst == NULL)
+ return NULL;
+ return (rl2PalettePtr) (rst->Palette);
+}
+
+RL2_DECLARE int
+rl2_raster_georeference_center (rl2RasterPtr ptr, int srid, double horz_res,
+ double vert_res, double cx, double cy)
+{
+/* setting the Raster's georeferencing infos - Center Point */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ double hExt;
+ double vExt;
+ if (rst == NULL)
+ return RL2_ERROR;
+ rst->Srid = srid;
+ rst->hResolution = horz_res;
+ rst->vResolution = vert_res;
+ hExt = horz_res * (double) (rst->width) / 2.0;
+ vExt = vert_res * (double) (rst->height) / 2.0;
+ rst->minX = cx - hExt;
+ rst->minY = cy - vExt;
+ rst->maxX = cx + hExt;
+ rst->maxY = cy + vExt;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_georeference_upper_left (rl2RasterPtr ptr, int srid, double horz_res,
+ double vert_res, double x, double y)
+{
+/* setting the Raster's georeferencing infos - UpperLeft corner */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ double hExt;
+ double vExt;
+ if (rst == NULL)
+ return RL2_ERROR;
+ rst->Srid = srid;
+ rst->hResolution = horz_res;
+ rst->vResolution = vert_res;
+ hExt = horz_res * (double) (rst->width);
+ vExt = vert_res * (double) (rst->height);
+ rst->minX = x;
+ rst->minY = y - vExt;
+ rst->maxX = x + hExt;
+ rst->maxY = y;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_georeference_upper_right (rl2RasterPtr ptr, int srid,
+ double horz_res, double vert_res, double x,
+ double y)
+{
+/* setting the Raster's georeferencing infos - UpperRight corner */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ double hExt;
+ double vExt;
+ if (rst == NULL)
+ return RL2_ERROR;
+ rst->Srid = srid;
+ rst->hResolution = horz_res;
+ rst->vResolution = vert_res;
+ hExt = horz_res * (double) (rst->width);
+ vExt = vert_res * (double) (rst->height);
+ rst->minX = x - hExt;
+ rst->minY = y - vExt;
+ rst->maxX = x;
+ rst->maxY = y;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_georeference_lower_left (rl2RasterPtr ptr, int srid, double horz_res,
+ double vert_res, double x, double y)
+{
+/* setting the Raster's georeferencing infos - LowerLeft corner */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ double hExt;
+ double vExt;
+ if (rst == NULL)
+ return RL2_ERROR;
+ rst->Srid = srid;
+ rst->hResolution = horz_res;
+ rst->vResolution = vert_res;
+ hExt = horz_res * (double) (rst->width);
+ vExt = vert_res * (double) (rst->height);
+ rst->minX = x;
+ rst->minY = y;
+ rst->maxX = x + hExt;
+ rst->maxY = y + vExt;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_georeference_lower_right (rl2RasterPtr ptr, int srid,
+ double horz_res, double vert_res, double x,
+ double y)
+{
+/* setting the Raster's georeferencing infos - LowerRight corner */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ double hExt;
+ double vExt;
+ if (rst == NULL)
+ return RL2_ERROR;
+ rst->Srid = srid;
+ rst->hResolution = horz_res;
+ rst->vResolution = vert_res;
+ hExt = horz_res * (double) (rst->width);
+ vExt = vert_res * (double) (rst->height);
+ rst->minX = x - hExt;
+ rst->minY = y;
+ rst->maxX = x;
+ rst->maxY = y + vExt;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_georeference_frame (rl2RasterPtr ptr, int srid, double min_x,
+ double min_y, double max_x, double max_y)
+{
+/* setting the Raster's georeferencing infos - LowerRight corner */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ double hExt;
+ double vExt;
+ double horz_res;
+ double vert_res;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (max_x <= min_x)
+ return RL2_ERROR;
+ if (max_y <= min_y)
+ return RL2_ERROR;
+
+ rst->Srid = srid;
+ rst->minX = min_x;
+ rst->minY = min_y;
+ rst->maxX = max_x;
+ rst->maxY = max_y;
+ hExt = max_x - min_x;
+ vExt = max_y - min_y;
+ horz_res = hExt / (double) (rst->width);
+ vert_res = vExt / (double) (rst->height);
+ rst->hResolution = horz_res;
+ rst->vResolution = vert_res;
+ hExt = horz_res * (double) (rst->width);
+ vExt = vert_res * (double) (rst->height);
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2PalettePtr
+rl2_create_palette (int num_entries)
+{
+/* allocating and initializing a Palette object */
+ int i;
+ rl2PrivPalettePtr plt = NULL;
+ if (num_entries < 0 || num_entries > 256)
+ return NULL;
+
+ plt = malloc (sizeof (rl2PrivPalette));
+ if (plt == NULL)
+ return NULL;
+ plt->nEntries = num_entries;
+ if (num_entries == 0)
+ {
+ plt->entries = NULL;
+ return (rl2PalettePtr) plt;
+ }
+ plt->entries = malloc (sizeof (rl2PrivPaletteEntry) * num_entries);
+ if (plt->entries == NULL)
+ {
+ free (plt);
+ return NULL;
+ }
+ for (i = 0; i < num_entries; i++)
+ {
+ /* setting all entries as BLACK full opaque */
+ rl2PrivPaletteEntryPtr entry = plt->entries + i;
+ entry->red = 0;
+ entry->green = 0;
+ entry->blue = 0;
+ }
+ return (rl2PalettePtr) plt;
+}
+
+RL2_DECLARE void
+rl2_destroy_palette (rl2PalettePtr ptr)
+{
+/* memory cleanup - destroying a Palette object */
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) ptr;
+ if (plt == NULL)
+ return;
+ if (plt->entries != NULL)
+ free (plt->entries);
+ free (plt);
+}
+
+RL2_DECLARE rl2PalettePtr
+rl2_clone_palette (rl2PalettePtr in)
+{
+/* cloning a Palette object */
+ rl2PrivPalettePtr plt_in = (rl2PrivPalettePtr) in;
+ rl2PalettePtr out;
+ rl2PrivPalettePtr plt_out;
+ int i;
+ if (in == NULL)
+ return NULL;
+ out = rl2_create_palette (plt_in->nEntries);
+ plt_out = (rl2PrivPalettePtr) out;
+ for (i = 0; i < plt_out->nEntries; i++)
+ {
+ rl2PrivPaletteEntryPtr entry_in = plt_in->entries + i;
+ rl2PrivPaletteEntryPtr entry_out = plt_out->entries + i;
+ entry_out->red = entry_in->red;
+ entry_out->green = entry_in->green;
+ entry_out->blue = entry_in->blue;
+ }
+ return out;
+}
+
+RL2_DECLARE int
+rl2_compare_palettes (rl2PalettePtr palette_1, rl2PalettePtr palette_2)
+{
+/* comparing two Palette objects */
+ rl2PrivPalettePtr plt_1 = (rl2PrivPalettePtr) palette_1;
+ rl2PrivPalettePtr plt_2 = (rl2PrivPalettePtr) palette_2;
+ int i;
+ if (plt_1 == NULL || plt_2 == NULL)
+ return 0;
+ if (plt_1->nEntries != plt_2->nEntries)
+ return 0;
+ for (i = 0; i < plt_2->nEntries; i++)
+ {
+ rl2PrivPaletteEntryPtr entry_1 = plt_1->entries + i;
+ rl2PrivPaletteEntryPtr entry_2 = plt_2->entries + i;
+ if (entry_1->red != entry_2->red)
+ return 0;
+ if (entry_1->green != entry_2->green)
+ return 0;
+ if (entry_1->blue != entry_2->blue)
+ return 0;
+ }
+ return 1;
+}
+
+static int
+check_monochrome (int max, unsigned char *red, unsigned char *green,
+ unsigned char *blue)
+{
+/* testing for a MONOCHROME palette */
+ if (max != 2)
+ return 0;
+ if (*(red + 0) != 255 || *(green + 0) != 255 || *(blue + 0) != 255)
+ return 0;
+ if (*(red + 1) != 0 || *(green + 1) != 0 || *(blue + 1) != 0)
+ return 0;
+ return 1;
+}
+
+static int
+check_gray (int max, unsigned char *red, unsigned char *green,
+ unsigned char *blue)
+{
+/* testing for a GRAYSCALE palette */
+ int i;
+ if (max == 4)
+ {
+ /* Gray4 */
+ if (*(red + 0) != 0 || *(green + 0) != 0 || *(blue + 0) != 0)
+ return 0;
+ if (*(red + 1) != 86 || *(green + 1) != 86 || *(blue + 1) != 86)
+ return 0;
+ if (*(red + 2) != 170 || *(green + 2) != 170 || *(blue + 2) != 170)
+ return 0;
+ if (*(red + 3) != 255 || *(green + 3) != 255 || *(blue + 3) != 255)
+ return 0;
+ return 1;
+ }
+ if (max == 16)
+ {
+ /* Gray16 */
+ if (*(red + 0) != 0 || *(green + 0) != 0 || *(blue + 0) != 0)
+ return 0;
+ if (*(red + 1) != 17 || *(green + 1) != 17 || *(blue + 1) != 17)
+ return 0;
+ if (*(red + 2) != 34 || *(green + 2) != 34 || *(blue + 2) != 34)
+ return 0;
+ if (*(red + 3) != 51 || *(green + 3) != 51 || *(blue + 3) != 51)
+ return 0;
+ if (*(red + 4) != 68 || *(green + 4) != 68 || *(blue + 4) != 68)
+ return 0;
+ if (*(red + 5) != 85 || *(green + 5) != 85 || *(blue + 5) != 85)
+ return 0;
+ if (*(red + 6) != 102 || *(green + 6) != 102 || *(blue + 6) != 102)
+ return 0;
+ if (*(red + 7) != 119 || *(green + 7) != 119 || *(blue + 7) != 119)
+ return 0;
+ if (*(red + 8) != 137 || *(green + 8) != 137 || *(blue + 8) != 137)
+ return 0;
+ if (*(red + 9) != 154 || *(green + 9) != 154 || *(blue + 9) != 154)
+ return 0;
+ if (*(red + 10) != 171 || *(green + 10) != 171 || *(blue + 10) != 171)
+ return 0;
+ if (*(red + 11) != 188 || *(green + 11) != 188 || *(blue + 11) != 188)
+ return 0;
+ if (*(red + 12) != 205 || *(green + 12) != 205 || *(blue + 12) != 205)
+ return 0;
+ if (*(red + 13) != 222 || *(green + 13) != 222 || *(blue + 13) != 222)
+ return 0;
+ if (*(red + 14) != 239 || *(green + 14) != 239 || *(blue + 14) != 239)
+ return 0;
+ if (*(red + 15) != 255 || *(green + 15) != 255 || *(blue + 15) != 255)
+ return 0;
+ return 1;
+ }
+ if (max == 256)
+ {
+ /* Gray256 */
+ for (i = 0; i < max; i++)
+ {
+ if (*(red + i) != i || *(green + i) != i || *(blue + i) != i)
+ return 0;
+ }
+ return 1;
+ }
+ return 0;
+}
+
+RL2_DECLARE int
+rl2_get_palette_type (rl2PalettePtr ptr, unsigned char *sample_type,
+ unsigned char *pixel_type)
+{
+/* retrieving the palette type */
+ unsigned char red[256];
+ unsigned char green[256];
+ unsigned char blue[256];
+ int max = 0;
+ int index;
+ int i;
+ int already_defined;
+ rl2PrivPaletteEntryPtr entry;
+ rl2PrivPalettePtr palette = (rl2PrivPalettePtr) ptr;
+ if (palette == NULL)
+ return RL2_ERROR;
+
+ for (index = 0; index < palette->nEntries; index++)
+ {
+ /* normalizing the palette, so to avoid duplicate colors */
+ already_defined = 0;
+ entry = palette->entries + index;
+ for (i = 0; i < max; i++)
+ {
+ if (entry->red == red[i] && entry->green == green[i]
+ && entry->blue == blue[i])
+ {
+ already_defined = 1;
+ break;
+ }
+ }
+ if (!already_defined)
+ {
+ /* inserting a normalized color */
+ red[max] = entry->red;
+ green[max] = entry->green;
+ blue[max] = entry->blue;
+ max++;
+ }
+ }
+ if (max <= 2)
+ *sample_type = RL2_SAMPLE_1_BIT;
+ else if (max <= 4)
+ *sample_type = RL2_SAMPLE_2_BIT;
+ else if (max <= 16)
+ *sample_type = RL2_SAMPLE_4_BIT;
+ else
+ *sample_type = RL2_SAMPLE_UINT8;
+ *pixel_type = RL2_PIXEL_PALETTE;
+ if (check_monochrome (max, red, green, blue))
+ *pixel_type = RL2_PIXEL_MONOCHROME;
+ else if (check_gray (max, red, green, blue))
+ *pixel_type = RL2_PIXEL_GRAYSCALE;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_palette_color (rl2PalettePtr ptr, int index, unsigned char r,
+ unsigned char g, unsigned char b)
+{
+/* setting a Palette entry */
+ rl2PrivPaletteEntryPtr entry;
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) ptr;
+ if (plt == NULL)
+ return RL2_ERROR;
+ if (index < 0 || index >= plt->nEntries)
+ return RL2_ERROR;
+ entry = plt->entries + index;
+ entry->red = r;
+ entry->green = g;
+ entry->blue = b;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_palette_index (rl2PalettePtr ptr, unsigned char *index, unsigned char r,
+ unsigned char g, unsigned char b)
+{
+/* finding the index corresponding to the given color (if any) */
+ int i;
+ rl2PrivPaletteEntryPtr entry;
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) ptr;
+ if (plt == NULL)
+ return RL2_ERROR;
+ for (i = 0; i < plt->nEntries; i++)
+ {
+ entry = plt->entries + i;
+ if (entry->red == r && entry->green == g && entry->blue == b)
+ {
+ *index = i;
+ return RL2_OK;
+ }
+ }
+ return RL2_ERROR;
+}
+
+static int
+parse_hex (unsigned char hi, unsigned char lo, unsigned char *x)
+{
+/* parsing an Hex Byte */
+ unsigned char res;
+ switch (hi)
+ {
+ case '0':
+ res = 0;
+ break;
+ case '1':
+ res = 16;
+ break;
+ case '2':
+ res = 2 * 16;
+ break;
+ case '3':
+ res = 3 * 16;
+ break;
+ case '4':
+ res = 4 * 16;
+ break;
+ case '5':
+ res = 5 * 16;
+ break;
+ case '6':
+ res = 6 * 16;
+ break;
+ case '7':
+ res = 7 * 16;
+ break;
+ case '8':
+ res = 8 * 16;
+ break;
+ case '9':
+ res = 9 * 16;
+ break;
+ case 'a':
+ case 'A':
+ res = 10 * 16;
+ break;
+ case 'b':
+ case 'B':
+ res = 11 * 16;
+ break;
+ case 'c':
+ case 'C':
+ res = 12 * 16;
+ break;
+ case 'd':
+ case 'D':
+ res = 13 * 16;
+ break;
+ case 'e':
+ case 'E':
+ res = 14 * 16;
+ break;
+ case 'f':
+ case 'F':
+ res = 15 * 16;
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ switch (lo)
+ {
+ case '0':
+ break;
+ case '1':
+ res += 1;
+ break;
+ case '2':
+ res += 2;
+ break;
+ case '3':
+ res += 3;
+ break;
+ case '4':
+ res += 4;
+ break;
+ case '5':
+ res += 5;
+ break;
+ case '6':
+ res += 6;
+ break;
+ case '7':
+ res += 7;
+ break;
+ case '8':
+ res += 8;
+ break;
+ case '9':
+ res += 9;
+ break;
+ case 'a':
+ case 'A':
+ res += 10;
+ break;
+ case 'b':
+ case 'B':
+ res += 11;
+ break;
+ case 'c':
+ case 'C':
+ res += 12;
+ break;
+ case 'd':
+ case 'D':
+ res += 13;
+ break;
+ case 'e':
+ case 'E':
+ res += 14;
+ break;
+ case 'f':
+ case 'F':
+ res += 15;
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ *x = res;
+ return RL2_OK;
+}
+
+static int
+parse_hex_rgb (const char *hex, unsigned char *r, unsigned char *g,
+ unsigned char *b)
+{
+/* parsing an Hex RGB */
+ if (parse_hex (*(hex + 0), *(hex + 1), r) != RL2_OK)
+ goto error;
+ if (parse_hex (*(hex + 2), *(hex + 3), g) != RL2_OK)
+ goto error;
+ if (parse_hex (*(hex + 4), *(hex + 5), b) != RL2_OK)
+ goto error;
+ return RL2_OK;
+ error:
+ *r = 0;
+ *g = 0;
+ *b = 0;
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_parse_hexrgb (const char *hex, unsigned char *red, unsigned char *green,
+ unsigned char *blue)
+{
+/* setting a Palette entry */
+ if (hex == NULL)
+ return RL2_ERROR;
+ if (strlen (hex) != 7)
+ return RL2_ERROR;
+ if (*hex != '#')
+ return RL2_ERROR;
+ if (parse_hex_rgb (hex + 1, red, green, blue) != RL2_OK)
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_palette_hexrgb (rl2PalettePtr ptr, int index, const char *hex)
+{
+/* setting a Palette entry */
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ rl2PrivPaletteEntryPtr entry;
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) ptr;
+ if (plt == NULL)
+ return RL2_ERROR;
+ if (index < 0 || index >= plt->nEntries)
+ return RL2_ERROR;
+ if (hex == NULL)
+ return RL2_ERROR;
+ if (strlen (hex) != 7)
+ return RL2_ERROR;
+ if (*hex != '#')
+ return RL2_ERROR;
+ if (parse_hex_rgb (hex + 1, &r, &g, &b) != RL2_OK)
+ return RL2_ERROR;
+ entry = plt->entries + index;
+ entry->red = r;
+ entry->green = g;
+ entry->blue = b;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_palette_entries (rl2PalettePtr ptr, unsigned short *num_entries)
+{
+/* return the Palette entries count */
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) ptr;
+ if (plt == NULL)
+ return RL2_ERROR;
+ *num_entries = plt->nEntries;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_palette_colors (rl2PalettePtr ptr, unsigned short *num_entries,
+ unsigned char **r, unsigned char **g, unsigned char **b)
+{
+/* return the Palette colors */
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) ptr;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+ int i;
+ *num_entries = 0;
+ *r = NULL;
+ *g = NULL;
+ *b = NULL;
+ if (plt == NULL)
+ return RL2_ERROR;
+ red = malloc (plt->nEntries);
+ green = malloc (plt->nEntries);
+ blue = malloc (plt->nEntries);
+ if (red == NULL || green == NULL || blue == NULL)
+ {
+ if (red != NULL)
+ free (red);
+ if (green != NULL)
+ free (green);
+ if (blue != NULL)
+ free (blue);
+ return RL2_ERROR;
+ }
+ for (i = 0; i < plt->nEntries; i++)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + i;
+ *(red + i) = entry->red;
+ *(green + i) = entry->green;
+ *(blue + i) = entry->blue;
+ }
+ *num_entries = plt->nEntries;
+ *r = red;
+ *g = green;
+ *b = blue;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2PixelPtr
+rl2_create_pixel (unsigned char sample_type, unsigned char pixel_type,
+ unsigned char num_samples)
+{
+/* allocating and initializing a Pixel object */
+ int nBand;
+ rl2PrivPixelPtr pxl = NULL;
+ if (!is_valid_sample_type (sample_type))
+ return NULL;
+ if (!is_valid_pixel_type (pixel_type))
+ return NULL;
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_PALETTE:
+ case RL2_PIXEL_GRAYSCALE:
+ case RL2_PIXEL_DATAGRID:
+ if (num_samples != 1)
+ return NULL;
+ break;
+ case RL2_PIXEL_RGB:
+ if (num_samples != 3)
+ return NULL;
+ break;
+ case RL2_PIXEL_MULTIBAND:
+ if (num_samples < 2)
+ return NULL;
+ break;
+ };
+
+ pxl = malloc (sizeof (rl2PrivPixel));
+ if (pxl == NULL)
+ return NULL;
+ pxl->sampleType = sample_type;
+ pxl->pixelType = pixel_type;
+ pxl->nBands = num_samples;
+ pxl->isTransparent = 0;
+ pxl->Samples = malloc (sizeof (rl2PrivSample) * num_samples);
+ if (pxl->Samples == NULL)
+ {
+ free (pxl);
+ return NULL;
+ }
+ for (nBand = 0; nBand < num_samples; nBand++)
+ {
+ /* initializing all samples as ZERO */
+ rl2PrivSamplePtr sample = pxl->Samples + nBand;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ sample->uint8 = 0;
+ break;
+ case RL2_SAMPLE_INT8:
+ sample->int8 = 0;
+ break;
+ case RL2_SAMPLE_INT16:
+ sample->int16 = 0;
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample->uint16 = 0;
+ break;
+ case RL2_SAMPLE_INT32:
+ sample->int32 = 0;
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample->uint32 = 0;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample->float32 = 0.0;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample->float64 = 0.0;
+ break;
+ }
+ }
+ return (rl2PixelPtr) pxl;
+}
+
+RL2_DECLARE rl2PixelPtr
+rl2_clone_pixel (rl2PixelPtr org)
+{
+/* cloning a Pixel object */
+ int b;
+ rl2PixelPtr dst;
+ rl2PrivPixelPtr px_out;
+ rl2PrivPixelPtr px_in = (rl2PrivPixelPtr) org;
+ if (px_in == NULL)
+ return NULL;
+ dst = rl2_create_pixel (px_in->sampleType, px_in->pixelType, px_in->nBands);
+ if (dst == NULL)
+ return NULL;
+ px_out = (rl2PrivPixelPtr) dst;
+ for (b = 0; b < px_in->nBands; b++)
+ {
+ /* copying all samples */
+ rl2PrivSamplePtr sample_in = px_in->Samples + b;
+ rl2PrivSamplePtr sample_out = px_out->Samples + b;
+ switch (px_in->sampleType)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ sample_out->uint8 = sample_in->uint8;
+ break;
+ case RL2_SAMPLE_INT8:
+ sample_out->int8 = sample_in->int8;
+ break;
+ case RL2_SAMPLE_INT16:
+ sample_out->int16 = sample_in->int16;
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample_out->uint16 = sample_in->uint16;
+ break;
+ case RL2_SAMPLE_INT32:
+ sample_out->int32 = sample_in->int32;
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample_out->uint32 = sample_in->uint32;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample_out->float32 = sample_in->float32;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample_out->float64 = sample_in->float64;
+ break;
+ }
+ }
+ return dst;
+}
+
+RL2_DECLARE rl2PixelPtr
+rl2_create_triple_band_pixel (rl2PixelPtr org, unsigned char red_band,
+ unsigned char green_band, unsigned char blue_band)
+{
+/* creating a new Pixel object by applying band composing */
+ rl2PrivSamplePtr sample_in;
+ rl2PrivSamplePtr sample_out;
+ rl2PixelPtr dst;
+ rl2PrivPixelPtr px_out;
+ rl2PrivPixelPtr px_in = (rl2PrivPixelPtr) org;
+ if (px_in == NULL)
+ return NULL;
+ if (px_in->sampleType != RL2_SAMPLE_UINT8
+ && px_in->sampleType != RL2_SAMPLE_UINT16)
+ return NULL;
+ if (px_in->pixelType != RL2_PIXEL_RGB
+ && px_in->pixelType != RL2_PIXEL_MULTIBAND)
+ return NULL;
+ if (red_band >= px_in->nBands)
+ return NULL;
+ if (green_band >= px_in->nBands)
+ return NULL;
+ if (blue_band >= px_in->nBands)
+ return NULL;
+ dst = rl2_create_pixel (px_in->sampleType, RL2_PIXEL_RGB, 3);
+ if (dst == NULL)
+ return NULL;
+ px_out = (rl2PrivPixelPtr) dst;
+/* red band */
+ sample_in = px_in->Samples + red_band;
+ sample_out = px_out->Samples + 0;
+ if (px_in->sampleType == RL2_SAMPLE_UINT16)
+ sample_out->uint16 = sample_in->uint16;
+ else
+ sample_out->uint8 = sample_in->uint8;
+/* green band */
+ sample_in = px_in->Samples + green_band;
+ sample_out = px_out->Samples + 1;
+ if (px_in->sampleType == RL2_SAMPLE_UINT16)
+ sample_out->uint16 = sample_in->uint16;
+ else
+ sample_out->uint8 = sample_in->uint8;
+/* blue band */
+ sample_in = px_in->Samples + blue_band;
+ sample_out = px_out->Samples + 2;
+ if (px_in->sampleType == RL2_SAMPLE_UINT16)
+ sample_out->uint16 = sample_in->uint16;
+ else
+ sample_out->uint8 = sample_in->uint8;
+ return dst;
+}
+
+RL2_DECLARE rl2PixelPtr
+rl2_create_mono_band_pixel (rl2PixelPtr org, unsigned char mono_band)
+{
+/* creating a new Pixel object by applying band composing */
+ rl2PrivSamplePtr sample_in;
+ rl2PrivSamplePtr sample_out;
+ rl2PixelPtr dst;
+ rl2PrivPixelPtr px_out;
+ rl2PrivPixelPtr px_in = (rl2PrivPixelPtr) org;
+ if (px_in == NULL)
+ return NULL;
+ if (px_in->sampleType != RL2_SAMPLE_UINT8
+ && px_in->sampleType != RL2_SAMPLE_UINT16)
+ return NULL;
+ if (px_in->pixelType != RL2_PIXEL_RGB
+ && px_in->pixelType != RL2_PIXEL_MULTIBAND)
+ return NULL;
+ if (mono_band >= px_in->nBands)
+ return NULL;
+ if (px_in->sampleType == RL2_SAMPLE_UINT16)
+ dst = rl2_create_pixel (RL2_SAMPLE_UINT16, RL2_PIXEL_DATAGRID, 1);
+ else
+ dst = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3);
+ if (dst == NULL)
+ return NULL;
+ px_out = (rl2PrivPixelPtr) dst;
+/* mono band */
+ sample_in = px_in->Samples + mono_band;
+ sample_out = px_out->Samples + 0;
+ if (px_in->sampleType == RL2_SAMPLE_UINT16)
+ sample_out->uint16 = sample_in->uint16;
+ else
+ sample_out->uint8 = sample_in->uint8;
+ return dst;
+}
+
+RL2_DECLARE void
+rl2_destroy_pixel (rl2PixelPtr ptr)
+{
+/* memory cleanup - destroying a Pixel object */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return;
+ if (pxl->Samples != NULL)
+ free (pxl->Samples);
+ free (pxl);
+}
+
+RL2_DECLARE int
+rl2_compare_pixels (rl2PixelPtr pixel1, rl2PixelPtr pixel2)
+{
+/* comparing if two pixels are the same */
+ int band;
+ rl2PrivPixelPtr pxl1 = (rl2PrivPixelPtr) pixel1;
+ rl2PrivPixelPtr pxl2 = (rl2PrivPixelPtr) pixel2;
+ if (pxl1 == NULL || pxl2 == NULL)
+ return RL2_ERROR;
+ if (pxl1->sampleType != pxl2->sampleType)
+ return RL2_ERROR;
+ if (pxl1->pixelType != pxl2->pixelType)
+ return RL2_ERROR;
+ if (pxl1->nBands != pxl2->nBands)
+ return RL2_ERROR;
+ for (band = 0; band < pxl1->nBands; band++)
+ {
+ rl2PrivSamplePtr sample1 = pxl1->Samples + band;
+ rl2PrivSamplePtr sample2 = pxl2->Samples + band;
+ switch (pxl1->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ if (sample1->int8 != sample2->int8)
+ return RL2_FALSE;
+ break;
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ if (sample1->uint8 != sample2->uint8)
+ return RL2_FALSE;
+ break;
+ case RL2_SAMPLE_INT16:
+ if (sample1->int16 != sample2->int16)
+ return RL2_FALSE;
+ break;
+ case RL2_SAMPLE_UINT16:
+ if (sample1->uint16 != sample2->uint16)
+ return RL2_FALSE;
+ break;
+ case RL2_SAMPLE_INT32:
+ if (sample1->int32 != sample2->int32)
+ return RL2_FALSE;
+ break;
+ case RL2_SAMPLE_UINT32:
+ if (sample1->uint32 != sample2->uint32)
+ return RL2_FALSE;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ if (sample1->float32 != sample2->float32)
+ return RL2_FALSE;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ if (sample1->float64 != sample2->float64)
+ return RL2_FALSE;
+ break;
+ };
+ }
+ if (pxl1->isTransparent != pxl2->isTransparent)
+ return RL2_FALSE;
+ return RL2_TRUE;
+}
+
+
+RL2_DECLARE int
+rl2_get_pixel_type (rl2PixelPtr ptr,
+ unsigned char *sample_type,
+ unsigned char *pixel_type, unsigned char *num_bands)
+{
+/* return the Pixel pixel type */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ *sample_type = pxl->sampleType;
+ *pixel_type = pxl->pixelType;
+ *num_bands = pxl->nBands;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_pixel_sample_1bit (rl2PixelPtr ptr, unsigned char *sample)
+{
+/* get a Pixel/Sample value - 1-BIT */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_1_BIT)
+ return RL2_ERROR;
+ *sample = pxl->Samples->uint8;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_sample_1bit (rl2PixelPtr ptr, unsigned char sample)
+{
+/* set a Pixel/Sample value - 1-BIT */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_1_BIT)
+ return RL2_ERROR;
+ if (sample > 1)
+ return RL2_ERROR;
+ pxl->Samples->uint8 = sample;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_pixel_sample_2bit (rl2PixelPtr ptr, unsigned char *sample)
+{
+/* get a Pixel/Sample value - 2-BIT */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_2_BIT)
+ return RL2_ERROR;
+ *sample = pxl->Samples->uint8;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_sample_2bit (rl2PixelPtr ptr, unsigned char sample)
+{
+/* set a Pixel/Sample value - 2-BIT */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_2_BIT)
+ return RL2_ERROR;
+ if (sample > 3)
+ return RL2_ERROR;
+ pxl->Samples->uint8 = sample;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_pixel_sample_4bit (rl2PixelPtr ptr, unsigned char *sample)
+{
+/* get a Pixel/Sample value - 4-BIT */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_4_BIT)
+ return RL2_ERROR;
+ *sample = pxl->Samples->uint8;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_sample_4bit (rl2PixelPtr ptr, unsigned char sample)
+{
+/* set a Pixel/Sample value - 4-BIT */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_4_BIT)
+ return RL2_ERROR;
+ if (sample > 15)
+ return RL2_ERROR;
+ pxl->Samples->uint8 = sample;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_pixel_sample_int8 (rl2PixelPtr ptr, char *sample)
+{
+/* get a Pixel/Sample value - INT8 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_INT8)
+ return RL2_ERROR;
+ *sample = pxl->Samples->int8;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_sample_int8 (rl2PixelPtr ptr, char sample)
+{
+/* set a Pixel/Sample value - INT8 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_INT8)
+ return RL2_ERROR;
+ pxl->Samples->int8 = sample;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_pixel_sample_uint8 (rl2PixelPtr ptr, int band, unsigned char *sample)
+{
+/* get a Pixel/Sample value - UINT8 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_UINT8)
+ return RL2_ERROR;
+ if (band >= 0 && band < pxl->nBands)
+ {
+ rl2PrivSamplePtr smp = pxl->Samples + band;
+ *sample = smp->uint8;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_sample_uint8 (rl2PixelPtr ptr, int band, unsigned char sample)
+{
+/* set a Pixel/Sample value - UINT8 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_UINT8)
+ return RL2_ERROR;
+ if (band >= 0 && band < pxl->nBands)
+ {
+ rl2PrivSamplePtr smp = pxl->Samples + band;
+ smp->uint8 = sample;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_pixel_sample_int16 (rl2PixelPtr ptr, short *sample)
+{
+/* get a Pixel/Sample value - INT16 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_INT16)
+ return RL2_ERROR;
+ *sample = pxl->Samples->int16;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_sample_int16 (rl2PixelPtr ptr, short sample)
+{
+/* set a Pixel/Sample value - INT16 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_INT16)
+ return RL2_ERROR;
+ pxl->Samples->int16 = sample;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_pixel_sample_uint16 (rl2PixelPtr ptr, int band, unsigned short *sample)
+{
+/* get a Pixel/Sample value - UINT16 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_UINT16)
+ return RL2_ERROR;
+ if (band >= 0 && band < pxl->nBands)
+ {
+ rl2PrivSamplePtr smp = pxl->Samples + band;
+ *sample = smp->uint16;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_sample_uint16 (rl2PixelPtr ptr, int band, unsigned short sample)
+{
+/* set a Pixel/Sample value - UINT16 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_UINT16)
+ return RL2_ERROR;
+ if (band >= 0 && band < pxl->nBands)
+ {
+ rl2PrivSamplePtr smp = pxl->Samples + band;
+ smp->uint16 = sample;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_pixel_sample_int32 (rl2PixelPtr ptr, int *sample)
+{
+/* get a Pixel/Sample value - INT32 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_INT32)
+ return RL2_ERROR;
+ *sample = pxl->Samples->int32;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_sample_int32 (rl2PixelPtr ptr, int sample)
+{
+/* set a Pixel/Sample value - INT32 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_INT32)
+ return RL2_ERROR;
+ pxl->Samples->int32 = sample;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_pixel_sample_uint32 (rl2PixelPtr ptr, unsigned int *sample)
+{
+/* get a Pixel/Sample value - UINT32 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_UINT32)
+ return RL2_ERROR;
+ *sample = pxl->Samples->uint32;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_sample_uint32 (rl2PixelPtr ptr, unsigned int sample)
+{
+/* set a Pixel/Sample value - UINT32 */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_UINT32)
+ return RL2_ERROR;
+ pxl->Samples->uint32 = sample;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_pixel_sample_float (rl2PixelPtr ptr, float *sample)
+{
+/* get a Pixel/Sample value - FLOAT */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_FLOAT)
+ return RL2_ERROR;
+ *sample = pxl->Samples->float32;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_sample_float (rl2PixelPtr ptr, float sample)
+{
+/* set a Pixel/Sample value - FLOAT */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_FLOAT)
+ return RL2_ERROR;
+ pxl->Samples->float32 = sample;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_pixel_sample_double (rl2PixelPtr ptr, double *sample)
+{
+/* get a Pixel/Sample value - DOUBLE */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_DOUBLE)
+ return RL2_ERROR;
+ *sample = pxl->Samples->float64;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_sample_double (rl2PixelPtr ptr, double sample)
+{
+/* set a Pixel/Sample value - DOUBLE */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->sampleType != RL2_SAMPLE_DOUBLE)
+ return RL2_ERROR;
+ pxl->Samples->float64 = sample;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_pixel_transparent (rl2PixelPtr ptr, int *is_transparent)
+{
+/* tests for a transparent pixel */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->isTransparent)
+ *is_transparent = RL2_TRUE;
+ else
+ *is_transparent = RL2_FALSE;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_pixel_opaque (rl2PixelPtr ptr, int *is_opaque)
+{
+/* tests for an opaque pixel */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ if (pxl->isTransparent)
+ *is_opaque = RL2_FALSE;
+ else
+ *is_opaque = RL2_TRUE;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_transparent (rl2PixelPtr ptr)
+{
+/* marks a pixel as transparent */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ pxl->isTransparent = 1;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_pixel_opaque (rl2PixelPtr ptr)
+{
+/* marks a pixel as opaque */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) ptr;
+ if (pxl == NULL)
+ return RL2_ERROR;
+ pxl->isTransparent = 0;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2PixelPtr
+rl2_create_raster_pixel (rl2RasterPtr ptr)
+{
+/* creating a Pixel matching the given Raster */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst == NULL)
+ return NULL;
+ return rl2_create_pixel (rst->sampleType, rst->pixelType, rst->nBands);
+}
+
+RL2_DECLARE int
+rl2_get_raster_pixel (rl2RasterPtr ptr, rl2PixelPtr pixel, unsigned int row,
+ unsigned int col)
+{
+/* fetching a Pixel from a Raster */
+ int nBand;
+ rl2PrivSamplePtr sample;
+ char *p_int8;
+ unsigned char *p_uint8;
+ short *p_int16;
+ unsigned short *p_uint16;
+ int *p_int32;
+ unsigned int *p_uint32;
+ float *p_float32;
+ double *p_float64;
+ unsigned char *mask;
+ unsigned char *p_mask;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) pixel;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (pxl == NULL)
+ return RL2_ERROR;
+
+ if (pxl->sampleType != rst->sampleType || pxl->pixelType != rst->pixelType
+ || pxl->nBands != rst->nBands)
+ return RL2_ERROR;
+ if (row >= rst->height || col >= rst->width)
+ return RL2_ERROR;
+
+ for (nBand = 0; nBand < pxl->nBands; nBand++)
+ {
+ sample = pxl->Samples + nBand;
+ switch (pxl->sampleType)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ p_uint8 = rst->rasterBuffer;
+ p_uint8 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ sample->uint8 = *p_uint8;
+ break;
+ case RL2_SAMPLE_INT8:
+ p_int8 = (char *) (rst->rasterBuffer);
+ p_int8 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ sample->int8 = *p_int8;
+ break;
+ case RL2_SAMPLE_INT16:
+ p_int16 = (short *) (rst->rasterBuffer);
+ p_int16 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ sample->int16 = *p_int16;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_uint16 = (unsigned short *) (rst->rasterBuffer);
+ p_uint16 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ sample->uint16 = *p_uint16;
+ break;
+ case RL2_SAMPLE_INT32:
+ p_int32 = (int *) (rst->rasterBuffer);
+ p_int32 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ sample->int32 = *p_int32;
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_uint32 = (unsigned int *) (rst->rasterBuffer);
+ p_uint32 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ sample->uint32 = *p_uint32;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_float32 = (float *) (rst->rasterBuffer);
+ p_float32 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ sample->float32 = *p_float32;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_float64 = (double *) (rst->rasterBuffer);
+ p_float64 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ sample->float64 = *p_float64;
+ break;
+ };
+ }
+
+/* transparency */
+ pxl->isTransparent = 0;
+ mask = rst->maskBuffer;
+ if (mask != NULL)
+ {
+ /* evaluating transparency mask */
+ p_mask = mask + (row * rst->width) + col;
+ if (*p_mask == 0)
+ pxl->isTransparent = 1;
+ }
+ if (rst->noData != NULL)
+ {
+ /* evaluating transparent color */
+ if (rl2_compare_pixels (pixel, (rl2PixelPtr) (rst->noData)) ==
+ RL2_TRUE)
+ pxl->isTransparent = 1;
+ }
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_set_raster_pixel (rl2RasterPtr ptr, rl2PixelPtr pixel, unsigned int row,
+ unsigned int col)
+{
+/* changing a Pixel into a Raster */
+ int nBand;
+ rl2PrivSamplePtr sample;
+ char *p_int8;
+ unsigned char *p_uint8;
+ short *p_int16;
+ unsigned short *p_uint16;
+ int *p_int32;
+ unsigned int *p_uint32;
+ float *p_float32;
+ double *p_float64;
+ unsigned char *mask;
+ unsigned char *p_mask;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) pixel;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (pxl == NULL)
+ return RL2_ERROR;
+
+ if (pxl->sampleType != rst->sampleType || pxl->pixelType != rst->pixelType
+ || pxl->nBands != rst->nBands)
+ return RL2_ERROR;
+ if (row >= rst->height || col >= rst->width)
+ return RL2_ERROR;
+ if (pxl->pixelType == RL2_PIXEL_PALETTE)
+ {
+ /* blocking any attempt to insert out-palette values */
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) rst->Palette;
+ if (pxl->Samples->uint8 >= plt->nEntries)
+ return RL2_ERROR;
+ }
+
+ for (nBand = 0; nBand < pxl->nBands; nBand++)
+ {
+ sample = pxl->Samples + nBand;
+ switch (pxl->sampleType)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ p_uint8 = rst->rasterBuffer;
+ p_uint8 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ *p_uint8 = sample->uint8;
+ break;
+ case RL2_SAMPLE_INT8:
+ p_int8 = (char *) (rst->rasterBuffer);
+ p_int8 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ *p_int8 = sample->int8;
+ break;
+ case RL2_SAMPLE_INT16:
+ p_int16 = (short *) (rst->rasterBuffer);
+ p_int16 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ *p_int16 = sample->int16;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_uint16 = (unsigned short *) (rst->rasterBuffer);
+ p_uint16 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ *p_uint16 = sample->uint16;
+ break;
+ case RL2_SAMPLE_INT32:
+ p_int32 = (int *) (rst->rasterBuffer);
+ p_int32 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ *p_int32 = sample->int32;
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_uint32 = (unsigned int *) (rst->rasterBuffer);
+ p_uint32 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ *p_uint32 = sample->uint32;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_float32 = (float *) (rst->rasterBuffer);
+ p_float32 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ *p_float32 = sample->float32;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_float64 = (double *) (rst->rasterBuffer);
+ p_float64 +=
+ (row * rst->width * pxl->nBands) + (col * pxl->nBands) +
+ nBand;
+ *p_float64 = sample->float64;
+ break;
+ };
+ }
+
+ mask = rst->maskBuffer;
+ if (mask != NULL)
+ {
+ /* updating the transparency mask */
+ p_mask = mask + (row * rst->width) + col;
+ if (pxl->isTransparent)
+ *p_mask = 0;
+ else
+ *p_mask = 1;
+ }
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2RasterStatisticsPtr
+rl2_create_raster_statistics (unsigned char sample_type,
+ unsigned char num_bands)
+{
+/* allocating and initializing a Raster Statistics object */
+ int i;
+ int j;
+ int nHistogram;
+ rl2PrivRasterStatisticsPtr stats = NULL;
+ if (num_bands == 0)
+ return NULL;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ nHistogram = 2;
+ break;
+ case RL2_SAMPLE_2_BIT:
+ nHistogram = 4;
+ break;
+ case RL2_SAMPLE_4_BIT:
+ nHistogram = 16;
+ break;
+ default:
+ nHistogram = 256;
+ break;
+ };
+
+ stats = malloc (sizeof (rl2PrivRasterStatistics));
+ if (stats == NULL)
+ return NULL;
+ stats->no_data = 0.0;
+ stats->count = 0.0;
+ stats->sampleType = sample_type;
+ stats->nBands = num_bands;
+ stats->band_stats = malloc (sizeof (rl2PrivBandStatistics) * num_bands);
+ if (stats->band_stats == NULL)
+ {
+ free (stats);
+ return NULL;
+ }
+ for (i = 0; i < num_bands; i++)
+ {
+ /* initializing the Bands Statistics */
+ rl2PrivBandStatisticsPtr band = stats->band_stats + i;
+ band->min = DBL_MAX;
+ band->max = 0.0 - DBL_MAX;
+ band->mean = 0.0;
+ band->sum_sq_diff = 0.0;
+ band->nHistogram = nHistogram;
+ band->histogram = malloc (sizeof (double) * nHistogram);
+ for (j = 0; j < nHistogram; j++)
+ *(band->histogram + j) = 0.0;
+ band->first = NULL;
+ band->last = NULL;
+ }
+ return (rl2RasterStatisticsPtr) stats;
+}
+
+static void
+free_band_stats (rl2PrivBandStatisticsPtr band)
+{
+/* memory cleanup - destroying a Raster Band Statistics object */
+ rl2PoolVariancePtr pV;
+ rl2PoolVariancePtr pVn;
+ if (band == NULL)
+ return;
+ if (band->histogram != NULL)
+ free (band->histogram);
+ pV = band->first;
+ while (pV != NULL)
+ {
+ pVn = pV->next;
+ free (pV);
+ pV = pVn;
+ }
+}
+
+RL2_DECLARE void
+rl2_destroy_raster_statistics (rl2RasterStatisticsPtr stats)
+{
+/* memory cleanup - destroying a Raster Statistics object */
+ int nb;
+ rl2PrivRasterStatisticsPtr st = (rl2PrivRasterStatisticsPtr) stats;
+ if (st == NULL)
+ return;
+ for (nb = 0; nb < st->nBands; nb++)
+ {
+ rl2PrivBandStatisticsPtr band = st->band_stats + nb;
+ free_band_stats (band);
+ }
+ if (st->band_stats != NULL)
+ free (st->band_stats);
+ free (st);
+}
+
+RL2_DECLARE int
+rl2_get_raster_statistics_summary (rl2RasterStatisticsPtr stats,
+ double *no_data, double *count,
+ unsigned char *sample_type,
+ unsigned char *num_bands)
+{
+/* returning overall statistics values */
+ rl2PrivRasterStatisticsPtr st = (rl2PrivRasterStatisticsPtr) stats;
+ if (st == NULL)
+ return RL2_ERROR;
+ *no_data = st->no_data;
+ *count = st->count;
+ *sample_type = st->sampleType;
+ *num_bands = st->nBands;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_band_statistics (rl2RasterStatisticsPtr stats, unsigned char band,
+ double *min, double *max, double *mean,
+ double *variance, double *standard_deviation)
+{
+/* returning Band statistics values */
+ rl2PrivBandStatisticsPtr st_band;
+ rl2PrivRasterStatisticsPtr st = (rl2PrivRasterStatisticsPtr) stats;
+ if (st == NULL)
+ return RL2_ERROR;
+ if (band >= st->nBands)
+ return RL2_ERROR;
+
+ st_band = st->band_stats + band;
+ *min = st_band->min;
+ *max = st_band->max;
+ *mean = st_band->mean;
+ if (st_band->first != NULL)
+ {
+ double count = 0.0;
+ double sum_var = 0.0;
+ double sum_count = 0.0;
+ rl2PoolVariancePtr pV = st_band->first;
+ while (pV != NULL)
+ {
+ count += 1.0;
+ sum_var += (pV->count - 1.0) * pV->variance;
+ sum_count += pV->count;
+ pV = pV->next;
+ }
+ *variance = sum_var / (sum_count - count);
+ }
+ else
+ *variance = st_band->sum_sq_diff / (st->count - 1.0);
+ *standard_deviation = sqrt (*variance);
+ return RL2_OK;
+}
diff --git a/src/rl2ascii.c b/src/rl2ascii.c
new file mode 100644
index 0000000..0ef3ec4
--- /dev/null
+++ b/src/rl2ascii.c
@@ -0,0 +1,1398 @@
+/*
+
+ rl2ascii -- ASCII Grids related functions
+
+ version 0.1, 2013 December 26
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#include "rasterlite2/sqlite.h"
+
+#include "config.h"
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2tiff.h"
+#include "rasterlite2_private.h"
+
+static int
+parse_ncols (const char *str, unsigned int *width)
+{
+/* attempting to parse the NCOLS item */
+ if (strncasecmp (str, "ncols ", 6) == 0)
+ {
+ *width = atoi (str + 6);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+parse_nrows (const char *str, unsigned int *height)
+{
+/* attempting to parse the NROWS item */
+ if (strncasecmp (str, "nrows ", 6) == 0)
+ {
+ *height = atoi (str + 6);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+parse_xllcorner (const char *str, double *minx)
+{
+/* attempting to parse the XLLCORNER item */
+ if (strncasecmp (str, "xllcorner ", 10) == 0)
+ {
+ *minx = atof (str + 10);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+parse_yllcorner (const char *str, double *miny)
+{
+/* attempting to parse the YLLCORNER item */
+ if (strncasecmp (str, "yllcorner ", 10) == 0)
+ {
+ *miny = atof (str + 10);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+parse_xllcenter (const char *str, double *minx)
+{
+/* attempting to parse the XLLCENTER item */
+ if (strncasecmp (str, "xllcenter ", 10) == 0)
+ {
+ *minx = atof (str + 10);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+parse_yllcenter (const char *str, double *miny)
+{
+/* attempting to parse the YLLCENTER item */
+ if (strncasecmp (str, "yllcenter ", 10) == 0)
+ {
+ *miny = atof (str + 10);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+parse_cellsize (const char *str, double *xres)
+{
+/* attempting to parse the CELLSIZE item */
+ if (strncasecmp (str, "cellsize ", 9) == 0)
+ {
+ *xres = atof (str + 9);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+parse_nodata (const char *str, double *no_data)
+{
+/* attempting to parse the NODATA_value item */
+ if (strncasecmp (str, "NODATA_value ", 13) == 0)
+ {
+ *no_data = atof (str + 13);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+get_ascii_header (FILE * in, unsigned int *width, unsigned int *height,
+ double *minx, double *miny, double *maxx, double *maxy,
+ double *xres, double *yres, double *no_data)
+{
+/* attempting to parse the ASCII Header */
+ char buf[1024];
+ char *p_out = buf;
+ int line_no = 0;
+ int c;
+ int ok_ncols = 0;
+ int ok_nrows = 0;
+ int ok_xll = 0;
+ int ok_yll = 0;
+ int ok_cellsize = 0;
+ int ok_nodata = 0;
+
+ while ((c = getc (in)) != EOF)
+ {
+ if (c == '\r')
+ continue;
+ if (c == '\n')
+ {
+ *p_out = '\0';
+ if (parse_ncols (buf, width))
+ ok_ncols++;
+ if (parse_nrows (buf, height))
+ ok_nrows++;
+ if (parse_xllcorner (buf, minx))
+ ok_xll++;
+ if (parse_xllcenter (buf, minx))
+ ok_xll++;
+ if (parse_yllcorner (buf, miny))
+ ok_yll++;
+ if (parse_yllcenter (buf, miny))
+ ok_yll++;
+ if (parse_cellsize (buf, xres))
+ ok_cellsize++;
+ if (parse_nodata (buf, no_data))
+ ok_nodata++;
+ line_no++;
+ if (line_no == 6)
+ break;
+ p_out = buf;
+ continue;
+ }
+ if ((p_out - buf) >= 1024)
+ goto error;
+ *p_out++ = c;
+ }
+ if (ok_ncols == 1 && ok_nrows == 1 && ok_xll == 1 && ok_yll == 1
+ && ok_cellsize == 1 && ok_nodata == 1)
+ ;
+ else
+ goto error;
+
+ *maxx = *minx + ((double) (*width) * *xres);
+ *yres = *xres;
+ *maxy = *miny + ((double) (*height) * *yres);
+ return 1;
+
+ error:
+ *width = 0;
+ *height = 0;
+ *minx = DBL_MAX;
+ *miny = DBL_MAX;
+ *maxx = 0.0 - DBL_MAX;
+ *maxy = 0.0 - DBL_MAX;
+ *xres = 0.0;
+ *yres = 0.0;
+ *no_data = DBL_MAX;
+ return 0;
+}
+
+static rl2PrivAsciiOriginPtr
+alloc_ascii_origin (const char *path, int srid, unsigned char sample_type,
+ unsigned short width, unsigned short height, double minx,
+ double miny, double maxx, double maxy, double xres,
+ double yres, double no_data)
+{
+/* allocating and initializing an ASCII Grid origin */
+ int len;
+ rl2PrivAsciiOriginPtr ascii = malloc (sizeof (rl2PrivAsciiOrigin));
+ if (ascii == NULL)
+ return NULL;
+ len = strlen (path);
+ ascii->path = malloc (len + 1);
+ strcpy (ascii->path, path);
+ ascii->tmp = NULL;
+ ascii->width = width;
+ ascii->height = height;
+ ascii->Srid = srid;
+ ascii->hResolution = xres;
+ ascii->vResolution = yres;
+ ascii->minX = minx;
+ ascii->minY = miny;
+ ascii->maxX = maxx;
+ ascii->maxY = maxy;
+ ascii->sample_type = sample_type;
+ ascii->noData = no_data;
+ return ascii;
+}
+
+RL2_DECLARE rl2AsciiGridOriginPtr
+rl2_create_ascii_grid_origin (const char *path, int srid,
+ unsigned char sample_type)
+{
+/* creating an ASCII Grid Origin */
+ FILE *in;
+ unsigned int width;
+ unsigned int height;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ double xres;
+ double yres;
+ double no_data;
+ char buf[1024];
+ char *p_out = buf;
+ unsigned int line_no = 0;
+ unsigned int col_no = 0;
+ int new_line = 1;
+ int c;
+ rl2PrivAsciiOriginPtr ascii = NULL;
+ void *scanline = NULL;
+ char *p_int8;
+ unsigned char *p_uint8;
+ short *p_int16;
+ unsigned short *p_uint16;
+ int *p_int32;
+ unsigned int *p_uint32;
+ float *p_float;
+ double *p_double;
+ int sz;
+
+ if (path == NULL)
+ return NULL;
+ if (srid <= 0)
+ return NULL;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ case RL2_SAMPLE_DOUBLE:
+ break;
+ default:
+ return NULL;
+ };
+
+ in = fopen (path, "r");
+ if (in == NULL)
+ {
+ fprintf (stderr, "ASCII Origin: Unable to open %s\n", path);
+ return NULL;
+ }
+ if (!get_ascii_header
+ (in, &width, &height, &minx, &miny, &maxx, &maxy, &xres, &yres,
+ &no_data))
+ {
+ fprintf (stderr, "ASCII Origin: invalid Header found on %s\n", path);
+ goto error;
+ }
+
+ ascii =
+ alloc_ascii_origin (path, srid, sample_type, width, height, minx, miny,
+ maxx, maxy, xres, yres, no_data);
+ if (ascii == NULL)
+ goto error;
+
+ *buf = '\0';
+ col_no = width;
+/* creating the helper Temporary File */
+ ascii->tmp = tmpfile ();
+ if (ascii->tmp == NULL)
+ goto error;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ sz = ascii->width;
+ break;
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ sz = ascii->width * 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ sz = ascii->width * 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sz = ascii->width * 8;
+ break;
+ };
+ scanline = malloc (sz);
+ if (scanline == NULL)
+ goto error;
+
+ while ((c = getc (in)) != EOF)
+ {
+ if (c == '\r')
+ continue;
+ if (c == ' ' || c == '\n')
+ {
+ *p_out = '\0';
+ if (*buf != '\0')
+ {
+ char int8_value;
+ unsigned char uint8_value;
+ short int16_value;
+ unsigned short uint16_value;
+ int int32_value;
+ unsigned int uint32_value;
+ float flt_value;
+ double dbl_value = atof (buf);
+ if (new_line)
+ {
+ if (col_no != width)
+ goto error;
+ line_no++;
+ new_line = 0;
+ col_no = 0;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ p_int8 = scanline;
+ break;
+ case RL2_SAMPLE_UINT8:
+ p_uint8 = scanline;
+ break;
+ case RL2_SAMPLE_INT16:
+ p_int16 = scanline;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_uint16 = scanline;
+ break;
+ case RL2_SAMPLE_INT32:
+ p_int32 = scanline;
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_uint32 = scanline;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_float = scanline;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_double = scanline;
+ break;
+ };
+ }
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ int8_value = truncate_8 (dbl_value);
+ *p_int8++ = int8_value;
+ break;
+ case RL2_SAMPLE_UINT8:
+ uint8_value = truncate_u8 (dbl_value);
+ *p_uint8++ = uint8_value;
+ break;
+ case RL2_SAMPLE_INT16:
+ int16_value = truncate_16 (dbl_value);
+ *p_int16++ = int16_value;
+ break;
+ case RL2_SAMPLE_UINT16:
+ uint16_value = truncate_u16 (dbl_value);
+ *p_uint16++ = uint16_value;
+ break;
+ case RL2_SAMPLE_INT32:
+ int32_value = truncate_32 (dbl_value);
+ *p_int32++ = int32_value;
+ break;
+ case RL2_SAMPLE_UINT32:
+ uint32_value = truncate_u32 (dbl_value);
+ *p_uint32++ = uint32_value;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ flt_value = (float) dbl_value;
+ *p_float++ = flt_value;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ *p_double++ = dbl_value;
+ break;
+ };
+ col_no++;
+ if (col_no == ascii->width)
+ fwrite (scanline, sz, 1, ascii->tmp);
+ }
+ p_out = buf;
+ if (c == '\n')
+ new_line = 1;
+ continue;
+ }
+
+ if ((p_out - buf) >= 1024)
+ goto error;
+ *p_out++ = c;
+ }
+ if (line_no != height)
+ goto error;
+
+ fclose (in);
+ free (scanline);
+ return (rl2AsciiGridOriginPtr) ascii;
+
+ error:
+ if (scanline != NULL)
+ free (scanline);
+ if (ascii != NULL)
+ rl2_destroy_ascii_grid_origin ((rl2AsciiGridOriginPtr) ascii);
+ if (in != NULL)
+ fclose (in);
+ return NULL;
+}
+
+RL2_DECLARE void
+rl2_destroy_ascii_grid_origin (rl2AsciiGridOriginPtr ascii)
+{
+/* memory cleanup - destroying an ASCII Grid Origin object */
+ rl2PrivAsciiOriginPtr org = (rl2PrivAsciiOriginPtr) ascii;
+ if (org == NULL)
+ return;
+ if (org->path != NULL)
+ free (org->path);
+ if (org->tmp != NULL)
+ fclose (org->tmp);
+ free (org);
+}
+
+RL2_DECLARE const char *
+rl2_get_ascii_grid_origin_path (rl2AsciiGridOriginPtr ascii)
+{
+/* retrieving the input path from an ASCII Grid origin */
+ rl2PrivAsciiOriginPtr origin = (rl2PrivAsciiOriginPtr) ascii;
+ if (origin == NULL)
+ return NULL;
+
+ return origin->path;
+}
+
+RL2_DECLARE int
+rl2_get_ascii_grid_origin_size (rl2AsciiGridOriginPtr ascii,
+ unsigned int *width, unsigned int *height)
+{
+/* retrieving Width and Height from an ASCII Grid origin */
+ rl2PrivAsciiOriginPtr origin = (rl2PrivAsciiOriginPtr) ascii;
+ if (origin == NULL)
+ return RL2_ERROR;
+
+ *width = origin->width;
+ *height = origin->height;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_ascii_grid_origin_srid (rl2AsciiGridOriginPtr ascii, int *srid)
+{
+/* retrieving the SRID from an ASCII Grid origin */
+ rl2PrivAsciiOriginPtr origin = (rl2PrivAsciiOriginPtr) ascii;
+ if (origin == NULL)
+ return RL2_ERROR;
+
+ *srid = origin->Srid;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_ascii_grid_origin_extent (rl2AsciiGridOriginPtr ascii, double *minX,
+ double *minY, double *maxX, double *maxY)
+{
+/* retrieving the Extent from an ASCII Grid origin */
+ rl2PrivAsciiOriginPtr origin = (rl2PrivAsciiOriginPtr) ascii;
+ if (origin == NULL)
+ return RL2_ERROR;
+
+ *minX = origin->minX;
+ *minY = origin->minY;
+ *maxX = origin->maxX;
+ *maxY = origin->maxY;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_ascii_grid_origin_resolution (rl2AsciiGridOriginPtr ascii,
+ double *hResolution, double *vResolution)
+{
+/* retrieving the Pixel Resolution from an ASCII Grid origin */
+ rl2PrivAsciiOriginPtr origin = (rl2PrivAsciiOriginPtr) ascii;
+ if (origin == NULL)
+ return RL2_ERROR;
+
+ *hResolution = origin->hResolution;
+ *vResolution = origin->vResolution;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_ascii_grid_origin_type (rl2AsciiGridOriginPtr ascii,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *num_bands)
+{
+/* retrieving the sample/pixel type from an ASCII Grid origin */
+ rl2PrivAsciiOriginPtr origin = (rl2PrivAsciiOriginPtr) ascii;
+ if (origin == NULL)
+ return RL2_ERROR;
+
+ *sample_type = origin->sample_type;
+ *pixel_type = RL2_PIXEL_DATAGRID;
+ *num_bands = 1;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_eval_ascii_grid_origin_compatibility (rl2CoveragePtr cvg,
+ rl2AsciiGridOriginPtr ascii)
+{
+/* testing if a Coverage and an ASCII Grid origin are mutually compatible */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int srid;
+ double hResolution;
+ double vResolution;
+ double confidence;
+ rl2PrivCoveragePtr coverage = (rl2PrivCoveragePtr) cvg;
+
+ if (coverage == NULL || ascii == NULL)
+ return RL2_ERROR;
+ if (rl2_get_ascii_grid_origin_type
+ (ascii, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ return RL2_ERROR;
+
+ if (coverage->sampleType != sample_type)
+ return RL2_FALSE;
+ if (coverage->pixelType != pixel_type)
+ return RL2_FALSE;
+ if (coverage->nBands != num_bands)
+ return RL2_FALSE;
+
+/* checking for resolution compatibility */
+ if (rl2_get_ascii_grid_origin_srid (ascii, &srid) != RL2_OK)
+ return RL2_FALSE;
+ if (coverage->Srid != srid)
+ return RL2_FALSE;
+ if (rl2_get_ascii_grid_origin_resolution (ascii, &hResolution, &vResolution)
+ != RL2_OK)
+ return RL2_FALSE;
+ confidence = coverage->hResolution / 100.0;
+ if (hResolution < (coverage->hResolution - confidence)
+ || hResolution > (coverage->hResolution + confidence))
+ return RL2_FALSE;
+ confidence = coverage->vResolution / 100.0;
+ if (vResolution < (coverage->vResolution - confidence)
+ || vResolution > (coverage->vResolution + confidence))
+ return RL2_FALSE;
+ return RL2_TRUE;
+}
+
+static int
+read_ascii_int8 (rl2PrivAsciiOriginPtr origin, unsigned int width,
+ unsigned int height, unsigned int startRow,
+ unsigned int startCol, char *pixels)
+{
+/* reading from the Temporary helper file - INT8 */
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ unsigned int col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ long offset = (row * origin->width) + startCol;
+ char *p_out = pixels + (y * width);
+ if (fseek (origin->tmp, offset, SEEK_SET) != 0)
+ return 0;
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ char int8;
+ if (fread (&int8, sizeof (char), 1, origin->tmp) <= 0)
+ return 0;
+ *p_out++ = int8;
+ }
+ }
+ return 1;
+}
+
+static int
+read_ascii_uint8 (rl2PrivAsciiOriginPtr origin, unsigned int width,
+ unsigned int height, unsigned int startRow,
+ unsigned int startCol, unsigned char *pixels)
+{
+/* reading from the Temporary helper file - UINT8 */
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ unsigned int col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ long offset = (row * origin->width) + startCol;
+ unsigned char *p_out = pixels + (y * width);
+ if (fseek (origin->tmp, offset, SEEK_SET) != 0)
+ return 0;
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ unsigned char uint8;
+ if (fread (&uint8, sizeof (unsigned char), 1, origin->tmp) <= 0)
+ return 0;
+ *p_out++ = uint8;
+ }
+ }
+ return 1;
+}
+
+static int
+read_ascii_int16 (rl2PrivAsciiOriginPtr origin, unsigned int width,
+ unsigned int height, unsigned int startRow,
+ unsigned int startCol, short *pixels)
+{
+/* reading from the Temporary helper file - INT16 */
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ unsigned int col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ long offset =
+ (row * origin->width * sizeof (short)) +
+ (startCol * sizeof (short));
+ short *p_out = pixels + (y * width);
+ if (fseek (origin->tmp, offset, SEEK_SET) < 0)
+ return 0;
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ short int16;
+ if (fread (&int16, sizeof (short), 1, origin->tmp) <= 0)
+ return 0;
+ *p_out++ = int16;
+ }
+ }
+ return 1;
+}
+
+static int
+read_ascii_uint16 (rl2PrivAsciiOriginPtr origin, unsigned int width,
+ unsigned int height, unsigned int startRow,
+ unsigned int startCol, unsigned short *pixels)
+{
+/* reading from the Temporary helper file - UINT16 */
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ unsigned int col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ long offset =
+ (row * origin->width * sizeof (unsigned short)) +
+ (startCol * sizeof (unsigned short));
+ unsigned short *p_out = pixels + (y * width);
+ if (fseek (origin->tmp, offset, SEEK_SET) != 0)
+ return 0;
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ unsigned short uint16;
+ if (fread (&uint16, sizeof (unsigned short), 1, origin->tmp) <=
+ 0)
+ return 0;
+ *p_out++ = uint16;
+ }
+ }
+ return 1;
+}
+
+static int
+read_ascii_int32 (rl2PrivAsciiOriginPtr origin, unsigned int width,
+ unsigned int height, unsigned int startRow,
+ unsigned int startCol, int *pixels)
+{
+/* reading from the Temporary helper file - INT32 */
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ unsigned int col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ long offset =
+ (row * origin->width * sizeof (int)) + (startCol * sizeof (int));
+ int *p_out = pixels + (y * width);
+ if (fseek (origin->tmp, offset, SEEK_SET) != 0)
+ return 0;
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ int int32;
+ if (fread (&int32, sizeof (int), 1, origin->tmp) <= 0)
+ return 0;
+ *p_out++ = int32;
+ }
+ }
+ return 1;
+}
+
+static int
+read_ascii_uint32 (rl2PrivAsciiOriginPtr origin, unsigned int width,
+ unsigned int height, unsigned int startRow,
+ unsigned int startCol, unsigned int *pixels)
+{
+/* reading from the Temporary helper file - UINT32 */
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ unsigned int col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ long offset =
+ (row * origin->width * sizeof (unsigned int)) +
+ (startCol * sizeof (unsigned int));
+ unsigned int *p_out = pixels + (y * width);
+ if (fseek (origin->tmp, offset, SEEK_SET) != 0)
+ return 0;
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ unsigned int uint32;
+ if (fread (&uint32, sizeof (unsigned int), 1, origin->tmp) <= 0)
+ return 0;
+ *p_out++ = uint32;
+ }
+ }
+ return 1;
+}
+
+static int
+read_ascii_float (rl2PrivAsciiOriginPtr origin, unsigned int width,
+ unsigned int height, unsigned int startRow,
+ unsigned int startCol, float *pixels)
+{
+/* reading from the Temporary helper file - FLOAT */
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ unsigned int col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ long offset =
+ (row * origin->width * sizeof (float)) +
+ (startCol * sizeof (float));
+ float *p_out = pixels + (y * width);
+ if (fseek (origin->tmp, offset, SEEK_SET) != 0)
+ return 0;
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ float flt;
+ if (fread (&flt, sizeof (float), 1, origin->tmp) <= 0)
+ return 0;
+ *p_out++ = flt;
+ }
+ }
+ return 1;
+}
+
+static int
+read_ascii_double (rl2PrivAsciiOriginPtr origin, unsigned int width,
+ unsigned int height, unsigned int startRow,
+ unsigned int startCol, double *pixels)
+{
+/* reading from the Temporary helper file - DOUBLE */
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ unsigned int col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ long offset =
+ (row * origin->width * sizeof (double)) +
+ (startCol * sizeof (double));
+ double *p_out = pixels + (y * width);
+ if (fseek (origin->tmp, offset, SEEK_SET) != 0)
+ return 0;
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ double dbl;
+ if (fread (&dbl, sizeof (double), 1, origin->tmp) <= 0)
+ return 0;
+ *p_out++ = dbl;
+ }
+ }
+ return 1;
+}
+
+static int
+read_ascii_pixels (rl2PrivAsciiOriginPtr origin, unsigned short width,
+ unsigned short height, unsigned char sample_type,
+ unsigned int startRow, unsigned int startCol, void *pixels)
+{
+/* reading from the Temporary helper file */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ return read_ascii_int8 (origin, width, height, startRow, startCol,
+ (char *) pixels);
+ case RL2_SAMPLE_UINT8:
+ return read_ascii_uint8 (origin, width, height, startRow, startCol,
+ (unsigned char *) pixels);
+ case RL2_SAMPLE_INT16:
+ return read_ascii_int16 (origin, width, height, startRow, startCol,
+ (short *) pixels);
+ case RL2_SAMPLE_UINT16:
+ return read_ascii_uint16 (origin, width, height, startRow, startCol,
+ (unsigned short *) pixels);
+ case RL2_SAMPLE_INT32:
+ return read_ascii_int32 (origin, width, height, startRow, startCol,
+ (int *) pixels);
+ case RL2_SAMPLE_UINT32:
+ return read_ascii_uint32 (origin, width, height, startRow, startCol,
+ (unsigned int *) pixels);
+ case RL2_SAMPLE_FLOAT:
+ return read_ascii_float (origin, width, height, startRow, startCol,
+ (float *) pixels);
+ case RL2_SAMPLE_DOUBLE:
+ return read_ascii_double (origin, width, height, startRow, startCol,
+ (double *) pixels);
+ };
+ return 0;
+}
+
+static int
+read_from_ascii (rl2PrivAsciiOriginPtr origin, unsigned short width,
+ unsigned short height, unsigned char sample_type,
+ unsigned int startRow, unsigned int startCol,
+ unsigned char **pixels, int *pixels_sz)
+{
+/* creating a tile from the ASCII Grid origin */
+ unsigned char *bufPixels = NULL;
+ int bufPixelsSz = 0;
+ int pix_sz = 1;
+ rl2PixelPtr no_data = NULL;
+
+ no_data = rl2_create_pixel (sample_type, RL2_PIXEL_DATAGRID, 1);
+
+/* allocating the pixels buffer */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ pix_sz = 1;
+ rl2_set_pixel_sample_int8 (no_data, (char) (origin->noData));
+ break;
+ case RL2_SAMPLE_UINT8:
+ pix_sz = 1;
+ rl2_set_pixel_sample_uint8 (no_data, 0,
+ (unsigned char) (origin->noData));
+ break;
+ case RL2_SAMPLE_INT16:
+ rl2_set_pixel_sample_int16 (no_data, (short) (origin->noData));
+ pix_sz = 2;
+ break;
+ case RL2_SAMPLE_UINT16:
+ rl2_set_pixel_sample_uint16 (no_data, 0,
+ (unsigned short) (origin->noData));
+ pix_sz = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ pix_sz = 4;
+ rl2_set_pixel_sample_int32 (no_data, (int) (origin->noData));
+ break;
+ case RL2_SAMPLE_UINT32:
+ pix_sz = 4;
+ rl2_set_pixel_sample_uint32 (no_data,
+ (unsigned int) (origin->noData));
+ break;
+ case RL2_SAMPLE_FLOAT:
+ pix_sz = 4;
+ rl2_set_pixel_sample_float (no_data, (float) (origin->noData));
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pix_sz = 8;
+ rl2_set_pixel_sample_double (no_data, (double) (origin->noData));
+ break;
+ };
+ bufPixelsSz = width * height * pix_sz;
+ bufPixels = malloc (bufPixelsSz);
+ if (bufPixels == NULL)
+ goto error;
+ if ((startRow + height) > origin->height
+ || (startCol + width) > origin->width)
+ rl2_prime_void_tile (bufPixels, width, height, sample_type, 1, no_data);
+
+ if (!read_ascii_pixels
+ (origin, width, height, sample_type, startRow, startCol, bufPixels))
+ goto error;
+
+ rl2_destroy_pixel (no_data);
+ *pixels = bufPixels;
+ *pixels_sz = bufPixelsSz;
+ return RL2_OK;
+ error:
+ if (bufPixels != NULL)
+ free (bufPixels);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_get_tile_from_ascii_grid_origin (rl2CoveragePtr cvg,
+ rl2AsciiGridOriginPtr ascii,
+ unsigned int startRow,
+ unsigned int startCol)
+{
+/* attempting to create a Coverage-tile from an ASCII Grid origin */
+ unsigned int x;
+ rl2PrivCoveragePtr coverage = (rl2PrivCoveragePtr) cvg;
+ rl2PrivAsciiOriginPtr origin = (rl2PrivAsciiOriginPtr) ascii;
+ rl2RasterPtr raster = NULL;
+ unsigned char *pixels = NULL;
+ int pixels_sz = 0;
+ unsigned char *mask = NULL;
+ int mask_size = 0;
+ unsigned int unused_width = 0;
+ unsigned int unused_height = 0;
+
+ if (coverage == NULL || origin == NULL)
+ return NULL;
+ if (rl2_eval_ascii_grid_origin_compatibility (cvg, ascii) != RL2_TRUE)
+ return NULL;
+ if (origin->tmp == NULL)
+ return NULL;
+
+/* testing for tile's boundary validity */
+ if (startCol > origin->width)
+ return NULL;
+ if (startRow > origin->height)
+ return NULL;
+ x = startCol / coverage->tileWidth;
+ if ((x * coverage->tileWidth) != startCol)
+ return NULL;
+ x = startRow / coverage->tileHeight;
+ if ((x * coverage->tileHeight) != startRow)
+ return NULL;
+
+/* attempting to create the tile */
+ if (read_from_ascii
+ (origin, coverage->tileWidth, coverage->tileHeight,
+ coverage->sampleType, startRow, startCol, &pixels,
+ &pixels_sz) != RL2_OK)
+ goto error;
+ if (startCol + coverage->tileWidth > origin->width)
+ unused_width = (startCol + coverage->tileWidth) - origin->width;
+ if (startRow + coverage->tileHeight > origin->height)
+ unused_height = (startRow + coverage->tileHeight) - origin->height;
+ if (unused_width || unused_height)
+ {
+ /*
+ * creating a Transparency Mask so to shadow any
+ * unused portion of the current tile
+ */
+ unsigned int shadow_x = coverage->tileWidth - unused_width;
+ unsigned int shadow_y = coverage->tileHeight - unused_height;
+ unsigned int row;
+ mask_size = coverage->tileWidth * coverage->tileHeight;
+ mask = malloc (mask_size);
+ if (mask == NULL)
+ goto error;
+ /* full Transparent mask */
+ memset (mask, 0, coverage->tileWidth * coverage->tileHeight);
+ for (row = 0; row < coverage->tileHeight; row++)
+ {
+ unsigned char *p = mask + (row * coverage->tileWidth);
+ if (row < shadow_y)
+ {
+ /* setting opaque pixels */
+ memset (p, 1, shadow_x);
+ }
+ }
+ }
+ raster =
+ rl2_create_raster (coverage->tileWidth, coverage->tileHeight,
+ coverage->sampleType, RL2_PIXEL_DATAGRID, 1, pixels,
+ pixels_sz, NULL, mask, mask_size, NULL);
+ if (raster == NULL)
+ goto error;
+ return raster;
+ error:
+ if (pixels != NULL)
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return NULL;
+}
+
+static rl2PrivAsciiDestinationPtr
+alloc_ascii_destination (const char *path, unsigned int width,
+ unsigned int height, double x, double y,
+ double res, int is_centered, double no_data,
+ int decimal_digits)
+{
+/* allocating and initializing an ASCII Grid detination */
+ int len;
+ rl2PrivAsciiDestinationPtr ascii =
+ malloc (sizeof (rl2PrivAsciiDestination));
+ if (ascii == NULL)
+ return NULL;
+ len = strlen (path);
+ ascii->path = malloc (len + 1);
+ strcpy (ascii->path, path);
+ ascii->out = NULL;
+ ascii->width = width;
+ ascii->height = height;
+ ascii->Resolution = res;
+ ascii->X = x;
+ ascii->Y = y;
+ ascii->isCentered = is_centered;
+ ascii->noData = no_data;
+ if (decimal_digits < 0)
+ ascii->decimalDigits = 0;
+ else if (decimal_digits > 18)
+ ascii->decimalDigits = 18;
+ else
+ ascii->decimalDigits = decimal_digits;
+ ascii->headerDone = 'N';
+ ascii->nextLineNo = 0;
+ ascii->pixels = NULL;
+ ascii->sampleType = RL2_SAMPLE_UNKNOWN;
+ return ascii;
+}
+
+RL2_DECLARE rl2AsciiGridDestinationPtr
+rl2_create_ascii_grid_destination (const char *path, unsigned int width,
+ unsigned int height, double resolution,
+ double x, double y, int is_centered,
+ double no_data, int decimal_digits,
+ void *pixels, int pixels_size,
+ unsigned char sample_type)
+{
+/* creating an ASCII Grid Destination */
+ FILE *out;
+ rl2PrivAsciiDestinationPtr ascii = NULL;
+ int pix_sz = 0;
+
+ if (path == NULL)
+ return NULL;
+ if (pixels == NULL)
+ return NULL;
+
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ pix_sz = 1;
+ break;
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pix_sz = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pix_sz = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pix_sz = 8;
+ break;
+ };
+ if (pix_sz < 1)
+ return NULL;
+ if (pixels_size != (int) (width * height * pix_sz))
+ return NULL;
+
+ out = fopen (path, "w");
+ if (out == NULL)
+ {
+ fprintf (stderr, "ASCII Destination: Unable to open %s\n", path);
+ return NULL;
+ }
+
+ ascii =
+ alloc_ascii_destination (path, width, height, x, y, resolution,
+ is_centered, no_data, decimal_digits);
+ if (ascii == NULL)
+ goto error;
+
+/* creating the output File */
+ out = fopen (path, "wb");
+ if (out == NULL)
+ goto error;
+ ascii->out = out;
+ ascii->pixels = pixels;
+ ascii->sampleType = sample_type;
+
+ return (rl2AsciiGridDestinationPtr) ascii;
+
+ error:
+ if (ascii != NULL)
+ rl2_destroy_ascii_grid_destination ((rl2AsciiGridDestinationPtr) ascii);
+ if (out != NULL)
+ fclose (out);
+ return NULL;
+}
+
+RL2_DECLARE void
+rl2_destroy_ascii_grid_destination (rl2AsciiGridDestinationPtr ascii)
+{
+/* memory cleanup - destroying an ASCII Grid destination object */
+ rl2PrivAsciiDestinationPtr dst = (rl2PrivAsciiDestinationPtr) ascii;
+ if (dst == NULL)
+ return;
+ if (dst->path != NULL)
+ free (dst->path);
+ if (dst->out != NULL)
+ fclose (dst->out);
+ if (dst->pixels != NULL)
+ free (dst->pixels);
+ free (dst);
+}
+
+RL2_DECLARE const char *
+rl2_get_ascii_grid_destination_path (rl2AsciiGridDestinationPtr ascii)
+{
+/* retrieving the input path from an ASCII Grid destination */
+ rl2PrivAsciiDestinationPtr dst = (rl2PrivAsciiDestinationPtr) ascii;
+ if (dst == NULL)
+ return NULL;
+
+ return dst->path;
+}
+
+RL2_DECLARE int
+rl2_get_ascii_grid_destination_size (rl2AsciiGridDestinationPtr ascii,
+ unsigned int *width, unsigned int *height)
+{
+/* retrieving Width and Height from an ASCII Grid destination */
+ rl2PrivAsciiDestinationPtr dst = (rl2PrivAsciiDestinationPtr) ascii;
+ if (dst == NULL)
+ return RL2_ERROR;
+
+ *width = dst->width;
+ *height = dst->height;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_ascii_grid_destination_tiepoint (rl2AsciiGridDestinationPtr ascii,
+ double *X, double *Y)
+{
+/* retrieving the tiepoint from an ASCII Grid destination */
+ rl2PrivAsciiDestinationPtr dst = (rl2PrivAsciiDestinationPtr) ascii;
+ if (dst == NULL)
+ return RL2_ERROR;
+
+ *X = dst->X;
+ *Y = dst->Y;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_ascii_grid_destination_resolution (rl2AsciiGridDestinationPtr ascii,
+ double *resolution)
+{
+/* retrieving the Pixel Resolution from an ASCII Grid destination */
+ rl2PrivAsciiDestinationPtr dst = (rl2PrivAsciiDestinationPtr) ascii;
+ if (dst == NULL)
+ return RL2_ERROR;
+
+ *resolution = dst->Resolution;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_write_ascii_grid_header (rl2AsciiGridDestinationPtr ascii)
+{
+/* attempting to write the ASCII Grid header */
+ rl2PrivAsciiDestinationPtr dst = (rl2PrivAsciiDestinationPtr) ascii;
+ if (dst == NULL)
+ return RL2_ERROR;
+ if (dst->out == NULL)
+ return RL2_ERROR;
+ if (dst->headerDone != 'N')
+ return RL2_ERROR;
+
+ fprintf (dst->out, "ncols %u\r\n", dst->width);
+ fprintf (dst->out, "nrows %u\r\n", dst->height);
+ if (dst->isCentered)
+ {
+ fprintf (dst->out, "xllcenter %1.8f\r\n", dst->X);
+ fprintf (dst->out, "yllcenter %1.8f\r\n", dst->Y);
+ }
+ else
+ {
+ fprintf (dst->out, "xllcorner %1.8f\r\n", dst->X);
+ fprintf (dst->out, "yllcorner %1.8f\r\n", dst->Y);
+ }
+ fprintf (dst->out, "cellsize %1.8f\r\n", dst->Resolution);
+ fprintf (dst->out, "NODATA_value %1.8f\r\n", dst->noData);
+ dst->headerDone = 'Y';
+ return RL2_OK;
+}
+
+static char *
+format_pixel (double cell_value, int decimal_digits)
+{
+/* well formatting an ASCII pixel */
+ char format[32];
+ char *pixel;
+ char *p;
+ sprintf (format, " %%1.%df", decimal_digits);
+ pixel = sqlite3_mprintf (format, cell_value);
+ if (decimal_digits == 0)
+ return pixel;
+ p = pixel + strlen (pixel) - 1;
+ while (1)
+ {
+ if (*p == '0')
+ *p = '\0';
+ else if (*p == '.')
+ {
+ *p = '\0';
+ break;
+ }
+ else
+ break;
+ p--;
+ }
+ return pixel;
+}
+
+RL2_DECLARE int
+rl2_write_ascii_grid_scanline (rl2AsciiGridDestinationPtr ascii,
+ unsigned int *line_no)
+{
+/* attempting to write a scanline into an ASCII Grid */
+ char *p8;
+ unsigned char *pu8;
+ short *p16;
+ unsigned short *pu16;
+ int *p32;
+ unsigned int *pu32;
+ float *pflt;
+ double *pdbl;
+ double cell_value;
+ char *pxl;
+ unsigned int x;
+ rl2PrivAsciiDestinationPtr dst = (rl2PrivAsciiDestinationPtr) ascii;
+
+ if (dst == NULL)
+ return RL2_ERROR;
+ if (dst->out == NULL)
+ return RL2_ERROR;
+ if (dst->headerDone != 'Y')
+ return RL2_ERROR;
+ if (dst->nextLineNo >= dst->height)
+ return RL2_ERROR;
+
+ switch (dst->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ p8 = dst->pixels;
+ p8 += (dst->nextLineNo * dst->width);
+ break;
+ case RL2_SAMPLE_UINT8:
+ pu8 = dst->pixels;
+ pu8 += (dst->nextLineNo * dst->width);
+ break;
+ case RL2_SAMPLE_INT16:
+ p16 = dst->pixels;
+ p16 += (dst->nextLineNo * dst->width);
+ break;
+ case RL2_SAMPLE_UINT16:
+ pu16 = dst->pixels;
+ pu16 += (dst->nextLineNo * dst->width);
+ break;
+ case RL2_SAMPLE_INT32:
+ p32 = dst->pixels;
+ p32 += (dst->nextLineNo * dst->width);
+ break;
+ case RL2_SAMPLE_UINT32:
+ pu32 = dst->pixels;
+ pu32 += (dst->nextLineNo * dst->width);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ pflt = dst->pixels;
+ pflt += (dst->nextLineNo * dst->width);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pdbl = dst->pixels;
+ pdbl += (dst->nextLineNo * dst->width);
+ break;
+ };
+
+ for (x = 0; x < dst->width; x++)
+ {
+ switch (dst->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ cell_value = *p8++;
+ break;
+ case RL2_SAMPLE_UINT8:
+ cell_value = *pu8++;
+ break;
+ case RL2_SAMPLE_INT16:
+ cell_value = *p16++;
+ break;
+ case RL2_SAMPLE_UINT16:
+ cell_value = *pu16++;
+ break;
+ case RL2_SAMPLE_INT32:
+ cell_value = *p32++;
+ break;
+ case RL2_SAMPLE_UINT32:
+ cell_value = *pu32++;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ cell_value = *pflt++;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ cell_value = *pdbl++;
+ break;
+ };
+ pxl = format_pixel (cell_value, dst->decimalDigits);
+ fprintf (dst->out, "%s", pxl);
+ sqlite3_free (pxl);
+ }
+ fprintf (dst->out, "\r\n");
+
+ dst->nextLineNo += 1;
+ *line_no = dst->nextLineNo;
+ return RL2_OK;
+}
diff --git a/src/rl2auxrender.c b/src/rl2auxrender.c
new file mode 100644
index 0000000..27ac522
--- /dev/null
+++ b/src/rl2auxrender.c
@@ -0,0 +1,1213 @@
+/*
+
+ rl2auxrender -- auxiliary methods for Raster Group rendering
+
+ version 0.1, 2014 July 30
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <limits.h>
+
+#ifdef _WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2graphics.h"
+#include "rasterlite2_private.h"
+
+static void
+copy_monochrome (unsigned char *rgba, unsigned int width, unsigned int height,
+ unsigned char *inbuf)
+{
+/* copying from Monochrome to RGBA */
+ unsigned int x;
+ unsigned int y;
+ unsigned char *p_in = inbuf;
+ unsigned char *p_out = rgba;
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ unsigned char mono = *p_in++;
+ if (mono == 0)
+ {
+ /* skipping a transparent pixel */
+ p_out += 4;
+ }
+ else
+ {
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+}
+
+static void
+copy_palette (unsigned char *rgba, unsigned int width, unsigned int height,
+ unsigned char *inbuf, rl2PalettePtr palette, unsigned char bg_red,
+ unsigned char bg_green, unsigned char bg_blue)
+{
+/* copying from Palette to RGBA */
+ unsigned int x;
+ unsigned int y;
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) palette;
+ unsigned char *p_in = inbuf;
+ unsigned char *p_out = rgba;
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ unsigned char red = 0;
+ unsigned char green = 0;
+ unsigned char blue = 0;
+ unsigned char index = *p_in++;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + index;
+ red = entry->red;
+ green = entry->green;
+ blue = entry->blue;
+ }
+ if (red == bg_red && green == bg_green && blue == bg_blue)
+ {
+ /* skipping a transparent pixel */
+ p_out += 4;
+ }
+ else
+ {
+ *p_out++ = red;
+ *p_out++ = green;
+ *p_out++ = blue;
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+}
+
+static void
+copy_grayscale (unsigned char *rgba, unsigned int width, unsigned int height,
+ unsigned char *inbuf, unsigned char bg_gray)
+{
+/* copying from Grayscale to RGBA */
+ unsigned int x;
+ unsigned int y;
+ unsigned char *p_in = inbuf;
+ unsigned char *p_out = rgba;
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ unsigned char gray = *p_in++;
+ if (gray == bg_gray)
+ {
+ /* skipping a transparent pixel */
+ p_out += 4;
+ }
+ else
+ {
+ *p_out++ = gray;
+ *p_out++ = gray;
+ *p_out++ = gray;
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+}
+
+static void
+copy_rgb (unsigned char *rgba, unsigned int width, unsigned int height,
+ unsigned char *inbuf, unsigned char bg_red, unsigned char bg_green,
+ unsigned char bg_blue)
+{
+/* copying from RGB to RGBA */
+ unsigned int x;
+ unsigned int y;
+ unsigned char *p_in = inbuf;
+ unsigned char *p_out = rgba;
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ unsigned char red = *p_in++;
+ unsigned char green = *p_in++;
+ unsigned char blue = *p_in++;
+ if (red == bg_red && green == bg_green && blue == bg_blue)
+ {
+ /* skipping a transparent pixel */
+ p_out += 4;
+ }
+ else
+ {
+ *p_out++ = red;
+ *p_out++ = green;
+ *p_out++ = blue;
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+}
+
+static void
+copy_rgb_alpha (unsigned char *rgba, unsigned int width, unsigned int height,
+ unsigned char *inbuf, unsigned char *inalpha)
+{
+/* copying from RGB+Alpha to RGBA */
+ unsigned int x;
+ unsigned int y;
+ unsigned char *p_in = inbuf;
+ unsigned char *p_alpha = inalpha;
+ unsigned char *p_out = rgba;
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ unsigned char alpha = *p_alpha++;
+ unsigned char red = *p_in++;
+ unsigned char green = *p_in++;
+ unsigned char blue = *p_in++;
+ if (alpha < 128)
+ {
+ /* skipping a transparent pixel */
+ p_out += 4;
+ }
+ else
+ {
+ *p_out++ = red;
+ *p_out++ = green;
+ *p_out++ = blue;
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+}
+
+static int
+aux_render_composed_image (struct aux_renderer *aux, unsigned char *aggreg_rgba)
+{
+/* rendering a raster image (composed) */
+ unsigned char *rgba = NULL;
+ unsigned char *rgb = NULL;
+ unsigned char *alpha = NULL;
+ rl2GraphicsBitmapPtr base_img = NULL;
+ rl2GraphicsContextPtr ctx = NULL;
+ double rescale_x = (double) aux->width / (double) aux->base_width;
+ double rescale_y = (double) aux->height / (double) aux->base_height;
+
+ if (aux->out_pixel == RL2_PIXEL_PALETTE && aux->palette == NULL)
+ goto error;
+
+ if (aux->base_width == aux->width && aux->base_height == aux->height)
+ {
+ if (aux->out_pixel == RL2_PIXEL_MONOCHROME)
+ {
+ /* Monochrome */
+ copy_monochrome (aggreg_rgba, aux->base_width, aux->base_height,
+ aux->outbuf);
+ aux->outbuf = NULL;
+ }
+ else if (aux->out_pixel == RL2_PIXEL_PALETTE)
+ {
+ /* Palette */
+ copy_palette (aggreg_rgba, aux->base_width, aux->base_height,
+ aux->outbuf, aux->palette, aux->bg_red,
+ aux->bg_green, aux->bg_blue);
+ aux->outbuf = NULL;
+ }
+ else if (aux->out_pixel == RL2_PIXEL_GRAYSCALE)
+ {
+ /* Grayscale */
+ copy_grayscale (aggreg_rgba, aux->base_width, aux->base_height,
+ aux->outbuf, aux->bg_red);
+ aux->outbuf = NULL;
+ }
+ else
+ {
+ /* RGB */
+ copy_rgb (aggreg_rgba, aux->base_width, aux->base_height,
+ aux->outbuf, aux->bg_red, aux->bg_green,
+ aux->bg_blue);
+ aux->outbuf = NULL;
+ }
+ }
+ else
+ {
+ /* rescaling */
+ ctx = rl2_graph_create_context (aux->width, aux->height);
+ if (ctx == NULL)
+ goto error;
+ rgba = malloc (aux->base_width * aux->base_height * 4);
+ if (aux->out_pixel == RL2_PIXEL_MONOCHROME)
+ {
+ /* Monochrome */
+ if (!get_rgba_from_monochrome_transparent
+ (aux->base_width, aux->base_height, aux->outbuf, rgba))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ aux->outbuf = NULL;
+ }
+ else if (aux->out_pixel == RL2_PIXEL_PALETTE)
+ {
+ /* Palette */
+ if (!get_rgba_from_palette_transparent
+ (aux->base_width, aux->base_height, aux->outbuf,
+ aux->palette, rgba, aux->bg_red, aux->bg_green,
+ aux->bg_blue))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ aux->outbuf = NULL;
+ }
+ else if (aux->out_pixel == RL2_PIXEL_GRAYSCALE)
+ {
+ /* Grayscale */
+ if (!get_rgba_from_grayscale_transparent
+ (aux->base_width, aux->base_height, aux->outbuf, rgba,
+ aux->bg_red))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ aux->outbuf = NULL;
+ }
+ else
+ {
+ /* RGB */
+ if (!get_rgba_from_rgb_transparent
+ (aux->base_width, aux->base_height, aux->outbuf, rgba,
+ aux->bg_red, aux->bg_green, aux->bg_blue))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ aux->outbuf = NULL;
+ }
+ base_img =
+ rl2_graph_create_bitmap (rgba, aux->base_width, aux->base_height);
+ if (base_img == NULL)
+ goto error;
+ rgba = NULL;
+ rl2_graph_draw_rescaled_bitmap (ctx, base_img, rescale_x, rescale_y,
+ 0, 0);
+ rl2_graph_destroy_bitmap (base_img);
+ rgb = rl2_graph_get_context_rgb_array (ctx);
+ alpha = rl2_graph_get_context_alpha_array (ctx);
+ rl2_graph_destroy_context (ctx);
+ if (rgb == NULL || alpha == NULL)
+ goto error;
+
+/* copying into the destination buffer */
+ copy_rgb_alpha (aggreg_rgba, aux->width, aux->height, rgb, alpha);
+ free (rgb);
+ free (alpha);
+ }
+ return 1;
+
+ error:
+ if (aux->outbuf != NULL)
+ free (aux->outbuf);
+ if (rgb != NULL)
+ free (rgb);
+ if (alpha != NULL)
+ free (alpha);
+ if (rgba != NULL)
+ free (rgba);
+ return 0;
+}
+
+RL2_PRIVATE int
+rl2_aux_render_image (struct aux_renderer *aux, unsigned char **ximage,
+ int *ximage_size)
+{
+/* rendering a raster image */
+ unsigned char *image = NULL;
+ int image_size;
+ unsigned char *rgb = NULL;
+ unsigned char *alpha = NULL;
+ unsigned char *rgba = NULL;
+ unsigned char *gray = NULL;
+ rl2GraphicsBitmapPtr base_img = NULL;
+ rl2GraphicsContextPtr ctx = NULL;
+ double rescale_x = (double) aux->width / (double) aux->base_width;
+ double rescale_y = (double) aux->height / (double) aux->base_height;
+
+ if (aux->out_pixel == RL2_PIXEL_PALETTE && aux->palette == NULL)
+ goto error;
+
+ if (aux->base_width == aux->width && aux->base_height == aux->height)
+ {
+ if (aux->out_pixel == RL2_PIXEL_MONOCHROME)
+ {
+ /* converting from Monochrome to Grayscale */
+ if (aux->transparent && aux->format_id == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (!get_payload_from_monochrome_transparent
+ (aux->base_width, aux->base_height, aux->outbuf,
+ aux->format_id, aux->quality, &image, &image_size,
+ aux->opacity))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ else
+ {
+ if (!get_payload_from_monochrome_opaque
+ (aux->base_width, aux->base_height, aux->sqlite,
+ aux->minx, aux->miny, aux->maxx, aux->maxy,
+ aux->srid, aux->outbuf, aux->format_id, aux->quality,
+ &image, &image_size))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ aux->outbuf = NULL;
+ }
+ else if (aux->out_pixel == RL2_PIXEL_PALETTE)
+ {
+ /* Palette */
+ if (aux->transparent && aux->format_id == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (!get_payload_from_palette_transparent
+ (aux->base_width, aux->base_height, aux->outbuf,
+ aux->palette, aux->format_id, aux->quality, &image,
+ &image_size, aux->bg_red, aux->bg_green,
+ aux->bg_blue, aux->opacity))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ else
+ {
+ if (!get_payload_from_palette_opaque
+ (aux->base_width, aux->base_height, aux->sqlite,
+ aux->minx, aux->miny, aux->maxx, aux->maxy,
+ aux->srid, aux->outbuf, aux->palette, aux->format_id,
+ aux->quality, &image, &image_size))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ aux->outbuf = NULL;
+ }
+ else if (aux->out_pixel == RL2_PIXEL_GRAYSCALE)
+ {
+ /* Grayscale */
+ if (aux->transparent && aux->format_id == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (!get_payload_from_grayscale_transparent
+ (aux->base_width, aux->base_height, aux->outbuf,
+ aux->format_id, aux->quality, &image, &image_size,
+ aux->bg_red, aux->opacity))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ else
+ {
+ if (!get_payload_from_grayscale_opaque
+ (aux->base_width, aux->base_height, aux->sqlite,
+ aux->minx, aux->miny, aux->maxx, aux->maxy,
+ aux->srid, aux->outbuf, aux->format_id, aux->quality,
+ &image, &image_size))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ aux->outbuf = NULL;
+ }
+ else
+ {
+ /* RGB */
+ if (aux->transparent && aux->format_id == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (!get_payload_from_rgb_transparent
+ (aux->base_width, aux->base_height, aux->outbuf,
+ aux->format_id, aux->quality, &image, &image_size,
+ aux->bg_red, aux->bg_green, aux->bg_blue,
+ aux->opacity))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ else
+ {
+ if (!get_payload_from_rgb_opaque
+ (aux->base_width, aux->base_height, aux->sqlite,
+ aux->minx, aux->miny, aux->maxx, aux->maxy,
+ aux->srid, aux->outbuf, aux->format_id, aux->quality,
+ &image, &image_size))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ aux->outbuf = NULL;
+ }
+ *ximage = image;
+ *ximage_size = image_size;
+ }
+ else
+ {
+ /* rescaling */
+ ctx = rl2_graph_create_context (aux->width, aux->height);
+ if (ctx == NULL)
+ goto error;
+ rgba = malloc (aux->base_width * aux->base_height * 4);
+ if (aux->out_pixel == RL2_PIXEL_MONOCHROME)
+ {
+ /* Monochrome - upsampled */
+ if (aux->transparent && aux->format_id == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (!get_rgba_from_monochrome_transparent
+ (aux->base_width, aux->base_height, aux->outbuf,
+ rgba))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ else
+ {
+ if (!get_rgba_from_monochrome_opaque
+ (aux->base_width, aux->base_height, aux->outbuf,
+ rgba))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ aux->outbuf = NULL;
+ }
+ else if (aux->out_pixel == RL2_PIXEL_PALETTE)
+ {
+ /* Monochrome - upsampled */
+ if (aux->transparent && aux->format_id == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (!get_rgba_from_palette_transparent
+ (aux->base_width, aux->base_height, aux->outbuf,
+ aux->palette, rgba, aux->bg_red, aux->bg_green,
+ aux->bg_blue))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ else
+ {
+ if (!get_rgba_from_palette_opaque
+ (aux->base_width, aux->base_height, aux->outbuf,
+ aux->palette, rgba))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ aux->outbuf = NULL;
+ }
+ else if (aux->out_pixel == RL2_PIXEL_GRAYSCALE)
+ {
+ /* Grayscale */
+ if (aux->transparent && aux->format_id == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (!get_rgba_from_grayscale_transparent
+ (aux->base_width, aux->base_height, aux->outbuf, rgba,
+ aux->bg_red))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ else
+ {
+ if (!get_rgba_from_grayscale_opaque
+ (aux->base_width, aux->base_height, aux->outbuf,
+ rgba))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ aux->outbuf = NULL;
+ }
+ else
+ {
+ /* RGB */
+ if (aux->transparent && aux->format_id == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (!get_rgba_from_rgb_transparent
+ (aux->base_width, aux->base_height, aux->outbuf, rgba,
+ aux->bg_red, aux->bg_green, aux->bg_blue))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ else
+ {
+ if (!get_rgba_from_rgb_opaque
+ (aux->base_width, aux->base_height, aux->outbuf,
+ rgba))
+ {
+ aux->outbuf = NULL;
+ goto error;
+ }
+ }
+ aux->outbuf = NULL;
+ }
+ base_img =
+ rl2_graph_create_bitmap (rgba, aux->base_width, aux->base_height);
+ if (base_img == NULL)
+ goto error;
+ rgba = NULL;
+ rl2_graph_draw_rescaled_bitmap (ctx, base_img, rescale_x, rescale_y,
+ 0, 0);
+ rl2_graph_destroy_bitmap (base_img);
+ rgb = rl2_graph_get_context_rgb_array (ctx);
+ alpha = NULL;
+ if (aux->transparent)
+ alpha = rl2_graph_get_context_alpha_array (ctx);
+ rl2_graph_destroy_context (ctx);
+ if (rgb == NULL)
+ goto error;
+ if (aux->out_pixel == RL2_PIXEL_GRAYSCALE
+ || aux->out_pixel == RL2_PIXEL_MONOCHROME)
+ {
+ /* Grayscale or Monochrome upsampled */
+ if (aux->transparent && aux->format_id == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (alpha == NULL)
+ goto error;
+ if (!get_payload_from_gray_rgba_transparent
+ (aux->width, aux->height, rgb, alpha, aux->format_id,
+ aux->quality, &image, &image_size, aux->opacity))
+ {
+ rgb = NULL;
+ alpha = NULL;
+ goto error;
+ }
+ rgb = NULL;
+ alpha = NULL;
+ }
+ else
+ {
+ if (alpha != NULL)
+ free (alpha);
+ alpha = NULL;
+ if (!get_payload_from_gray_rgba_opaque
+ (aux->width, aux->height, aux->sqlite, aux->minx,
+ aux->miny, aux->maxx, aux->maxy, aux->srid, rgb,
+ aux->format_id, aux->quality, &image, &image_size))
+ {
+ rgb = NULL;
+ goto error;
+ }
+ rgb = NULL;
+ }
+ }
+ else
+ {
+ /* RGB */
+ if (aux->transparent && aux->format_id == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (alpha == NULL)
+ goto error;
+ if (!get_payload_from_rgb_rgba_transparent
+ (aux->width, aux->height, rgb, alpha, aux->format_id,
+ aux->quality, &image, &image_size, aux->opacity))
+ {
+ rgb = NULL;
+ alpha = NULL;
+ goto error;
+ }
+ rgb = NULL;
+ alpha = NULL;
+ }
+ else
+ {
+ if (alpha != NULL)
+ free (alpha);
+ alpha = NULL;
+ if (!get_payload_from_rgb_rgba_opaque
+ (aux->width, aux->height, aux->sqlite, aux->minx,
+ aux->miny, aux->maxx, aux->maxy, aux->srid, rgb,
+ aux->format_id, aux->quality, &image, &image_size))
+ {
+ rgb = NULL;
+ goto error;
+ }
+ rgb = NULL;
+ }
+ }
+ *ximage = image;
+ *ximage_size = image_size;
+ }
+ return 1;
+
+ error:
+ if (aux->outbuf != NULL)
+ free (aux->outbuf);
+ if (rgb != NULL)
+ free (rgb);
+ if (alpha != NULL)
+ free (alpha);
+ if (rgba != NULL)
+ free (rgba);
+ if (gray != NULL)
+ free (gray);
+ return 0;
+}
+
+static int
+aux_render_final_image (struct aux_group_renderer *aux, sqlite3 * sqlite,
+ int srid, unsigned char *rgb, unsigned char *alpha,
+ unsigned char **ximage, int *ximage_size)
+{
+/* rendering a raster image from the cumulative RGB+Alpha buffers */
+ unsigned char *image = NULL;
+ int image_size;
+
+ if (aux->transparent && aux->format_id == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (!get_payload_from_rgb_rgba_transparent
+ (aux->width, aux->height, rgb, alpha, aux->format_id,
+ aux->quality, &image, &image_size, 1.0))
+ {
+ rgb = NULL;
+ alpha = NULL;
+ goto error;
+ }
+ rgb = NULL;
+ alpha = NULL;
+ }
+ else
+ {
+ free (alpha);
+ alpha = NULL;
+ if (!get_payload_from_rgb_rgba_opaque
+ (aux->width, aux->height, sqlite, aux->minx,
+ aux->miny, aux->maxx, aux->maxy, srid, rgb,
+ aux->format_id, aux->quality, &image, &image_size))
+ {
+ rgb = NULL;
+ goto error;
+ }
+ rgb = NULL;
+ }
+
+ *ximage = image;
+ *ximage_size = image_size;
+ return 1;
+
+ error:
+ if (rgb != NULL)
+ free (rgb);
+ if (alpha != NULL)
+ free (alpha);
+ return 0;
+}
+
+static int
+aux_shaded_relief_mask (struct aux_renderer *aux, double relief_factor,
+ unsigned char **shaded_relief)
+{
+/* attempting to create a Shaded Relief brightness-only mask */
+ rl2GraphicsBitmapPtr base_img = NULL;
+ rl2GraphicsContextPtr ctx = NULL;
+ float *shr_mask;
+ int shr_size;
+ const char *coverage;
+ double scale_factor;
+ int row;
+ int col;
+ float *p_in;
+ unsigned char *rgba = NULL;
+ unsigned char *rgb = NULL;
+ unsigned char *p_out;
+ double rescale_x = (double) aux->width / (double) aux->base_width;
+ double rescale_y = (double) aux->height / (double) aux->base_height;
+
+ *shaded_relief = NULL;
+ coverage = rl2_get_coverage_name (aux->coverage);
+ if (coverage == NULL)
+ return 0;
+ scale_factor = rl2_get_shaded_relief_scale_factor (aux->sqlite, coverage);
+
+ if (rl2_build_shaded_relief_mask
+ (aux->sqlite, aux->coverage, relief_factor, scale_factor,
+ aux->base_width, aux->base_height, aux->minx, aux->miny, aux->maxx,
+ aux->maxy, aux->xx_res, aux->yy_res, &shr_mask, &shr_size) != RL2_OK)
+ return 0;
+
+/* allocating the RGBA buffer */
+ rgba = malloc (aux->base_width * aux->base_height * 4);
+ if (rgba == NULL)
+ return 0;
+
+/* priming a full transparent RGBA buffer */
+ memset (rgba, 0, aux->base_width * aux->base_height * 4);
+
+/* creating a pure brightness mask - RGBA */
+ p_in = shr_mask;
+ p_out = rgba;
+ for (row = 0; row < aux->base_height; row++)
+ {
+ for (col = 0; col < aux->base_width; col++)
+ {
+ float coeff = *p_in++;
+ if (coeff < 0.0)
+ p_out += 4; /* transparent */
+ else
+ {
+ unsigned char gray = (unsigned char) (255.0 * coeff);
+ *p_out++ = gray;
+ *p_out++ = gray;
+ *p_out++ = gray;
+ *p_out++ = 255;
+ }
+ }
+ }
+ free (shr_mask);
+
+/* rescaling the brightness mask */
+ ctx = rl2_graph_create_context (aux->width, aux->height);
+ if (ctx == NULL)
+ goto error;
+ base_img =
+ rl2_graph_create_bitmap (rgba, aux->base_width, aux->base_height);
+ if (base_img == NULL)
+ goto error;
+ rgba = NULL;
+ rl2_graph_draw_rescaled_bitmap (ctx, base_img, rescale_x, rescale_y, 0, 0);
+ rl2_graph_destroy_bitmap (base_img);
+ rgb = rl2_graph_get_context_rgb_array (ctx);
+ rl2_graph_destroy_context (ctx);
+ if (rgb == NULL)
+ goto error;
+
+ *shaded_relief = rgb;
+ return 1;
+
+ error:
+ if (rgb != NULL)
+ free (rgb);
+ if (rgba != NULL)
+ free (rgba);
+ return 0;
+}
+
+RL2_PRIVATE void
+rl2_aux_group_renderer (struct aux_group_renderer *auxgrp)
+{
+/* Group Renderer - attempting to render a complex layered image */
+ double x_res;
+ double y_res;
+ double ext_x;
+ double ext_y;
+ int level_id;
+ int scale;
+ int xscale;
+ double xx_res;
+ double yy_res;
+ int base_width;
+ int base_height;
+ double aspect_org;
+ double aspect_dst;
+ double confidence;
+ int srid;
+ int i;
+ double opacity;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+ unsigned char *image = NULL;
+ int image_size;
+ int was_monochrome;
+ unsigned char *rgba = NULL;
+ unsigned char *p_rgba;
+ unsigned char *rgb = NULL;
+ unsigned char *p_rgb;
+ unsigned char *alpha = NULL;
+ unsigned char *p_alpha;
+ unsigned char *shaded_relief_mask = NULL;
+ int row;
+ int col;
+ unsigned char out_pixel = RL2_PIXEL_UNKNOWN;
+ rl2GroupStylePtr group_style = NULL;
+ rl2GroupRendererPtr group = NULL;
+ rl2PrivGroupRendererPtr grp;
+ struct aux_renderer aux;
+ rl2PalettePtr palette = NULL;
+ rl2PrivRasterStylePtr symbolizer = NULL;
+ sqlite3 *sqlite = sqlite3_context_db_handle (auxgrp->context);
+
+ ext_x = auxgrp->maxx - auxgrp->minx;
+ ext_y = auxgrp->maxy - auxgrp->miny;
+ x_res = ext_x / (double) (auxgrp->width);
+ y_res = ext_y / (double) (auxgrp->height);
+
+/* attempting to validate the Group Style */
+ group_style =
+ rl2_create_group_style_from_dbms (sqlite, auxgrp->group_name,
+ auxgrp->style);
+ if (group_style == NULL)
+ goto error;
+
+ group = rl2_create_group_renderer (sqlite, group_style);
+ if (group == NULL)
+ goto error;
+
+/* allocating the cumulative RGBA buffer */
+ rgba = malloc (auxgrp->width * auxgrp->height * 4);
+ if (rgba == NULL)
+ goto error;
+ p_rgba = rgba;
+ for (row = 0; row < auxgrp->height; row++)
+ {
+ for (col = 0; col < auxgrp->width; col++)
+ {
+ /* priming the cumulative RGBA buffer */
+ *p_rgba++ = auxgrp->bg_red;
+ *p_rgba++ = auxgrp->bg_green;
+ *p_rgba++ = auxgrp->bg_blue;
+ *p_rgba++ = 0; /* full transparent */
+ }
+ }
+
+ grp = (rl2PrivGroupRendererPtr) group;
+ for (i = 0; i < grp->count; i++)
+ {
+ /* rendering all rasters on the same canvass */
+ int is_shaded_relief = 0;
+ rl2PrivCoveragePtr cvg;
+ rl2PrivGroupRendererLayerPtr lyr = grp->layers + i;
+ if (lyr->layer_type != RL2_GROUP_RENDERER_RASTER_LAYER)
+ continue;
+ cvg = (rl2PrivCoveragePtr) (lyr->coverage);
+
+ if (cvg->sampleType == RL2_SAMPLE_UINT8
+ && cvg->pixelType == RL2_PIXEL_RGB && cvg->nBands == 3)
+ out_pixel = RL2_PIXEL_RGB;
+ if (cvg->sampleType == RL2_SAMPLE_UINT8
+ && cvg->pixelType == RL2_PIXEL_GRAYSCALE && cvg->nBands == 1)
+ out_pixel = RL2_PIXEL_GRAYSCALE;
+ if (cvg->pixelType == RL2_PIXEL_PALETTE && cvg->nBands == 1)
+ out_pixel = RL2_PIXEL_PALETTE;
+ if (cvg->pixelType == RL2_PIXEL_MONOCHROME && cvg->nBands == 1)
+ out_pixel = RL2_PIXEL_MONOCHROME;
+
+ if (lyr->raster_symbolizer != NULL)
+ {
+ /* applying a RasterSymbolizer */
+ int yes_no;
+ if (lyr->raster_symbolizer->shadedRelief)
+ is_shaded_relief = 1;
+ if (!is_shaded_relief)
+ {
+ if (rl2_is_raster_style_triple_band_selected
+ ((rl2RasterStylePtr) (lyr->raster_symbolizer),
+ &yes_no) == RL2_OK)
+ {
+ if ((cvg->sampleType == RL2_SAMPLE_UINT8
+ || cvg->sampleType == RL2_SAMPLE_UINT16)
+ && (cvg->pixelType == RL2_PIXEL_RGB
+ || cvg->pixelType == RL2_PIXEL_MULTIBAND)
+ && yes_no)
+ out_pixel = RL2_PIXEL_RGB;
+ }
+ if (rl2_is_raster_style_mono_band_selected
+ ((rl2RasterStylePtr) (lyr->raster_symbolizer),
+ &yes_no) == RL2_OK)
+ {
+ if ((cvg->sampleType == RL2_SAMPLE_UINT8
+ || cvg->sampleType == RL2_SAMPLE_UINT16)
+ && (cvg->pixelType == RL2_PIXEL_RGB
+ || cvg->pixelType == RL2_PIXEL_MULTIBAND
+ || cvg->pixelType == RL2_PIXEL_GRAYSCALE)
+ && yes_no)
+ out_pixel = RL2_PIXEL_GRAYSCALE;
+ if ((cvg->sampleType == RL2_SAMPLE_INT8
+ || cvg->sampleType == RL2_SAMPLE_UINT8
+ || cvg->sampleType == RL2_SAMPLE_INT16
+ || cvg->sampleType == RL2_SAMPLE_UINT16
+ || cvg->sampleType == RL2_SAMPLE_INT32
+ || cvg->sampleType == RL2_SAMPLE_UINT32
+ || cvg->sampleType == RL2_SAMPLE_FLOAT
+ || cvg->sampleType == RL2_SAMPLE_DOUBLE)
+ && cvg->pixelType == RL2_PIXEL_DATAGRID
+ && yes_no)
+ out_pixel = RL2_PIXEL_GRAYSCALE;
+ }
+ if (rl2_get_raster_style_opacity
+ ((rl2RasterStylePtr) (lyr->raster_symbolizer),
+ &opacity) != RL2_OK)
+ opacity = 1.0;
+ if (opacity > 1.0)
+ opacity = 1.0;
+ if (opacity < 0.0)
+ opacity = 0.0;
+ if (opacity < 1.0)
+ auxgrp->transparent = 1;
+ if (out_pixel == RL2_PIXEL_UNKNOWN)
+ {
+ fprintf (stderr, "*** Unsupported Pixel !!!!\n");
+ goto error;
+ }
+ }
+ }
+
+ /* retrieving the optimal resolution level */
+ if (!find_best_resolution_level
+ (sqlite, cvg->coverageName, x_res, y_res, &level_id, &scale,
+ &xscale, &xx_res, &yy_res))
+ goto error;
+ base_width = (int) (ext_x / xx_res);
+ base_height = (int) (ext_y / yy_res);
+ if ((base_width <= 0 && base_width >= USHRT_MAX)
+ || (base_height <= 0 && base_height >= USHRT_MAX))
+ goto error;
+ aspect_org = (double) base_width / (double) base_height;
+ aspect_dst = (double) auxgrp->width / (double) auxgrp->height;
+ confidence = aspect_org / 100.0;
+ if (aspect_dst >= (aspect_org - confidence)
+ || aspect_dst <= (aspect_org + confidence))
+ ;
+ else if (aspect_org != aspect_dst && !(auxgrp->reaspect))
+ goto error;
+
+ symbolizer = lyr->raster_symbolizer;
+ if (!is_shaded_relief)
+ {
+ was_monochrome = 0;
+ if (out_pixel == RL2_PIXEL_MONOCHROME)
+ {
+ if (level_id != 0 && scale != 1)
+ {
+ out_pixel = RL2_PIXEL_GRAYSCALE;
+ was_monochrome = 1;
+ }
+ }
+ if (out_pixel == RL2_PIXEL_PALETTE)
+ {
+ if (level_id != 0 && scale != 1)
+ out_pixel = RL2_PIXEL_RGB;
+ }
+ if (rl2_get_coverage_srid (lyr->coverage, &srid) != RL2_OK)
+ srid = -1;
+ if (rl2_get_raw_raster_data_bgcolor
+ (sqlite, lyr->coverage, base_width, base_height,
+ auxgrp->minx, auxgrp->miny, auxgrp->maxx, auxgrp->maxy,
+ xx_res, yy_res, &outbuf, &outbuf_size, &palette,
+ &out_pixel, auxgrp->bg_red, auxgrp->bg_green,
+ auxgrp->bg_blue, (rl2RasterStylePtr) symbolizer,
+ (rl2RasterStatisticsPtr) (lyr->raster_stats)) != RL2_OK)
+ goto error;
+ if (out_pixel == RL2_PIXEL_PALETTE && palette == NULL)
+ goto error;
+ if (was_monochrome && out_pixel == RL2_PIXEL_GRAYSCALE)
+ symbolizer = NULL;
+ }
+
+/* preparing the aux struct for passing rendering arguments */
+ aux.sqlite = sqlite;
+ aux.width = auxgrp->width;
+ aux.height = auxgrp->height;
+ aux.base_width = base_width;
+ aux.base_height = base_height;
+ aux.minx = auxgrp->minx;
+ aux.miny = auxgrp->miny;
+ aux.maxx = auxgrp->maxx;
+ aux.maxy = auxgrp->maxy;
+ aux.srid = srid;
+ aux.xx_res = xx_res;
+ aux.yy_res = yy_res;
+ aux.transparent = auxgrp->transparent;
+ aux.opacity = opacity;
+ aux.quality = auxgrp->quality;
+ aux.format_id = auxgrp->format_id;
+ aux.bg_red = auxgrp->bg_red;
+ aux.bg_green = auxgrp->bg_green;
+ aux.bg_blue = auxgrp->bg_blue;
+ aux.coverage = lyr->coverage;
+ aux.symbolizer = (rl2RasterStylePtr) symbolizer;
+ aux.stats = (rl2RasterStatisticsPtr) (lyr->raster_stats);
+ aux.outbuf = outbuf;
+ aux.palette = palette;
+ aux.out_pixel = out_pixel;
+ if (is_shaded_relief)
+ {
+ /* requesting a shaded relief mask */
+ if (shaded_relief_mask != NULL)
+ free (shaded_relief_mask);
+ if (!aux_shaded_relief_mask
+ (&aux, symbolizer->reliefFactor, &shaded_relief_mask))
+ goto error;
+ }
+ else
+ {
+ /* rendering an image */
+ if (!aux_render_composed_image (&aux, rgba))
+ goto error;
+ }
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ palette = NULL;
+ }
+
+/* transforming the RGBA buffer into RGB+Alpha */
+ rgb = malloc (auxgrp->width * auxgrp->height * 3);
+ alpha = malloc (auxgrp->width * auxgrp->height);
+ if (rgb == NULL || alpha == NULL)
+ goto error;
+ p_rgba = rgba;
+ p_rgb = rgb;
+ p_alpha = alpha;
+ for (row = 0; row < auxgrp->height; row++)
+ {
+ for (col = 0; col < auxgrp->width; col++)
+ {
+ /* splitting the cumulative RGBA buffer into RGB+Alpha */
+ *p_rgb++ = *p_rgba++;
+ *p_rgb++ = *p_rgba++;
+ *p_rgb++ = *p_rgba++;
+ *p_alpha++ = *p_rgba++;
+ }
+ }
+ free (rgba);
+ rgba = NULL;
+
+ if (shaded_relief_mask != NULL)
+ {
+ /* applying the Shaded Relief */
+ unsigned char *p_in = shaded_relief_mask;
+ p_rgb = rgb;
+ p_alpha = alpha;
+ for (row = 0; row < auxgrp->height; row++)
+ {
+ for (col = 0; col < auxgrp->width; col++)
+ {
+ float coeff;
+ unsigned char v = *p_in;
+ unsigned char a = *p_alpha++;
+ p_in += 3;
+ if (a < 128)
+ {
+ /* transparency */
+ p_rgb += 3;
+ continue;
+ }
+ if (v == 0)
+ coeff = -1.0;
+ else
+ coeff = (float) v / 255.0;
+ if (coeff < 0.0)
+ p_rgb += 3; /* unaffected */
+ else
+ {
+ unsigned char r = *p_rgb;
+ unsigned char g = *(p_rgb + 1);
+ unsigned char b = *(p_rgb + 2);
+ *p_rgb++ = (unsigned char) (r * coeff);
+ *p_rgb++ = (unsigned char) (g * coeff);
+ *p_rgb++ = (unsigned char) (b * coeff);
+ }
+ }
+ }
+ free (shaded_relief_mask);
+ }
+
+/* exporting the final composite image */
+ if (!aux_render_final_image
+ (auxgrp, sqlite, srid, rgb, alpha, &image, &image_size))
+ {
+ rgb = NULL;
+ alpha = NULL;
+ goto error;
+ }
+ sqlite3_result_blob (auxgrp->context, image, image_size, free);
+ rl2_destroy_group_style (group_style);
+ rl2_destroy_group_renderer (group);
+ return;
+
+ error:
+ if (shaded_relief_mask != NULL)
+ free (shaded_relief_mask);
+ if (rgba != NULL)
+ free (rgba);
+ if (rgb != NULL)
+ free (rgb);
+ if (alpha != NULL)
+ free (alpha);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ if (group_style != NULL)
+ rl2_destroy_group_style (group_style);
+ if (group != NULL)
+ rl2_destroy_group_renderer (group);
+ sqlite3_result_null (auxgrp->context);
+}
diff --git a/src/rl2codec.c b/src/rl2codec.c
new file mode 100644
index 0000000..a01f423
--- /dev/null
+++ b/src/rl2codec.c
@@ -0,0 +1,7137 @@
+/*
+
+ rl2codec -- encoding/decoding functions
+
+ version 0.1, 2013 April 1
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#include <zlib.h>
+#include <lzma.h>
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2tiff.h"
+#include "rasterlite2_private.h"
+
+static int
+endianArch ()
+{
+/* checking if target CPU is a little-endian one */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static void
+exportU16 (unsigned char *p, unsigned short value, int little_endian,
+ int little_endian_arch)
+{
+/* stores a 16bit int into a BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[2];
+ unsigned short int_value;
+ } convert;
+ convert.int_value = value;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 1) = convert.byte[0];
+ *(p + 0) = convert.byte[1];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 1) = convert.byte[0];
+ *(p + 0) = convert.byte[1];
+ }
+ }
+}
+
+static short
+import16 (const unsigned char *p, int little_endian, int little_endian_arch)
+{
+/* fetches a 16bit int from BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[2];
+ short int_value;
+ } convert;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 1);
+ convert.byte[1] = *(p + 0);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 1);
+ convert.byte[1] = *(p + 0);
+ }
+ }
+ return convert.int_value;
+}
+
+static void
+export16 (unsigned char *p, short value, int little_endian,
+ int little_endian_arch)
+{
+/* stores a 16bit int into a BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[2];
+ short int_value;
+ } convert;
+ convert.int_value = value;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 1) = convert.byte[0];
+ *(p + 0) = convert.byte[1];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 1) = convert.byte[0];
+ *(p + 0) = convert.byte[1];
+ }
+ }
+}
+
+static unsigned short
+importU16 (const unsigned char *p, int little_endian, int little_endian_arch)
+{
+/* fetches a 16bit uint from BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[2];
+ unsigned short int_value;
+ } convert;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 1);
+ convert.byte[1] = *(p + 0);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 1);
+ convert.byte[1] = *(p + 0);
+ }
+ }
+ return convert.int_value;
+}
+
+static void
+exportU32 (unsigned char *p, unsigned int value, int little_endian,
+ int little_endian_arch)
+{
+/* stores a 32bit int into a BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[4];
+ unsigned int int_value;
+ } convert;
+ convert.int_value = value;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 3) = convert.byte[0];
+ *(p + 2) = convert.byte[1];
+ *(p + 1) = convert.byte[2];
+ *(p + 0) = convert.byte[3];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ *(p + 2) = convert.byte[2];
+ *(p + 3) = convert.byte[3];
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ *(p + 2) = convert.byte[2];
+ *(p + 3) = convert.byte[3];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 3) = convert.byte[0];
+ *(p + 2) = convert.byte[1];
+ *(p + 1) = convert.byte[2];
+ *(p + 0) = convert.byte[3];
+ }
+ }
+}
+
+static unsigned int
+importU32 (const unsigned char *p, int little_endian, int little_endian_arch)
+{
+/* fetches a 32bit uint from BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[4];
+ unsigned int int_value;
+ } convert;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 3);
+ convert.byte[1] = *(p + 2);
+ convert.byte[2] = *(p + 1);
+ convert.byte[3] = *(p + 0);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ convert.byte[2] = *(p + 2);
+ convert.byte[3] = *(p + 3);
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ convert.byte[2] = *(p + 2);
+ convert.byte[3] = *(p + 3);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 3);
+ convert.byte[1] = *(p + 2);
+ convert.byte[2] = *(p + 1);
+ convert.byte[3] = *(p + 0);
+ }
+ }
+ return convert.int_value;
+}
+
+static void
+export32 (unsigned char *p, int value, int little_endian,
+ int little_endian_arch)
+{
+/* stores a 32bit int into a BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = value;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 3) = convert.byte[0];
+ *(p + 2) = convert.byte[1];
+ *(p + 1) = convert.byte[2];
+ *(p + 0) = convert.byte[3];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ *(p + 2) = convert.byte[2];
+ *(p + 3) = convert.byte[3];
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ *(p + 2) = convert.byte[2];
+ *(p + 3) = convert.byte[3];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 3) = convert.byte[0];
+ *(p + 2) = convert.byte[1];
+ *(p + 1) = convert.byte[2];
+ *(p + 0) = convert.byte[3];
+ }
+ }
+}
+
+static int
+import32 (const unsigned char *p, int little_endian, int little_endian_arch)
+{
+/* fetches a 32bit int from BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 3);
+ convert.byte[1] = *(p + 2);
+ convert.byte[2] = *(p + 1);
+ convert.byte[3] = *(p + 0);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ convert.byte[2] = *(p + 2);
+ convert.byte[3] = *(p + 3);
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ convert.byte[2] = *(p + 2);
+ convert.byte[3] = *(p + 3);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 3);
+ convert.byte[1] = *(p + 2);
+ convert.byte[2] = *(p + 1);
+ convert.byte[3] = *(p + 0);
+ }
+ }
+ return convert.int_value;
+}
+
+static void
+exportFloat (unsigned char *p, float value, int little_endian,
+ int little_endian_arch)
+{
+/* stores a 32bit Float into a BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[4];
+ float flt_value;
+ } convert;
+ convert.flt_value = value;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 3) = convert.byte[0];
+ *(p + 2) = convert.byte[1];
+ *(p + 1) = convert.byte[2];
+ *(p + 0) = convert.byte[3];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ *(p + 2) = convert.byte[2];
+ *(p + 3) = convert.byte[3];
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ *(p + 2) = convert.byte[2];
+ *(p + 3) = convert.byte[3];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 3) = convert.byte[0];
+ *(p + 2) = convert.byte[1];
+ *(p + 1) = convert.byte[2];
+ *(p + 0) = convert.byte[3];
+ }
+ }
+}
+
+static float
+importFloat (const unsigned char *p, int little_endian, int little_endian_arch)
+{
+/* fetches a 32bit Float from BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[4];
+ float flt_value;
+ } convert;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 3);
+ convert.byte[1] = *(p + 2);
+ convert.byte[2] = *(p + 1);
+ convert.byte[3] = *(p + 0);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ convert.byte[2] = *(p + 2);
+ convert.byte[3] = *(p + 3);
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ convert.byte[2] = *(p + 2);
+ convert.byte[3] = *(p + 3);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 3);
+ convert.byte[1] = *(p + 2);
+ convert.byte[2] = *(p + 1);
+ convert.byte[3] = *(p + 0);
+ }
+ }
+ return convert.flt_value;
+}
+
+static void
+exportDouble (unsigned char *p, double value, int little_endian,
+ int little_endian_arch)
+{
+/* stores a Double into a BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[8];
+ double dbl_value;
+ } convert;
+ convert.dbl_value = value;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 7) = convert.byte[0];
+ *(p + 6) = convert.byte[1];
+ *(p + 5) = convert.byte[2];
+ *(p + 4) = convert.byte[3];
+ *(p + 3) = convert.byte[4];
+ *(p + 2) = convert.byte[5];
+ *(p + 1) = convert.byte[6];
+ *(p + 0) = convert.byte[7];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ *(p + 2) = convert.byte[2];
+ *(p + 3) = convert.byte[3];
+ *(p + 4) = convert.byte[4];
+ *(p + 5) = convert.byte[5];
+ *(p + 6) = convert.byte[6];
+ *(p + 7) = convert.byte[7];
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ *(p + 0) = convert.byte[0];
+ *(p + 1) = convert.byte[1];
+ *(p + 2) = convert.byte[2];
+ *(p + 3) = convert.byte[3];
+ *(p + 4) = convert.byte[4];
+ *(p + 5) = convert.byte[5];
+ *(p + 6) = convert.byte[6];
+ *(p + 7) = convert.byte[7];
+ }
+ else
+ {
+ /* Little Endian data */
+ *(p + 7) = convert.byte[0];
+ *(p + 6) = convert.byte[1];
+ *(p + 5) = convert.byte[2];
+ *(p + 4) = convert.byte[3];
+ *(p + 3) = convert.byte[4];
+ *(p + 2) = convert.byte[5];
+ *(p + 1) = convert.byte[6];
+ *(p + 0) = convert.byte[7];
+ }
+ }
+}
+
+static double
+importDouble (const unsigned char *p, int little_endian, int little_endian_arch)
+{
+/* fetches a Double from BLOB respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[8];
+ double dbl_value;
+ } convert;
+ if (little_endian_arch)
+ {
+ /* Litte-Endian architecture [e.g. x86] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 7);
+ convert.byte[1] = *(p + 6);
+ convert.byte[2] = *(p + 5);
+ convert.byte[3] = *(p + 4);
+ convert.byte[4] = *(p + 3);
+ convert.byte[5] = *(p + 2);
+ convert.byte[6] = *(p + 1);
+ convert.byte[7] = *(p + 0);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ convert.byte[2] = *(p + 2);
+ convert.byte[3] = *(p + 3);
+ convert.byte[4] = *(p + 4);
+ convert.byte[5] = *(p + 5);
+ convert.byte[6] = *(p + 6);
+ convert.byte[7] = *(p + 7);
+ }
+ }
+ else
+ {
+ /* Big Endian architecture [e.g. PPC] */
+ if (!little_endian)
+ {
+ /* Big Endian data */
+ convert.byte[0] = *(p + 0);
+ convert.byte[1] = *(p + 1);
+ convert.byte[2] = *(p + 2);
+ convert.byte[3] = *(p + 3);
+ convert.byte[4] = *(p + 4);
+ convert.byte[5] = *(p + 5);
+ convert.byte[6] = *(p + 6);
+ convert.byte[7] = *(p + 7);
+ }
+ else
+ {
+ /* Little Endian data */
+ convert.byte[0] = *(p + 7);
+ convert.byte[1] = *(p + 6);
+ convert.byte[2] = *(p + 5);
+ convert.byte[3] = *(p + 4);
+ convert.byte[4] = *(p + 3);
+ convert.byte[5] = *(p + 2);
+ convert.byte[6] = *(p + 1);
+ convert.byte[7] = *(p + 0);
+ }
+ }
+ return convert.dbl_value;
+}
+
+static short
+swapINT16 (short value)
+{
+/* swaps a INT16 respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[4];
+ short value;
+ } convert1;
+ union cvt convert2;
+ convert1.value = value;
+ convert2.byte[0] = convert1.byte[1];
+ convert2.byte[1] = convert1.byte[0];
+ return convert2.value;
+}
+
+static unsigned short
+swapUINT16 (unsigned short value)
+{
+/* swaps a UINT16 respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[4];
+ unsigned short value;
+ } convert1;
+ union cvt convert2;
+ convert1.value = value;
+ convert2.byte[0] = convert1.byte[1];
+ convert2.byte[1] = convert1.byte[0];
+ return convert2.value;
+}
+
+static int
+swapINT32 (int value)
+{
+/* swaps an INT32 respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[4];
+ int value;
+ } convert1;
+ union cvt convert2;
+ convert1.value = value;
+ convert2.byte[0] = convert1.byte[3];
+ convert2.byte[1] = convert1.byte[2];
+ convert2.byte[2] = convert1.byte[1];
+ convert2.byte[3] = convert1.byte[0];
+ return convert2.value;
+}
+
+static unsigned int
+swapUINT32 (unsigned int value)
+{
+/* swaps a UINT32 respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[4];
+ unsigned int value;
+ } convert1;
+ union cvt convert2;
+ convert1.value = value;
+ convert2.byte[0] = convert1.byte[3];
+ convert2.byte[1] = convert1.byte[2];
+ convert2.byte[2] = convert1.byte[1];
+ convert2.byte[3] = convert1.byte[0];
+ return convert2.value;
+}
+
+static float
+swapFloat (float value)
+{
+/* swaps a Float respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[4];
+ float value;
+ } convert1;
+ union cvt convert2;
+ convert1.value = value;
+ convert2.byte[0] = convert1.byte[3];
+ convert2.byte[1] = convert1.byte[2];
+ convert2.byte[2] = convert1.byte[1];
+ convert2.byte[3] = convert1.byte[0];
+ return convert2.value;
+}
+
+static double
+swapDouble (double value)
+{
+/* swaps a Double respecting declared endiannes */
+ union cvt
+ {
+ unsigned char byte[8];
+ double value;
+ } convert1;
+ union cvt convert2;
+ convert1.value = value;
+ convert2.byte[0] = convert1.byte[7];
+ convert2.byte[1] = convert1.byte[6];
+ convert2.byte[2] = convert1.byte[5];
+ convert2.byte[3] = convert1.byte[4];
+ convert2.byte[4] = convert1.byte[3];
+ convert2.byte[5] = convert1.byte[2];
+ convert2.byte[6] = convert1.byte[1];
+ convert2.byte[7] = convert1.byte[0];
+ return convert2.value;
+}
+
+static int
+check_encode_self_consistency (unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_samples,
+ unsigned char compression)
+{
+/* checking overall self-consistency for coverage params */
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (sample_type != RL2_SAMPLE_1_BIT || num_samples != 1)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_PNG:
+ case RL2_COMPRESSION_CCITTFAX4:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 1)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_PNG:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 1)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_PNG:
+ case RL2_COMPRESSION_JPEG:
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ case RL2_PIXEL_RGB:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_UINT16:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 3)
+ return 0;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ {
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ break;
+ default:
+ return 0;
+ };
+ }
+ else
+ {
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_PNG:
+ case RL2_COMPRESSION_JPEG:
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ break;
+ default:
+ return 0;
+ };
+ }
+ break;
+ case RL2_PIXEL_MULTIBAND:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_UINT16:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples < 2)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ case RL2_PIXEL_DATAGRID:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ case RL2_SAMPLE_DOUBLE:
+ break;
+ default:
+ return 0;
+ };
+ if (num_samples != 1)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ };
+ return 1;
+}
+
+static int
+pack_rle_rows (rl2PrivRasterPtr raster, unsigned char *in,
+ unsigned char **pixels, int *size)
+{
+/* creating an RLE encoded 1-BIT pixel buffer */
+ int sz = 0;
+ unsigned char *p_in = in;
+ unsigned char *rle;
+ unsigned char *p_out;
+ unsigned int row;
+ unsigned int col;
+
+ for (row = 0; row < raster->height; row++)
+ {
+ int cnt = 0;
+ int pix = *p_in;
+ for (col = 0; col < raster->width; col++)
+ {
+ /* computing the required size */
+ if (pix == *p_in)
+ {
+ if (cnt == 128)
+ {
+ sz++;
+ cnt = 1;
+ }
+ else
+ cnt++;
+ }
+ else
+ {
+ sz++;
+ pix = *p_in;
+ cnt = 1;
+ }
+ p_in++;
+ }
+ sz++;
+ }
+
+ rle = malloc (sz);
+ p_out = rle;
+ p_in = in;
+ for (row = 0; row < raster->height; row++)
+ {
+ char byte;
+ int cnt = 0;
+ int pix = *p_in;
+ for (col = 0; col < raster->width; col++)
+ {
+ /* RLE encoding */
+ if (pix == *p_in)
+ {
+ if (cnt == 128)
+ {
+ if (pix == 1)
+ {
+ byte = 127;
+ *p_out++ = byte;
+ }
+ else
+ {
+ byte = -128;
+ *p_out++ = byte;
+ }
+ cnt = 1;
+ }
+ else
+ cnt++;
+ }
+ else
+ {
+ if (pix == 1)
+ {
+ byte = cnt - 1;
+ *p_out++ = byte;
+ }
+ else
+ {
+ byte = cnt * -1;
+ *p_out++ = byte;
+ }
+ pix = *p_in;
+ cnt = 1;
+ }
+ p_in++;
+ }
+ if (pix == 1)
+ {
+ byte = cnt - 1;
+ *p_out++ = byte;
+ }
+ else
+ {
+ byte = cnt * -1;
+ *p_out++ = byte;
+ }
+ }
+ *pixels = rle;
+ *size = sz;
+ return 1;
+}
+
+static int
+unpack_rle (unsigned short width, unsigned short height,
+ const unsigned char *pixels_in, int pixels_in_sz,
+ unsigned char **pixels, int *pixels_sz)
+{
+/* unpacking an RLE encoded 1-BIT raster */
+ unsigned char *buf;
+ int buf_size;
+ int col;
+ int byte;
+ int i;
+ unsigned char px;
+ int row_stride;
+ int row_no;
+ int cnt;
+ unsigned char *p_out;
+ const char *p_in;
+
+ p_in = (char *) pixels_in;
+ row_stride = 0;
+ row_no = 0;
+ for (col = 0; col < pixels_in_sz; col++)
+ {
+ /* checking the encoded buffer for validity */
+ byte = *p_in++;
+ if (byte < 0)
+ row_stride += byte * -1;
+ else
+ row_stride += byte + 1;
+ if (row_stride == width)
+ {
+ row_stride = 0;
+ row_no++;
+ }
+ else if (row_stride > width)
+ goto error;
+ }
+
+ buf_size = width * height;
+ buf = malloc (buf_size);
+ if (buf == NULL)
+ return 0;
+
+ p_in = (char *) pixels_in;
+ p_out = buf;
+ row_stride = 0;
+ row_no = 0;
+ for (col = 0; col < pixels_in_sz; col++)
+ {
+ /* decoding the buffer */
+ byte = *p_in++;
+ if (byte < 0)
+ {
+ px = 0;
+ cnt = byte * -1;
+ }
+ else
+ {
+ px = 1;
+ cnt = byte + 1;
+ }
+ for (i = 0; i < cnt; i++)
+ *p_out++ = px;
+ }
+
+ *pixels = buf;
+ *pixels_sz = buf_size;
+ return 1;
+ error:
+ return 0;
+}
+
+static int
+pack_1bit_rows (rl2PrivRasterPtr raster, unsigned char *in, int *xrow_stride,
+ unsigned char **pixels, int *size)
+{
+/* creating a packed 1-BIT pixel buffer */
+ int row_stride = 0;
+ unsigned char *pix_buf = NULL;
+ int pix_size;
+ unsigned int row;
+ unsigned int col;
+ int cnt = 0;
+ unsigned char *p_in = in;
+
+/* computing the required sizes */
+ for (col = 0; col < raster->width; col++)
+ {
+ if (cnt == 0)
+ row_stride++;
+ if (cnt == 7)
+ cnt = 0;
+ else
+ cnt++;
+ }
+ pix_size = raster->height * row_stride;
+
+/* allocating the pixel buffers */
+ pix_buf = malloc (pix_size);
+ if (pix_buf == NULL)
+ return 0;
+
+/* pixels packing */
+ for (row = 0; row < raster->height; row++)
+ {
+ unsigned char *p_out = pix_buf + (row_stride * row);
+ unsigned char packed = 0x00;
+ unsigned char pixel;
+ cnt = 0;
+ for (col = 0; col < raster->width; col++)
+ {
+ pixel = *p_in++;
+ switch (cnt)
+ {
+ case 0:
+ if (pixel != 0)
+ packed |= 0x80;
+ break;
+ case 1:
+ if (pixel != 0)
+ packed |= 0x40;
+ break;
+ case 2:
+ if (pixel != 0)
+ packed |= 0x20;
+ break;
+ case 3:
+ if (pixel != 0)
+ packed |= 0x10;
+ break;
+ case 4:
+ if (pixel != 0)
+ packed |= 0x08;
+ break;
+ case 5:
+ if (pixel != 0)
+ packed |= 0x04;
+ break;
+ case 6:
+ if (pixel != 0)
+ packed |= 0x02;
+ break;
+ case 7:
+ if (pixel != 0)
+ packed |= 0x01;
+ break;
+ };
+ if (cnt == 7)
+ {
+ *p_out++ = packed;
+ packed = 0x00;
+ cnt = 0;
+ }
+ else
+ cnt++;
+ }
+ if (cnt != 0)
+ *p_out++ = packed;
+ }
+
+ *xrow_stride = row_stride;
+ *pixels = pix_buf;
+ *size = pix_size;
+ return 1;
+}
+
+static int
+pack_2bit_rows (rl2PrivRasterPtr raster, int *xrow_stride,
+ unsigned char **pixels, int *size)
+{
+/* creating a packed 2-BIT pixel buffer */
+ int row_stride = 0;
+ unsigned char *pix_buf = NULL;
+ int pix_size;
+ unsigned int row;
+ unsigned int col;
+ int cnt = 0;
+ unsigned char *p_in = raster->rasterBuffer;
+
+/* computing the required sizes */
+ for (col = 0; col < raster->width; col++)
+ {
+ if (cnt == 0)
+ row_stride++;
+ if (cnt == 3)
+ cnt = 0;
+ else
+ cnt++;
+ }
+ pix_size = raster->height * row_stride;
+
+/* allocating the pixel buffers */
+ pix_buf = malloc (pix_size);
+ if (pix_buf == NULL)
+ return 0;
+
+/* pixels packing */
+ for (row = 0; row < raster->height; row++)
+ {
+ unsigned char *p_out = pix_buf + (row_stride * row);
+ unsigned char packed = 0x00;
+ unsigned char pixel;
+ cnt = 0;
+ for (col = 0; col < raster->width; col++)
+ {
+ pixel = *p_in++;
+ switch (cnt)
+ {
+ case 0:
+ switch (pixel)
+ {
+ case 1:
+ packed |= 0x40;
+ break;
+ case 2:
+ packed |= 0x80;
+ break;
+ case 3:
+ packed |= 0xc0;
+ break;
+ };
+ break;
+ case 1:
+ switch (pixel)
+ {
+ case 1:
+ packed |= 0x10;
+ break;
+ case 2:
+ packed |= 0x20;
+ break;
+ case 3:
+ packed |= 0x30;
+ break;
+ };
+ break;
+ case 2:
+ switch (pixel)
+ {
+ case 1:
+ packed |= 0x04;
+ break;
+ case 2:
+ packed |= 0x08;
+ break;
+ case 3:
+ packed |= 0x0c;
+ break;
+ };
+ break;
+ case 3:
+ switch (pixel)
+ {
+ case 1:
+ packed |= 0x01;
+ break;
+ case 2:
+ packed |= 0x02;
+ break;
+ case 3:
+ packed |= 0x03;
+ break;
+ };
+ break;
+ };
+ if (cnt == 3)
+ {
+ *p_out++ = packed;
+ packed = 0x00;
+ cnt = 0;
+ }
+ else
+ cnt++;
+ }
+ if (cnt != 0)
+ *p_out++ = packed;
+ }
+
+ *xrow_stride = row_stride;
+ *pixels = pix_buf;
+ *size = pix_size;
+ return 1;
+}
+
+static int
+pack_4bit_rows (rl2PrivRasterPtr raster, int *xrow_stride,
+ unsigned char **pixels, int *size)
+{
+/* creating a packed 4-BIT pixel buffer */
+ int row_stride = 0;
+ unsigned char *pix_buf = NULL;
+ int pix_size;
+ unsigned int row;
+ unsigned int col;
+ int cnt = 0;
+ unsigned char *p_in = raster->rasterBuffer;
+
+/* computing the required sizes */
+ for (col = 0; col < raster->width; col++)
+ {
+ if (cnt == 0)
+ row_stride++;
+ if (cnt == 1)
+ cnt = 0;
+ else
+ cnt++;
+ }
+ pix_size = raster->height * row_stride;
+
+/* allocating the pixel buffers */
+ pix_buf = malloc (pix_size);
+ if (pix_buf == NULL)
+ return 0;
+
+/* pixels packing */
+ for (row = 0; row < raster->height; row++)
+ {
+ unsigned char *p_out = pix_buf + (row_stride * row);
+ unsigned char packed = 0x00;
+ unsigned char pixel;
+ cnt = 0;
+ for (col = 0; col < raster->width; col++)
+ {
+ pixel = *p_in++;
+ switch (cnt)
+ {
+ case 0:
+ switch (pixel)
+ {
+ case 1:
+ packed |= 0x10;
+ break;
+ case 2:
+ packed |= 0x20;
+ break;
+ case 3:
+ packed |= 0x30;
+ break;
+ case 4:
+ packed |= 0x40;
+ break;
+ case 5:
+ packed |= 0x50;
+ break;
+ case 6:
+ packed |= 0x60;
+ break;
+ case 7:
+ packed |= 0x70;
+ break;
+ case 8:
+ packed |= 0x80;
+ break;
+ case 9:
+ packed |= 0x90;
+ break;
+ case 10:
+ packed |= 0xa0;
+ break;
+ case 11:
+ packed |= 0xb0;
+ break;
+ case 12:
+ packed |= 0xc0;
+ break;
+ case 13:
+ packed |= 0xd0;
+ break;
+ case 14:
+ packed |= 0xe0;
+ break;
+ case 15:
+ packed |= 0xf0;
+ break;
+ };
+ break;
+ case 1:
+ switch (pixel)
+ {
+ case 1:
+ packed |= 0x01;
+ break;
+ case 2:
+ packed |= 0x02;
+ break;
+ case 3:
+ packed |= 0x03;
+ break;
+ case 4:
+ packed |= 0x04;
+ break;
+ case 5:
+ packed |= 0x05;
+ break;
+ case 6:
+ packed |= 0x06;
+ break;
+ case 7:
+ packed |= 0x07;
+ break;
+ case 8:
+ packed |= 0x08;
+ break;
+ case 9:
+ packed |= 0x09;
+ break;
+ case 10:
+ packed |= 0x0a;
+ break;
+ case 11:
+ packed |= 0x0b;
+ break;
+ case 12:
+ packed |= 0x0c;
+ break;
+ case 13:
+ packed |= 0x0d;
+ break;
+ case 14:
+ packed |= 0x0e;
+ break;
+ case 15:
+ packed |= 0x0f;
+ break;
+ };
+ break;
+ };
+ if (cnt == 1)
+ {
+ *p_out++ = packed;
+ packed = 0x00;
+ cnt = 0;
+ }
+ else
+ cnt++;
+ }
+ if (cnt != 0)
+ *p_out++ = packed;
+ }
+
+ *xrow_stride = row_stride;
+ *pixels = pix_buf;
+ *size = pix_size;
+ return 1;
+}
+
+static void
+feed_odd_even_int8 (void *in, unsigned int width, unsigned int height,
+ int bands, void *pix_odd, void *pix_even)
+{
+/* feeding Odd/Even pixel buffers - INT8 */
+ char *p_in;
+ char *p_odd = pix_odd;
+ char *p_even = pix_even;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = in;
+ for (row = 0; row < height; row += 2)
+ {
+ for (col = 0; col < width * bands; col++)
+ *p_odd++ = *p_in++;
+ p_in += width * bands;
+ }
+
+ p_in = in;
+ for (row = 1; row < height; row += 2)
+ {
+ p_in += width * bands;
+ for (col = 0; col < width * bands; col++)
+ *p_even++ = *p_in++;
+ }
+}
+
+static void
+feed_odd_even_uint8 (void *in, unsigned int width, unsigned int height,
+ int bands, void *pix_odd, void *pix_even)
+{
+/* feeding Odd/Even pixel buffers - UINT8 */
+ unsigned char *p_in;
+ unsigned char *p_odd = pix_odd;
+ unsigned char *p_even = pix_even;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = in;
+ for (row = 0; row < height; row += 2)
+ {
+ for (col = 0; col < width * bands; col++)
+ *p_odd++ = *p_in++;
+ p_in += width * bands;
+ }
+
+ p_in = in;
+ for (row = 1; row < height; row += 2)
+ {
+ p_in += width * bands;
+ for (col = 0; col < width * bands; col++)
+ *p_even++ = *p_in++;
+ }
+}
+
+static void
+feed_odd_even_int16 (void *in, unsigned int width, unsigned int height,
+ int bands, void *pix_odd, void *pix_even, int swap)
+{
+/* feeding Odd/Even pixel buffers - INT16 */
+ short *p_in;
+ short *p_odd = pix_odd;
+ short *p_even = pix_even;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = in;
+ for (row = 0; row < height; row += 2)
+ {
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_odd++ = swapINT16 (*p_in++);
+ else
+ *p_odd++ = *p_in++;
+ }
+ p_in += width * bands;
+ }
+
+ p_in = in;
+ for (row = 1; row < height; row += 2)
+ {
+ p_in += width * bands;
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_even++ = swapINT16 (*p_in++);
+ else
+ *p_even++ = *p_in++;
+ }
+ }
+}
+
+static void
+feed_odd_even_uint16 (void *in, unsigned int width, unsigned int height,
+ int bands, void *pix_odd, void *pix_even, int swap)
+{
+/* feeding Odd/Even pixel buffers - UINT16 */
+ unsigned short *p_in;
+ unsigned short *p_odd = pix_odd;
+ unsigned short *p_even = pix_even;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = in;
+ for (row = 0; row < height; row += 2)
+ {
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_odd++ = swapUINT16 (*p_in++);
+ else
+ *p_odd++ = *p_in++;
+ }
+ p_in += width * bands;
+ }
+
+ p_in = in;
+ for (row = 1; row < height; row += 2)
+ {
+ p_in += width * bands;
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_even++ = swapUINT16 (*p_in++);
+ else
+ *p_even++ = *p_in++;
+ }
+ }
+}
+
+static void
+feed_odd_even_int32 (void *in, unsigned int width, unsigned int height,
+ int bands, void *pix_odd, void *pix_even, int swap)
+{
+/* feeding Odd/Even pixel buffers - INT32 */
+ int *p_in;
+ int *p_odd = pix_odd;
+ int *p_even = pix_even;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = in;
+ for (row = 0; row < height; row += 2)
+ {
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_odd++ = swapINT32 (*p_in++);
+ else
+ *p_odd++ = *p_in++;
+ }
+ p_in += width * bands;
+ }
+
+ p_in = in;
+ for (row = 1; row < height; row += 2)
+ {
+ p_in += width * bands;
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_even++ = swapINT32 (*p_in++);
+ else
+ *p_even++ = *p_in++;
+ }
+ }
+}
+
+static void
+feed_odd_even_uint32 (void *in, unsigned int width, unsigned int height,
+ int bands, void *pix_odd, void *pix_even, int swap)
+{
+/* feeding Odd/Even pixel buffers - UINT32 */
+ unsigned int *p_in;
+ unsigned int *p_odd = pix_odd;
+ unsigned int *p_even = pix_even;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = in;
+ for (row = 0; row < height; row += 2)
+ {
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_odd++ = swapUINT32 (*p_in++);
+ else
+ *p_odd++ = *p_in++;
+ }
+ p_in += width * bands;
+ }
+
+ p_in = in;
+ for (row = 1; row < height; row += 2)
+ {
+ p_in += width * bands;
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_even++ = swapUINT32 (*p_in++);
+ else
+ *p_even++ = *p_in++;
+ }
+ }
+}
+
+static void
+feed_odd_even_float (void *in, unsigned int width, unsigned int height,
+ int bands, void *pix_odd, void *pix_even, int swap)
+{
+/* feeding Odd/Even pixel buffers - FLOAT */
+ float *p_in;
+ float *p_odd = pix_odd;
+ float *p_even = pix_even;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = in;
+ for (row = 0; row < height; row += 2)
+ {
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_odd++ = swapFloat (*p_in++);
+ else
+ *p_odd++ = *p_in++;
+ }
+ p_in += width * bands;
+ }
+
+ p_in = in;
+ for (row = 1; row < height; row += 2)
+ {
+ p_in += width * bands;
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_even++ = swapFloat (*p_in++);
+ else
+ *p_even++ = *p_in++;
+ }
+ }
+}
+
+static void
+feed_odd_even_double (void *in, unsigned int width, unsigned int height,
+ int bands, void *pix_odd, void *pix_even, int swap)
+{
+/* feeding Odd/Even pixel buffers - DOUBLE */
+ double *p_in;
+ double *p_odd = pix_odd;
+ double *p_even = pix_even;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = in;
+ for (row = 0; row < height; row += 2)
+ {
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_odd++ = swapDouble (*p_in++);
+ else
+ *p_odd++ = *p_in++;
+ }
+ p_in += width * bands;
+ }
+
+ p_in = in;
+ for (row = 1; row < height; row += 2)
+ {
+ p_in += width * bands;
+ for (col = 0; col < width * bands; col++)
+ {
+ if (swap)
+ *p_even++ = swapDouble (*p_in++);
+ else
+ *p_even++ = *p_in++;
+ }
+ }
+}
+
+static int
+odd_even_rows (rl2PrivRasterPtr raster, int *odd_rows, int *row_stride_odd,
+ unsigned char **pixels_odd, int *size_odd, int *even_rows,
+ int *row_stride_even, unsigned char **pixels_even,
+ int *size_even, int little_endian)
+{
+/* creating both Odd and Even rows buffers */
+ int o_rows = 0;
+ int e_rows = 0;
+ int o_stride = 0;
+ int e_stride = 0;
+ unsigned char *pix_odd = NULL;
+ unsigned char *pix_even = NULL;
+ int o_size;
+ int e_size;
+ unsigned int row;
+ int pix_size;
+ int swap = 0;
+ if (little_endian != endianArch ())
+ swap = 1;
+ else
+ swap = 0;
+
+/* computing the required sizes */
+ for (row = 0; row < raster->height; row += 2)
+ o_rows++;
+ for (row = 1; row < raster->height; row += 2)
+ e_rows++;
+ switch (raster->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ pix_size = 1;
+ break;
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pix_size = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pix_size = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pix_size = 8;
+ break;
+ };
+ o_size = raster->width * o_rows * pix_size * raster->nBands;
+ e_size = raster->width * e_rows * pix_size * raster->nBands;
+ o_stride = raster->width * pix_size * raster->nBands;
+ e_stride = o_stride;
+
+/* allocating the pixel buffers */
+ pix_odd = malloc (o_size);
+ if (pix_odd == NULL)
+ return 0;
+ pix_even = malloc (e_size);
+ if (pix_even == NULL)
+ {
+ free (pix_odd);
+ return 0;
+ }
+ memset (pix_odd, 0, o_size);
+ memset (pix_even, 0, e_size);
+
+/* feeding the pixel buffers */
+ switch (raster->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ feed_odd_even_int8 (raster->rasterBuffer, raster->width,
+ raster->height, raster->nBands, pix_odd,
+ pix_even);
+ break;
+ case RL2_SAMPLE_UINT8:
+ feed_odd_even_uint8 (raster->rasterBuffer, raster->width,
+ raster->height, raster->nBands, pix_odd,
+ pix_even);
+ break;
+ case RL2_SAMPLE_INT16:
+ feed_odd_even_int16 (raster->rasterBuffer, raster->width,
+ raster->height, raster->nBands, pix_odd,
+ pix_even, swap);
+ break;
+ case RL2_SAMPLE_UINT16:
+ feed_odd_even_uint16 (raster->rasterBuffer, raster->width,
+ raster->height, raster->nBands, pix_odd,
+ pix_even, swap);
+ break;
+ case RL2_SAMPLE_INT32:
+ feed_odd_even_int32 (raster->rasterBuffer, raster->width,
+ raster->height, raster->nBands, pix_odd,
+ pix_even, swap);
+ break;
+ case RL2_SAMPLE_UINT32:
+ feed_odd_even_uint32 (raster->rasterBuffer, raster->width,
+ raster->height, raster->nBands, pix_odd,
+ pix_even, swap);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ feed_odd_even_float (raster->rasterBuffer, raster->width,
+ raster->height, raster->nBands, pix_odd,
+ pix_even, swap);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ feed_odd_even_double (raster->rasterBuffer, raster->width,
+ raster->height, raster->nBands, pix_odd,
+ pix_even, swap);
+ break;
+ };
+ *odd_rows = o_rows;
+ *even_rows = e_rows;
+ *row_stride_odd = o_stride;
+ *row_stride_even = e_stride;
+ *pixels_odd = pix_odd;
+ *pixels_even = pix_even;
+ *size_odd = o_size;
+ *size_even = e_size;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_raster_encode (rl2RasterPtr rst, int compression, unsigned char **blob_odd,
+ int *blob_odd_sz, unsigned char **blob_even,
+ int *blob_even_sz, int quality, int little_endian)
+{
+/* encoding a Raster into the internal RL2 binary format */
+ rl2PrivRasterPtr raster = (rl2PrivRasterPtr) rst;
+ int odd_rows;
+ unsigned char *pixels_odd = NULL;
+ int size_odd;
+ int even_rows = 0;
+ unsigned char *pixels_even = NULL;
+ int size_even = 0;
+ int row_stride_odd = 0;
+ unsigned char *mask_pix = NULL;
+ int mask_pix_size = 0;
+ unsigned char *block_odd = NULL;
+ int block_odd_size = 0;
+ int row_stride_even = 0;
+ unsigned char *block_even = NULL;
+ int block_even_size = 0;
+ unsigned char *ptr;
+ int uncompressed;
+ int compressed;
+ int uncompressed_mask = 0;
+ int compressed_mask = 0;
+ unsigned char *compr_data = NULL;
+ unsigned char *compr_mask = NULL;
+ unsigned char *to_clean1 = NULL;
+ unsigned char *to_clean2 = NULL;
+ unsigned char *save_mask = NULL;
+ uLong crc;
+ int endian_arch = endianArch ();
+
+ *blob_odd = NULL;
+ *blob_odd_sz = 0;
+ *blob_even = NULL;
+ *blob_even_sz = 0;
+
+ if (raster == NULL)
+ return RL2_ERROR;
+ if (!check_encode_self_consistency
+ (raster->sampleType, raster->pixelType, raster->nBands, compression))
+ return RL2_ERROR;
+
+ if (compression == RL2_COMPRESSION_NONE
+ || compression == RL2_COMPRESSION_DEFLATE
+ || compression == RL2_COMPRESSION_LZMA)
+ {
+ /* preparing the pixels buffers */
+ if (raster->sampleType == RL2_SAMPLE_1_BIT)
+ {
+ /* packing 1-BIT data */
+ if (!pack_1bit_rows
+ (raster, raster->rasterBuffer, &row_stride_odd, &pixels_odd,
+ &size_odd))
+ return RL2_ERROR;
+ odd_rows = raster->height;
+ }
+ else if (raster->sampleType == RL2_SAMPLE_2_BIT)
+ {
+ /* packing 2-BIT data */
+ if (!pack_2bit_rows
+ (raster, &row_stride_odd, &pixels_odd, &size_odd))
+ return RL2_ERROR;
+ odd_rows = raster->height;
+ }
+ else if (raster->sampleType == RL2_SAMPLE_4_BIT)
+ {
+ /* packing 4-BIT data */
+ if (!pack_4bit_rows
+ (raster, &row_stride_odd, &pixels_odd, &size_odd))
+ return RL2_ERROR;
+ odd_rows = raster->height;
+ }
+ else
+ {
+ /* Odd/Even raster */
+ if (!odd_even_rows
+ (raster, &odd_rows, &row_stride_odd, &pixels_odd, &size_odd,
+ &even_rows, &row_stride_even, &pixels_even, &size_even,
+ little_endian))
+ return RL2_ERROR;
+ }
+ }
+ else if (compression == RL2_COMPRESSION_PNG)
+ {
+ if (raster->sampleType == RL2_SAMPLE_1_BIT
+ || raster->sampleType == RL2_SAMPLE_2_BIT
+ || raster->sampleType == RL2_SAMPLE_4_BIT)
+ {
+ /* no special action is required */
+ }
+ else
+ {
+ /* Odd/Even raster */
+ if (!odd_even_rows
+ (raster, &odd_rows, &row_stride_odd, &pixels_odd, &size_odd,
+ &even_rows, &row_stride_even, &pixels_even, &size_even,
+ little_endian))
+ return RL2_ERROR;
+ }
+ }
+ else if (compression == RL2_COMPRESSION_JPEG
+ || compression == RL2_COMPRESSION_LOSSY_WEBP
+ || compression == RL2_COMPRESSION_LOSSLESS_WEBP
+ || compression == RL2_COMPRESSION_CCITTFAX4)
+ {
+ /* no special action is required */
+ }
+ else
+ return RL2_ERROR;
+ if (raster->maskBuffer != NULL)
+ {
+ /* preparing the mask buffer */
+ save_mask = raster->maskBuffer;
+ raster->maskBuffer = NULL;
+ /* packing RLE data */
+ if (!pack_rle_rows (raster, save_mask, &mask_pix, &mask_pix_size))
+ return RL2_ERROR;
+ }
+
+ if (compression == RL2_COMPRESSION_NONE)
+ {
+ uncompressed = size_odd;
+ compressed = size_odd;
+ compr_data = pixels_odd;
+ if (mask_pix == NULL)
+ uncompressed_mask = 0;
+ else
+ uncompressed_mask = raster->width * raster->height;
+ compressed_mask = mask_pix_size;
+ compr_mask = mask_pix;
+ }
+ else if (compression == RL2_COMPRESSION_DEFLATE)
+ {
+ /* compressing as ZIP [Deflate] */
+ int ret;
+ uLong zLen = size_odd - 1;
+ unsigned char *zip_buf = malloc (zLen);
+ if (zip_buf == NULL)
+ goto error;
+ ret =
+ compress (zip_buf, &zLen, (const Bytef *) pixels_odd,
+ (uLong) size_odd);
+ if (ret == Z_OK)
+ {
+ /* ok, ZIP compression was successful */
+ uncompressed = size_odd;
+ compressed = (int) zLen;
+ compr_data = zip_buf;
+ to_clean1 = zip_buf;
+ }
+ else if (ret == Z_BUF_ERROR)
+ {
+ /* ZIP compression actually causes inflation: saving uncompressed data */
+ uncompressed = size_odd;
+ compressed = size_odd;
+ compr_data = pixels_odd;
+ free (zip_buf);
+ zip_buf = NULL;
+ }
+ else
+ {
+ /* compression error */
+ free (zip_buf);
+ goto error;
+ }
+ if (mask_pix == NULL)
+ uncompressed_mask = 0;
+ else
+ uncompressed_mask = raster->width * raster->height;
+ compressed_mask = mask_pix_size;
+ compr_mask = mask_pix;
+ }
+ else if (compression == RL2_COMPRESSION_LZMA)
+ {
+ /* compressing as LZMA */
+ lzma_options_lzma opt_lzma2;
+ lzma_ret ret;
+ lzma_filter filters[2];
+ size_t out_pos = 0;
+ size_t lzmaLen = size_odd - 1;
+ unsigned char *lzma_buf = malloc (lzmaLen);
+ if (lzma_buf == NULL)
+ goto error;
+ lzma_lzma_preset (&opt_lzma2, LZMA_PRESET_DEFAULT);
+ filters[0].id = LZMA_FILTER_LZMA2;
+ filters[0].options = &opt_lzma2;
+ filters[1].id = LZMA_VLI_UNKNOWN;
+ filters[1].options = NULL;
+ ret =
+ lzma_raw_buffer_encode (filters, NULL,
+ (const uint8_t *) pixels_odd, size_odd,
+ lzma_buf, &out_pos, lzmaLen);
+ if (ret == LZMA_OK)
+ {
+ /* ok, LZMA compression was successful */
+ uncompressed = size_odd;
+ compressed = (int) out_pos;
+ compr_data = lzma_buf;
+ to_clean1 = lzma_buf;
+ }
+ else if (ret == LZMA_BUF_ERROR)
+ {
+ /* LZMA compression actually causes inflation: saving uncompressed data */
+ uncompressed = size_odd;
+ compressed = size_odd;
+ compr_data = pixels_odd;
+ free (lzma_buf);
+ lzma_buf = NULL;
+ }
+ else
+ {
+ /* compression error */
+ free (lzma_buf);
+ goto error;
+ }
+ if (mask_pix == NULL)
+ uncompressed_mask = 0;
+ else
+ uncompressed_mask = raster->width * raster->height;
+ compressed_mask = mask_pix_size;
+ compr_mask = mask_pix;
+ }
+ else if (compression == RL2_COMPRESSION_JPEG)
+ {
+ /* compressing as JPEG */
+ if (rl2_raster_to_jpeg (rst, &compr_data, &compressed, quality) ==
+ RL2_OK)
+ {
+ /* ok, JPEG compression was successful */
+ uncompressed = raster->width * raster->height * raster->nBands;
+ to_clean1 = compr_data;
+ }
+ else
+ goto error;
+ odd_rows = raster->height;
+ if (mask_pix == NULL)
+ uncompressed_mask = 0;
+ else
+ uncompressed_mask = raster->width * raster->height;
+ compressed_mask = mask_pix_size;
+ compr_mask = mask_pix;
+ }
+ else if (compression == RL2_COMPRESSION_LOSSLESS_WEBP)
+ {
+ /* compressing as lossless WEBP */
+ if (rl2_raster_to_lossless_webp (rst, &compr_data, &compressed) ==
+ RL2_OK)
+ {
+ /* ok, lossless WEBP compression was successful */
+ uncompressed = raster->width * raster->height * raster->nBands;
+ to_clean1 = compr_data;
+ }
+ else
+ goto error;
+ odd_rows = raster->height;
+ if (mask_pix == NULL)
+ uncompressed_mask = 0;
+ else
+ uncompressed_mask = raster->width * raster->height;
+ compressed_mask = mask_pix_size;
+ compr_mask = mask_pix;
+ }
+ else if (compression == RL2_COMPRESSION_LOSSY_WEBP)
+ {
+ /* compressing as lossy WEBP */
+ if (rl2_raster_to_lossy_webp (rst, &compr_data, &compressed, quality)
+ == RL2_OK)
+ {
+ /* ok, lossy WEBP compression was successful */
+ uncompressed = raster->width * raster->height * raster->nBands;
+ to_clean1 = compr_data;
+ }
+ else
+ goto error;
+ odd_rows = raster->height;
+ if (mask_pix == NULL)
+ uncompressed_mask = 0;
+ else
+ uncompressed_mask = raster->width * raster->height;
+ compressed_mask = mask_pix_size;
+ compr_mask = mask_pix;
+ }
+ else if (compression == RL2_COMPRESSION_PNG)
+ {
+ /* compressing as PNG */
+ if (raster->sampleType == RL2_SAMPLE_1_BIT
+ || raster->sampleType == RL2_SAMPLE_2_BIT
+ || raster->sampleType == RL2_SAMPLE_4_BIT)
+ {
+ /* solid ODD block */
+ if (rl2_raster_to_png (rst, &compr_data, &compressed) == RL2_OK)
+ {
+ /* ok, PNG compression was successful */
+ uncompressed = raster->width * raster->height;
+ to_clean1 = compr_data;
+ odd_rows = raster->height;
+ if (mask_pix == NULL)
+ uncompressed_mask = 0;
+ else
+ uncompressed_mask = raster->width * raster->height;
+ compressed_mask = mask_pix_size;
+ compr_mask = mask_pix;
+ }
+ else
+ goto error;
+ }
+ else
+ {
+ /* split between Odd/Even Blocks */
+ rl2PalettePtr plt = rl2_get_raster_palette (rst);
+ if (rl2_data_to_png
+ (pixels_odd, NULL, 1.0, plt, raster->width,
+ odd_rows, raster->sampleType, raster->pixelType,
+ &compr_data, &compressed) == RL2_OK)
+ {
+ /* ok, PNG compression was successful */
+ uncompressed = size_odd;
+ to_clean1 = compr_data;
+ if (mask_pix == NULL)
+ uncompressed_mask = 0;
+ else
+ uncompressed_mask = raster->width * raster->height;
+ compressed_mask = mask_pix_size;
+ compr_mask = mask_pix;
+ }
+ else
+ goto error;
+ }
+ }
+ else if (compression == RL2_COMPRESSION_CCITTFAX4)
+ {
+ /* compressing as TIFF FAX4 */
+ if (rl2_raster_to_tiff_mono4
+ (rst, &compr_data, &compressed) == RL2_OK)
+ {
+ /* ok, TIFF compression was successful */
+ uncompressed = raster->width * raster->height;
+ to_clean1 = compr_data;
+ odd_rows = raster->height;
+ if (mask_pix == NULL)
+ uncompressed_mask = 0;
+ else
+ uncompressed_mask = raster->width * raster->height;
+ compressed_mask = mask_pix_size;
+ compr_mask = mask_pix;
+ }
+ else
+ goto error;
+ }
+
+/* preparing the OddBlock */
+ block_odd_size = 40 + compressed + compressed_mask;
+ block_odd = malloc (block_odd_size);
+ if (block_odd == NULL)
+ goto error;
+ ptr = block_odd;
+ *ptr++ = 0x00; /* start marker */
+ *ptr++ = RL2_ODD_BLOCK_START; /* OddBlock marker */
+ if (little_endian) /* endian marker */
+ *ptr++ = RL2_LITTLE_ENDIAN;
+ else
+ *ptr++ = RL2_BIG_ENDIAN;
+ *ptr++ = compression; /* compression marker */
+ *ptr++ = raster->sampleType; /* sample type marker */
+ *ptr++ = raster->pixelType; /* pixel type marker */
+ *ptr++ = raster->nBands; /* # Bands marker */
+ exportU16 (ptr, raster->width, little_endian, endian_arch); /* the raster width */
+ ptr += 2;
+ exportU16 (ptr, raster->height, little_endian, endian_arch); /* the raster height */
+ ptr += 2;
+ exportU16 (ptr, row_stride_odd, little_endian, endian_arch); /* the block row stride */
+ ptr += 2;
+ exportU16 (ptr, odd_rows, little_endian, endian_arch); /* block #rows */
+ ptr += 2;
+ exportU32 (ptr, uncompressed, little_endian, endian_arch); /* uncompressed payload size in bytes */
+ ptr += 4;
+ exportU32 (ptr, compressed, little_endian, endian_arch); /* compressed payload size in bytes */
+ ptr += 4;
+ exportU32 (ptr, uncompressed_mask, little_endian, endian_arch); /* uncompressed mask size in bytes */
+ ptr += 4;
+ exportU32 (ptr, compressed_mask, little_endian, endian_arch); /* compressed mask size in bytes */
+ ptr += 4;
+ *ptr++ = RL2_DATA_START;
+ memcpy (ptr, compr_data, compressed); /* the payload */
+ ptr += compressed;
+ *ptr++ = RL2_DATA_END;
+ *ptr++ = RL2_MASK_START;
+ if (compr_mask != NULL)
+ {
+ memcpy (ptr, compr_mask, compressed_mask); /* the mask */
+ ptr += compressed_mask;
+ }
+ *ptr++ = RL2_MASK_END;
+/* computing the CRC32 */
+ crc = crc32 (0L, block_odd, ptr - block_odd);
+ exportU32 (ptr, crc, little_endian, endian_arch); /* the OddBlock own CRC */
+ ptr += 4;
+ *ptr = RL2_ODD_BLOCK_END;
+
+ if (size_even)
+ {
+ /* preparing the EvenBlock */
+ if (compression == RL2_COMPRESSION_NONE)
+ {
+ uncompressed = size_even;
+ compressed = size_even;
+ compr_data = pixels_even;
+ }
+ else if (compression == RL2_COMPRESSION_DEFLATE)
+ {
+ /* compressing as ZIP [Deflate] */
+ int ret;
+ uLong zLen = compressBound (size_even);
+ unsigned char *zip_buf = malloc (zLen);
+ if (zip_buf == NULL)
+ goto error;
+ ret =
+ compress (zip_buf, &zLen, (const Bytef *) pixels_even,
+ (uLong) size_even);
+ if (ret == Z_OK)
+ {
+ /* ok, ZIP compression was successful */
+ uncompressed = size_even;
+ compressed = (int) zLen;
+ compr_data = zip_buf;
+ to_clean2 = zip_buf;
+ }
+ else if (ret == Z_BUF_ERROR)
+ {
+ /* ZIP compression actually causes inflation: saving uncompressed data */
+ uncompressed = size_even;
+ compressed = size_even;
+ compr_data = pixels_even;
+ free (zip_buf);
+ zip_buf = NULL;
+ }
+ else
+ {
+ /* compression error */
+ free (zip_buf);
+ goto error;
+ }
+ }
+ else if (compression == RL2_COMPRESSION_LZMA)
+ {
+ /* compressing as LZMA */
+ lzma_options_lzma opt_lzma2;
+ lzma_ret ret;
+ lzma_filter filters[2];
+ size_t out_pos = 0;
+ size_t lzmaLen = size_even - 1;
+ unsigned char *lzma_buf = malloc (lzmaLen);
+ if (lzma_buf == NULL)
+ goto error;
+ lzma_lzma_preset (&opt_lzma2, LZMA_PRESET_DEFAULT);
+ filters[0].id = LZMA_FILTER_LZMA2;
+ filters[0].options = &opt_lzma2;
+ filters[1].id = LZMA_VLI_UNKNOWN;
+ filters[1].options = NULL;
+ ret =
+ lzma_raw_buffer_encode (filters, NULL,
+ (const uint8_t *) pixels_even,
+ size_even, lzma_buf, &out_pos,
+ lzmaLen);
+ if (ret == LZMA_OK)
+ {
+ /* ok, LZMA compression was successful */
+ uncompressed = size_even;
+ compressed = (int) out_pos;
+ compr_data = lzma_buf;
+ to_clean2 = lzma_buf;
+ }
+ else if (ret == LZMA_BUF_ERROR)
+ {
+ /* LZMA compression actually causes inflation: saving uncompressed data */
+ uncompressed = size_even;
+ compressed = size_even;
+ compr_data = pixels_even;
+ free (lzma_buf);
+ lzma_buf = NULL;
+ }
+ else
+ {
+ /* compression error */
+ free (lzma_buf);
+ goto error;
+ }
+ }
+ else if (compression == RL2_COMPRESSION_PNG)
+ {
+ /* compressing as PNG */
+ if (raster->sampleType == RL2_SAMPLE_1_BIT
+ || raster->sampleType == RL2_SAMPLE_2_BIT
+ || raster->sampleType == RL2_SAMPLE_4_BIT)
+ ;
+ else
+ {
+ /* split between Odd/Even Blocks */
+ rl2PalettePtr plt = rl2_get_raster_palette (rst);
+ if (rl2_data_to_png
+ (pixels_even, NULL, 1.0, plt, raster->width,
+ even_rows, raster->sampleType, raster->pixelType,
+ &compr_data, &compressed) == RL2_OK)
+ {
+ /* ok, PNG compression was successful */
+ uncompressed = size_even;
+ to_clean2 = compr_data;
+ }
+ else
+ goto error;
+ }
+ }
+ block_even_size = 32 + compressed;
+ block_even = malloc (block_even_size);
+ if (block_even == NULL)
+ goto error;
+ ptr = block_even;
+ *ptr++ = 0x00; /* start marker */
+ *ptr++ = RL2_EVEN_BLOCK_START; /* EvenBlock marker */
+ if (little_endian) /* endian marker */
+ *ptr++ = RL2_LITTLE_ENDIAN;
+ else
+ *ptr++ = RL2_BIG_ENDIAN;
+ *ptr++ = compression; /* compression marker */
+ *ptr++ = raster->sampleType; /* sample type marker */
+ *ptr++ = raster->pixelType; /* pixel type marker */
+ *ptr++ = raster->nBands; /* # Bands marker */
+ exportU16 (ptr, raster->width, little_endian, endian_arch); /* the raster width */
+ ptr += 2;
+ exportU16 (ptr, raster->height, little_endian, endian_arch); /* the raster height */
+ ptr += 2;
+ exportU16 (ptr, even_rows, little_endian, endian_arch); /* block #rows */
+ ptr += 2;
+ exportU32 (ptr, crc, little_endian, endian_arch); /* the OddBlock own CRC */
+ ptr += 4;
+ exportU32 (ptr, uncompressed, little_endian, endian_arch); /* uncompressed payload size in bytes */
+ ptr += 4;
+ exportU32 (ptr, compressed, little_endian, endian_arch); /* compressed payload size in bytes */
+ ptr += 4;
+ *ptr++ = RL2_DATA_START;
+ memcpy (ptr, compr_data, compressed); /* the payload */
+ ptr += compressed;
+ *ptr++ = RL2_DATA_END;
+ /* computing the CRC32 */
+ crc = crc32 (0L, block_even, ptr - block_even);
+ exportU32 (ptr, crc, little_endian, endian_arch); /* the EvenBlock own CRC */
+ ptr += 4;
+ *ptr = RL2_EVEN_BLOCK_END;
+ }
+
+ if (pixels_odd != NULL)
+ free (pixels_odd);
+ if (pixels_even != NULL)
+ free (pixels_even);
+ if (mask_pix != NULL)
+ free (mask_pix);
+ if (to_clean1 != NULL)
+ free (to_clean1);
+ if (to_clean2 != NULL)
+ free (to_clean2);
+
+ raster->maskBuffer = save_mask;
+ *blob_odd = block_odd;
+ *blob_odd_sz = block_odd_size;
+ *blob_even = block_even;
+ *blob_even_sz = block_even_size;
+ return RL2_OK;
+
+ error:
+ if (pixels_odd != NULL)
+ free (pixels_odd);
+ if (pixels_even != NULL)
+ free (pixels_even);
+ if (mask_pix != NULL)
+ free (mask_pix);
+ if (to_clean1 != NULL)
+ free (to_clean1);
+ if (to_clean2 != NULL)
+ free (to_clean2);
+ if (block_odd != NULL)
+ free (block_odd);
+ if (block_even != NULL)
+ free (block_even);
+ raster->maskBuffer = save_mask;
+ return RL2_ERROR;
+}
+
+static int
+check_blob_odd (const unsigned char *blob, int blob_sz, unsigned int *xwidth,
+ unsigned int *xheight, unsigned char *xsample_type,
+ unsigned char *xpixel_type, unsigned char *xnum_bands,
+ unsigned char *xcompression, uLong * xcrc)
+{
+/* checking the OddBlock for validity */
+ const unsigned char *ptr;
+ unsigned short width;
+ unsigned short height;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned char compression;
+ int compressed;
+ int compressed_mask;
+ uLong crc;
+ uLong oldCrc;
+ int endian;
+ int endian_arch = endianArch ();
+
+ if (blob_sz < 41)
+ return 0;
+ ptr = blob;
+ if (*ptr++ != 0x00)
+ return 0; /* invalid start signature */
+ if (*ptr++ != RL2_ODD_BLOCK_START)
+ return 0; /* invalid start signature */
+ endian = *ptr++;
+ if (endian == RL2_LITTLE_ENDIAN || endian == RL2_BIG_ENDIAN)
+ ;
+ else
+ return 0; /* invalid endiannes */
+ compression = *ptr++; /* compression */
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ case RL2_COMPRESSION_PNG:
+ case RL2_COMPRESSION_JPEG:
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ case RL2_COMPRESSION_CCITTFAX4:
+ break;
+ default:
+ return 0;
+ };
+ sample_type = *ptr++; /* sample type */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ case RL2_SAMPLE_DOUBLE:
+ break;
+ default:
+ return 0;
+ };
+ pixel_type = *ptr++; /* pixel type */
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_PALETTE:
+ case RL2_PIXEL_GRAYSCALE:
+ case RL2_PIXEL_RGB:
+ case RL2_PIXEL_MULTIBAND:
+ case RL2_PIXEL_DATAGRID:
+ break;
+ default:
+ return 0;
+ };
+ num_bands = *ptr++; /* # Bands */
+ width = importU16 (ptr, endian, endian_arch);
+ ptr += 2;
+ height = importU16 (ptr, endian, endian_arch);
+ ptr += 2;
+ ptr += 4; /* skipping */
+ ptr += 4; /* skipping the uncompressed payload size */
+ compressed = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ ptr += 4; /* skipping the uncompressed mask size */
+ compressed_mask = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ if (*ptr++ != RL2_DATA_START)
+ return 0;
+ if (blob_sz < 40 + compressed + compressed_mask)
+ return 0;
+ ptr += compressed;
+ if (*ptr++ != RL2_DATA_END)
+ return 0;
+ if (*ptr++ != RL2_MASK_START)
+ return 0;
+ ptr += compressed_mask;
+ if (*ptr++ != RL2_MASK_END)
+ return 0;
+/* computing the CRC32 */
+ crc = crc32 (0L, blob, ptr - blob);
+ oldCrc = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ if (crc != oldCrc)
+ return 0;
+ if (*ptr != RL2_ODD_BLOCK_END)
+ return 0; /* invalid end signature */
+
+ *xwidth = width;
+ *xheight = height;
+ *xsample_type = sample_type;
+ *xpixel_type = pixel_type;
+ *xnum_bands = num_bands;
+ *xcompression = compression;
+ *xcrc = crc;
+ return 1;
+}
+
+static int
+check_blob_even (const unsigned char *blob, int blob_sz, unsigned short xwidth,
+ unsigned short xheight, unsigned char xsample_type,
+ unsigned char xpixel_type, unsigned char xnum_bands,
+ unsigned char xcompression, uLong xcrc)
+{
+/* checking the EvenBlock for validity */
+ const unsigned char *ptr;
+ unsigned short width;
+ unsigned short height;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned char compression;
+ int compressed;
+ uLong crc;
+ uLong oldCrc;
+ int endian;
+ int endian_arch = endianArch ();
+
+ if (blob_sz < 33)
+ return 0;
+ ptr = blob;
+ if (*ptr++ != 0x00)
+ return 0; /* invalid start signature */
+ if (*ptr++ != RL2_EVEN_BLOCK_START)
+ return 0; /* invalid start signature */
+ endian = *ptr++;
+ if (endian == RL2_LITTLE_ENDIAN || endian == RL2_BIG_ENDIAN)
+ ;
+ else
+ return 0; /* invalid endiannes */
+ compression = *ptr++; /* compression */
+ if (xcompression != compression)
+ return 0;
+ sample_type = *ptr++; /* sample type */
+ if (xsample_type != sample_type)
+ return 0;
+ pixel_type = *ptr++; /* pixel type */
+ if (xpixel_type != pixel_type)
+ return 0;
+ num_bands = *ptr++; /* # Bands */
+ if (num_bands != xnum_bands)
+ return 0;
+ width = importU16 (ptr, endian, endian_arch);
+ ptr += 2;
+ if (xwidth != width)
+ return 0;
+ height = importU16 (ptr, endian, endian_arch);
+ ptr += 2;
+ if (xheight != height)
+ return 0;
+ ptr += 2; /* skipping block # rows */
+ crc = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ if (xcrc != crc)
+ return 0;
+ ptr += 4; /* skipping the uncompressed payload size */
+ compressed = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ if (*ptr++ != RL2_DATA_START)
+ return 0;
+ if (blob_sz < 32 + compressed)
+ return 0;
+ ptr += compressed;
+ if (*ptr++ != RL2_DATA_END)
+ return 0;
+/* computing the CRC32 */
+ crc = crc32 (0L, blob, ptr - blob);
+ oldCrc = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ if (crc != oldCrc)
+ return 0;
+ if (*ptr != RL2_EVEN_BLOCK_END)
+ return 0; /* invalid end signature */
+ return 1;
+}
+
+static int
+check_scale (int scale, unsigned char sample_type, unsigned char compression,
+ const unsigned char *blob_even)
+{
+/* checking if the encoded raster could be decoded at given scale */
+ switch (scale)
+ {
+ case RL2_SCALE_1:
+ if (sample_type == RL2_SAMPLE_1_BIT || sample_type == RL2_SAMPLE_2_BIT
+ || sample_type == RL2_SAMPLE_4_BIT)
+ ;
+ else if (compression == RL2_COMPRESSION_JPEG
+ || compression == RL2_COMPRESSION_LOSSY_WEBP
+ || compression == RL2_COMPRESSION_LOSSLESS_WEBP
+ || compression == RL2_COMPRESSION_CCITTFAX4)
+ {
+ if (blob_even != NULL)
+ return 0;
+ }
+ else if (blob_even == NULL)
+ return 0;
+ break;
+ case RL2_SCALE_2:
+ case RL2_SCALE_4:
+ case RL2_SCALE_8:
+ break;
+ default:
+ return 0;
+ };
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ if (scale != RL2_SCALE_1)
+ return 0;
+ break;
+ };
+ return 1;
+}
+
+static void
+do_copy2_int8 (const char *p_odd, char *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling an INT8 raster - scale 1:2 */
+ unsigned int row;
+ unsigned int col;
+ char *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ for (col = 0; col < width; col += 2)
+ *p_out++ = *p_odd++;
+ p_odd++;
+ }
+}
+
+static void
+do_copy2_uint8 (const unsigned char *p_odd, unsigned char *buf,
+ unsigned int width, unsigned int odd_rows,
+ unsigned char num_bands)
+{
+/* reassembling a UINT8 raster - scale 1:2 */
+ unsigned int row;
+ unsigned int col;
+ int band;
+ unsigned char *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ for (col = 0; col < width; col += 2)
+ {
+ for (band = 0; band < num_bands; band++)
+ *p_out++ = *p_odd++;
+ p_odd += num_bands;
+ }
+ }
+}
+
+static void
+do_copy2_int16 (int swap, const short *p_odd, short *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling an INT16 raster - scale 1:2 */
+ unsigned int row;
+ unsigned int col;
+ short *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ for (col = 0; col < width; col += 2)
+ {
+ if (swap)
+ *p_out++ = swapINT16 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd++;
+ }
+ }
+}
+
+static void
+do_copy2_uint16 (int swap, const unsigned short *p_odd, unsigned short *buf,
+ unsigned int width, unsigned int odd_rows,
+ unsigned char num_bands)
+{
+/* reassembling a UINT16 raster - scale 1:2 */
+ unsigned int row;
+ unsigned int col;
+ int band;
+ unsigned short *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ for (col = 0; col < width; col += 2)
+ {
+ for (band = 0; band < num_bands; band++)
+ {
+ if (swap)
+ *p_out++ = swapUINT16 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ }
+ p_odd += num_bands;
+ }
+ }
+}
+
+static void
+do_copy2_int32 (int swap, const int *p_odd, int *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling an INT32 raster - scale 1:2 */
+ unsigned int row;
+ unsigned int col;
+ int *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ for (col = 0; col < width; col += 2)
+ {
+ if (swap)
+ *p_out++ = swapINT32 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd++;
+ }
+ }
+}
+
+static void
+do_copy2_uint32 (int swap, const unsigned int *p_odd, unsigned int *buf,
+ unsigned int width, unsigned int odd_rows)
+{
+/* reassembling an UINT32 raster - scale 1:2 */
+ unsigned int row;
+ unsigned int col;
+ unsigned int *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ for (col = 0; col < width; col += 2)
+ {
+ if (swap)
+ *p_out++ = swapUINT32 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd++;
+ }
+ }
+}
+
+static void
+do_copy2_float (int swap, const float *p_odd, float *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling a FLOAT raster - scale 1:2 */
+ unsigned int row;
+ unsigned int col;
+ float *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ for (col = 0; col < width; col += 2)
+ {
+ if (swap)
+ *p_out++ = swapFloat (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd++;
+ }
+ }
+}
+
+static void
+do_copy2_double (int swap, const double *p_odd, double *buf,
+ unsigned int width, unsigned int odd_rows)
+{
+/* reassembling a FLOAT raster - scale 1:2 */
+ unsigned int row;
+ unsigned int col;
+ double *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ for (col = 0; col < width; col += 2)
+ {
+ if (swap)
+ *p_out++ = swapDouble (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd++;
+ }
+ }
+}
+
+static int
+build_pixel_buffer_2 (int swap, unsigned int *xwidth, unsigned int *xheight,
+ unsigned char sample_type, unsigned char pixel_size,
+ unsigned char num_bands, unsigned short odd_rows,
+ const void *pixels_odd, void **pixels, int *pixels_sz)
+{
+/* decoding the raster - scale 1:2 */
+ unsigned int width = 0;
+ unsigned int height = 0;
+ unsigned int row;
+ unsigned int col;
+ void *buf;
+ int buf_size;
+
+ for (row = 0; row < *xheight; row += 2)
+ height++;
+ for (col = 0; col < *xwidth; col += 2)
+ width++;
+
+ buf_size = width * height * pixel_size * num_bands;
+ buf = malloc (buf_size);
+ if (buf == NULL)
+ return 0;
+
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ do_copy2_int8 (pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_UINT8:
+ do_copy2_uint8 (pixels_odd, buf, *xwidth, odd_rows, num_bands);
+ break;
+ case RL2_SAMPLE_INT16:
+ do_copy2_int16 (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_UINT16:
+ do_copy2_uint16 (swap, pixels_odd, buf, *xwidth, odd_rows, num_bands);
+ break;
+ case RL2_SAMPLE_INT32:
+ do_copy2_int32 (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_UINT32:
+ do_copy2_uint32 (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ do_copy2_float (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ do_copy2_double (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ };
+
+ *xwidth = width;
+ *xheight = height;
+ *pixels = buf;
+ *pixels_sz = buf_size;
+ return 1;
+}
+
+static void
+do_copy4_int8 (const char *p_odd, char *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling an INT8 raster - scale 1:4 */
+ unsigned int row;
+ unsigned int col;
+ char *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 2)
+ {
+ for (col = 0; col < width; col += 4)
+ {
+ *p_out++ = *p_odd++;
+ p_odd += 3;
+ }
+ p_odd += width;
+ }
+}
+
+static void
+do_copy4_uint8 (const unsigned char *p_odd, unsigned char *buf,
+ unsigned int width, unsigned int odd_rows,
+ unsigned char num_bands)
+{
+/* reassembling a UINT8 raster - scale 1:4 */
+ unsigned int row;
+ unsigned int col;
+ int band;
+ unsigned char *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 2)
+ {
+ for (col = 0; col < width; col += 4)
+ {
+ for (band = 0; band < num_bands; band++)
+ *p_out++ = *p_odd++;
+ p_odd += num_bands * 3;
+ }
+ p_odd += width * num_bands;
+ }
+}
+
+static void
+do_copy4_int16 (int swap, const short *p_odd, short *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling an INT16 raster - scale 1:4 */
+ unsigned int row;
+ unsigned int col;
+ short *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 2)
+ {
+ for (col = 0; col < width; col += 4)
+ {
+ if (swap)
+ *p_out++ = swapINT16 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd += 3;
+ }
+ p_odd += width;
+ }
+}
+
+static void
+do_copy4_uint16 (int swap, const unsigned short *p_odd, unsigned short *buf,
+ unsigned int width, unsigned int odd_rows,
+ unsigned char num_bands)
+{
+/* reassembling a UINT16 raster - scale 1:4 */
+ unsigned int row;
+ unsigned int col;
+ int band;
+ unsigned short *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 2)
+ {
+ for (col = 0; col < width; col += 4)
+ {
+ for (band = 0; band < num_bands; band++)
+ {
+ if (swap)
+ *p_out++ = swapUINT16 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ }
+ p_odd += num_bands * 3;
+ }
+ p_odd += width * num_bands;
+ }
+}
+
+static void
+do_copy4_int32 (int swap, const int *p_odd, int *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling an INT32 raster - scale 1:4 */
+ unsigned int row;
+ unsigned int col;
+ int *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 2)
+ {
+ for (col = 0; col < width; col += 4)
+ {
+ if (swap)
+ *p_out++ = swapINT32 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd += 3;
+ }
+ p_odd += width;
+ }
+}
+
+static void
+do_copy4_uint32 (int swap, const unsigned int *p_odd, unsigned int *buf,
+ unsigned int width, unsigned int odd_rows)
+{
+/* reassembling an UINT32 raster - scale 1:4 */
+ unsigned int row;
+ unsigned int col;
+ unsigned int *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 2)
+ {
+ for (col = 0; col < width; col += 4)
+ {
+ if (swap)
+ *p_out++ = swapUINT32 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd += 3;
+ }
+ p_odd += width;
+ }
+}
+
+static void
+do_copy4_float (int swap, const float *p_odd, float *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling a FLOAT raster - scale 1:4 */
+ unsigned int row;
+ unsigned int col;
+ float *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 2)
+ {
+ for (col = 0; col < width; col += 4)
+ {
+ if (swap)
+ *p_out++ = swapFloat (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd += 3;
+ }
+ p_odd += width;
+ }
+}
+
+static void
+do_copy4_double (int swap, const double *p_odd, double *buf,
+ unsigned int width, unsigned int odd_rows)
+{
+/* reassembling a DOUBLE raster - scale 1:4 */
+ unsigned int row;
+ unsigned int col;
+ double *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 2)
+ {
+ for (col = 0; col < width; col += 4)
+ {
+ if (swap)
+ *p_out++ = swapDouble (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd += 3;
+ }
+ p_odd += width;
+ }
+}
+
+static int
+build_pixel_buffer_4 (int swap, unsigned int *xwidth, unsigned int *xheight,
+ unsigned char sample_type, unsigned char pixel_size,
+ unsigned char num_bands, unsigned int odd_rows,
+ const void *pixels_odd, void **pixels, int *pixels_sz)
+{
+/* decoding the raster - scale 1:4 */
+ unsigned short width = 0;
+ unsigned short height = 0;
+ unsigned int row;
+ unsigned int col;
+ void *buf;
+ int buf_size;
+
+ for (row = 0; row < *xheight; row += 4)
+ height++;
+ for (col = 0; col < *xwidth; col += 4)
+ width++;
+
+ buf_size = width * height * pixel_size * num_bands;
+ buf = malloc (buf_size);
+ if (buf == NULL)
+ return 0;
+
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ do_copy4_int8 (pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_UINT8:
+ do_copy4_uint8 (pixels_odd, buf, *xwidth, odd_rows, num_bands);
+ break;
+ case RL2_SAMPLE_INT16:
+ do_copy4_int16 (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_UINT16:
+ do_copy4_uint16 (swap, pixels_odd, buf, *xwidth, odd_rows, num_bands);
+ break;
+ case RL2_SAMPLE_INT32:
+ do_copy4_int32 (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_UINT32:
+ do_copy4_uint32 (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ do_copy4_float (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ do_copy4_double (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ };
+
+ *xwidth = width;
+ *xheight = height;
+ *pixels = buf;
+ *pixels_sz = buf_size;
+ return 1;
+}
+
+static void
+do_copy8_int8 (const char *p_odd, char *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling an INT8 raster - scale 1:8 */
+ unsigned int row;
+ unsigned int col;
+ char *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 4)
+ {
+ for (col = 0; col < width; col += 8)
+ {
+ *p_out++ = *p_odd++;
+ p_odd += 7;
+ }
+ p_odd += 3 * width;
+ }
+}
+
+static void
+do_copy8_uint8 (const unsigned char *p_odd, unsigned char *buf,
+ unsigned int width, unsigned int odd_rows,
+ unsigned char num_bands)
+{
+/* reassembling a UINT8 raster - scale 1:8 */
+ unsigned int row;
+ unsigned int col;
+ int band;
+ unsigned char *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 4)
+ {
+ for (col = 0; col < width; col += 8)
+ {
+ for (band = 0; band < num_bands; band++)
+ *p_out++ = *p_odd++;
+ p_odd += num_bands * 7;
+ }
+ p_odd += 3 * width * num_bands;
+ }
+}
+
+static void
+do_copy8_int16 (int swap, const short *p_odd, short *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling an INT16 raster - scale 1:8 */
+ unsigned int row;
+ unsigned int col;
+ short *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 4)
+ {
+ for (col = 0; col < width; col += 8)
+ {
+ if (swap)
+ *p_out++ = swapINT16 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd += 7;
+ }
+ p_odd += 3 * width;
+ }
+}
+
+static void
+do_copy8_uint16 (int swap, const unsigned short *p_odd, unsigned short *buf,
+ unsigned int width, unsigned int odd_rows,
+ unsigned char num_bands)
+{
+/* reassembling a UINT16 raster - scale 1:8 */
+ unsigned int row;
+ unsigned int col;
+ int band;
+ unsigned short *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 4)
+ {
+ for (col = 0; col < width; col += 8)
+ {
+ for (band = 0; band < num_bands; band++)
+ {
+ if (swap)
+ *p_out++ = swapUINT16 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ }
+ p_odd += num_bands * 7;
+ }
+ p_odd += 3 * width * num_bands;
+ }
+}
+
+static void
+do_copy8_int32 (int swap, const int *p_odd, int *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling an INT32 raster - scale 1:8 */
+ unsigned int row;
+ unsigned int col;
+ int *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 4)
+ {
+ for (col = 0; col < width; col += 8)
+ {
+ if (swap)
+ *p_out++ = swapINT32 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd += 7;
+ }
+ p_odd += 3 * width;
+ }
+}
+
+static void
+do_copy8_uint32 (int swap, const unsigned int *p_odd, unsigned int *buf,
+ unsigned short width, unsigned short odd_rows)
+{
+/* reassembling an UINT32 raster - scale 1:8 */
+ int row;
+ int col;
+ unsigned int *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 4)
+ {
+ for (col = 0; col < width; col += 8)
+ {
+ if (swap)
+ *p_out++ = swapUINT32 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd += 7;
+ }
+ p_odd += 3 * width;
+ }
+}
+
+static void
+do_copy8_float (int swap, const float *p_odd, float *buf, unsigned int width,
+ unsigned int odd_rows)
+{
+/* reassembling a FLOAT raster - scale 1:8 */
+ unsigned int row;
+ unsigned int col;
+ float *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 4)
+ {
+ for (col = 0; col < width; col += 8)
+ {
+ if (swap)
+ *p_out++ = swapFloat (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd += 7;
+ }
+ p_odd += 3 * width;
+ }
+}
+
+static void
+do_copy8_double (int swap, const double *p_odd, double *buf,
+ unsigned int width, unsigned int odd_rows)
+{
+/* reassembling a DOUBLE raster - scale 1:8 */
+ unsigned int row;
+ unsigned int col;
+ double *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row += 4)
+ {
+ for (col = 0; col < width; col += 8)
+ {
+ if (swap)
+ *p_out++ = swapDouble (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ p_odd += 7;
+ }
+ p_odd += 3 * width;
+ }
+}
+
+static int
+build_pixel_buffer_8 (int swap, unsigned int *xwidth, unsigned int *xheight,
+ unsigned char sample_type, unsigned char pixel_size,
+ unsigned char num_bands, unsigned short odd_rows,
+ const void *pixels_odd, void **pixels, int *pixels_sz)
+{
+/* decoding the raster - scale 1:8 */
+ unsigned int width = 0;
+ unsigned int height = 0;
+ unsigned int row;
+ unsigned int col;
+ void *buf;
+ int buf_size;
+
+ for (row = 0; row < *xheight; row += 8)
+ height++;
+ for (col = 0; col < *xwidth; col += 8)
+ width++;
+
+ buf_size = width * height * pixel_size * num_bands;
+ buf = malloc (buf_size);
+ if (buf == NULL)
+ return 0;
+
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ do_copy8_int8 (pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_UINT8:
+ do_copy8_uint8 (pixels_odd, buf, *xwidth, odd_rows, num_bands);
+ break;
+ case RL2_SAMPLE_INT16:
+ do_copy8_int16 (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_UINT16:
+ do_copy8_uint16 (swap, pixels_odd, buf, *xwidth, odd_rows, num_bands);
+ break;
+ case RL2_SAMPLE_INT32:
+ do_copy8_int32 (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_UINT32:
+ do_copy8_uint32 (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ do_copy8_float (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ do_copy8_double (swap, pixels_odd, buf, *xwidth, odd_rows);
+ break;
+ };
+
+ *xwidth = width;
+ *xheight = height;
+ *pixels = buf;
+ *pixels_sz = buf_size;
+ return 1;
+}
+
+static void
+do_copy_int8 (const char *p_odd, const char *p_even, char *buf,
+ unsigned short width, unsigned short odd_rows,
+ unsigned short even_rows)
+{
+/* reassembling an INT8 raster - scale 1:1 */
+ int row;
+ int col;
+ char *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ /* Odd scanlines */
+ for (col = 0; col < width; col++)
+ *p_out++ = *p_odd++;
+ p_out += width;
+ }
+
+ p_out = buf;
+ for (row = 0; row < even_rows; row++)
+ {
+ /* Even scanlines */
+ p_out += width;
+ for (col = 0; col < width; col++)
+ *p_out++ = *p_even++;
+ }
+}
+
+static void
+do_copy_uint8 (const unsigned char *p_odd, const unsigned char *p_even,
+ unsigned char *buf, unsigned short width,
+ unsigned short odd_rows, unsigned short even_rows,
+ unsigned char num_bands)
+{
+/* reassembling a UINT8 raster - scale 1:1 */
+ int row;
+ int col;
+ int band;
+ unsigned char *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ /* Odd scanlines */
+ for (col = 0; col < width; col++)
+ {
+ for (band = 0; band < num_bands; band++)
+ *p_out++ = *p_odd++;
+ }
+ p_out += width * num_bands;
+ }
+
+ p_out = buf;
+ for (row = 0; row < even_rows; row++)
+ {
+ /* Even scanlines */
+ p_out += width * num_bands;
+ for (col = 0; col < width; col++)
+ {
+ for (band = 0; band < num_bands; band++)
+ *p_out++ = *p_even++;
+ }
+ }
+}
+
+static void
+do_copy_int16 (int swap, const short *p_odd, const short *p_even, short *buf,
+ unsigned short width, unsigned short odd_rows,
+ unsigned short even_rows)
+{
+/* reassembling an INT16 raster - scale 1:1 */
+ int row;
+ int col;
+ short *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ /* Odd scanlines */
+ for (col = 0; col < width; col++)
+ {
+ if (swap)
+ *p_out++ = swapINT16 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ }
+ p_out += width;
+ }
+
+ p_out = buf;
+ for (row = 0; row < even_rows; row++)
+ {
+ /* Even scanlines */
+ p_out += width;
+ for (col = 0; col < width; col++)
+ {
+ if (swap)
+ *p_out++ = swapINT16 (*p_even++);
+ else
+ *p_out++ = *p_even++;
+ }
+ }
+}
+
+static void
+do_copy_uint16 (int swap, const unsigned short *p_odd,
+ const unsigned short *p_even, unsigned short *buf,
+ unsigned short width, unsigned short odd_rows,
+ unsigned short even_rows, unsigned char num_bands)
+{
+/* reassembling a UINT16 raster - scale 1:1 */
+ int row;
+ int col;
+ int band;
+ unsigned short *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ /* Odd scanlines */
+ for (col = 0; col < width; col++)
+ {
+ for (band = 0; band < num_bands; band++)
+ {
+ if (swap)
+ *p_out++ = swapUINT16 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ }
+ }
+ p_out += width * num_bands;
+ }
+
+ p_out = buf;
+ for (row = 0; row < even_rows; row++)
+ {
+ /* Even scanlines */
+ p_out += width * num_bands;
+ for (col = 0; col < width; col++)
+ {
+ for (band = 0; band < num_bands; band++)
+ {
+ if (swap)
+ *p_out++ = swapUINT16 (*p_even++);
+ else
+ *p_out++ = *p_even++;
+ }
+ }
+ }
+}
+
+static void
+do_copy_int32 (int swap, const int *p_odd, const int *p_even, int *buf,
+ unsigned short width, unsigned short odd_rows,
+ unsigned short even_rows)
+{
+/* reassembling an INT32 raster - scale 1:1 */
+ int row;
+ int col;
+ int *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ /* Odd scanlines */
+ for (col = 0; col < width; col++)
+ {
+ if (swap)
+ *p_out++ = swapINT32 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ }
+ p_out += width;
+ }
+
+ p_out = buf;
+ for (row = 0; row < even_rows; row++)
+ {
+ /* Even scanlines */
+ p_out += width;
+ for (col = 0; col < width; col++)
+ {
+ if (swap)
+ *p_out++ = swapINT32 (*p_even++);
+ else
+ *p_out++ = *p_even++;
+ }
+ }
+}
+
+static void
+do_copy_uint32 (int swap, const unsigned int *p_odd, const unsigned int *p_even,
+ unsigned int *buf, unsigned short width,
+ unsigned short odd_rows, unsigned short even_rows)
+{
+/* reassembling an UINT32 raster - scale 1:1 */
+ int row;
+ int col;
+ unsigned int *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ /* Odd scanlines */
+ for (col = 0; col < width; col++)
+ {
+ if (swap)
+ *p_out++ = swapUINT32 (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ }
+ p_out += width;
+ }
+
+ p_out = buf;
+ for (row = 0; row < even_rows; row++)
+ {
+ /* Even scanlines */
+ p_out += width;
+ for (col = 0; col < width; col++)
+ {
+ if (swap)
+ *p_out++ = swapUINT32 (*p_even++);
+ else
+ *p_out++ = *p_even++;
+ }
+ }
+}
+
+static void
+do_copy_float (int swap, const float *p_odd, const float *p_even, float *buf,
+ unsigned short width, unsigned short odd_rows,
+ unsigned short even_rows)
+{
+/* reassembling a FLOAT raster - scale 1:1 */
+ int row;
+ int col;
+ float *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ /* Odd scanlines */
+ for (col = 0; col < width; col++)
+ {
+ if (swap)
+ *p_out++ = swapFloat (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ }
+ p_out += width;
+ }
+
+ p_out = buf;
+ for (row = 0; row < even_rows; row++)
+ {
+ /* Even scanlines */
+ p_out += width;
+ for (col = 0; col < width; col++)
+ {
+ if (swap)
+ *p_out++ = swapFloat (*p_even++);
+ else
+ *p_out++ = *p_even++;
+ }
+ }
+}
+
+static void
+do_copy_double (int swap, const double *p_odd, const double *p_even,
+ double *buf, unsigned short width, unsigned short odd_rows,
+ unsigned short even_rows)
+{
+/* reassembling a DOUBLE raster - scale 1:1 */
+ int row;
+ int col;
+ double *p_out;
+
+ p_out = buf;
+ for (row = 0; row < odd_rows; row++)
+ {
+ /* Odd scanlines */
+ for (col = 0; col < width; col++)
+ {
+ if (swap)
+ *p_out++ = swapDouble (*p_odd++);
+ else
+ *p_out++ = *p_odd++;
+ }
+ p_out += width;
+ }
+
+ p_out = buf;
+ for (row = 0; row < even_rows; row++)
+ {
+ /* Even scanlines */
+ p_out += width;
+ for (col = 0; col < width; col++)
+ {
+ if (swap)
+ *p_out++ = swapDouble (*p_even++);
+ else
+ *p_out++ = *p_even++;
+ }
+ }
+}
+
+static int
+build_pixel_buffer (int swap, int scale, unsigned int *xwidth,
+ unsigned int *xheight, unsigned char sample_type,
+ unsigned char num_bands, unsigned short odd_rows,
+ const void *pixels_odd, unsigned short even_rows,
+ const void *pixels_even, void **pixels, int *pixels_sz)
+{
+/* decoding the raster */
+ unsigned int width = *xwidth;
+ unsigned int height = *xheight;
+ void *buf;
+ int buf_size;
+ unsigned char pixel_size;
+
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pixel_size = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pixel_size = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pixel_size = 8;
+ break;
+ default:
+ pixel_size = 1;
+ break;
+ };
+
+ if (scale == RL2_SCALE_2)
+ return build_pixel_buffer_2 (swap, xwidth, xheight, sample_type,
+ pixel_size, num_bands, odd_rows,
+ pixels_odd, pixels, pixels_sz);
+ if (scale == RL2_SCALE_4)
+ return build_pixel_buffer_4 (swap, xwidth, xheight, sample_type,
+ pixel_size, num_bands, odd_rows,
+ pixels_odd, pixels, pixels_sz);
+ if (scale == RL2_SCALE_8)
+ return build_pixel_buffer_8 (swap, xwidth, xheight, sample_type,
+ pixel_size, num_bands, odd_rows,
+ pixels_odd, pixels, pixels_sz);
+
+ buf_size = width * height * pixel_size * num_bands;
+ buf = malloc (buf_size);
+ if (buf == NULL)
+ return 0;
+
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ do_copy_int8 (pixels_odd, pixels_even, buf, width, odd_rows,
+ even_rows);
+ break;
+ case RL2_SAMPLE_UINT8:
+ do_copy_uint8 (pixels_odd, pixels_even, buf, width, odd_rows,
+ even_rows, num_bands);
+ break;
+ case RL2_SAMPLE_INT16:
+ do_copy_int16 (swap, pixels_odd, pixels_even, buf, width, odd_rows,
+ even_rows);
+ break;
+ case RL2_SAMPLE_UINT16:
+ do_copy_uint16 (swap, pixels_odd, pixels_even, buf, width, odd_rows,
+ even_rows, num_bands);
+ break;
+ case RL2_SAMPLE_INT32:
+ do_copy_int32 (swap, pixels_odd, pixels_even, buf, width, odd_rows,
+ even_rows);
+ break;
+ case RL2_SAMPLE_UINT32:
+ do_copy_uint32 (swap, pixels_odd, pixels_even, buf, width, odd_rows,
+ even_rows);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ do_copy_float (swap, pixels_odd, pixels_even, buf, width, odd_rows,
+ even_rows);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ do_copy_double (swap, pixels_odd, pixels_even, buf, width, odd_rows,
+ even_rows);
+ break;
+ };
+
+ *pixels = buf;
+ *pixels_sz = buf_size;
+ return 1;
+}
+
+static int
+rescale_mask_2 (unsigned short *xwidth, unsigned short *xheight,
+ const unsigned char *mask_pix, unsigned char **mask,
+ int *mask_sz)
+{
+/* rescaling a transparency mask - scale 1:2 */
+ int row;
+ int col;
+ unsigned short width = *xwidth / 2.0;
+ unsigned short height = *xheight / 2.0;
+ unsigned char *p_out;
+ const unsigned char *p_in = mask_pix;
+
+ if ((width * 2) < *xwidth)
+ width++;
+ if ((height * 2) < *xheight)
+ height++;
+ *mask_sz = width * height;
+ *mask = malloc (*mask_sz);
+ if (*mask == NULL)
+ return 0;
+ p_out = *mask;
+
+ for (row = 0; row < *xheight; row += 2)
+ {
+ for (col = 0; col < *xwidth; col += 2)
+ {
+ *p_out++ = *p_in++;
+ p_in++;
+ }
+ p_in += *xwidth;
+ }
+
+ *xwidth = width;
+ *xheight = height;
+ return 1;
+}
+
+static int
+rescale_mask_4 (unsigned short *xwidth, unsigned short *xheight,
+ const unsigned char *mask_pix, unsigned char **mask,
+ int *mask_sz)
+{
+/* rescaling a transparency mask - scale 1:4 */
+ int row;
+ int col;
+ unsigned short width = *xwidth / 4.0;
+ unsigned short height = *xheight / 4.0;
+ unsigned char *p_out;
+ const unsigned char *p_in = mask_pix;
+
+ if ((width * 4) < *xwidth)
+ width++;
+ if ((height * 4) < *xheight)
+ height++;
+ *mask_sz = width * height;
+ *mask = malloc (*mask_sz);
+ if (*mask == NULL)
+ return 0;
+ p_out = *mask;
+
+ for (row = 0; row < *xheight; row += 4)
+ {
+ for (col = 0; col < *xwidth; col += 4)
+ {
+ *p_out++ = *p_in++;
+ p_in += 3;
+ }
+ p_in += *xwidth * 3;
+ }
+
+ *xwidth = width;
+ *xheight = height;
+ return 1;
+}
+
+static int
+rescale_mask_8 (unsigned short *xwidth, unsigned short *xheight,
+ const unsigned char *mask_pix, unsigned char **mask,
+ int *mask_sz)
+{
+/* rescaling a transparency mask - scale 1:8 */
+ int row;
+ int col;
+ unsigned short width = *xwidth / 8.0;
+ unsigned short height = *xheight / 8.0;
+ unsigned char *p_out;
+ const unsigned char *p_in = mask_pix;
+
+ if ((width * 8) < *xwidth)
+ width++;
+ if ((height * 8) < *xheight)
+ height++;
+ *mask_sz = width * height;
+ *mask = malloc (*mask_sz);
+ if (*mask == NULL)
+ return 0;
+ p_out = *mask;
+
+ for (row = 0; row < *xheight; row += 8)
+ {
+ for (col = 0; col < *xwidth; col += 8)
+ {
+ *p_out++ = *p_in++;
+ p_in += 7;
+ }
+ p_in += *xwidth * 7;
+ }
+
+ *xwidth = width;
+ *xheight = height;
+ return 1;
+}
+
+static int
+rescale_mask (int scale, unsigned short *xwidth, unsigned short *xheight,
+ unsigned char *mask_pix, unsigned char **mask, int *mask_sz)
+{
+/* rescaling the transparency mask */
+ unsigned short width = *xwidth;
+ unsigned short height = *xheight;
+ unsigned char *buf;
+ int buf_size;
+
+ if (scale == RL2_SCALE_2)
+ return rescale_mask_2 (xwidth, xheight, mask_pix, mask, mask_sz);
+ if (scale == RL2_SCALE_4)
+ return rescale_mask_4 (xwidth, xheight, mask_pix, mask, mask_sz);
+ if (scale == RL2_SCALE_8)
+ return rescale_mask_8 (xwidth, xheight, mask_pix, mask, mask_sz);
+
+ buf_size = width * height;
+ buf = malloc (buf_size);
+ if (buf == NULL)
+ return 0;
+
+ memcpy (buf, mask_pix, buf_size);
+ *mask = buf;
+ *mask_sz = buf_size;
+ return 1;
+}
+
+static int
+unpack_1bit (unsigned short width, unsigned short height,
+ unsigned short row_stride, const unsigned char *pixels_in,
+ unsigned char **pixels, int *pixels_sz)
+{
+/* unpacking a 1-BIT raster */
+ unsigned char *buf;
+ int buf_size;
+ int row;
+ int col;
+ unsigned char *p_out;
+ const unsigned char *p_in;
+
+ buf_size = width * height;
+ buf = malloc (buf_size);
+ if (buf == NULL)
+ return 0;
+
+ p_in = pixels_in;
+ p_out = buf;
+ for (row = 0; row < height; row++)
+ {
+ int x = 0;
+ for (col = 0; col < row_stride; col++)
+ {
+ unsigned char byte = *p_in++;
+ if ((byte & 0x80) == 0x80)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ x++;
+ if (x >= width)
+ break;
+ if ((byte & 0x40) == 0x40)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ x++;
+ if (x >= width)
+ break;
+ if ((byte & 0x20) == 0x20)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ x++;
+ if (x >= width)
+ break;
+ if ((byte & 0x10) == 0x10)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ x++;
+ if (x >= width)
+ break;
+ if ((byte & 0x08) == 0x08)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ if ((byte & 0x04) == 0x04)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ x++;
+ if (x >= width)
+ break;
+ if ((byte & 0x02) == 0x02)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ x++;
+ if (x >= width)
+ break;
+ if ((byte & 0x01) == 0x01)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ }
+ }
+
+ *pixels = buf;
+ *pixels_sz = buf_size;
+ return 1;
+}
+
+static int
+unpack_2bit (unsigned short width, unsigned short height,
+ unsigned short row_stride, const unsigned char *pixels_in,
+ unsigned char **pixels, int *pixels_sz)
+{
+/* unpacking a 2-BIT raster */
+ void *buf;
+ int buf_size;
+ int row;
+ int col;
+ unsigned char *p_out;
+ const unsigned char *p_in;
+
+ buf_size = width * height;
+ buf = malloc (buf_size);
+ if (buf == NULL)
+ return 0;
+
+ p_in = pixels_in;
+ p_out = buf;
+ for (row = 0; row < height; row++)
+ {
+ int x = 0;
+ for (col = 0; col < row_stride; col++)
+ {
+ unsigned char byte = *p_in++;
+ unsigned char hi0 = byte & 0xc0;
+ unsigned char hi1 = byte & 0x30;
+ unsigned char lo0 = byte & 0x0c;
+ unsigned char lo1 = byte & 0x03;
+ switch (hi0)
+ {
+ case 0x00:
+ *p_out++ = 0;
+ break;
+ case 0x40:
+ *p_out++ = 1;
+ break;
+ case 0x80:
+ *p_out++ = 2;
+ break;
+ case 0xc0:
+ *p_out++ = 3;
+ break;
+ };
+ x++;
+ if (x >= width)
+ break;
+ switch (hi1)
+ {
+ case 0x00:
+ *p_out++ = 0;
+ break;
+ case 0x10:
+ *p_out++ = 1;
+ break;
+ case 0x20:
+ *p_out++ = 2;
+ break;
+ case 0x30:
+ *p_out++ = 3;
+ break;
+ };
+ x++;
+ if (x >= width)
+ break;
+ switch (lo0)
+ {
+ case 0x00:
+ *p_out++ = 0;
+ break;
+ case 0x04:
+ *p_out++ = 1;
+ break;
+ case 0x08:
+ *p_out++ = 2;
+ break;
+ case 0x0c:
+ *p_out++ = 3;
+ break;
+ };
+ x++;
+ if (x >= width)
+ break;
+ switch (lo1)
+ {
+ case 0x00:
+ *p_out++ = 0;
+ break;
+ case 0x01:
+ *p_out++ = 1;
+ break;
+ case 0x02:
+ *p_out++ = 2;
+ break;
+ case 0x03:
+ *p_out++ = 3;
+ break;
+ };
+ x++;
+ }
+ }
+
+ *pixels = buf;
+ *pixels_sz = buf_size;
+ return 1;
+}
+
+static int
+unpack_4bit (unsigned short width, unsigned short height,
+ unsigned short row_stride, const unsigned char *pixels_in,
+ unsigned char **pixels, int *pixels_sz)
+{
+/* unpacking a 4-BIT raster */
+ void *buf;
+ int buf_size;
+ int row;
+ int col;
+ unsigned char *p_out;
+ const unsigned char *p_in;
+
+ buf_size = width * height;
+ buf = malloc (buf_size);
+ if (buf == NULL)
+ return 0;
+
+ p_in = pixels_in;
+ p_out = buf;
+ for (row = 0; row < height; row++)
+ {
+ int x = 0;
+ for (col = 0; col < row_stride; col++)
+ {
+ unsigned char byte = *p_in++;
+ unsigned char hi = byte & 0xf0;
+ unsigned char lo = byte & 0x0f;
+ switch (hi)
+ {
+ case 0x00:
+ *p_out++ = 0;
+ break;
+ case 0x10:
+ *p_out++ = 1;
+ break;
+ case 0x20:
+ *p_out++ = 2;
+ break;
+ case 0x30:
+ *p_out++ = 3;
+ break;
+ case 0x40:
+ *p_out++ = 4;
+ break;
+ case 0x50:
+ *p_out++ = 5;
+ break;
+ case 0x60:
+ *p_out++ = 6;
+ break;
+ case 0x70:
+ *p_out++ = 7;
+ break;
+ case 0x80:
+ *p_out++ = 8;
+ break;
+ case 0x90:
+ *p_out++ = 9;
+ break;
+ case 0xa0:
+ *p_out++ = 10;
+ break;
+ case 0xb0:
+ *p_out++ = 11;
+ break;
+ case 0xc0:
+ *p_out++ = 12;
+ break;
+ case 0xd0:
+ *p_out++ = 13;
+ break;
+ case 0xe0:
+ *p_out++ = 14;
+ break;
+ case 0xf0:
+ *p_out++ = 15;
+ break;
+ };
+ x++;
+ if (x >= width)
+ break;
+ switch (lo)
+ {
+ case 0x00:
+ *p_out++ = 0;
+ break;
+ case 0x01:
+ *p_out++ = 1;
+ break;
+ case 0x02:
+ *p_out++ = 2;
+ break;
+ case 0x03:
+ *p_out++ = 3;
+ break;
+ case 0x04:
+ *p_out++ = 4;
+ break;
+ case 0x05:
+ *p_out++ = 5;
+ break;
+ case 0x06:
+ *p_out++ = 6;
+ break;
+ case 0x07:
+ *p_out++ = 7;
+ break;
+ case 0x08:
+ *p_out++ = 8;
+ break;
+ case 0x09:
+ *p_out++ = 9;
+ break;
+ case 0x0a:
+ *p_out++ = 10;
+ break;
+ case 0x0b:
+ *p_out++ = 11;
+ break;
+ case 0x0c:
+ *p_out++ = 12;
+ break;
+ case 0x0d:
+ *p_out++ = 13;
+ break;
+ case 0x0e:
+ *p_out++ = 14;
+ break;
+ case 0x0f:
+ *p_out++ = 15;
+ break;
+ };
+ x++;
+ }
+ }
+
+ *pixels = buf;
+ *pixels_sz = buf_size;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_is_valid_dbms_raster_tile (unsigned short level, unsigned int tile_width,
+ unsigned int tile_height,
+ const unsigned char *blob_odd, int blob_odd_sz,
+ const unsigned char *blob_even, int blob_even_sz,
+ unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_bands,
+ unsigned char compression)
+{
+/* testing a serialized Raster Tile object for validity */
+ unsigned int width;
+ unsigned int height;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char xnum_bands;
+ unsigned char xcompression;
+ uLong crc;
+ if (!check_blob_odd
+ (blob_odd, blob_odd_sz, &width, &height, &xsample_type, &xpixel_type,
+ &xnum_bands, &xcompression, &crc))
+ return RL2_ERROR;
+ if (blob_even != NULL)
+ {
+ if (!check_blob_even
+ (blob_even, blob_even_sz, width, height, xsample_type,
+ xpixel_type, xnum_bands, xcompression, crc))
+ return RL2_ERROR;
+ }
+ if (width != tile_width || height != tile_height)
+ return RL2_ERROR;
+ if (level == 0)
+ {
+ /* base-level tile */
+ if (sample_type == xsample_type && pixel_type == xpixel_type
+ && num_bands == xnum_bands && compression == xcompression)
+ return RL2_OK;
+ }
+ else
+ {
+ /* Pyramid-level tile */
+ if (sample_type == RL2_SAMPLE_UINT8 && pixel_type == RL2_PIXEL_RGB
+ && num_bands == 3)
+ {
+ /* expecting an RGB/JPEG Pyramid tile 8bit */
+ if (xsample_type == RL2_SAMPLE_UINT8
+ && xpixel_type == RL2_PIXEL_RGB && xnum_bands == 3
+ && xcompression == RL2_COMPRESSION_JPEG)
+ return RL2_OK;
+ }
+ if (sample_type == RL2_SAMPLE_UINT8
+ && pixel_type == RL2_PIXEL_GRAYSCALE && num_bands == 1)
+ {
+ /* expecting a GRAYSCALE/JPEG Pyramid tile 8bit */
+ if (xsample_type == RL2_SAMPLE_UINT8
+ && xpixel_type == RL2_PIXEL_GRAYSCALE && xnum_bands == 1
+ && xcompression == RL2_COMPRESSION_JPEG)
+ return RL2_OK;
+ }
+ if (sample_type == RL2_SAMPLE_UINT16 && pixel_type == RL2_PIXEL_RGB
+ && num_bands == 3)
+ {
+ /* expecting an RGB/JPEG Pyramid tile 16bit */
+ if (xsample_type == RL2_SAMPLE_UINT16
+ && xpixel_type == RL2_PIXEL_RGB && xnum_bands == 3
+ && xcompression == RL2_COMPRESSION_DEFLATE)
+ return RL2_OK;
+ }
+ if (sample_type == RL2_SAMPLE_UINT16
+ && pixel_type == RL2_PIXEL_GRAYSCALE && num_bands == 1)
+ {
+ /* expecting a GRAYSCALE/JPEG Pyramid tile 16bit */
+ if (xsample_type == RL2_SAMPLE_UINT16
+ && xpixel_type == RL2_PIXEL_GRAYSCALE && xnum_bands == 1
+ && xcompression == RL2_COMPRESSION_DEFLATE)
+ return RL2_OK;
+ }
+ if (sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_MONOCHROME && num_bands == 1)
+ {
+ /* expecting a GRAYSCALE/PNG Pyramid tile */
+ if (xsample_type == RL2_SAMPLE_UINT8
+ && xpixel_type == RL2_PIXEL_GRAYSCALE && xnum_bands == 1
+ && xcompression == RL2_COMPRESSION_PNG)
+ return RL2_OK;
+ }
+ if ((sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1) ||
+ (sample_type == RL2_SAMPLE_2_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1) ||
+ (sample_type == RL2_SAMPLE_4_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1))
+ {
+ /* expecting an RGB/PNG Pyramid tile */
+ if (xsample_type == RL2_SAMPLE_UINT8
+ && xpixel_type == RL2_PIXEL_RGB && xnum_bands == 3
+ && xcompression == RL2_COMPRESSION_PNG)
+ return RL2_OK;
+ }
+ if (sample_type == RL2_SAMPLE_UINT8 && pixel_type == RL2_PIXEL_PALETTE
+ && num_bands == 1)
+ {
+ /* expecting an RGB/JPEG Pyramid tile */
+ if (xsample_type == RL2_SAMPLE_UINT8
+ && xpixel_type == RL2_PIXEL_RGB && xnum_bands == 3
+ && xcompression == RL2_COMPRESSION_JPEG)
+ return RL2_OK;
+ }
+ if (sample_type == xsample_type && pixel_type == RL2_PIXEL_DATAGRID
+ && num_bands == xnum_bands
+ && xcompression == RL2_COMPRESSION_DEFLATE)
+ return RL2_OK;
+ if (sample_type == xsample_type && pixel_type == RL2_PIXEL_MULTIBAND
+ && num_bands == xnum_bands
+ && xcompression == RL2_COMPRESSION_DEFLATE)
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_raster_decode (int scale, const unsigned char *blob_odd,
+ int blob_odd_sz, const unsigned char *blob_even,
+ int blob_even_sz, rl2PalettePtr ext_palette)
+{
+/* decoding from internal RL2 binary format to Raster */
+ rl2RasterPtr raster;
+ rl2PalettePtr palette = NULL;
+ rl2PalettePtr palette2 = NULL;
+ unsigned int width;
+ unsigned int height;
+ unsigned short mask_width;
+ unsigned short mask_height;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned char compression;
+ unsigned short row_stride_odd;
+ unsigned int odd_rows;
+ unsigned int even_rows;
+ int uncompressed_odd;
+ int compressed_odd;
+ int uncompressed_mask;
+ int compressed_mask;
+ int uncompressed_even = 0;
+ int compressed_even = 0;
+ uLong crc;
+ const unsigned char *pixels_odd;
+ const unsigned char *pixels_even;
+ const unsigned char *pixels_mask = NULL;
+ unsigned char *pixels = NULL;
+ int pixels_sz;
+ unsigned char *mask = NULL;
+ int mask_sz = 0;
+ const unsigned char *ptr;
+ unsigned char *odd_data = NULL;
+ unsigned char *even_data = NULL;
+ unsigned char *odd_mask = NULL;
+ unsigned char *even_mask = NULL;
+ int odd_mask_sz;
+ int even_mask_sz;
+ int swap;
+ int endian;
+ int endian_arch = endianArch ();
+ if (blob_odd == NULL)
+ return NULL;
+ if (!check_blob_odd
+ (blob_odd, blob_odd_sz, &width, &height, &sample_type, &pixel_type,
+ &num_bands, &compression, &crc))
+ return NULL;
+ if (blob_even != NULL)
+ {
+ if (!check_blob_even
+ (blob_even, blob_even_sz, width, height, sample_type, pixel_type,
+ num_bands, compression, crc))
+ return NULL;
+ }
+ if (!check_scale (scale, sample_type, compression, blob_even))
+ return NULL;
+
+ endian = *(blob_odd + 2);
+ num_bands = *(blob_odd + 6);
+ ptr = blob_odd + 11;
+ row_stride_odd = importU16 (ptr, endian, endian_arch);
+ ptr += 2;
+ odd_rows = importU16 (ptr, endian, endian_arch);
+ ptr += 2;
+ uncompressed_odd = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ compressed_odd = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ uncompressed_mask = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ compressed_mask = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ if (*ptr++ != RL2_DATA_START)
+ return NULL;
+ pixels_odd = ptr;
+ if (uncompressed_mask > 0)
+ {
+ /* retrieving the mask */
+ ptr += compressed_odd;
+ if (*ptr++ != RL2_DATA_END)
+ return NULL;
+ if (*ptr++ != RL2_MASK_START)
+ return NULL;
+ pixels_mask = ptr;
+ mask_width = width;
+ mask_height = height;
+ ptr += compressed_mask;
+ if (*ptr++ != RL2_MASK_END)
+ return NULL;
+ }
+ if (blob_even != NULL)
+ {
+ ptr = blob_even + 11;
+ even_rows = importU16 (ptr, endian, endian_arch);
+ ptr += 2;
+ ptr += 4; /* skipping OddBlock CRC */
+ uncompressed_even = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ compressed_even = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ if (*ptr++ != RL2_DATA_START)
+ return NULL;
+ pixels_even = ptr;
+ }
+ else
+ {
+ compressed_even = 0;
+ uncompressed_even = 0;
+ pixels_even = NULL;
+ }
+
+ if (compression == RL2_COMPRESSION_DEFLATE
+ && uncompressed_odd != compressed_odd)
+ {
+ /* decompressing from ZIP [Deflate] - ODD Block */
+ uLong refLen = uncompressed_odd;
+ const Bytef *in = pixels_odd;
+ odd_data = malloc (uncompressed_odd);
+ if (odd_data == NULL)
+ goto error;
+ if (uncompress (odd_data, &refLen, in, compressed_odd) != Z_OK)
+ goto error;
+ pixels_odd = odd_data;
+ if (pixels_even != NULL && uncompressed_even != compressed_even)
+ {
+ /* decompressing from ZIP [Deflate] - EVEN Block */
+ uLong refLen = uncompressed_even;
+ const Bytef *in = pixels_even;
+ even_data = malloc (uncompressed_even);
+ if (even_data == NULL)
+ goto error;
+ if (uncompress (even_data, &refLen, in, compressed_even) !=
+ Z_OK)
+ goto error;
+ pixels_even = even_data;
+ }
+ }
+ if (compression == RL2_COMPRESSION_LZMA
+ && uncompressed_odd != compressed_odd)
+ {
+ /* decompressing from LZMA - ODD Block */
+ lzma_options_lzma opt_lzma2;
+ lzma_filter filters[2];
+ size_t in_pos = 0;
+ size_t out_pos = 0;
+ size_t refLen = compressed_odd;
+ odd_data = malloc (uncompressed_odd);
+ if (odd_data == NULL)
+ goto error;
+ lzma_lzma_preset (&opt_lzma2, LZMA_PRESET_DEFAULT);
+ filters[0].id = LZMA_FILTER_LZMA2;
+ filters[0].options = &opt_lzma2;
+ filters[1].id = LZMA_VLI_UNKNOWN;
+ filters[1].options = NULL;
+ if (lzma_raw_buffer_decode
+ (filters, NULL, pixels_odd, &in_pos, refLen, odd_data, &out_pos,
+ uncompressed_odd) != LZMA_OK)
+ goto error;
+ pixels_odd = odd_data;
+ if (pixels_even != NULL && uncompressed_even != compressed_even)
+ {
+ /* decompressing from LZMA - EVEN Block */
+ lzma_options_lzma opt_lzma2;
+ lzma_filter filters[2];
+ size_t in_pos = 0;
+ size_t out_pos = 0;
+ size_t refLen = compressed_even;
+ even_data = malloc (uncompressed_even);
+ if (even_data == NULL)
+ goto error;
+ lzma_lzma_preset (&opt_lzma2, LZMA_PRESET_DEFAULT);
+ filters[0].id = LZMA_FILTER_LZMA2;
+ filters[0].options = &opt_lzma2;
+ filters[1].id = LZMA_VLI_UNKNOWN;
+ filters[1].options = NULL;
+ if (lzma_raw_buffer_decode
+ (filters, NULL, pixels_even, &in_pos, refLen, even_data,
+ &out_pos, uncompressed_even) != LZMA_OK)
+ goto error;
+ pixels_even = even_data;
+ }
+ }
+ if (compression == RL2_COMPRESSION_JPEG)
+ {
+ /* decompressing from JPEG - always on the ODD Block */
+ int ret = RL2_ERROR;
+ unsigned char pix_typ;
+ switch (scale)
+ {
+ case RL2_SCALE_1:
+ ret =
+ rl2_decode_jpeg_scaled (1, pixels_odd, compressed_odd,
+ &width, &height, &pix_typ, &pixels,
+ &pixels_sz);
+ break;
+ case RL2_SCALE_2:
+ ret =
+ rl2_decode_jpeg_scaled (2, pixels_odd, compressed_odd,
+ &width, &height, &pix_typ, &pixels,
+ &pixels_sz);
+ break;
+ case RL2_SCALE_4:
+ ret =
+ rl2_decode_jpeg_scaled (4, pixels_odd, compressed_odd,
+ &width, &height, &pix_typ, &pixels,
+ &pixels_sz);
+ break;
+ case RL2_SCALE_8:
+ ret =
+ rl2_decode_jpeg_scaled (8, pixels_odd, compressed_odd,
+ &width, &height, &pix_typ, &pixels,
+ &pixels_sz);
+ break;
+ };
+ if (ret != RL2_OK)
+ goto error;
+ goto done;
+ }
+ if (compression == RL2_COMPRESSION_LOSSY_WEBP
+ || compression == RL2_COMPRESSION_LOSSLESS_WEBP)
+ {
+ /* decompressing from WEBP - always on the ODD Block */
+ int ret = RL2_ERROR;
+ switch (scale)
+ {
+ case RL2_SCALE_1:
+ ret =
+ rl2_decode_webp_scaled (1, pixels_odd, compressed_odd,
+ &width, &height, pixel_type,
+ &pixels, &pixels_sz, &mask,
+ &mask_sz);
+ break;
+ case RL2_SCALE_2:
+ ret =
+ rl2_decode_webp_scaled (2, pixels_odd, compressed_odd,
+ &width, &height, pixel_type,
+ &pixels, &pixels_sz, &mask,
+ &mask_sz);
+ break;
+ case RL2_SCALE_4:
+ ret =
+ rl2_decode_webp_scaled (4, pixels_odd, compressed_odd,
+ &width, &height, pixel_type,
+ &pixels, &pixels_sz, &mask,
+ &mask_sz);
+ break;
+ case RL2_SCALE_8:
+ ret =
+ rl2_decode_webp_scaled (8, pixels_odd, compressed_odd,
+ &width, &height, pixel_type,
+ &pixels, &pixels_sz, &mask,
+ &mask_sz);
+ break;
+ };
+ if (ret != RL2_OK)
+ goto error;
+ goto done;
+ }
+ if (compression == RL2_COMPRESSION_PNG)
+ {
+ /* decompressing from PNG */
+ int ret;
+ if (sample_type == RL2_SAMPLE_1_BIT || sample_type == RL2_SAMPLE_2_BIT
+ || sample_type == RL2_SAMPLE_4_BIT)
+ {
+ /* Palette or Grayscale - 1,2 or 4 bit isn't scalable */
+ if (scale != RL2_SCALE_1)
+ goto error;
+ ret =
+ rl2_decode_png (pixels_odd, compressed_odd,
+ &width, &height, &sample_type, &pixel_type,
+ &num_bands, &pixels, &pixels_sz, &mask,
+ &mask_sz, &palette);
+ if (ret != RL2_OK)
+ goto error;
+ goto done;
+ }
+ else
+ {
+ ret = rl2_decode_png (pixels_odd, compressed_odd,
+ &width, &odd_rows, &sample_type,
+ &pixel_type, &num_bands, &odd_data,
+ &pixels_sz, &odd_mask, &odd_mask_sz,
+ &palette);
+ if (ret != RL2_OK)
+ goto error;
+ pixels_odd = odd_data;
+ if (scale == RL2_SCALE_1)
+ {
+ ret = rl2_decode_png (pixels_even, compressed_even,
+ &width, &even_rows, &sample_type,
+ &pixel_type, &num_bands, &even_data,
+ &pixels_sz, &even_mask,
+ &even_mask_sz, &palette2);
+ if (ret != RL2_OK)
+ goto error;
+ rl2_destroy_palette (palette2);
+ }
+ pixels_even = even_data;
+ if (odd_mask != NULL)
+ free (odd_mask);
+ if (even_mask != NULL)
+ free (even_mask);
+ goto merge;
+ }
+ }
+ if (compression == RL2_COMPRESSION_CCITTFAX4)
+ {
+ /* decompressing from TIFF FAX4 */
+ int ret;
+ if (sample_type == RL2_SAMPLE_1_BIT && scale == RL2_SCALE_1)
+ ;
+ else
+ goto error;
+ ret =
+ rl2_decode_tiff_mono4 (pixels_odd, compressed_odd,
+ &width, &height, &pixels, &pixels_sz);
+ if (ret != RL2_OK)
+ goto error;
+ sample_type = RL2_SAMPLE_1_BIT;
+ pixel_type = RL2_PIXEL_MONOCHROME;
+ num_bands = 1;
+ goto done;
+ }
+
+ if (sample_type == RL2_SAMPLE_1_BIT)
+ {
+ if (!unpack_1bit
+ (width, height, row_stride_odd, pixels_odd, &pixels, &pixels_sz))
+ goto error;
+ }
+ else if (sample_type == RL2_SAMPLE_2_BIT)
+ {
+ if (!unpack_2bit
+ (width, height, row_stride_odd, pixels_odd, &pixels, &pixels_sz))
+ goto error;
+ }
+ else if (sample_type == RL2_SAMPLE_4_BIT)
+ {
+ if (!unpack_4bit
+ (width, height, row_stride_odd, pixels_odd, &pixels, &pixels_sz))
+ goto error;
+ }
+ else
+ {
+ merge:
+ if (endian != endian_arch)
+ swap = 1;
+ else
+ swap = 0;
+ if (!build_pixel_buffer
+ (swap, scale, &width, &height, sample_type, num_bands, odd_rows,
+ pixels_odd, even_rows, pixels_even, (void **) (&pixels),
+ &pixels_sz))
+ goto error;
+ }
+
+ done:
+ if (pixels_mask != NULL)
+ {
+ /* unpacking the mask */
+ unsigned char *mask_pix;
+ int mask_pix_sz;
+ if (uncompressed_mask != (mask_width * mask_height))
+ goto error;
+ if (!unpack_rle
+ (mask_width, mask_height, pixels_mask, compressed_mask, &mask_pix,
+ &mask_pix_sz))
+ goto error;
+ if (!rescale_mask
+ (scale, &mask_width, &mask_height, mask_pix, &mask, &mask_sz))
+ {
+ free (mask_pix);
+ goto error;
+ }
+ free (mask_pix);
+ }
+
+ if (palette == NULL)
+ {
+ palette = ext_palette;
+ ext_palette = NULL;
+ }
+ else
+ {
+ if (ext_palette != NULL)
+ rl2_destroy_palette (ext_palette);
+ }
+ raster =
+ rl2_create_raster (width, height, sample_type, pixel_type, num_bands,
+ pixels, pixels_sz, palette, mask, mask_sz, NULL);
+ if (raster == NULL)
+ goto error;
+ if (odd_data != NULL)
+ free (odd_data);
+ if (even_data != NULL)
+ free (even_data);
+ return raster;
+ error:
+ if (odd_mask != NULL)
+ free (odd_mask);
+ if (even_mask != NULL)
+ free (even_mask);
+ if (odd_data != NULL)
+ free (odd_data);
+ if (even_data != NULL)
+ free (even_data);
+ if (pixels != NULL)
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ if (ext_palette != NULL)
+ rl2_destroy_palette (ext_palette);
+ return NULL;
+}
+
+static void
+add_pooled_variance (rl2PrivBandStatisticsPtr band_in,
+ rl2PrivBandStatisticsPtr band_out, double count)
+{
+/* adding a Pooled Variance item */
+ rl2PoolVariancePtr pool = malloc (sizeof (rl2PoolVariance));
+ pool->count = count;
+ pool->variance = band_in->sum_sq_diff / (count - 1.0);
+ pool->next = NULL;
+ if (band_out->first == NULL)
+ band_out->first = pool;
+ if (band_out->last != NULL)
+ band_out->last->next = pool;
+ band_out->last = pool;
+}
+
+static void
+do_aggregate_histograms (rl2PrivBandStatisticsPtr band_in,
+ rl2PrivBandStatisticsPtr band_out)
+{
+/* rescaling and aggregating histograms */
+ int ih;
+ double interval_in = band_in->max - band_in->min;
+ double interval_out = band_out->max - band_out->min;
+ double step_in = interval_in / ((double) (band_in->nHistogram) - 1.0);
+ double step_out = interval_out / ((double) (band_out->nHistogram) - 1.0);
+ for (ih = 0; ih < band_in->nHistogram; ih++)
+ {
+ double value = (((double) ih + 0.5) * step_in) + band_in->min;
+ double qty = *(band_in->histogram + ih);
+ double index = floor ((value - band_out->min) / step_out);
+ if (index < 0.0)
+ index = 0.0;
+ if (index > 255.0)
+ index = 255.0;
+ *(band_out->histogram + (unsigned int) index) += qty;
+ }
+}
+
+RL2_DECLARE int
+rl2_aggregate_raster_statistics (rl2RasterStatisticsPtr stats_in,
+ rl2RasterStatisticsPtr stats_out)
+{
+/* aggregating Raster Statistics */
+ rl2PrivRasterStatisticsPtr in = (rl2PrivRasterStatisticsPtr) stats_in;
+ rl2PrivRasterStatisticsPtr out = (rl2PrivRasterStatisticsPtr) stats_out;
+ rl2PrivBandStatisticsPtr band_in;
+ rl2PrivBandStatisticsPtr band_out;
+ int ib;
+ int ih;
+
+ if (in == NULL || out == NULL)
+ return RL2_ERROR;
+ if (in->sampleType != out->sampleType)
+ return RL2_ERROR;
+ if (in->nBands != out->nBands)
+ return RL2_ERROR;
+
+ if (out->count == 0.0)
+ {
+ /* initializing */
+ out->no_data = in->no_data;
+ out->count = in->count;
+ for (ib = 0; ib < in->nBands; ib++)
+ {
+ band_in = in->band_stats + ib;
+ band_out = out->band_stats + ib;
+ band_out->min = band_in->min;
+ band_out->max = band_in->max;
+ band_out->mean = band_in->mean;
+ add_pooled_variance (band_in, band_out, in->count);
+ for (ih = 0; ih < band_in->nHistogram; ih++)
+ *(band_out->histogram + ih) = *(band_in->histogram + ih);
+ }
+ }
+ else
+ {
+ /* aggregating */
+ out->no_data += in->no_data;
+ for (ib = 0; ib < in->nBands; ib++)
+ {
+ band_in = in->band_stats + ib;
+ band_out = out->band_stats + ib;
+ if (band_in->min < band_out->min)
+ band_out->min = band_in->min;
+ if (band_in->max > band_out->max)
+ band_out->max = band_in->max;
+ add_pooled_variance (band_in, band_out, in->count);
+ band_out->mean =
+ ((band_out->mean * out->count) +
+ (band_in->mean * in->count)) / (out->count + in->count);
+ if (out->sampleType == RL2_SAMPLE_INT8
+ || out->sampleType == RL2_SAMPLE_UINT8)
+ {
+ /* just copying 8-bit histograms */
+ for (ih = 0; ih < band_in->nHistogram; ih++)
+ *(band_out->histogram + ih) +=
+ *(band_in->histogram + ih);
+ }
+ else
+ {
+ /* rescaling and aggregating histograms */
+ do_aggregate_histograms (band_in, band_out);
+ }
+ }
+ out->count += in->count;
+ }
+ return RL2_OK;
+}
+
+static void
+update_no_data_stats (rl2PrivRasterStatisticsPtr st)
+{
+/* updating the NoData count */
+ st->no_data += 1.0;
+}
+
+static void
+update_count_stats (rl2PrivRasterStatisticsPtr st)
+{
+/* updating the samples count */
+ st->count += 1.0;
+}
+
+static void
+update_stats (rl2PrivRasterStatisticsPtr st, int band, double value)
+{
+/* updating the Statistics */
+ rl2PrivBandStatisticsPtr band_st = st->band_stats + band;
+ if (value < band_st->min)
+ band_st->min = value;
+ if (value > band_st->max)
+ band_st->max = value;
+ if (st->count == 0.0)
+ {
+ band_st->mean = value;
+ band_st->sum_sq_diff = 0.0;
+ }
+ else
+ {
+ band_st->sum_sq_diff =
+ band_st->sum_sq_diff +
+ (((st->count -
+ 1.0) * ((value - band_st->mean) * (value -
+ band_st->mean))) /
+ st->count);
+ band_st->mean = band_st->mean + ((value - band_st->mean) / st->count);
+ }
+ if (st->sampleType == RL2_SAMPLE_INT8)
+ {
+ int idx = value + 128;
+ *(band_st->histogram + idx) += 1.0;
+ }
+ else if (st->sampleType == RL2_SAMPLE_1_BIT
+ || st->sampleType == RL2_SAMPLE_2_BIT
+ || st->sampleType == RL2_SAMPLE_4_BIT
+ || st->sampleType == RL2_SAMPLE_UINT8)
+ {
+ int idx = value;
+ *(band_st->histogram + idx) += 1.0;
+ }
+}
+
+static void
+update_int8_stats (unsigned short width, unsigned short height,
+ const char *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing INT8 tile statistics */
+ int x;
+ int y;
+ const char *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_INT8)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ update_no_data_stats (st);
+ p_in++;
+ }
+ else
+ {
+ /* opaque pixel */
+ double value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const char *p_save = p_in;
+ char sample = 0;
+ rl2_get_pixel_sample_int8 (no_data, &sample);
+ if (sample == *p_in++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ double value;
+ p_in = p_save;
+ value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ update_no_data_stats (st);
+ }
+ }
+ }
+ }
+}
+
+static void
+update_uint8_stats (unsigned short width, unsigned short height,
+ unsigned char num_bands,
+ const unsigned char *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing UINT8 tile statistics */
+ int x;
+ int y;
+ int ib;
+ const unsigned char *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != num_bands)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_1_BIT || sample_type == RL2_SAMPLE_2_BIT
+ || sample_type == RL2_SAMPLE_4_BIT
+ || sample_type == RL2_SAMPLE_UINT8)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ update_no_data_stats (st);
+ for (ib = 0; ib < num_bands; ib++)
+ p_in++;
+ }
+ else
+ {
+ /* opaque pixel */
+ update_count_stats (st);
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ double value = *p_in++;
+ update_stats (st, ib, value);
+ }
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned char *p_save = p_in;
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ unsigned char sample = 0;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ rl2_get_pixel_sample_1bit (no_data, &sample);
+ break;
+ case RL2_SAMPLE_2_BIT:
+ rl2_get_pixel_sample_2bit (no_data, &sample);
+ break;
+ case RL2_SAMPLE_4_BIT:
+ rl2_get_pixel_sample_4bit (no_data, &sample);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_get_pixel_sample_uint8 (no_data, ib,
+ &sample);
+ break;
+ };
+ if (sample == *p_in++)
+ match++;
+ }
+ if (match != num_bands)
+ {
+ /* opaque pixel */
+ update_count_stats (st);
+ p_in = p_save;
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ double value = *p_in++;
+ update_stats (st, ib, value);
+ }
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ update_no_data_stats (st);
+ }
+ }
+ }
+ }
+}
+
+static void
+update_histogram (rl2PrivRasterStatisticsPtr st, int band, double value)
+{
+/* updating the Histogram */
+ double interval;
+ double step;
+ double index;
+ rl2PrivBandStatisticsPtr band_st = st->band_stats + band;
+
+ interval = band_st->max - band_st->min;
+ step = interval / ((double) (band_st->nHistogram) - 1.0);
+ index = floor ((value - band_st->min) / step);
+ if (index < 0.0)
+ index = 0.0;
+ if (index > 255.0)
+ index = 255.0;
+ *(band_st->histogram + (unsigned int) index) += 1.0;
+}
+
+static void
+compute_int16_histogram (unsigned short width, unsigned short height,
+ const short *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing INT16 tile histogram */
+ int x;
+ int y;
+ const short *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_INT16)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ p_in++;
+ else
+ {
+ /* opaque pixel */
+ double value = *p_in++;
+ update_histogram (st, 0, value);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const short *p_save = p_in;
+ short sample = 0;
+ rl2_get_pixel_sample_int16 (no_data, &sample);
+ if (sample == *p_in++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ double value;
+ p_in = p_save;
+ value = *p_in++;
+ update_histogram (st, 0, value);
+ }
+ }
+ }
+ }
+}
+
+static void
+update_int16_stats (unsigned short width, unsigned short height,
+ const short *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing INT16 tile statistics */
+ int x;
+ int y;
+ const short *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_INT16)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ update_no_data_stats (st);
+ p_in++;
+ }
+ else
+ {
+ /* opaque pixel */
+ double value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const short *p_save = p_in;
+ short sample = 0;
+ rl2_get_pixel_sample_int16 (no_data, &sample);
+ if (sample == *p_in++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ double value;
+ p_in = p_save;
+ value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ update_no_data_stats (st);
+ }
+ }
+ }
+ }
+ compute_int16_histogram (width, height, pixels, mask, st, no_data);
+}
+
+static void
+compute_uint16_histogram (unsigned short width, unsigned short height,
+ unsigned char num_bands,
+ const unsigned short *pixels,
+ const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing INT16 tile histogram */
+ int x;
+ int y;
+ int ib;
+ const unsigned short *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != num_bands)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ for (ib = 0; ib < num_bands; ib++)
+ p_in++;
+ }
+ else
+ {
+ /* opaque pixel */
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ double value = *p_in++;
+ update_histogram (st, ib, value);
+ }
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned short *p_save = p_in;
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ unsigned short sample = 0;
+ rl2_get_pixel_sample_uint16 (no_data, ib, &sample);
+ if (sample == *p_in++)
+ match++;
+ }
+ if (match != num_bands)
+ {
+ /* opaque pixel */
+ p_in = p_save;
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ double value = *p_in++;
+ update_histogram (st, ib, value);
+ }
+ }
+ }
+ }
+ }
+}
+
+static void
+update_uint16_stats (unsigned short width, unsigned short height,
+ unsigned char num_bands,
+ const unsigned short *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing UINT16 tile statistics */
+ int x;
+ int y;
+ int ib;
+ const unsigned short *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != num_bands)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ update_no_data_stats (st);
+ for (ib = 0; ib < num_bands; ib++)
+ p_in++;
+ }
+ else
+ {
+ /* opaque pixel */
+ update_count_stats (st);
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ double value = *p_in++;
+ update_stats (st, ib, value);
+ }
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned short *p_save = p_in;
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ unsigned short sample = 0;
+ rl2_get_pixel_sample_uint16 (no_data, ib, &sample);
+ if (sample == *p_in++)
+ match++;
+ }
+ if (match != num_bands)
+ {
+ /* opaque pixel */
+ update_count_stats (st);
+ p_in = p_save;
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ double value = *p_in++;
+ update_stats (st, ib, value);
+ }
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ update_no_data_stats (st);
+ }
+ }
+ }
+ }
+ compute_uint16_histogram (width, height, num_bands, pixels, mask, st,
+ no_data);
+}
+
+static void
+compute_int32_histogram (unsigned short width, unsigned short height,
+ const int *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing INT16 tile histogram */
+ int x;
+ int y;
+ const int *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_INT32)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ p_in++;
+ else
+ {
+ /* opaque pixel */
+ double value = *p_in++;
+ update_histogram (st, 0, value);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const int *p_save = p_in;
+ int sample = 0;
+ rl2_get_pixel_sample_int32 (no_data, &sample);
+ if (sample == *p_in++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ double value;
+ p_in = p_save;
+ value = *p_in++;
+ update_histogram (st, 0, value);
+ }
+ }
+ }
+ }
+}
+
+static void
+update_int32_stats (unsigned short width, unsigned short height,
+ const int *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing INT32 tile statistics */
+ int x;
+ int y;
+ const int *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_INT32)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ update_no_data_stats (st);
+ p_in++;
+ }
+ else
+ {
+ /* opaque pixel */
+ double value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const int *p_save = p_in;
+ int sample = 0;
+ rl2_get_pixel_sample_int32 (no_data, &sample);
+ if (sample == *p_in++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ double value;
+ p_in = p_save;
+ value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ update_no_data_stats (st);
+ }
+ }
+ }
+ }
+ compute_int32_histogram (width, height, pixels, mask, st, no_data);
+}
+
+static void
+compute_uint32_histogram (unsigned short width, unsigned short height,
+ const unsigned int *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing INT16 tile histogram */
+ int x;
+ int y;
+ const unsigned int *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_UINT32)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ p_in++;
+ else
+ {
+ /* opaque pixel */
+ double value = *p_in++;
+ update_histogram (st, 0, value);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned int *p_save = p_in;
+ unsigned int sample = 0;
+ rl2_get_pixel_sample_uint32 (no_data, &sample);
+ if (sample == *p_in++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ double value;
+ p_in = p_save;
+ value = *p_in++;
+ update_histogram (st, 0, value);
+ }
+ }
+ }
+ }
+}
+
+static void
+update_uint32_stats (unsigned short width, unsigned short height,
+ const unsigned int *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing UINT32 tile statistics */
+ int x;
+ int y;
+ const unsigned int *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_UINT32)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ update_no_data_stats (st);
+ p_in++;
+ }
+ else
+ {
+ /* opaque pixel */
+ double value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned int *p_save = p_in;
+ unsigned int sample = 0;
+ rl2_get_pixel_sample_uint32 (no_data, &sample);
+ if (sample == *p_in++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ double value;
+ p_in = p_save;
+ value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ update_no_data_stats (st);
+ }
+ }
+ }
+ }
+ compute_uint32_histogram (width, height, pixels, mask, st, no_data);
+}
+
+static void
+compute_float_histogram (unsigned short width, unsigned short height,
+ const float *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing FLOAT tile histogram */
+ int x;
+ int y;
+ const float *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_FLOAT)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ p_in++;
+ else
+ {
+ /* opaque pixel */
+ double value = *p_in++;
+ update_histogram (st, 0, value);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const float *p_save = p_in;
+ float sample = 0;
+ rl2_get_pixel_sample_float (no_data, &sample);
+ if (sample == *p_in++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ double value;
+ p_in = p_save;
+ value = *p_in++;
+ update_histogram (st, 0, value);
+ }
+ }
+ }
+ }
+}
+
+static void
+update_float_stats (unsigned short width, unsigned short height,
+ const float *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing FLOAT tile statistics */
+ int x;
+ int y;
+ const float *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_FLOAT)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ update_no_data_stats (st);
+ p_in++;
+ }
+ else
+ {
+ /* opaque pixel */
+ double value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const float *p_save = p_in;
+ float sample = 0.0;
+ rl2_get_pixel_sample_float (no_data, &sample);
+ if (sample == *p_in++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ double value;
+ p_in = p_save;
+ value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ update_no_data_stats (st);
+ }
+ }
+ }
+ }
+ compute_float_histogram (width, height, pixels, mask, st, no_data);
+}
+
+static void
+compute_double_histogram (unsigned short width, unsigned short height,
+ const double *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing INT16 tile histogram */
+ int x;
+ int y;
+ const double *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_DOUBLE)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ p_in++;
+ else
+ {
+ /* opaque pixel */
+ double value = *p_in++;
+ update_histogram (st, 0, value);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const double *p_save = p_in;
+ double sample = 0;
+ rl2_get_pixel_sample_double (no_data, &sample);
+ if (sample == *p_in++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ double value;
+ p_in = p_save;
+ value = *p_in++;
+ update_histogram (st, 0, value);
+ }
+ }
+ }
+ }
+}
+
+static void
+update_double_stats (unsigned short width, unsigned short height,
+ const double *pixels, const unsigned char *mask,
+ rl2PrivRasterStatisticsPtr st, rl2PixelPtr no_data)
+{
+/* computing DOUBLE tile statistics */
+ int x;
+ int y;
+ const double *p_in = pixels;
+ const unsigned char *p_msk = mask;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_DOUBLE)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ update_no_data_stats (st);
+ p_in++;
+ }
+ else
+ {
+ /* opaque pixel */
+ double value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const double *p_save = p_in;
+ double sample = 0.0;
+ rl2_get_pixel_sample_double (no_data, &sample);
+ if (sample == *p_in++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ double value;
+ p_in = p_save;
+ value = *p_in++;
+ update_count_stats (st);
+ update_stats (st, 0, value);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ update_no_data_stats (st);
+ }
+ }
+ }
+ }
+ compute_double_histogram (width, height, pixels, mask, st, no_data);
+}
+
+RL2_DECLARE rl2RasterStatisticsPtr
+rl2_build_raster_statistics (rl2RasterPtr raster, rl2PixelPtr noData)
+{
+/*
+/ building a statistics object from a Raster object
+*/
+ rl2PrivRasterStatisticsPtr st;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterPtr rst;
+ if (raster == NULL)
+ goto error;
+ rst = (rl2PrivRasterPtr) raster;
+
+ stats = rl2_create_raster_statistics (rst->sampleType, rst->nBands);
+ if (stats == NULL)
+ goto error;
+ st = (rl2PrivRasterStatisticsPtr) stats;
+
+ switch (rst->sampleType)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ update_uint8_stats (rst->width, rst->height, rst->nBands,
+ (const unsigned char *) (rst->rasterBuffer),
+ rst->maskBuffer, st, noData);
+ break;
+ case RL2_SAMPLE_INT8:
+ update_int8_stats (rst->width, rst->height,
+ (const char *) (rst->rasterBuffer),
+ rst->maskBuffer, st, noData);
+ break;
+ case RL2_SAMPLE_UINT16:
+ update_uint16_stats (rst->width, rst->height, rst->nBands,
+ (const unsigned short *) (rst->rasterBuffer),
+ rst->maskBuffer, st, noData);
+ break;
+ case RL2_SAMPLE_INT16:
+ update_int16_stats (rst->width, rst->height,
+ (const short *) (rst->rasterBuffer),
+ rst->maskBuffer, st, noData);
+ break;
+ case RL2_SAMPLE_UINT32:
+ update_uint32_stats (rst->width, rst->height,
+ (const unsigned int *) (rst->rasterBuffer),
+ rst->maskBuffer, st, noData);
+ break;
+ case RL2_SAMPLE_INT32:
+ update_int32_stats (rst->width, rst->height,
+ (const int *) (rst->rasterBuffer),
+ rst->maskBuffer, st, noData);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ update_float_stats (rst->width, rst->height,
+ (const float *) (rst->rasterBuffer),
+ rst->maskBuffer, st, noData);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ update_double_stats (rst->width, rst->height,
+ (const double *) (rst->rasterBuffer),
+ rst->maskBuffer, st, noData);
+ break;
+ };
+ return stats;
+
+ error:
+ if (stats != NULL)
+ rl2_destroy_raster_statistics (stats);
+ return NULL;
+}
+
+RL2_DECLARE rl2RasterStatisticsPtr
+rl2_get_raster_statistics (const unsigned char *blob_odd,
+ int blob_odd_sz, const unsigned char *blob_even,
+ int blob_even_sz, rl2PalettePtr palette,
+ rl2PixelPtr noData)
+{
+/*
+/ decoding from internal RL2 binary format to Raster and
+/ building the corresponding statistics object
+*/
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2RasterPtr raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, palette);
+ if (raster == NULL)
+ goto error;
+ palette = NULL;
+
+ stats = rl2_build_raster_statistics (raster, noData);
+ if (stats == NULL)
+ goto error;
+ rl2_destroy_raster (raster);
+ return stats;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ if (stats != NULL)
+ rl2_destroy_raster_statistics (stats);
+ return NULL;
+}
+
+RL2_DECLARE int
+rl2_serialize_dbms_palette (rl2PalettePtr palette, unsigned char **blob,
+ int *blob_size)
+{
+/* creating a Palette (DBMS serialized format) */
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) palette;
+ rl2PrivPaletteEntryPtr entry;
+ int sz = 12;
+ uLong crc;
+ int i;
+ int endian_arch = endianArch ();
+ unsigned char *p;
+ unsigned char *ptr;
+
+ if (plt == NULL)
+ return RL2_ERROR;
+
+ sz += plt->nEntries * 3;
+ p = malloc (sz);
+ if (p == NULL)
+ return RL2_ERROR;
+ ptr = p;
+
+ *ptr++ = 0x00; /* start marker */
+ *ptr++ = RL2_DATA_START;
+ *ptr++ = RL2_LITTLE_ENDIAN;
+ exportU16 (ptr, plt->nEntries, 1, endian_arch); /* # Palette entries */
+ ptr += 2;
+ *ptr++ = RL2_PALETTE_START;
+ for (i = 0; i < plt->nEntries; i++)
+ {
+ entry = plt->entries + i;
+ *ptr++ = entry->red;
+ *ptr++ = entry->green;
+ *ptr++ = entry->blue;
+ }
+ *ptr++ = RL2_PALETTE_END;
+/* computing the CRC32 */
+ crc = crc32 (0L, p, ptr - p);
+ exportU32 (ptr, crc, 1, endian_arch); /* the Palette own CRC */
+ ptr += 4;
+ *ptr++ = RL2_DATA_END;
+ *blob = p;
+ *blob_size = sz;
+ return RL2_OK;
+}
+
+static int
+check_serialized_palette (const unsigned char *blob, int blob_size)
+{
+/* checking a Raster Statistics serialized object from validity */
+ uLong crc;
+ uLong oldCrc;
+ const unsigned char *ptr = blob;
+ int endian;
+ unsigned short nEntries;
+ int endian_arch = endianArch ();
+ if (blob == NULL)
+ return 0;
+ if (blob_size < 12)
+ return 0;
+
+ if (*ptr++ != 0x00)
+ return 0; /* invalid start signature */
+ if (*ptr++ != RL2_DATA_START)
+ return 0; /* invalid start signature */
+ endian = *ptr++;
+ if (endian == RL2_LITTLE_ENDIAN || endian == RL2_BIG_ENDIAN)
+ ;
+ else
+ return 0; /* invalid endiannes */
+ nEntries = importU16 (ptr, endian, endian_arch);
+ ptr += 2;
+ if (blob_size != 12 + (nEntries * 3))
+ return 0; /* invalid size */
+ if (*ptr++ != RL2_PALETTE_START)
+ return 0; /* invalid start marker */
+ ptr += nEntries * 3;
+ if (*ptr++ != RL2_PALETTE_END)
+ return 0;
+/* computing the CRC32 */
+ crc = crc32 (0L, blob, ptr - blob);
+ oldCrc = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ if (crc != oldCrc)
+ return 0;
+ if (*ptr != RL2_DATA_END)
+ return 0; /* invalid end signature */
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_is_valid_dbms_palette (const unsigned char *blob, int blob_size,
+ unsigned char sample_type)
+{
+/* testing a serialized Palette object for validity */
+ const unsigned char *ptr;
+ int endian;
+ unsigned short nEntries;
+ int endian_arch = endianArch ();
+ if (!check_serialized_palette (blob, blob_size))
+ return RL2_ERROR;
+ ptr = blob + 2;
+ endian = *ptr++;
+ nEntries = importU16 (ptr, endian, endian_arch);
+ if (sample_type == RL2_SAMPLE_1_BIT || sample_type == RL2_SAMPLE_2_BIT
+ || sample_type == RL2_SAMPLE_4_BIT || sample_type == RL2_SAMPLE_UINT8)
+ ;
+ else
+ return RL2_ERROR;
+ if (sample_type == RL2_SAMPLE_1_BIT && nEntries > 2)
+ return RL2_ERROR;
+ if (sample_type == RL2_SAMPLE_2_BIT && nEntries > 4)
+ return RL2_ERROR;
+ if (sample_type == RL2_SAMPLE_4_BIT && nEntries > 16)
+ return RL2_ERROR;
+ if (sample_type == RL2_SAMPLE_UINT8 && nEntries > 256)
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2PalettePtr
+rl2_deserialize_dbms_palette (const unsigned char *blob, int blob_size)
+{
+/* attempting to deserialize a Palette from DBMS binary format */
+ rl2PalettePtr palette = NULL;
+ int ip;
+ const unsigned char *ptr;
+ int endian;
+ unsigned short nEntries;
+ int endian_arch = endianArch ();
+ if (blob == NULL)
+ return NULL;
+ if (blob_size < 12)
+ return NULL;
+
+ if (!check_serialized_palette (blob, blob_size))
+ return NULL;
+ ptr = blob + 2;
+ endian = *ptr++;
+ nEntries = importU16 (ptr, endian, endian_arch);
+ ptr += 3;
+ palette = rl2_create_palette (nEntries);
+ if (palette == NULL)
+ return NULL;
+ for (ip = 0; ip < nEntries; ip++)
+ {
+ unsigned char r = *ptr++;
+ unsigned char g = *ptr++;
+ unsigned char b = *ptr++;
+ rl2_set_palette_color (palette, ip, r, g, b);
+ }
+ return palette;
+}
+
+RL2_DECLARE int
+rl2_serialize_dbms_raster_statistics (rl2RasterStatisticsPtr stats,
+ unsigned char **blob, int *blob_size)
+{
+/* creating a Raster Statistics (DBMS serialized format) */
+ rl2PrivRasterStatisticsPtr st = (rl2PrivRasterStatisticsPtr) stats;
+ rl2PrivBandStatisticsPtr band;
+ int sz = 26;
+ uLong crc;
+ int ib;
+ int ih;
+ int endian_arch = endianArch ();
+ unsigned char *p;
+ unsigned char *ptr;
+
+ *blob = NULL;
+ *blob_size = 0;
+ if (st == NULL)
+ return RL2_ERROR;
+
+ for (ib = 0; ib < st->nBands; ib++)
+ {
+ band = st->band_stats + ib;
+ sz += 38;
+ sz += band->nHistogram * sizeof (double);
+ }
+ p = malloc (sz);
+ if (p == NULL)
+ return RL2_ERROR;
+ ptr = p;
+
+ *ptr++ = 0x00; /* start marker */
+ *ptr++ = RL2_STATS_START;
+ *ptr++ = RL2_LITTLE_ENDIAN;
+ *ptr++ = st->sampleType;
+ *ptr++ = st->nBands;
+ exportDouble (ptr, st->no_data, 1, endian_arch); /* # no_data values */
+ ptr += 8;
+ exportDouble (ptr, st->count, 1, endian_arch); /* # count */
+ ptr += 8;
+ for (ib = 0; ib < st->nBands; ib++)
+ {
+ *ptr++ = RL2_BAND_STATS_START;
+ band = st->band_stats + ib;
+ exportDouble (ptr, band->min, 1, endian_arch); /* # Min values */
+ ptr += 8;
+ exportDouble (ptr, band->max, 1, endian_arch); /* # Max values */
+ ptr += 8;
+ exportDouble (ptr, band->mean, 1, endian_arch); /* # Mean */
+ ptr += 8;
+ exportDouble (ptr, band->sum_sq_diff, 1, endian_arch); /* # sum of square differences */
+ ptr += 8;
+ exportU16 (ptr, band->nHistogram, 1, endian_arch); /* # Histogram entries */
+ ptr += 2;
+ *ptr++ = RL2_HISTOGRAM_START;
+ for (ih = 0; ih < band->nHistogram; ih++)
+ {
+ exportDouble (ptr, *(band->histogram + ih), 1, endian_arch); /* # Histogram value */
+ ptr += 8;
+ }
+ *ptr++ = RL2_HISTOGRAM_END;
+ *ptr++ = RL2_BAND_STATS_END;
+ }
+/* computing the CRC32 */
+ crc = crc32 (0L, p, ptr - p);
+ exportU32 (ptr, crc, 1, endian_arch); /* the Raster Statistics own CRC */
+ ptr += 4;
+ *ptr++ = RL2_STATS_END;
+ *blob = p;
+ *blob_size = sz;
+ return RL2_OK;
+}
+
+static int
+check_raster_serialized_statistics (const unsigned char *blob, int blob_size)
+{
+/* checking a Raster Statistics serialized object from validity */
+ const unsigned char *ptr = blob;
+ int endian;
+ uLong crc;
+ uLong oldCrc;
+ int ib;
+ unsigned short nHistogram;
+ unsigned char sample_type;
+ unsigned char num_bands;
+ int endian_arch = endianArch ();
+
+ if (blob == NULL)
+ return 0;
+ if (blob_size < 27)
+ return 0;
+ if (*ptr++ != 0x00)
+ return 0; /* invalid start signature */
+ if (*ptr++ != RL2_STATS_START)
+ return 0; /* invalid start signature */
+ endian = *ptr++;
+ if (endian == RL2_LITTLE_ENDIAN || endian == RL2_BIG_ENDIAN)
+ ;
+ else
+ return 0; /* invalid endiannes */
+ sample_type = *ptr++;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ case RL2_SAMPLE_DOUBLE:
+ break;
+ default:
+ return 0;
+ };
+ num_bands = *ptr++;
+
+ ptr = blob + 21;
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ if (((ptr - blob) + 38) >= blob_size)
+ return 0;
+ if (*ptr++ != RL2_BAND_STATS_START)
+ return 0;
+ ptr += 32;
+ nHistogram = importU16 (ptr, endian, endian_arch);
+ ptr += 2;
+ if (*ptr++ != RL2_HISTOGRAM_START)
+ return 0;
+ if (((ptr - blob) + 2 + (nHistogram * sizeof (double))) >=
+ (unsigned int) blob_size)
+ return 0;
+ ptr += nHistogram * sizeof (double);
+ if (*ptr++ != RL2_HISTOGRAM_END)
+ return 0;
+ if (*ptr++ != RL2_BAND_STATS_END)
+ return 0;
+ }
+/* computing the CRC32 */
+ crc = crc32 (0L, blob, ptr - blob);
+ oldCrc = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ if (crc != oldCrc)
+ return 0;
+ if (*ptr != RL2_STATS_END)
+ return 0; /* invalid end signature */
+
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_is_valid_dbms_raster_statistics (const unsigned char *blob, int blob_size,
+ unsigned char sample_type,
+ unsigned char num_bands)
+{
+/* testing a serialized Raster Statistics object for validity */
+ const unsigned char *ptr;
+ unsigned char xsample_type;
+ unsigned char xnum_bands;
+ if (!check_raster_serialized_statistics (blob, blob_size))
+ return RL2_ERROR;
+ ptr = blob + 3;
+ xsample_type = *ptr++;
+ xnum_bands = *ptr++;
+ if (sample_type == xsample_type && num_bands == xnum_bands)
+ return RL2_OK;
+ return RL2_ERROR;
+}
+
+RL2_DECLARE rl2RasterStatisticsPtr
+rl2_deserialize_dbms_raster_statistics (const unsigned char *blob,
+ int blob_size)
+{
+/* attempting to deserialize a Raster Statistics object from DBMS binary format */
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ unsigned char sample_type;
+ unsigned char num_bands;
+ int ib;
+ int ih;
+ const unsigned char *ptr = blob;
+ int endian;
+ int endian_arch = endianArch ();
+ if (!check_raster_serialized_statistics (blob, blob_size))
+ return NULL;
+
+ ptr = blob + 2;
+ endian = *ptr++;
+ sample_type = *ptr++;
+ num_bands = *ptr++;
+ stats = rl2_create_raster_statistics (sample_type, num_bands);
+ if (stats == NULL)
+ goto error;
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ st->no_data = importDouble (ptr, endian, endian_arch); /* # no_data values */
+ ptr += 8;
+ st->count = importDouble (ptr, endian, endian_arch); /* # count */
+ ptr += 8;
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ rl2PrivBandStatisticsPtr band = st->band_stats + ib;
+ ptr++; /* skipping BAND START marker */
+ band->min = importDouble (ptr, endian, endian_arch); /* # Min values */
+ ptr += 8;
+ band->max = importDouble (ptr, endian, endian_arch); /* # Max values */
+ ptr += 8;
+ band->mean = importDouble (ptr, endian, endian_arch); /* # Mean */
+ ptr += 8;
+ band->sum_sq_diff = importDouble (ptr, endian, endian_arch); /* # Sum of square differences */
+ ptr += 8;
+ ptr += 3; /* skipping HISTOGRAM START marker */
+ for (ih = 0; ih < band->nHistogram; ih++)
+ {
+ *(band->histogram + ih) = importDouble (ptr, endian, endian_arch); /* # Histogram values */
+ ptr += 8;
+ }
+ ptr += 2; /* skipping END markers */
+ }
+ return stats;
+
+ error:
+ if (stats != NULL)
+ rl2_destroy_raster_statistics (stats);
+ return NULL;
+}
+
+RL2_DECLARE int
+rl2_serialize_dbms_pixel (rl2PixelPtr pixel, unsigned char **blob,
+ int *blob_size)
+{
+/* creating a NO-DATA (DBMS serialized format) */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) pixel;
+ rl2PrivSamplePtr band;
+ int sz = 12;
+ uLong crc;
+ int ib;
+ int endian_arch = endianArch ();
+ unsigned char *p;
+ unsigned char *ptr;
+
+ *blob = NULL;
+ *blob_size = 0;
+ if (pxl == NULL)
+ return RL2_ERROR;
+
+ switch (pxl->sampleType)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_INT8:
+ sz += 3;
+ break;
+ case RL2_SAMPLE_UINT8:
+ sz += pxl->nBands * 3;
+ break;
+ case RL2_SAMPLE_INT16:
+ sz += 4;
+ break;
+ case RL2_SAMPLE_UINT16:
+ sz += (pxl->nBands * 4);
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ sz += 6;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sz += 10;
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ p = malloc (sz);
+ if (p == NULL)
+ return RL2_ERROR;
+ ptr = p;
+
+ *ptr++ = 0x00; /* start marker */
+ *ptr++ = RL2_NO_DATA_START;
+ *ptr++ = RL2_LITTLE_ENDIAN;
+ *ptr++ = pxl->sampleType;
+ *ptr++ = pxl->pixelType;
+ *ptr++ = pxl->nBands;
+ *ptr++ = pxl->isTransparent;
+ for (ib = 0; ib < pxl->nBands; ib++)
+ {
+ *ptr++ = RL2_SAMPLE_START;
+ band = pxl->Samples + ib;
+ switch (pxl->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ *ptr++ = (unsigned char) (band->int8);
+ break;
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ *ptr++ = band->uint8;
+ break;
+ case RL2_SAMPLE_INT16:
+ export16 (ptr, band->int16, 1, endian_arch);
+ ptr += 2;
+ break;
+ case RL2_SAMPLE_UINT16:
+ exportU16 (ptr, band->uint16, 1, endian_arch);
+ ptr += 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ export32 (ptr, band->int32, 1, endian_arch);
+ ptr += 4;
+ break;
+ case RL2_SAMPLE_UINT32:
+ exportU32 (ptr, band->uint32, 1, endian_arch);
+ ptr += 4;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ exportFloat (ptr, band->float32, 1, endian_arch);
+ ptr += 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ exportDouble (ptr, band->float64, 1, endian_arch);
+ ptr += 8;
+ break;
+ };
+ *ptr++ = RL2_SAMPLE_END;
+ }
+/* computing the CRC32 */
+ crc = crc32 (0L, p, ptr - p);
+ exportU32 (ptr, crc, 1, endian_arch); /* the NO-DATA own CRC */
+ ptr += 4;
+ *ptr++ = RL2_NO_DATA_END;
+ *blob = p;
+ *blob_size = sz;
+ return RL2_OK;
+}
+
+static int
+check_raster_serialized_pixel (const unsigned char *blob, int blob_size)
+{
+/* checking a Pixel value serialized object from validity */
+ const unsigned char *ptr = blob;
+ int endian;
+ uLong crc;
+ uLong oldCrc;
+ int ib;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int endian_arch = endianArch ();
+
+ if (blob == NULL)
+ return 0;
+ if (blob_size < 13)
+ return 0;
+ if (*ptr++ != 0x00)
+ return 0; /* invalid start signature */
+ if (*ptr++ != RL2_NO_DATA_START)
+ return 0; /* invalid start signature */
+ endian = *ptr++;
+ if (endian == RL2_LITTLE_ENDIAN || endian == RL2_BIG_ENDIAN)
+ ;
+ else
+ return 0; /* invalid endiannes */
+ sample_type = *ptr++;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ case RL2_SAMPLE_DOUBLE:
+ break;
+ default:
+ return 0;
+ };
+ pixel_type = *ptr++;
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_PALETTE:
+ case RL2_PIXEL_GRAYSCALE:
+ case RL2_PIXEL_RGB:
+ case RL2_PIXEL_MULTIBAND:
+ case RL2_PIXEL_DATAGRID:
+ break;
+ default:
+ return 0;
+ };
+ num_bands = *ptr++;
+ ptr++;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ if ((pixel_type == RL2_PIXEL_PALETTE
+ || pixel_type == RL2_PIXEL_MONOCHROME) && num_bands == 1)
+ ;
+ else
+ return 0;
+ break;
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ if ((pixel_type == RL2_PIXEL_PALETTE
+ || pixel_type == RL2_PIXEL_GRAYSCALE) && num_bands == 1)
+ ;
+ else
+ return 0;
+ break;
+ case RL2_SAMPLE_UINT8:
+ if ((pixel_type == RL2_PIXEL_PALETTE
+ || pixel_type == RL2_PIXEL_GRAYSCALE
+ || pixel_type == RL2_PIXEL_DATAGRID) && num_bands == 1)
+ ;
+ else if (pixel_type == RL2_PIXEL_RGB && num_bands == 3)
+ ;
+ else if (pixel_type == RL2_PIXEL_MULTIBAND && num_bands > 1)
+ ;
+ else
+ return 0;
+ break;
+ case RL2_SAMPLE_UINT16:
+ if ((pixel_type == RL2_PIXEL_GRAYSCALE
+ || pixel_type == RL2_PIXEL_DATAGRID) && num_bands == 1)
+ ;
+ else if (pixel_type == RL2_PIXEL_RGB && num_bands == 3)
+ ;
+ else if (pixel_type == RL2_PIXEL_MULTIBAND && num_bands > 1)
+ ;
+ else
+ return 0;
+ break;
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ case RL2_SAMPLE_DOUBLE:
+ if (pixel_type == RL2_PIXEL_DATAGRID && num_bands == 1)
+ ;
+ else
+ return 0;
+ break;
+ default:
+ return 0;
+ };
+
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ if (*ptr++ != RL2_SAMPLE_START)
+ return 0;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ ptr++;
+ break;
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ ptr += 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ ptr += 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ ptr += 8;
+ break;
+ };
+ if (((ptr - blob) + 6) > blob_size)
+ return 0;
+ if (*ptr++ != RL2_SAMPLE_END)
+ return 0;
+ }
+/* computing the CRC32 */
+ crc = crc32 (0L, blob, ptr - blob);
+ oldCrc = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ if (crc != oldCrc)
+ return 0;
+ if (*ptr != RL2_NO_DATA_END)
+ return 0; /* invalid end signature */
+
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_is_valid_dbms_pixel (const unsigned char *blob, int blob_size,
+ unsigned char sample_type, unsigned char num_bands)
+{
+/* testing a serialized Pixel value for validity */
+ const unsigned char *ptr;
+ unsigned char xsample_type;
+ unsigned char xnum_bands;
+ if (!check_raster_serialized_pixel (blob, blob_size))
+ return RL2_ERROR;
+ ptr = blob + 3;
+ xsample_type = *ptr++;
+ ptr++;
+ xnum_bands = *ptr++;
+ if (sample_type == xsample_type && num_bands == xnum_bands)
+ return RL2_OK;
+ return RL2_ERROR;
+}
+
+RL2_DECLARE rl2PixelPtr
+rl2_deserialize_dbms_pixel (const unsigned char *blob, int blob_size)
+{
+/* attempting to deserialize a Pixel value from DBMS binary format */
+ rl2PixelPtr pixel = NULL;
+ rl2PrivPixelPtr pxl;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned char transparent;
+ int ib;
+ const unsigned char *ptr = blob;
+ int endian;
+ int endian_arch = endianArch ();
+ if (!check_raster_serialized_pixel (blob, blob_size))
+ return NULL;
+
+ ptr = blob + 2;
+ endian = *ptr++;
+ sample_type = *ptr++;
+ pixel_type = *ptr++;
+ num_bands = *ptr++;
+ transparent = *ptr++;
+ pixel = rl2_create_pixel (sample_type, pixel_type, num_bands);
+ if (pixel == NULL)
+ goto error;
+ pxl = (rl2PrivPixelPtr) pixel;
+ pxl->isTransparent = transparent;
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ rl2PrivSamplePtr band = pxl->Samples + ib;
+ ptr++; /* skipping SAMPLE START marker */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ band->int8 = *((char *) ptr);
+ ptr++;
+ break;
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ band->uint8 = *ptr;
+ ptr++;
+ break;
+ case RL2_SAMPLE_INT16:
+ band->int16 = import16 (ptr, endian, endian_arch);
+ ptr += 2;
+ break;
+ case RL2_SAMPLE_UINT16:
+ band->uint16 = importU16 (ptr, endian, endian_arch);
+ ptr += 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ band->int32 = import32 (ptr, endian, endian_arch);
+ ptr += 4;
+ break;
+ case RL2_SAMPLE_UINT32:
+ band->uint32 = importU32 (ptr, endian, endian_arch);
+ ptr += 4;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ band->float32 = importFloat (ptr, endian, endian_arch);
+ ptr += 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ band->float64 = importDouble (ptr, endian, endian_arch);
+ ptr += 8;
+ break;
+ };
+ ptr++; /* skipping SAMPLE END marker */
+ }
+ return pixel;
+
+ error:
+ if (pixel != NULL)
+ rl2_destroy_pixel (pixel);
+ return NULL;
+}
diff --git a/src/rl2dbms.c b/src/rl2dbms.c
new file mode 100644
index 0000000..ea7af99
--- /dev/null
+++ b/src/rl2dbms.c
@@ -0,0 +1,5010 @@
+/*
+
+ rl2dbms -- DBMS related functions
+
+ version 0.1, 2013 March 29
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2_private.h"
+
+#include <spatialite/gaiaaux.h>
+
+/* 64 bit integer: portable format for printf() */
+#if defined(_WIN32) && !defined(__MINGW32__)
+#define ERR_FRMT64 "ERROR: unable to decode Tile ID=%I64d\n"
+#else
+#define ERR_FRMT64 "ERROR: unable to decode Tile ID=%lld\n"
+#endif
+
+static int
+insert_into_raster_coverages (sqlite3 * handle, const char *coverage,
+ unsigned char sample, unsigned char pixel,
+ unsigned char num_bands,
+ unsigned char compression, int quality,
+ unsigned int tile_width,
+ unsigned int tile_height, int srid,
+ double x_res, double y_res, unsigned char *blob,
+ int blob_sz, unsigned char *blob_no_data,
+ int blob_no_data_sz)
+{
+/* inserting into "raster_coverages" */
+ int ret;
+ char *sql;
+ sqlite3_stmt *stmt;
+ const char *xsample = "UNKNOWN";
+ const char *xpixel = "UNKNOWN";
+ const char *xcompression = "UNKNOWN";
+
+ sql = "INSERT INTO raster_coverages (coverage_name, sample_type, "
+ "pixel_type, num_bands, compression, quality, tile_width, "
+ "tile_height, horz_resolution, vert_resolution, srid, "
+ "nodata_pixel, palette) VALUES (Lower(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ return 0;
+ }
+ switch (sample)
+ {
+ case RL2_SAMPLE_1_BIT:
+ xsample = "1-BIT";
+ break;
+ case RL2_SAMPLE_2_BIT:
+ xsample = "2-BIT";
+ break;
+ case RL2_SAMPLE_4_BIT:
+ xsample = "4-BIT";
+ break;
+ case RL2_SAMPLE_INT8:
+ xsample = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ xsample = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ xsample = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ xsample = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ xsample = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ xsample = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ xsample = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ xsample = "DOUBLE";
+ break;
+ };
+ switch (pixel)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ xpixel = "MONOCHROME";
+ break;
+ case RL2_PIXEL_PALETTE:
+ xpixel = "PALETTE";
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ xpixel = "GRAYSCALE";
+ break;
+ case RL2_PIXEL_RGB:
+ xpixel = "RGB";
+ break;
+ case RL2_PIXEL_MULTIBAND:
+ xpixel = "MULTIBAND";
+ break;
+ case RL2_PIXEL_DATAGRID:
+ xpixel = "DATAGRID";
+ break;
+ };
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ xcompression = "NONE";
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ xcompression = "DEFLATE";
+ break;
+ case RL2_COMPRESSION_LZMA:
+ xcompression = "LZMA";
+ break;
+ case RL2_COMPRESSION_PNG:
+ xcompression = "PNG";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ xcompression = "JPEG";
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ xcompression = "LOSSY_WEBP";
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ xcompression = "LOSSLESS_WEBP";
+ break;
+ case RL2_COMPRESSION_CCITTFAX4:
+ xcompression = "CCITTFAX4";
+ break;
+ };
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, xsample, strlen (xsample), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 3, xpixel, strlen (xpixel), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 4, num_bands);
+ sqlite3_bind_text (stmt, 5, xcompression, strlen (xcompression),
+ SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 6, quality);
+ sqlite3_bind_int (stmt, 7, tile_width);
+ sqlite3_bind_int (stmt, 8, tile_height);
+ sqlite3_bind_double (stmt, 9, x_res);
+ sqlite3_bind_double (stmt, 10, y_res);
+ sqlite3_bind_int (stmt, 11, srid);
+ if (blob_no_data == NULL)
+ sqlite3_bind_null (stmt, 12);
+ else
+ sqlite3_bind_blob (stmt, 12, blob_no_data, blob_no_data_sz, free);
+ if (blob == NULL)
+ sqlite3_bind_null (stmt, 13);
+ else
+ sqlite3_bind_blob (stmt, 13, blob, blob_sz, free);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ goto coverage_registered;
+ fprintf (stderr,
+ "sqlite3_step() error: INSERT INTO raster_coverages \"%s\"\n",
+ sqlite3_errmsg (handle));
+ sqlite3_finalize (stmt);
+ return 0;
+ coverage_registered:
+ sqlite3_finalize (stmt);
+ return 1;
+}
+
+static int
+create_levels (sqlite3 * handle, const char *coverage)
+{
+/* creating the LEVELS table */
+ int ret;
+ char *sql;
+ char *sql_err = NULL;
+ char *xcoverage;
+ char *xxcoverage;
+
+ xcoverage = sqlite3_mprintf ("%s_levels", coverage);
+ xxcoverage = gaiaDoubleQuotedSql (xcoverage);
+ sqlite3_free (xcoverage);
+ sql = sqlite3_mprintf ("CREATE TABLE \"%s\" ("
+ "\tpyramid_level INTEGER PRIMARY KEY AUTOINCREMENT,\n"
+ "\tx_resolution_1_1 DOUBLE NOT NULL,\n"
+ "\ty_resolution_1_1 DOUBLE NOT NULL,\n"
+ "\tx_resolution_1_2 DOUBLE,\n"
+ "\ty_resolution_1_2 DOUBLE,\n"
+ "\tx_resolution_1_4 DOUBLE,\n"
+ "\ty_resolution_1_4 DOUBLE,\n"
+ "\tx_resolution_1_8 DOUBLE,\n"
+ "\ty_resolution_1_8 DOUBLE)\n", xxcoverage);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CREATE TABLE \"%s_levels\" error: %s\n", xxcoverage,
+ sql_err);
+ sqlite3_free (sql_err);
+ free (xxcoverage);
+ return 0;
+ }
+ free (xxcoverage);
+ return 1;
+}
+
+static int
+create_sections (sqlite3 * handle, const char *coverage, int srid)
+{
+/* creating the SECTIONS table */
+ int ret;
+ char *sql;
+ char *sql_err = NULL;
+ char *xcoverage;
+ char *xxcoverage;
+ char *xindex;
+ char *xxindex;
+ char *xtrigger;
+ char *xxtrigger;
+
+/* creating the SECTIONS table */
+ xcoverage = sqlite3_mprintf ("%s_sections", coverage);
+ xxcoverage = gaiaDoubleQuotedSql (xcoverage);
+ sqlite3_free (xcoverage);
+ sql = sqlite3_mprintf ("CREATE TABLE \"%s\" ("
+ "\tsection_id INTEGER PRIMARY KEY AUTOINCREMENT,\n"
+ "\tsection_name TEXT NOT NULL,\n"
+ "\twidth INTEGER NOT NULL,\n"
+ "\theight INTEGER NOT NULL,\n"
+ "\tfile_path TEXT,\n"
+ "\tstatistics BLOB)", xxcoverage);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CREATE TABLE \"%s\" error: %s\n",
+ xxcoverage, sql_err);
+ sqlite3_free (sql_err);
+ free (xxcoverage);
+ return 0;
+ }
+ free (xxcoverage);
+
+/* adding the safeguard Triggers */
+ xtrigger = sqlite3_mprintf ("%s_sections_statistics_insert", coverage);
+ xxtrigger = gaiaDoubleQuotedSql (xtrigger);
+ sqlite3_free (xtrigger);
+ xcoverage = sqlite3_mprintf ("%s_sections", coverage);
+ sql = sqlite3_mprintf ("CREATE TRIGGER \"%s\"\n"
+ "BEFORE INSERT ON %Q\nFOR EACH ROW BEGIN\n"
+ "SELECT RAISE(ABORT,'insert on %s violates constraint: "
+ "invalid statistics')\nWHERE NEW.statistics IS NOT NULL AND "
+ "IsValidRasterStatistics(%Q, NEW.statistics) <> 1;\nEND",
+ xxtrigger, xcoverage, xcoverage, coverage);
+ sqlite3_free (xcoverage);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CREATE TRIGGER \"%s\" error: %s\n", xxtrigger,
+ sql_err);
+ sqlite3_free (sql_err);
+ free (xxtrigger);
+ return 0;
+ }
+ free (xxtrigger);
+ xtrigger = sqlite3_mprintf ("%s_sections_statistics_update", coverage);
+ xxtrigger = gaiaDoubleQuotedSql (xtrigger);
+ sqlite3_free (xtrigger);
+ xcoverage = sqlite3_mprintf ("%s_sections", coverage);
+ sql = sqlite3_mprintf ("CREATE TRIGGER \"%s\"\n"
+ "BEFORE UPDATE OF 'statistics' ON %Q"
+ "\nFOR EACH ROW BEGIN\n"
+ "SELECT RAISE(ABORT, 'update on %s violates constraint: "
+ "invalid statistics')\nWHERE NEW.statistics IS NOT NULL AND "
+ "IsValidRasterStatistics(%Q, NEW.statistics) <> 1;\nEND",
+ xxtrigger, xcoverage, xcoverage, coverage);
+ sqlite3_free (xcoverage);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CREATE TRIGGER \"%s\" error: %s\n", xxtrigger,
+ sql_err);
+ sqlite3_free (sql_err);
+ free (xxtrigger);
+ return 0;
+ }
+ free (xxtrigger);
+
+/* creating the SECTIONS geometry */
+ xcoverage = sqlite3_mprintf ("%s_sections", coverage);
+ sql = sqlite3_mprintf ("SELECT AddGeometryColumn("
+ "%Q, 'geometry', %d, 'POLYGON', 'XY')", xcoverage,
+ srid);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "AddGeometryColumn \"%s\" error: %s\n",
+ xcoverage, sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (xcoverage);
+ return 0;
+ }
+ sqlite3_free (xcoverage);
+
+/* creating the SECTIONS spatial index */
+ xcoverage = sqlite3_mprintf ("%s_sections", coverage);
+ sql = sqlite3_mprintf ("SELECT CreateSpatialIndex("
+ "%Q, 'geometry')", xcoverage);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateSpatialIndex \"%s\" error: %s\n",
+ xcoverage, sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (xcoverage);
+ return 0;
+ }
+ sqlite3_free (xcoverage);
+
+/* creating the SECTIONS index by name */
+ xcoverage = sqlite3_mprintf ("%s_sections", coverage);
+ xxcoverage = gaiaDoubleQuotedSql (xcoverage);
+ sqlite3_free (xcoverage);
+ xindex = sqlite3_mprintf ("idx_%s_sections", coverage);
+ xxindex = gaiaDoubleQuotedSql (xindex);
+ sqlite3_free (xindex);
+ sql =
+ sqlite3_mprintf ("CREATE UNIQUE INDEX \"%s\" ON \"%s\" (section_name)",
+ xxindex, xxcoverage);
+ free (xxcoverage);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CREATE INDEX \"%s\" error: %s\n", xxindex, sql_err);
+ sqlite3_free (sql_err);
+ free (xxindex);
+ return 0;
+ }
+ free (xxindex);
+ return 1;
+}
+
+static int
+create_tiles (sqlite3 * handle, const char *coverage, int srid)
+{
+/* creating the TILES table */
+ int ret;
+ char *sql;
+ char *sql_err = NULL;
+ char *xcoverage;
+ char *xxcoverage;
+ char *xindex;
+ char *xxindex;
+ char *xfk;
+ char *xxfk;
+ char *xmother;
+ char *xxmother;
+ char *xfk2;
+ char *xxfk2;
+ char *xmother2;
+ char *xxmother2;
+ char *xtrigger;
+ char *xxtrigger;
+ char *xtiles;
+ char *xxtiles;
+
+ xcoverage = sqlite3_mprintf ("%s_tiles", coverage);
+ xxcoverage = gaiaDoubleQuotedSql (xcoverage);
+ sqlite3_free (xcoverage);
+ xmother = sqlite3_mprintf ("%s_sections", coverage);
+ xxmother = gaiaDoubleQuotedSql (xmother);
+ sqlite3_free (xmother);
+ xfk = sqlite3_mprintf ("fk_%s_tiles_section", coverage);
+ xxfk = gaiaDoubleQuotedSql (xfk);
+ sqlite3_free (xfk);
+ xmother2 = sqlite3_mprintf ("%s_levels", coverage);
+ xxmother2 = gaiaDoubleQuotedSql (xmother2);
+ sqlite3_free (xmother2);
+ xfk2 = sqlite3_mprintf ("fk_%s_tiles_level", coverage);
+ xxfk2 = gaiaDoubleQuotedSql (xfk2);
+ sqlite3_free (xfk2);
+ sql = sqlite3_mprintf ("CREATE TABLE \"%s\" ("
+ "\ttile_id INTEGER PRIMARY KEY AUTOINCREMENT,\n"
+ "\tpyramid_level INTEGER NOT NULL,\n"
+ "\tsection_id INTEGER,\n"
+ "\tCONSTRAINT \"%s\" FOREIGN KEY (section_id) "
+ "REFERENCES \"%s\" (section_id) ON DELETE CASCADE,\n"
+ "\tCONSTRAINT \"%s\" FOREIGN KEY (pyramid_level) "
+ "REFERENCES \"%s\" (pyramid_level) ON DELETE CASCADE)",
+ xxcoverage, xxfk, xxmother, xxfk2, xxmother2);
+ free (xxfk);
+ free (xxmother);
+ free (xxfk2);
+ free (xxmother2);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CREATE TABLE \"%s_tiles\" error: %s\n",
+ xxcoverage, sql_err);
+ sqlite3_free (sql_err);
+ free (xxcoverage);
+ return 0;
+ }
+ free (xxcoverage);
+
+/* creating the TILES geometry */
+ xcoverage = sqlite3_mprintf ("%s_tiles", coverage);
+ sql = sqlite3_mprintf ("SELECT AddGeometryColumn("
+ "%Q, 'geometry', %d, 'POLYGON', 'XY')", xcoverage,
+ srid);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "AddGeometryColumn \"%s_tiles\" error: %s\n",
+ xcoverage, sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (xcoverage);
+ return 0;
+ }
+ sqlite3_free (xcoverage);
+
+/* creating the TILES spatial Index */
+ xcoverage = sqlite3_mprintf ("%s_tiles", coverage);
+ sql = sqlite3_mprintf ("SELECT CreateSpatialIndex("
+ "%Q, 'geometry')", xcoverage);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateSpatialIndex \"%s_tiles\" error: %s\n",
+ xcoverage, sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (xcoverage);
+ return 0;
+ }
+ sqlite3_free (xcoverage);
+
+/* creating the TILES index by section */
+ xcoverage = sqlite3_mprintf ("%s_tiles", coverage);
+ xxcoverage = gaiaDoubleQuotedSql (xcoverage);
+ sqlite3_free (xcoverage);
+ xindex = sqlite3_mprintf ("idx_%s_tiles", coverage);
+ xxindex = gaiaDoubleQuotedSql (xindex);
+ sqlite3_free (xindex);
+ sql =
+ sqlite3_mprintf ("CREATE INDEX \"%s\" ON \"%s\" (section_id)", xxindex,
+ xxcoverage);
+ free (xxcoverage);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CREATE INDEX \"%s\" error: %s\n", xxindex, sql_err);
+ sqlite3_free (sql_err);
+ free (xxindex);
+ return 0;
+ }
+ free (xxindex);
+
+/* creating the TILE_DATA table */
+ xcoverage = sqlite3_mprintf ("%s_tile_data", coverage);
+ xxcoverage = gaiaDoubleQuotedSql (xcoverage);
+ sqlite3_free (xcoverage);
+ xmother = sqlite3_mprintf ("%s_tiles", coverage);
+ xxmother = gaiaDoubleQuotedSql (xmother);
+ sqlite3_free (xmother);
+ xfk = sqlite3_mprintf ("fk_%s_tile_data", coverage);
+ xxfk = gaiaDoubleQuotedSql (xfk);
+ sqlite3_free (xfk);
+ sql = sqlite3_mprintf ("CREATE TABLE \"%s\" ("
+ "\ttile_id INTEGER NOT NULL PRIMARY KEY,\n"
+ "\ttile_data_odd BLOB NOT NULL,\n"
+ "\ttile_data_even BLOB,\n"
+ "CONSTRAINT \"%s\" FOREIGN KEY (tile_id) "
+ "REFERENCES \"%s\" (tile_id) ON DELETE CASCADE)",
+ xxcoverage, xxfk, xxmother);
+ free (xxfk);
+ free (xxmother);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CREATE TABLE \"%s_tile_data\" error: %s\n",
+ xxcoverage, sql_err);
+ sqlite3_free (sql_err);
+ free (xxcoverage);
+ return 0;
+ }
+ free (xxcoverage);
+
+/* adding the safeguard Triggers */
+ xtrigger = sqlite3_mprintf ("%s_tile_data_insert", coverage);
+ xxtrigger = gaiaDoubleQuotedSql (xtrigger);
+ sqlite3_free (xtrigger);
+ xcoverage = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtiles = sqlite3_mprintf ("%s_tiles", coverage);
+ xxtiles = gaiaDoubleQuotedSql (xtiles);
+ sqlite3_free (xtiles);
+ sql = sqlite3_mprintf ("CREATE TRIGGER \"%s\"\n"
+ "BEFORE INSERT ON %Q\nFOR EACH ROW BEGIN\n"
+ "SELECT RAISE(ABORT,'insert on %s violates constraint: "
+ "invalid tile_data')\nWHERE IsValidRasterTile(%Q, "
+ "(SELECT t.pyramid_level FROM \"%s\" AS t WHERE t.tile_id = NEW.tile_id), "
+ "NEW.tile_data_odd, NEW.tile_data_even) <> 1;\nEND",
+ xxtrigger, xcoverage, xcoverage, coverage, xxtiles);
+ sqlite3_free (xcoverage);
+ free (xxtiles);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CREATE TRIGGER \"%s\" error: %s\n", xxtrigger,
+ sql_err);
+ sqlite3_free (sql_err);
+ free (xxtrigger);
+ return 0;
+ }
+ free (xxtrigger);
+ xtrigger = sqlite3_mprintf ("%s_tile_data_update", coverage);
+ xxtrigger = gaiaDoubleQuotedSql (xtrigger);
+ sqlite3_free (xtrigger);
+ xcoverage = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtiles = sqlite3_mprintf ("%s_tiles", coverage);
+ xxtiles = gaiaDoubleQuotedSql (xtiles);
+ sqlite3_free (xtiles);
+ sql = sqlite3_mprintf ("CREATE TRIGGER \"%s\"\n"
+ "BEFORE UPDATE ON %Q\nFOR EACH ROW BEGIN\n"
+ "SELECT RAISE(ABORT, 'update on %s violates constraint: "
+ "invalid tile_data')\nWHERE IsValidRasterTile(%Q, "
+ "(SELECT t.pyramid_level FROM \"%s\" AS t WHERE t.tile_id = NEW.tile_id), "
+ "NEW.tile_data_odd, NEW.tile_data_even) <> 1;\nEND",
+ xxtrigger, xcoverage, xcoverage, coverage, xxtiles);
+ sqlite3_free (xcoverage);
+ free (xxtiles);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CREATE TRIGGER \"%s\" error: %s\n", xxtrigger,
+ sql_err);
+ sqlite3_free (sql_err);
+ free (xxtrigger);
+ return 0;
+ }
+ free (xxtrigger);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_create_dbms_coverage (sqlite3 * handle, const char *coverage,
+ unsigned char sample, unsigned char pixel,
+ unsigned char num_bands, unsigned char compression,
+ int quality, unsigned int tile_width,
+ unsigned int tile_height, int srid, double x_res,
+ double y_res, rl2PixelPtr no_data,
+ rl2PalettePtr palette)
+{
+/* creating a DBMS-based Coverage */
+ unsigned char *blob = NULL;
+ int blob_size = 0;
+ unsigned char *blob_no_data = NULL;
+ int blob_no_data_sz = 0;
+ if (pixel == RL2_PIXEL_PALETTE)
+ {
+ /* installing a default (empty) Palette */
+ if (rl2_serialize_dbms_palette (palette, &blob, &blob_size) != RL2_OK)
+ goto error;
+ }
+ if (no_data != NULL)
+ {
+ if (rl2_serialize_dbms_pixel
+ (no_data, &blob_no_data, &blob_no_data_sz) != RL2_OK)
+ goto error;
+ }
+ if (!insert_into_raster_coverages
+ (handle, coverage, sample, pixel, num_bands, compression, quality,
+ tile_width, tile_height, srid, x_res, y_res, blob, blob_size,
+ blob_no_data, blob_no_data_sz))
+ goto error;
+ if (!create_levels (handle, coverage))
+ goto error;
+ if (!create_sections (handle, coverage, srid))
+ goto error;
+ if (!create_tiles (handle, coverage, srid))
+ goto error;
+ return RL2_OK;
+ error:
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_dbms_section_id (sqlite3 * handle, const char *coverage,
+ const char *section, sqlite3_int64 * section_id)
+{
+/* retrieving a Section ID by its name */
+ int ret;
+ char *sql;
+ char *table;
+ char *xtable;
+ int found = 0;
+ sqlite3_stmt *stmt = NULL;
+
+ table = sqlite3_mprintf ("%s_sections", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf ("SELECT section_id FROM \"%s\" WHERE section_name = ?",
+ xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT section_name SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+/* querying the section */
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, section, strlen (section), SQLITE_STATIC);
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ *section_id = sqlite3_column_int64 (stmt, 0);
+ found++;
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT section_name; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ stmt = NULL;
+ if (found == 1)
+ return RL2_OK;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_delete_dbms_section (sqlite3 * handle, const char *coverage,
+ sqlite3_int64 section_id)
+{
+/* deleting a Raster Section */
+ int ret;
+ char *sql;
+ rl2CoveragePtr cvg = NULL;
+ char *table;
+ char *xtable;
+ sqlite3_stmt *stmt = NULL;
+
+ table = sqlite3_mprintf ("%s_sections", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("DELETE FROM \"%s\" WHERE section_id = ?", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("DELETE sections SQL error: %s\n", sqlite3_errmsg (handle));
+ goto error;
+ }
+
+/* DELETing the section */
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_int64 (stmt, 1, section_id);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "DELETE sections; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ sqlite3_finalize (stmt);
+
+ rl2_destroy_coverage (cvg);
+ return RL2_OK;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (cvg != NULL)
+ rl2_destroy_coverage (cvg);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_drop_dbms_coverage (sqlite3 * handle, const char *coverage)
+{
+/* dropping a Raster Coverage */
+ int ret;
+ char *sql;
+ char *sql_err = NULL;
+ char *table;
+ char *xtable;
+
+/* disabling the SECTIONS spatial index */
+ xtable = sqlite3_mprintf ("%s_sections", coverage);
+ sql = sqlite3_mprintf ("SELECT DisableSpatialIndex("
+ "%Q, 'geometry')", xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DisableSpatialIndex \"%s\" error: %s\n", xtable,
+ sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (xtable);
+ goto error;
+ }
+ sqlite3_free (xtable);
+
+/* dropping the SECTIONS spatial index */
+ table = sqlite3_mprintf ("idx_%s_sections_geometry", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sql = sqlite3_mprintf ("DROP TABLE \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DROP TABLE \"%s\" error: %s\n", table, sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (table);
+ goto error;
+ }
+ sqlite3_free (table);
+
+/* disabling the TILES spatial index */
+ xtable = sqlite3_mprintf ("%s_tiles", coverage);
+ sql = sqlite3_mprintf ("SELECT DisableSpatialIndex("
+ "%Q, 'geometry')", xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DisableSpatialIndex \"%s\" error: %s\n", xtable,
+ sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (xtable);
+ goto error;
+ }
+ sqlite3_free (xtable);
+
+/* dropping the TILES spatial index */
+ table = sqlite3_mprintf ("idx_%s_tiles_geometry", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sql = sqlite3_mprintf ("DROP TABLE \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DROP TABLE \"%s\" error: %s\n", table, sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (table);
+ goto error;
+ }
+ sqlite3_free (table);
+
+/* dropping the TILE_DATA table */
+ table = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sql = sqlite3_mprintf ("DROP TABLE \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DROP TABLE \"%s\" error: %s\n", table, sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (table);
+ goto error;
+ }
+ sqlite3_free (table);
+
+/* deleting the TILES Geometry definition */
+ table = sqlite3_mprintf ("%s_tiles", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("DELETE FROM geometry_columns "
+ "WHERE Lower(f_table_name) = Lower(%Q)", xtable);
+ free (xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DELETE TilesGeometry \"%s\" error: %s\n",
+ coverage, sql_err);
+ sqlite3_free (sql_err);
+ goto error;
+ }
+
+/* deleting the SECTIONS Geometry definition */
+ table = sqlite3_mprintf ("%s_sections", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sql = sqlite3_mprintf ("DELETE FROM geometry_columns "
+ "WHERE Lower(f_table_name) = Lower(%Q)", xtable);
+ free (xtable);
+ sqlite3_free (table);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DELETE SectionsGeometry \"%s\" error: %s\n",
+ coverage, sql_err);
+ sqlite3_free (sql_err);
+ goto error;
+ }
+
+/* dropping the TILES table */
+ table = sqlite3_mprintf ("%s_tiles", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sql = sqlite3_mprintf ("DROP TABLE \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DROP TABLE \"%s\" error: %s\n", table, sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (table);
+ goto error;
+ }
+ sqlite3_free (table);
+
+/* dropping the SECTIONS table */
+ table = sqlite3_mprintf ("%s_sections", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sql = sqlite3_mprintf ("DROP TABLE \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DROP TABLE \"%s\" error: %s\n", table, sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (table);
+ goto error;
+ }
+ sqlite3_free (table);
+
+/* dropping the LEVELS table */
+ table = sqlite3_mprintf ("%s_levels", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sql = sqlite3_mprintf ("DROP TABLE \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DROP TABLE \"%s\" error: %s\n", table, sql_err);
+ sqlite3_free (sql_err);
+ sqlite3_free (table);
+ goto error;
+ }
+ sqlite3_free (table);
+
+/* deleting the Raster Coverage definition */
+ sql = sqlite3_mprintf ("DELETE FROM raster_coverages "
+ "WHERE Lower(coverage_name) = Lower(%Q)", coverage);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &sql_err);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DELETE raster_coverage \"%s\" error: %s\n",
+ coverage, sql_err);
+ sqlite3_free (sql_err);
+ goto error;
+ }
+ return RL2_OK;
+
+ error:
+ return RL2_ERROR;
+}
+
+static void
+prime_void_tile_int8 (void *pixels, unsigned int width, unsigned int height,
+ rl2PixelPtr no_data)
+{
+/* priming a void tile buffer - INT8 */
+ unsigned int row;
+ unsigned int col;
+ char *p = pixels;
+ char val = 0;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ goto done;
+ if (sample_type != RL2_SAMPLE_INT8 || num_bands != 1)
+ goto done;
+ rl2_get_pixel_sample_int8 (no_data, &val);
+ }
+
+ done:
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ *p++ = val;
+ }
+}
+
+static void
+prime_void_tile_uint8 (void *pixels, unsigned int width,
+ unsigned int height, unsigned char num_bands,
+ rl2PixelPtr no_data)
+{
+/* priming a void tile buffer - UINT8 */
+ unsigned int row;
+ unsigned int col;
+ int band;
+ unsigned char *p = pixels;
+ unsigned char val = 0;
+ int ok_no_data = 0;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ goto done;
+ if (sample_type != RL2_SAMPLE_UINT8)
+ goto done;
+ ok_no_data = 1;
+ }
+
+ done:
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ for (band = 0; band < num_bands; band++)
+ {
+ if (ok_no_data)
+ rl2_get_pixel_sample_uint8 (no_data, band, &val);
+ *p++ = val;
+ }
+ }
+ }
+}
+
+static void
+prime_void_tile_int16 (void *pixels, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data)
+{
+/* priming a void tile buffer - INT16 */
+ unsigned int row;
+ unsigned int col;
+ short *p = pixels;
+ short val = 0;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ goto done;
+ if (sample_type != RL2_SAMPLE_INT16 || num_bands != 1)
+ goto done;
+ rl2_get_pixel_sample_int16 (no_data, &val);
+ }
+
+ done:
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ *p++ = val;
+ }
+}
+
+static void
+prime_void_tile_uint16 (void *pixels, unsigned int width,
+ unsigned int height, unsigned char num_bands,
+ rl2PixelPtr no_data)
+{
+/* priming a void tile buffer - UINT16 */
+ unsigned int row;
+ unsigned int col;
+ int band;
+ unsigned short *p = pixels;
+ unsigned short val = 0;
+ int ok_no_data = 0;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ goto done;
+ if (sample_type != RL2_SAMPLE_UINT16)
+ goto done;
+ ok_no_data = 1;
+ }
+
+ done:
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ for (band = 0; band < num_bands; band++)
+ {
+ if (ok_no_data)
+ rl2_get_pixel_sample_uint16 (no_data, band, &val);
+ *p++ = val;
+ }
+ }
+ }
+}
+
+static void
+prime_void_tile_int32 (void *pixels, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data)
+{
+/* priming a void tile buffer - INT32 */
+ unsigned int row;
+ unsigned int col;
+ int *p = pixels;
+ int val = 0;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ goto done;
+ if (sample_type != RL2_SAMPLE_INT32 || num_bands != 1)
+ goto done;
+ rl2_get_pixel_sample_int32 (no_data, &val);
+ }
+
+ done:
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ *p++ = val;
+ }
+}
+
+static void
+prime_void_tile_uint32 (void *pixels, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data)
+{
+/* priming a void tile buffer - UINT32 */
+ unsigned int row;
+ unsigned int col;
+ unsigned int *p = pixels;
+ unsigned int val = 0;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ goto done;
+ if (sample_type != RL2_SAMPLE_UINT32 || num_bands != 1)
+ goto done;
+ rl2_get_pixel_sample_uint32 (no_data, &val);
+ }
+
+ done:
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ *p++ = val;
+ }
+}
+
+static void
+prime_void_tile_float (void *pixels, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data)
+{
+/* priming a void tile buffer - Float */
+ unsigned int row;
+ unsigned int col;
+ float *p = pixels;
+ float val = 0.0;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ goto done;
+ if (sample_type != RL2_SAMPLE_FLOAT || num_bands != 1)
+ goto done;
+ rl2_get_pixel_sample_float (no_data, &val);
+ }
+
+ done:
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ *p++ = val;
+ }
+}
+
+static void
+prime_void_tile_double (void *pixels, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data)
+{
+/* priming a void tile buffer - Double */
+ unsigned int row;
+ unsigned int col;
+ double *p = pixels;
+ double val = 0.0;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ goto done;
+ if (sample_type != RL2_SAMPLE_DOUBLE || num_bands != 1)
+ goto done;
+ rl2_get_pixel_sample_double (no_data, &val);
+ }
+
+ done:
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ *p++ = val;
+ }
+}
+
+RL2_DECLARE void
+rl2_prime_void_tile (void *pixels, unsigned int width, unsigned int height,
+ unsigned char sample_type, unsigned char num_bands,
+ rl2PixelPtr no_data)
+{
+/* priming a void tile buffer */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ prime_void_tile_int8 (pixels, width, height, no_data);
+ break;
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ prime_void_tile_uint8 (pixels, width, height, num_bands, no_data);
+ break;
+ case RL2_SAMPLE_INT16:
+ prime_void_tile_int16 (pixels, width, height, no_data);
+ break;
+ case RL2_SAMPLE_UINT16:
+ prime_void_tile_uint16 (pixels, width, height, num_bands, no_data);
+ break;
+ case RL2_SAMPLE_INT32:
+ prime_void_tile_int32 (pixels, width, height, no_data);
+ break;
+ case RL2_SAMPLE_UINT32:
+ prime_void_tile_uint32 (pixels, width, height, no_data);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ prime_void_tile_float (pixels, width, height, no_data);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ prime_void_tile_double (pixels, width, height, no_data);
+ break;
+ };
+}
+
+RL2_DECLARE void
+rl2_prime_void_tile_palette (void *pixels, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data)
+{
+/* priming a void tile buffer (PALETTE) */
+ unsigned int row;
+ unsigned int col;
+ unsigned char index = 0;
+ unsigned char *p = pixels;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ goto done;
+ if (pixel_type != RL2_PIXEL_PALETTE || num_bands != 1)
+ goto done;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ rl2_get_pixel_sample_1bit (no_data, &index);
+ break;
+ case RL2_SAMPLE_2_BIT:
+ rl2_get_pixel_sample_2bit (no_data, &index);
+ break;
+ case RL2_SAMPLE_4_BIT:
+ rl2_get_pixel_sample_4bit (no_data, &index);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_get_pixel_sample_uint8 (no_data, 0, &index);
+ break;
+ };
+ }
+
+ done:
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ *p++ = index;
+ }
+}
+
+RL2_DECLARE rl2CoveragePtr
+rl2_create_coverage_from_dbms (sqlite3 * handle, const char *coverage)
+{
+/* attempting to create a Coverage Object from the DBMS definition */
+ char *sql;
+ int ret;
+ sqlite3_stmt *stmt;
+ int sample;
+ int pixel;
+ int num_bands;
+ int compression;
+ int quality;
+ int tile_width;
+ int tile_height;
+ double x_res;
+ double y_res;
+ int srid;
+ int ok = 0;
+ const char *value;
+ rl2PixelPtr no_data = NULL;
+ rl2CoveragePtr cvg;
+
+/* querying the Coverage metadata defs */
+ sql =
+ "SELECT sample_type, pixel_type, num_bands, compression, quality, tile_width, "
+ "tile_height, horz_resolution, vert_resolution, srid, nodata_pixel "
+ "FROM raster_coverages WHERE Lower(coverage_name) = Lower(?)";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ return NULL;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ int ok_sample = 0;
+ int ok_pixel = 0;
+ int ok_num_bands = 0;
+ int ok_compression = 0;
+ int ok_quality = 0;
+ int ok_tile_width = 0;
+ int ok_tile_height = 0;
+ int ok_x_res = 0;
+ int ok_y_res = 0;
+ int ok_srid = 0;
+ int ok_nodata = 1;
+ if (sqlite3_column_type (stmt, 0) == SQLITE_TEXT)
+ {
+ value = (const char *) sqlite3_column_text (stmt, 0);
+ if (strcasecmp (value, "1-BIT") == 0)
+ {
+ ok_sample = 1;
+ sample = RL2_SAMPLE_1_BIT;
+ }
+ if (strcasecmp (value, "2-BIT") == 0)
+ {
+ ok_sample = 1;
+ sample = RL2_SAMPLE_2_BIT;
+ }
+ if (strcasecmp (value, "4-BIT") == 0)
+ {
+ ok_sample = 1;
+ sample = RL2_SAMPLE_4_BIT;
+ }
+ if (strcasecmp (value, "INT8") == 0)
+ {
+ ok_sample = 1;
+ sample = RL2_SAMPLE_INT8;
+ }
+ if (strcasecmp (value, "UINT8") == 0)
+ {
+ ok_sample = 1;
+ sample = RL2_SAMPLE_UINT8;
+ }
+ if (strcasecmp (value, "INT16") == 0)
+ {
+ ok_sample = 1;
+ sample = RL2_SAMPLE_INT16;
+ }
+ if (strcasecmp (value, "UINT16") == 0)
+ {
+ ok_sample = 1;
+ sample = RL2_SAMPLE_UINT16;
+ }
+ if (strcasecmp (value, "INT32") == 0)
+ {
+ ok_sample = 1;
+ sample = RL2_SAMPLE_INT32;
+ }
+ if (strcasecmp (value, "UINT32") == 0)
+ {
+ ok_sample = 1;
+ sample = RL2_SAMPLE_UINT32;
+ }
+ if (strcasecmp (value, "FLOAT") == 0)
+ {
+ ok_sample = 1;
+ sample = RL2_SAMPLE_FLOAT;
+ }
+ if (strcasecmp (value, "DOUBLE") == 0)
+ {
+ ok_sample = 1;
+ sample = RL2_SAMPLE_DOUBLE;
+ }
+ }
+ if (sqlite3_column_type (stmt, 1) == SQLITE_TEXT)
+ {
+ value = (const char *) sqlite3_column_text (stmt, 1);
+ if (strcasecmp (value, "MONOCHROME") == 0)
+ {
+ ok_pixel = 1;
+ pixel = RL2_PIXEL_MONOCHROME;
+ }
+ if (strcasecmp (value, "PALETTE") == 0)
+ {
+ ok_pixel = 1;
+ pixel = RL2_PIXEL_PALETTE;
+ }
+ if (strcasecmp (value, "GRAYSCALE") == 0)
+ {
+ ok_pixel = 1;
+ pixel = RL2_PIXEL_GRAYSCALE;
+ }
+ if (strcasecmp (value, "RGB") == 0)
+ {
+ ok_pixel = 1;
+ pixel = RL2_PIXEL_RGB;
+ }
+ if (strcasecmp (value, "MULTIBAND") == 0)
+ {
+ ok_pixel = 1;
+ pixel = RL2_PIXEL_MULTIBAND;
+ }
+ if (strcasecmp (value, "DATAGRID") == 0)
+ {
+ ok_pixel = 1;
+ pixel = RL2_PIXEL_DATAGRID;
+ }
+ }
+ if (sqlite3_column_type (stmt, 2) == SQLITE_INTEGER)
+ {
+ num_bands = sqlite3_column_int (stmt, 2);
+ ok_num_bands = 1;
+ }
+ if (sqlite3_column_type (stmt, 3) == SQLITE_TEXT)
+ {
+ value = (const char *) sqlite3_column_text (stmt, 3);
+ if (strcasecmp (value, "NONE") == 0)
+ {
+ ok_compression = 1;
+ compression = RL2_COMPRESSION_NONE;
+ }
+ if (strcasecmp (value, "DEFLATE") == 0)
+ {
+ ok_compression = 1;
+ compression = RL2_COMPRESSION_DEFLATE;
+ }
+ if (strcasecmp (value, "LZMA") == 0)
+ {
+ ok_compression = 1;
+ compression = RL2_COMPRESSION_LZMA;
+ }
+ if (strcasecmp (value, "PNG") == 0)
+ {
+ ok_compression = 1;
+ compression = RL2_COMPRESSION_PNG;
+ }
+ if (strcasecmp (value, "JPEG") == 0)
+ {
+ ok_compression = 1;
+ compression = RL2_COMPRESSION_JPEG;
+ }
+ if (strcasecmp (value, "LOSSY_WEBP") == 0)
+ {
+ ok_compression = 1;
+ compression = RL2_COMPRESSION_LOSSY_WEBP;
+ }
+ if (strcasecmp (value, "LOSSLESS_WEBP") == 0)
+ {
+ ok_compression = 1;
+ compression = RL2_COMPRESSION_LOSSLESS_WEBP;
+ }
+ if (strcasecmp (value, "CCITTFAX4") == 0)
+ {
+ ok_compression = 1;
+ compression = RL2_COMPRESSION_CCITTFAX4;
+ }
+ }
+ if (sqlite3_column_type (stmt, 4) == SQLITE_INTEGER)
+ {
+ quality = sqlite3_column_int (stmt, 4);
+ ok_quality = 1;
+ }
+ if (sqlite3_column_type (stmt, 5) == SQLITE_INTEGER)
+ {
+ tile_width = sqlite3_column_int (stmt, 5);
+ ok_tile_width = 1;
+ }
+ if (sqlite3_column_type (stmt, 6) == SQLITE_INTEGER)
+ {
+ tile_height = sqlite3_column_int (stmt, 6);
+ ok_tile_height = 1;
+ }
+ if (sqlite3_column_type (stmt, 7) == SQLITE_FLOAT)
+ {
+ x_res = sqlite3_column_double (stmt, 7);
+ ok_x_res = 1;
+ }
+ if (sqlite3_column_type (stmt, 8) == SQLITE_FLOAT)
+ {
+ y_res = sqlite3_column_double (stmt, 8);
+ ok_y_res = 1;
+ }
+ if (sqlite3_column_type (stmt, 9) == SQLITE_INTEGER)
+ {
+ srid = sqlite3_column_int (stmt, 9);
+ ok_srid = 1;
+ }
+ if (sqlite3_column_type (stmt, 10) == SQLITE_BLOB)
+ {
+ const unsigned char *blob =
+ sqlite3_column_blob (stmt, 10);
+ int blob_sz = sqlite3_column_bytes (stmt, 10);
+ no_data = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (no_data == NULL)
+ ok_nodata = 0;
+ }
+ if (ok_sample && ok_pixel && ok_num_bands && ok_compression
+ && ok_quality && ok_tile_width && ok_tile_height && ok_x_res
+ && ok_y_res && ok_srid && ok_nodata)
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+
+ if (!ok)
+ {
+ fprintf (stderr, "ERROR: unable to find a Coverage named \"%s\"\n",
+ coverage);
+ return NULL;
+ }
+
+ cvg =
+ rl2_create_coverage (coverage, sample, pixel, num_bands, compression,
+ quality, tile_width, tile_height, no_data);
+ if (cvg == NULL)
+ {
+ fprintf (stderr,
+ "ERROR: unable to create a Coverage Object supporting \"%s\"\n",
+ coverage);
+ return NULL;
+ }
+ if (rl2_coverage_georeference (cvg, srid, x_res, y_res) != RL2_OK)
+ {
+ fprintf (stderr,
+ "ERROR: unable to Georeference a Coverage Object supporting \"%s\"\n",
+ coverage);
+ rl2_destroy_coverage (cvg);
+ return NULL;
+ }
+ return cvg;
+}
+
+static void
+void_int8_raw_buffer (char *buffer, unsigned int width, unsigned int height,
+ rl2PixelPtr no_data)
+{
+/* preparing an empty/void INT8 raw buffer */
+ rl2PrivPixelPtr pxl = NULL;
+ unsigned int x;
+ unsigned int y;
+ char *p = buffer;
+ char nd_value = 0;
+ if (no_data != NULL)
+ {
+ pxl = (rl2PrivPixelPtr) no_data;
+ if (pxl->sampleType == RL2_SAMPLE_INT8 && pxl->nBands == 1)
+ {
+
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd_value = sample->int8;
+ }
+ }
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ *p++ = nd_value;
+ }
+}
+
+static void
+void_uint8_raw_buffer (unsigned char *buffer, unsigned int width,
+ unsigned int height, unsigned char num_bands,
+ rl2PixelPtr no_data)
+{
+/* preparing an empty/void UINT8 raw buffer */
+ rl2PrivPixelPtr pxl = NULL;
+ unsigned int x;
+ unsigned int y;
+ unsigned char b;
+ unsigned char *p = buffer;
+ int has_nodata = 0;
+ if (no_data != NULL)
+ {
+ pxl = (rl2PrivPixelPtr) no_data;
+ if (pxl->sampleType == RL2_SAMPLE_UINT8 && pxl->nBands == num_bands)
+ has_nodata = 1;
+ }
+ if (!has_nodata)
+ {
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ for (b = 0; b < num_bands; b++)
+ *p++ = 0;
+ }
+ }
+ }
+ else
+ {
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ for (b = 0; b < num_bands; b++)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + b;
+ *p++ = sample->uint8;
+ }
+ }
+ }
+ }
+}
+
+static void
+void_int16_raw_buffer (short *buffer, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data)
+{
+/* preparing an empty/void INT16 raw buffer */
+ rl2PrivPixelPtr pxl = NULL;
+ unsigned int x;
+ unsigned int y;
+ short *p = buffer;
+ short nd_value = 0;
+ if (no_data != NULL)
+ {
+ pxl = (rl2PrivPixelPtr) no_data;
+ if (pxl->sampleType == RL2_SAMPLE_INT16 && pxl->nBands == 1)
+ {
+
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd_value = sample->int16;
+ }
+ }
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ *p++ = nd_value;
+ }
+}
+
+static void
+void_uint16_raw_buffer (unsigned short *buffer, unsigned int width,
+ unsigned int height, unsigned char num_bands,
+ rl2PixelPtr no_data)
+{
+/* preparing an empty/void UINT16 raw buffer */
+ rl2PrivPixelPtr pxl = NULL;
+ unsigned int x;
+ unsigned int y;
+ unsigned char b;
+ unsigned short *p = buffer;
+ int has_nodata = 0;
+ if (no_data != NULL)
+ {
+ pxl = (rl2PrivPixelPtr) no_data;
+ if (pxl->sampleType == RL2_SAMPLE_UINT16 && pxl->nBands == num_bands)
+ has_nodata = 1;
+ }
+ if (!has_nodata)
+ {
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ for (b = 0; b < num_bands; b++)
+ *p++ = 0;
+ }
+ }
+ }
+ else
+ {
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ for (b = 0; b < num_bands; b++)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + b;
+ *p++ = sample->uint16;
+ }
+ }
+ }
+ }
+}
+
+static void
+void_int32_raw_buffer (int *buffer, unsigned int width, unsigned int height,
+ rl2PixelPtr no_data)
+{
+/* preparing an empty/void INT32 raw buffer */
+ rl2PrivPixelPtr pxl = NULL;
+ unsigned int x;
+ unsigned int y;
+ int *p = buffer;
+ int nd_value = 0;
+ if (no_data != NULL)
+ {
+ pxl = (rl2PrivPixelPtr) no_data;
+ if (pxl->sampleType == RL2_SAMPLE_INT32 && pxl->nBands == 1)
+ {
+
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd_value = sample->int32;
+ }
+ }
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ *p++ = nd_value;
+ }
+}
+
+static void
+void_uint32_raw_buffer (unsigned int *buffer, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data)
+{
+/* preparing an empty/void UINT32 raw buffer */
+ rl2PrivPixelPtr pxl = NULL;
+ unsigned int x;
+ unsigned int y;
+ unsigned int *p = buffer;
+ unsigned int nd_value = 0;
+ if (no_data != NULL)
+ {
+ pxl = (rl2PrivPixelPtr) no_data;
+ if (pxl->sampleType == RL2_SAMPLE_UINT32 && pxl->nBands == 1)
+ {
+
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd_value = sample->uint32;
+ }
+ }
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ *p++ = nd_value;
+ }
+}
+
+static void
+void_float_raw_buffer (float *buffer, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data)
+{
+/* preparing an empty/void FLOAT raw buffer */
+ rl2PrivPixelPtr pxl = NULL;
+ unsigned int x;
+ unsigned int y;
+ float *p = buffer;
+ float nd_value = 0.0;
+ if (no_data != NULL)
+ {
+ pxl = (rl2PrivPixelPtr) no_data;
+ if (pxl->sampleType == RL2_SAMPLE_FLOAT && pxl->nBands == 1)
+ {
+
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd_value = sample->float32;
+ }
+ }
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ *p++ = nd_value;
+ }
+}
+
+static void
+void_double_raw_buffer (double *buffer, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data)
+{
+/* preparing an empty/void DOUBLE raw buffer */
+ rl2PrivPixelPtr pxl = NULL;
+ unsigned int x;
+ unsigned int y;
+ double *p = buffer;
+ double nd_value = 0.0;
+ if (no_data != NULL)
+ {
+ pxl = (rl2PrivPixelPtr) no_data;
+ if (pxl->sampleType == RL2_SAMPLE_DOUBLE && pxl->nBands == 1)
+ {
+
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd_value = sample->float64;
+ }
+ }
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ *p++ = nd_value;
+ }
+}
+
+RL2_PRIVATE void
+void_raw_buffer (unsigned char *buffer, unsigned int width,
+ unsigned int height, unsigned char sample_type,
+ unsigned char num_bands, rl2PixelPtr no_data)
+{
+/* preparing an empty/void buffer */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ void_int8_raw_buffer ((char *) buffer, width, height, no_data);
+ break;
+ case RL2_SAMPLE_INT16:
+ void_int16_raw_buffer ((short *) buffer, width, height, no_data);
+ break;
+ case RL2_SAMPLE_UINT16:
+ void_uint16_raw_buffer ((unsigned short *) buffer, width, height,
+ num_bands, no_data);
+ break;
+ case RL2_SAMPLE_INT32:
+ void_int32_raw_buffer ((int *) buffer, width, height, no_data);
+ break;
+ case RL2_SAMPLE_UINT32:
+ void_uint32_raw_buffer ((unsigned int *) buffer, width, height,
+ no_data);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ void_float_raw_buffer ((float *) buffer, width, height, no_data);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ void_double_raw_buffer ((double *) buffer, width, height, no_data);
+ break;
+ default:
+ void_uint8_raw_buffer ((unsigned char *) buffer, width, height,
+ num_bands, no_data);
+ break;
+ };
+}
+
+RL2_PRIVATE void
+void_raw_buffer_palette (unsigned char *buffer, unsigned int width,
+ unsigned int height, rl2PixelPtr no_data)
+{
+/* preparing an empty/void buffer (PALETTE) */
+ unsigned int row;
+ unsigned int col;
+ unsigned char index = 0;
+ unsigned char *p = buffer;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ goto done;
+ if (pixel_type != RL2_PIXEL_PALETTE || num_bands != 1)
+ goto done;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ rl2_get_pixel_sample_1bit (no_data, &index);
+ break;
+ case RL2_SAMPLE_2_BIT:
+ rl2_get_pixel_sample_2bit (no_data, &index);
+ break;
+ case RL2_SAMPLE_4_BIT:
+ rl2_get_pixel_sample_4bit (no_data, &index);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_get_pixel_sample_uint8 (no_data, 0, &index);
+ break;
+ };
+ }
+
+ done:
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ *p++ = index;
+ }
+}
+
+static int
+load_dbms_tiles_common (sqlite3 * handle, sqlite3_stmt * stmt_tiles,
+ sqlite3_stmt * stmt_data, unsigned char *outbuf,
+ unsigned int width,
+ unsigned int height, unsigned char sample_type,
+ unsigned char num_bands, double x_res, double y_res,
+ double minx, double maxy,
+ int scale, rl2PalettePtr palette, rl2PixelPtr no_data,
+ rl2RasterStylePtr style, rl2RasterStatisticsPtr stats)
+{
+/* retrieving a full image from DBMS tiles */
+ rl2RasterPtr raster = NULL;
+ rl2PalettePtr plt = NULL;
+ int ret;
+
+/* querying the tiles */
+ while (1)
+ {
+ ret = sqlite3_step (stmt_tiles);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob_odd = NULL;
+ int blob_odd_sz = 0;
+ const unsigned char *blob_even = NULL;
+ int blob_even_sz = 0;
+ sqlite3_int64 tile_id = sqlite3_column_int64 (stmt_tiles, 0);
+ double tile_minx = sqlite3_column_double (stmt_tiles, 1);
+ double tile_maxy = sqlite3_column_double (stmt_tiles, 2);
+
+ /* retrieving tile raw data from BLOBs */
+ sqlite3_reset (stmt_data);
+ sqlite3_clear_bindings (stmt_data);
+ sqlite3_bind_int64 (stmt_data, 1, tile_id);
+ ret = sqlite3_step (stmt_data);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt_data, 0) == SQLITE_BLOB)
+ {
+ blob_odd = sqlite3_column_blob (stmt_data, 0);
+ blob_odd_sz = sqlite3_column_bytes (stmt_data, 0);
+ }
+ if (scale == RL2_SCALE_1)
+ {
+ if (sqlite3_column_type (stmt_data, 1) ==
+ SQLITE_BLOB)
+ {
+ blob_even =
+ sqlite3_column_blob (stmt_data, 1);
+ blob_even_sz =
+ sqlite3_column_bytes (stmt_data, 1);
+ }
+ }
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT tiles data; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ plt = rl2_clone_palette (palette);
+ raster =
+ rl2_raster_decode (scale, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, plt);
+ plt = NULL;
+ if (raster == NULL)
+ {
+ fprintf (stderr, ERR_FRMT64, tile_id);
+ goto error;
+ }
+ if (!copy_raw_pixels
+ (raster, outbuf, width, height, sample_type,
+ num_bands, x_res, y_res, minx, maxy, tile_minx, tile_maxy,
+ no_data, style, stats))
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT tiles; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+
+ return 1;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (plt != NULL)
+ rl2_destroy_palette (plt);
+ return 0;
+}
+
+static int
+is_nodata_u16 (rl2PrivPixelPtr no_data, const unsigned short *p_in)
+{
+/* testing for NO-DATA */
+ if (no_data != NULL)
+ {
+ unsigned char band;
+ int match = 0;
+ rl2PrivSamplePtr sample;
+ for (band = 0; band < no_data->nBands; band++)
+ {
+ sample = no_data->Samples + band;
+ if (*(p_in + band) == sample->uint16)
+ match++;
+ }
+ if (match == no_data->nBands)
+ return 1;
+ }
+ return 0;
+}
+
+static int
+copy_triple_band_raw_pixels_u16 (rl2RasterPtr raster, unsigned short *outbuf,
+ unsigned int width, unsigned int height,
+ unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band, double x_res,
+ double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ rl2PixelPtr no_data)
+{
+/* copying raw pixels into the output buffer - UINT16 */
+ unsigned int tile_width;
+ unsigned int tile_height;
+ unsigned int x;
+ unsigned int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned short *p_in;
+ const unsigned char *p_msk;
+ unsigned short *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ unsigned char num_bands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+ rl2PrivPixelPtr no_data_in;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) raster;
+
+ if (rl2_get_raster_size (raster, &tile_width, &tile_height) != RL2_OK)
+ return 0;
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ return 0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &nbands) != RL2_OK)
+ ignore_no_data = 1;
+ if (pixel_type != RL2_PIXEL_RGB)
+ ignore_no_data = 1;
+ if (nbands != 3)
+ ignore_no_data = 1;
+ if (sample_type != RL2_SAMPLE_UINT16)
+ ignore_no_data = 1;
+ }
+
+ p_in = (const unsigned short *) (rst->rasterBuffer);
+ p_msk = (unsigned char *) (rst->maskBuffer);
+ no_data_in = rst->noData;
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || (unsigned int) out_y >= height)
+ {
+ p_in += tile_width * num_bands;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || (unsigned int) out_x >= width)
+ {
+ p_in += num_bands;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = outbuf + (out_y * width * 3) + (out_x * 3);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (!transparent)
+ transparent = is_nodata_u16 (no_data_in, p_in);
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out += 3;
+ p_in += num_bands;
+ }
+ else
+ {
+ unsigned short r = *(p_in + red_band);
+ unsigned short g = *(p_in + green_band);
+ unsigned short b = *(p_in + blue_band);
+ p_in += num_bands;
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ unsigned short sample;
+ unsigned short r = *(p_in + red_band);
+ unsigned short g = *(p_in + green_band);
+ unsigned short b = *(p_in + blue_band);
+ p_in += num_bands;
+ rl2_get_pixel_sample_uint16 (no_data, 0, &sample);
+ if (sample == r)
+ match++;
+ rl2_get_pixel_sample_uint16 (no_data, 1, &sample);
+ if (sample == g)
+ match++;
+ rl2_get_pixel_sample_uint16 (no_data, 2, &sample);
+ if (sample == b)
+ match++;
+ if (match != 3)
+ {
+ /* opaque pixel */
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out += 3;
+ }
+ }
+ }
+ }
+
+ return 1;
+}
+
+static int
+is_nodata_u8 (rl2PrivPixelPtr no_data, const unsigned char *p_in)
+{
+/* testing for NO-DATA */
+ if (no_data != NULL)
+ {
+ unsigned char band;
+ int match = 0;
+ rl2PrivSamplePtr sample;
+ for (band = 0; band < no_data->nBands; band++)
+ {
+ sample = no_data->Samples + band;
+ if (*(p_in + band) == sample->uint8)
+ match++;
+ }
+ if (match == no_data->nBands)
+ return 1;
+ }
+ return 0;
+}
+
+static int
+copy_triple_band_raw_pixels (rl2RasterPtr raster, unsigned char *outbuf,
+ unsigned int width,
+ unsigned int height, unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band, double x_res,
+ double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ rl2PixelPtr no_data)
+{
+/* copying raw pixels into the output buffer */
+ unsigned int tile_width;
+ unsigned int tile_height;
+ unsigned int x;
+ unsigned int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned char *p_in;
+ const unsigned char *p_msk;
+ unsigned char *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ unsigned char num_bands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+ rl2PrivPixelPtr no_data_in;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) raster;
+
+ if (rst->sampleType == RL2_SAMPLE_UINT16)
+ return copy_triple_band_raw_pixels_u16 (raster,
+ (unsigned short *) outbuf,
+ width, height, red_band,
+ green_band, blue_band, x_res,
+ y_res, minx, maxy, tile_minx,
+ tile_maxy, no_data);
+
+ if (rl2_get_raster_size (raster, &tile_width, &tile_height) != RL2_OK)
+ return 0;
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ return 0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &nbands) != RL2_OK)
+ ignore_no_data = 1;
+ if (pixel_type != RL2_PIXEL_RGB)
+ ignore_no_data = 1;
+ if (nbands != 3)
+ ignore_no_data = 1;
+ if (sample_type != RL2_SAMPLE_UINT8)
+ ignore_no_data = 1;
+ }
+
+ p_in = rst->rasterBuffer;
+ p_msk = rst->maskBuffer;
+ no_data_in = rst->noData;
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || (unsigned int) out_y >= height)
+ {
+ p_in += tile_width * num_bands;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || (unsigned int) out_x >= width)
+ {
+ p_in += num_bands;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = outbuf + (out_y * width * 3) + (out_x * 3);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (!transparent)
+ transparent = is_nodata_u8 (no_data_in, p_in);
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out += 3;
+ p_in += num_bands;
+ }
+ else
+ {
+ unsigned char r = *(p_in + red_band);
+ unsigned char g = *(p_in + green_band);
+ unsigned char b = *(p_in + blue_band);
+ p_in += num_bands;
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ unsigned char sample;
+ unsigned char r = *(p_in + red_band);
+ unsigned char g = *(p_in + green_band);
+ unsigned char b = *(p_in + blue_band);
+ p_in += num_bands;
+ rl2_get_pixel_sample_uint8 (no_data, 0, &sample);
+ if (sample == r)
+ match++;
+ rl2_get_pixel_sample_uint8 (no_data, 1, &sample);
+ if (sample == g)
+ match++;
+ rl2_get_pixel_sample_uint8 (no_data, 2, &sample);
+ if (sample == b)
+ match++;
+ if (match != 3)
+ {
+ /* opaque pixel */
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out += 3;
+ }
+ }
+ }
+ }
+
+ return 1;
+}
+
+static int
+load_triple_band_dbms_tiles (sqlite3 * handle, sqlite3_stmt * stmt_tiles,
+ sqlite3_stmt * stmt_data, unsigned char *outbuf,
+ unsigned int width, unsigned int height,
+ unsigned char red_band, unsigned char green_band,
+ unsigned char blue_band, double x_res,
+ double y_res, double minx, double miny,
+ double maxx, double maxy, int level, int scale,
+ rl2PixelPtr no_data)
+{
+/* retrieving a full image from DBMS tiles */
+ rl2RasterPtr raster = NULL;
+ int ret;
+
+/* binding the query args */
+ sqlite3_reset (stmt_tiles);
+ sqlite3_clear_bindings (stmt_tiles);
+ sqlite3_bind_int (stmt_tiles, 1, level);
+ sqlite3_bind_double (stmt_tiles, 2, minx);
+ sqlite3_bind_double (stmt_tiles, 3, miny);
+ sqlite3_bind_double (stmt_tiles, 4, maxx);
+ sqlite3_bind_double (stmt_tiles, 5, maxy);
+
+/* querying the tiles */
+ while (1)
+ {
+ ret = sqlite3_step (stmt_tiles);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob_odd = NULL;
+ int blob_odd_sz = 0;
+ const unsigned char *blob_even = NULL;
+ int blob_even_sz = 0;
+ sqlite3_int64 tile_id = sqlite3_column_int64 (stmt_tiles, 0);
+ double tile_minx = sqlite3_column_double (stmt_tiles, 1);
+ double tile_maxy = sqlite3_column_double (stmt_tiles, 2);
+
+ /* retrieving tile raw data from BLOBs */
+ sqlite3_reset (stmt_data);
+ sqlite3_clear_bindings (stmt_data);
+ sqlite3_bind_int64 (stmt_data, 1, tile_id);
+ ret = sqlite3_step (stmt_data);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt_data, 0) == SQLITE_BLOB)
+ {
+ blob_odd = sqlite3_column_blob (stmt_data, 0);
+ blob_odd_sz = sqlite3_column_bytes (stmt_data, 0);
+ }
+ if (sqlite3_column_type (stmt_data, 1) == SQLITE_BLOB)
+ {
+ blob_even = sqlite3_column_blob (stmt_data, 1);
+ blob_even_sz = sqlite3_column_bytes (stmt_data, 1);
+ }
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT tiles data; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ raster =
+ rl2_raster_decode (scale, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, ERR_FRMT64, tile_id);
+ goto error;
+ }
+ if (!copy_triple_band_raw_pixels
+ (raster, outbuf, width, height, red_band, green_band,
+ blue_band, x_res, y_res, minx, maxy, tile_minx, tile_maxy,
+ no_data))
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT tiles; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+
+ return 1;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ return 0;
+}
+
+static int
+copy_mono_band_raw_pixels_u16 (rl2RasterPtr raster, unsigned char *outbuf,
+ unsigned int width, unsigned int height,
+ unsigned char mono_band, double x_res,
+ double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ rl2PixelPtr no_data)
+{
+/* copying raw pixels into the output buffer - UINT16 */
+ unsigned int tile_width;
+ unsigned int tile_height;
+ unsigned int x;
+ unsigned int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned short *p_in;
+ const unsigned char *p_msk;
+ unsigned short *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ unsigned char num_bands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) raster;
+
+ if (rl2_get_raster_size (raster, &tile_width, &tile_height) != RL2_OK)
+ return 0;
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ return 0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &nbands) != RL2_OK)
+ ignore_no_data = 1;
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type != RL2_SAMPLE_UINT16)
+ ignore_no_data = 1;
+ }
+
+ p_in = (const unsigned short *) (rst->rasterBuffer);
+ p_msk = (unsigned char *) (rst->maskBuffer);
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < (unsigned int) tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || (unsigned int) out_y >= height)
+ {
+ p_in += tile_width * num_bands;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < (unsigned int) tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || (unsigned int) out_x >= width)
+ {
+ p_in += num_bands;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = (unsigned short *) outbuf;
+ p_out += (out_y * width) + out_x;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out++;
+ p_in += num_bands;
+ }
+ else
+ {
+ *p_out++ = *(p_in + mono_band);
+ p_in += num_bands;
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ unsigned short sample;
+ unsigned short gray = *(p_in + mono_band);
+ p_in += num_bands;
+ rl2_get_pixel_sample_uint16 (no_data, 0, &sample);
+ if (sample == gray)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ *p_out++ = gray;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out++;
+ }
+ }
+ }
+ }
+
+ return 1;
+}
+
+static int
+copy_mono_band_raw_pixels (rl2RasterPtr raster, unsigned char *outbuf,
+ unsigned int width, unsigned int height,
+ unsigned char mono_band, double x_res, double y_res,
+ double minx, double maxy, double tile_minx,
+ double tile_maxy, rl2PixelPtr no_data)
+{
+/* copying raw pixels into the output buffer */
+ unsigned int tile_width;
+ unsigned int tile_height;
+ unsigned int x;
+ unsigned int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned char *p_in;
+ const unsigned char *p_msk;
+ unsigned char *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ unsigned char num_bands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) raster;
+
+ if (rst->sampleType == RL2_SAMPLE_UINT16)
+ return copy_mono_band_raw_pixels_u16 (raster, outbuf, width, height,
+ mono_band, x_res, y_res, minx,
+ maxy, tile_minx, tile_maxy,
+ no_data);
+
+ if (rl2_get_raster_size (raster, &tile_width, &tile_height) != RL2_OK)
+ return 0;
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ return 0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &nbands) != RL2_OK)
+ ignore_no_data = 1;
+ if (pixel_type != RL2_PIXEL_GRAYSCALE)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type != RL2_SAMPLE_UINT8)
+ ignore_no_data = 1;
+ }
+
+ p_in = rst->rasterBuffer;
+ p_msk = rst->maskBuffer;
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || (unsigned int) out_y >= height)
+ {
+ p_in += tile_width * num_bands;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < (unsigned int) tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || (unsigned int) out_x >= width)
+ {
+ p_in += num_bands;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = outbuf + (out_y * width) + out_x;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out++;
+ p_in += num_bands;
+ }
+ else
+ {
+ unsigned char gray = *(p_in + mono_band);
+ p_in += num_bands;
+ *p_out++ = gray;
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ unsigned char sample;
+ unsigned char gray = *(p_in + mono_band);
+ p_in += num_bands;
+ rl2_get_pixel_sample_uint8 (no_data, 0, &sample);
+ if (sample == gray)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ *p_out++ = gray;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out++;
+ }
+ }
+ }
+ }
+
+ return 1;
+}
+
+static int
+load_mono_band_dbms_tiles (sqlite3 * handle, sqlite3_stmt * stmt_tiles,
+ sqlite3_stmt * stmt_data, unsigned char *outbuf,
+ unsigned int width, unsigned int height,
+ unsigned char mono_band, double x_res, double y_res,
+ double minx, double miny, double maxx, double maxy,
+ int level, int scale, rl2PixelPtr no_data)
+{
+/* retrieving a full image from DBMS tiles */
+ rl2RasterPtr raster = NULL;
+ int ret;
+
+/* binding the query args */
+ sqlite3_reset (stmt_tiles);
+ sqlite3_clear_bindings (stmt_tiles);
+ sqlite3_bind_int (stmt_tiles, 1, level);
+ sqlite3_bind_double (stmt_tiles, 2, minx);
+ sqlite3_bind_double (stmt_tiles, 3, miny);
+ sqlite3_bind_double (stmt_tiles, 4, maxx);
+ sqlite3_bind_double (stmt_tiles, 5, maxy);
+
+/* querying the tiles */
+ while (1)
+ {
+ ret = sqlite3_step (stmt_tiles);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob_odd = NULL;
+ int blob_odd_sz = 0;
+ const unsigned char *blob_even = NULL;
+ int blob_even_sz = 0;
+ sqlite3_int64 tile_id = sqlite3_column_int64 (stmt_tiles, 0);
+ double tile_minx = sqlite3_column_double (stmt_tiles, 1);
+ double tile_maxy = sqlite3_column_double (stmt_tiles, 2);
+
+ /* retrieving tile raw data from BLOBs */
+ sqlite3_reset (stmt_data);
+ sqlite3_clear_bindings (stmt_data);
+ sqlite3_bind_int64 (stmt_data, 1, tile_id);
+ ret = sqlite3_step (stmt_data);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt_data, 0) == SQLITE_BLOB)
+ {
+ blob_odd = sqlite3_column_blob (stmt_data, 0);
+ blob_odd_sz = sqlite3_column_bytes (stmt_data, 0);
+ }
+ if (sqlite3_column_type (stmt_data, 1) == SQLITE_BLOB)
+ {
+ blob_even = sqlite3_column_blob (stmt_data, 1);
+ blob_even_sz = sqlite3_column_bytes (stmt_data, 1);
+ }
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT tiles data; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ raster =
+ rl2_raster_decode (scale, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, ERR_FRMT64, tile_id);
+ goto error;
+ }
+ if (!copy_mono_band_raw_pixels
+ (raster, outbuf, width, height, mono_band, x_res, y_res,
+ minx, maxy, tile_minx, tile_maxy, no_data))
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT tiles; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+
+ return 1;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ return 0;
+}
+
+RL2_PRIVATE int
+load_dbms_tiles (sqlite3 * handle, sqlite3_stmt * stmt_tiles,
+ sqlite3_stmt * stmt_data, unsigned char *outbuf,
+ unsigned int width,
+ unsigned int height, unsigned char sample_type,
+ unsigned char num_bands, double x_res, double y_res,
+ double minx, double miny, double maxx, double maxy, int level,
+ int scale, rl2PalettePtr palette, rl2PixelPtr no_data,
+ rl2RasterStylePtr style, rl2RasterStatisticsPtr stats)
+{
+/* binding the query args */
+ sqlite3_reset (stmt_tiles);
+ sqlite3_clear_bindings (stmt_tiles);
+ sqlite3_bind_int (stmt_tiles, 1, level);
+ sqlite3_bind_double (stmt_tiles, 2, minx);
+ sqlite3_bind_double (stmt_tiles, 3, miny);
+ sqlite3_bind_double (stmt_tiles, 4, maxx);
+ sqlite3_bind_double (stmt_tiles, 5, maxy);
+
+ if (!load_dbms_tiles_common
+ (handle, stmt_tiles, stmt_data, outbuf, width, height,
+ sample_type, num_bands, x_res, y_res, minx, maxy, scale,
+ palette, no_data, style, stats))
+ return 0;
+ return 1;
+}
+
+RL2_PRIVATE int
+load_dbms_tiles_section (sqlite3 * handle, sqlite3_int64 section_id,
+ sqlite3_stmt * stmt_tiles, sqlite3_stmt * stmt_data,
+ unsigned char *outbuf,
+ unsigned int width, unsigned int height,
+ unsigned char sample_type, unsigned char num_bands,
+ double x_res, double y_res, double minx, double maxy,
+ int scale, rl2PalettePtr palette, rl2PixelPtr no_data)
+{
+/* binding the query args */
+ sqlite3_reset (stmt_tiles);
+ sqlite3_clear_bindings (stmt_tiles);
+ sqlite3_bind_int (stmt_tiles, 1, section_id);
+
+ if (!load_dbms_tiles_common
+ (handle, stmt_tiles, stmt_data, outbuf, width, height,
+ sample_type, num_bands, x_res, y_res, minx, maxy, scale,
+ palette, no_data, NULL, NULL))
+ return 0;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_find_matching_resolution (sqlite3 * handle, rl2CoveragePtr cvg,
+ double *x_res, double *y_res,
+ unsigned char *level, unsigned char *scale)
+{
+/* attempting to identify the corresponding resolution level */
+ rl2PrivCoveragePtr coverage = (rl2PrivCoveragePtr) cvg;
+ int ret;
+ int found = 0;
+ int x_level;
+ int x_scale;
+ double z_x_res;
+ double z_y_res;
+ char *xcoverage;
+ char *xxcoverage;
+ char *sql;
+ sqlite3_stmt *stmt = NULL;
+
+ if (coverage == NULL)
+ return RL2_ERROR;
+ if (coverage->coverageName == NULL)
+ return RL2_ERROR;
+
+ xcoverage = sqlite3_mprintf ("%s_levels", coverage->coverageName);
+ xxcoverage = gaiaDoubleQuotedSql (xcoverage);
+ sqlite3_free (xcoverage);
+ sql =
+ sqlite3_mprintf
+ ("SELECT pyramid_level, x_resolution_1_1, y_resolution_1_1, "
+ "x_resolution_1_2, y_resolution_1_2, x_resolution_1_4, y_resolution_1_4, "
+ "x_resolution_1_8, y_resolution_1_8 FROM \"%s\"", xxcoverage);
+ free (xxcoverage);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ sqlite3_free (sql);
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ double xx_res;
+ double yy_res;
+ double confidence;
+ int ok;
+ int lvl = sqlite3_column_int (stmt, 0);
+ if (sqlite3_column_type (stmt, 1) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 2) == SQLITE_FLOAT)
+ {
+ ok = 1;
+ xx_res = sqlite3_column_double (stmt, 1);
+ yy_res = sqlite3_column_double (stmt, 2);
+ confidence = xx_res / 100.0;
+ if (*x_res < (xx_res - confidence)
+ || *x_res > (xx_res + confidence))
+ ok = 0;
+ confidence = yy_res / 100.0;
+ if (*y_res < (yy_res - confidence)
+ || *y_res > (yy_res + confidence))
+ ok = 0;
+ if (ok)
+ {
+ found = 1;
+ x_level = lvl;
+ x_scale = RL2_SCALE_1;
+ z_x_res = xx_res;
+ z_y_res = yy_res;
+ }
+ }
+ if (sqlite3_column_type (stmt, 3) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 4) == SQLITE_FLOAT)
+ {
+ ok = 1;
+ xx_res = sqlite3_column_double (stmt, 3);
+ yy_res = sqlite3_column_double (stmt, 4);
+ confidence = xx_res / 100.0;
+ if (*x_res < (xx_res - confidence)
+ || *x_res > (xx_res + confidence))
+ ok = 0;
+ confidence = yy_res / 100.0;
+ if (*y_res < (yy_res - confidence)
+ || *y_res > (yy_res + confidence))
+ ok = 0;
+ if (ok)
+ {
+ found = 1;
+ x_level = lvl;
+ x_scale = RL2_SCALE_2;
+ z_x_res = xx_res;
+ z_y_res = yy_res;
+ }
+ }
+ if (sqlite3_column_type (stmt, 5) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 6) == SQLITE_FLOAT)
+ {
+ ok = 1;
+ xx_res = sqlite3_column_double (stmt, 5);
+ yy_res = sqlite3_column_double (stmt, 6);
+ confidence = xx_res / 100.0;
+ if (*x_res < (xx_res - confidence)
+ || *x_res > (xx_res + confidence))
+ ok = 0;
+ confidence = yy_res / 100.0;
+ if (*y_res < (yy_res - confidence)
+ || *y_res > (yy_res + confidence))
+ ok = 0;
+ if (ok)
+ {
+ found = 1;
+ x_level = lvl;
+ x_scale = RL2_SCALE_4;
+ z_x_res = xx_res;
+ z_y_res = yy_res;
+ }
+ }
+ if (sqlite3_column_type (stmt, 7) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 8) == SQLITE_FLOAT)
+ {
+ ok = 1;
+ xx_res = sqlite3_column_double (stmt, 7);
+ yy_res = sqlite3_column_double (stmt, 8);
+ confidence = xx_res / 100.0;
+ if (*x_res < (xx_res - confidence)
+ || *x_res > (xx_res + confidence))
+ ok = 0;
+ confidence = yy_res / 100.0;
+ if (*y_res < (yy_res - confidence)
+ || *y_res > (yy_res + confidence))
+ ok = 0;
+ if (ok)
+ {
+ found = 1;
+ x_level = lvl;
+ x_scale = RL2_SCALE_8;
+ z_x_res = xx_res;
+ z_y_res = yy_res;
+ }
+ }
+ }
+ else
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql,
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (found)
+ {
+ *level = x_level;
+ *scale = x_scale;
+ *x_res = z_x_res;
+ *y_res = z_y_res;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ return RL2_ERROR;
+}
+
+static int
+has_styled_rgb_colors (rl2RasterStylePtr style)
+{
+/* testing for a RasterSymbolizer requiring RGB colors */
+ rl2PrivColorMapPointPtr color;
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return 0;
+ if (stl->shadedRelief && stl->brightnessOnly)
+ return 0;
+ if (stl->categorize != NULL)
+ {
+ if (stl->categorize->dfltRed == stl->categorize->dfltGreen
+ && stl->categorize->dfltRed == stl->categorize->dfltBlue)
+ ;
+ else
+ return 1;
+ if (stl->categorize->baseRed == stl->categorize->baseGreen
+ && stl->categorize->baseRed == stl->categorize->baseBlue)
+ ;
+ else
+ return 1;
+ color = stl->categorize->first;
+ while (color != NULL)
+ {
+ if (color->red == color->green && color->red == color->blue)
+ ;
+ else
+ return 1;
+ color = color->next;
+ }
+ }
+ if (stl->interpolate != NULL)
+ {
+ if (stl->interpolate->dfltRed == stl->interpolate->dfltGreen
+ && stl->interpolate->dfltRed == stl->interpolate->dfltBlue)
+ ;
+ else
+ return 1;
+ color = stl->interpolate->first;
+ while (color != NULL)
+ {
+ if (color->red == color->green && color->red == color->blue)
+ ;
+ else
+ return 1;
+ color = color->next;
+ }
+ }
+ return 0;
+}
+
+RL2_PRIVATE double
+rl2_get_shaded_relief_scale_factor (sqlite3 * handle, const char *coverage)
+{
+/* return the appropriate Scale Factor for Shaded Relief
+/ when SRID is of the Long/Lat type
+/ this is strictly required because in this case
+/ X and Y are measured in degrees, but elevations
+/ (Z) are measured in meters
+*/
+ double scale_factor = 1.0;
+ int ret;
+ char **results;
+ int rows;
+ int columns;
+ int i;
+ char *sql = sqlite3_mprintf ("SELECT s.srid FROM raster_coverages AS r "
+ "JOIN spatial_ref_sys AS s ON (s.srid = r.srid AND "
+ "s.proj4text LIKE '%%+proj=longlat%%') "
+ "WHERE Lower(r.coverage_name) = Lower(%Q)",
+ coverage);
+ ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return scale_factor;
+ for (i = 1; i <= rows; i++)
+ scale_factor = 11.1120;
+ sqlite3_free_table (results);
+ return scale_factor;
+}
+
+static int
+get_raw_raster_data_common (sqlite3 * handle, rl2CoveragePtr cvg,
+ unsigned int width, unsigned int height,
+ double minx, double miny, double maxx, double maxy,
+ double x_res, double y_res, unsigned char **buffer,
+ int *buf_size, rl2PalettePtr * palette,
+ unsigned char out_pixel, rl2PixelPtr bgcolor,
+ rl2RasterStylePtr style,
+ rl2RasterStatisticsPtr stats)
+{
+/* attempting to return a buffer containing raw pixels from the DBMS Coverage */
+ rl2PalettePtr plt = NULL;
+ rl2PixelPtr no_data = NULL;
+ rl2PixelPtr kill_no_data = NULL;
+ const char *coverage;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ int pix_sz = 1;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char cvg_pixel_type;
+ unsigned char num_bands;
+ char *xtiles;
+ char *xxtiles;
+ char *xdata;
+ char *xxdata;
+ char *sql;
+ sqlite3_stmt *stmt_tiles = NULL;
+ sqlite3_stmt *stmt_data = NULL;
+ int ret;
+ int has_shaded_relief;
+ int brightness_only;
+ double relief_factor;
+ float *shaded_relief = NULL;
+ int shaded_relief_sz;
+
+ if (cvg == NULL || handle == NULL)
+ goto error;
+ coverage = rl2_get_coverage_name (cvg);
+ if (coverage == NULL)
+ goto error;
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ goto error;
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ cvg_pixel_type = pixel_type;
+
+ if (pixel_type == RL2_PIXEL_MONOCHROME && out_pixel == RL2_PIXEL_GRAYSCALE)
+ {
+ /* Pyramid tiles MONOCHROME */
+ rl2PixelPtr nd = NULL;
+ nd = rl2_get_coverage_no_data (cvg);
+ if (nd != NULL)
+ {
+ /* creating a Grayscale NoData pixel */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) nd;
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8,
+ RL2_PIXEL_GRAYSCALE, 1);
+ kill_no_data = no_data;
+ if (sample->uint8 == 0)
+ rl2_set_pixel_sample_uint8 (no_data,
+ RL2_GRAYSCALE_BAND, 255);
+ else
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 0);
+ }
+ sample_type = RL2_SAMPLE_UINT8;
+ pixel_type = RL2_PIXEL_GRAYSCALE;
+ num_bands = 1;
+ }
+ else if (pixel_type == RL2_PIXEL_PALETTE && out_pixel == RL2_PIXEL_RGB)
+ {
+ /* Pyramid tiles PALETTE */
+ rl2PixelPtr nd = NULL;
+ nd = rl2_get_coverage_no_data (cvg);
+ plt = rl2_get_dbms_palette (handle, coverage);
+ if (nd != NULL)
+ {
+ /* creating an RGB NoData pixel */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) nd;
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3);
+ kill_no_data = no_data;
+ if (plt == NULL)
+ {
+ /* default: white */
+ rl2_set_pixel_sample_uint8 (no_data, RL2_RED_BAND, 255);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, 255);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, 255);
+ }
+ else
+ {
+ /* retrieving the color from within the palette */
+ int ok = 0;
+ unsigned short num_entries;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+ if (rl2_get_palette_colors
+ (plt, &num_entries, &red, &green, &blue) == RL2_OK)
+ {
+ if (sample->uint8 < num_entries)
+ {
+ rl2_set_pixel_sample_uint8 (no_data,
+ RL2_RED_BAND,
+ red
+ [sample->uint8]);
+ rl2_set_pixel_sample_uint8 (no_data,
+ RL2_GREEN_BAND,
+ green
+ [sample->uint8]);
+ rl2_set_pixel_sample_uint8 (no_data,
+ RL2_BLUE_BAND,
+ blue
+ [sample->uint8]);
+ ok = 1;
+ }
+ free (red);
+ free (green);
+ free (blue);
+ }
+ if (!ok)
+ {
+ /* default: white */
+ rl2_set_pixel_sample_uint8 (no_data, RL2_RED_BAND,
+ 255);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GREEN_BAND,
+ 255);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_BLUE_BAND,
+ 255);
+ }
+ }
+ }
+ if (plt != NULL)
+ rl2_destroy_palette (plt);
+ plt = NULL;
+ sample_type = RL2_SAMPLE_UINT8;
+ pixel_type = RL2_PIXEL_RGB;
+ num_bands = 3;
+ }
+ else
+ {
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ /* attempting to retrieve the Coverage's Palette */
+ plt = rl2_get_dbms_palette (handle, coverage);
+ if (plt == NULL)
+ goto error;
+ }
+ no_data = rl2_get_coverage_no_data (cvg);
+ }
+
+ if (style != NULL && stats != NULL)
+ {
+ if (out_pixel == RL2_PIXEL_RGB)
+ {
+ sample_type = RL2_SAMPLE_UINT8;
+ pixel_type = RL2_PIXEL_RGB;
+ num_bands = 3;
+ }
+ if (out_pixel == RL2_PIXEL_GRAYSCALE)
+ {
+ sample_type = RL2_SAMPLE_UINT8;
+ pixel_type = RL2_PIXEL_GRAYSCALE;
+ num_bands = 1;
+ }
+ }
+
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pix_sz = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pix_sz = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pix_sz = 8;
+ break;
+ };
+ if (out_pixel == RL2_PIXEL_GRAYSCALE
+ && cvg_pixel_type == RL2_PIXEL_DATAGRID)
+ {
+ if (has_styled_rgb_colors (style))
+ {
+ /* RGB RasterSymbolizer: promoting to RGB */
+ out_pixel = RL2_PIXEL_RGB;
+ sample_type = RL2_SAMPLE_UINT8;
+ pixel_type = RL2_PIXEL_RGB;
+ pix_sz = 1;
+ num_bands = 3;
+ }
+ }
+ bufpix_size = pix_sz * num_bands * width * height;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2_get_raw_raster_data: Insufficient Memory !!!\n");
+ goto error;
+ }
+
+ if (style != NULL)
+ {
+ /* testing for Shaded Relief */
+ if (rl2_has_raster_style_shaded_relief (style, &has_shaded_relief) !=
+ RL2_OK)
+ goto error;
+ if (has_shaded_relief)
+ {
+ /* preparing a Shaded Relief mask */
+ double scale_factor =
+ rl2_get_shaded_relief_scale_factor (handle, coverage);
+ if (rl2_get_raster_style_shaded_relief
+ (style, &brightness_only, &relief_factor) != RL2_OK)
+ goto error;
+ if (rl2_build_shaded_relief_mask
+ (handle, cvg, relief_factor, scale_factor, width, height,
+ minx, miny, maxx, maxy, x_res, y_res, &shaded_relief,
+ &shaded_relief_sz) != RL2_OK)
+ goto error;
+
+ if (brightness_only || !has_styled_rgb_colors (style))
+ {
+ /* returning a Grayscale ShadedRelief (BrightnessOnly) */
+ unsigned int row;
+ unsigned int col;
+ float *p_in = shaded_relief;
+ unsigned char *p_out = bufpix;
+ if (bgcolor != NULL)
+ void_raw_buffer (bufpix, width, height, sample_type,
+ num_bands, bgcolor);
+ else
+ void_raw_buffer (bufpix, width, height, sample_type,
+ num_bands, no_data);
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ float coeff = *p_in++;
+ if (coeff < 0.0)
+ p_out++; /* transparent */
+ else
+ *p_out++ =
+ (unsigned char) (255.0 * coeff);
+ }
+ }
+ free (shaded_relief);
+ *buffer = bufpix;
+ *buf_size = bufpix_size;
+ if (kill_no_data != NULL)
+ rl2_destroy_pixel (kill_no_data);
+ return RL2_OK;
+ }
+ }
+ }
+
+/* preparing the "tiles" SQL query */
+ xtiles = sqlite3_mprintf ("%s_tiles", coverage);
+ xxtiles = gaiaDoubleQuotedSql (xtiles);
+ sql =
+ sqlite3_mprintf ("SELECT tile_id, MbrMinX(geometry), MbrMaxY(geometry) "
+ "FROM \"%s\" "
+ "WHERE pyramid_level = ? AND ROWID IN ( "
+ "SELECT ROWID FROM SpatialIndex WHERE f_table_name = %Q "
+ "AND search_frame = BuildMBR(?, ?, ?, ?))", xxtiles,
+ xtiles);
+ sqlite3_free (xtiles);
+ free (xxtiles);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_tiles, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT raw tiles SQL error: %s\n", sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ if (scale == RL2_SCALE_1)
+ {
+ /* preparing the data SQL query - both ODD and EVEN */
+ xdata = sqlite3_mprintf ("%s_tile_data", coverage);
+ xxdata = gaiaDoubleQuotedSql (xdata);
+ sqlite3_free (xdata);
+ sql = sqlite3_mprintf ("SELECT tile_data_odd, tile_data_even "
+ "FROM \"%s\" WHERE tile_id = ?", xxdata);
+ free (xxdata);
+ ret =
+ sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_data, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT raw tiles data(2) SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ else
+ {
+ /* preparing the data SQL query - only ODD */
+ xdata = sqlite3_mprintf ("%s_tile_data", coverage);
+ xxdata = gaiaDoubleQuotedSql (xdata);
+ sqlite3_free (xdata);
+ sql = sqlite3_mprintf ("SELECT tile_data_odd "
+ "FROM \"%s\" WHERE tile_id = ?", xxdata);
+ free (xxdata);
+ ret =
+ sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_data, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT raw tiles data(1) SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+
+/* preparing a raw pixels buffer */
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ void_raw_buffer_palette (bufpix, width, height, no_data);
+ else
+ {
+ if (bgcolor != NULL)
+ void_raw_buffer (bufpix, width, height, sample_type, num_bands,
+ bgcolor);
+ else
+ void_raw_buffer (bufpix, width, height, sample_type, num_bands,
+ no_data);
+ }
+ if (!load_dbms_tiles
+ (handle, stmt_tiles, stmt_data, bufpix, width, height, sample_type,
+ num_bands, xx_res, yy_res, minx, miny, maxx, maxy, level, scale, plt,
+ no_data, style, stats))
+ goto error;
+ if (kill_no_data != NULL)
+ rl2_destroy_pixel (kill_no_data);
+ sqlite3_finalize (stmt_tiles);
+ sqlite3_finalize (stmt_data);
+ if (shaded_relief != NULL)
+ {
+ /* applying the Shaded Relief */
+ unsigned int row;
+ unsigned int col;
+ float *p_in = shaded_relief;
+ unsigned char *p_out = bufpix;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ float coeff = *p_in++;
+ if (coeff < 0.0)
+ p_out += 3; /* unaffected */
+ else
+ {
+ unsigned char r = *p_out;
+ unsigned char g = *(p_out + 1);
+ unsigned char b = *(p_out + 2);
+ *p_out++ = (unsigned char) (r * coeff);
+ *p_out++ = (unsigned char) (g * coeff);
+ *p_out++ = (unsigned char) (b * coeff);
+ }
+ }
+ }
+ }
+ *buffer = bufpix;
+ *buf_size = bufpix_size;
+ if (palette != NULL)
+ *palette = plt;
+ if (shaded_relief != NULL)
+ free (shaded_relief);
+ return RL2_OK;
+
+ error:
+ if (stmt_tiles != NULL)
+ sqlite3_finalize (stmt_tiles);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ if (bufpix != NULL)
+ free (bufpix);
+ if (kill_no_data != NULL)
+ rl2_destroy_pixel (kill_no_data);
+ if (shaded_relief != NULL)
+ free (shaded_relief);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_raw_raster_data (sqlite3 * handle, rl2CoveragePtr cvg,
+ unsigned int width, unsigned int height,
+ double minx, double miny, double maxx, double maxy,
+ double x_res, double y_res, unsigned char **buffer,
+ int *buf_size, rl2PalettePtr * palette,
+ unsigned char out_pixel)
+{
+/* attempting to return a buffer containing raw pixels from the DBMS Coverage */
+ return get_raw_raster_data_common (handle, cvg, width, height, minx, miny,
+ maxx, maxy, x_res, y_res, buffer,
+ buf_size, palette, out_pixel, NULL,
+ NULL, NULL);
+}
+
+RL2_DECLARE int
+rl2_get_triple_band_raw_raster_data (sqlite3 * handle, rl2CoveragePtr cvg,
+ unsigned int width,
+ unsigned int height, double minx,
+ double miny, double maxx, double maxy,
+ double x_res, double y_res,
+ unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band,
+ unsigned char **buffer, int *buf_size,
+ rl2PixelPtr bgcolor)
+{
+/* attempting to return a buffer containing raw pixels from the DBMS Coverage */
+ rl2PixelPtr no_data = NULL;
+ const char *coverage;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ char *xtiles;
+ char *xxtiles;
+ char *xdata;
+ char *xxdata;
+ char *sql;
+ sqlite3_stmt *stmt_tiles = NULL;
+ sqlite3_stmt *stmt_data = NULL;
+ int ret;
+
+ if (cvg == NULL || handle == NULL)
+ goto error;
+ coverage = rl2_get_coverage_name (cvg);
+ if (coverage == NULL)
+ goto error;
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ goto error;
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (pixel_type != RL2_PIXEL_RGB && pixel_type != RL2_PIXEL_MULTIBAND)
+ goto error;
+ if (sample_type != RL2_SAMPLE_UINT8 && sample_type != RL2_SAMPLE_UINT16)
+ goto error;
+ if (red_band >= num_bands)
+ goto error;
+ if (green_band >= num_bands)
+ goto error;
+ if (blue_band >= num_bands)
+ goto error;
+
+ if (bgcolor != NULL)
+ {
+ /* using the externally define background color */
+ no_data = bgcolor;
+ goto ok_no_data;
+ }
+
+ ok_no_data:
+ bufpix_size = 3 * width * height;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ bufpix_size *= 2;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2_get_triple_band_raw_raster_data: Insufficient Memory !!!\n");
+ goto error;
+ }
+
+/* preparing the "tiles" SQL query */
+ xtiles = sqlite3_mprintf ("%s_tiles", coverage);
+ xxtiles = gaiaDoubleQuotedSql (xtiles);
+ sql =
+ sqlite3_mprintf ("SELECT tile_id, MbrMinX(geometry), MbrMaxY(geometry) "
+ "FROM \"%s\" "
+ "WHERE pyramid_level = ? AND ROWID IN ( "
+ "SELECT ROWID FROM SpatialIndex WHERE f_table_name = %Q "
+ "AND search_frame = BuildMBR(?, ?, ?, ?))", xxtiles,
+ xtiles);
+ sqlite3_free (xtiles);
+ free (xxtiles);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_tiles, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT raw tiles SQL error: %s\n", sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ /* preparing the data SQL query - both ODD and EVEN */
+ xdata = sqlite3_mprintf ("%s_tile_data", coverage);
+ xxdata = gaiaDoubleQuotedSql (xdata);
+ sqlite3_free (xdata);
+ sql = sqlite3_mprintf ("SELECT tile_data_odd, tile_data_even "
+ "FROM \"%s\" WHERE tile_id = ?", xxdata);
+ free (xxdata);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_data, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT raw tiles data(2) SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+/* preparing a raw pixels buffer */
+ void_raw_buffer (bufpix, width, height, sample_type, 3, no_data);
+ if (!load_triple_band_dbms_tiles
+ (handle, stmt_tiles, stmt_data, bufpix, width, height, red_band,
+ green_band, blue_band, xx_res, yy_res, minx, miny, maxx, maxy, level,
+ scale, no_data))
+ goto error;
+ sqlite3_finalize (stmt_tiles);
+ sqlite3_finalize (stmt_data);
+ *buffer = bufpix;
+ *buf_size = bufpix_size;
+ return RL2_OK;
+
+ error:
+ if (stmt_tiles != NULL)
+ sqlite3_finalize (stmt_tiles);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ if (bufpix != NULL)
+ free (bufpix);
+ return RL2_ERROR;
+}
+
+static int
+get_mono_band_raw_raster_data_common (sqlite3 * handle, rl2CoveragePtr cvg,
+ unsigned int width,
+ unsigned int height, double minx,
+ double miny, double maxx, double maxy,
+ double x_res, double y_res,
+ unsigned char **buffer, int *buf_size,
+ unsigned char mono_band,
+ rl2PixelPtr bgcolor)
+{
+/* attempting to return a buffer containing raw pixels from the DBMS Coverage */
+ rl2PixelPtr no_data = NULL;
+ const char *coverage;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ char *xtiles;
+ char *xxtiles;
+ char *xdata;
+ char *xxdata;
+ char *sql;
+ sqlite3_stmt *stmt_tiles = NULL;
+ sqlite3_stmt *stmt_data = NULL;
+ int ret;
+
+ if (cvg == NULL || handle == NULL)
+ goto error;
+ coverage = rl2_get_coverage_name (cvg);
+ if (coverage == NULL)
+ goto error;
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ goto error;
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (pixel_type != RL2_PIXEL_RGB && pixel_type != RL2_PIXEL_MULTIBAND)
+ goto error;
+ if (sample_type != RL2_SAMPLE_UINT8 && sample_type != RL2_SAMPLE_UINT16)
+ goto error;
+ if (mono_band >= num_bands)
+ goto error;
+
+ if (bgcolor != NULL)
+ {
+ /* using the externally define background color */
+ no_data = bgcolor;
+ goto ok_no_data;
+ }
+
+ ok_no_data:
+ bufpix_size = width * height;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ bufpix_size *= 2;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2_get_mono_band_raw_raster_data: Insufficient Memory !!!\n");
+ goto error;
+ }
+
+/* preparing the "tiles" SQL query */
+ xtiles = sqlite3_mprintf ("%s_tiles", coverage);
+ xxtiles = gaiaDoubleQuotedSql (xtiles);
+ sql =
+ sqlite3_mprintf ("SELECT tile_id, MbrMinX(geometry), MbrMaxY(geometry) "
+ "FROM \"%s\" "
+ "WHERE pyramid_level = ? AND ROWID IN ( "
+ "SELECT ROWID FROM SpatialIndex WHERE f_table_name = %Q "
+ "AND search_frame = BuildMBR(?, ?, ?, ?))", xxtiles,
+ xtiles);
+ sqlite3_free (xtiles);
+ free (xxtiles);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_tiles, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT raw tiles SQL error: %s\n", sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ /* preparing the data SQL query - both ODD and EVEN */
+ xdata = sqlite3_mprintf ("%s_tile_data", coverage);
+ xxdata = gaiaDoubleQuotedSql (xdata);
+ sqlite3_free (xdata);
+ sql = sqlite3_mprintf ("SELECT tile_data_odd, tile_data_even "
+ "FROM \"%s\" WHERE tile_id = ?", xxdata);
+ free (xxdata);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_data, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT raw tiles data(2) SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+/* preparing a raw pixels buffer */
+ void_raw_buffer (bufpix, width, height, sample_type, 1, no_data);
+ if (!load_mono_band_dbms_tiles
+ (handle, stmt_tiles, stmt_data, bufpix, width, height, mono_band,
+ xx_res, yy_res, minx, miny, maxx, maxy, level, scale, no_data))
+ goto error;
+ sqlite3_finalize (stmt_tiles);
+ sqlite3_finalize (stmt_data);
+ *buffer = bufpix;
+ *buf_size = bufpix_size;
+ return RL2_OK;
+
+ error:
+ if (stmt_tiles != NULL)
+ sqlite3_finalize (stmt_tiles);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ if (bufpix != NULL)
+ free (bufpix);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_mono_band_raw_raster_data (sqlite3 * handle, rl2CoveragePtr cvg,
+ unsigned int width,
+ unsigned int height, double minx,
+ double miny, double maxx, double maxy,
+ double x_res, double y_res,
+ unsigned char mono_band,
+ unsigned char **buffer, int *buf_size,
+ rl2PixelPtr no_data)
+{
+/* attempting to return a buffer containing raw pixels from the DBMS Coverage */
+ return get_mono_band_raw_raster_data_common (handle, cvg, width, height,
+ minx, miny, maxx, maxy,
+ x_res, y_res, buffer,
+ buf_size, mono_band, no_data);
+}
+
+RL2_DECLARE int
+rl2_get_raw_raster_data_bgcolor (sqlite3 * handle, rl2CoveragePtr cvg,
+ unsigned int width, unsigned int height,
+ double minx, double miny, double maxx,
+ double maxy, double x_res, double y_res,
+ unsigned char **buffer, int *buf_size,
+ rl2PalettePtr * palette,
+ unsigned char *out_pixel, unsigned char bg_red,
+ unsigned char bg_green, unsigned char bg_blue,
+ rl2RasterStylePtr style,
+ rl2RasterStatisticsPtr stats)
+{
+/* attempting to return a buffer containing raw pixels from the DBMS Coverage + bgcolor */
+ int ret;
+ rl2PixelPtr no_data = NULL;
+ const char *coverage;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ rl2RasterStylePtr xstyle = style;
+
+ if (cvg == NULL || handle == NULL)
+ return RL2_ERROR;
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ return RL2_ERROR;
+ coverage = rl2_get_coverage_name (cvg);
+ if (coverage == NULL)
+ return RL2_ERROR;
+
+ if (pixel_type == RL2_PIXEL_MONOCHROME && *out_pixel == RL2_PIXEL_GRAYSCALE)
+ {
+ /* Pyramid tiles MONOCHROME - Grayscale pixel */
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, bg_red);
+ }
+ else if (pixel_type == RL2_PIXEL_PALETTE && *out_pixel == RL2_PIXEL_RGB)
+ {
+ /* Pyramid tiles PALETTE - RGB pixel */
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_RED_BAND, bg_red);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, bg_green);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, bg_blue);
+ }
+ else if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ /* Monochrome */
+ no_data =
+ rl2_create_pixel (RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1);
+ if (bg_red > 128)
+ rl2_set_pixel_sample_1bit (no_data, 0);
+ else
+ rl2_set_pixel_sample_1bit (no_data, 1);
+ }
+ else if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ /* Palette */
+ int index = -1;
+ rl2PalettePtr palette = rl2_get_dbms_palette (handle, coverage);
+ if (palette != NULL)
+ {
+ /* searching the background color from within the palette */
+ int i;
+ unsigned short num_entries;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+ if (rl2_get_palette_colors
+ (palette, &num_entries, &red, &green, &blue) == RL2_OK)
+ {
+ for (i = 0; i < num_entries; i++)
+ {
+ if (red[i] == bg_red && green[i] == bg_green
+ && blue[i] == bg_blue)
+ {
+ index = i;
+ break;
+ }
+ }
+ free (red);
+ free (green);
+ free (blue);
+ }
+ }
+ if (index < 0)
+ {
+ /* palette color found */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ no_data =
+ rl2_create_pixel (RL2_SAMPLE_1_BIT, RL2_PIXEL_PALETTE,
+ 1);
+ rl2_set_pixel_sample_1bit (no_data,
+ (unsigned char) index);
+ break;
+ case RL2_SAMPLE_2_BIT:
+ no_data =
+ rl2_create_pixel (RL2_SAMPLE_2_BIT, RL2_PIXEL_PALETTE,
+ 1);
+ rl2_set_pixel_sample_2bit (no_data,
+ (unsigned char) index);
+ break;
+ case RL2_SAMPLE_4_BIT:
+ no_data =
+ rl2_create_pixel (RL2_SAMPLE_4_BIT, RL2_PIXEL_PALETTE,
+ 1);
+ rl2_set_pixel_sample_4bit (no_data,
+ (unsigned char) index);
+ break;
+ case RL2_SAMPLE_UINT8:
+ no_data =
+ rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_PALETTE,
+ 1);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_PALETTE_BAND,
+ (unsigned char) index);
+ break;
+
+ };
+ }
+ }
+ else if (pixel_type == RL2_PIXEL_GRAYSCALE)
+ {
+ /* Grayscale */
+ if (sample_type == RL2_SAMPLE_UINT8)
+ {
+ /* 256 levels grayscale */
+ no_data =
+ rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND,
+ bg_red);
+ }
+ else if (sample_type == RL2_SAMPLE_1_BIT)
+ {
+ /* 2 levels grayscale */
+ no_data =
+ rl2_create_pixel (RL2_SAMPLE_1_BIT, RL2_PIXEL_GRAYSCALE, 1);
+ if (bg_red >= 128)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 1);
+ else
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 0);
+ }
+ else if (sample_type == RL2_SAMPLE_2_BIT)
+ {
+ /* 4 levels grayscale */
+ no_data =
+ rl2_create_pixel (RL2_SAMPLE_1_BIT, RL2_PIXEL_GRAYSCALE, 1);
+ if (bg_red >= 192)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 3);
+ else if (bg_red >= 128)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 2);
+ else if (bg_red >= 64)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 1);
+ else
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 0);
+ }
+ else if (sample_type == RL2_SAMPLE_4_BIT)
+ {
+ /* 16 levels grayscale */
+ no_data =
+ rl2_create_pixel (RL2_SAMPLE_1_BIT, RL2_PIXEL_GRAYSCALE, 1);
+ if (bg_red >= 240)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND,
+ 15);
+ else if (bg_red >= 224)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND,
+ 14);
+ else if (bg_red >= 208)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND,
+ 13);
+ else if (bg_red >= 192)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND,
+ 12);
+ else if (bg_red >= 176)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND,
+ 11);
+ else if (bg_red >= 160)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND,
+ 10);
+ else if (bg_red >= 144)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 9);
+ else if (bg_red >= 128)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 8);
+ else if (bg_red >= 112)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 7);
+ else if (bg_red >= 96)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 6);
+ else if (bg_red >= 80)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 5);
+ else if (bg_red >= 64)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 4);
+ else if (bg_red >= 48)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 3);
+ else if (bg_red >= 32)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 2);
+ else if (bg_red >= 16)
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 1);
+ else
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND, 0);
+ }
+ }
+ else if (pixel_type == RL2_PIXEL_RGB)
+ {
+ /* RGB */
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_RED_BAND, bg_red);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, bg_green);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, bg_blue);
+ }
+ if (no_data == NULL)
+ {
+ unsigned char pixel = *out_pixel;
+ if (pixel == RL2_PIXEL_GRAYSCALE && pixel_type == RL2_PIXEL_DATAGRID)
+ {
+ if (has_styled_rgb_colors (style))
+ {
+ /* RGB RasterSymbolizer: promoting to RGB */
+ pixel = RL2_PIXEL_RGB;
+ }
+ }
+ if (pixel == RL2_PIXEL_GRAYSCALE)
+ {
+ /* output Grayscale pixel */
+ no_data =
+ rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GRAYSCALE_BAND,
+ bg_red);
+ }
+ if (pixel == RL2_PIXEL_RGB)
+ {
+ /* output RGB pixel */
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_RED_BAND, bg_red);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, bg_green);
+ rl2_set_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, bg_blue);
+ }
+ }
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ xstyle = NULL;
+ ret =
+ get_raw_raster_data_common (handle, cvg, width, height, minx, miny,
+ maxx, maxy, x_res, y_res, buffer, buf_size,
+ palette, *out_pixel, no_data, xstyle,
+ stats);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ if (*out_pixel == RL2_PIXEL_GRAYSCALE && pixel_type == RL2_PIXEL_DATAGRID)
+ {
+ if (has_styled_rgb_colors (style))
+ {
+ /* RGB RasterSymbolizer: promoting to RGB */
+ *out_pixel = RL2_PIXEL_RGB;
+ }
+ }
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ int ok = 0;
+ if (style != NULL)
+ {
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl->categorize != NULL)
+ {
+ rl2PrivColorMapPointPtr color = stl->categorize->first;
+ while (color != NULL)
+ {
+ if (color->value == 1.0)
+ {
+ ok = 1;
+ red = color->red;
+ green = color->green;
+ blue = color->blue;
+ break;
+ }
+ color = color->next;
+ }
+ }
+ }
+ if (*out_pixel != RL2_PIXEL_MONOCHROME)
+ {
+ int i;
+ unsigned char *p = *buffer;
+ for (i = 0; i < *buf_size; i++)
+ {
+ if (*p > 224)
+ *p = 255;
+ p++;
+ }
+ if (ok == 1)
+ ok = 2;
+ }
+ if (ok == 1)
+ {
+ /* creating a Palette 0/1 */
+ rl2PalettePtr plt = rl2_create_palette (2);
+ rl2_set_palette_color (plt, 0, 255, 255, 255);
+ rl2_set_palette_color (plt, 1, red, green, blue);
+ *palette = plt;
+ *out_pixel = RL2_PIXEL_PALETTE;
+ }
+ if (ok == 2)
+ {
+ /* creating a Palette 0/255 */
+ int i;
+ double dr = 255.0 - red;
+ double dg = 255.0 - green;
+ double db = 255.0 - blue;
+ rl2PalettePtr plt = rl2_create_palette (256);
+ for (i = 0; i < 256; i++)
+ {
+ double scale = 255.0 / (double) i;
+ double r = (double) red + (dr / scale);
+ double g = (double) green + (dg / scale);
+ double b = (double) blue + (db / scale);
+ if (r < 0.0)
+ r = 0.0;
+ if (r > 255.0)
+ r = 255.0;
+ if (g < 0.0)
+ g = 0.0;
+ if (g > 255.0)
+ g = 255.0;
+ if (b < 0.0)
+ b = 0.0;
+ if (b > 255.0)
+ b = 255.0;
+ rl2_set_palette_color (plt, i, (unsigned char) r,
+ (unsigned char) g,
+ (unsigned char) b);
+ }
+ *palette = plt;
+ *out_pixel = RL2_PIXEL_PALETTE;
+ }
+ }
+
+ return ret;
+}
+
+RL2_DECLARE rl2PalettePtr
+rl2_get_dbms_palette (sqlite3 * handle, const char *coverage)
+{
+/* attempting to retrieve a Coverage's Palette from the DBMS */
+ rl2PalettePtr palette = NULL;
+ char *sql;
+ int ret;
+ sqlite3_stmt *stmt = NULL;
+
+ if (handle == NULL || coverage == NULL)
+ return NULL;
+
+ sql = sqlite3_mprintf ("SELECT palette FROM raster_coverages "
+ "WHERE Lower(coverage_name) = Lower(%Q)", coverage);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ palette = rl2_deserialize_dbms_palette (blob, blob_sz);
+ }
+ }
+ else
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql,
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+
+ if (palette == NULL)
+ goto error;
+ sqlite3_finalize (stmt);
+ return palette;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ return NULL;
+}
+
+RL2_DECLARE int
+rl2_update_dbms_palette (sqlite3 * handle, const char *coverage,
+ rl2PalettePtr palette)
+{
+/* attempting to update a Coverage's Palette into the DBMS */
+ unsigned char sample_type = RL2_SAMPLE_UNKNOWN;
+ unsigned char pixel_type = RL2_PIXEL_UNKNOWN;
+ unsigned short num_entries;
+ unsigned char *blob;
+ int blob_size;
+ sqlite3_stmt *stmt = NULL;
+ char *sql;
+ int ret;
+ if (handle == NULL || coverage == NULL || palette == NULL)
+ return RL2_ERROR;
+
+ sql =
+ sqlite3_mprintf ("SELECT sample_type, pixel_type FROM raster_coverages "
+ "WHERE Lower(coverage_name) = Lower(%Q)", coverage);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const char *sample =
+ (const char *) sqlite3_column_text (stmt, 0);
+ const char *pixel =
+ (const char *) sqlite3_column_text (stmt, 1);
+ if (strcmp (sample, "1-BIT") == 0)
+ sample_type = RL2_SAMPLE_1_BIT;
+ if (strcmp (sample, "2-BIT") == 0)
+ sample_type = RL2_SAMPLE_2_BIT;
+ if (strcmp (sample, "4-BIT") == 0)
+ sample_type = RL2_SAMPLE_4_BIT;
+ if (strcmp (sample, "UINT8") == 0)
+ sample_type = RL2_SAMPLE_UINT8;
+ if (strcmp (pixel, "PALETTE") == 0)
+ pixel_type = RL2_PIXEL_PALETTE;
+ }
+ else
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql,
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ stmt = NULL;
+
+/* testing for self-consistency */
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ goto error;
+ if (rl2_get_palette_entries (palette, &num_entries) != RL2_OK)
+ goto error;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ if (num_entries > 256)
+ goto error;
+ break;
+ case RL2_SAMPLE_1_BIT:
+ if (num_entries > 2)
+ goto error;
+ break;
+ case RL2_SAMPLE_2_BIT:
+ if (num_entries > 4)
+ goto error;
+ break;
+ case RL2_SAMPLE_4_BIT:
+ if (num_entries > 16)
+ goto error;
+ break;
+ default:
+ goto error;
+ };
+
+ if (rl2_serialize_dbms_palette (palette, &blob, &blob_size) != RL2_OK)
+ goto error;
+ sql = sqlite3_mprintf ("UPDATE raster_coverages SET palette = ? "
+ "WHERE Lower(coverage_name) = Lower(%Q)", coverage);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_blob (stmt, 1, blob, blob_size, free);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ sqlite3_finalize (stmt);
+ return RL2_OK;
+ }
+ fprintf (stderr,
+ "sqlite3_step() error: UPDATE raster_coverages \"%s\"\n",
+ sqlite3_errmsg (handle));
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ return RL2_ERROR;
+}
+
+static void
+set_remapped_palette (rl2PrivTiffOriginPtr origin, rl2PalettePtr palette)
+{
+/* installing a remapped Palette into the TIFF origin */
+ int j;
+ rl2PrivPaletteEntryPtr entry;
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) palette;
+
+ if (plt->nEntries != origin->remapMaxPalette)
+ {
+ /* reallocating the remapped palette */
+ if (origin->remapRed != NULL)
+ free (origin->remapRed);
+ if (origin->remapGreen != NULL)
+ free (origin->remapGreen);
+ if (origin->remapBlue != NULL)
+ free (origin->remapBlue);
+ origin->remapMaxPalette = plt->nEntries;
+ origin->remapRed = malloc (origin->remapMaxPalette);
+ origin->remapGreen = malloc (origin->remapMaxPalette);
+ origin->remapBlue = malloc (origin->remapMaxPalette);
+ }
+ for (j = 0; j < plt->nEntries; j++)
+ {
+ entry = plt->entries + j;
+ origin->remapRed[j] = entry->red;
+ origin->remapGreen[j] = entry->green;
+ origin->remapBlue[j] = entry->blue;
+ }
+}
+
+RL2_DECLARE int
+rl2_check_dbms_palette (sqlite3 * handle, rl2CoveragePtr coverage,
+ rl2TiffOriginPtr tiff)
+{
+/*attempting to merge/update a Coverage's Palette */
+ int i;
+ int j;
+ int changed = 0;
+ int maxPalette = 0;
+ unsigned char red[256];
+ unsigned char green[256];
+ unsigned char blue[256];
+ int ok;
+ rl2PalettePtr palette = NULL;
+ rl2PrivPaletteEntryPtr entry;
+ rl2PrivPalettePtr plt;
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) coverage;
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (cvg == NULL || origin == NULL)
+ return RL2_ERROR;
+ palette = rl2_get_dbms_palette (handle, cvg->coverageName);
+ if (palette == NULL)
+ goto error;
+ plt = (rl2PrivPalettePtr) palette;
+ for (j = 0; j < plt->nEntries; j++)
+ {
+ entry = plt->entries + j;
+ ok = 0;
+ for (i = 0; i < maxPalette; i++)
+ {
+ if (red[i] == entry->red && green[i] == entry->green
+ && blue[i] == entry->blue)
+ {
+ ok = 1;
+ break;
+ }
+ }
+ if (ok)
+ continue;
+ if (maxPalette == 256)
+ goto error;
+ red[maxPalette] = entry->red;
+ green[maxPalette] = entry->green;
+ blue[maxPalette] = entry->blue;
+ maxPalette++;
+ }
+
+ for (i = 0; i < origin->maxPalette; i++)
+ {
+ /* checking TIFF palette entries */
+ unsigned char tiff_red = origin->red[i];
+ unsigned char tiff_green = origin->green[i];
+ unsigned char tiff_blue = origin->blue[i];
+ ok = 0;
+ for (j = 0; j < maxPalette; j++)
+ {
+ if (tiff_red == red[j] && tiff_green == green[j]
+ && tiff_blue == blue[j])
+ {
+ /* found a matching color */
+ ok = 1;
+ break;
+ }
+ }
+ if (!ok)
+ {
+ /* attempting to insert a new color into the pseudo-Palette */
+ if (maxPalette == 256)
+ goto error;
+ red[maxPalette] = tiff_red;
+ green[maxPalette] = tiff_green;
+ blue[maxPalette] = tiff_blue;
+ maxPalette++;
+ changed = 1;
+ }
+ }
+ if (changed)
+ {
+ /* updating the DBMS Palette */
+ rl2PalettePtr plt2 = rl2_create_palette (maxPalette);
+ if (plt2 == NULL)
+ goto error;
+ rl2_destroy_palette (palette);
+ palette = plt2;
+ for (j = 0; j < maxPalette; j++)
+ rl2_set_palette_color (palette, j, red[j], green[j], blue[j]);
+ if (rl2_update_dbms_palette (handle, cvg->coverageName, palette) !=
+ RL2_OK)
+ goto error;
+ }
+ set_remapped_palette (origin, palette);
+ rl2_destroy_palette (palette);
+ return RL2_OK;
+
+ error:
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_update_dbms_coverage (sqlite3 * handle, const char *coverage)
+{
+/*attempting to update a Coverage (statistics and extent) */
+ int ret;
+ char *sql;
+ char *xtable;
+ char *xxtable;
+ rl2RasterStatisticsPtr coverage_stats = NULL;
+ unsigned char *blob_stats;
+ int blob_stats_sz;
+ int first;
+ sqlite3_stmt *stmt_ext_in = NULL;
+ sqlite3_stmt *stmt_ext_out = NULL;
+ sqlite3_stmt *stmt_stats_in = NULL;
+ sqlite3_stmt *stmt_stats_out = NULL;
+
+/* Extent query stmt */
+ xtable = sqlite3_mprintf ("%s_sections", coverage);
+ xxtable = gaiaDoubleQuotedSql (xtable);
+ sqlite3_free (xtable);
+ sql =
+ sqlite3_mprintf
+ ("SELECT Min(MbrMinX(geometry)), Min(MbrMinY(geometry)), "
+ "Max(MbrMaxX(geometry)), Max(MbrMaxY(geometry)) " "FROM \"%s\"",
+ xxtable);
+ free (xxtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_ext_in, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT Coverage extent SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+/* Extent update stmt */
+ sql = sqlite3_mprintf ("UPDATE raster_coverages SET extent_minx = ?, "
+ "extent_miny = ?, extent_maxx = ?, extent_maxy = ? "
+ "WHERE Lower(coverage_name) = Lower(%Q)", coverage);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_ext_out, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("UPDATE Coverage extent SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ while (1)
+ {
+ /* querying the extent */
+ ret = sqlite3_step (stmt_ext_in);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ double minx = sqlite3_column_double (stmt_ext_in, 0);
+ double miny = sqlite3_column_double (stmt_ext_in, 1);
+ double maxx = sqlite3_column_double (stmt_ext_in, 2);
+ double maxy = sqlite3_column_double (stmt_ext_in, 3);
+
+ /* updating the extent */
+ sqlite3_reset (stmt_ext_out);
+ sqlite3_clear_bindings (stmt_ext_out);
+ sqlite3_bind_double (stmt_ext_out, 1, minx);
+ sqlite3_bind_double (stmt_ext_out, 2, miny);
+ sqlite3_bind_double (stmt_ext_out, 3, maxx);
+ sqlite3_bind_double (stmt_ext_out, 4, maxy);
+ ret = sqlite3_step (stmt_ext_out);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ break;
+ else
+ {
+ fprintf (stderr,
+ "UPDATE Coverage Extent sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT Coverage Extent sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+
+ sqlite3_finalize (stmt_ext_in);
+ sqlite3_finalize (stmt_ext_out);
+ stmt_ext_in = NULL;
+ stmt_ext_out = NULL;
+
+/* Raster Statistics query stmt */
+ xtable = sqlite3_mprintf ("%s_sections", coverage);
+ xxtable = gaiaDoubleQuotedSql (xtable);
+ sqlite3_free (xtable);
+ sql = sqlite3_mprintf ("SELECT statistics FROM \"%s\"", xxtable);
+ free (xxtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_stats_in, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT Coverage Statistics SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+/* Raster Statistics update stmt */
+ sql = sqlite3_mprintf ("UPDATE raster_coverages SET statistics = ? "
+ "WHERE Lower(coverage_name) = Lower(%Q)", coverage);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_stats_out, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("UPDATE Coverage Statistics SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ first = 1;
+ while (1)
+ {
+ /* querying the statistics */
+ ret = sqlite3_step (stmt_stats_in);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ rl2RasterStatisticsPtr stats;
+ blob_stats =
+ (unsigned char *) sqlite3_column_blob (stmt_stats_in, 0);
+ blob_stats_sz = sqlite3_column_bytes (stmt_stats_in, 0);
+ stats =
+ rl2_deserialize_dbms_raster_statistics (blob_stats,
+ blob_stats_sz);
+ if (stats == NULL)
+ goto error;
+
+ if (first)
+ {
+ double no_data;
+ double count;
+ unsigned char sample_type;
+ unsigned char num_bands;
+ if (rl2_get_raster_statistics_summary
+ (stats, &no_data, &count, &sample_type,
+ &num_bands) != RL2_OK)
+ goto error;
+ coverage_stats =
+ rl2_create_raster_statistics (sample_type, num_bands);
+ if (coverage_stats == NULL)
+ goto error;
+ first = 0;
+ }
+
+ rl2_aggregate_raster_statistics (stats, coverage_stats);
+ rl2_destroy_raster_statistics (stats);
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT Coverage Statistics sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ if (coverage_stats == NULL)
+ goto error;
+
+ /* updating the statistics */
+ compute_aggregate_sq_diff (coverage_stats);
+ sqlite3_reset (stmt_stats_out);
+ sqlite3_clear_bindings (stmt_stats_out);
+ rl2_serialize_dbms_raster_statistics (coverage_stats, &blob_stats,
+ &blob_stats_sz);
+ sqlite3_bind_blob (stmt_stats_out, 1, blob_stats, blob_stats_sz, free);
+ ret = sqlite3_step (stmt_stats_out);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "UPDATE Coverage Statistics sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ sqlite3_finalize (stmt_stats_in);
+ sqlite3_finalize (stmt_stats_out);
+ rl2_destroy_raster_statistics (coverage_stats);
+ return RL2_OK;
+
+ error:
+ if (stmt_ext_in != NULL)
+ sqlite3_finalize (stmt_ext_in);
+ if (stmt_ext_out != NULL)
+ sqlite3_finalize (stmt_ext_out);
+ if (stmt_stats_in != NULL)
+ sqlite3_finalize (stmt_stats_in);
+ if (stmt_stats_out != NULL)
+ sqlite3_finalize (stmt_stats_out);
+ if (coverage_stats != NULL)
+ rl2_destroy_raster_statistics (coverage_stats);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE rl2RasterStylePtr
+rl2_create_raster_style_from_dbms (sqlite3 * handle, const char *coverage,
+ const char *style)
+{
+/* attempting to load and parse a RasterSymbolizer style */
+ const char *sql;
+ int ret;
+ sqlite3_stmt *stmt = NULL;
+ rl2RasterStylePtr stl = NULL;
+ char *name = NULL;
+ char *title = NULL;
+ char *abstract = NULL;
+ unsigned char *xml = NULL;
+
+ sql = "SELECT style_name, XB_GetTitle(style), XB_GetAbstract(style), "
+ "XB_GetDocument(style) FROM SE_raster_styled_layers "
+ "WHERE Lower(coverage_name) = Lower(?) AND Lower(style_name) = Lower(?)";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, style, strlen (style), SQLITE_STATIC);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ int len;
+ const char *str;
+ const unsigned char *ustr;
+ if (sqlite3_column_type (stmt, 0) == SQLITE_TEXT)
+ {
+ str = (const char *) sqlite3_column_text (stmt, 0);
+ len = strlen (str);
+ name = malloc (len + 1);
+ strcpy (name, str);
+ }
+ if (sqlite3_column_type (stmt, 1) == SQLITE_TEXT)
+ {
+ str = (const char *) sqlite3_column_text (stmt, 1);
+ len = strlen (str);
+ title = malloc (len + 1);
+ strcpy (title, str);
+ }
+ if (sqlite3_column_type (stmt, 2) == SQLITE_TEXT)
+ {
+ str = (const char *) sqlite3_column_text (stmt, 2);
+ len = strlen (str);
+ abstract = malloc (len + 1);
+ strcpy (abstract, str);
+ }
+ if (sqlite3_column_type (stmt, 3) == SQLITE_TEXT)
+ {
+ ustr = sqlite3_column_text (stmt, 3);
+ len = strlen ((const char *) ustr);
+ xml = malloc (len + 1);
+ strcpy ((char *) xml, (const char *) ustr);
+ }
+ }
+ else
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql,
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ stmt = NULL;
+
+ if (name == NULL || xml == NULL)
+ {
+ if (name != NULL)
+ free (name);
+ if (title != NULL)
+ free (title);
+ if (abstract != NULL)
+ free (abstract);
+ if (xml != NULL)
+ free (xml);
+ goto error;
+ }
+ stl = raster_style_from_sld_se_xml (name, title, abstract, xml);
+ if (stl == NULL)
+ goto error;
+ return stl;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (stl != NULL)
+ rl2_destroy_raster_style (stl);
+ return NULL;
+}
+
+static int
+test_named_layer (sqlite3 * handle, const char *groupName,
+ const char *namedLayer)
+{
+/* testing a Named Layer for validity */
+ int ret;
+ char **results;
+ int rows;
+ int columns;
+ int i;
+ int ok = 0;
+/* testing if the Raster Coverage exists */
+ char *sql = sqlite3_mprintf ("SELECT coverage_name FROM raster_coverages "
+ "WHERE Lower(coverage_name) = Lower(%Q)",
+ namedLayer);
+ ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ for (i = 1; i <= rows; i++)
+ ok = 1;
+ sqlite3_free_table (results);
+ if (!ok)
+ return 0;
+
+ ok = 0;
+/* testing if the Raster Coverage belong to the Layer Group */
+ sql = sqlite3_mprintf ("SELECT coverage_name FROM SE_styled_group_refs "
+ "WHERE Lower(group_name) = Lower(%Q) AND "
+ "Lower(coverage_name) = Lower(%Q)", groupName,
+ namedLayer);
+ ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ for (i = 1; i <= rows; i++)
+ ok = 1;
+ sqlite3_free_table (results);
+ return ok;
+}
+
+static int
+test_named_style (sqlite3 * handle, const char *namedLayer,
+ const char *namedStyle)
+{
+/* testing a Named Style for validity */
+ int ret;
+ char **results;
+ int rows;
+ int columns;
+ int i;
+ int ok = 0;
+/* testing if the Layer Style exists */
+ char *sql =
+ sqlite3_mprintf ("SELECT style_name FROM SE_raster_styled_layers "
+ "WHERE Lower(coverage_name) = Lower(%Q) AND "
+ "Lower(style_name) = Lower(%Q)", namedLayer,
+ namedStyle);
+ ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ for (i = 1; i <= rows; i++)
+ ok = 1;
+ sqlite3_free_table (results);
+ return ok;
+}
+
+RL2_DECLARE rl2GroupStylePtr
+rl2_create_group_style_from_dbms (sqlite3 * handle, const char *group,
+ const char *style)
+{
+/* attempting to load and parse a Layer Group style */
+ const char *sql;
+ int ret;
+ sqlite3_stmt *stmt = NULL;
+ rl2GroupStylePtr stl = NULL;
+ char *name = NULL;
+ char *title = NULL;
+ char *abstract = NULL;
+ unsigned char *xml = NULL;
+ rl2PrivGroupStylePtr grp_stl;
+ rl2PrivChildStylePtr child;
+
+ sql = "SELECT style_name, XB_GetTitle(style), XB_GetAbstract(style), "
+ "XB_GetDocument(style) FROM SE_group_styles "
+ "WHERE Lower(group_name) = Lower(?) AND Lower(style_name) = Lower(?)";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, group, strlen (group), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, style, strlen (style), SQLITE_STATIC);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ int len;
+ const char *str;
+ const unsigned char *ustr;
+ if (sqlite3_column_type (stmt, 0) == SQLITE_TEXT)
+ {
+ str = (const char *) sqlite3_column_text (stmt, 0);
+ len = strlen (str);
+ name = malloc (len + 1);
+ strcpy (name, str);
+ }
+ if (sqlite3_column_type (stmt, 1) == SQLITE_TEXT)
+ {
+ str = (const char *) sqlite3_column_text (stmt, 1);
+ len = strlen (str);
+ title = malloc (len + 1);
+ strcpy (title, str);
+ }
+ if (sqlite3_column_type (stmt, 2) == SQLITE_TEXT)
+ {
+ str = (const char *) sqlite3_column_text (stmt, 2);
+ len = strlen (str);
+ abstract = malloc (len + 1);
+ strcpy (abstract, str);
+ }
+ if (sqlite3_column_type (stmt, 3) == SQLITE_TEXT)
+ {
+ ustr = sqlite3_column_text (stmt, 3);
+ len = strlen ((const char *) ustr);
+ xml = malloc (len + 1);
+ strcpy ((char *) xml, (const char *) ustr);
+ }
+ }
+ else
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql,
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ stmt = NULL;
+
+ if (name == NULL || xml == NULL)
+ {
+ if (name != NULL)
+ free (name);
+ if (title != NULL)
+ free (title);
+ if (abstract != NULL)
+ free (abstract);
+ if (xml != NULL)
+ free (xml);
+ goto error;
+ }
+
+/* final validation */
+ stl = group_style_from_sld_xml (name, title, abstract, xml);
+ if (stl == NULL)
+ goto error;
+ grp_stl = (rl2PrivGroupStylePtr) stl;
+ child = grp_stl->first;
+ while (child != NULL)
+ {
+ /* testing NamedLayers and NamedStyles */
+ if (child->namedLayer != NULL)
+ {
+ if (test_named_layer (handle, group, child->namedLayer))
+ child->validLayer = 1;
+ }
+ if (child->validLayer == 1)
+ {
+ if (child->namedStyle != NULL)
+ {
+ if (strcmp (child->namedStyle, "default") == 0)
+ child->validStyle = 1;
+ else if (test_named_style
+ (handle, child->namedLayer, child->namedStyle))
+ child->validStyle = 1;
+ }
+ else
+ child->validStyle = 1;
+ }
+ child = child->next;
+ }
+ grp_stl->valid = 1;
+ child = grp_stl->first;
+ while (child != NULL)
+ {
+ if (child->validLayer == 0 || child->validStyle == 0)
+ grp_stl->valid = 0;
+ child = child->next;
+ }
+
+ return stl;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (stl != NULL)
+ rl2_destroy_group_style (stl);
+ return NULL;
+}
+
+RL2_DECLARE rl2RasterStatisticsPtr
+rl2_create_raster_statistics_from_dbms (sqlite3 * handle, const char *coverage)
+{
+/* attempting to load a Covrage's RasterStatistics object */
+ const char *sql;
+ int ret;
+ sqlite3_stmt *stmt = NULL;
+ rl2RasterStatisticsPtr stats = NULL;
+
+ sql = "SELECT statistics FROM raster_coverages "
+ "WHERE Lower(coverage_name) = Lower(?)";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ stats =
+ rl2_deserialize_dbms_raster_statistics (blob,
+ blob_sz);
+ }
+ }
+ else
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql,
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return stats;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ return NULL;
+}
diff --git a/src/rl2gif.c b/src/rl2gif.c
new file mode 100644
index 0000000..e6b4727
--- /dev/null
+++ b/src/rl2gif.c
@@ -0,0 +1,828 @@
+/*
+
+ rl2gif -- GIF related functions
+
+ version 0.1, 2013 April 5
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <gif_lib.h>
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2_private.h"
+
+struct gif_memory_buffer
+{
+ unsigned char *buffer;
+ size_t size;
+ size_t off;
+};
+
+static int
+readGif (GifFileType * gif, GifByteType * buf, int len)
+{
+ struct gif_memory_buffer *p = gif->UserData;
+ size_t rd = len;
+ if (p->off + len > p->size)
+ rd = p->size - p->off;
+ if (rd != 0)
+ {
+ /* copy bytes into buffer */
+ memcpy (buf, p->buffer + p->off, rd);
+ p->off += rd;
+ }
+ return rd;
+}
+
+static int
+writeGif (GifFileType * gif, const GifByteType * buf, int len)
+{
+ struct gif_memory_buffer *p = gif->UserData;
+ size_t nsize = p->size + len;
+
+ /* allocate or grow buffer */
+ if (p->buffer)
+ p->buffer = realloc (p->buffer, nsize);
+ else
+ p->buffer = malloc (nsize);
+
+ if (!p->buffer)
+ return 0;
+
+ /* copy new bytes to end of buffer */
+ memcpy (p->buffer + p->size, buf, len);
+ p->size += len;
+ return len;
+}
+
+static void
+print_gif_error (int ErrorCode)
+{
+ const char *Err = NULL;
+#ifdef GIFLIB_MAJOR
+ Err = GifErrorString (ErrorCode);
+#endif
+ if (Err != NULL)
+ fprintf (stderr, "GIF error: %d \"%s\"\n", ErrorCode, Err);
+ else
+ fprintf (stderr, "GIF error: %d\n", ErrorCode);
+}
+
+static int
+check_gif_compatibility (unsigned char sample_type, unsigned char pixel_type,
+ unsigned char num_bands)
+{
+/* checks for GIF compatibility */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_PALETTE:
+ case RL2_PIXEL_GRAYSCALE:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_bands != 1)
+ return RL2_ERROR;
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ }
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ }
+ if (pixel_type == RL2_PIXEL_GRAYSCALE)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ }
+ return RL2_OK;
+}
+
+static int
+compress_gif (rl2RasterPtr rst, unsigned char **gif, int *gif_size)
+{
+/* attempting to create a GIF compressed image */
+ rl2PrivRasterPtr raster = (rl2PrivRasterPtr) rst;
+ rl2PalettePtr plt;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_samples;
+ unsigned char *blob;
+ int blob_size;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (rl2_get_raster_type (rst, &sample_type, &pixel_type, &num_samples) !=
+ RL2_OK)
+ return RL2_ERROR;
+ if (check_gif_compatibility (sample_type, pixel_type, num_samples) !=
+ RL2_OK)
+ return RL2_ERROR;
+ plt = rl2_get_raster_palette (rst);
+ if (rl2_data_to_gif
+ (raster->rasterBuffer, plt, raster->width,
+ raster->height, sample_type, pixel_type, &blob, &blob_size) != RL2_OK)
+ return RL2_ERROR;
+ *gif = blob;
+ *gif_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_PRIVATE int
+rl2_data_to_gif (const unsigned char *pixels, rl2PalettePtr plt,
+ unsigned int width, unsigned int height,
+ unsigned char sample_type, unsigned char pixel_type,
+ unsigned char **gif, int *gif_size)
+{
+/* attempting to create a GIF compressed image */
+ struct gif_memory_buffer membuf;
+ GifPixelType *ScanLine = NULL;
+ GifFileType *GifFile = NULL;
+#ifdef GIFLIB_MAJOR
+ int ErrorCode;
+#endif
+ ColorMapObject *ColorMap = NULL;
+ int i;
+ unsigned int row;
+ unsigned int col;
+ const unsigned char *p_data;
+ rl2PrivPalettePtr palette = (rl2PrivPalettePtr) plt;
+ int max_palette;
+
+ *gif = NULL;
+ *gif_size = 0;
+ membuf.buffer = NULL;
+ membuf.size = 0;
+ membuf.off = 0;
+
+/* allocating the GIF scanline */
+ if ((ScanLine =
+ (GifPixelType *) malloc (sizeof (GifPixelType) * width)) == NULL)
+ {
+ fprintf (stderr, "Failed to allocate GIF scan line, aborted.\n");
+ return RL2_ERROR;
+ }
+
+/* opening the GIF */
+#ifdef GIFLIB_MAJOR
+ GifFile = EGifOpen (&membuf, writeGif, &ErrorCode);
+#else
+ GifFile = EGifOpen (&membuf, writeGif);
+#endif
+ if (GifFile == NULL)
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (ErrorCode);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ goto error;
+ }
+
+/* preparing a GIF Palette object */
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+#ifdef GIFLIB_MAJOR
+ ColorMap = GifMakeMapObject (2, NULL);
+#else
+ ColorMap = MakeMapObject (2, NULL);
+#endif
+ if (ColorMap == NULL)
+ goto error;
+ ColorMap->BitsPerPixel = 1;
+ ColorMap->Colors[0].Red = 255;
+ ColorMap->Colors[0].Green = 255;
+ ColorMap->Colors[0].Blue = 255;
+ ColorMap->Colors[1].Red = 0;
+ ColorMap->Colors[1].Green = 0;
+ ColorMap->Colors[1].Blue = 0;
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_2_BIT:
+#ifdef GIFLIB_MAJOR
+ ColorMap = GifMakeMapObject (4, NULL);
+#else
+ ColorMap = MakeMapObject (4, NULL);
+#endif
+ if (ColorMap == NULL)
+ goto error;
+ ColorMap->Colors[0].Red = 0;
+ ColorMap->Colors[0].Green = 0;
+ ColorMap->Colors[0].Blue = 0;
+ ColorMap->Colors[1].Red = 86;
+ ColorMap->Colors[1].Green = 86;
+ ColorMap->Colors[1].Blue = 86;
+ ColorMap->Colors[2].Red = 170;
+ ColorMap->Colors[2].Green = 170;
+ ColorMap->Colors[2].Blue = 170;
+ ColorMap->Colors[3].Red = 255;
+ ColorMap->Colors[3].Green = 255;
+ ColorMap->Colors[3].Blue = 255;
+ break;
+ case RL2_SAMPLE_4_BIT:
+#ifdef GIFLIB_MAJOR
+ ColorMap = GifMakeMapObject (16, NULL);
+#else
+ ColorMap = MakeMapObject (16, NULL);
+#endif
+ if (ColorMap == NULL)
+ goto error;
+ ColorMap->Colors[0].Red = 0;
+ ColorMap->Colors[0].Green = 0;
+ ColorMap->Colors[0].Blue = 0;
+ ColorMap->Colors[1].Red = 17;
+ ColorMap->Colors[1].Green = 17;
+ ColorMap->Colors[1].Blue = 17;
+ ColorMap->Colors[2].Red = 34;
+ ColorMap->Colors[2].Green = 34;
+ ColorMap->Colors[2].Blue = 34;
+ ColorMap->Colors[3].Red = 51;
+ ColorMap->Colors[3].Green = 51;
+ ColorMap->Colors[3].Blue = 51;
+ ColorMap->Colors[4].Red = 68;
+ ColorMap->Colors[4].Green = 68;
+ ColorMap->Colors[4].Blue = 68;
+ ColorMap->Colors[5].Red = 85;
+ ColorMap->Colors[5].Green = 85;
+ ColorMap->Colors[5].Blue = 85;
+ ColorMap->Colors[6].Red = 102;
+ ColorMap->Colors[6].Green = 102;
+ ColorMap->Colors[6].Blue = 102;
+ ColorMap->Colors[7].Red = 119;
+ ColorMap->Colors[7].Green = 119;
+ ColorMap->Colors[7].Blue = 119;
+ ColorMap->Colors[8].Red = 137;
+ ColorMap->Colors[8].Green = 137;
+ ColorMap->Colors[8].Blue = 137;
+ ColorMap->Colors[9].Red = 154;
+ ColorMap->Colors[9].Green = 154;
+ ColorMap->Colors[9].Blue = 154;
+ ColorMap->Colors[10].Red = 171;
+ ColorMap->Colors[10].Green = 171;
+ ColorMap->Colors[10].Blue = 171;
+ ColorMap->Colors[11].Red = 188;
+ ColorMap->Colors[11].Green = 188;
+ ColorMap->Colors[11].Blue = 188;
+ ColorMap->Colors[12].Red = 205;
+ ColorMap->Colors[12].Green = 205;
+ ColorMap->Colors[12].Blue = 205;
+ ColorMap->Colors[13].Red = 222;
+ ColorMap->Colors[13].Green = 222;
+ ColorMap->Colors[13].Blue = 222;
+ ColorMap->Colors[14].Red = 239;
+ ColorMap->Colors[14].Green = 239;
+ ColorMap->Colors[14].Blue = 239;
+ ColorMap->Colors[15].Red = 255;
+ ColorMap->Colors[15].Green = 255;
+ ColorMap->Colors[15].Blue = 255;
+ break;
+ case RL2_SAMPLE_UINT8:
+#ifdef GIFLIB_MAJOR
+ ColorMap = GifMakeMapObject (256, NULL);
+#else
+ ColorMap = MakeMapObject (256, NULL);
+#endif
+ if (ColorMap == NULL)
+ goto error;
+ for (i = 0; i < 256; i++)
+ {
+ ColorMap->Colors[i].Red = i;
+ ColorMap->Colors[i].Green = i;
+ ColorMap->Colors[i].Blue = i;
+ }
+ break;
+ };
+ break;
+ case RL2_PIXEL_PALETTE:
+ if (palette == NULL)
+ goto error;
+ /* a GIF palette should must containt a power of 2 #entries */
+ if (palette->nEntries <= 2)
+ max_palette = 2;
+ else if (palette->nEntries <= 4)
+ max_palette = 4;
+ else if (palette->nEntries <= 8)
+ max_palette = 8;
+ else if (palette->nEntries <= 16)
+ max_palette = 16;
+ else if (palette->nEntries <= 32)
+ max_palette = 32;
+ else if (palette->nEntries <= 64)
+ max_palette = 64;
+ else if (palette->nEntries <= 128)
+ max_palette = 128;
+ else
+ max_palette = 256;
+#ifdef GIFLIB_MAJOR
+ ColorMap = GifMakeMapObject (max_palette, NULL);
+#else
+ ColorMap = MakeMapObject (max_palette, NULL);
+#endif
+ if (ColorMap == NULL)
+ goto error;
+ for (i = 0; i < max_palette; i++)
+ {
+ /* filling the palette with the latest entry */
+ rl2PrivPaletteEntryPtr entry =
+ palette->entries + (palette->nEntries - 1);
+ ColorMap->Colors[i].Red = entry->red;
+ ColorMap->Colors[i].Green = entry->green;
+ ColorMap->Colors[i].Blue = entry->blue;
+ }
+ for (i = 0; i < palette->nEntries; i++)
+ {
+ /* effective palette entries */
+ rl2PrivPaletteEntryPtr entry = palette->entries + i;
+ ColorMap->Colors[i].Red = entry->red;
+ ColorMap->Colors[i].Green = entry->green;
+ ColorMap->Colors[i].Blue = entry->blue;
+ }
+ break;
+ };
+
+/* GIF headers */
+ if (EGifPutScreenDesc
+ (GifFile, width, height, ColorMap->BitsPerPixel, 0,
+ ColorMap) == GIF_ERROR)
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (ErrorCode);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ goto error;
+ }
+ if (EGifPutImageDesc (GifFile, 0, 0, width, height, 0, NULL) == GIF_ERROR)
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (ErrorCode);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ goto error;
+ }
+
+/* compressing GIF pixels */
+ p_data = pixels;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ ScanLine[col] = *p_data++;
+ if (EGifPutLine (GifFile, ScanLine, width) == GIF_ERROR)
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (ErrorCode);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ goto error;
+ }
+ }
+
+/* closing the GIF */
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+ if (EGifCloseFile (GifFile, NULL) == GIF_ERROR)
+#else
+ if (EGifCloseFile (GifFile) == GIF_ERROR)
+#endif
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (ErrorCode);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ goto error;
+ }
+
+ free (ScanLine);
+#ifdef GIFLIB_MAJOR
+ GifFreeMapObject (ColorMap);
+#else
+ FreeMapObject (ColorMap);
+#endif
+ *gif = membuf.buffer;
+ *gif_size = membuf.size;
+ return RL2_OK;
+ error:
+ if (GifFile != NULL)
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+ EGifCloseFile (GifFile, NULL);
+#else
+ EGifCloseFile (GifFile);
+#endif
+ if (ScanLine != NULL)
+ free (ScanLine);
+ if (ColorMap != NULL)
+ {
+#ifdef GIFLIB_MAJOR
+ GifFreeMapObject (ColorMap);
+#else
+ FreeMapObject (ColorMap);
+#endif
+ }
+ if (membuf.buffer != NULL)
+ free (membuf.buffer);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_section_to_gif (rl2SectionPtr scn, const char *path)
+{
+/* attempting to save a raster section into a GIF file */
+ int blob_size;
+ unsigned char *blob;
+ rl2RasterPtr rst;
+ int ret;
+
+ if (scn == NULL)
+ return RL2_ERROR;
+ rst = rl2_get_section_raster (scn);
+ if (rst == NULL)
+ return RL2_ERROR;
+/* attempting to export as a GIF image */
+ if (rl2_raster_to_gif (rst, &blob, &blob_size) != RL2_OK)
+ return RL2_ERROR;
+ ret = rl2_blob_to_file (path, blob, blob_size);
+ free (blob);
+ if (ret != RL2_OK)
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_to_gif (rl2RasterPtr rst, unsigned char **gif, int *gif_size)
+{
+/* creating a GIF image from a raster */
+ unsigned char *blob;
+ int blob_size;
+
+ if (rst == NULL)
+ return RL2_ERROR;
+
+ if (compress_gif (rst, &blob, &blob_size) != RL2_OK)
+ return RL2_ERROR;
+ *gif = blob;
+ *gif_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2SectionPtr
+rl2_section_from_gif (const char *path)
+{
+/* attempting to create a raster section from a GIF file */
+ int blob_size;
+ unsigned char *blob;
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+
+/* attempting to create a raster */
+ if (rl2_blob_from_file (path, &blob, &blob_size) != RL2_OK)
+ return NULL;
+ rst = rl2_raster_from_gif (blob, blob_size);
+ free (blob);
+ if (rst == NULL)
+ return NULL;
+
+/* creating the raster section */
+ scn =
+ rl2_create_section (path, RL2_COMPRESSION_GIF, RL2_TILESIZE_UNDEFINED,
+ RL2_TILESIZE_UNDEFINED, rst);
+ return scn;
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_raster_from_gif (const unsigned char *gif, int gif_size)
+{
+/* attempting to create a raster from a GIF image */
+ rl2RasterPtr rst = NULL;
+ unsigned int width;
+ unsigned int height;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char *data = NULL;
+ int data_size;
+ rl2PalettePtr palette = NULL;
+
+ if (rl2_decode_gif
+ (gif, gif_size, &width, &height, &sample_type, &pixel_type, &data,
+ &data_size, &palette) != RL2_OK)
+ goto error;
+ rst =
+ rl2_create_raster (width, height, sample_type, pixel_type, 1, data,
+ data_size, palette, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+ return rst;
+
+ error:
+ if (data != NULL)
+ free (data);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return NULL;
+}
+
+RL2_PRIVATE int
+rl2_decode_gif (const unsigned char *gif, int gif_size, unsigned int *xwidth,
+ unsigned int *xheight, unsigned char *xsample_type,
+ unsigned char *xpixel_type, unsigned char **blob, int *blob_sz,
+ rl2PalettePtr * palette)
+{
+/* attempting to create a raster from a GIF image - raw block */
+ struct gif_memory_buffer membuf;
+#ifdef GIFLIB_MAJOR
+ int ErrorCode;
+#endif
+ GifFileType *GifFile = NULL;
+ GifPixelType *Line;
+ GifRecordType RecordType;
+ GifByteType *Extension;
+ ColorMapObject *ColorMap;
+ int ExtCode;
+ unsigned int width;
+ unsigned int height;
+ int row;
+ int col;
+ int i;
+ unsigned char sample_type = RL2_SAMPLE_UNKNOWN;
+ unsigned char pixel_type = RL2_PIXEL_PALETTE;
+ unsigned char sample_typ;
+ unsigned char pixel_typ;
+ rl2PalettePtr rl_palette = NULL;
+ int nPalette = 0;
+ unsigned char *data = NULL;
+ unsigned char *p_data;
+ int data_size;
+ int already_done = 0;
+ unsigned char red[256];
+ unsigned char green[256];
+ unsigned char blue[256];
+
+ membuf.buffer = (unsigned char *) gif;
+ membuf.size = gif_size;
+ membuf.off = 0;
+
+/* opening the GIF */
+#ifdef GIFLIB_MAJOR
+ GifFile = DGifOpen (&membuf, readGif, &ErrorCode);
+#else
+ GifFile = DGifOpen (&membuf, readGif);
+#endif
+ if (GifFile == NULL)
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (ErrorCode);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ return RL2_ERROR;
+ }
+
+ do
+ {
+ /* looping on GIF chunks */
+ if (DGifGetRecordType (GifFile, &RecordType) == GIF_ERROR)
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (GifFile->Error);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ goto error;
+ }
+ switch (RecordType)
+ {
+ case IMAGE_DESC_RECORD_TYPE:
+ /* we have a valid image */
+ if (DGifGetImageDesc (GifFile) == GIF_ERROR)
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (GifFile->Error);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ goto error;
+ }
+ if (already_done)
+ {
+ /* if multiple images are found, simply the first one will be imported */
+ break;
+ }
+ /* width and height */
+ width = GifFile->Image.Width;
+ height = GifFile->Image.Height;
+ ColorMap = GifFile->SColorMap;
+ if (ColorMap->BitsPerPixel == 1)
+ sample_type = RL2_SAMPLE_1_BIT;
+ else if (ColorMap->BitsPerPixel == 2)
+ sample_type = RL2_SAMPLE_2_BIT;
+ else if (ColorMap->BitsPerPixel <= 4)
+ sample_type = RL2_SAMPLE_4_BIT;
+ else
+ sample_type = RL2_SAMPLE_UINT8;
+ /* palette */
+ ColorMap = GifFile->SColorMap;
+ if (ColorMap == NULL)
+ goto error;
+ nPalette = ColorMap->ColorCount;
+ rl_palette = rl2_create_palette (nPalette);
+ if (rl_palette == NULL)
+ goto error;
+ for (i = 0; i < nPalette; i++)
+ {
+ red[i] = ColorMap->Colors[i].Red;
+ green[i] = ColorMap->Colors[i].Green;
+ blue[i] = ColorMap->Colors[i].Blue;
+ }
+ /* creating the raster data */
+ data_size = width * height;
+ data = malloc (data_size);
+ if (data == NULL)
+ goto error;
+ p_data = data;
+ Line = (GifPixelType *) malloc (GifFile->Image.Width *
+ sizeof (GifPixelType));
+ for (row = 0; row < GifFile->Image.Height; row++)
+ {
+ if (DGifGetLine (GifFile, Line, GifFile->Image.Width)
+ == GIF_ERROR)
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (GifFile->Error);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ fprintf (stderr, "err GIF %d / %d %d\n", row,
+ GifFile->Image.Height,
+ GifFile->Image.Width);
+ goto error;
+ }
+ for (col = 0; col < GifFile->Image.Width; col++)
+ *p_data++ = Line[col];
+ }
+ free (Line);
+ /* exporting data to be returned */
+ already_done = 1;
+ break;
+ case EXTENSION_RECORD_TYPE:
+ if (DGifGetExtension (GifFile, &ExtCode, &Extension) ==
+ GIF_ERROR)
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (GifFile->Error);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ goto error;
+ }
+ for (;;)
+ {
+ if (DGifGetExtensionNext (GifFile, &Extension) ==
+ GIF_ERROR)
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (GifFile->Error);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ goto error;
+ }
+ if (Extension == NULL)
+ break;
+ }
+ break;
+ case TERMINATE_RECORD_TYPE:
+ break;
+ default: /* Should be trapped by DGifGetRecordType */
+ break;
+ }
+ }
+ while (RecordType != TERMINATE_RECORD_TYPE);
+
+/* closing the GIF */
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+ if (DGifCloseFile (GifFile, NULL) == GIF_ERROR)
+#else
+ if (DGifCloseFile (GifFile) == GIF_ERROR)
+#endif
+ {
+#ifdef GIFLIB_MAJOR
+ print_gif_error (GifFile->Error);
+#else
+ print_gif_error (GifLastError ());
+#endif
+ goto error;
+ }
+ if (already_done)
+ {
+ for (i = 0; i < nPalette; i++)
+ rl2_set_palette_color (rl_palette, i, red[i], green[i], blue[i]);
+ if (rl2_get_palette_type (rl_palette, &sample_typ, &pixel_typ) !=
+ RL2_OK)
+ goto error;
+ *xwidth = width;
+ *xheight = height;
+ *xsample_type = sample_type;
+ *xpixel_type = pixel_type;
+ if (sample_type == sample_typ)
+ *xpixel_type = pixel_typ;
+ *blob = data;
+ *blob_sz = data_size;
+ *palette = rl_palette;
+ return RL2_OK;
+ }
+ error:
+ if (GifFile != NULL)
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+ DGifCloseFile (GifFile, NULL);
+#else
+ DGifCloseFile (GifFile);
+#endif
+ if (rl_palette != NULL)
+ rl2_destroy_palette (rl_palette);
+ if (data != NULL)
+ free (data);
+ *palette = NULL;
+ return RL2_ERROR;
+}
diff --git a/src/rl2import.c b/src/rl2import.c
new file mode 100644
index 0000000..ebf4021
--- /dev/null
+++ b/src/rl2import.c
@@ -0,0 +1,3204 @@
+/*
+
+ rl2import -- DBMS import functions
+
+ version 0.1, 2014 January 9
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#include <sys/types.h>
+#if defined(_WIN32) && !defined(__MINGW32__)
+#include <io.h>
+#include <direct.h>
+#else
+#include <dirent.h>
+#endif
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2tiff.h"
+#include "rasterlite2/rl2graphics.h"
+#include "rasterlite2_private.h"
+
+#include <spatialite/gaiaaux.h>
+
+static char *
+formatFloat (double value)
+{
+/* nicely formatting a float value */
+ int i;
+ int len;
+ char *fmt = sqlite3_mprintf ("%1.24f", value);
+ len = strlen (fmt);
+ for (i = len - 1; i >= 0; i--)
+ {
+ if (fmt[i] == '0')
+ fmt[i] = '\0';
+ else
+ break;
+ }
+ len = strlen (fmt);
+ if (fmt[len - 1] == '.')
+ fmt[len] = '0';
+ return fmt;
+}
+
+static char *
+formatFloat2 (double value)
+{
+/* nicely formatting a float value (2 decimals) */
+ char *fmt = sqlite3_mprintf ("%1.2f", value);
+ return fmt;
+}
+
+static char *
+formatFloat6 (double value)
+{
+/* nicely formatting a float value (6 decimals) */
+ char *fmt = sqlite3_mprintf ("%1.2f", value);
+ return fmt;
+}
+
+static char *
+formatLong (double value)
+{
+/* nicely formatting a Longitude */
+ if (value >= -180.0 && value <= 180.0)
+ return formatFloat6 (value);
+ return formatFloat2 (value);
+}
+
+static char *
+formatLat (double value)
+{
+/* nicely formatting a Latitude */
+ if (value >= -90.0 && value <= 90.0)
+ return formatFloat6 (value);
+ return formatFloat2 (value);
+}
+
+static int
+do_insert_tile (sqlite3 * handle, unsigned char *blob_odd, int blob_odd_sz,
+ unsigned char *blob_even, int blob_even_sz,
+ sqlite3_int64 section_id, int srid, double res_x, double res_y,
+ unsigned int tile_w, unsigned int tile_h, double miny,
+ double maxx, double *tile_minx, double *tile_miny,
+ double *tile_maxx, double *tile_maxy, rl2PalettePtr aux_palette,
+ rl2PixelPtr no_data, sqlite3_stmt * stmt_tils,
+ sqlite3_stmt * stmt_data, rl2RasterStatisticsPtr section_stats)
+{
+/* INSERTing the tile */
+ int ret;
+ sqlite3_int64 tile_id;
+ unsigned char *blob;
+ int blob_size;
+ gaiaGeomCollPtr geom;
+ rl2RasterStatisticsPtr stats = NULL;
+
+ stats = rl2_get_raster_statistics
+ (blob_odd, blob_odd_sz, blob_even, blob_even_sz, aux_palette, no_data);
+ if (stats == NULL)
+ goto error;
+ rl2_aggregate_raster_statistics (stats, section_stats);
+ sqlite3_reset (stmt_tils);
+ sqlite3_clear_bindings (stmt_tils);
+ sqlite3_bind_int64 (stmt_tils, 1, section_id);
+ *tile_maxx = *tile_minx + ((double) tile_w * res_x);
+ if (*tile_maxx > maxx)
+ *tile_maxx = maxx;
+ *tile_miny = *tile_maxy - ((double) tile_h * res_y);
+ if (*tile_miny < miny)
+ *tile_miny = miny;
+ geom = build_extent (srid, *tile_minx, *tile_miny, *tile_maxx, *tile_maxy);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ gaiaFreeGeomColl (geom);
+ sqlite3_bind_blob (stmt_tils, 2, blob, blob_size, free);
+ ret = sqlite3_step (stmt_tils);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "INSERT INTO tiles; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ tile_id = sqlite3_last_insert_rowid (handle);
+ /* INSERTing tile data */
+ sqlite3_reset (stmt_data);
+ sqlite3_clear_bindings (stmt_data);
+ sqlite3_bind_int64 (stmt_data, 1, tile_id);
+ sqlite3_bind_blob (stmt_data, 2, blob_odd, blob_odd_sz, free);
+ if (blob_even == NULL)
+ sqlite3_bind_null (stmt_data, 3);
+ else
+ sqlite3_bind_blob (stmt_data, 3, blob_even, blob_even_sz, free);
+ ret = sqlite3_step (stmt_data);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "INSERT INTO tile_data; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ rl2_destroy_raster_statistics (stats);
+ return 1;
+ error:
+ if (stats != NULL)
+ rl2_destroy_raster_statistics (stats);
+ return 0;
+}
+
+RL2_PRIVATE void
+compute_aggregate_sq_diff (rl2RasterStatisticsPtr section_stats)
+{
+/* updating aggregate sum_sq_diff */
+ int ib;
+ rl2PoolVariancePtr pV;
+ rl2PrivBandStatisticsPtr st_band;
+ rl2PrivRasterStatisticsPtr st = (rl2PrivRasterStatisticsPtr) section_stats;
+ if (st == NULL)
+ return;
+
+ for (ib = 0; ib < st->nBands; ib++)
+ {
+ double sum_var = 0.0;
+ st_band = st->band_stats + ib;
+ pV = st_band->first;
+ while (pV != NULL)
+ {
+ sum_var += (pV->count - 1.0) * pV->variance;
+ pV = pV->next;
+ }
+ st_band->sum_sq_diff = sum_var;
+ }
+}
+
+static int
+do_import_ascii_grid (sqlite3 * handle, const char *src_path,
+ rl2CoveragePtr cvg, const char *section, int srid,
+ unsigned int tile_w, unsigned int tile_h,
+ int pyramidize, unsigned char sample_type,
+ unsigned char compression, sqlite3_stmt * stmt_data,
+ sqlite3_stmt * stmt_tils, sqlite3_stmt * stmt_sect,
+ sqlite3_stmt * stmt_levl, sqlite3_stmt * stmt_upd_sect)
+{
+/* importing an ASCII Data Grid file */
+ int ret;
+ rl2AsciiGridOriginPtr origin = NULL;
+ rl2RasterPtr raster = NULL;
+ rl2RasterStatisticsPtr section_stats = NULL;
+ rl2PixelPtr no_data = NULL;
+ unsigned int row;
+ unsigned int col;
+ unsigned int width;
+ unsigned int height;
+ unsigned char *blob_odd = NULL;
+ unsigned char *blob_even = NULL;
+ int blob_odd_sz;
+ int blob_even_sz;
+ double tile_minx;
+ double tile_miny;
+ double tile_maxx;
+ double tile_maxy;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ double res_x;
+ double res_y;
+ double base_res_x;
+ double base_res_y;
+ char *dumb1;
+ char *dumb2;
+ sqlite3_int64 section_id;
+
+ if (rl2_get_coverage_resolution (cvg, &base_res_x, &base_res_y) != RL2_OK)
+ goto error;
+ origin = rl2_create_ascii_grid_origin (src_path, srid, sample_type);
+ if (origin == NULL)
+ goto error;
+
+ printf ("Importing: %s\n", rl2_get_ascii_grid_origin_path (origin));
+ printf ("------------------\n");
+ ret = rl2_get_ascii_grid_origin_size (origin, &width, &height);
+ if (ret == RL2_OK)
+ printf (" Image Size (pixels): %d x %d\n", width, height);
+ ret = rl2_get_ascii_grid_origin_srid (origin, &srid);
+ if (ret == RL2_OK)
+ printf (" SRID: %d\n", srid);
+ ret = rl2_get_ascii_grid_origin_extent (origin, &minx, &miny, &maxx, &maxy);
+ if (ret == RL2_OK)
+ {
+ dumb1 = formatLong (minx);
+ dumb2 = formatLat (miny);
+ printf (" LowerLeft Corner: X=%s Y=%s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ dumb1 = formatLong (maxx);
+ dumb2 = formatLat (maxy);
+ printf (" UpperRight Corner: X=%s Y=%s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ }
+ ret = rl2_get_ascii_grid_origin_resolution (origin, &res_x, &res_y);
+ if (ret == RL2_OK)
+ {
+ dumb1 = formatFloat (res_x);
+ dumb2 = formatFloat (res_y);
+ printf (" Pixel resolution: X=%s Y=%s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ }
+
+ if (rl2_eval_ascii_grid_origin_compatibility (cvg, origin) != RL2_TRUE)
+ {
+ fprintf (stderr, "Coverage/ASCII mismatch\n");
+ goto error;
+ }
+ no_data = rl2_get_coverage_no_data (cvg);
+
+/* INSERTing the section */
+ if (!do_insert_section
+ (handle, src_path, section, srid, width, height, minx, miny, maxx, maxy,
+ stmt_sect, §ion_id))
+ goto error;
+ section_stats = rl2_create_raster_statistics (sample_type, 1);
+ if (section_stats == NULL)
+ goto error;
+/* INSERTing the base-levels */
+ if (!do_insert_levels
+ (handle, base_res_x, base_res_y, 1.0, sample_type, stmt_levl))
+ goto error;
+
+ tile_maxy = maxy;
+ for (row = 0; row < height; row += tile_h)
+ {
+ tile_minx = minx;
+ for (col = 0; col < width; col += tile_w)
+ {
+ raster =
+ rl2_get_tile_from_ascii_grid_origin (cvg, origin, row, col);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "ERROR: unable to get a tile [Row=%d Col=%d]\n",
+ row, col);
+ goto error;
+ }
+ if (rl2_raster_encode
+ (raster, compression, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 100, 1) != RL2_OK)
+ {
+ fprintf (stderr,
+ "ERROR: unable to encode a tile [Row=%d Col=%d]\n",
+ row, col);
+ goto error;
+ }
+
+ /* INSERTing the tile */
+ if (!do_insert_tile
+ (handle, blob_odd, blob_odd_sz, blob_even, blob_even_sz,
+ section_id, srid, res_x, res_y, tile_w, tile_h, miny,
+ maxx, &tile_minx, &tile_miny, &tile_maxx, &tile_maxy,
+ NULL, no_data, stmt_tils, stmt_data, section_stats))
+ goto error;
+ blob_odd = NULL;
+ blob_even = NULL;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ tile_minx += (double) tile_w *res_x;
+ }
+ tile_maxy -= (double) tile_h *res_y;
+ }
+
+/* updating the Section's Statistics */
+ compute_aggregate_sq_diff (section_stats);
+ if (!do_insert_stats (handle, section_stats, section_id, stmt_upd_sect))
+ goto error;
+
+ rl2_destroy_ascii_grid_origin (origin);
+ rl2_destroy_raster_statistics (section_stats);
+ origin = NULL;
+ section_stats = NULL;
+
+ if (pyramidize)
+ {
+ /* immediately building the Section's Pyramid */
+ const char *coverage_name = rl2_get_coverage_name (cvg);
+ const char *section_name = section;
+ char *sect_name = NULL;
+ if (coverage_name == NULL)
+ goto error;
+ if (section_name == NULL)
+ {
+ sect_name = get_section_name (src_path);
+ section_name = sect_name;
+ }
+ if (section_name == NULL)
+ goto error;
+ if (rl2_build_section_pyramid (handle, coverage_name, section_name, 1)
+ != RL2_OK)
+ {
+ if (sect_name != NULL)
+ free (sect_name);
+ fprintf (stderr, "unable to build the Section's Pyramid\n");
+ goto error;
+ }
+ if (sect_name != NULL)
+ free (sect_name);
+ }
+
+ return 1;
+
+ error:
+ if (blob_odd != NULL)
+ free (blob_odd);
+ if (blob_even != NULL)
+ free (blob_even);
+ if (origin != NULL)
+ rl2_destroy_ascii_grid_origin (origin);
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (section_stats != NULL)
+ rl2_destroy_raster_statistics (section_stats);
+ return 0;
+}
+
+static int
+check_jpeg_origin_compatibility (rl2RasterPtr raster, rl2CoveragePtr coverage,
+ unsigned int *width, unsigned int *height,
+ unsigned char *forced_conversion)
+{
+/* checking if the JPEG and the Coverage are mutually compatible */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) raster;
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) coverage;
+ if (rst == NULL || cvg == NULL)
+ return 0;
+ if (rst->sampleType == RL2_SAMPLE_UINT8
+ && rst->pixelType == RL2_PIXEL_GRAYSCALE && rst->nBands == 1)
+ {
+ if (cvg->sampleType == RL2_SAMPLE_UINT8
+ && cvg->pixelType == RL2_PIXEL_GRAYSCALE && cvg->nBands == 1)
+ {
+ *width = rst->width;
+ *height = rst->height;
+ *forced_conversion = RL2_CONVERT_NO;
+ return 1;
+ }
+ if (cvg->sampleType == RL2_SAMPLE_UINT8
+ && cvg->pixelType == RL2_PIXEL_RGB && cvg->nBands == 3)
+ {
+ *width = rst->width;
+ *height = rst->height;
+ *forced_conversion = RL2_CONVERT_GRAYSCALE_TO_RGB;
+ return 1;
+ }
+ }
+ if (rst->sampleType == RL2_SAMPLE_UINT8 && rst->pixelType == RL2_PIXEL_RGB
+ && rst->nBands == 3)
+ {
+ if (cvg->sampleType == RL2_SAMPLE_UINT8
+ && cvg->pixelType == RL2_PIXEL_RGB && cvg->nBands == 3)
+ {
+ *width = rst->width;
+ *height = rst->height;
+ *forced_conversion = RL2_CONVERT_NO;
+ return 1;
+ }
+ if (cvg->sampleType == RL2_SAMPLE_UINT8
+ && cvg->pixelType == RL2_PIXEL_GRAYSCALE && cvg->nBands == 1)
+ {
+ *width = rst->width;
+ *height = rst->height;
+ *forced_conversion = RL2_CONVERT_RGB_TO_GRAYSCALE;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static char *
+build_worldfile_path (const char *path, const char *suffix)
+{
+/* building the JGW path (WorldFile) */
+ char *wf_path;
+ const char *x = NULL;
+ const char *p = path;
+ int len;
+
+ if (path == NULL || suffix == NULL)
+ return NULL;
+ len = strlen (path);
+ len -= 1;
+ while (*p != '\0')
+ {
+ if (*p == '.')
+ x = p;
+ p++;
+ }
+ if (x > path)
+ len = x - path;
+ wf_path = malloc (len + strlen (suffix) + 1);
+ memcpy (wf_path, path, len);
+ strcpy (wf_path + len, suffix);
+ return wf_path;
+}
+
+static int
+read_jgw_worldfile (const char *src_path, double *minx, double *maxy,
+ double *pres_x, double *pres_y)
+{
+/* attempting to retrieve georeferencing from a JPEG+JGW origin */
+ FILE *jgw = NULL;
+ double res_x;
+ double res_y;
+ double x;
+ double y;
+ char *jgw_path = NULL;
+
+ jgw_path = build_worldfile_path (src_path, ".jgw");
+ if (jgw_path == NULL)
+ goto error;
+ jgw = fopen (jgw_path, "r");
+ free (jgw_path);
+ jgw_path = NULL;
+ if (jgw == NULL)
+ goto error;
+ if (!parse_worldfile (jgw, &x, &y, &res_x, &res_y))
+ goto error;
+ fclose (jgw);
+ *pres_x = res_x;
+ *pres_y = res_y;
+ *minx = x;
+ *maxy = y;
+ return 1;
+
+ error:
+ if (jgw_path != NULL)
+ free (jgw_path);
+ if (jgw != NULL)
+ fclose (jgw);
+ return 0;
+}
+
+static void
+write_jgw_worldfile (const char *path, double minx, double maxy, double x_res,
+ double y_res)
+{
+/* exporting a JGW WorldFile */
+ FILE *jgw = NULL;
+ char *jgw_path = NULL;
+
+ jgw_path = build_worldfile_path (path, ".jgw");
+ if (jgw_path == NULL)
+ goto error;
+ jgw = fopen (jgw_path, "w");
+ free (jgw_path);
+ jgw_path = NULL;
+ if (jgw == NULL)
+ goto error;
+ fprintf (jgw, " %1.16f\n", x_res);
+ fprintf (jgw, " 0.0\n");
+ fprintf (jgw, " 0.0\n");
+ fprintf (jgw, " -%1.16f\n", y_res);
+ fprintf (jgw, " %1.16f\n", minx);
+ fprintf (jgw, " %1.16f\n", maxy);
+ fclose (jgw);
+ return;
+
+ error:
+ if (jgw_path != NULL)
+ free (jgw_path);
+ if (jgw != NULL)
+ fclose (jgw);
+}
+
+static int
+do_import_jpeg_image (sqlite3 * handle, const char *src_path,
+ rl2CoveragePtr cvg, const char *section, int srid,
+ unsigned int tile_w, unsigned int tile_h,
+ int pyramidize, unsigned char sample_type,
+ unsigned char num_bands, unsigned char compression,
+ sqlite3_stmt * stmt_data, sqlite3_stmt * stmt_tils,
+ sqlite3_stmt * stmt_sect, sqlite3_stmt * stmt_levl,
+ sqlite3_stmt * stmt_upd_sect)
+{
+/* importing a JPEG image file [with optional WorldFile */
+ rl2SectionPtr origin;
+ rl2RasterPtr rst_in;
+ rl2RasterPtr raster = NULL;
+ rl2RasterStatisticsPtr section_stats = NULL;
+ rl2PixelPtr no_data = NULL;
+ unsigned int row;
+ unsigned int col;
+ unsigned int width;
+ unsigned int height;
+ unsigned char *blob_odd = NULL;
+ unsigned char *blob_even = NULL;
+ int blob_odd_sz;
+ int blob_even_sz;
+ double tile_minx;
+ double tile_miny;
+ double tile_maxx;
+ double tile_maxy;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ double res_x;
+ double res_y;
+ char *dumb1;
+ char *dumb2;
+ sqlite3_int64 section_id;
+ unsigned char forced_conversion = RL2_CONVERT_NO;
+ double base_res_x;
+ double base_res_y;
+
+ if (rl2_get_coverage_resolution (cvg, &base_res_x, &base_res_y) != RL2_OK)
+ goto error;
+ origin = rl2_section_from_jpeg (src_path);
+ if (origin == NULL)
+ goto error;
+ rst_in = rl2_get_section_raster (origin);
+ if (!check_jpeg_origin_compatibility
+ (rst_in, cvg, &width, &height, &forced_conversion))
+ goto error;
+ if (read_jgw_worldfile (src_path, &minx, &maxy, &res_x, &res_y))
+ {
+ /* georeferenced JPEG */
+ maxx = minx + ((double) width * res_x);
+ miny = maxy - ((double) height * res_y);
+ }
+ else
+ {
+ /* not georeferenced JPEG */
+ if (srid != -1)
+ goto error;
+ minx = 0.0;
+ miny = 0.0;
+ maxx = width - 1.0;
+ maxy = height - 1.0;
+ res_x = 1.0;
+ res_y = 1.0;
+ }
+
+ printf ("Importing: %s\n", src_path);
+ printf ("------------------\n");
+ printf (" Image Size (pixels): %d x %d\n", width, height);
+ printf (" SRID: %d\n", srid);
+ dumb1 = formatLong (minx);
+ dumb2 = formatLat (miny);
+ printf (" LowerLeft Corner: X=%s Y=%s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ dumb1 = formatLong (maxx);
+ dumb2 = formatLat (maxy);
+ printf (" UpperRight Corner: X=%s Y=%s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ dumb1 = formatFloat (res_x);
+ dumb2 = formatFloat (res_y);
+ printf (" Pixel resolution: X=%s Y=%s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+
+ no_data = rl2_get_coverage_no_data (cvg);
+
+/* INSERTing the section */
+ if (!do_insert_section
+ (handle, src_path, section, srid, width, height, minx, miny, maxx, maxy,
+ stmt_sect, §ion_id))
+ goto error;
+ section_stats = rl2_create_raster_statistics (sample_type, num_bands);
+ if (section_stats == NULL)
+ goto error;
+/* INSERTing the base-levels */
+ if (!do_insert_levels
+ (handle, base_res_x, base_res_y, 1.0, sample_type, stmt_levl))
+ goto error;
+
+ tile_maxy = maxy;
+ for (row = 0; row < height; row += tile_h)
+ {
+ tile_minx = minx;
+ for (col = 0; col < width; col += tile_w)
+ {
+ raster =
+ rl2_get_tile_from_jpeg_origin (cvg, rst_in, row, col,
+ forced_conversion);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "ERROR: unable to get a tile [Row=%d Col=%d]\n",
+ row, col);
+ goto error;
+ }
+ if (rl2_raster_encode
+ (raster, compression, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 100, 1) != RL2_OK)
+ {
+ fprintf (stderr,
+ "ERROR: unable to encode a tile [Row=%d Col=%d]\n",
+ row, col);
+ goto error;
+ }
+
+ /* INSERTing the tile */
+ if (!do_insert_tile
+ (handle, blob_odd, blob_odd_sz, blob_even, blob_even_sz,
+ section_id, srid, res_x, res_y, tile_w, tile_h, miny,
+ maxx, &tile_minx, &tile_miny, &tile_maxx, &tile_maxy,
+ NULL, no_data, stmt_tils, stmt_data, section_stats))
+ goto error;
+ blob_odd = NULL;
+ blob_even = NULL;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ tile_minx += (double) tile_w *res_x;
+ }
+ tile_maxy -= (double) tile_h *res_y;
+ }
+
+/* updating the Section's Statistics */
+ compute_aggregate_sq_diff (section_stats);
+ if (!do_insert_stats (handle, section_stats, section_id, stmt_upd_sect))
+ goto error;
+
+ rl2_destroy_section (origin);
+ rl2_destroy_raster_statistics (section_stats);
+ origin = NULL;
+ section_stats = NULL;
+
+ if (pyramidize)
+ {
+ /* immediately building the Section's Pyramid */
+ const char *coverage_name = rl2_get_coverage_name (cvg);
+ const char *section_name = section;
+ char *sect_name = NULL;
+ if (coverage_name == NULL)
+ goto error;
+ if (section_name == NULL)
+ {
+ sect_name = get_section_name (src_path);
+ section_name = sect_name;
+ }
+ if (section_name == NULL)
+ goto error;
+ if (rl2_build_section_pyramid (handle, coverage_name, section_name, 1)
+ != RL2_OK)
+ {
+ if (sect_name != NULL)
+ free (sect_name);
+ fprintf (stderr, "unable to build the Section's Pyramid\n");
+ goto error;
+ }
+ if (sect_name != NULL)
+ free (sect_name);
+ }
+
+ return 1;
+
+ error:
+ if (blob_odd != NULL)
+ free (blob_odd);
+ if (blob_even != NULL)
+ free (blob_even);
+ if (origin != NULL)
+ rl2_destroy_section (origin);
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (section_stats != NULL)
+ rl2_destroy_raster_statistics (section_stats);
+ return 0;
+}
+
+static int
+is_ascii_grid (const char *path)
+{
+/* testing for an ASCII Grid */
+ int len = strlen (path);
+ if (len > 4)
+ {
+ if (strcasecmp (path + len - 4, ".asc") == 0)
+ return 1;
+ }
+ return 0;
+}
+
+static int
+is_jpeg_image (const char *path)
+{
+/* testing for a JPEG image */
+ int len = strlen (path);
+ if (len > 4)
+ {
+ if (strcasecmp (path + len - 4, ".jpg") == 0)
+ return 1;
+ }
+ return 0;
+}
+
+static int
+do_import_file (sqlite3 * handle, const char *src_path,
+ rl2CoveragePtr cvg, const char *section, int worldfile,
+ int force_srid, int pyramidize, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_bands,
+ unsigned int tile_w, unsigned int tile_h,
+ unsigned char compression, int quality,
+ sqlite3_stmt * stmt_data, sqlite3_stmt * stmt_tils,
+ sqlite3_stmt * stmt_sect, sqlite3_stmt * stmt_levl,
+ sqlite3_stmt * stmt_upd_sect)
+{
+/* importing a single Source file */
+ int ret;
+ rl2TiffOriginPtr origin = NULL;
+ rl2RasterPtr raster = NULL;
+ rl2PalettePtr aux_palette = NULL;
+ rl2RasterStatisticsPtr section_stats = NULL;
+ rl2PixelPtr no_data = NULL;
+ unsigned int row;
+ unsigned int col;
+ unsigned int width;
+ unsigned int height;
+ unsigned char *blob_odd = NULL;
+ unsigned char *blob_even = NULL;
+ int blob_odd_sz;
+ int blob_even_sz;
+ int srid;
+ int xsrid;
+ double tile_minx;
+ double tile_miny;
+ double tile_maxx;
+ double tile_maxy;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ double res_x;
+ double res_y;
+ char *dumb1;
+ char *dumb2;
+ sqlite3_int64 section_id;
+ double base_res_x;
+ double base_res_y;
+
+ if (is_ascii_grid (src_path))
+ return do_import_ascii_grid (handle, src_path, cvg, section, force_srid,
+ tile_w, tile_h, pyramidize, sample_type,
+ compression, stmt_data, stmt_tils,
+ stmt_sect, stmt_levl, stmt_upd_sect);
+
+ if (is_jpeg_image (src_path))
+ return do_import_jpeg_image (handle, src_path, cvg, section, force_srid,
+ tile_w, tile_h, pyramidize, sample_type,
+ num_bands, compression, stmt_data,
+ stmt_tils, stmt_sect, stmt_levl,
+ stmt_upd_sect);
+
+ if (rl2_get_coverage_resolution (cvg, &base_res_x, &base_res_y) != RL2_OK)
+ goto error;
+ if (worldfile)
+ origin =
+ rl2_create_tiff_origin (src_path, RL2_TIFF_WORLDFILE, force_srid,
+ sample_type, pixel_type, num_bands);
+ else
+ origin =
+ rl2_create_tiff_origin (src_path, RL2_TIFF_GEOTIFF, force_srid,
+ sample_type, pixel_type, num_bands);
+ if (origin == NULL)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &xsrid) == RL2_OK)
+ {
+ if (xsrid == RL2_GEOREFERENCING_NONE)
+ rl2_set_tiff_origin_not_referenced (origin);
+ }
+
+ printf ("Importing: %s\n", rl2_get_tiff_origin_path (origin));
+ printf ("------------------\n");
+ ret = rl2_get_tiff_origin_size (origin, &width, &height);
+ if (ret == RL2_OK)
+ printf (" Image Size (pixels): %d x %d\n", width, height);
+ ret = rl2_get_tiff_origin_srid (origin, &srid);
+ if (ret == RL2_OK)
+ {
+ if (force_srid > 0 && force_srid != srid)
+ {
+ printf (" SRID: %d (forced to %d)\n", srid,
+ force_srid);
+ srid = force_srid;
+ }
+ else
+ printf (" SRID: %d\n", srid);
+ }
+ ret = rl2_get_tiff_origin_extent (origin, &minx, &miny, &maxx, &maxy);
+ if (ret == RL2_OK)
+ {
+ dumb1 = formatLong (minx);
+ dumb2 = formatLat (miny);
+ printf (" LowerLeft Corner: X=%s Y=%s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ dumb1 = formatLong (maxx);
+ dumb2 = formatLat (maxy);
+ printf (" UpperRight Corner: X=%s Y=%s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ }
+ ret = rl2_get_tiff_origin_resolution (origin, &res_x, &res_y);
+ if (ret == RL2_OK)
+ {
+ dumb1 = formatFloat (res_x);
+ dumb2 = formatFloat (res_y);
+ printf (" Pixel resolution: X=%s Y=%s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ }
+
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ /* remapping the Palette */
+ if (rl2_check_dbms_palette (handle, cvg, origin) != RL2_OK)
+ {
+ fprintf (stderr, "Mismatching Palette !!!\n");
+ goto error;
+ }
+ }
+
+ if (rl2_eval_tiff_origin_compatibility (cvg, origin, force_srid) !=
+ RL2_TRUE)
+ {
+ fprintf (stderr, "Coverage/TIFF mismatch\n");
+ goto error;
+ }
+ no_data = rl2_get_coverage_no_data (cvg);
+
+/* INSERTing the section */
+ if (!do_insert_section
+ (handle, src_path, section, srid, width, height, minx, miny, maxx, maxy,
+ stmt_sect, §ion_id))
+ goto error;
+ section_stats = rl2_create_raster_statistics (sample_type, num_bands);
+ if (section_stats == NULL)
+ goto error;
+/* INSERTing the base-levels */
+ if (!do_insert_levels
+ (handle, base_res_x, base_res_y, 1.0, sample_type, stmt_levl))
+ goto error;
+
+ tile_maxy = maxy;
+ for (row = 0; row < height; row += tile_h)
+ {
+ tile_minx = minx;
+ for (col = 0; col < width; col += tile_w)
+ {
+ raster =
+ rl2_get_tile_from_tiff_origin (cvg, origin, row, col, srid);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "ERROR: unable to get a tile [Row=%d Col=%d]\n",
+ row, col);
+ goto error;
+ }
+ if (rl2_raster_encode
+ (raster, compression, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, quality, 1) != RL2_OK)
+ {
+ fprintf (stderr,
+ "ERROR: unable to encode a tile [Row=%d Col=%d]\n",
+ row, col);
+ goto error;
+ }
+ /* INSERTing the tile */
+ aux_palette =
+ rl2_clone_palette (rl2_get_raster_palette (raster));
+
+ if (!do_insert_tile
+ (handle, blob_odd, blob_odd_sz, blob_even, blob_even_sz,
+ section_id, srid, res_x, res_y, tile_w, tile_h, miny,
+ maxx, &tile_minx, &tile_miny, &tile_maxx, &tile_maxy,
+ aux_palette, no_data, stmt_tils, stmt_data, section_stats))
+ goto error;
+ blob_odd = NULL;
+ blob_even = NULL;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ tile_minx += (double) tile_w *res_x;
+ }
+ tile_maxy -= (double) tile_h *res_y;
+ }
+
+/* updating the Section's Statistics */
+ compute_aggregate_sq_diff (section_stats);
+ if (!do_insert_stats (handle, section_stats, section_id, stmt_upd_sect))
+ goto error;
+
+ rl2_destroy_tiff_origin (origin);
+ rl2_destroy_raster_statistics (section_stats);
+ origin = NULL;
+ section_stats = NULL;
+
+ if (pyramidize)
+ {
+ /* immediately building the Section's Pyramid */
+ const char *coverage_name = rl2_get_coverage_name (cvg);
+ const char *section_name = section;
+ char *sect_name = NULL;
+ if (coverage_name == NULL)
+ goto error;
+ if (section_name == NULL)
+ {
+ sect_name = get_section_name (src_path);
+ section_name = sect_name;
+ }
+ if (section_name == NULL)
+ goto error;
+ if (rl2_build_section_pyramid (handle, coverage_name, section_name, 1)
+ != RL2_OK)
+ {
+ if (sect_name != NULL)
+ free (sect_name);
+ fprintf (stderr, "unable to build the Section's Pyramid\n");
+ goto error;
+ }
+ if (sect_name != NULL)
+ free (sect_name);
+ }
+
+ return 1;
+
+ error:
+ if (blob_odd != NULL)
+ free (blob_odd);
+ if (blob_even != NULL)
+ free (blob_even);
+ if (origin != NULL)
+ rl2_destroy_tiff_origin (origin);
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (section_stats != NULL)
+ rl2_destroy_raster_statistics (section_stats);
+ return 0;
+}
+
+static int
+check_extension_match (const char *file_name, const char *file_ext)
+{
+/* checks the file extension */
+ const char *mark = NULL;
+ const char *p = file_name;
+ int len;
+ char *ext;
+ int match = 0;
+ if (file_ext == NULL)
+ return 0;
+
+ len = strlen (file_ext);
+ if (*file_ext == '.')
+ {
+ /* file extension starts with dot */
+ ext = malloc (len + 1);
+ strcpy (ext, file_ext);
+ }
+ else
+ {
+ /* file extension doesn't start with dot */
+ ext = malloc (len + 2);
+ *ext = '.';
+ strcpy (ext + 1, file_ext);
+ }
+ while (*p != '\0')
+ {
+ if (*p == '.')
+ mark = p;
+ p++;
+ }
+ if (mark == NULL)
+ {
+ free (ext);
+ return 0;
+ }
+ match = strcasecmp (mark, ext);
+ free (ext);
+ if (match == 0)
+ return 1;
+ return 0;
+}
+
+static int
+do_import_dir (sqlite3 * handle, const char *dir_path, const char *file_ext,
+ rl2CoveragePtr cvg, const char *section, int worldfile,
+ int force_srid, int pyramidize, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_bands,
+ unsigned int tile_w, unsigned int tile_h,
+ unsigned char compression, int quality, sqlite3_stmt * stmt_data,
+ sqlite3_stmt * stmt_tils, sqlite3_stmt * stmt_sect,
+ sqlite3_stmt * stmt_levl, sqlite3_stmt * stmt_upd_sect)
+{
+/* importing a whole directory */
+#if defined(_WIN32) && !defined(__MINGW32__)
+/* Visual Studio .NET */
+ struct _finddata_t c_file;
+ intptr_t hFile;
+ int cnt = 0;
+ char *search;
+ char *path;
+ int ret;
+ if (_chdir (dir_path) < 0)
+ return 0;
+ search = sqlite3_mprintf ("*%s", file_ext);
+ if ((hFile = _findfirst (search, &c_file)) == -1L)
+ ;
+ else
+ {
+ while (1)
+ {
+ if ((c_file.attrib & _A_RDONLY) == _A_RDONLY
+ || (c_file.attrib & _A_NORMAL) == _A_NORMAL)
+ {
+ path = sqlite3_mprintf ("%s/%s", dir_path, c_file.name);
+ ret =
+ do_import_file (handle, path, cvg, section, worldfile,
+ force_srid, pyramidize, sample_type,
+ pixel_type, num_bands, tile_w, tile_h,
+ compression, quality, stmt_data,
+ stmt_tils, stmt_sect, stmt_levl,
+ stmt_upd_sect);
+ sqlite3_free (path);
+ if (!ret)
+ goto error;
+ cnt++;
+ }
+ if (_findnext (hFile, &c_file) != 0)
+ break;
+ };
+ error:
+ _findclose (hFile);
+ }
+ sqlite3_free (search);
+ return cnt;
+#else
+/* not Visual Studio .NET */
+ int cnt = 0;
+ char *path;
+ struct dirent *entry;
+ int ret;
+ DIR *dir = opendir (dir_path);
+ if (!dir)
+ return 0;
+ while (1)
+ {
+ /* scanning dir-entries */
+ entry = readdir (dir);
+ if (!entry)
+ break;
+ if (!check_extension_match (entry->d_name, file_ext))
+ continue;
+ path = sqlite3_mprintf ("%s/%s", dir_path, entry->d_name);
+ ret =
+ do_import_file (handle, path, cvg, section, worldfile, force_srid,
+ pyramidize, sample_type, pixel_type, num_bands,
+ tile_w, tile_h, compression, quality, stmt_data,
+ stmt_tils, stmt_sect, stmt_levl, stmt_upd_sect);
+ sqlite3_free (path);
+ if (!ret)
+ goto error;
+ cnt++;
+ }
+ error:
+ closedir (dir);
+ return cnt;
+#endif
+}
+
+static int
+do_import_common (sqlite3 * handle, const char *src_path, const char *dir_path,
+ const char *file_ext, rl2CoveragePtr cvg, const char *section,
+ int worldfile, int force_srid, int pyramidize)
+{
+/* main IMPORT Raster function */
+ int ret;
+ char *sql;
+ const char *coverage;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned int tile_w;
+ unsigned int tile_h;
+ unsigned char compression;
+ int quality;
+ char *table;
+ char *xtable;
+ unsigned int tileWidth;
+ unsigned int tileHeight;
+ sqlite3_stmt *stmt_data = NULL;
+ sqlite3_stmt *stmt_tils = NULL;
+ sqlite3_stmt *stmt_sect = NULL;
+ sqlite3_stmt *stmt_levl = NULL;
+ sqlite3_stmt *stmt_upd_sect = NULL;
+
+ if (cvg == NULL)
+ goto error;
+
+ if (rl2_get_coverage_tile_size (cvg, &tileWidth, &tileHeight) != RL2_OK)
+ goto error;
+
+ tile_w = tileWidth;
+ tile_h = tileHeight;
+ rl2_get_coverage_compression (cvg, &compression, &quality);
+ rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands);
+ coverage = rl2_get_coverage_name (cvg);
+
+ table = sqlite3_mprintf ("%s_sections", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("INSERT INTO \"%s\" (section_id, section_name, file_path, "
+ "width, height, geometry) VALUES (NULL, ?, ?, ?, ?, ?)", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_sect, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO sections SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ table = sqlite3_mprintf ("%s_sections", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("UPDATE \"%s\" SET statistics = ? WHERE section_id = ?", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_upd_sect, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("UPDATE sections SQL error: %s\n", sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ table = sqlite3_mprintf ("%s_levels", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("INSERT OR IGNORE INTO \"%s\" (pyramid_level, "
+ "x_resolution_1_1, y_resolution_1_1, "
+ "x_resolution_1_2, y_resolution_1_2, x_resolution_1_4, "
+ "y_resolution_1_4, x_resolution_1_8, y_resolution_1_8) "
+ "VALUES (0, ?, ?, ?, ?, ?, ?, ?, ?)", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_levl, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO levels SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ table = sqlite3_mprintf ("%s_tiles", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("INSERT INTO \"%s\" (tile_id, pyramid_level, section_id, geometry) "
+ "VALUES (NULL, 0, ?, ?)", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_tils, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO tiles SQL error: %s\n", sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ table = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("INSERT INTO \"%s\" (tile_id, tile_data_odd, tile_data_even) "
+ "VALUES (?, ?, ?)", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_data, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO tile_data SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ if (dir_path == NULL)
+ {
+ /* importing a single Image file */
+ if (!do_import_file
+ (handle, src_path, cvg, section, worldfile, force_srid,
+ pyramidize, sample_type, pixel_type, num_bands, tile_w, tile_h,
+ compression, quality, stmt_data, stmt_tils, stmt_sect,
+ stmt_levl, stmt_upd_sect))
+ goto error;
+ }
+ else
+ {
+ /* importing all Image files from a whole directory */
+ if (!do_import_dir
+ (handle, dir_path, file_ext, cvg, section, worldfile, force_srid,
+ pyramidize, sample_type, pixel_type, num_bands, tile_w, tile_h,
+ compression, quality, stmt_data, stmt_tils, stmt_sect,
+ stmt_levl, stmt_upd_sect))
+ goto error;
+ }
+
+ sqlite3_finalize (stmt_upd_sect);
+ sqlite3_finalize (stmt_sect);
+ sqlite3_finalize (stmt_levl);
+ sqlite3_finalize (stmt_tils);
+ sqlite3_finalize (stmt_data);
+ stmt_upd_sect = NULL;
+ stmt_sect = NULL;
+ stmt_levl = NULL;
+ stmt_tils = NULL;
+ stmt_data = NULL;
+
+ if (rl2_update_dbms_coverage (handle, coverage) != RL2_OK)
+ {
+ fprintf (stderr, "unable to update the Coverage\n");
+ goto error;
+ }
+
+ return 1;
+
+ error:
+ if (stmt_upd_sect != NULL)
+ sqlite3_finalize (stmt_upd_sect);
+ if (stmt_sect != NULL)
+ sqlite3_finalize (stmt_sect);
+ if (stmt_levl != NULL)
+ sqlite3_finalize (stmt_levl);
+ if (stmt_tils != NULL)
+ sqlite3_finalize (stmt_tils);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ return 0;
+}
+
+RL2_DECLARE int
+rl2_load_raster_into_dbms (sqlite3 * handle, const char *src_path,
+ rl2CoveragePtr coverage, int worldfile,
+ int force_srid, int pyramidize)
+{
+/* importing a single Raster file */
+ if (!do_import_common
+ (handle, src_path, NULL, NULL, coverage, NULL, worldfile, force_srid,
+ pyramidize))
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_load_mrasters_into_dbms (sqlite3 * handle, const char *dir_path,
+ const char *file_ext,
+ rl2CoveragePtr coverage, int worldfile,
+ int force_srid, int pyramidize)
+{
+/* importing multiple Raster files from dir */
+ if (!do_import_common
+ (handle, NULL, dir_path, file_ext, coverage, NULL, worldfile,
+ force_srid, pyramidize))
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+static int
+mismatching_size (unsigned int width, unsigned int height, double x_res,
+ double y_res, double minx, double miny, double maxx,
+ double maxy)
+{
+/* checking if the image size and the map extent do match */
+ double ext_x = (double) width * x_res;
+ double ext_y = (double) height * y_res;
+ double img_x = maxx - minx;
+ double img_y = maxy = miny;
+ double confidence;
+ confidence = ext_x / 100.0;
+ if (img_x < (ext_x - confidence) || img_x > (ext_x + confidence))
+ return 0;
+ confidence = ext_y / 100.0;
+ if (img_y < (ext_y - confidence) || img_y > (ext_y + confidence))
+ return 0;
+ return 1;
+}
+
+static void
+copy_int8_outbuf_to_tile (const char *outbuf, char *tile,
+ unsigned int width,
+ unsigned int height,
+ unsigned int tile_width,
+ unsigned int tile_height, unsigned int base_y,
+ unsigned int base_x)
+{
+/* copying INT8 pixels from the output buffer into the tile */
+ unsigned int x;
+ unsigned int y;
+ const char *p_in;
+ char *p_out = tile;
+
+ for (y = 0; y < tile_height; y++)
+ {
+ if ((base_y + y) >= height)
+ break;
+ p_in = outbuf + ((base_y + y) * width) + base_x;
+ for (x = 0; x < tile_width; x++)
+ {
+ if ((base_x + x) >= width)
+ {
+ p_out++;
+ p_in++;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+}
+
+static void
+copy_uint8_outbuf_to_tile (const unsigned char *outbuf, unsigned char *tile,
+ unsigned char num_bands, unsigned int width,
+ unsigned int height,
+ unsigned int tile_width,
+ unsigned int tile_height, unsigned int base_y,
+ unsigned int base_x)
+{
+/* copying UINT8 pixels from the output buffer into the tile */
+ unsigned int x;
+ unsigned int y;
+ int b;
+ const unsigned char *p_in;
+ unsigned char *p_out = tile;
+
+ for (y = 0; y < tile_height; y++)
+ {
+ if ((base_y + y) >= height)
+ break;
+ p_in =
+ outbuf + ((base_y + y) * width * num_bands) +
+ (base_x * num_bands);
+ for (x = 0; x < tile_width; x++)
+ {
+ if ((base_x + x) >= width)
+ {
+ p_out += num_bands;
+ p_in += num_bands;
+ continue;
+ }
+ for (b = 0; b < num_bands; b++)
+ *p_out++ = *p_in++;
+ }
+ }
+}
+
+static void
+copy_int16_outbuf_to_tile (const short *outbuf, short *tile,
+ unsigned int width,
+ unsigned int height,
+ unsigned int tile_width,
+ unsigned int tile_height, unsigned int base_y,
+ unsigned int base_x)
+{
+/* copying INT16 pixels from the output buffer into the tile */
+ unsigned int x;
+ unsigned int y;
+ const short *p_in;
+ short *p_out = tile;
+
+ for (y = 0; y < tile_height; y++)
+ {
+ if ((base_y + y) >= height)
+ break;
+ p_in = outbuf + ((base_y + y) * width) + base_x;
+ for (x = 0; x < tile_width; x++)
+ {
+ if ((base_x + x) >= width)
+ {
+ p_out++;
+ p_in++;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+}
+
+static void
+copy_uint16_outbuf_to_tile (const unsigned short *outbuf, unsigned short *tile,
+ unsigned char num_bands, unsigned int width,
+ unsigned int height,
+ unsigned int tile_width,
+ unsigned int tile_height, unsigned int base_y,
+ unsigned int base_x)
+{
+/* copying UINT16 pixels from the output buffer into the tile */
+ unsigned int x;
+ unsigned int y;
+ int b;
+ const unsigned short *p_in;
+ unsigned short *p_out = tile;
+
+ for (y = 0; y < tile_height; y++)
+ {
+ if ((base_y + y) >= height)
+ break;
+ p_in =
+ outbuf + ((base_y + y) * width * num_bands) +
+ (base_x * num_bands);
+ for (x = 0; x < tile_width; x++)
+ {
+ if ((base_x + x) >= width)
+ {
+ p_out += num_bands;
+ p_in += num_bands;
+ continue;
+ }
+ for (b = 0; b < num_bands; b++)
+ *p_out++ = *p_in++;
+ }
+ }
+}
+
+static void
+copy_int32_outbuf_to_tile (const int *outbuf, int *tile,
+ unsigned int width,
+ unsigned int height,
+ unsigned int tile_width,
+ unsigned int tile_height, unsigned int base_y,
+ unsigned int base_x)
+{
+/* copying INT32 pixels from the output buffer into the tile */
+ unsigned int x;
+ unsigned int y;
+ const int *p_in;
+ int *p_out = tile;
+
+ for (y = 0; y < tile_height; y++)
+ {
+ if ((base_y + y) >= height)
+ break;
+ p_in = outbuf + ((base_y + y) * width) + base_x;
+ for (x = 0; x < tile_width; x++)
+ {
+ if ((base_x + x) >= width)
+ {
+ p_out++;
+ p_in++;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+}
+
+static void
+copy_uint32_outbuf_to_tile (const unsigned int *outbuf, unsigned int *tile,
+ unsigned int width,
+ unsigned int height,
+ unsigned int tile_width,
+ unsigned int tile_height, int base_y, int base_x)
+{
+/* copying UINT32 pixels from the output buffer into the tile */
+ unsigned int x;
+ unsigned int y;
+ const unsigned int *p_in;
+ unsigned int *p_out = tile;
+
+ for (y = 0; y < tile_height; y++)
+ {
+ if ((base_y + y) >= height)
+ break;
+ p_in = outbuf + ((base_y + y) * width) + base_x;
+ for (x = 0; x < tile_width; x++)
+ {
+ if ((base_x + x) >= width)
+ {
+ p_out++;
+ p_in++;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+}
+
+static void
+copy_float_outbuf_to_tile (const float *outbuf, float *tile,
+ unsigned int width,
+ unsigned int height,
+ unsigned int tile_width,
+ unsigned int tile_height, unsigned int base_y,
+ unsigned int base_x)
+{
+/* copying FLOAT pixels from the output buffer into the tile */
+ unsigned int x;
+ unsigned int y;
+ const float *p_in;
+ float *p_out = tile;
+
+ for (y = 0; y < tile_height; y++)
+ {
+ if ((base_y + y) >= height)
+ break;
+ p_in = outbuf + ((base_y + y) * width) + base_x;
+ for (x = 0; x < tile_width; x++)
+ {
+ if ((base_x + x) >= width)
+ {
+ p_out++;
+ p_in++;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+}
+
+static void
+copy_double_outbuf_to_tile (const double *outbuf, double *tile,
+ unsigned int width,
+ unsigned int height,
+ unsigned int tile_width,
+ unsigned int tile_height, unsigned int base_y,
+ unsigned int base_x)
+{
+/* copying DOUBLE pixels from the output buffer into the tile */
+ unsigned int x;
+ unsigned int y;
+ const double *p_in;
+ double *p_out = tile;
+
+ for (y = 0; y < tile_height; y++)
+ {
+ if ((base_y + y) >= height)
+ break;
+ p_in = outbuf + ((base_y + y) * width) + base_x;
+ for (x = 0; x < tile_width; x++)
+ {
+ if ((base_x + x) >= width)
+ {
+ p_out++;
+ p_in++;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+}
+
+static void
+copy_from_outbuf_to_tile (const unsigned char *outbuf, unsigned char *tile,
+ unsigned char sample_type, unsigned char num_bands,
+ unsigned int width, unsigned int height,
+ unsigned int tile_width, unsigned int tile_height,
+ unsigned int base_y, unsigned int base_x)
+{
+/* copying pixels from the output buffer into the tile */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ copy_int8_outbuf_to_tile ((char *) outbuf,
+ (char *) tile, width, height, tile_width,
+ tile_height, base_y, base_x);
+ break;
+ case RL2_SAMPLE_INT16:
+ copy_int16_outbuf_to_tile ((short *) outbuf,
+ (short *) tile, width, height, tile_width,
+ tile_height, base_y, base_x);
+ break;
+ case RL2_SAMPLE_UINT16:
+ copy_uint16_outbuf_to_tile ((unsigned short *) outbuf,
+ (unsigned short *) tile, num_bands,
+ width, height, tile_width, tile_height,
+ base_y, base_x);
+ break;
+ case RL2_SAMPLE_INT32:
+ copy_int32_outbuf_to_tile ((int *) outbuf,
+ (int *) tile, width, height, tile_width,
+ tile_height, base_y, base_x);
+ break;
+ case RL2_SAMPLE_UINT32:
+ copy_uint32_outbuf_to_tile ((unsigned int *) outbuf,
+ (unsigned int *) tile, width, height,
+ tile_width, tile_height, base_y, base_x);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ copy_float_outbuf_to_tile ((float *) outbuf,
+ (float *) tile, width, height, tile_width,
+ tile_height, base_y, base_x);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ copy_double_outbuf_to_tile ((double *) outbuf,
+ (double *) tile, width, height,
+ tile_width, tile_height, base_y, base_x);
+ break;
+ default:
+ copy_uint8_outbuf_to_tile ((unsigned char *) outbuf,
+ (unsigned char *) tile, num_bands, width,
+ height, tile_width, tile_height, base_y,
+ base_x);
+ break;
+ };
+}
+
+RL2_DECLARE int
+rl2_export_geotiff_from_dbms (sqlite3 * handle, const char *dst_path,
+ rl2CoveragePtr cvg, double x_res, double y_res,
+ double minx, double miny, double maxx,
+ double maxy, unsigned int width,
+ unsigned int height, unsigned char compression,
+ unsigned int tile_sz, int with_worldfile)
+{
+/* exporting a GeoTIFF from the DBMS into the file-system */
+ rl2RasterPtr raster = NULL;
+ rl2PalettePtr palette = NULL;
+ rl2PalettePtr plt2 = NULL;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2PixelPtr no_data = NULL;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int srid;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ int pix_sz = 1;
+ unsigned int base_x;
+ unsigned int base_y;
+
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ return RL2_ERROR;
+
+ if (mismatching_size
+ (width, height, xx_res, yy_res, minx, miny, maxx, maxy))
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &srid) != RL2_OK)
+ goto error;
+ no_data = rl2_get_coverage_no_data (cvg);
+
+ if (level > 0)
+ {
+ /* special handling for Pyramid tiles */
+ if (sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_MONOCHROME && num_bands == 1)
+ {
+ /* expecting a Grayscale/PNG Pyramid tile */
+ sample_type = RL2_SAMPLE_UINT8;
+ pixel_type = RL2_PIXEL_GRAYSCALE;
+ num_bands = 1;
+ }
+ if ((sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1) ||
+ (sample_type == RL2_SAMPLE_2_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1) ||
+ (sample_type == RL2_SAMPLE_4_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1))
+ {
+ /* expecting an RGB/PNG Pyramid tile */
+ sample_type = RL2_SAMPLE_UINT8;
+ pixel_type = RL2_PIXEL_RGB;
+ num_bands = 3;
+ }
+ }
+
+ if (rl2_get_raw_raster_data
+ (handle, cvg, width, height, minx, miny, maxx, maxy, xx_res,
+ yy_res, &outbuf, &outbuf_size, &palette, pixel_type) != RL2_OK)
+ goto error;
+
+/* computing the sample size */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pix_sz = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pix_sz = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pix_sz = 8;
+ break;
+ };
+
+ tiff =
+ rl2_create_geotiff_destination (dst_path, handle, width, height,
+ sample_type, pixel_type, num_bands,
+ palette, compression, 1,
+ tile_sz, srid, minx, miny, maxx,
+ maxy, xx_res, yy_res, with_worldfile);
+ if (tiff == NULL)
+ goto error;
+ for (base_y = 0; base_y < height; base_y += tile_sz)
+ {
+ for (base_x = 0; base_x < width; base_x += tile_sz)
+ {
+ /* exporting all tiles from the output buffer */
+ bufpix_size = pix_sz * num_bands * tile_sz * tile_sz;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2tool Export: Insufficient Memory !!!\n");
+ goto error;
+ }
+ if (pixel_type == RL2_PIXEL_PALETTE && palette != NULL)
+ rl2_prime_void_tile_palette (bufpix, tile_sz, tile_sz,
+ no_data);
+ else
+ rl2_prime_void_tile (bufpix, tile_sz, tile_sz, sample_type,
+ num_bands, no_data);
+ copy_from_outbuf_to_tile (outbuf, bufpix, sample_type,
+ num_bands, width, height, tile_sz,
+ tile_sz, base_y, base_x);
+ plt2 = rl2_clone_palette (palette);
+ raster =
+ rl2_create_raster (tile_sz, tile_sz, sample_type,
+ pixel_type, num_bands, bufpix,
+ bufpix_size, plt2, NULL, 0, NULL);
+ bufpix = NULL;
+ if (raster == NULL)
+ goto error;
+ if (rl2_write_tiff_tile (tiff, raster, base_y, base_x) !=
+ RL2_OK)
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ }
+
+ if (with_worldfile)
+ {
+ /* exporting the Worldfile */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ goto error;
+ }
+
+ rl2_destroy_tiff_destination (tiff);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ free (outbuf);
+ return RL2_OK;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ if (outbuf != NULL)
+ free (outbuf);
+ if (bufpix != NULL)
+ free (bufpix);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_export_tiff_worldfile_from_dbms (sqlite3 * handle, const char *dst_path,
+ rl2CoveragePtr cvg, double x_res,
+ double y_res, double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char compression,
+ unsigned int tile_sz)
+{
+/* exporting a TIFF+TFW from the DBMS into the file-system */
+ rl2RasterPtr raster = NULL;
+ rl2PalettePtr palette = NULL;
+ rl2PalettePtr plt2 = NULL;
+ rl2PixelPtr no_data = NULL;
+ rl2TiffDestinationPtr tiff = NULL;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int srid;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ int pix_sz = 1;
+ unsigned int base_x;
+ unsigned int base_y;
+
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ return RL2_ERROR;
+
+ if (mismatching_size
+ (width, height, xx_res, yy_res, minx, miny, maxx, maxy))
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &srid) != RL2_OK)
+ goto error;
+ no_data = rl2_get_coverage_no_data (cvg);
+
+ if (level > 0)
+ {
+ /* special handling for Pyramid tiles */
+ if (sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_MONOCHROME && num_bands == 1)
+ {
+ /* expecting a Grayscale/PNG Pyramid tile */
+ sample_type = RL2_SAMPLE_UINT8;
+ pixel_type = RL2_PIXEL_GRAYSCALE;
+ num_bands = 1;
+ }
+ if ((sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1) ||
+ (sample_type == RL2_SAMPLE_2_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1) ||
+ (sample_type == RL2_SAMPLE_4_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1))
+ {
+ /* expecting an RGB/PNG Pyramid tile */
+ sample_type = RL2_SAMPLE_UINT8;
+ pixel_type = RL2_PIXEL_RGB;
+ num_bands = 3;
+ }
+ }
+
+ if (rl2_get_raw_raster_data
+ (handle, cvg, width, height, minx, miny, maxx, maxy, xx_res,
+ yy_res, &outbuf, &outbuf_size, &palette, pixel_type) != RL2_OK)
+ goto error;
+
+/* computing the sample size */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pix_sz = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pix_sz = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pix_sz = 8;
+ break;
+ };
+
+ tiff =
+ rl2_create_tiff_worldfile_destination (dst_path, width, height,
+ sample_type, pixel_type,
+ num_bands, palette, compression,
+ 1, tile_sz, srid, minx, miny,
+ maxx, maxy, xx_res, yy_res);
+ if (tiff == NULL)
+ goto error;
+ for (base_y = 0; base_y < height; base_y += tile_sz)
+ {
+ for (base_x = 0; base_x < width; base_x += tile_sz)
+ {
+ /* exporting all tiles from the output buffer */
+ bufpix_size = pix_sz * num_bands * tile_sz * tile_sz;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2tool Export: Insufficient Memory !!!\n");
+ goto error;
+ }
+ if (pixel_type == RL2_PIXEL_PALETTE && palette != NULL)
+ rl2_prime_void_tile_palette (bufpix, tile_sz, tile_sz,
+ no_data);
+ else
+ rl2_prime_void_tile (bufpix, tile_sz, tile_sz, sample_type,
+ num_bands, no_data);
+ copy_from_outbuf_to_tile (outbuf, bufpix, sample_type,
+ num_bands, width, height, tile_sz,
+ tile_sz, base_y, base_x);
+ plt2 = rl2_clone_palette (palette);
+ raster =
+ rl2_create_raster (tile_sz, tile_sz, sample_type,
+ pixel_type, num_bands, bufpix,
+ bufpix_size, plt2, NULL, 0, NULL);
+ bufpix = NULL;
+ if (raster == NULL)
+ goto error;
+ if (rl2_write_tiff_tile (tiff, raster, base_y, base_x) !=
+ RL2_OK)
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ }
+
+/* exporting the Worldfile */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ goto error;
+
+ rl2_destroy_tiff_destination (tiff);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ free (outbuf);
+ return RL2_OK;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ if (outbuf != NULL)
+ free (outbuf);
+ if (bufpix != NULL)
+ free (bufpix);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_export_tiff_from_dbms (sqlite3 * handle, const char *dst_path,
+ rl2CoveragePtr cvg, double x_res, double y_res,
+ double minx, double miny, double maxx,
+ double maxy, unsigned int width,
+ unsigned int height, unsigned char compression,
+ unsigned int tile_sz)
+{
+/* exporting a plain TIFF from the DBMS into the file-system */
+ rl2RasterPtr raster = NULL;
+ rl2PalettePtr palette = NULL;
+ rl2PalettePtr plt2 = NULL;
+ rl2PixelPtr no_data = NULL;
+ rl2TiffDestinationPtr tiff = NULL;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int srid;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ int pix_sz = 1;
+ unsigned int base_x;
+ unsigned int base_y;
+
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ return RL2_ERROR;
+
+ if (mismatching_size
+ (width, height, xx_res, yy_res, minx, miny, maxx, maxy))
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &srid) != RL2_OK)
+ goto error;
+ no_data = rl2_get_coverage_no_data (cvg);
+
+ if (level > 0)
+ {
+ /* special handling for Pyramid tiles */
+ if (sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_MONOCHROME && num_bands == 1)
+ {
+ /* expecting a Grayscale/PNG Pyramid tile */
+ sample_type = RL2_SAMPLE_UINT8;
+ pixel_type = RL2_PIXEL_GRAYSCALE;
+ num_bands = 1;
+ }
+ if ((sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1) ||
+ (sample_type == RL2_SAMPLE_2_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1) ||
+ (sample_type == RL2_SAMPLE_4_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1) ||
+ (sample_type == RL2_SAMPLE_UINT8
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1))
+ {
+ /* expecting an RGB/PNG Pyramid tile */
+ sample_type = RL2_SAMPLE_UINT8;
+ pixel_type = RL2_PIXEL_RGB;
+ num_bands = 3;
+ }
+ }
+
+ if (rl2_get_raw_raster_data
+ (handle, cvg, width, height, minx, miny, maxx, maxy, xx_res,
+ yy_res, &outbuf, &outbuf_size, &palette, pixel_type) != RL2_OK)
+ goto error;
+
+/* computing the sample size */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pix_sz = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pix_sz = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pix_sz = 8;
+ break;
+ };
+
+ tiff =
+ rl2_create_tiff_destination (dst_path, width, height, sample_type,
+ pixel_type, num_bands, palette,
+ compression, 1, tile_sz);
+ if (tiff == NULL)
+ goto error;
+ for (base_y = 0; base_y < height; base_y += tile_sz)
+ {
+ for (base_x = 0; base_x < width; base_x += tile_sz)
+ {
+ /* exporting all tiles from the output buffer */
+ bufpix_size = pix_sz * num_bands * tile_sz * tile_sz;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2tool Export: Insufficient Memory !!!\n");
+ goto error;
+ }
+ if (pixel_type == RL2_PIXEL_PALETTE && palette != NULL)
+ rl2_prime_void_tile_palette (bufpix, tile_sz, tile_sz,
+ no_data);
+ else
+ rl2_prime_void_tile (bufpix, tile_sz, tile_sz, sample_type,
+ num_bands, no_data);
+ copy_from_outbuf_to_tile (outbuf, bufpix, sample_type,
+ num_bands, width, height, tile_sz,
+ tile_sz, base_y, base_x);
+ plt2 = rl2_clone_palette (palette);
+ raster =
+ rl2_create_raster (tile_sz, tile_sz, sample_type,
+ pixel_type, num_bands, bufpix,
+ bufpix_size, plt2, NULL, 0, NULL);
+ bufpix = NULL;
+ if (raster == NULL)
+ goto error;
+ if (rl2_write_tiff_tile (tiff, raster, base_y, base_x) !=
+ RL2_OK)
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ }
+
+ rl2_destroy_tiff_destination (tiff);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ free (outbuf);
+ return RL2_OK;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ if (outbuf != NULL)
+ free (outbuf);
+ if (bufpix != NULL)
+ free (bufpix);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_export_triple_band_geotiff_from_dbms (sqlite3 * handle,
+ const char *dst_path,
+ rl2CoveragePtr cvg, double x_res,
+ double y_res, double minx,
+ double miny, double maxx,
+ double maxy, unsigned int width,
+ unsigned int height,
+ unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band,
+ unsigned char compression,
+ unsigned int tile_sz,
+ int with_worldfile)
+{
+/* exporting a Band-Composed GeoTIFF from the DBMS into the file-system */
+ rl2RasterPtr raster = NULL;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2PixelPtr no_data_multi = NULL;
+ rl2PixelPtr no_data = NULL;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int srid;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ unsigned int base_x;
+ unsigned int base_y;
+
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ return RL2_ERROR;
+
+ if (mismatching_size
+ (width, height, xx_res, yy_res, minx, miny, maxx, maxy))
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (pixel_type != RL2_PIXEL_RGB && pixel_type != RL2_PIXEL_MULTIBAND)
+ goto error;
+ if (sample_type != RL2_SAMPLE_UINT8 && sample_type != RL2_SAMPLE_UINT16)
+ goto error;
+ if (red_band >= num_bands)
+ goto error;
+ if (green_band >= num_bands)
+ goto error;
+ if (blue_band >= num_bands)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &srid) != RL2_OK)
+ goto error;
+ no_data_multi = rl2_get_coverage_no_data (cvg);
+ no_data =
+ rl2_create_triple_band_pixel (no_data_multi, red_band, green_band,
+ blue_band);
+
+ if (rl2_get_triple_band_raw_raster_data
+ (handle, cvg, width, height, minx, miny, maxx, maxy, xx_res,
+ yy_res, red_band, green_band, blue_band, &outbuf, &outbuf_size,
+ no_data) != RL2_OK)
+ goto error;
+
+ tiff =
+ rl2_create_geotiff_destination (dst_path, handle, width, height,
+ sample_type, RL2_PIXEL_RGB, 3,
+ NULL, compression, 1, tile_sz, srid,
+ minx, miny, maxx, maxy, xx_res, yy_res,
+ with_worldfile);
+ if (tiff == NULL)
+ goto error;
+ for (base_y = 0; base_y < height; base_y += tile_sz)
+ {
+ for (base_x = 0; base_x < width; base_x += tile_sz)
+ {
+ /* exporting all tiles from the output buffer */
+ bufpix_size = 3 * tile_sz * tile_sz;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ bufpix_size *= 2;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2tool Export: Insufficient Memory !!!\n");
+ goto error;
+ }
+ rl2_prime_void_tile (bufpix, tile_sz, tile_sz, sample_type,
+ 3, no_data);
+ copy_from_outbuf_to_tile (outbuf, bufpix, sample_type,
+ 3, width, height, tile_sz,
+ tile_sz, base_y, base_x);
+ raster =
+ rl2_create_raster (tile_sz, tile_sz, sample_type,
+ RL2_PIXEL_RGB, 3, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ bufpix = NULL;
+ if (raster == NULL)
+ goto error;
+ if (rl2_write_tiff_tile (tiff, raster, base_y, base_x) !=
+ RL2_OK)
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ }
+
+ if (with_worldfile)
+ {
+ /* exporting the Worldfile */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ goto error;
+ }
+
+ rl2_destroy_tiff_destination (tiff);
+ free (outbuf);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_OK;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ if (outbuf != NULL)
+ free (outbuf);
+ if (bufpix != NULL)
+ free (bufpix);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_export_mono_band_geotiff_from_dbms (sqlite3 * handle,
+ const char *dst_path,
+ rl2CoveragePtr cvg, double x_res,
+ double y_res, double minx,
+ double miny, double maxx,
+ double maxy, unsigned int width,
+ unsigned int height,
+ unsigned char mono_band,
+ unsigned char compression,
+ unsigned int tile_sz,
+ int with_worldfile)
+{
+/* exporting a Mono-Band GeoTIFF from the DBMS into the file-system */
+ rl2RasterPtr raster = NULL;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2PixelPtr no_data_mono = NULL;
+ rl2PixelPtr no_data = NULL;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int srid;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ unsigned int base_x;
+ unsigned int base_y;
+ unsigned char out_pixel;
+
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ return RL2_ERROR;
+
+ if (mismatching_size
+ (width, height, xx_res, yy_res, minx, miny, maxx, maxy))
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (pixel_type != RL2_PIXEL_RGB && pixel_type != RL2_PIXEL_MULTIBAND)
+ goto error;
+ if (sample_type != RL2_SAMPLE_UINT8 && sample_type != RL2_SAMPLE_UINT16)
+ goto error;
+ if (mono_band >= num_bands)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &srid) != RL2_OK)
+ goto error;
+ no_data_mono = rl2_get_coverage_no_data (cvg);
+ no_data = rl2_create_mono_band_pixel (no_data_mono, mono_band);
+
+ if (rl2_get_mono_band_raw_raster_data
+ (handle, cvg, width, height, minx, miny, maxx, maxy, xx_res,
+ yy_res, mono_band, &outbuf, &outbuf_size, no_data) != RL2_OK)
+ goto error;
+
+ if (sample_type == RL2_SAMPLE_UINT16)
+ out_pixel = RL2_PIXEL_DATAGRID;
+ else
+ out_pixel = RL2_PIXEL_GRAYSCALE;
+
+ tiff =
+ rl2_create_geotiff_destination (dst_path, handle, width, height,
+ sample_type, out_pixel, 1,
+ NULL, compression, 1, tile_sz, srid,
+ minx, miny, maxx, maxy, xx_res, yy_res,
+ with_worldfile);
+ if (tiff == NULL)
+ goto error;
+ for (base_y = 0; base_y < height; base_y += tile_sz)
+ {
+ for (base_x = 0; base_x < width; base_x += tile_sz)
+ {
+ /* exporting all tiles from the output buffer */
+ bufpix_size = tile_sz * tile_sz;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ bufpix_size *= 2;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2tool Export: Insufficient Memory !!!\n");
+ goto error;
+ }
+ rl2_prime_void_tile (bufpix, tile_sz, tile_sz, sample_type,
+ 1, no_data);
+ copy_from_outbuf_to_tile (outbuf, bufpix, sample_type,
+ 1, width, height, tile_sz,
+ tile_sz, base_y, base_x);
+ raster =
+ rl2_create_raster (tile_sz, tile_sz, sample_type,
+ out_pixel, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ bufpix = NULL;
+ if (raster == NULL)
+ goto error;
+ if (rl2_write_tiff_tile (tiff, raster, base_y, base_x) !=
+ RL2_OK)
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ }
+
+ if (with_worldfile)
+ {
+ /* exporting the Worldfile */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ goto error;
+ }
+
+ rl2_destroy_tiff_destination (tiff);
+ free (outbuf);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_OK;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ if (outbuf != NULL)
+ free (outbuf);
+ if (bufpix != NULL)
+ free (bufpix);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_export_triple_band_tiff_worldfile_from_dbms (sqlite3 * handle,
+ const char *dst_path,
+ rl2CoveragePtr cvg,
+ double x_res, double y_res,
+ double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band,
+ unsigned char compression,
+ unsigned int tile_sz)
+{
+/* exporting a Band-Composed TIFF+TFW from the DBMS into the file-system */
+ rl2RasterPtr raster = NULL;
+ rl2PixelPtr no_data_multi = NULL;
+ rl2PixelPtr no_data = NULL;
+ rl2TiffDestinationPtr tiff = NULL;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int srid;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ unsigned int base_x;
+ unsigned int base_y;
+
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ return RL2_ERROR;
+
+ if (mismatching_size
+ (width, height, xx_res, yy_res, minx, miny, maxx, maxy))
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (pixel_type != RL2_PIXEL_RGB && pixel_type != RL2_PIXEL_MULTIBAND)
+ goto error;
+ if (sample_type != RL2_SAMPLE_UINT8 && sample_type != RL2_SAMPLE_UINT16)
+ goto error;
+ if (red_band >= num_bands)
+ goto error;
+ if (green_band >= num_bands)
+ goto error;
+ if (blue_band >= num_bands)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &srid) != RL2_OK)
+ goto error;
+ no_data_multi = rl2_get_coverage_no_data (cvg);
+ no_data =
+ rl2_create_triple_band_pixel (no_data_multi, red_band, green_band,
+ blue_band);
+
+ if (rl2_get_triple_band_raw_raster_data
+ (handle, cvg, width, height, minx, miny, maxx, maxy, xx_res,
+ yy_res, red_band, green_band, blue_band, &outbuf, &outbuf_size,
+ no_data) != RL2_OK)
+ goto error;
+
+ tiff =
+ rl2_create_tiff_worldfile_destination (dst_path, width, height,
+ sample_type, RL2_PIXEL_RGB,
+ 3, NULL, compression, 1, tile_sz,
+ srid, minx, miny, maxx, maxy,
+ xx_res, yy_res);
+ if (tiff == NULL)
+ goto error;
+ for (base_y = 0; base_y < height; base_y += tile_sz)
+ {
+ for (base_x = 0; base_x < width; base_x += tile_sz)
+ {
+ /* exporting all tiles from the output buffer */
+ bufpix_size = 3 * tile_sz * tile_sz;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ bufpix_size *= 2;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2tool Export: Insufficient Memory !!!\n");
+ goto error;
+ }
+ rl2_prime_void_tile (bufpix, tile_sz, tile_sz, sample_type,
+ 3, no_data);
+ copy_from_outbuf_to_tile (outbuf, bufpix, sample_type,
+ 3, width, height, tile_sz,
+ tile_sz, base_y, base_x);
+ raster =
+ rl2_create_raster (tile_sz, tile_sz, sample_type,
+ RL2_PIXEL_RGB, 3, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ bufpix = NULL;
+ if (raster == NULL)
+ goto error;
+ if (rl2_write_tiff_tile (tiff, raster, base_y, base_x) !=
+ RL2_OK)
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ }
+
+/* exporting the Worldfile */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ goto error;
+
+ rl2_destroy_tiff_destination (tiff);
+ free (outbuf);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_OK;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ if (outbuf != NULL)
+ free (outbuf);
+ if (bufpix != NULL)
+ free (bufpix);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_export_mono_band_tiff_worldfile_from_dbms (sqlite3 * handle,
+ const char *dst_path,
+ rl2CoveragePtr cvg,
+ double x_res, double y_res,
+ double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char mono_band,
+ unsigned char compression,
+ unsigned int tile_sz)
+{
+/* exporting a Mono-Band TIFF+TFW from the DBMS into the file-system */
+ rl2RasterPtr raster = NULL;
+ rl2PixelPtr no_data_multi = NULL;
+ rl2PixelPtr no_data = NULL;
+ rl2TiffDestinationPtr tiff = NULL;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int srid;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ unsigned int base_x;
+ unsigned int base_y;
+ unsigned char out_pixel;
+
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ return RL2_ERROR;
+
+ if (mismatching_size
+ (width, height, xx_res, yy_res, minx, miny, maxx, maxy))
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (pixel_type != RL2_PIXEL_RGB && pixel_type != RL2_PIXEL_MULTIBAND)
+ goto error;
+ if (sample_type != RL2_SAMPLE_UINT8 && sample_type != RL2_SAMPLE_UINT16)
+ goto error;
+ if (mono_band >= num_bands)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &srid) != RL2_OK)
+ goto error;
+ no_data_multi = rl2_get_coverage_no_data (cvg);
+ no_data = rl2_create_mono_band_pixel (no_data_multi, mono_band);
+
+ if (rl2_get_mono_band_raw_raster_data
+ (handle, cvg, width, height, minx, miny, maxx, maxy, xx_res,
+ yy_res, mono_band, &outbuf, &outbuf_size, no_data) != RL2_OK)
+ goto error;
+
+ if (sample_type == RL2_SAMPLE_UINT16)
+ out_pixel = RL2_PIXEL_DATAGRID;
+ else
+ out_pixel = RL2_PIXEL_GRAYSCALE;
+
+ tiff =
+ rl2_create_tiff_worldfile_destination (dst_path, width, height,
+ sample_type, out_pixel,
+ 1, NULL, compression, 1, tile_sz,
+ srid, minx, miny, maxx, maxy,
+ xx_res, yy_res);
+ if (tiff == NULL)
+ goto error;
+ for (base_y = 0; base_y < height; base_y += tile_sz)
+ {
+ for (base_x = 0; base_x < width; base_x += tile_sz)
+ {
+ /* exporting all tiles from the output buffer */
+ bufpix_size = tile_sz * tile_sz;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ bufpix_size *= 2;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2tool Export: Insufficient Memory !!!\n");
+ goto error;
+ }
+ rl2_prime_void_tile (bufpix, tile_sz, tile_sz, sample_type,
+ 1, no_data);
+ copy_from_outbuf_to_tile (outbuf, bufpix, sample_type,
+ 1, width, height, tile_sz,
+ tile_sz, base_y, base_x);
+ raster =
+ rl2_create_raster (tile_sz, tile_sz, sample_type,
+ out_pixel, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ bufpix = NULL;
+ if (raster == NULL)
+ goto error;
+ if (rl2_write_tiff_tile (tiff, raster, base_y, base_x) !=
+ RL2_OK)
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ }
+
+/* exporting the Worldfile */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ goto error;
+
+ rl2_destroy_tiff_destination (tiff);
+ free (outbuf);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_OK;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ if (outbuf != NULL)
+ free (outbuf);
+ if (bufpix != NULL)
+ free (bufpix);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_export_triple_band_tiff_from_dbms (sqlite3 * handle, const char *dst_path,
+ rl2CoveragePtr cvg, double x_res,
+ double y_res, double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band,
+ unsigned char compression,
+ unsigned int tile_sz)
+{
+/* exporting a plain Band-Composed TIFF from the DBMS into the file-system */
+ rl2RasterPtr raster = NULL;
+ rl2PixelPtr no_data_multi = NULL;
+ rl2PixelPtr no_data = NULL;
+ rl2TiffDestinationPtr tiff = NULL;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int srid;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ unsigned int base_x;
+ unsigned int base_y;
+
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ return RL2_ERROR;
+
+ if (mismatching_size
+ (width, height, xx_res, yy_res, minx, miny, maxx, maxy))
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (pixel_type != RL2_PIXEL_RGB && pixel_type != RL2_PIXEL_MULTIBAND)
+ goto error;
+ if (sample_type != RL2_SAMPLE_UINT8 && sample_type != RL2_SAMPLE_UINT16)
+ goto error;
+ if (red_band >= num_bands)
+ goto error;
+ if (green_band >= num_bands)
+ goto error;
+ if (blue_band >= num_bands)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &srid) != RL2_OK)
+ goto error;
+ no_data_multi = rl2_get_coverage_no_data (cvg);
+ no_data =
+ rl2_create_triple_band_pixel (no_data_multi, red_band, green_band,
+ blue_band);
+
+ if (rl2_get_triple_band_raw_raster_data
+ (handle, cvg, width, height, minx, miny, maxx, maxy, xx_res,
+ yy_res, red_band, green_band, blue_band, &outbuf, &outbuf_size,
+ no_data) != RL2_OK)
+ goto error;
+
+ tiff =
+ rl2_create_tiff_destination (dst_path, width, height, sample_type,
+ RL2_PIXEL_RGB, 3, NULL,
+ compression, 1, tile_sz);
+ if (tiff == NULL)
+ goto error;
+ for (base_y = 0; base_y < height; base_y += tile_sz)
+ {
+ for (base_x = 0; base_x < width; base_x += tile_sz)
+ {
+ /* exporting all tiles from the output buffer */
+ bufpix_size = 3 * tile_sz * tile_sz;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ bufpix_size *= 2;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2tool Export: Insufficient Memory !!!\n");
+ goto error;
+ }
+ rl2_prime_void_tile (bufpix, tile_sz, tile_sz, sample_type,
+ 3, no_data);
+ copy_from_outbuf_to_tile (outbuf, bufpix, sample_type,
+ 3, width, height, tile_sz,
+ tile_sz, base_y, base_x);
+ raster =
+ rl2_create_raster (tile_sz, tile_sz, sample_type,
+ RL2_PIXEL_RGB, 3, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ bufpix = NULL;
+ if (raster == NULL)
+ goto error;
+ if (rl2_write_tiff_tile (tiff, raster, base_y, base_x) !=
+ RL2_OK)
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ }
+
+ rl2_destroy_tiff_destination (tiff);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ free (outbuf);
+ return RL2_OK;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ if (outbuf != NULL)
+ free (outbuf);
+ if (bufpix != NULL)
+ free (bufpix);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_export_mono_band_tiff_from_dbms (sqlite3 * handle, const char *dst_path,
+ rl2CoveragePtr cvg, double x_res,
+ double y_res, double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height,
+ unsigned char mono_band,
+ unsigned char compression,
+ unsigned int tile_sz)
+{
+/* exporting a plain Mono-Band TIFF from the DBMS into the file-system */
+ rl2RasterPtr raster = NULL;
+ rl2PixelPtr no_data_multi = NULL;
+ rl2PixelPtr no_data = NULL;
+ rl2TiffDestinationPtr tiff = NULL;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int srid;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ unsigned int base_x;
+ unsigned int base_y;
+ unsigned char out_pixel;
+
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ return RL2_ERROR;
+
+ if (mismatching_size
+ (width, height, xx_res, yy_res, minx, miny, maxx, maxy))
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (pixel_type != RL2_PIXEL_RGB && pixel_type != RL2_PIXEL_MULTIBAND)
+ goto error;
+ if (sample_type != RL2_SAMPLE_UINT8 && sample_type != RL2_SAMPLE_UINT16)
+ goto error;
+ if (mono_band >= num_bands)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &srid) != RL2_OK)
+ goto error;
+ no_data_multi = rl2_get_coverage_no_data (cvg);
+ no_data = rl2_create_mono_band_pixel (no_data_multi, mono_band);
+
+ if (rl2_get_mono_band_raw_raster_data
+ (handle, cvg, width, height, minx, miny, maxx, maxy, xx_res,
+ yy_res, mono_band, &outbuf, &outbuf_size, no_data) != RL2_OK)
+ goto error;
+
+ if (sample_type == RL2_SAMPLE_UINT16)
+ out_pixel = RL2_PIXEL_DATAGRID;
+ else
+ out_pixel = RL2_PIXEL_GRAYSCALE;
+
+ tiff =
+ rl2_create_tiff_destination (dst_path, width, height, sample_type,
+ out_pixel, 1, NULL,
+ compression, 1, tile_sz);
+ if (tiff == NULL)
+ goto error;
+ for (base_y = 0; base_y < height; base_y += tile_sz)
+ {
+ for (base_x = 0; base_x < width; base_x += tile_sz)
+ {
+ /* exporting all tiles from the output buffer */
+ bufpix_size = tile_sz * tile_sz;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ bufpix_size *= 2;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "rl2tool Export: Insufficient Memory !!!\n");
+ goto error;
+ }
+ rl2_prime_void_tile (bufpix, tile_sz, tile_sz, sample_type,
+ 1, no_data);
+ copy_from_outbuf_to_tile (outbuf, bufpix, sample_type,
+ 1, width, height, tile_sz,
+ tile_sz, base_y, base_x);
+ raster =
+ rl2_create_raster (tile_sz, tile_sz, sample_type,
+ out_pixel, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ bufpix = NULL;
+ if (raster == NULL)
+ goto error;
+ if (rl2_write_tiff_tile (tiff, raster, base_y, base_x) !=
+ RL2_OK)
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ }
+ }
+
+ rl2_destroy_tiff_destination (tiff);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ free (outbuf);
+ return RL2_OK;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ if (outbuf != NULL)
+ free (outbuf);
+ if (bufpix != NULL)
+ free (bufpix);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_export_ascii_grid_from_dbms (sqlite3 * handle, const char *dst_path,
+ rl2CoveragePtr cvg, double res,
+ double minx, double miny, double maxx,
+ double maxy, unsigned int width,
+ unsigned int height, int is_centered,
+ int decimal_digits)
+{
+/* exporting an ASCII Grid from the DBMS into the file-system */
+ rl2PalettePtr palette = NULL;
+ rl2AsciiGridDestinationPtr ascii = NULL;
+ rl2PixelPtr pixel;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = res;
+ double yy_res = res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ double no_data = -9999.0;
+ unsigned int base_y;
+ unsigned char *pixels = NULL;
+ int pixels_size;
+
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ return RL2_ERROR;
+
+ if (mismatching_size
+ (width, height, xx_res, yy_res, minx, miny, maxx, maxy))
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+
+ if (pixel_type != RL2_PIXEL_DATAGRID || num_bands != 1)
+ goto error;
+
+ pixel = rl2_get_coverage_no_data (cvg);
+ if (pixel != NULL)
+ {
+ /* attempting to retrieve the NO-DATA value */
+ unsigned char st;
+ unsigned char pt;
+ unsigned char nb;
+ if (rl2_get_pixel_type (pixel, &st, &pt, &nb) == RL2_OK)
+ {
+ if (st == RL2_SAMPLE_INT8)
+ {
+ char v8;
+ if (rl2_get_pixel_sample_int8 (pixel, &v8) == RL2_OK)
+ no_data = v8;
+ }
+ if (st == RL2_SAMPLE_UINT8)
+ {
+ unsigned char vu8;
+ if (rl2_get_pixel_sample_uint8 (pixel, 0, &vu8) == RL2_OK)
+ no_data = vu8;
+ }
+ if (st == RL2_SAMPLE_INT16)
+ {
+ short v16;
+ if (rl2_get_pixel_sample_int16 (pixel, &v16) == RL2_OK)
+ no_data = v16;
+ }
+ if (st == RL2_SAMPLE_UINT16)
+ {
+ unsigned short vu16;
+ if (rl2_get_pixel_sample_uint16 (pixel, 0, &vu16) ==
+ RL2_OK)
+ no_data = vu16;
+ }
+ if (st == RL2_SAMPLE_INT32)
+ {
+ int v32;
+ if (rl2_get_pixel_sample_int32 (pixel, &v32) == RL2_OK)
+ no_data = v32;
+ }
+ if (st == RL2_SAMPLE_UINT32)
+ {
+ unsigned int vu32;
+ if (rl2_get_pixel_sample_uint32 (pixel, &vu32) == RL2_OK)
+ no_data = vu32;
+ }
+ if (st == RL2_SAMPLE_FLOAT)
+ {
+ float vflt;
+ if (rl2_get_pixel_sample_float (pixel, &vflt) == RL2_OK)
+ no_data = vflt;
+ }
+ if (st == RL2_SAMPLE_DOUBLE)
+ {
+ double vdbl;
+ if (rl2_get_pixel_sample_double (pixel, &vdbl) == RL2_OK)
+ no_data = vdbl;
+ }
+ }
+ }
+
+ if (rl2_get_raw_raster_data
+ (handle, cvg, width, height, minx, miny, maxx, maxy, res, res, &pixels,
+ &pixels_size, &palette, RL2_PIXEL_DATAGRID) != RL2_OK)
+ goto error;
+
+ ascii =
+ rl2_create_ascii_grid_destination (dst_path, width, height,
+ xx_res, minx, miny, is_centered,
+ no_data, decimal_digits, pixels,
+ pixels_size, sample_type);
+ if (ascii == NULL)
+ goto error;
+ pixels = NULL; /* pix-buffer ownership now belongs to the ASCII object */
+/* writing the ASCII Grid header */
+ if (rl2_write_ascii_grid_header (ascii) != RL2_OK)
+ goto error;
+ for (base_y = 0; base_y < height; base_y++)
+ {
+ /* exporting all scanlines from the output buffer */
+ unsigned int line_no;
+ if (rl2_write_ascii_grid_scanline (ascii, &line_no) != RL2_OK)
+ goto error;
+ }
+
+ rl2_destroy_ascii_grid_destination (ascii);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return RL2_OK;
+
+ error:
+ if (ascii != NULL)
+ rl2_destroy_ascii_grid_destination (ascii);
+ if (pixels != NULL)
+ free (pixels);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_export_jpeg_from_dbms (sqlite3 * handle, const char *dst_path,
+ rl2CoveragePtr cvg, double x_res,
+ double y_res, double minx, double miny,
+ double maxx, double maxy,
+ unsigned int width,
+ unsigned int height, int quality, int with_worldfile)
+{
+/* exporting a JPEG (with possible JGW) from the DBMS into the file-system */
+ rl2SectionPtr section = NULL;
+ rl2RasterPtr raster = NULL;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ return RL2_ERROR;
+
+ if (mismatching_size
+ (width, height, xx_res, yy_res, minx, miny, maxx, maxy))
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (sample_type == RL2_SAMPLE_UINT8 && pixel_type == RL2_PIXEL_GRAYSCALE
+ && num_bands == 1)
+ ;
+ else if (sample_type == RL2_SAMPLE_UINT8 && pixel_type == RL2_PIXEL_RGB
+ && num_bands == 3)
+ ;
+ else
+ goto error;
+
+ if (rl2_get_raw_raster_data
+ (handle, cvg, width, height, minx, miny, maxx, maxy, xx_res,
+ yy_res, &outbuf, &outbuf_size, NULL, pixel_type) != RL2_OK)
+ goto error;
+
+ raster =
+ rl2_create_raster (width, height, sample_type, pixel_type, num_bands,
+ outbuf, outbuf_size, NULL, NULL, 0, NULL);
+ outbuf = NULL;
+ if (raster == NULL)
+ goto error;
+ section =
+ rl2_create_section ("jpeg", RL2_COMPRESSION_JPEG, 256, 256, raster);
+ raster = NULL;
+ if (section == NULL)
+ goto error;
+ if (rl2_section_to_jpeg (section, dst_path, quality) != RL2_OK)
+ goto error;
+
+ if (with_worldfile)
+ {
+ /* exporting the JGW WorldFile */
+ write_jgw_worldfile (dst_path, minx, maxy, x_res, y_res);
+ }
+
+ rl2_destroy_section (section);
+ return RL2_OK;
+
+ error:
+ if (section != NULL)
+ rl2_destroy_section (section);
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (outbuf != NULL)
+ free (outbuf);
+ return RL2_ERROR;
+}
diff --git a/src/rl2jpeg.c b/src/rl2jpeg.c
new file mode 100644
index 0000000..af97ad9
--- /dev/null
+++ b/src/rl2jpeg.c
@@ -0,0 +1,1344 @@
+/*
+
+ rl2jpeg -- JPEG related functions
+
+ version 0.1, 2013 March 29
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <jpeglib.h>
+#include <jerror.h>
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2tiff.h"
+#include "rasterlite2_private.h"
+
+#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */
+
+typedef struct
+{
+ struct jpeg_destination_mgr pub; /* public fields */
+
+ unsigned char **outbuffer; /* target buffer */
+ unsigned long *outsize;
+ unsigned char *newbuffer; /* newly allocated buffer */
+ JOCTET *buffer; /* start of buffer */
+ size_t bufsize;
+ boolean alloc;
+} jpeg_mem_destination_mgr;
+typedef jpeg_mem_destination_mgr *jpeg_mem_dest_ptr;
+
+static int
+empty_mem_output_buffer (j_compress_ptr cinfo)
+{
+/*
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * Modified 2009-2010 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+*/
+ size_t nextsize;
+ JOCTET *nextbuffer;
+ jpeg_mem_dest_ptr dest = (jpeg_mem_dest_ptr) cinfo->dest;
+
+ if (!dest->alloc)
+ ERREXIT (cinfo, JERR_BUFFER_SIZE);
+
+ /* Try to allocate new buffer with double size */
+ nextsize = dest->bufsize * 2;
+ nextbuffer = malloc (nextsize);
+
+ if (nextbuffer == NULL)
+ ERREXIT1 (cinfo, JERR_OUT_OF_MEMORY, 10);
+
+ memcpy (nextbuffer, dest->buffer, dest->bufsize);
+
+ if (dest->newbuffer != NULL)
+ free (dest->newbuffer);
+
+ dest->newbuffer = nextbuffer;
+
+ dest->pub.next_output_byte = nextbuffer + dest->bufsize;
+ dest->pub.free_in_buffer = dest->bufsize;
+
+ dest->buffer = nextbuffer;
+ dest->bufsize = nextsize;
+
+ return 1;
+}
+
+static void
+init_mem_destination (j_compress_ptr cinfo)
+{
+/* just silencing stupid compiler warnings */
+ if (cinfo == NULL)
+ cinfo = NULL;
+}
+
+static void
+term_mem_destination (j_compress_ptr cinfo)
+{
+/*
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * Modified 2009-2010 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+*/
+ jpeg_mem_dest_ptr dest = (jpeg_mem_dest_ptr) cinfo->dest;
+
+ if (dest->alloc)
+ *dest->outbuffer = dest->buffer;
+ *dest->outsize = (unsigned long) (dest->bufsize - dest->pub.free_in_buffer);
+}
+
+static int
+fill_mem_input_buffer (j_decompress_ptr cinfo)
+{
+/*
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * Modified 2009-2010 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+*/
+ static JOCTET mybuffer[4];
+
+ /* The whole JPEG data is expected to reside in the supplied memory
+ * buffer, so any request for more data beyond the given buffer size
+ * is treated as an error.
+ */
+ WARNMS (cinfo, JWRN_JPEG_EOF);
+ /* Insert a fake EOI marker */
+ mybuffer[0] = (JOCTET) 0xFF;
+ mybuffer[1] = (JOCTET) JPEG_EOI;
+
+ cinfo->src->next_input_byte = mybuffer;
+ cinfo->src->bytes_in_buffer = 2;
+
+ return 1;
+}
+
+static void
+skip_input_data (j_decompress_ptr cinfo, long num_bytes)
+{
+/*
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * Modified 2009-2010 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+*/
+ struct jpeg_source_mgr *src = cinfo->src;
+
+ /* Just a dumb implementation for now. Could use fseek() except
+ * it doesn't work on pipes. Not clear that being smart is worth
+ * any trouble anyway --- large skips are infrequent.
+ */
+ if (num_bytes > 0)
+ {
+ while (num_bytes > (long) src->bytes_in_buffer)
+ {
+ num_bytes -= (long) src->bytes_in_buffer;
+ (void) (*src->fill_input_buffer) (cinfo);
+ /* note we assume that fill_input_buffer will never return FALSE,
+ * so suspension need not be handled.
+ */
+ }
+ src->next_input_byte += (size_t) num_bytes;
+ src->bytes_in_buffer -= (size_t) num_bytes;
+ }
+}
+
+static void
+term_source (j_decompress_ptr cinfo)
+{
+/* just silencing stupid compiler warnings */
+ if (cinfo == NULL)
+ cinfo = NULL;
+}
+
+static void
+init_mem_source (j_decompress_ptr cinfo)
+{
+/* just silencing stupid compiler warnings */
+ if (cinfo == NULL)
+ cinfo = NULL;
+}
+
+static void
+rl2_jpeg_src (j_decompress_ptr cinfo,
+ unsigned char *inbuffer, unsigned long insize)
+{
+/*
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * Modified 2009-2010 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+*/
+ struct jpeg_source_mgr *src;
+
+ if (inbuffer == NULL || insize == 0) /* Treat empty input as fatal error */
+ ERREXIT (cinfo, JERR_INPUT_EMPTY);
+
+ /* The source object is made permanent so that a series of JPEG images
+ * can be read from the same buffer by calling jpeg_mem_src only before
+ * the first one.
+ */
+ if (cinfo->src == NULL)
+ { /* first time for this JPEG object? */
+ cinfo->src = (struct jpeg_source_mgr *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+ sizeof (struct jpeg_source_mgr));
+ }
+
+ src = cinfo->src;
+ src->init_source = init_mem_source;
+ src->fill_input_buffer = fill_mem_input_buffer;
+ src->skip_input_data = skip_input_data;
+ src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
+ src->term_source = term_source;
+ src->bytes_in_buffer = (size_t) insize;
+ src->next_input_byte = (JOCTET *) inbuffer;
+}
+
+static void
+rl2_jpeg_dest (j_compress_ptr cinfo,
+ unsigned char **outbuffer, unsigned long *outsize)
+{
+/*
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * Modified 2009-2010 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+*/
+ jpeg_mem_dest_ptr dest;
+
+ if (outbuffer == NULL || outsize == NULL) /* sanity check */
+ ERREXIT (cinfo, JERR_BUFFER_SIZE);
+
+ /* The destination object is made permanent so that multiple JPEG images
+ * can be written to the same buffer without re-executing jpeg_mem_dest.
+ */
+ if (cinfo->dest == NULL)
+ { /* first time for this JPEG object? */
+ cinfo->dest = (struct jpeg_destination_mgr *)
+ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+ sizeof (jpeg_mem_destination_mgr));
+ dest = (jpeg_mem_dest_ptr) cinfo->dest;
+ dest->newbuffer = NULL;
+ }
+
+ dest = (jpeg_mem_dest_ptr) cinfo->dest;
+ dest->pub.init_destination = init_mem_destination;
+ dest->pub.empty_output_buffer = empty_mem_output_buffer;
+ dest->pub.term_destination = term_mem_destination;
+ dest->outbuffer = outbuffer;
+ dest->outsize = outsize;
+ dest->alloc = 1;
+
+ if (*outbuffer == NULL || *outsize == 0)
+ {
+ /* Allocate initial buffer */
+ dest->newbuffer = *outbuffer = malloc (OUTPUT_BUF_SIZE);
+ if (dest->newbuffer == NULL)
+ ERREXIT1 (cinfo, JERR_OUT_OF_MEMORY, 10);
+ *outsize = OUTPUT_BUF_SIZE;
+ }
+
+ dest->pub.next_output_byte = dest->buffer = *outbuffer;
+ dest->pub.free_in_buffer = dest->bufsize = *outsize;
+}
+
+static void
+CMYK2RGB (int c, int m, int y, int k, int inverted, unsigned char *p)
+{
+/* converting from CMYK to RGB */
+ if (inverted)
+ {
+ c = 255 - c;
+ m = 255 - m;
+ y = 255 - y;
+ k = 255 - k;
+ }
+ *p++ = (255 - c) * (255 - k) / 255;
+ *p++ = (255 - m) * (255 - k) / 255;
+ *p++ = (255 - y) * (255 - k) / 255;
+}
+
+static int
+check_jpeg_compatibility (unsigned char sample_type, unsigned char pixel_type,
+ unsigned char num_samples)
+{
+/* checks for JPEG compatibility */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_PALETTE:
+ case RL2_PIXEL_GRAYSCALE:
+ case RL2_PIXEL_RGB:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 1)
+ return RL2_ERROR;
+ }
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 1)
+ return RL2_ERROR;
+ }
+ if (pixel_type == RL2_PIXEL_GRAYSCALE)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 1)
+ return RL2_ERROR;
+ }
+ if (pixel_type == RL2_PIXEL_RGB)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 3)
+ return RL2_ERROR;
+ }
+ return RL2_OK;
+}
+
+static int
+compress_jpeg (unsigned short width, unsigned short height,
+ unsigned char sample_type, unsigned char pixel_type,
+ const unsigned char *pixel_buffer,
+ const unsigned char *mask_buffer, rl2PalettePtr palette,
+ unsigned char **jpeg, int *jpeg_size, int quality)
+{
+/* compressing a JPG image */
+ struct jpeg_compress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+ unsigned char *outbuffer = NULL;
+ unsigned long outsize = 0;
+ volatile JSAMPROW scanline = NULL;
+ JSAMPROW rowptr[1];
+ JSAMPROW p_row;
+ const char *comment;
+ const unsigned char *p_data;
+ const unsigned char *p_mask;
+ unsigned int row;
+ unsigned int col;
+ unsigned short num_entries;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+
+ cinfo.err = jpeg_std_error (&jerr);
+ jpeg_create_compress (&cinfo);
+ rl2_jpeg_dest (&cinfo, &outbuffer, &outsize);
+ cinfo.image_width = width;
+ cinfo.image_height = height;
+ if (pixel_type == RL2_PIXEL_MONOCHROME || pixel_type == RL2_PIXEL_GRAYSCALE)
+ {
+ /* GRAYSCALE */
+ cinfo.input_components = 1;
+ cinfo.in_color_space = JCS_GRAYSCALE;
+ }
+ else
+ {
+ /* RGB */
+ cinfo.input_components = 3;
+ cinfo.in_color_space = JCS_RGB;
+ }
+ jpeg_set_defaults (&cinfo);
+ if (quality > 100)
+ quality = 100;
+ if (quality < 0)
+ quality = 75;
+ jpeg_set_quality (&cinfo, quality, 1);
+ scanline =
+ (JSAMPROW) calloc (1,
+ cinfo.image_width * cinfo.input_components *
+ sizeof (JSAMPLE));
+ if (scanline == NULL)
+ goto error;
+ rowptr[0] = scanline;
+ jpeg_start_compress (&cinfo, 1);
+ comment = "CREATOR: RasterLite2\n";
+ jpeg_write_marker (&cinfo, JPEG_COM, (unsigned char *) comment,
+ (unsigned int) strlen (comment));
+ p_data = pixel_buffer;
+ p_mask = mask_buffer;
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ /* retrieving the palette */
+ if (rl2_get_palette_colors (palette, &num_entries, &red, &green,
+ &blue) != RL2_OK)
+ goto error;
+ }
+ for (row = 0; row < (int) height; row++)
+ {
+ p_row = scanline;
+ for (col = 0; col < (int) width; col++)
+ {
+ int transparent = 1;
+ if (p_mask != NULL)
+ transparent = *p_mask++;
+ transparent = !transparent;
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ unsigned char index = *p_data++;
+ if (transparent)
+ {
+ /* transparent pixel - defaulting to WHITE */
+ *p_row++ = 255;
+ *p_row++ = 255;
+ *p_row++ = 255;
+ }
+ else
+ {
+ /* opaque pixel */
+ if (index >= num_entries)
+ {
+ /* color mismatch: default BLACK pixel */
+ *p_row++ = 0;
+ *p_row++ = 0;
+ *p_row++ = 0;
+ }
+ else
+ {
+ *p_row++ = *(red + index);
+ *p_row++ = *(green + index);
+ *p_row++ = *(blue + index);
+ }
+ }
+ }
+ else if (pixel_type == RL2_PIXEL_GRAYSCALE)
+ {
+ if (transparent)
+ {
+ /* transparent pixel - defaulting to WHITE */
+ *p_row++ = 255;
+ p_data++;
+ }
+ else
+ {
+ /* opaque pixel */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_2_BIT:
+ switch (*p_data++)
+ {
+ case 3:
+ *p_row++ = 255;
+ break;
+ case 2:
+ *p_row++ = 170;
+ break;
+ case 1:
+ *p_row++ = 86;
+ break;
+ case 0:
+ default:
+ *p_row++ = 0;
+ break;
+ };
+ break;
+ case RL2_SAMPLE_4_BIT:
+ switch (*p_data++)
+ {
+ case 15:
+ *p_row++ = 255;
+ break;
+ case 14:
+ *p_row++ = 239;
+ break;
+ case 13:
+ *p_row++ = 222;
+ break;
+ case 12:
+ *p_row++ = 205;
+ break;
+ case 11:
+ *p_row++ = 188;
+ break;
+ case 10:
+ *p_row++ = 171;
+ break;
+ case 9:
+ *p_row++ = 154;
+ break;
+ case 8:
+ *p_row++ = 137;
+ break;
+ case 7:
+ *p_row++ = 119;
+ break;
+ case 6:
+ *p_row++ = 102;
+ break;
+ case 5:
+ *p_row++ = 85;
+ break;
+ case 4:
+ *p_row++ = 68;
+ break;
+ case 3:
+ *p_row++ = 51;
+ break;
+ case 2:
+ *p_row++ = 34;
+ break;
+ case 1:
+ *p_row++ = 17;
+ break;
+ case 0:
+ default:
+ *p_row++ = 0;
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ default:
+ *p_row++ = *p_data++;
+ break;
+ };
+ }
+ }
+ else if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ if (transparent)
+ {
+ /* transparent pixel - defaulting to WHITE */
+ *p_row++ = 255;
+ p_data++;
+ }
+ else
+ {
+ /* opaque pixel */
+ if (*p_data++ == 0)
+ *p_row++ = 255;
+ else
+ *p_row++ = 0;
+ }
+ }
+ else
+ {
+ /* RGB */
+ if (transparent)
+ {
+ /* transparent pixel - defaulting to WHITE */
+ *p_row++ = 255;
+ *p_row++ = 255;
+ *p_row++ = 255;
+ p_data++;
+ p_data++;
+ p_data++;
+ }
+ else
+ {
+ /* opaque pixel */
+ *p_row++ = *p_data++;
+ *p_row++ = *p_data++;
+ *p_row++ = *p_data++;
+ }
+ }
+ }
+ jpeg_write_scanlines (&cinfo, rowptr, 1);
+ }
+ jpeg_finish_compress (&cinfo);
+ jpeg_destroy_compress (&cinfo);
+ free (scanline);
+ if (red != NULL)
+ free (red);
+ if (green != NULL)
+ free (green);
+ if (blue != NULL)
+ free (blue);
+ *jpeg = outbuffer;
+ *jpeg_size = outsize;
+ return RL2_OK;
+ error:
+ jpeg_destroy_compress (&cinfo);
+ if (scanline != NULL)
+ free (scanline);
+ if (outbuffer != NULL)
+ free (outbuffer);
+ if (red != NULL)
+ free (red);
+ if (green != NULL)
+ free (green);
+ if (blue != NULL)
+ free (blue);
+ return RL2_ERROR;
+}
+
+RL2_PRIVATE int
+rl2_blob_from_file (const char *path, unsigned char **p_blob, int *p_blob_size)
+{
+/* attempting to load a BLOB from a file */
+ int rd;
+ int blob_size;
+ unsigned char *blob;
+ FILE *in;
+
+ *p_blob = NULL;
+ *p_blob_size = 0;
+/* attempting to open the file */
+ in = fopen (path, "rb");
+ if (in == NULL)
+ return RL2_ERROR;
+
+/* querying the file length */
+ if (fseek (in, 0, SEEK_END) < 0)
+ return RL2_ERROR;
+ blob_size = ftell (in);
+ rewind (in);
+ blob = malloc (blob_size);
+ if (blob == NULL)
+ {
+ fclose (in);
+ return RL2_ERROR;
+ }
+
+/* attempting to load the BLOB from the file */
+ rd = fread (blob, 1, blob_size, in);
+ fclose (in);
+ if (rd != blob_size)
+ {
+ /* read error */
+ free (blob);
+ return RL2_ERROR;
+ }
+ *p_blob = blob;
+ *p_blob_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_PRIVATE int
+rl2_blob_to_file (const char *path, unsigned char *blob, int blob_size)
+{
+/* attempting to store a BLOB into a file */
+ int wr;
+ FILE *out;
+
+ if (blob == NULL || blob_size < 1)
+ return RL2_ERROR;
+/* attempting to open the file */
+ out = fopen (path, "wb");
+ if (out == NULL)
+ return RL2_ERROR;
+
+/* attempting to store the BLOB into the file */
+ wr = fwrite (blob, 1, blob_size, out);
+ fclose (out);
+ if (wr != blob_size)
+ {
+ /* write error */
+ return RL2_ERROR;
+ }
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_section_to_jpeg (rl2SectionPtr scn, const char *path, int quality)
+{
+/* attempting to save a raster section into a JPEG file */
+ int blob_size;
+ unsigned char *blob;
+ rl2RasterPtr rst;
+ int ret;
+
+ if (scn == NULL)
+ return RL2_ERROR;
+ rst = rl2_get_section_raster (scn);
+ if (rst == NULL)
+ return RL2_ERROR;
+/* attempting to export as a PNG image */
+ if (rl2_raster_to_jpeg (rst, &blob, &blob_size, quality) != RL2_OK)
+ return RL2_ERROR;
+ ret = rl2_blob_to_file (path, blob, blob_size);
+ free (blob);
+ if (ret != RL2_OK)
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_to_jpeg (rl2RasterPtr raster, unsigned char **jpeg, int *jpeg_size,
+ int quality)
+{
+/* creating a JPEG image from a raster */
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) raster;
+ unsigned char *blob;
+ int blob_size;
+
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (check_jpeg_compatibility (rst->sampleType, rst->pixelType, rst->nBands)
+ != RL2_OK)
+ return RL2_ERROR;
+ if (rl2_data_to_jpeg
+ (rst->rasterBuffer, rst->maskBuffer, (rl2PalettePtr) (rst->Palette),
+ rst->width, rst->height, rst->sampleType, rst->pixelType, &blob,
+ &blob_size, quality) != RL2_OK)
+ return RL2_ERROR;
+ *jpeg = blob;
+ *jpeg_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_rgb_to_jpeg (unsigned int width, unsigned int height,
+ const unsigned char *rgb, int quality, unsigned char **jpeg,
+ int *jpeg_size)
+{
+/* creating a PNG image from an RGB buffer */
+ unsigned char *blob;
+ int blob_size;
+ if (rgb == NULL)
+ return RL2_ERROR;
+
+ if (rl2_data_to_jpeg
+ (rgb, NULL, NULL, width, height, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, &blob,
+ &blob_size, quality) != RL2_OK)
+ return RL2_ERROR;
+ *jpeg = blob;
+ *jpeg_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_gray_to_jpeg (unsigned int width, unsigned int height,
+ const unsigned char *gray, int quality, unsigned char **jpeg,
+ int *jpeg_size)
+{
+/* creating a PNG image from a Grayscale buffer */
+ unsigned char *blob;
+ int blob_size;
+ if (gray == NULL)
+ return RL2_ERROR;
+
+ if (rl2_data_to_jpeg
+ (gray, NULL, NULL, width, height, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE,
+ &blob, &blob_size, quality) != RL2_OK)
+ return RL2_ERROR;
+ *jpeg = blob;
+ *jpeg_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_PRIVATE int
+rl2_data_to_jpeg (const unsigned char *pixels, const unsigned char *mask,
+ rl2PalettePtr palette, unsigned int width,
+ unsigned int height, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char **jpeg,
+ int *jpeg_size, int quality)
+{
+/* encoding a JPEG image */
+ unsigned char *blob;
+ int blob_size;
+
+ if (pixels == NULL)
+ return RL2_ERROR;
+ if (compress_jpeg
+ (width, height, sample_type, pixel_type, pixels, mask, palette, &blob,
+ &blob_size, quality) != RL2_OK)
+ return RL2_ERROR;
+ *jpeg = blob;
+ *jpeg_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2SectionPtr
+rl2_section_from_jpeg (const char *path)
+{
+/* attempting to create a raster section from a JPEG file */
+ int blob_size;
+ unsigned char *blob;
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+
+/* attempting to create a raster */
+ if (rl2_blob_from_file (path, &blob, &blob_size) != RL2_OK)
+ return NULL;
+ rst = rl2_raster_from_jpeg (blob, blob_size);
+ free (blob);
+ if (rst == NULL)
+ return NULL;
+
+/* creating the raster section */
+ scn =
+ rl2_create_section (path, RL2_COMPRESSION_JPEG, RL2_TILESIZE_UNDEFINED,
+ RL2_TILESIZE_UNDEFINED, rst);
+ return scn;
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_raster_from_jpeg (const unsigned char *jpeg, int jpeg_size)
+{
+/* attempting to create a raster from a JPEG image */
+ rl2RasterPtr rst = NULL;
+ unsigned char *data = NULL;
+ int data_size;
+ unsigned int width;
+ unsigned int height;
+ unsigned char pixel_type;
+ int nBands;
+
+ if (rl2_decode_jpeg_scaled
+ (1, jpeg, jpeg_size, &width, &height, &pixel_type, &data,
+ &data_size) != RL2_OK)
+ goto error;
+ nBands = 1;
+ if (pixel_type == RL2_PIXEL_RGB)
+ nBands = 3;
+
+/* creating the raster */
+ rst =
+ rl2_create_raster (width, height, RL2_SAMPLE_UINT8, pixel_type, nBands,
+ data, data_size, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+ return rst;
+
+ error:
+ if (rst != NULL)
+ rl2_destroy_raster (rst);
+ if (data != NULL)
+ free (data);
+ return NULL;
+}
+
+
+RL2_PRIVATE int
+rl2_decode_jpeg_scaled (int scale, const unsigned char *jpeg, int jpeg_size,
+ unsigned int *width, unsigned int *height,
+ unsigned char *xpixel_type, unsigned char **pixels,
+ int *pixels_size)
+{
+/* attempting to create a raster from a JPEG image - supporting rescaled size */
+ struct jpeg_decompress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+ unsigned char pixel_type = RL2_PIXEL_UNKNOWN;
+ int nBands;
+ int channels;
+ int inverted = 0;
+ unsigned char *data = NULL;
+ unsigned char *p_data;
+ int data_size;
+ int i;
+ int row_stride;
+ JSAMPARRAY buffer;
+
+ if (scale == 1 || scale == 2 || scale == 4 || scale == 8)
+ ;
+ else
+ goto error;
+
+ cinfo.err = jpeg_std_error (&jerr);
+ jpeg_create_decompress (&cinfo);
+ rl2_jpeg_src (&cinfo, (unsigned char *) jpeg, jpeg_size);
+ jpeg_read_header (&cinfo, TRUE);
+ if (scale == 8)
+ {
+ /* requesting 1:8 scaling */
+ cinfo.scale_num = 1;
+ }
+ else if (scale == 4)
+ {
+ /* requesting 1:4 scaling */
+ cinfo.scale_num = 2;
+ }
+ else if (scale == 2)
+ {
+ /* requesting 1:2 scaling */
+ cinfo.scale_num = 4;
+ }
+ else
+ {
+ /* no scaling, full dimension */
+ cinfo.scale_num = 8;
+ }
+ cinfo.scale_denom = 8;
+ if ((cinfo.jpeg_color_space == JCS_CMYK)
+ || (cinfo.jpeg_color_space == JCS_YCCK))
+ cinfo.out_color_space = JCS_CMYK;
+ if (!jpeg_start_decompress (&cinfo))
+ goto error;
+ channels = cinfo.output_components;
+ if (cinfo.out_color_space == JCS_RGB && channels == 3)
+ {
+ pixel_type = RL2_PIXEL_RGB;
+ nBands = 3;
+ }
+ else if (cinfo.out_color_space == JCS_GRAYSCALE && channels == 1)
+ {
+ pixel_type = RL2_PIXEL_GRAYSCALE;
+ nBands = 1;
+ }
+ else if (cinfo.out_color_space == JCS_CMYK && channels == 4)
+ {
+ jpeg_saved_marker_ptr marker;
+ pixel_type = RL2_PIXEL_RGB;
+ nBands = 3;
+ marker = cinfo.marker_list;
+ while (marker)
+ {
+ if ((marker->marker == (JPEG_APP0 + 14))
+ && (marker->data_length >= 12)
+ && (!strncmp ((const char *) marker->data, "Adobe", 5)))
+ {
+ inverted = 1;
+ break;
+ }
+ marker = marker->next;
+ }
+ }
+ else
+ goto error;
+/* creating the scanline buffer */
+ row_stride = cinfo.output_width * cinfo.output_components;
+ buffer =
+ (*cinfo.mem->alloc_sarray) ((j_common_ptr) & cinfo, JPOOL_IMAGE,
+ row_stride, 1);
+ if (buffer == NULL)
+ goto error;
+/* creating the raster data */
+ data_size = cinfo.output_width * cinfo.output_height * nBands;
+ data = malloc (data_size);
+ if (data == NULL)
+ goto error;
+ p_data = data;
+ while (cinfo.output_scanline < cinfo.output_height)
+ {
+ /* reading all decompressed scanlines */
+ jpeg_read_scanlines (&cinfo, buffer, 1);
+ if (cinfo.out_color_space == JCS_CMYK)
+ {
+ JSAMPROW row = buffer[0];
+ for (i = 0; i < (int) (cinfo.output_width); i++)
+ {
+ CMYK2RGB (*(row + 0), *(row + 1), *(row + 2), *(row + 3),
+ inverted, p_data);
+ row += 4;
+ p_data += 3;
+ }
+ }
+ else if (cinfo.out_color_space == JCS_GRAYSCALE)
+ {
+ JSAMPROW row = buffer[0];
+ for (i = 0; i < (int) (cinfo.output_width); i++)
+ *p_data++ = *row++;
+ }
+ else
+ {
+ /* RGB */
+ JSAMPROW row = buffer[0];
+ for (i = 0; i < (int) (cinfo.output_width); i++)
+ {
+ *p_data++ = *row++;
+ *p_data++ = *row++;
+ *p_data++ = *row++;
+ }
+ }
+ }
+ *width = cinfo.output_width;
+ *height = cinfo.output_height;
+ *xpixel_type = pixel_type;
+ *pixels = data;
+ *pixels_size = data_size;
+/* memory cleanup */
+ jpeg_finish_decompress (&cinfo);
+ jpeg_destroy_decompress (&cinfo);
+ return RL2_OK;
+
+ error:
+ jpeg_destroy_decompress (&cinfo);
+ if (data != NULL)
+ free (data);
+ return RL2_ERROR;
+}
+
+static int
+read_jpeg_pixels_gray (rl2PrivRasterPtr origin, unsigned short width,
+ unsigned short height, unsigned int startRow,
+ unsigned int startCol, unsigned char *pixels)
+{
+/* Grayscale -> Grayscale */
+ unsigned short x;
+ unsigned short y;
+ unsigned short row;
+ unsigned short col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ unsigned char *p_out = pixels + (y * width);
+ unsigned char *p_in_base =
+ origin->rasterBuffer + (row * origin->width);
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ unsigned char *p_in = p_in_base + col;
+ *p_out++ = *p_in;
+ }
+ }
+ return 1;
+}
+
+static int
+read_jpeg_pixels_rgb (rl2PrivRasterPtr origin, unsigned short width,
+ unsigned short height, unsigned int startRow,
+ unsigned int startCol, unsigned char *pixels)
+{
+/* RGB -> RGB */
+ unsigned short x;
+ unsigned short y;
+ unsigned short row;
+ unsigned short col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ unsigned char *p_out = pixels + (y * width * 3);
+ unsigned char *p_in_base =
+ origin->rasterBuffer + (row * origin->width * 3);
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ unsigned char *p_in = p_in_base + (col * 3);
+ *p_out++ = *p_in++; /* red */
+ *p_out++ = *p_in++; /* green */
+ *p_out++ = *p_in++; /* blue */
+ }
+ }
+ return 1;
+}
+
+static int
+read_jpeg_pixels_gray_to_rgb (rl2PrivRasterPtr origin, unsigned short width,
+ unsigned short height, unsigned int startRow,
+ unsigned int startCol, unsigned char *pixels)
+{
+/* Grayscale -> RGB */
+ unsigned short x;
+ unsigned short y;
+ unsigned short row;
+ unsigned short col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ unsigned char *p_out = pixels + (y * width * 3);
+ unsigned char *p_in_base =
+ origin->rasterBuffer + (row * origin->width);
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ unsigned char *p_in = p_in_base + col;
+ unsigned char value = *p_in;
+ *p_out++ = value; /* red */
+ *p_out++ = value; /* green */
+ *p_out++ = value; /* blue */
+ }
+ }
+ return 1;
+}
+
+static int
+read_jpeg_pixels_rgb_to_gray (rl2PrivRasterPtr origin, unsigned short width,
+ unsigned short height, unsigned int startRow,
+ unsigned int startCol, unsigned char *pixels)
+{
+/* RGB -> Grayscale */
+ unsigned short x;
+ unsigned short y;
+ unsigned short row;
+ unsigned short col;
+ for (y = 0, row = startRow; y < height && row < origin->height; y++, row++)
+ {
+ /* looping on rows */
+ unsigned char *p_out = pixels + (y * width);
+ unsigned char *p_in_base =
+ origin->rasterBuffer + (row * origin->width * 3);
+ for (x = 0, col = startCol; x < width && col < origin->width;
+ x++, col++)
+ {
+ unsigned char *p_in = p_in_base + (col * 3);
+ unsigned char r = *p_in++;
+ unsigned char g = *p_in++;
+ unsigned char b = *p_in++;
+ double gray =
+ ((double) r * 0.2126) + ((double) g * 0.7152) +
+ ((double) b * 0.0722);
+ *p_out++ = (unsigned char) gray;
+ }
+ }
+ return 1;
+}
+
+static int
+read_from_jpeg (rl2PrivRasterPtr origin, unsigned short width,
+ unsigned short height, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_bands,
+ unsigned char forced_conversion, unsigned int startRow,
+ unsigned int startCol, unsigned char **pixels, int *pixels_sz)
+{
+/* creating a tile from the JPEG origin */
+ int nb;
+ unsigned char *bufPixels = NULL;
+ int bufPixelsSz = 0;
+ rl2PixelPtr no_data = NULL;
+
+ no_data = rl2_create_pixel (sample_type, pixel_type, num_bands);
+ for (nb = 0; nb < num_bands; nb++)
+ rl2_set_pixel_sample_uint8 (no_data, nb, 255);
+
+/* allocating the pixels buffer */
+ bufPixelsSz = width * height * num_bands;
+ bufPixels = malloc (bufPixelsSz);
+ if (bufPixels == NULL)
+ goto error;
+ if ((startRow + height) > origin->height
+ || (startCol + width) > origin->width)
+ rl2_prime_void_tile (bufPixels, width, height, sample_type, num_bands,
+ no_data);
+
+ if (pixel_type == RL2_PIXEL_GRAYSCALE
+ && forced_conversion == RL2_CONVERT_NO)
+ {
+ if (!read_jpeg_pixels_gray
+ (origin, width, height, startRow, startCol, bufPixels))
+ goto error;
+ }
+ if (pixel_type == RL2_PIXEL_GRAYSCALE
+ && forced_conversion == RL2_CONVERT_RGB_TO_GRAYSCALE)
+ {
+ if (!read_jpeg_pixels_rgb_to_gray
+ (origin, width, height, startRow, startCol, bufPixels))
+ goto error;
+ }
+ if (pixel_type == RL2_PIXEL_RGB && forced_conversion == RL2_CONVERT_NO)
+ {
+ if (!read_jpeg_pixels_rgb
+ (origin, width, height, startRow, startCol, bufPixels))
+ goto error;
+ }
+ if (pixel_type == RL2_PIXEL_RGB
+ && forced_conversion == RL2_CONVERT_GRAYSCALE_TO_RGB)
+ {
+ if (!read_jpeg_pixels_gray_to_rgb
+ (origin, width, height, startRow, startCol, bufPixels))
+ goto error;
+ }
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+
+ *pixels = bufPixels;
+ *pixels_sz = bufPixelsSz;
+ return RL2_OK;
+ error:
+ if (bufPixels != NULL)
+ free (bufPixels);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return RL2_ERROR;
+}
+
+static int
+eval_jpeg_origin_compatibility (rl2PrivCoveragePtr coverage,
+ rl2PrivRasterPtr raster,
+ unsigned char forced_conversion)
+{
+/* checking for strict compatibility */
+ if (coverage->sampleType == RL2_SAMPLE_UINT8
+ && coverage->pixelType == RL2_PIXEL_GRAYSCALE && coverage->nBands == 1)
+ {
+ if (raster->sampleType == RL2_SAMPLE_UINT8
+ && raster->pixelType == RL2_PIXEL_GRAYSCALE && raster->nBands == 1
+ && forced_conversion == RL2_CONVERT_NO)
+ return 1;
+ if (raster->sampleType == RL2_SAMPLE_UINT8
+ && raster->pixelType == RL2_PIXEL_RGB && raster->nBands == 3
+ && forced_conversion == RL2_CONVERT_RGB_TO_GRAYSCALE)
+ return 1;
+ }
+ if (coverage->sampleType == RL2_SAMPLE_UINT8
+ && coverage->pixelType == RL2_PIXEL_RGB && coverage->nBands == 3)
+ {
+ if (raster->sampleType == RL2_SAMPLE_UINT8
+ && raster->pixelType == RL2_PIXEL_RGB && raster->nBands == 3
+ && forced_conversion == RL2_CONVERT_NO)
+ return 1;
+ if (raster->sampleType == RL2_SAMPLE_UINT8
+ && raster->pixelType == RL2_PIXEL_GRAYSCALE && raster->nBands == 1
+ && forced_conversion == RL2_CONVERT_GRAYSCALE_TO_RGB)
+ return 1;
+ }
+ return 0;
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_get_tile_from_jpeg_origin (rl2CoveragePtr cvg, rl2RasterPtr jpeg,
+ unsigned int startRow, unsigned int startCol,
+ unsigned char forced_conversion)
+{
+/* attempting to create a Coverage-tile from a JPEG origin */
+ unsigned int x;
+ rl2PrivCoveragePtr coverage = (rl2PrivCoveragePtr) cvg;
+ rl2PrivRasterPtr origin = (rl2PrivRasterPtr) jpeg;
+ rl2RasterPtr raster = NULL;
+ unsigned char *pixels = NULL;
+ int pixels_sz = 0;
+ unsigned char *mask = NULL;
+ int mask_size = 0;
+ unsigned int unused_width = 0;
+ unsigned int unused_height = 0;
+
+ if (coverage == NULL || origin == NULL)
+ return NULL;
+ if (!eval_jpeg_origin_compatibility (coverage, origin, forced_conversion))
+ return NULL;
+
+/* testing for tile's boundary validity */
+ if (startCol > origin->width)
+ return NULL;
+ if (startRow > origin->height)
+ return NULL;
+ x = startCol / coverage->tileWidth;
+ if ((x * coverage->tileWidth) != startCol)
+ return NULL;
+ x = startRow / coverage->tileHeight;
+ if ((x * coverage->tileHeight) != startRow)
+ return NULL;
+
+/* attempting to create the tile */
+ if (read_from_jpeg
+ (origin, coverage->tileWidth, coverage->tileHeight,
+ coverage->sampleType, coverage->pixelType, coverage->nBands,
+ forced_conversion, startRow, startCol, &pixels, &pixels_sz) != RL2_OK)
+ goto error;
+ if (startCol + coverage->tileWidth > origin->width)
+ unused_width = (startCol + coverage->tileWidth) - origin->width;
+ if (startRow + coverage->tileHeight > origin->height)
+ unused_height = (startRow + coverage->tileHeight) - origin->height;
+ if (unused_width || unused_height)
+ {
+ /*
+ * creating a Transparency Mask so to shadow any
+ * unused portion of the current tile
+ */
+ unsigned int shadow_x = coverage->tileWidth - unused_width;
+ unsigned int shadow_y = coverage->tileHeight - unused_height;
+ unsigned int row;
+ mask_size = coverage->tileWidth * coverage->tileHeight;
+ mask = malloc (mask_size);
+ if (mask == NULL)
+ goto error;
+ /* full Transparent mask */
+ memset (mask, 0, coverage->tileWidth * coverage->tileHeight);
+ for (row = 0; row < coverage->tileHeight; row++)
+ {
+ unsigned char *p = mask + (row * coverage->tileWidth);
+ if (row < shadow_y)
+ {
+ /* setting opaque pixels */
+ memset (p, 1, shadow_x);
+ }
+ }
+ }
+ raster =
+ rl2_create_raster (coverage->tileWidth, coverage->tileHeight,
+ coverage->sampleType, coverage->pixelType,
+ coverage->nBands, pixels, pixels_sz, NULL, mask,
+ mask_size, NULL);
+ if (raster == NULL)
+ goto error;
+ return raster;
+ error:
+ if (pixels != NULL)
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return NULL;
+}
diff --git a/src/rl2paint.c b/src/rl2paint.c
new file mode 100644
index 0000000..05ab535
--- /dev/null
+++ b/src/rl2paint.c
@@ -0,0 +1,1715 @@
+/*
+
+ rl2paint -- Cairco graphics functions
+
+ version 0.1, 2013 September 29
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the RasterLite2 library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2graphics.h"
+#include "rasterlite2_private.h"
+
+#ifdef __ANDROID__ /* Android specific */
+#include <cairo.h>
+#include <cairo-svg.h>
+#include <cairo-pdf.h>
+#else /* any other standard platform (Win, Linux, Mac) */
+#include <cairo/cairo.h>
+#include <cairo/cairo-svg.h>
+#include <cairo/cairo-pdf.h>
+#endif /* end Android conditionals */
+
+#define RL2_SURFACE_IMG 2671
+#define RL2_SURFACE_SVG 1267
+#define RL2_SURFACE_PDF 1276
+
+struct rl2_graphics_pen
+{
+/* a struct wrapping a Cairo Pen */
+ double red;
+ double green;
+ double blue;
+ double alpha;
+ double width;
+ double lengths[4];
+ int lengths_count;
+};
+
+struct rl2_graphics_brush
+{
+/* a struct wrapping a Cairo Brush */
+ int is_solid_color;
+ int is_linear_gradient;
+ int is_pattern;
+ double red;
+ double green;
+ double blue;
+ double alpha;
+ double x0;
+ double y0;
+ double x1;
+ double y1;
+ double red2;
+ double green2;
+ double blue2;
+ double alpha2;
+ cairo_pattern_t *pattern;
+};
+
+typedef struct rl2_graphics_context
+{
+/* a Cairo based painting context */
+ int type;
+ cairo_surface_t *surface;
+ cairo_surface_t *clip_surface;
+ cairo_t *cairo;
+ cairo_t *clip_cairo;
+ struct rl2_graphics_pen current_pen;
+ struct rl2_graphics_brush current_brush;
+ double font_red;
+ double font_green;
+ double font_blue;
+ double font_alpha;
+ int is_font_outlined;
+ double font_outline_width;
+} RL2GraphContext;
+typedef RL2GraphContext *RL2GraphContextPtr;
+
+typedef struct rl2_graphics_pattern_brush
+{
+/* a Cairo based pattern brush */
+ int width;
+ int height;
+ unsigned char *rgba;
+ cairo_surface_t *bitmap;
+ cairo_pattern_t *pattern;
+} RL2GraphPatternBrush;
+typedef RL2GraphPatternBrush *RL2GraphPatternBrushPtr;
+
+typedef struct rl2_graphics_font
+{
+/* a struct wrapping a Cairo Font */
+ double size;
+ int is_outlined;
+ double outline_width;
+ int style;
+ int weight;
+ double red;
+ double green;
+ double blue;
+ double alpha;
+} RL2GraphFont;
+typedef RL2GraphFont *RL2GraphFontPtr;
+
+typedef struct rl2_graphics_bitmap
+{
+/* a Cairo based symbol bitmap */
+ int width;
+ int height;
+ unsigned char *rgba;
+ cairo_surface_t *bitmap;
+ cairo_pattern_t *pattern;
+} RL2GraphBitmap;
+typedef RL2GraphBitmap *RL2GraphBitmapPtr;
+
+RL2_DECLARE rl2GraphicsContextPtr
+rl2_graph_create_context (int width, int height)
+{
+/* creating a generic Graphics Context */
+ RL2GraphContextPtr ctx;
+
+ ctx = malloc (sizeof (RL2GraphContext));
+ if (!ctx)
+ return NULL;
+
+ ctx->type = RL2_SURFACE_IMG;
+ ctx->clip_surface = NULL;
+ ctx->clip_cairo = NULL;
+ ctx->surface =
+ cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
+ if (cairo_surface_status (ctx->surface) == CAIRO_STATUS_SUCCESS)
+ ;
+ else
+ goto error1;
+ ctx->cairo = cairo_create (ctx->surface);
+ if (cairo_status (ctx->cairo) == CAIRO_STATUS_NO_MEMORY)
+ goto error2;
+
+/* setting up a default Black Pen */
+ ctx->current_pen.red = 0.0;
+ ctx->current_pen.green = 0.0;
+ ctx->current_pen.blue = 0.0;
+ ctx->current_pen.alpha = 1.0;
+ ctx->current_pen.width = 1.0;
+ ctx->current_pen.lengths[0] = 1.0;
+ ctx->current_pen.lengths_count = 1;
+
+/* setting up a default Black Brush */
+ ctx->current_brush.is_solid_color = 1;
+ ctx->current_brush.is_linear_gradient = 0;
+ ctx->current_brush.is_pattern = 0;
+ ctx->current_brush.red = 0.0;
+ ctx->current_brush.green = 0.0;
+ ctx->current_brush.blue = 0.0;
+ ctx->current_brush.alpha = 1.0;
+ ctx->current_brush.pattern = NULL;
+
+/* priming a transparent background */
+ cairo_rectangle (ctx->cairo, 0, 0, width, height);
+ cairo_set_source_rgba (ctx->cairo, 0.0, 0.0, 0.0, 0.0);
+ cairo_fill (ctx->cairo);
+
+/* setting up default Font options */
+ ctx->font_red = 0.0;
+ ctx->font_green = 0.0;
+ ctx->font_blue = 0.0;
+ ctx->font_alpha = 1.0;
+ ctx->is_font_outlined = 0;
+ ctx->font_outline_width = 0.0;
+ return (rl2GraphicsContextPtr) ctx;
+ error2:
+ cairo_destroy (ctx->cairo);
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+ error1:
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+}
+
+static void
+destroy_context (RL2GraphContextPtr ctx)
+{
+/* memory cleanup - destroying a Graphics Context */
+ if (ctx == NULL)
+ return;
+ cairo_destroy (ctx->cairo);
+ cairo_surface_destroy (ctx->surface);
+ free (ctx);
+}
+
+static void
+destroy_svg_context (RL2GraphContextPtr ctx)
+{
+/* freeing an SVG Graphics Context */
+ if (ctx == NULL)
+ return;
+ cairo_surface_show_page (ctx->surface);
+ cairo_destroy (ctx->cairo);
+ cairo_surface_finish (ctx->surface);
+ cairo_surface_destroy (ctx->surface);
+ free (ctx);
+}
+
+static void
+destroy_pdf_context (RL2GraphContextPtr ctx)
+{
+/* freeing an PDF Graphics Context */
+ if (ctx == NULL)
+ return;
+ cairo_surface_finish (ctx->clip_surface);
+ cairo_surface_destroy (ctx->clip_surface);
+ cairo_destroy (ctx->clip_cairo);
+ cairo_surface_show_page (ctx->surface);
+ cairo_destroy (ctx->cairo);
+ cairo_surface_finish (ctx->surface);
+ cairo_surface_destroy (ctx->surface);
+ free (ctx);
+}
+
+RL2_DECLARE void
+rl2_graph_destroy_context (rl2GraphicsContextPtr context)
+{
+/* memory cleanup - destroying a Graphics Context */
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return;
+ if (ctx->type == RL2_SURFACE_SVG)
+ destroy_svg_context (ctx);
+ else if (ctx->type == RL2_SURFACE_PDF)
+ destroy_pdf_context (ctx);
+ else
+ destroy_context (ctx);
+}
+
+RL2_DECLARE rl2GraphicsContextPtr
+rl2_graph_create_svg_context (const char *path, int width, int height)
+{
+/* creating an SVG Graphics Context */
+ RL2GraphContextPtr ctx;
+
+ ctx = malloc (sizeof (RL2GraphContext));
+ if (!ctx)
+ return NULL;
+
+ ctx->type = RL2_SURFACE_SVG;
+ ctx->clip_surface = NULL;
+ ctx->clip_cairo = NULL;
+ ctx->surface =
+ cairo_svg_surface_create (path, (double) width, (double) height);
+
+ if (cairo_surface_status (ctx->surface) == CAIRO_STATUS_SUCCESS)
+ ;
+ else
+ goto error1;
+ ctx->cairo = cairo_create (ctx->surface);
+ if (cairo_status (ctx->cairo) == CAIRO_STATUS_NO_MEMORY)
+ goto error2;
+
+/* setting up a default Black Pen */
+ ctx->current_pen.red = 0.0;
+ ctx->current_pen.green = 0.0;
+ ctx->current_pen.blue = 0.0;
+ ctx->current_pen.alpha = 1.0;
+ ctx->current_pen.width = 1.0;
+ ctx->current_pen.lengths[0] = 1.0;
+ ctx->current_pen.lengths_count = 1;
+
+/* setting up a default Black Brush */
+ ctx->current_brush.is_solid_color = 1;
+ ctx->current_brush.is_linear_gradient = 0;
+ ctx->current_brush.is_pattern = 0;
+ ctx->current_brush.red = 0.0;
+ ctx->current_brush.green = 0.0;
+ ctx->current_brush.blue = 0.0;
+ ctx->current_brush.alpha = 1.0;
+ ctx->current_brush.pattern = NULL;
+
+/* priming a transparent background */
+ cairo_rectangle (ctx->cairo, 0, 0, width, height);
+ cairo_set_source_rgba (ctx->cairo, 0.0, 0.0, 0.0, 0.0);
+ cairo_fill (ctx->cairo);
+
+/* setting up default Font options */
+ ctx->font_red = 0.0;
+ ctx->font_green = 0.0;
+ ctx->font_blue = 0.0;
+ ctx->font_alpha = 1.0;
+ ctx->is_font_outlined = 0;
+ ctx->font_outline_width = 0.0;
+ return (rl2GraphicsContextPtr) ctx;
+ error2:
+ cairo_destroy (ctx->cairo);
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+ error1:
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+}
+
+RL2_DECLARE rl2GraphicsContextPtr
+rl2_graph_create_pdf_context (const char *path, int dpi, double page_width,
+ double page_height, double margin_width,
+ double margin_height)
+{
+/* creating a PDF Graphics Context */
+ RL2GraphContextPtr ctx;
+ double scale = 72.0 / (double) dpi;
+ double page2_width = page_width * 72.0;
+ double page2_height = page_height * 72.0;
+ double horz_margin_sz = margin_width * 72.0;
+ double vert_margin_sz = margin_height * 72.0;
+ double img_width = (page_width - (margin_width * 2.0)) * 72.0;
+ double img_height = (page_height - (margin_height * 2.0)) * 72.0;
+
+ ctx = malloc (sizeof (RL2GraphContext));
+ if (ctx == NULL)
+ return NULL;
+
+ ctx->type = RL2_SURFACE_PDF;
+ ctx->clip_surface = NULL;
+ ctx->clip_cairo = NULL;
+ ctx->surface = cairo_pdf_surface_create (path, page2_width, page2_height);
+ if (cairo_surface_status (ctx->surface) == CAIRO_STATUS_SUCCESS)
+ ;
+ else
+ goto error1;
+ ctx->cairo = cairo_create (ctx->surface);
+ if (cairo_status (ctx->cairo) == CAIRO_STATUS_NO_MEMORY)
+ goto error2;
+
+/* priming a transparent background */
+ cairo_rectangle (ctx->cairo, 0, 0, page2_width, page2_height);
+ cairo_set_source_rgba (ctx->cairo, 0.0, 0.0, 0.0, 0.0);
+ cairo_fill (ctx->cairo);
+
+/* clipped surface respecting free margins */
+ ctx->clip_surface =
+ cairo_surface_create_for_rectangle (ctx->surface, horz_margin_sz,
+ vert_margin_sz, img_width,
+ img_height);
+ if (cairo_surface_status (ctx->clip_surface) == CAIRO_STATUS_SUCCESS)
+ ;
+ else
+ goto error3;
+ ctx->clip_cairo = cairo_create (ctx->clip_surface);
+ if (cairo_status (ctx->clip_cairo) == CAIRO_STATUS_NO_MEMORY)
+ goto error4;
+
+/* setting up a default Black Pen */
+ ctx->current_pen.red = 0.0;
+ ctx->current_pen.green = 0.0;
+ ctx->current_pen.blue = 0.0;
+ ctx->current_pen.alpha = 1.0;
+ ctx->current_pen.width = 1.0;
+ ctx->current_pen.lengths[0] = 1.0;
+ ctx->current_pen.lengths_count = 1;
+
+/* setting up a default Black Brush */
+ ctx->current_brush.is_solid_color = 1;
+ ctx->current_brush.is_linear_gradient = 0;
+ ctx->current_brush.is_pattern = 0;
+ ctx->current_brush.red = 0.0;
+ ctx->current_brush.green = 0.0;
+ ctx->current_brush.blue = 0.0;
+ ctx->current_brush.alpha = 1.0;
+ ctx->current_brush.pattern = NULL;
+
+/* scaling accordingly to DPI resolution */
+ cairo_scale (ctx->clip_cairo, scale, scale);
+
+/* setting up default Font options */
+ ctx->font_red = 0.0;
+ ctx->font_green = 0.0;
+ ctx->font_blue = 0.0;
+ ctx->font_alpha = 1.0;
+ ctx->is_font_outlined = 0;
+ ctx->font_outline_width = 0.0;
+ return (rl2GraphicsContextPtr) ctx;
+ error4:
+ cairo_destroy (ctx->clip_cairo);
+ cairo_surface_destroy (ctx->clip_surface);
+ cairo_destroy (ctx->cairo);
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+ error3:
+ cairo_surface_destroy (ctx->clip_surface);
+ cairo_destroy (ctx->cairo);
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+ error2:
+ cairo_destroy (ctx->cairo);
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+ error1:
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+}
+
+static cairo_status_t
+pdf_write_func (void *ptr, const unsigned char *data, unsigned int length)
+{
+/* writing into the in-memory PDF target */
+ rl2PrivMemPdfPtr mem = (rl2PrivMemPdfPtr) ptr;
+ if (mem == NULL)
+ return CAIRO_STATUS_WRITE_ERROR;
+
+ if (mem->write_offset + (int) length < mem->size)
+ {
+ /* inserting into the current buffer */
+ memcpy (mem->buffer + mem->write_offset, data, length);
+ mem->write_offset += length;
+ }
+ else
+ {
+ /* expanding the current buffer */
+ int new_sz = mem->size + length + (64 * 1024);
+ unsigned char *save = mem->buffer;
+ mem->buffer = realloc (mem->buffer, new_sz);
+ if (mem->buffer == NULL)
+ {
+ free (save);
+ return CAIRO_STATUS_WRITE_ERROR;
+ }
+ mem->size = new_sz;
+ memcpy (mem->buffer + mem->write_offset, data, length);
+ mem->write_offset += length;
+ }
+ return CAIRO_STATUS_SUCCESS;
+}
+
+RL2_DECLARE rl2GraphicsContextPtr
+rl2_graph_create_mem_pdf_context (rl2MemPdfPtr mem_pdf, int dpi,
+ double page_width, double page_height,
+ double margin_width, double margin_height)
+{
+/* creating an in-memory PDF Graphics Context */
+ RL2GraphContextPtr ctx;
+ double scale = 72.0 / (double) dpi;
+ double page2_width = page_width * 72.0;
+ double page2_height = page_height * 72.0;
+ double horz_margin_sz = margin_width * 72.0;
+ double vert_margin_sz = margin_height * 72.0;
+ double img_width = (page_width - (margin_width * 2.0)) * 72.0;
+ double img_height = (page_height - (margin_height * 2.0)) * 72.0;
+
+ ctx = malloc (sizeof (RL2GraphContext));
+ if (ctx == NULL)
+ return NULL;
+
+ ctx->type = RL2_SURFACE_PDF;
+ ctx->clip_surface = NULL;
+ ctx->clip_cairo = NULL;
+ ctx->surface =
+ cairo_pdf_surface_create_for_stream (pdf_write_func, mem_pdf,
+ page2_width, page2_height);
+ if (cairo_surface_status (ctx->surface) == CAIRO_STATUS_SUCCESS)
+ ;
+ else
+ goto error1;
+ ctx->cairo = cairo_create (ctx->surface);
+ if (cairo_status (ctx->cairo) == CAIRO_STATUS_NO_MEMORY)
+ goto error2;
+
+/* priming a transparent background */
+ cairo_rectangle (ctx->cairo, 0, 0, page2_width, page2_height);
+ cairo_set_source_rgba (ctx->cairo, 0.0, 0.0, 0.0, 0.0);
+ cairo_fill (ctx->cairo);
+
+/* clipped surface respecting free margins */
+ ctx->clip_surface =
+ cairo_surface_create_for_rectangle (ctx->surface, horz_margin_sz,
+ vert_margin_sz, img_width,
+ img_height);
+ if (cairo_surface_status (ctx->clip_surface) == CAIRO_STATUS_SUCCESS)
+ ;
+ else
+ goto error3;
+ ctx->clip_cairo = cairo_create (ctx->clip_surface);
+ if (cairo_status (ctx->clip_cairo) == CAIRO_STATUS_NO_MEMORY)
+ goto error4;
+
+/* setting up a default Black Pen */
+ ctx->current_pen.red = 0.0;
+ ctx->current_pen.green = 0.0;
+ ctx->current_pen.blue = 0.0;
+ ctx->current_pen.alpha = 1.0;
+ ctx->current_pen.width = 1.0;
+ ctx->current_pen.lengths[0] = 1.0;
+ ctx->current_pen.lengths_count = 1;
+
+/* setting up a default Black Brush */
+ ctx->current_brush.is_solid_color = 1;
+ ctx->current_brush.is_linear_gradient = 0;
+ ctx->current_brush.is_pattern = 0;
+ ctx->current_brush.red = 0.0;
+ ctx->current_brush.green = 0.0;
+ ctx->current_brush.blue = 0.0;
+ ctx->current_brush.alpha = 1.0;
+ ctx->current_brush.pattern = NULL;
+
+/* scaling accordingly to DPI resolution */
+ cairo_scale (ctx->clip_cairo, scale, scale);
+
+/* setting up default Font options */
+ ctx->font_red = 0.0;
+ ctx->font_green = 0.0;
+ ctx->font_blue = 0.0;
+ ctx->font_alpha = 1.0;
+ ctx->is_font_outlined = 0;
+ ctx->font_outline_width = 0.0;
+ return (rl2GraphicsContextPtr) ctx;
+ error4:
+ cairo_destroy (ctx->clip_cairo);
+ cairo_surface_destroy (ctx->clip_surface);
+ cairo_destroy (ctx->cairo);
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+ error3:
+ cairo_surface_destroy (ctx->clip_surface);
+ cairo_destroy (ctx->cairo);
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+ error2:
+ cairo_destroy (ctx->cairo);
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+ error1:
+ cairo_surface_destroy (ctx->surface);
+ return NULL;
+}
+
+RL2_DECLARE int
+rl2_graph_set_pen (rl2GraphicsContextPtr context, unsigned char red,
+ unsigned char green, unsigned char blue, unsigned char alpha,
+ double width, int style)
+{
+/* creating a Color Pen */
+ double d_red = (double) red / 255.0;
+ double d_green = (double) green / 255.0;
+ double d_blue = (double) blue / 255.0;
+ double d_alpha = (double) alpha / 255.0;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+
+ ctx->current_pen.width = width;
+ ctx->current_pen.red = d_red;
+ ctx->current_pen.green = d_green;
+ ctx->current_pen.blue = d_blue;
+ ctx->current_pen.alpha = d_alpha;
+ switch (style)
+ {
+ case RL2_PENSTYLE_DOT:
+ ctx->current_pen.lengths[0] = 2;
+ ctx->current_pen.lengths[1] = 2;
+ ctx->current_pen.lengths_count = 2;
+ break;
+ case RL2_PENSTYLE_LONG_DASH:
+ ctx->current_pen.lengths[0] = 16;
+ ctx->current_pen.lengths[1] = 8;
+ ctx->current_pen.lengths_count = 2;
+ break;
+ case RL2_PENSTYLE_SHORT_DASH:
+ ctx->current_pen.lengths[0] = 8;
+ ctx->current_pen.lengths[1] = 4;
+ ctx->current_pen.lengths_count = 2;
+ break;
+ case RL2_PENSTYLE_DOT_DASH:
+ ctx->current_pen.lengths[0] = 8;
+ ctx->current_pen.lengths[1] = 4;
+ ctx->current_pen.lengths[2] = 2;
+ ctx->current_pen.lengths[3] = 4;
+ ctx->current_pen.lengths_count = 4;
+ break;
+ default:
+ ctx->current_pen.lengths[0] = 1;
+ ctx->current_pen.lengths[1] = 0;
+ ctx->current_pen.lengths_count = 2;
+ };
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_set_brush (rl2GraphicsContextPtr context, unsigned char red,
+ unsigned char green, unsigned char blue,
+ unsigned char alpha)
+{
+/* setting up a Color Brush */
+ double d_red = (double) red / 255.0;
+ double d_green = (double) green / 255.0;
+ double d_blue = (double) blue / 255.0;
+ double d_alpha = (double) alpha / 255.0;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+
+ ctx->current_brush.is_solid_color = 1;
+ ctx->current_brush.is_linear_gradient = 0;
+ ctx->current_brush.is_pattern = 0;
+ ctx->current_brush.red = d_red;
+ ctx->current_brush.green = d_green;
+ ctx->current_brush.blue = d_blue;
+ ctx->current_brush.alpha = d_alpha;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_set_linear_gradient_brush (rl2GraphicsContextPtr context, double x,
+ double y, double width, double height,
+ unsigned char red1, unsigned char green1,
+ unsigned char blue1, unsigned char alpha1,
+ unsigned char red2, unsigned char green2,
+ unsigned char blue2, unsigned char alpha2)
+{
+/* setting up a Linear Gradient Brush */
+ double d_red = (double) red1 / 255.0;
+ double d_green = (double) green1 / 255.0;
+ double d_blue = (double) blue1 / 255.0;
+ double d_alpha = (double) alpha1 / 255.0;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+
+ ctx->current_brush.is_solid_color = 0;
+ ctx->current_brush.is_linear_gradient = 1;
+ ctx->current_brush.is_pattern = 0;
+ ctx->current_brush.red = d_red;
+ ctx->current_brush.green = d_green;
+ ctx->current_brush.blue = d_blue;
+ ctx->current_brush.alpha = d_alpha;
+ ctx->current_brush.x0 = x;
+ ctx->current_brush.y0 = y;
+ ctx->current_brush.x1 = x + width;
+ ctx->current_brush.y1 = y + height;
+ d_red = (double) red2 / 255.0;
+ d_green = (double) green2 / 255.0;
+ d_blue = (double) blue2 / 255.0;
+ d_alpha = (double) alpha2 / 255.0;
+ ctx->current_brush.red2 = d_red;
+ ctx->current_brush.green2 = d_green;
+ ctx->current_brush.blue2 = d_blue;
+ ctx->current_brush.alpha2 = d_alpha;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_set_pattern_brush (rl2GraphicsContextPtr context,
+ rl2GraphicsPatternPtr brush)
+{
+/* setting up a Pattern Brush */
+ RL2GraphPatternBrushPtr pattern = (RL2GraphPatternBrushPtr) brush;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+
+ if (ctx == NULL)
+ return 0;
+ if (pattern == NULL)
+ return 0;
+
+ ctx->current_brush.is_solid_color = 0;
+ ctx->current_brush.is_linear_gradient = 0;
+ ctx->current_brush.is_pattern = 1;
+
+ ctx->current_brush.pattern = pattern->pattern;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_set_font (rl2GraphicsContextPtr context, rl2GraphicsFontPtr font)
+{
+/* setting up the current font */
+ cairo_t *cairo;
+ int style = CAIRO_FONT_SLANT_NORMAL;
+ int weight = CAIRO_FONT_WEIGHT_NORMAL;
+ double size;
+ RL2GraphFontPtr fnt = (RL2GraphFontPtr) font;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+
+ if (ctx == NULL)
+ return 0;
+ if (fnt == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+
+ if (fnt->style == RL2_FONTSTYLE_ITALIC)
+ style = CAIRO_FONT_SLANT_ITALIC;
+ if (fnt->weight == RL2_FONTWEIGHT_BOLD)
+ weight = CAIRO_FONT_WEIGHT_BOLD;
+ cairo_select_font_face (cairo, "monospace", style, weight);
+ size = fnt->size;
+ if (fnt->is_outlined)
+ size += fnt->outline_width;
+ cairo_set_font_size (cairo, size);
+ ctx->font_red = fnt->red;
+ ctx->font_green = fnt->green;
+ ctx->font_blue = fnt->blue;
+ ctx->font_alpha = fnt->alpha;
+ ctx->is_font_outlined = fnt->is_outlined;
+ ctx->font_outline_width = fnt->outline_width;
+
+ return 1;
+}
+
+static int
+rl2cr_endian_arch ()
+{
+/* checking if target CPU is a little-endian one */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static void
+adjust_for_endianness (unsigned char *rgbaArray, int width, int height)
+{
+/* Adjusting from RGBA to ARGB respecting platform endianness */
+ int x;
+ int y;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ unsigned char alpha;
+ unsigned char *p_in = rgbaArray;
+ unsigned char *p_out = rgbaArray;
+ int little_endian = rl2cr_endian_arch ();
+
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ red = *p_in++;
+ green = *p_in++;
+ blue = *p_in++;
+ alpha = *p_in++;
+ if (little_endian)
+ {
+ *p_out++ = blue;
+ *p_out++ = green;
+ *p_out++ = red;
+ *p_out++ = alpha;
+ }
+ else
+ {
+ *p_out++ = alpha;
+ *p_out++ = red;
+ *p_out++ = green;
+ *p_out++ = blue;
+ }
+ }
+ }
+}
+
+RL2_DECLARE rl2GraphicsPatternPtr
+rl2_graph_create_pattern (unsigned char *rgbaArray, int width, int height)
+{
+/* creating a pattern brush */
+ RL2GraphPatternBrushPtr pattern;
+
+ if (rgbaArray == NULL)
+ return NULL;
+
+ adjust_for_endianness (rgbaArray, width, height);
+ pattern = malloc (sizeof (RL2GraphPatternBrush));
+ if (pattern == NULL)
+ return NULL;
+ pattern->width = width;
+ pattern->height = height;
+ pattern->rgba = rgbaArray;
+ pattern->bitmap =
+ cairo_image_surface_create_for_data (rgbaArray, CAIRO_FORMAT_ARGB32,
+ width, height, width * 4);
+ pattern->pattern = cairo_pattern_create_for_surface (pattern->bitmap);
+ cairo_pattern_set_extend (pattern->pattern, CAIRO_EXTEND_REPEAT);
+ return (rl2GraphicsPatternPtr) pattern;
+}
+
+RL2_DECLARE void
+rl2_graph_destroy_pattern (rl2GraphicsPatternPtr brush)
+{
+/* destroying a pattern brush */
+ RL2GraphPatternBrushPtr pattern = (RL2GraphPatternBrushPtr) brush;
+
+ if (pattern == NULL)
+ return;
+
+ cairo_pattern_destroy (pattern->pattern);
+ cairo_surface_destroy (pattern->bitmap);
+ if (pattern->rgba != NULL)
+ free (pattern->rgba);
+ free (pattern);
+}
+
+RL2_DECLARE rl2GraphicsFontPtr
+rl2_graph_create_font (double size, int style, int weight)
+{
+/* creating a font */
+ RL2GraphFontPtr fnt;
+
+ fnt = malloc (sizeof (RL2GraphFont));
+ if (fnt == NULL)
+ return NULL;
+ if (size < 1.0)
+ fnt->size = 1.0;
+ else if (size > 32.0)
+ fnt->size = 32.0;
+ else
+ fnt->size = size;
+ if (style == RL2_FONTSTYLE_ITALIC)
+ fnt->style = RL2_FONTSTYLE_ITALIC;
+ else
+ fnt->style = RL2_FONTSTYLE_NORMAL;
+ if (weight == RL2_FONTWEIGHT_BOLD)
+ fnt->weight = RL2_FONTWEIGHT_BOLD;
+ else
+ fnt->weight = RL2_FONTWEIGHT_NORMAL;
+ fnt->is_outlined = 0;
+ fnt->outline_width = 0.0;
+ fnt->red = 0.0;
+ fnt->green = 0.0;
+ fnt->blue = 0.0;
+ fnt->alpha = 1.0;
+ return (rl2GraphicsFontPtr) fnt;
+}
+
+RL2_DECLARE void
+rl2_graph_destroy_font (rl2GraphicsFontPtr font)
+{
+/* destroying a font */
+ RL2GraphFontPtr fnt = (RL2GraphFontPtr) font;
+
+ if (fnt == NULL)
+ return;
+
+ free (fnt);
+}
+
+RL2_DECLARE int
+rl2_graph_font_set_color (rl2GraphicsFontPtr font, unsigned char red,
+ unsigned char green, unsigned char blue,
+ unsigned char alpha)
+{
+/* setting up the font color */
+ RL2GraphFontPtr fnt = (RL2GraphFontPtr) font;
+
+ if (fnt == NULL)
+ return 0;
+
+ fnt->red = (double) red / 255.0;
+ fnt->green = (double) green / 255.0;
+ fnt->blue = (double) blue / 255.0;
+ fnt->alpha = (double) alpha / 255.0;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_font_set_outline (rl2GraphicsFontPtr font, double width)
+{
+/* setting up the font outline */
+ RL2GraphFontPtr fnt = (RL2GraphFontPtr) font;
+
+ if (fnt == NULL)
+ return 0;
+
+ if (width <= 0.0)
+ {
+ fnt->is_outlined = 0;
+ fnt->outline_width = 0.0;
+ }
+ else
+ {
+ fnt->is_outlined = 1;
+ fnt->outline_width = width;
+ }
+ return 1;
+}
+
+RL2_DECLARE rl2GraphicsBitmapPtr
+rl2_graph_create_bitmap (unsigned char *rgbaArray, int width, int height)
+{
+/* creating a bitmap */
+ RL2GraphBitmapPtr bmp;
+
+ if (rgbaArray == NULL)
+ return NULL;
+
+ adjust_for_endianness (rgbaArray, width, height);
+ bmp = malloc (sizeof (RL2GraphBitmap));
+ if (bmp == NULL)
+ return NULL;
+ bmp->width = width;
+ bmp->height = height;
+ bmp->rgba = rgbaArray;
+ bmp->bitmap =
+ cairo_image_surface_create_for_data (rgbaArray, CAIRO_FORMAT_ARGB32,
+ width, height, width * 4);
+ bmp->pattern = cairo_pattern_create_for_surface (bmp->bitmap);
+ return (rl2GraphicsBitmapPtr) bmp;
+}
+
+RL2_DECLARE void
+rl2_graph_destroy_bitmap (rl2GraphicsBitmapPtr bitmap)
+{
+/* destroying a bitmap */
+ RL2GraphBitmapPtr bmp = (RL2GraphBitmapPtr) bitmap;
+
+ if (bmp == NULL)
+ return;
+
+ cairo_pattern_destroy (bmp->pattern);
+ cairo_surface_destroy (bmp->bitmap);
+ if (bmp->rgba != NULL)
+ free (bmp->rgba);
+ free (bmp);
+}
+
+static void
+set_current_brush (RL2GraphContextPtr ctx)
+{
+/* setting up the current Brush */
+ cairo_t *cairo;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+ if (ctx->current_brush.is_solid_color)
+ {
+ /* using a Solid Color Brush */
+ cairo_set_source_rgba (cairo, ctx->current_brush.red,
+ ctx->current_brush.green,
+ ctx->current_brush.blue,
+ ctx->current_brush.alpha);
+ }
+ else if (ctx->current_brush.is_linear_gradient)
+ {
+ /* using a Linear Gradient Brush */
+ cairo_pattern_t *pattern =
+ cairo_pattern_create_linear (ctx->current_brush.x0,
+ ctx->current_brush.y0,
+ ctx->current_brush.x1,
+ ctx->current_brush.y1);
+ cairo_pattern_add_color_stop_rgba (pattern, 0.0,
+ ctx->current_brush.red,
+ ctx->current_brush.green,
+ ctx->current_brush.blue,
+ ctx->current_brush.alpha);
+ cairo_pattern_add_color_stop_rgba (pattern, 1.0,
+ ctx->current_brush.red2,
+ ctx->current_brush.green2,
+ ctx->current_brush.blue2,
+ ctx->current_brush.alpha2);
+ cairo_set_source (cairo, pattern);
+ cairo_pattern_destroy (pattern);
+ }
+ else if (ctx->current_brush.is_pattern)
+ {
+ /* using a Pattern Brush */
+ cairo_set_source (cairo, ctx->current_brush.pattern);
+ }
+}
+
+static void
+set_current_pen (RL2GraphContextPtr ctx)
+{
+/* setting up the current Pen */
+ cairo_t *cairo;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+ cairo_set_line_width (cairo, ctx->current_pen.width);
+ cairo_set_source_rgba (cairo, ctx->current_pen.red,
+ ctx->current_pen.green, ctx->current_pen.blue,
+ ctx->current_pen.alpha);
+ cairo_set_line_cap (cairo, CAIRO_LINE_CAP_BUTT);
+ cairo_set_line_join (cairo, CAIRO_LINE_JOIN_MITER);
+ cairo_set_dash (cairo, ctx->current_pen.lengths,
+ ctx->current_pen.lengths_count, 0.0);
+}
+
+RL2_DECLARE int
+rl2_graph_draw_rectangle (rl2GraphicsContextPtr context, double x, double y,
+ double width, double height)
+{
+/* Drawing a filled rectangle */
+ cairo_t *cairo;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+
+ cairo_rectangle (cairo, x, y, width, height);
+ set_current_brush (ctx);
+ cairo_fill_preserve (cairo);
+ set_current_pen (ctx);
+ cairo_stroke (cairo);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_draw_rounded_rectangle (rl2GraphicsContextPtr context, double x,
+ double y, double width, double height,
+ double radius)
+{
+/* Drawing a filled rectangle with rounded corners */
+ cairo_t *cairo;
+ double degrees = M_PI / 180.0;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+
+ cairo_new_sub_path (cairo);
+ cairo_arc (cairo, x + width - radius, y + radius, radius,
+ -90 * degrees, 0 * degrees);
+ cairo_arc (cairo, x + width - radius, y + height - radius, radius,
+ 0 * degrees, 90 * degrees);
+ cairo_arc (cairo, x + radius, y + height - radius, radius,
+ 90 * degrees, 180 * degrees);
+ cairo_arc (cairo, x + radius, y + radius, radius, 180 * degrees,
+ 270 * degrees);
+ cairo_close_path (cairo);
+ set_current_brush (ctx);
+ cairo_fill_preserve (cairo);
+ set_current_pen (ctx);
+ cairo_stroke (cairo);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_draw_ellipse (rl2GraphicsContextPtr context, double x, double y,
+ double width, double height)
+{
+/* Drawing a filled ellipse */
+ cairo_t *cairo;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+
+ cairo_save (cairo);
+ cairo_translate (cairo, x + (width / 2.0), y + (height / 2.0));
+ cairo_scale (cairo, width / 2.0, height / 2.0);
+ cairo_arc (cairo, 0.0, 0.0, 1.0, 0.0, 2.0 * M_PI);
+ cairo_restore (cairo);
+ set_current_brush (ctx);
+ cairo_fill_preserve (cairo);
+ set_current_pen (ctx);
+ cairo_stroke (cairo);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_draw_circle_sector (rl2GraphicsContextPtr context, double center_x,
+ double center_y, double radius, double from_angle,
+ double to_angle)
+{
+/* drawing a filled circular sector */
+ cairo_t *cairo;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+
+ cairo_move_to (cairo, center_x, center_y);
+ cairo_arc (cairo, center_x, center_y, radius, from_angle, to_angle);
+ cairo_line_to (cairo, center_x, center_y);
+ set_current_brush (ctx);
+ cairo_fill_preserve (cairo);
+ set_current_pen (ctx);
+ cairo_stroke (cairo);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_stroke_line (rl2GraphicsContextPtr context, double x0, double y0,
+ double x1, double y1)
+{
+/* Stroking a line */
+ cairo_t *cairo;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+
+ cairo_move_to (cairo, x0, y0);
+ cairo_line_to (cairo, x1, y1);
+ set_current_pen (ctx);
+ cairo_stroke (cairo);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_move_to_point (rl2GraphicsContextPtr context, double x, double y)
+{
+/* Moving to a Path Point */
+ cairo_t *cairo;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+ cairo_move_to (cairo, x, y);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_add_line_to_path (rl2GraphicsContextPtr context, double x, double y)
+{
+/* Adding a Line to a Path */
+ cairo_t *cairo;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+ cairo_line_to (cairo, x, y);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_close_subpath (rl2GraphicsContextPtr context)
+{
+/* Closing a SubPath */
+ cairo_t *cairo;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+ cairo_close_path (cairo);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_stroke_path (rl2GraphicsContextPtr context, int preserve)
+{
+/* Stroking a path */
+ cairo_t *cairo;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+
+ set_current_pen (ctx);
+ if (preserve == RL2_PRESERVE_PATH)
+ cairo_stroke_preserve (cairo);
+ else
+ cairo_stroke (cairo);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_fill_path (rl2GraphicsContextPtr context, int preserve)
+{
+/* Filling a path */
+ cairo_t *cairo;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+
+ set_current_brush (ctx);
+ if (preserve == RL2_PRESERVE_PATH)
+ cairo_fill_preserve (cairo);
+ else
+ cairo_fill (cairo);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_get_text_extent (rl2GraphicsContextPtr context, const char *text,
+ double *pre_x, double *pre_y, double *width,
+ double *height, double *post_x, double *post_y)
+{
+/* measuring the text extent (using the current font) */
+ cairo_t *cairo;
+ cairo_text_extents_t extents;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+
+ cairo_text_extents (cairo, text, &extents);
+ *pre_x = extents.x_bearing;
+ *pre_y = extents.y_bearing;
+ *width = extents.width;
+ *height = extents.height;
+ *post_x = extents.x_advance;
+ *post_y = extents.y_advance;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_draw_text (rl2GraphicsContextPtr context, const char *text, double x,
+ double y, double angle)
+{
+/* drawing a text string (using the current font) */
+ cairo_t *cairo;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+
+ if (ctx == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ cairo = ctx->clip_cairo;
+ else
+ cairo = ctx->cairo;
+
+ cairo_save (cairo);
+ cairo_translate (cairo, x, y);
+ cairo_rotate (cairo, angle);
+ if (ctx->is_font_outlined)
+ {
+ /* outlined font */
+ cairo_move_to (cairo, 0.0, 0.0);
+ cairo_text_path (cairo, text);
+ cairo_set_source_rgba (cairo, ctx->font_red, ctx->font_green,
+ ctx->font_blue, ctx->font_alpha);
+ cairo_fill_preserve (cairo);
+ cairo_set_source_rgba (cairo, 1.0, 1.0, 1.0, ctx->font_alpha);
+ cairo_set_line_width (cairo, ctx->font_outline_width);
+ cairo_stroke (cairo);
+ }
+ else
+ {
+ /* no outline */
+ cairo_set_source_rgba (cairo, ctx->font_red, ctx->font_green,
+ ctx->font_blue, ctx->font_alpha);
+ cairo_move_to (cairo, 0.0, 0.0);
+ cairo_show_text (cairo, text);
+ }
+ cairo_restore (cairo);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_draw_bitmap (rl2GraphicsContextPtr context,
+ rl2GraphicsBitmapPtr bitmap, int x, int y)
+{
+/* drawing a symbol bitmap */
+ cairo_t *cairo;
+ cairo_surface_t *surface;
+ RL2GraphBitmapPtr bmp = (RL2GraphBitmapPtr) bitmap;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+
+ if (ctx == NULL)
+ return 0;
+ if (bmp == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ {
+ surface = ctx->clip_surface;
+ cairo = ctx->clip_cairo;
+ }
+ else
+ {
+ surface = ctx->surface;
+ cairo = ctx->cairo;
+ }
+
+ cairo_save (cairo);
+ cairo_scale (cairo, 1, 1);
+ cairo_translate (cairo, x, y);
+ cairo_set_source (cairo, bmp->pattern);
+ cairo_rectangle (cairo, 0, 0, bmp->width, bmp->height);
+ cairo_fill (cairo);
+ cairo_restore (cairo);
+ cairo_surface_flush (surface);
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_graph_draw_rescaled_bitmap (rl2GraphicsContextPtr context,
+ rl2GraphicsBitmapPtr bitmap, double scale_x,
+ double scale_y, int x, int y)
+{
+/* drawing a rescaled bitmap */
+ cairo_t *cairo;
+ cairo_surface_t *surface;
+ RL2GraphBitmapPtr bmp = (RL2GraphBitmapPtr) bitmap;
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+
+ if (ctx == NULL)
+ return 0;
+ if (bmp == NULL)
+ return 0;
+ if (ctx->type == RL2_SURFACE_PDF)
+ {
+ surface = ctx->clip_surface;
+ cairo = ctx->clip_cairo;
+ }
+ else
+ {
+ surface = ctx->surface;
+ cairo = ctx->cairo;
+ }
+
+ cairo_save (cairo);
+ cairo_translate (cairo, x, y);
+ cairo_scale (cairo, scale_x, scale_y);
+ cairo_set_source (cairo, bmp->pattern);
+ cairo_paint (cairo);
+ cairo_restore (cairo);
+ cairo_surface_flush (surface);
+ return 1;
+}
+
+RL2_DECLARE unsigned char *
+rl2_graph_get_context_rgb_array (rl2GraphicsContextPtr context)
+{
+/* creating an RGB buffer from the given Context */
+ int width;
+ int height;
+ int x;
+ int y;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *rgb;
+ int little_endian = rl2cr_endian_arch ();
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+
+ if (ctx == NULL)
+ return NULL;
+
+ width = cairo_image_surface_get_width (ctx->surface);
+ height = cairo_image_surface_get_height (ctx->surface);
+ rgb = malloc (width * height * 3);
+ if (rgb == NULL)
+ return NULL;
+
+ p_in = cairo_image_surface_get_data (ctx->surface);
+ p_out = rgb;
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ if (little_endian)
+ {
+ b = *p_in++;
+ g = *p_in++;
+ r = *p_in++;
+ p_in++; /* skipping Alpha */
+ }
+ else
+ {
+ p_in++; /* skipping Alpha */
+ r = *p_in++;
+ g = *p_in++;
+ b = *p_in++;
+ }
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ }
+ }
+ return rgb;
+}
+
+RL2_DECLARE unsigned char *
+rl2_graph_get_context_alpha_array (rl2GraphicsContextPtr context)
+{
+/* creating an Alpha buffer from the given Context */
+ int width;
+ int height;
+ int x;
+ int y;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *alpha;
+ int little_endian = rl2cr_endian_arch ();
+ RL2GraphContextPtr ctx = (RL2GraphContextPtr) context;
+
+ if (ctx == NULL)
+ return NULL;
+
+ width = cairo_image_surface_get_width (ctx->surface);
+ height = cairo_image_surface_get_height (ctx->surface);
+ alpha = malloc (width * height);
+ if (alpha == NULL)
+ return NULL;
+
+ p_in = cairo_image_surface_get_data (ctx->surface);
+ p_out = alpha;
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ if (little_endian)
+ {
+ p_in += 3; /* skipping RGB */
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ *p_out++ = *p_in++;
+ p_in += 3; /* skipping RGB */
+ }
+ }
+ }
+ return alpha;
+}
+
+RL2_DECLARE int
+rl2_rgba_to_pdf (unsigned int width, unsigned int height,
+ unsigned char *rgba, unsigned char **pdf, int *pdf_size)
+{
+/* attempting to create an RGB PDF map */
+ rl2MemPdfPtr mem = NULL;
+ rl2GraphicsContextPtr ctx = NULL;
+ rl2GraphicsBitmapPtr bmp = NULL;
+ int dpi;
+ double w_150 = (double) width / 150.0;
+ double h_150 = (double) height / 150.0;
+ double w_300 = (double) width / 300.0;
+ double h_300 = (double) height / 300.0;
+ double w_600 = (double) width / 600.0;
+ double h_600 = (double) height / 600.0;
+ double page_width;
+ double page_height;
+
+ if (w_150 <= 6.3 && h_150 <= 9.7)
+ {
+ /* A4 portrait - 150 DPI */
+ page_width = 8.3;
+ page_height = 11.7;
+ dpi = 150;
+ }
+ else if (w_150 <= 9.7 && h_150 < 6.3)
+ {
+ /* A4 landscape - 150 DPI */
+ page_width = 11.7;
+ page_height = 8.3;;
+ dpi = 150;
+ }
+ else if (w_300 <= 6.3 && h_300 <= 9.7)
+ {
+ /* A4 portrait - 300 DPI */
+ page_width = 8.3;
+ page_height = 11.7;;
+ dpi = 300;
+ }
+ else if (w_300 <= 9.7 && h_300 < 6.3)
+ {
+ /* A4 landscape - 300 DPI */
+ page_width = 11.7;
+ page_height = 8.3;;
+ dpi = 300;
+ }
+ else if (w_600 <= 6.3 && h_600 <= 9.7)
+ {
+ /* A4 portrait - 600 DPI */
+ page_width = 8.3;
+ page_height = 11.7;;
+ dpi = 600;
+ }
+ else
+ {
+ /* A4 landscape - 600 DPI */
+ page_width = 11.7;
+ page_height = 8.3;;
+ dpi = 600;
+ }
+
+ mem = rl2_create_mem_pdf_target ();
+ if (mem == NULL)
+ goto error;
+
+ ctx =
+ rl2_graph_create_mem_pdf_context (mem, dpi, page_width, page_height,
+ 1.0, 1.0);
+ if (ctx == NULL)
+ goto error;
+ bmp = rl2_graph_create_bitmap (rgba, width, height);
+ rgba = NULL;
+ if (bmp == NULL)
+ goto error;
+/* rendering the Bitmap */
+ if (ctx != NULL)
+ rl2_graph_draw_bitmap (ctx, bmp, 0, 0);
+ rl2_graph_destroy_bitmap (bmp);
+ rl2_graph_destroy_context (ctx);
+/* retrieving the PDF memory block */
+ if (rl2_get_mem_pdf_buffer (mem, pdf, pdf_size) != RL2_OK)
+ goto error;
+ rl2_destroy_mem_pdf_target (mem);
+
+ return RL2_OK;
+
+ error:
+ if (bmp != NULL)
+ rl2_graph_destroy_bitmap (bmp);
+ if (ctx != NULL)
+ rl2_graph_destroy_context (ctx);
+ if (mem != NULL)
+ rl2_destroy_mem_pdf_target (mem);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_gray_pdf (unsigned int width, unsigned int height, unsigned char **pdf,
+ int *pdf_size)
+{
+/* attempting to create an all-Gray PDF */
+ rl2MemPdfPtr mem = NULL;
+ rl2GraphicsContextPtr ctx = NULL;
+ int dpi;
+ double w_150 = (double) width / 150.0;
+ double h_150 = (double) height / 150.0;
+ double w_300 = (double) width / 300.0;
+ double h_300 = (double) height / 300.0;
+ double w_600 = (double) width / 600.0;
+ double h_600 = (double) height / 600.0;
+ double page_width;
+ double page_height;
+
+ if (w_150 <= 6.3 && h_150 <= 9.7)
+ {
+ /* A4 portrait - 150 DPI */
+ page_width = 8.3;
+ page_height = 11.7;
+ dpi = 150;
+ }
+ else if (w_150 <= 9.7 && h_150 < 6.3)
+ {
+ /* A4 landscape - 150 DPI */
+ page_width = 11.7;
+ page_height = 8.3;;
+ dpi = 150;
+ }
+ else if (w_300 <= 6.3 && h_300 <= 9.7)
+ {
+ /* A4 portrait - 300 DPI */
+ page_width = 8.3;
+ page_height = 11.7;;
+ dpi = 300;
+ }
+ else if (w_300 <= 9.7 && h_300 < 6.3)
+ {
+ /* A4 landscape - 300 DPI */
+ page_width = 11.7;
+ page_height = 8.3;;
+ dpi = 300;
+ }
+ else if (w_600 <= 6.3 && h_600 <= 9.7)
+ {
+ /* A4 portrait - 600 DPI */
+ page_width = 8.3;
+ page_height = 11.7;;
+ dpi = 600;
+ }
+ else
+ {
+ /* A4 landscape - 600 DPI */
+ page_width = 11.7;
+ page_height = 8.3;;
+ dpi = 600;
+ }
+
+ mem = rl2_create_mem_pdf_target ();
+ if (mem == NULL)
+ goto error;
+
+ ctx =
+ rl2_graph_create_mem_pdf_context (mem, dpi, page_width, page_height,
+ 1.0, 1.0);
+ if (ctx == NULL)
+ goto error;
+ rl2_graph_set_pen (ctx, 255, 0, 0, 255, 2.0, RL2_PENSTYLE_SOLID);
+ rl2_graph_set_brush (ctx, 128, 128, 128, 255);
+ rl2_graph_draw_rounded_rectangle (ctx, 0, 0, width, height, width / 10.0);
+
+ rl2_graph_destroy_context (ctx);
+/* retrieving the PDF memory block */
+ if (rl2_get_mem_pdf_buffer (mem, pdf, pdf_size) != RL2_OK)
+ goto error;
+ rl2_destroy_mem_pdf_target (mem);
+
+ return RL2_OK;
+
+ error:
+ if (ctx != NULL)
+ rl2_graph_destroy_context (ctx);
+ if (mem != NULL)
+ rl2_destroy_mem_pdf_target (mem);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE rl2MemPdfPtr
+rl2_create_mem_pdf_target (void)
+{
+/* creating an initially empty in-memory PDF target */
+ rl2PrivMemPdfPtr mem = malloc (sizeof (rl2PrivMemPdf));
+ if (mem == NULL)
+ return NULL;
+ mem->write_offset = 0;
+ mem->size = 64 * 1024;
+ mem->buffer = malloc (mem->size);
+ if (mem->buffer == NULL)
+ {
+ free (mem);
+ return NULL;
+ }
+ return (rl2MemPdfPtr) mem;
+}
+
+RL2_DECLARE void
+rl2_destroy_mem_pdf_target (rl2MemPdfPtr target)
+{
+/* memory cleanup - destroying an in-memory PDF target */
+ rl2PrivMemPdfPtr mem = (rl2PrivMemPdfPtr) target;
+ if (mem == NULL)
+ return;
+ if (mem->buffer != NULL)
+ free (mem->buffer);
+ free (mem);
+}
+
+RL2_DECLARE int
+rl2_get_mem_pdf_buffer (rl2MemPdfPtr target, unsigned char **buffer, int *size)
+{
+/* exporting the internal buffer */
+ rl2PrivMemPdfPtr mem = (rl2PrivMemPdfPtr) target;
+ if (mem == NULL)
+ return RL2_ERROR;
+ if (mem->buffer == NULL)
+ return RL2_ERROR;
+ *buffer = mem->buffer;
+ mem->buffer = NULL;
+ *size = mem->write_offset;
+ return RL2_OK;
+}
diff --git a/src/rl2png.c b/src/rl2png.c
new file mode 100644
index 0000000..ea78674
--- /dev/null
+++ b/src/rl2png.c
@@ -0,0 +1,1057 @@
+/*
+
+ rl2png -- PNG related functions
+
+ version 0.1, 2013 March 29
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <png.h>
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2_private.h"
+
+struct png_memory_buffer
+{
+ unsigned char *buffer;
+ size_t size;
+ size_t off;
+};
+
+static void
+rl2_png_read_data (png_structp png_ptr, png_bytep data, png_size_t length)
+{
+ struct png_memory_buffer *p = png_get_io_ptr (png_ptr);
+ size_t rd = length;
+ if (p->off + length > p->size)
+ rd = p->size - p->off;
+ if (rd != 0)
+ {
+ /* copy bytes into buffer */
+ memcpy (data, p->buffer + p->off, rd);
+ p->off += rd;
+ }
+ if (rd != length)
+ png_error (png_ptr, "Read Error: truncated data");
+}
+
+static void
+rl2_png_write_data (png_structp png_ptr, png_bytep data, png_size_t length)
+{
+ struct png_memory_buffer *p = png_get_io_ptr (png_ptr);
+ size_t nsize = p->size + length;
+
+ /* allocate or grow buffer */
+ if (p->buffer)
+ p->buffer = realloc (p->buffer, nsize);
+ else
+ p->buffer = malloc (nsize);
+
+ if (!p->buffer)
+ png_error (png_ptr, "Write Error");
+
+ /* copy new bytes to end of buffer */
+ memcpy (p->buffer + p->size, data, length);
+ p->size += length;
+}
+
+static void
+rl2_png_flush (png_structp png_ptr)
+{
+/* just silencing stupid compiler warnings */
+ if (png_ptr == NULL)
+ png_ptr = NULL;
+}
+
+static int
+compress_palette_png (const unsigned char *pixels, unsigned int width,
+ unsigned int height, rl2PalettePtr plt,
+ unsigned char sample_type, unsigned char **png,
+ int *png_size)
+{
+/* compressing a PNG image of the PALETTE type */
+ png_structp png_ptr;
+ png_infop info_ptr;
+ int bit_depth;
+ png_bytep *row_pointers = NULL;
+ png_bytep p_out;
+ unsigned int row;
+ unsigned int col;
+ png_color palette[256];
+ unsigned short num_entries;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+ int i;
+ const unsigned char *p_in;
+ struct png_memory_buffer membuf;
+ membuf.buffer = NULL;
+ membuf.size = 0;
+
+ png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+ if (!png_ptr)
+ return RL2_ERROR;
+ info_ptr = png_create_info_struct (png_ptr);
+ if (!info_ptr)
+ {
+ png_destroy_write_struct (&png_ptr, NULL);
+ return RL2_ERROR;
+ }
+ if (setjmp (png_jmpbuf (png_ptr)))
+ {
+ goto error;
+ }
+
+ png_set_write_fn (png_ptr, &membuf, rl2_png_write_data, rl2_png_flush);
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ bit_depth = 1;
+ break;
+ case RL2_SAMPLE_2_BIT:
+ bit_depth = 2;
+ break;
+ case RL2_SAMPLE_4_BIT:
+ bit_depth = 4;
+ break;
+ case RL2_SAMPLE_UINT8:
+ bit_depth = 8;
+ break;
+ };
+ png_set_IHDR (png_ptr, info_ptr, width, height, bit_depth,
+ PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE,
+ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+/* setting the palette */
+ if (plt == NULL)
+ goto error;
+ if (rl2_get_palette_colors (plt, &num_entries, &red, &green, &blue)
+ != RL2_OK)
+ goto error;
+ for (i = 0; i < num_entries; i++)
+ {
+ palette[i].red = *(red + i);
+ palette[i].green = *(green + i);
+ palette[i].blue = *(blue + i);
+ }
+ png_set_PLTE (png_ptr, info_ptr, palette, num_entries);
+ png_write_info (png_ptr, info_ptr);
+ png_set_packing (png_ptr);
+ row_pointers = malloc (sizeof (png_bytep) * height);
+ if (row_pointers == NULL)
+ goto error;
+ for (row = 0; row < height; ++row)
+ row_pointers[row] = NULL;
+ p_in = pixels;
+ for (row = 0; row < height; row++)
+ {
+ if ((row_pointers[row] = malloc (width)) == NULL)
+ goto error;
+ p_out = row_pointers[row];
+ for (col = 0; col < width; col++)
+ *p_out++ = *p_in++;
+ }
+ png_write_image (png_ptr, row_pointers);
+ png_write_end (png_ptr, info_ptr);
+ for (row = 0; row < height; ++row)
+ free (row_pointers[row]);
+ free (row_pointers);
+ png_destroy_write_struct (&png_ptr, &info_ptr);
+ if (red != NULL)
+ rl2_free (red);
+ if (green != NULL)
+ rl2_free (green);
+ if (blue != NULL)
+ rl2_free (blue);
+ *png = membuf.buffer;
+ *png_size = membuf.size;
+ return RL2_OK;
+
+ error:
+ png_destroy_write_struct (&png_ptr, &info_ptr);
+ for (row = 0; row < height; ++row)
+ free (row_pointers[row]);
+ free (row_pointers);
+ if (membuf.buffer != NULL)
+ free (membuf.buffer);
+ if (red != NULL)
+ rl2_free (red);
+ if (green != NULL)
+ rl2_free (green);
+ if (blue != NULL)
+ rl2_free (blue);
+ return RL2_ERROR;
+}
+
+static int
+compress_grayscale_png (const unsigned char *pixels, const unsigned char *mask,
+ double opacity, unsigned int width,
+ unsigned int height, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char **png,
+ int *png_size)
+{
+/* compressing a PNG image of the GRAYSCALE type */
+ png_structp png_ptr;
+ png_infop info_ptr;
+ int bit_depth;
+ png_bytep *row_pointers = NULL;
+ png_bytep p_out;
+ unsigned int row;
+ unsigned int col;
+ const unsigned char *p_in;
+ const unsigned char *p_mask;
+ int nBands;
+ int type;
+ int is_monochrome = 0;
+ unsigned char alpha = 255;
+ struct png_memory_buffer membuf;
+ membuf.buffer = NULL;
+ membuf.size = 0;
+
+ if (opacity < 0.0)
+ opacity = 0.0;
+ if (opacity > 1.0)
+ opacity = 1.0;
+ if (opacity < 1.0)
+ alpha = (unsigned char) (255.0 * opacity);
+
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ is_monochrome = 1;
+
+ png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+ if (!png_ptr)
+ return RL2_ERROR;
+ info_ptr = png_create_info_struct (png_ptr);
+ if (!info_ptr)
+ {
+ png_destroy_write_struct (&png_ptr, NULL);
+ return RL2_ERROR;
+ }
+ if (setjmp (png_jmpbuf (png_ptr)))
+ {
+ goto error;
+ }
+
+ png_set_write_fn (png_ptr, &membuf, rl2_png_write_data, rl2_png_flush);
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ bit_depth = 1;
+ break;
+ case RL2_SAMPLE_2_BIT:
+ bit_depth = 2;
+ break;
+ case RL2_SAMPLE_4_BIT:
+ bit_depth = 4;
+ break;
+ case RL2_SAMPLE_UINT8:
+ bit_depth = 8;
+ break;
+ };
+ p_mask = mask;
+ type = PNG_COLOR_TYPE_GRAY;
+ nBands = 1;
+ if (p_mask != NULL && sample_type == RL2_SAMPLE_UINT8)
+ {
+ type = PNG_COLOR_TYPE_GRAY_ALPHA;
+ nBands = 2;
+ }
+ png_set_IHDR (png_ptr, info_ptr, width, height, bit_depth,
+ type, PNG_INTERLACE_NONE,
+ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+ png_write_info (png_ptr, info_ptr);
+ png_set_packing (png_ptr);
+ row_pointers = malloc (sizeof (png_bytep) * height);
+ if (row_pointers == NULL)
+ goto error;
+ for (row = 0; row < height; ++row)
+ row_pointers[row] = NULL;
+ p_in = pixels;
+ for (row = 0; row < height; row++)
+ {
+ if ((row_pointers[row] = malloc (width * nBands)) == NULL)
+ goto error;
+ p_out = row_pointers[row];
+ for (col = 0; col < width; col++)
+ {
+ if (is_monochrome)
+ {
+ if (*p_in++ != 0)
+ *p_out++ = 255;
+ else
+ *p_out++ = 0;
+ }
+ else
+ *p_out++ = *p_in++;
+ if (type == PNG_COLOR_TYPE_GRAY_ALPHA)
+ {
+ /* ALPHA channel */
+ int transparent = *p_mask++;
+ transparent = !transparent;
+ if (transparent)
+ *p_out++ = 0;
+ else
+ *p_out++ = alpha;
+ }
+ }
+ }
+
+ png_write_image (png_ptr, row_pointers);
+ png_write_end (png_ptr, info_ptr);
+ for (row = 0; row < height; ++row)
+ free (row_pointers[row]);
+ free (row_pointers);
+ png_destroy_write_struct (&png_ptr, &info_ptr);
+ *png = membuf.buffer;
+ *png_size = membuf.size;
+ return RL2_OK;
+
+ error:
+ png_destroy_write_struct (&png_ptr, &info_ptr);
+ for (row = 0; row < height; ++row)
+ free (row_pointers[row]);
+ free (row_pointers);
+ if (membuf.buffer != NULL)
+ free (membuf.buffer);
+ return RL2_ERROR;
+}
+
+static int
+compress_rgb_png (const unsigned char *pixels, const unsigned char *mask,
+ double opacity, unsigned int width, unsigned int height,
+ unsigned char **png, int *png_size)
+{
+/* compressing a PNG image of the RGB type */
+ png_structp png_ptr;
+ png_infop info_ptr;
+ png_bytep *row_pointers = NULL;
+ png_bytep p_out;
+ unsigned int row;
+ unsigned int col;
+ const unsigned char *p_in;
+ const unsigned char *p_mask;
+ int nBands;
+ int type;
+ unsigned char alpha = 255;
+ struct png_memory_buffer membuf;
+ membuf.buffer = NULL;
+ membuf.size = 0;
+
+ if (opacity < 0.0)
+ opacity = 0.0;
+ if (opacity > 1.0)
+ opacity = 1.0;
+ if (opacity < 1.0)
+ alpha = (unsigned char) (255.0 * opacity);
+
+ png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+ if (!png_ptr)
+ return RL2_ERROR;
+ info_ptr = png_create_info_struct (png_ptr);
+ if (!info_ptr)
+ {
+ png_destroy_write_struct (&png_ptr, NULL);
+ return RL2_ERROR;
+ }
+ if (setjmp (png_jmpbuf (png_ptr)))
+ {
+ goto error;
+ }
+
+ png_set_write_fn (png_ptr, &membuf, rl2_png_write_data, rl2_png_flush);
+ p_mask = mask;
+ type = PNG_COLOR_TYPE_RGB;
+ nBands = 3;
+ if (p_mask != NULL)
+ {
+ type = PNG_COLOR_TYPE_RGB_ALPHA;
+ nBands = 4;
+ }
+ png_set_IHDR (png_ptr, info_ptr, width, height, 8,
+ type, PNG_INTERLACE_NONE,
+ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+ png_write_info (png_ptr, info_ptr);
+ row_pointers = malloc (sizeof (png_bytep) * height);
+ if (row_pointers == NULL)
+ goto error;
+ for (row = 0; row < height; ++row)
+ row_pointers[row] = NULL;
+ p_in = pixels;
+ for (row = 0; row < height; row++)
+ {
+ if ((row_pointers[row] = malloc (width * nBands)) == NULL)
+ goto error;
+ p_out = row_pointers[row];
+ for (col = 0; col < width; col++)
+ {
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ if (p_mask != NULL)
+ {
+ /* ALPHA channel */
+ int transparent = *p_mask++;
+ transparent = !transparent;
+ if (transparent)
+ *p_out++ = 0;
+ else
+ *p_out++ = alpha;
+ }
+ }
+ }
+ png_write_image (png_ptr, row_pointers);
+ png_write_end (png_ptr, info_ptr);
+ for (row = 0; row < height; ++row)
+ free (row_pointers[row]);
+ free (row_pointers);
+ png_destroy_write_struct (&png_ptr, &info_ptr);
+ *png = membuf.buffer;
+ *png_size = membuf.size;
+ return RL2_OK;
+
+ error:
+ png_destroy_write_struct (&png_ptr, &info_ptr);
+ for (row = 0; row < height; ++row)
+ free (row_pointers[row]);
+ free (row_pointers);
+ if (membuf.buffer != NULL)
+ free (membuf.buffer);
+ return RL2_ERROR;
+}
+
+static int
+check_png_compatibility (unsigned char sample_type, unsigned char pixel_type,
+ unsigned char num_samples)
+{
+/* checks for PNG compatibility */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_PALETTE:
+ case RL2_PIXEL_GRAYSCALE:
+ case RL2_PIXEL_RGB:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 1)
+ return RL2_ERROR;
+ }
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 1)
+ return RL2_ERROR;
+ }
+ if (pixel_type == RL2_PIXEL_GRAYSCALE)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 1)
+ return RL2_ERROR;
+ }
+ if (pixel_type == RL2_PIXEL_RGB)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 3)
+ return RL2_ERROR;
+ }
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_section_to_png (rl2SectionPtr scn, const char *path)
+{
+/* attempting to save a raster section into a PNG file */
+ int blob_size;
+ unsigned char *blob;
+ rl2RasterPtr rst;
+ int ret;
+
+ if (scn == NULL)
+ return RL2_ERROR;
+ rst = rl2_get_section_raster (scn);
+ if (rst == NULL)
+ return RL2_ERROR;
+/* attempting to export as a PNG image */
+ if (rl2_raster_to_png (rst, &blob, &blob_size) != RL2_OK)
+ return RL2_ERROR;
+ ret = rl2_blob_to_file (path, blob, blob_size);
+ free (blob);
+ if (ret != RL2_OK)
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_to_png (rl2RasterPtr rst, unsigned char **png, int *png_size)
+{
+/* creating a PNG image from a raster */
+ rl2PrivRasterPtr raster = (rl2PrivRasterPtr) rst;
+ rl2PalettePtr plt;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_samples;
+ unsigned char *blob;
+ int blob_size;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (rl2_get_raster_type (rst, &sample_type, &pixel_type, &num_samples) !=
+ RL2_OK)
+ return RL2_ERROR;
+ if (check_png_compatibility (sample_type, pixel_type, num_samples) !=
+ RL2_OK)
+ return RL2_ERROR;
+ plt = rl2_get_raster_palette (rst);
+
+ if (rl2_data_to_png
+ (raster->rasterBuffer, raster->maskBuffer, 1.0, plt, raster->width,
+ raster->height, sample_type, pixel_type, &blob, &blob_size) != RL2_OK)
+ return RL2_ERROR;
+ *png = blob;
+ *png_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_rgb_to_png (unsigned int width, unsigned int height,
+ const unsigned char *rgb, unsigned char **png, int *png_size)
+{
+/* creating a PNG image from an RGB buffer */
+ unsigned char *blob;
+ int blob_size;
+ if (rgb == NULL)
+ return RL2_ERROR;
+
+ if (rl2_data_to_png
+ (rgb, NULL, 1.0, NULL, width, height, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB,
+ &blob, &blob_size) != RL2_OK)
+ return RL2_ERROR;
+ *png = blob;
+ *png_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_rgb_alpha_to_png (unsigned int width, unsigned int height,
+ const unsigned char *rgb, const unsigned char *alpha,
+ unsigned char **png, int *png_size, double opacity)
+{
+/* creating a PNG image from two distinct RGB + Alpha buffer */
+ unsigned char *blob;
+ int blob_size;
+ if (rgb == NULL || alpha == NULL)
+ return RL2_ERROR;
+
+ if (rl2_data_to_png
+ (rgb, alpha, opacity, NULL, width, height, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_RGB, &blob, &blob_size) != RL2_OK)
+ return RL2_ERROR;
+ *png = blob;
+ *png_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_gray_to_png (unsigned int width, unsigned int height,
+ const unsigned char *gray, unsigned char **png, int *png_size)
+{
+/* creating a PNG image from a Grayscale buffer */
+ unsigned char *blob;
+ int blob_size;
+ if (gray == NULL)
+ return RL2_ERROR;
+
+ if (rl2_data_to_png
+ (gray, NULL, 1.0, NULL, width, height, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_GRAYSCALE, &blob, &blob_size) != RL2_OK)
+ return RL2_ERROR;
+ *png = blob;
+ *png_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_gray_alpha_to_png (unsigned int width, unsigned int height,
+ const unsigned char *gray, const unsigned char *alpha,
+ unsigned char **png, int *png_size, double opacity)
+{
+/* creating a PNG image from two distinct Grayscale + Alpha buffer */
+ unsigned char *blob;
+ int blob_size;
+ if (gray == NULL)
+ return RL2_ERROR;
+
+ if (rl2_data_to_png
+ (gray, alpha, opacity, NULL, width, height, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_GRAYSCALE, &blob, &blob_size) != RL2_OK)
+ return RL2_ERROR;
+ *png = blob;
+ *png_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_PRIVATE int
+rl2_data_to_png (const unsigned char *pixels, const unsigned char *mask,
+ double opacity, rl2PalettePtr plt, unsigned int width,
+ unsigned int height, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char **png, int *png_size)
+{
+/* encoding a PNG image */
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+
+ if (pixels == NULL)
+ return RL2_ERROR;
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_PALETTE:
+ ret =
+ compress_palette_png (pixels, width, height, plt, sample_type,
+ &blob, &blob_size);
+ break;
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_GRAYSCALE:
+ ret =
+ compress_grayscale_png (pixels, mask, opacity, width, height,
+ sample_type, pixel_type, &blob,
+ &blob_size);
+ break;
+ case RL2_PIXEL_RGB:
+ ret =
+ compress_rgb_png (pixels, mask, opacity, width, height, &blob,
+ &blob_size);
+ break;
+ };
+ if (ret != RL2_OK)
+ return RL2_ERROR;
+ *png = blob;
+ *png_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2SectionPtr
+rl2_section_from_png (const char *path)
+{
+/* attempting to create a raster section from a PNG file */
+ int blob_size;
+ unsigned char *blob;
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+
+/* attempting to create a raster */
+ if (rl2_blob_from_file (path, &blob, &blob_size) != RL2_OK)
+ return NULL;
+ rst = rl2_raster_from_png (blob, blob_size);
+ free (blob);
+ if (rst == NULL)
+ return NULL;
+
+/* creating the raster section */
+ scn =
+ rl2_create_section (path, RL2_COMPRESSION_PNG, RL2_TILESIZE_UNDEFINED,
+ RL2_TILESIZE_UNDEFINED, rst);
+ return scn;
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_raster_from_png (const unsigned char *blob, int blob_size)
+{
+/* attempting to create a raster from a PNG image */
+ rl2RasterPtr rst = NULL;
+ unsigned int width;
+ unsigned int height;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nBands;
+ unsigned char *data = NULL;
+ int data_size;
+ unsigned char *mask = NULL;
+ int mask_sz;
+ rl2PalettePtr palette = NULL;
+
+ if (rl2_decode_png
+ (blob, blob_size, &width, &height, &sample_type, &pixel_type, &nBands,
+ &data, &data_size, &mask, &mask_sz, &palette) != RL2_OK)
+ goto error;
+ rst =
+ rl2_create_raster (width, height, sample_type, pixel_type, nBands, data,
+ data_size, palette, mask, mask_sz, NULL);
+ if (rst == NULL)
+ goto error;
+ return rst;
+
+ error:
+ if (data != NULL)
+ free (data);
+ if (mask != NULL)
+ free (mask);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return NULL;
+}
+
+RL2_PRIVATE int
+rl2_decode_png (const unsigned char *blob, int blob_size,
+ unsigned int *xwidth, unsigned int *xheight,
+ unsigned char *xsample_type, unsigned char *xpixel_type,
+ unsigned char *num_bands, unsigned char **pixels,
+ int *pixels_sz, unsigned char **xmask, int *xmask_sz,
+ rl2PalettePtr * xpalette)
+{
+/* attempting to decode a PNG image - raw block */
+ png_uint_32 width;
+ png_uint_32 height;
+ png_uint_32 rowbytes;
+ int bit_depth;
+ int color_type;
+ int interlace_type;
+ png_structp png_ptr;
+ png_infop info_ptr;
+ struct png_memory_buffer membuf;
+ unsigned char sample_type = RL2_SAMPLE_UNKNOWN;
+ unsigned char pixel_type = RL2_PIXEL_UNKNOWN;
+ int nBands;
+ int i;
+ png_colorp palette;
+ int red[256];
+ int green[256];
+ int blue[256];
+ int alpha[256];
+ unsigned char *data = NULL;
+ unsigned char *p_data;
+ unsigned char *mask = NULL;
+ int mask_sz = 0;
+ unsigned char *p_mask = NULL;
+ int data_size;
+ png_bytep image_data = NULL;
+ png_bytepp row_pointers = NULL;
+ unsigned int row;
+ unsigned int col;
+ rl2PalettePtr rl_palette = NULL;
+ int nPalette = 0;
+ png_bytep transp;
+ int nTransp;
+ png_color_16p transpValues;
+ int has_alpha = 0;
+
+ if (blob == NULL || blob_size == 0)
+ return RL2_ERROR;
+ png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+ if (!png_ptr)
+ return RL2_ERROR;
+ info_ptr = png_create_info_struct (png_ptr);
+ if (!info_ptr)
+ {
+ png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
+ return RL2_ERROR;
+ }
+ if (setjmp (png_jmpbuf (png_ptr)))
+ {
+ goto error;
+ }
+
+ membuf.buffer = (unsigned char *) blob;
+ membuf.size = blob_size;
+ membuf.off = 0;
+ png_set_read_fn (png_ptr, &membuf, rl2_png_read_data);
+ png_read_info (png_ptr, info_ptr);
+ png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
+ &interlace_type, NULL, NULL);
+ switch (bit_depth)
+ {
+ case 1:
+ sample_type = RL2_SAMPLE_1_BIT;
+ break;
+ case 2:
+ sample_type = RL2_SAMPLE_2_BIT;
+ break;
+ case 4:
+ sample_type = RL2_SAMPLE_4_BIT;
+ break;
+ case 8:
+ sample_type = RL2_SAMPLE_UINT8;
+ break;
+ };
+ if (bit_depth < 8)
+ png_set_packing (png_ptr);
+ switch (color_type)
+ {
+ case PNG_COLOR_TYPE_PALETTE:
+ pixel_type = RL2_PIXEL_PALETTE;
+ nBands = 1;
+ png_get_PLTE (png_ptr, info_ptr, &palette, &nPalette);
+ for (i = 0; i < nPalette; i++)
+ {
+ red[i] = palette[i].red;
+ green[i] = palette[i].green;
+ blue[i] = palette[i].blue;
+ alpha[i] = 255;
+ }
+ break;
+ case PNG_COLOR_TYPE_GRAY:
+ case PNG_COLOR_TYPE_GRAY_ALPHA:
+ pixel_type = RL2_PIXEL_GRAYSCALE;
+ if (sample_type == RL2_SAMPLE_1_BIT)
+ pixel_type = RL2_PIXEL_MONOCHROME;
+ nBands = 1;
+ break;
+ case PNG_COLOR_TYPE_RGB:
+ case PNG_COLOR_TYPE_RGB_ALPHA:
+ pixel_type = RL2_PIXEL_RGB;
+ nBands = 3;
+ break;
+ };
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ if (png_get_tRNS (png_ptr, info_ptr, &transp, &nTransp, &transpValues)
+ == PNG_INFO_tRNS)
+ {
+ /* a Transparency palette is defined */
+ int i;
+ for (i = 0; i < nTransp; i++)
+ *(alpha + i) = *(transp + i);
+ has_alpha = 1;
+ }
+ }
+/* creating the raster data */
+ data_size = width * height * nBands;
+ data = malloc (data_size);
+ if (data == NULL)
+ goto error;
+ p_data = data;
+ if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA
+ || color_type == PNG_COLOR_TYPE_RGB_ALPHA || has_alpha)
+ {
+ /* creating a transparency mask */
+ mask_sz = width * height;
+ mask = malloc (mask_sz);
+ if (mask == NULL)
+ goto error;
+ p_mask = mask;
+ }
+ png_read_update_info (png_ptr, info_ptr);
+ rowbytes = png_get_rowbytes (png_ptr, info_ptr);
+ image_data = malloc (rowbytes * height);
+ if (!image_data)
+ goto error;
+ row_pointers = malloc (height * sizeof (png_bytep));
+ if (!row_pointers)
+ goto error;
+ for (row = 0; row < height; row++)
+ row_pointers[row] = image_data + (row * rowbytes);
+ png_read_image (png_ptr, row_pointers);
+ png_read_end (png_ptr, NULL);
+ png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
+ switch (color_type)
+ {
+ case PNG_COLOR_TYPE_RGB:
+ for (row = 0; row < height; row++)
+ {
+ png_bytep p_in = row_pointers[row];
+ for (col = 0; col < width; col++)
+ {
+ *p_data++ = *p_in++;
+ *p_data++ = *p_in++;
+ *p_data++ = *p_in++;
+ }
+ }
+ break;
+ case PNG_COLOR_TYPE_RGB_ALPHA:
+ for (row = 0; row < height; row++)
+ {
+ png_bytep p_in = row_pointers[row];
+ for (col = 0; col < width; col++)
+ {
+ *p_data++ = *p_in++;
+ *p_data++ = *p_in++;
+ *p_data++ = *p_in++;
+ if (p_mask != NULL)
+ {
+ if (*p_in++ < 128)
+ *p_mask++ = 0;
+ else
+ *p_mask++ = 1;
+ }
+ else
+ p_in++;
+ }
+ }
+ break;
+ case PNG_COLOR_TYPE_GRAY:
+ for (row = 0; row < height; row++)
+ {
+ png_bytep p_in = row_pointers[row];
+ for (col = 0; col < width; col++)
+ {
+ unsigned char val = *p_in++;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ val = 0;
+ };
+ *p_data++ = val;
+ }
+ }
+ break;
+ case PNG_COLOR_TYPE_GRAY_ALPHA:
+ for (row = 0; row < height; row++)
+ {
+ png_bytep p_in = row_pointers[row];
+ for (col = 0; col < width; col++)
+ {
+ *p_data++ = *p_in++;
+ if (p_mask != NULL)
+ {
+ if (*p_in++ < 128)
+ *p_mask++ = 0;
+ else
+ *p_mask++ = 1;
+ }
+ else
+ p_in++;
+ }
+ }
+ break;
+ default: /* palette */
+ for (row = 0; row < height; row++)
+ {
+ png_bytep p_in = row_pointers[row];
+ for (col = 0; col < width; col++)
+ {
+ *p_data++ = *p_in;
+ if (p_mask != NULL)
+ {
+ if (alpha[*p_in] < 128)
+ *p_mask++ = 0;
+ else
+ *p_mask++ = 1;
+ }
+ p_in++;
+ }
+ }
+ break;
+ };
+
+ free (image_data);
+ free (row_pointers);
+/* creating the raster */
+ if (nPalette > 0)
+ {
+ rl_palette = rl2_create_palette (nPalette);
+ if (rl_palette == NULL)
+ goto error;
+ for (i = 0; i < nPalette; i++)
+ rl2_set_palette_color (rl_palette, i, red[i], green[i], blue[i]);
+ }
+ *xwidth = width;
+ *xheight = height;
+ *xsample_type = sample_type;
+ *xpixel_type = pixel_type;
+ *num_bands = nBands;
+ *pixels = data;
+ *pixels_sz = data_size;
+ *xmask = mask;
+ *xmask_sz = mask_sz;
+ *xpalette = rl_palette;
+ return RL2_OK;
+
+ error:
+ png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
+ free (image_data);
+ if (mask != NULL)
+ free (mask);
+ free (row_pointers);
+ return RL2_ERROR;
+}
diff --git a/src/rl2pyramid.c b/src/rl2pyramid.c
new file mode 100644
index 0000000..ca59e73
--- /dev/null
+++ b/src/rl2pyramid.c
@@ -0,0 +1,6522 @@
+/*
+
+ rl2pyramid -- DBMS Pyramid functions
+
+ version 0.1, 2014 July 13
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#include <sys/types.h>
+#if defined(_WIN32) && !defined(__MINGW32__)
+#include <io.h>
+#include <direct.h>
+#else
+#include <dirent.h>
+#endif
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2tiff.h"
+#include "rasterlite2/rl2graphics.h"
+#include "rasterlite2_private.h"
+
+#include <spatialite/gaiaaux.h>
+
+/* 64 bit integer: portable format for printf() */
+#if defined(_WIN32) && !defined(__MINGW32__)
+#define ERR_FRMT64 "ERROR: unable to decode Tile ID=%I64d\n"
+#else
+#define ERR_FRMT64 "ERROR: unable to decode Tile ID=%lld\n"
+#endif
+
+static int
+do_insert_pyramid_levels (sqlite3 * handle, int id_level, double res_x,
+ double res_y, sqlite3_stmt * stmt_levl)
+{
+/* INSERTing the Pyramid levels */
+ int ret;
+ sqlite3_reset (stmt_levl);
+ sqlite3_clear_bindings (stmt_levl);
+ sqlite3_bind_int (stmt_levl, 1, id_level);
+ sqlite3_bind_double (stmt_levl, 2, res_x);
+ sqlite3_bind_double (stmt_levl, 3, res_y);
+ sqlite3_bind_double (stmt_levl, 4, res_x * 2.0);
+ sqlite3_bind_double (stmt_levl, 5, res_y * 2.0);
+ sqlite3_bind_double (stmt_levl, 6, res_x * 4.0);
+ sqlite3_bind_double (stmt_levl, 7, res_y * 4.0);
+ sqlite3_bind_double (stmt_levl, 8, res_x * 8.0);
+ sqlite3_bind_double (stmt_levl, 9, res_y * 8.0);
+ ret = sqlite3_step (stmt_levl);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "INSERT INTO levels; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ return 1;
+ error:
+ return 0;
+}
+
+static int
+do_insert_pyramid_tile (sqlite3 * handle, unsigned char *blob_odd,
+ int blob_odd_sz, unsigned char *blob_even,
+ int blob_even_sz, int id_level,
+ sqlite3_int64 section_id, int srid, double minx,
+ double miny, double maxx, double maxy,
+ sqlite3_stmt * stmt_tils, sqlite3_stmt * stmt_data)
+{
+/* INSERTing a Pyramid tile */
+ int ret;
+ sqlite3_int64 tile_id;
+ unsigned char *blob;
+ int blob_size;
+ gaiaGeomCollPtr geom;
+
+ sqlite3_reset (stmt_tils);
+ sqlite3_clear_bindings (stmt_tils);
+ sqlite3_bind_int (stmt_tils, 1, id_level);
+ if (section_id < 0)
+ sqlite3_bind_null (stmt_tils, 2);
+ else
+ sqlite3_bind_int64 (stmt_tils, 2, section_id);
+ geom = build_extent (srid, minx, miny, maxx, maxy);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ gaiaFreeGeomColl (geom);
+ sqlite3_bind_blob (stmt_tils, 3, blob, blob_size, free);
+ ret = sqlite3_step (stmt_tils);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "INSERT INTO tiles; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ tile_id = sqlite3_last_insert_rowid (handle);
+ /* INSERTing tile data */
+ sqlite3_reset (stmt_data);
+ sqlite3_clear_bindings (stmt_data);
+ sqlite3_bind_int64 (stmt_data, 1, tile_id);
+ sqlite3_bind_blob (stmt_data, 2, blob_odd, blob_odd_sz, free);
+ if (blob_even == NULL)
+ sqlite3_bind_null (stmt_data, 3);
+ else
+ sqlite3_bind_blob (stmt_data, 3, blob_even, blob_even_sz, free);
+ ret = sqlite3_step (stmt_data);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "INSERT INTO tile_data; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ return 1;
+ error:
+ return 0;
+}
+
+static int
+resolve_section_id (sqlite3 * handle, const char *coverage, const char *section,
+ sqlite3_int64 * sect_id)
+{
+/* resolving the Section ID by name */
+ char *table;
+ char *xtable;
+ char *sql;
+ sqlite3_stmt *stmt = NULL;
+ int ret;
+ int ok = 0;
+
+/* Section infos */
+ table = sqlite3_mprintf ("%s_sections", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("SELECT section_id "
+ "FROM \"%s\" WHERE section_name = %Q", xtable,
+ section);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ *sect_id = sqlite3_column_int64 (stmt, 0);
+ ok = 1;
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT section_info; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ return 0;
+}
+
+static int
+delete_section_pyramid (sqlite3 * handle, const char *coverage,
+ const char *section)
+{
+/* attempting to delete a section pyramid */
+ char *sql;
+ char *table;
+ char *xtable;
+ sqlite3_int64 section_id;
+ char sect_id[1024];
+ int ret;
+ char *err_msg = NULL;
+
+ if (!resolve_section_id (handle, coverage, section, §ion_id))
+ return 0;
+#if defined(_WIN32) && !defined(__MINGW32__)
+ sprintf (sect_id, "%I64d", section_id);
+#else
+ sprintf (sect_id, "%lld", section_id);
+#endif
+
+ table = sqlite3_mprintf ("%s_tiles", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("DELETE FROM \"%s\" WHERE pyramid_level > 0 AND section_id = %s",
+ xtable, sect_id);
+ free (xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DELETE FROM \"%s_tiles\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+check_section_pyramid (sqlite3 * handle, const char *coverage,
+ const char *section)
+{
+/* checking if a section's pyramid already exists */
+ char *sql;
+ char *table;
+ char *xtable;
+ sqlite3_int64 section_id;
+ char sect_id[1024];
+ sqlite3_stmt *stmt = NULL;
+ int ret;
+ int count = 0;
+
+ if (!resolve_section_id (handle, coverage, section, §ion_id))
+ return 1;
+#if defined(_WIN32) && !defined(__MINGW32__)
+ sprintf (sect_id, "%I64d", section_id);
+#else
+ sprintf (sect_id, "%lld", section_id);
+#endif
+
+ table = sqlite3_mprintf ("%s_tiles", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf ("SELECT Count(*) FROM \"%s\" "
+ "WHERE section_id = %s AND pyramid_level > 0", xtable,
+ sect_id);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 1;
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ count = sqlite3_column_int (stmt, 0);
+ else
+ {
+ fprintf (stderr,
+ "SELECT pyramid_exists; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ count = 0;
+ break;
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (count == 0)
+ return 1;
+ return 0;
+}
+
+static int
+get_section_infos (sqlite3 * handle, const char *coverage, const char *section,
+ sqlite3_int64 * sect_id, unsigned int *sect_width,
+ unsigned int *sect_height, double *minx, double *miny,
+ double *maxx, double *maxy, rl2PalettePtr * palette,
+ rl2PixelPtr * no_data)
+{
+/* retrieving the Section most relevant infos */
+ char *table;
+ char *xtable;
+ char *sql;
+ sqlite3_stmt *stmt = NULL;
+ int ret;
+ int ok = 0;
+
+/* Section infos */
+ table = sqlite3_mprintf ("%s_sections", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf ("SELECT section_id, width, height, MbrMinX(geometry), "
+ "MbrMinY(geometry), MbrMaxX(geometry), MbrMaxY(geometry) "
+ "FROM \"%s\" WHERE section_name = %Q", xtable,
+ section);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ *sect_id = sqlite3_column_int64 (stmt, 0);
+ *sect_width = sqlite3_column_int (stmt, 1);
+ *sect_height = sqlite3_column_int (stmt, 2);
+ *minx = sqlite3_column_double (stmt, 3);
+ *miny = sqlite3_column_double (stmt, 4);
+ *maxx = sqlite3_column_double (stmt, 5);
+ *maxy = sqlite3_column_double (stmt, 6);
+ ok = 1;
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT section_info; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (!ok)
+ goto error;
+
+/* Coverage's palette and no-data */
+ sql = sqlite3_mprintf ("SELECT palette, nodata_pixel FROM raster_coverages "
+ "WHERE Lower(coverage_name) = Lower(%Q)", coverage);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ *palette = rl2_deserialize_dbms_palette (blob, blob_sz);
+ }
+ if (sqlite3_column_type (stmt, 1) == SQLITE_BLOB)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 1);
+ int blob_sz = sqlite3_column_bytes (stmt, 1);
+ *no_data = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ }
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT section_info; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return 1;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ return 0;
+}
+
+static SectionPyramidTileInPtr
+alloc_section_pyramid_tile (sqlite3_int64 tile_id, double minx, double miny,
+ double maxx, double maxy)
+{
+/* allocating a Section Pyramid Tile object */
+ SectionPyramidTileInPtr tile = malloc (sizeof (SectionPyramidTileIn));
+ if (tile == NULL)
+ return NULL;
+ tile->tile_id = tile_id;
+ tile->cx = minx + ((maxx - minx) / 2.0);
+ tile->cy = miny + ((maxy - miny) / 2.0);
+ tile->next = NULL;
+ return tile;
+}
+
+static SectionPyramidPtr
+alloc_sect_pyramid (sqlite3_int64 sect_id, unsigned int sect_width,
+ unsigned int sect_height, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_samples,
+ unsigned char compression, int quality, int srid,
+ double res_x, double res_y, double tile_width,
+ double tile_height, double minx, double miny, double maxx,
+ double maxy, int scale)
+{
+/* allocating a Section Pyramid object */
+ double ext_x = maxx - minx;
+ double ext_y = maxy - miny;
+ SectionPyramidPtr pyr = malloc (sizeof (SectionPyramid));
+ if (pyr == NULL)
+ return NULL;
+ pyr->section_id = sect_id;
+ pyr->scale = scale;
+ pyr->full_width = sect_width;
+ pyr->full_height = sect_height;
+ pyr->sample_type = sample_type;
+ pyr->pixel_type = pixel_type;
+ pyr->num_samples = num_samples;
+ pyr->compression = compression;
+ pyr->quality = quality;
+ pyr->srid = srid;
+ pyr->res_x = res_x;
+ pyr->res_y = res_y;
+ pyr->scaled_width = ext_x / res_x;
+ pyr->scaled_height = ext_y / res_y;
+ pyr->tile_width = tile_width;
+ pyr->tile_height = tile_height;
+ pyr->minx = minx;
+ pyr->miny = miny;
+ pyr->maxx = maxx;
+ pyr->maxy = maxy;
+ pyr->first_in = NULL;
+ pyr->last_in = NULL;
+ pyr->first_out = NULL;
+ pyr->last_out = NULL;
+ return pyr;
+}
+
+static void
+delete_sect_pyramid (SectionPyramidPtr pyr)
+{
+/* memory cleanup - destroying a Section Pyramid object */
+ SectionPyramidTileInPtr tile_in;
+ SectionPyramidTileInPtr tile_in_n;
+ SectionPyramidTileOutPtr tile_out;
+ SectionPyramidTileOutPtr tile_out_n;
+ if (pyr == NULL)
+ return;
+ tile_out = pyr->first_out;
+ while (tile_out != NULL)
+ {
+ SectionPyramidTileRefPtr ref;
+ SectionPyramidTileRefPtr ref_n;
+ tile_out_n = tile_out->next;
+ ref = tile_out->first;
+ while (ref != NULL)
+ {
+ ref_n = ref->next;
+ free (ref);
+ ref = ref_n;
+ }
+ free (tile_out);
+ tile_out = tile_out_n;
+ }
+ tile_in = pyr->first_in;
+ while (tile_in != NULL)
+ {
+ tile_in_n = tile_in->next;
+ free (tile_in);
+ tile_in = tile_in_n;
+ }
+ free (pyr);
+}
+
+static int
+insert_tile_into_section_pyramid (SectionPyramidPtr pyr, sqlite3_int64 tile_id,
+ double minx, double miny, double maxx,
+ double maxy)
+{
+/* inserting a base tile into the Pyramid level */
+ SectionPyramidTileInPtr tile;
+ if (pyr == NULL)
+ return 0;
+ tile = alloc_section_pyramid_tile (tile_id, minx, miny, maxx, maxy);
+ if (tile == NULL)
+ return 0;
+ if (pyr->first_in == NULL)
+ pyr->first_in = tile;
+ if (pyr->last_in != NULL)
+ pyr->last_in->next = tile;
+ pyr->last_in = tile;
+ return 1;
+}
+
+static SectionPyramidTileOutPtr
+add_pyramid_out_tile (SectionPyramidPtr pyr, unsigned int row,
+ unsigned int col, double minx, double miny, double maxx,
+ double maxy)
+{
+/* inserting a Parent tile (output) */
+ SectionPyramidTileOutPtr tile;
+ if (pyr == NULL)
+ return NULL;
+ tile = malloc (sizeof (SectionPyramidTileOut));
+ if (tile == NULL)
+ return NULL;
+ tile->row = row;
+ tile->col = col;
+ tile->minx = minx;
+ tile->miny = miny;
+ tile->maxx = maxx;
+ tile->maxy = maxy;
+ tile->first = NULL;
+ tile->last = NULL;
+ tile->next = NULL;
+ if (pyr->first_out == NULL)
+ pyr->first_out = tile;
+ if (pyr->last_out != NULL)
+ pyr->last_out->next = tile;
+ pyr->last_out = tile;
+ return tile;
+}
+
+static void
+add_pyramid_sub_tile (SectionPyramidTileOutPtr parent,
+ SectionPyramidTileInPtr child)
+{
+/* inserting a Child tile (input) */
+ SectionPyramidTileRefPtr ref;
+ if (parent == NULL)
+ return;
+ ref = malloc (sizeof (SectionPyramidTileRef));
+ if (ref == NULL)
+ return;
+ ref->child = child;
+ ref->next = NULL;
+ if (parent->first == NULL)
+ parent->first = ref;
+ if (parent->last != NULL)
+ parent->last->next = ref;
+ parent->last = ref;
+}
+
+static void
+set_pyramid_tile_destination (SectionPyramidPtr pyr, double minx, double miny,
+ double maxx, double maxy, unsigned int row,
+ unsigned int col)
+{
+/* aggregating lower level tiles */
+ int first = 1;
+ SectionPyramidTileOutPtr out = NULL;
+ SectionPyramidTileInPtr tile = pyr->first_in;
+ while (tile != NULL)
+ {
+ if (tile->cx > minx && tile->cx < maxx && tile->cy > miny
+ && tile->cy < maxy)
+ {
+ if (first)
+ {
+ out =
+ add_pyramid_out_tile (pyr, row, col, minx, miny, maxx,
+ maxy);
+ first = 0;
+ }
+ if (out != NULL)
+ add_pyramid_sub_tile (out, tile);
+ }
+ tile = tile->next;
+ }
+}
+
+static unsigned char *
+load_tile_base (sqlite3_stmt * stmt, sqlite3_int64 tile_id,
+ rl2PalettePtr palette, rl2PixelPtr no_data)
+{
+/* attempting to read a lower-level tile */
+ int ret;
+ const unsigned char *blob_odd = NULL;
+ int blob_odd_sz = 0;
+ const unsigned char *blob_even = NULL;
+ int blob_even_sz = 0;
+ rl2RasterPtr raster = NULL;
+ rl2PalettePtr plt = NULL;
+ unsigned char *rgba_tile = NULL;
+ int rgba_sz;
+ rl2PixelPtr nd;
+
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_int64 (stmt, 1, tile_id);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ blob_odd = sqlite3_column_blob (stmt, 0);
+ blob_odd_sz = sqlite3_column_bytes (stmt, 0);
+ }
+ if (sqlite3_column_type (stmt, 1) == SQLITE_BLOB)
+ {
+ blob_even = sqlite3_column_blob (stmt, 1);
+ blob_even_sz = sqlite3_column_bytes (stmt, 1);
+ }
+ plt = rl2_clone_palette (palette);
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz,
+ blob_even, blob_even_sz, plt);
+ if (raster == NULL)
+ {
+ fprintf (stderr, ERR_FRMT64, tile_id);
+ return NULL;
+ }
+ nd = rl2_clone_pixel (no_data);
+ rl2_set_raster_no_data (raster, nd);
+ if (rl2_raster_data_to_RGBA (raster, &rgba_tile, &rgba_sz) !=
+ RL2_OK)
+ rgba_tile = NULL;
+ rl2_destroy_raster (raster);
+ break;
+ }
+ else
+ return NULL;
+ }
+ return rgba_tile;
+}
+
+static rl2RasterPtr
+load_tile_base_generic (sqlite3_stmt * stmt, sqlite3_int64 tile_id)
+{
+/* attempting to read a lower-level tile */
+ int ret;
+ const unsigned char *blob_odd = NULL;
+ int blob_odd_sz = 0;
+ const unsigned char *blob_even = NULL;
+ int blob_even_sz = 0;
+ rl2RasterPtr raster = NULL;
+
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_int64 (stmt, 1, tile_id);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ blob_odd = sqlite3_column_blob (stmt, 0);
+ blob_odd_sz = sqlite3_column_bytes (stmt, 0);
+ }
+ if (sqlite3_column_type (stmt, 1) == SQLITE_BLOB)
+ {
+ blob_even = sqlite3_column_blob (stmt, 1);
+ blob_even_sz = sqlite3_column_bytes (stmt, 1);
+ }
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz,
+ blob_even, blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, ERR_FRMT64, tile_id);
+ return NULL;
+ }
+ return raster;
+ }
+ }
+ return NULL;
+}
+
+static double
+rescale_pixel_int8 (const char *buf_in, unsigned int tileWidth,
+ unsigned int tileHeight, int x, int y, char nd)
+{
+/* rescaling a DataGrid pixel (8x8) - INT8 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+
+ for (row = 0; row < 8; row++)
+ {
+ const char *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < 8; col++)
+ {
+ const char *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + x;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return nd;
+ return (char) (sum / (double) valid);
+}
+
+static void
+rescale_grid_int8 (char *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight, const char *buf_in, int x, int y,
+ int tic_x, int tic_y, rl2PixelPtr no_data)
+{
+/* rescaling a DataGrid tile - int 8 bit */
+ unsigned int row;
+ unsigned int col;
+ char nd = 0;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) no_data;
+
+ if (pxl != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ if (pxl->sampleType == RL2_SAMPLE_INT8 && pxl->nBands == 1)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd = sample->int8;
+ }
+ }
+
+ for (row = 0; row < (unsigned) tic_y; row++)
+ {
+ unsigned int yy = row + y;
+ char *p_out_base = buf_out + (yy * tileWidth);
+ if (yy >= tileHeight)
+ break;
+ for (col = 0; col < (unsigned int) tic_x; col++)
+ {
+ unsigned int xx = col + x;
+ char *p_out = p_out_base + xx;
+ if (xx >= tileWidth)
+ break;
+ *p_out =
+ rescale_pixel_int8 (buf_in, tileWidth, tileHeight, col * 8,
+ row * 8, nd);
+ }
+ }
+}
+
+static double
+rescale_pixel_uint8 (const unsigned char *buf_in, unsigned int tileWidth,
+ unsigned int tileHeight, int x, int y, unsigned char nd)
+{
+/* rescaling a DataGrid pixel (8x8) - UINT8 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+
+ for (row = 0; row < 8; row++)
+ {
+ const unsigned char *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < 8; col++)
+ {
+ const unsigned char *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + x;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return nd;
+ return (unsigned char) (sum / (double) valid);
+}
+
+static void
+rescale_grid_uint8 (unsigned char *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight, const unsigned char *buf_in,
+ int x, int y, int tic_x, int tic_y, rl2PixelPtr no_data)
+{
+/* rescaling a DataGrid tile - unsigned int 8 bit */
+ unsigned int row;
+ unsigned int col;
+ unsigned char nd = 0;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) no_data;
+
+ if (pxl != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ if (pxl->sampleType == RL2_SAMPLE_UINT8 && pxl->nBands == 1)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd = sample->uint8;
+ }
+ }
+
+ for (row = 0; row < (unsigned int) tic_y; row++)
+ {
+ unsigned int yy = row + y;
+ unsigned char *p_out_base = buf_out + (yy * tileWidth);
+ if (yy >= tileHeight)
+ break;
+ for (col = 0; col < (unsigned int) tic_x; col++)
+ {
+ unsigned int xx = col + x;
+ unsigned char *p_out = p_out_base + xx;
+ if (xx >= tileWidth)
+ break;
+ *p_out =
+ rescale_pixel_uint8 (buf_in, tileWidth, tileHeight, col * 8,
+ row * 8, nd);
+ }
+ }
+}
+
+static double
+rescale_pixel_int16 (const short *buf_in, unsigned int tileWidth,
+ unsigned int tileHeight, int x, int y, short nd)
+{
+/* rescaling a DataGrid pixel (8x8) - INT32 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+
+ for (row = 0; row < 8; row++)
+ {
+ const short *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < 8; col++)
+ {
+ const short *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + x;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return nd;
+ return (short) (sum / (double) valid);
+}
+
+static void
+rescale_grid_int16 (short *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight, const short *buf_in, int x,
+ int y, int tic_x, int tic_y, rl2PixelPtr no_data)
+{
+/* rescaling a DataGrid tile - int 16 bit */
+ unsigned int row;
+ unsigned int col;
+ short nd = 0;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) no_data;
+
+ if (pxl != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ if (pxl->sampleType == RL2_SAMPLE_INT16 && pxl->nBands == 1)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd = sample->int16;
+ }
+ }
+
+ for (row = 0; row < (unsigned int) tic_y; row++)
+ {
+ unsigned int yy = row + y;
+ short *p_out_base = buf_out + (yy * tileWidth);
+ if (yy >= tileHeight)
+ break;
+ for (col = 0; col < (unsigned int) tic_x; col++)
+ {
+ unsigned int xx = col + x;
+ short *p_out = p_out_base + xx;
+ if (xx >= tileWidth)
+ break;
+ *p_out =
+ rescale_pixel_int16 (buf_in, tileWidth, tileHeight, col * 8,
+ row * 8, nd);
+ }
+ }
+}
+
+static double
+rescale_pixel_uint16 (const unsigned short *buf_in, unsigned int tileWidth,
+ unsigned int tileHeight, int x, int y, unsigned short nd)
+{
+/* rescaling a DataGrid pixel (8x8) - UINT16 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+
+ for (row = 0; row < 8; row++)
+ {
+ const unsigned short *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < 8; col++)
+ {
+ const unsigned short *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + x;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return nd;
+ return (unsigned short) (sum / (double) valid);
+}
+
+static void
+rescale_grid_uint16 (unsigned short *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight, const unsigned short *buf_in,
+ int x, int y, int tic_x, int tic_y, rl2PixelPtr no_data)
+{
+/* rescaling a DataGrid tile - unsigned int 16 bit */
+ unsigned int row;
+ unsigned int col;
+ unsigned short nd = 0;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) no_data;
+
+ if (pxl != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ if (pxl->sampleType == RL2_SAMPLE_UINT16 && pxl->nBands == 1)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd = sample->uint16;
+ }
+ }
+
+ for (row = 0; row < (unsigned int) tic_y; row++)
+ {
+ unsigned int yy = row + y;
+ unsigned short *p_out_base = buf_out + (yy * tileWidth);
+ if (yy >= tileHeight)
+ break;
+ for (col = 0; col < (unsigned int) tic_x; col++)
+ {
+ unsigned int xx = col + x;
+ unsigned short *p_out = p_out_base + xx;
+ if (xx >= tileWidth)
+ break;
+ *p_out =
+ rescale_pixel_uint16 (buf_in, tileWidth, tileHeight,
+ col * 8, row * 8, nd);
+ }
+ }
+}
+
+static double
+rescale_pixel_int32 (const int *buf_in, unsigned int tileWidth,
+ unsigned int tileHeight, int x, int y, int nd)
+{
+/* rescaling a DataGrid pixel (8x8) - INT32 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+
+ for (row = 0; row < 8; row++)
+ {
+ const int *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < 8; col++)
+ {
+ const int *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + x;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return nd;
+ return (int) (sum / (double) valid);
+}
+
+static void
+rescale_grid_int32 (int *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight, const int *buf_in, int x, int y,
+ int tic_x, int tic_y, rl2PixelPtr no_data)
+{
+/* rescaling a DataGrid tile - int 32 bit */
+ unsigned int row;
+ unsigned int col;
+ int nd = 0;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) no_data;
+
+ if (pxl != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ if (pxl->sampleType == RL2_SAMPLE_INT32 && pxl->nBands == 1)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd = sample->int32;
+ }
+ }
+
+ for (row = 0; row < (unsigned int) tic_y; row++)
+ {
+ unsigned int yy = row + y;
+ int *p_out_base = buf_out + (yy * tileWidth);
+ if (yy >= tileHeight)
+ break;
+ for (col = 0; col < (unsigned int) tic_x; col++)
+ {
+ unsigned int xx = col + x;
+ int *p_out = p_out_base + xx;
+ if (xx >= tileWidth)
+ break;
+ *p_out =
+ rescale_pixel_int32 (buf_in, tileWidth, tileHeight, col * 8,
+ row * 8, nd);
+ }
+ }
+}
+
+static double
+rescale_pixel_uint32 (const unsigned int *buf_in, unsigned int tileWidth,
+ unsigned int tileHeight, int x, int y, unsigned int nd)
+{
+/* rescaling a DataGrid pixel (8x8) - UINT32 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+
+ for (row = 0; row < 8; row++)
+ {
+ const unsigned int *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < 8; col++)
+ {
+ const unsigned int *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + x;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return nd;
+ return (unsigned int) (sum / (double) valid);
+}
+
+static void
+rescale_grid_uint32 (unsigned int *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight, const unsigned int *buf_in,
+ int x, int y, int tic_x, int tic_y, rl2PixelPtr no_data)
+{
+/* rescaling a DataGrid tile - unsigned int 32 bit */
+ unsigned int row;
+ unsigned int col;
+ unsigned int nd = 0;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) no_data;
+
+ if (pxl != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ if (pxl->sampleType == RL2_SAMPLE_UINT32 && pxl->nBands == 1)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd = sample->uint32;
+ }
+ }
+
+ for (row = 0; row < (unsigned int) tic_y; row++)
+ {
+ unsigned int yy = row + y;
+ unsigned int *p_out_base = buf_out + (yy * tileWidth);
+ if (yy >= tileHeight)
+ break;
+ for (col = 0; col < (unsigned int) tic_x; col++)
+ {
+ unsigned int xx = col + x;
+ unsigned int *p_out = p_out_base + xx;
+ if (xx >= tileWidth)
+ break;
+ *p_out =
+ rescale_pixel_uint32 (buf_in, tileWidth, tileHeight,
+ col * 8, row * 8, nd);
+ }
+ }
+}
+
+static double
+rescale_pixel_float (const float *buf_in, unsigned int tileWidth,
+ unsigned int tileHeight, int x, int y, float nd)
+{
+/* rescaling a DataGrid pixel (8x8) - Float */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+
+ for (row = 0; row < 8; row++)
+ {
+ const float *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < 8; col++)
+ {
+ const float *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + x;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return nd;
+ return (float) (sum / (double) valid);
+}
+
+static void
+rescale_grid_float (float *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight, const float *buf_in, int x,
+ int y, int tic_x, int tic_y, rl2PixelPtr no_data)
+{
+/* rescaling a DataGrid tile - Float */
+ unsigned int row;
+ unsigned int col;
+ float nd = 0.0;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) no_data;
+
+ if (pxl != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ if (pxl->sampleType == RL2_SAMPLE_FLOAT && pxl->nBands == 1)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd = sample->float32;
+ }
+ }
+
+ for (row = 0; row < (unsigned int) tic_y; row++)
+ {
+ unsigned int yy = row + y;
+ float *p_out_base = buf_out + (yy * tileWidth);
+ if (yy >= tileHeight)
+ break;
+ for (col = 0; col < (unsigned int) tic_x; col++)
+ {
+ unsigned int xx = col + x;
+ float *p_out = p_out_base + xx;
+ if (xx >= tileWidth)
+ break;
+ *p_out =
+ rescale_pixel_float (buf_in, tileWidth, tileHeight, col * 8,
+ row * 8, nd);
+ }
+ }
+}
+
+static double
+rescale_pixel_double (const double *buf_in, unsigned int tileWidth,
+ unsigned int tileHeight, int x, int y, double nd)
+{
+/* rescaling a DataGrid pixel (8x8) - Double */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+
+ for (row = 0; row < 8; row++)
+ {
+ const double *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < 8; col++)
+ {
+ const double *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + x;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return nd;
+ return sum / (double) valid;
+}
+
+static void
+rescale_grid_double (double *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight, const double *buf_in, int x,
+ int y, int tic_x, int tic_y, rl2PixelPtr no_data)
+{
+/* rescaling a DataGrid tile - Double */
+ unsigned int row;
+ unsigned int col;
+ double nd = 0.0;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) no_data;
+
+ if (pxl != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ if (pxl->sampleType == RL2_SAMPLE_DOUBLE && pxl->nBands == 1)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd = sample->float64;
+ }
+ }
+
+ for (row = 0; row < (unsigned int) tic_y; row++)
+ {
+ unsigned int yy = row + y;
+ double *p_out_base = buf_out + (yy * tileWidth);
+ if (yy >= tileHeight)
+ break;
+ for (col = 0; col < (unsigned int) tic_x; col++)
+ {
+ unsigned int xx = col + x;
+ double *p_out = p_out_base + xx;
+ if (xx >= tileWidth)
+ break;
+ *p_out =
+ rescale_pixel_double (buf_in, tileWidth, tileHeight,
+ col * 8, row * 8, nd);
+ }
+ }
+}
+
+static void
+rescale_grid (void *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight, const void *buf_in,
+ unsigned char sample_type, int x, int y, int tic_x, int tic_y,
+ rl2PixelPtr no_data)
+{
+/* rescaling a DataGrid tile */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ rescale_grid_int8 ((char *) buf_out, tileWidth, tileHeight,
+ (const char *) buf_in, x, y, tic_x, tic_y,
+ no_data);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rescale_grid_uint8 ((unsigned char *) buf_out, tileWidth, tileHeight,
+ (const unsigned char *) buf_in, x, y, tic_x,
+ tic_y, no_data);
+ break;
+ case RL2_SAMPLE_INT16:
+ rescale_grid_int16 ((short *) buf_out, tileWidth, tileHeight,
+ (const short *) buf_in, x, y, tic_x, tic_y,
+ no_data);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rescale_grid_uint16 ((unsigned short *) buf_out, tileWidth,
+ tileHeight, (const unsigned short *) buf_in, x,
+ y, tic_x, tic_y, no_data);
+ break;
+ case RL2_SAMPLE_INT32:
+ rescale_grid_int32 ((int *) buf_out, tileWidth, tileHeight,
+ (const int *) buf_in, x, y, tic_x, tic_y,
+ no_data);
+ break;
+ case RL2_SAMPLE_UINT32:
+ rescale_grid_uint32 ((unsigned int *) buf_out, tileWidth, tileHeight,
+ (const unsigned int *) buf_in, x, y, tic_x,
+ tic_y, no_data);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ rescale_grid_float ((float *) buf_out, tileWidth, tileHeight,
+ (const float *) buf_in, x, y, tic_x, tic_y,
+ no_data);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ rescale_grid_double ((double *) buf_out, tileWidth, tileHeight,
+ (const double *) buf_in, x, y, tic_x, tic_y,
+ no_data);
+ break;
+ };
+}
+
+static int
+update_sect_pyramid_grid (sqlite3 * handle, sqlite3_stmt * stmt_rd,
+ sqlite3_stmt * stmt_tils, sqlite3_stmt * stmt_data,
+ SectionPyramid * pyr, unsigned int tileWidth,
+ unsigned int tileHeight, int id_level,
+ rl2PixelPtr no_data, unsigned char sample_type)
+{
+/* creating and inserting Pyramid tiles */
+ unsigned char *buf_out = NULL;
+ unsigned char *mask = NULL;
+ SectionPyramidTileOutPtr tile_out;
+ SectionPyramidTileRefPtr tile_in;
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ unsigned int col;
+ int tic_x;
+ int tic_y;
+ double pos_y;
+ double pos_x;
+ double geo_x;
+ double geo_y;
+ rl2PixelPtr nd = NULL;
+ rl2RasterPtr raster_out = NULL;
+ rl2RasterPtr raster_in = NULL;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ int pixel_sz = 1;
+ int out_sz;
+ int mask_sz = 0;
+
+ if (pyr == NULL)
+ goto error;
+ tic_x = tileWidth / pyr->scale;
+ tic_y = tileHeight / pyr->scale;
+ geo_x = (double) tic_x *pyr->res_x;
+ geo_y = (double) tic_y *pyr->res_y;
+
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pixel_sz = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pixel_sz = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pixel_sz = 8;
+ break;
+ };
+ out_sz = tileWidth * tileHeight * pixel_sz;
+
+ tile_out = pyr->first_out;
+ while (tile_out != NULL)
+ {
+ rl2PrivRasterPtr rst;
+ /* allocating the output buffer */
+ buf_out = malloc (out_sz);
+ if (buf_out == NULL)
+ goto error;
+ rl2_prime_void_tile (buf_out, tileWidth, tileHeight, sample_type, 1,
+ no_data);
+
+ if (tile_out->col + tileWidth > pyr->scaled_width
+ || tile_out->row + tileHeight > pyr->scaled_height)
+ {
+ /* allocating and initializing a transparency mask */
+ unsigned char *p;
+ mask_sz = tileWidth * tileHeight;
+ mask = malloc (mask_sz);
+ if (mask == NULL)
+ goto error;
+ p = mask;
+ for (row = 0; row < tileHeight; row++)
+ {
+ unsigned int x_row = tile_out->row + row;
+ for (col = 0; col < tileWidth; col++)
+ {
+ unsigned int x_col = tile_out->col + col;
+ if (x_row >= pyr->scaled_height
+ || x_col >= pyr->scaled_width)
+ {
+ /* masking any portion of the tile exceeding the scaled section size */
+ *p++ = 0;
+ }
+ else
+ *p++ = 1;
+ }
+ }
+ }
+ else
+ {
+ mask = NULL;
+ mask_sz = 0;
+ }
+
+ /* creating the output (rescaled) tile */
+ tile_in = tile_out->first;
+ while (tile_in != NULL)
+ {
+ /* loading and rescaling the base tiles */
+ raster_in =
+ load_tile_base_generic (stmt_rd, tile_in->child->tile_id);
+ if (raster_in == NULL)
+ goto error;
+ pos_y = tile_out->maxy;
+ x = 0;
+ y = 0;
+ for (row = 0; row < tileHeight; row += tic_y)
+ {
+ pos_x = tile_out->minx;
+ for (col = 0; col < tileWidth; col += tic_x)
+ {
+ if (tile_in->child->cy < pos_y
+ && tile_in->child->cy > (pos_y - geo_y)
+ && tile_in->child->cx > pos_x
+ && tile_in->child->cx < (pos_x + geo_x))
+ {
+ x = col;
+ y = row;
+ break;
+ }
+ pos_x += geo_x;
+ }
+ pos_y -= geo_y;
+ }
+ rst = (rl2PrivRasterPtr) raster_in;
+ rescale_grid (buf_out, tileWidth, tileHeight, rst->rasterBuffer,
+ sample_type, x, y, tic_x, tic_y, no_data);
+ rl2_destroy_raster (raster_in);
+ raster_in = NULL;
+ tile_in = tile_in->next;
+ }
+
+ raster_out = NULL;
+ raster_out =
+ rl2_create_raster (tileWidth, tileHeight, sample_type,
+ RL2_PIXEL_DATAGRID, 1, buf_out,
+ out_sz, NULL, mask, mask_sz, nd);
+ buf_out = NULL;
+ mask = NULL;
+ if (raster_out == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to create a Pyramid Tile\n");
+ goto error;
+ }
+ if (rl2_raster_encode
+ (raster_out, RL2_COMPRESSION_DEFLATE, &blob_odd, &blob_odd_sz,
+ &blob_even, &blob_even_sz, 100, 1) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to encode a Pyramid tile\n");
+ goto error;
+ }
+ rl2_destroy_raster (raster_out);
+ raster_out = NULL;
+
+ /* INSERTing the tile */
+ if (!do_insert_pyramid_tile
+ (handle, blob_odd, blob_odd_sz, blob_even, blob_even_sz, id_level,
+ pyr->section_id, pyr->srid, tile_out->minx, tile_out->miny,
+ tile_out->maxx, tile_out->maxy, stmt_tils, stmt_data))
+ goto error;
+
+ tile_out = tile_out->next;
+ }
+
+ return 1;
+
+ error:
+ if (raster_in != NULL)
+ rl2_destroy_raster (raster_in);
+ if (raster_out != NULL)
+ rl2_destroy_raster (raster_out);
+ if (buf_out != NULL)
+ free (buf_out);
+ if (mask != NULL)
+ free (mask);
+ return 0;
+}
+
+static double
+rescale_mb_pixel_uint8 (const unsigned char *buf_in, unsigned int tileWidth,
+ unsigned int tileHeight, unsigned int x, unsigned int y,
+ unsigned char nd, unsigned char nb,
+ unsigned char num_bands)
+{
+/* rescaling a MultiBand pixel sample (8x8) - UINT8 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+
+ for (row = 0; row < 8; row++)
+ {
+ const unsigned char *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth * num_bands);
+ for (col = 0; col < 8; col++)
+ {
+ const unsigned char *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + (xx * num_bands) + nb;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return nd;
+ return (unsigned char) (sum / (double) valid);
+}
+
+static void
+rescale_multiband_uint8 (unsigned char *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight, const unsigned char *buf_in,
+ unsigned int x, unsigned int y, unsigned int tic_x,
+ unsigned int tic_y, unsigned char num_bands,
+ rl2PixelPtr no_data)
+{
+/* rescaling a MultiBand tile - unsigned int 8 bit */
+ unsigned int row;
+ unsigned int col;
+ unsigned char nb;
+ unsigned char nd = 0;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) no_data;
+
+ for (row = 0; row < tic_y; row++)
+ {
+ unsigned int yy = row + y;
+ unsigned char *p_out_base = buf_out + (yy * tileWidth * num_bands);
+ if (yy >= tileHeight)
+ break;
+ for (col = 0; col < tic_x; col++)
+ {
+ unsigned int xx = col + x;
+ unsigned char *p_out = p_out_base + (xx * num_bands);
+ if (xx >= tileWidth)
+ break;
+ for (nb = 0; nb < num_bands; nb++)
+ {
+ if (pxl != NULL)
+ {
+ if (pxl->sampleType == RL2_SAMPLE_UINT8
+ && pxl->nBands == num_bands)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + nb;
+ nd = sample->uint8;
+ }
+ }
+ *(p_out + nb) =
+ rescale_mb_pixel_uint8 (buf_in, tileWidth, tileHeight,
+ col * 8, row * 8, nd, nb,
+ num_bands);
+ }
+ }
+ }
+}
+
+static double
+rescale_mb_pixel_uint16 (const unsigned short *buf_in, unsigned int tileWidth,
+ unsigned int tileHeight, unsigned int x,
+ unsigned int y, unsigned short nd, unsigned char nb,
+ unsigned char num_bands)
+{
+/* rescaling a MultiBand pixel sample (8x8) - UINT16 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+
+ for (row = 0; row < 8; row++)
+ {
+ const unsigned short *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth * num_bands);
+ for (col = 0; col < 8; col++)
+ {
+ const unsigned short *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + (xx * num_bands) + nb;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return nd;
+ return (unsigned short) (sum / (double) valid);
+}
+
+static void
+rescale_multiband_uint16 (unsigned short *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight,
+ const unsigned short *buf_in, unsigned int x,
+ unsigned int y, unsigned int tic_x,
+ unsigned int tic_y, unsigned char num_bands,
+ rl2PixelPtr no_data)
+{
+/* rescaling a MultiBand tile - unsigned int 16 bit */
+ unsigned int row;
+ unsigned int col;
+ unsigned char nb;
+ unsigned short nd = 0;
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) no_data;
+
+ for (row = 0; row < tic_y; row++)
+ {
+ unsigned int yy = row + y;
+ unsigned short *p_out_base = buf_out + (yy * tileWidth * num_bands);
+ if (yy >= tileHeight)
+ break;
+ for (col = 0; col < tic_x; col++)
+ {
+ unsigned int xx = col + x;
+ unsigned short *p_out = p_out_base + (xx * num_bands);
+ if (xx >= tileWidth)
+ break;
+ for (nb = 0; nb < num_bands; nb++)
+ {
+ if (pxl != NULL)
+ {
+ if (pxl->sampleType == RL2_SAMPLE_UINT16
+ && pxl->nBands == num_bands)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples + nb;
+ nd = sample->uint16;
+ }
+ }
+ *(p_out + nb) =
+ rescale_mb_pixel_uint16 (buf_in, tileWidth,
+ tileHeight, col * 8, row * 8,
+ nd, nb, num_bands);
+ }
+ }
+ }
+}
+
+static void
+rescale_multiband (void *buf_out, unsigned int tileWidth,
+ unsigned int tileHeight, const void *buf_in,
+ unsigned char sample_type, unsigned char num_bands,
+ unsigned int x, unsigned int y, unsigned int tic_x,
+ unsigned int tic_y, rl2PixelPtr no_data)
+{
+/* rescaling a Multiband tile */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ rescale_multiband_uint8 ((unsigned char *) buf_out, tileWidth,
+ tileHeight, (const unsigned char *) buf_in,
+ x, y, tic_x, tic_y, num_bands, no_data);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rescale_multiband_uint16 ((unsigned short *) buf_out, tileWidth,
+ tileHeight, (const unsigned short *) buf_in,
+ x, y, tic_x, tic_y, num_bands, no_data);
+ break;
+ };
+}
+
+static int
+update_sect_pyramid_multiband (sqlite3 * handle, sqlite3_stmt * stmt_rd,
+ sqlite3_stmt * stmt_tils,
+ sqlite3_stmt * stmt_data, SectionPyramid * pyr,
+ unsigned int tileWidth,
+ unsigned int tileHeight, int id_level,
+ rl2PixelPtr no_data, unsigned char sample_type,
+ unsigned char num_bands)
+{
+/* creating and inserting Pyramid tiles */
+ unsigned char *buf_out = NULL;
+ unsigned char *mask = NULL;
+ SectionPyramidTileOutPtr tile_out;
+ SectionPyramidTileRefPtr tile_in;
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ unsigned int col;
+ unsigned int tic_x;
+ unsigned int tic_y;
+ double pos_y;
+ double pos_x;
+ double geo_x;
+ double geo_y;
+ rl2PixelPtr nd = NULL;
+ rl2RasterPtr raster_out = NULL;
+ rl2RasterPtr raster_in = NULL;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ int pixel_sz = 1;
+ int out_sz;
+ int mask_sz = 0;
+
+ if (pyr == NULL)
+ goto error;
+ tic_x = tileWidth / pyr->scale;
+ tic_y = tileHeight / pyr->scale;
+ geo_x = (double) tic_x *pyr->res_x;
+ geo_y = (double) tic_y *pyr->res_y;
+
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT16:
+ pixel_sz = 2;
+ break;
+ };
+ out_sz = tileWidth * tileHeight * pixel_sz * num_bands;
+
+ tile_out = pyr->first_out;
+ while (tile_out != NULL)
+ {
+ rl2PrivRasterPtr rst;
+ /* allocating the output buffer */
+ buf_out = malloc (out_sz);
+ if (buf_out == NULL)
+ goto error;
+ rl2_prime_void_tile (buf_out, tileWidth, tileHeight, sample_type,
+ num_bands, no_data);
+
+ if (tile_out->col + tileWidth > pyr->scaled_width
+ || tile_out->row + tileHeight > pyr->scaled_height)
+ {
+ /* allocating and initializing a transparency mask */
+ unsigned char *p;
+ mask_sz = tileWidth * tileHeight;
+ mask = malloc (mask_sz);
+ if (mask == NULL)
+ goto error;
+ p = mask;
+ for (row = 0; row < tileHeight; row++)
+ {
+ unsigned int x_row = tile_out->row + row;
+ for (col = 0; col < tileWidth; col++)
+ {
+ unsigned int x_col = tile_out->col + col;
+ if (x_row >= pyr->scaled_height
+ || x_col >= pyr->scaled_width)
+ {
+ /* masking any portion of the tile exceeding the scaled section size */
+ *p++ = 0;
+ }
+ else
+ *p++ = 1;
+ }
+ }
+ }
+ else
+ {
+ mask = NULL;
+ mask_sz = 0;
+ }
+
+ /* creating the output (rescaled) tile */
+ tile_in = tile_out->first;
+ while (tile_in != NULL)
+ {
+ /* loading and rescaling the base tiles */
+ raster_in =
+ load_tile_base_generic (stmt_rd, tile_in->child->tile_id);
+ if (raster_in == NULL)
+ goto error;
+ pos_y = tile_out->maxy;
+ x = 0;
+ y = 0;
+ for (row = 0; row < tileHeight; row += tic_y)
+ {
+ pos_x = tile_out->minx;
+ for (col = 0; col < tileWidth; col += tic_x)
+ {
+ if (tile_in->child->cy < pos_y
+ && tile_in->child->cy > (pos_y - geo_y)
+ && tile_in->child->cx > pos_x
+ && tile_in->child->cx < (pos_x + geo_x))
+ {
+ x = col;
+ y = row;
+ break;
+ }
+ pos_x += geo_x;
+ }
+ pos_y -= geo_y;
+ }
+ rst = (rl2PrivRasterPtr) raster_in;
+ rescale_multiband (buf_out, tileWidth, tileHeight,
+ rst->rasterBuffer, sample_type, num_bands, x,
+ y, tic_x, tic_y, no_data);
+ rl2_destroy_raster (raster_in);
+ raster_in = NULL;
+ tile_in = tile_in->next;
+ }
+
+ raster_out = NULL;
+ raster_out =
+ rl2_create_raster (tileWidth, tileHeight, sample_type,
+ RL2_PIXEL_MULTIBAND, num_bands, buf_out,
+ out_sz, NULL, mask, mask_sz, nd);
+ buf_out = NULL;
+ mask = NULL;
+ if (raster_out == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to create a Pyramid Tile\n");
+ goto error;
+ }
+ if (rl2_raster_encode
+ (raster_out, RL2_COMPRESSION_DEFLATE, &blob_odd, &blob_odd_sz,
+ &blob_even, &blob_even_sz, 100, 1) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to encode a Pyramid tile\n");
+ goto error;
+ }
+ rl2_destroy_raster (raster_out);
+ raster_out = NULL;
+
+ /* INSERTing the tile */
+ if (!do_insert_pyramid_tile
+ (handle, blob_odd, blob_odd_sz, blob_even, blob_even_sz, id_level,
+ pyr->section_id, pyr->srid, tile_out->minx, tile_out->miny,
+ tile_out->maxx, tile_out->maxy, stmt_tils, stmt_data))
+ goto error;
+
+ tile_out = tile_out->next;
+ }
+
+ return 1;
+
+ error:
+ if (raster_in != NULL)
+ rl2_destroy_raster (raster_in);
+ if (raster_out != NULL)
+ rl2_destroy_raster (raster_out);
+ if (buf_out != NULL)
+ free (buf_out);
+ if (mask != NULL)
+ free (mask);
+ return 0;
+}
+
+static int
+update_sect_pyramid (sqlite3 * handle, sqlite3_stmt * stmt_rd,
+ sqlite3_stmt * stmt_tils, sqlite3_stmt * stmt_data,
+ SectionPyramid * pyr, unsigned int tileWidth,
+ unsigned int tileHeight, int id_level,
+ rl2PalettePtr palette, rl2PixelPtr no_data)
+{
+/* creating and inserting Pyramid tiles */
+ unsigned char *buf_in;
+ SectionPyramidTileOutPtr tile_out;
+ SectionPyramidTileRefPtr tile_in;
+ rl2GraphicsBitmapPtr base_tile;
+ rl2GraphicsContextPtr ctx = NULL;
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ unsigned int col;
+ unsigned int tic_x;
+ unsigned int tic_y;
+ double pos_y;
+ double pos_x;
+ double geo_x;
+ double geo_y;
+ unsigned char *rgb = NULL;
+ unsigned char *alpha = NULL;
+ rl2PixelPtr nd = NULL;
+ rl2RasterPtr raster = NULL;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *p;
+ unsigned char compression = RL2_COMPRESSION_NONE;
+
+ if (pyr == NULL)
+ goto error;
+ tic_x = tileWidth / pyr->scale;
+ tic_y = tileHeight / pyr->scale;
+ geo_x = (double) tic_x *pyr->res_x;
+ geo_y = (double) tic_y *pyr->res_y;
+
+ tile_out = pyr->first_out;
+ while (tile_out != NULL)
+ {
+ /* creating the output (rescaled) tile */
+ ctx = rl2_graph_create_context (tileWidth, tileHeight);
+ if (ctx == NULL)
+ goto error;
+ tile_in = tile_out->first;
+ while (tile_in != NULL)
+ {
+ /* loading and rescaling the base tiles */
+ buf_in =
+ load_tile_base (stmt_rd, tile_in->child->tile_id, palette,
+ no_data);
+ if (buf_in == NULL)
+ goto error;
+ base_tile =
+ rl2_graph_create_bitmap (buf_in, tileWidth, tileHeight);
+ if (base_tile == NULL)
+ {
+ free (buf_in);
+ goto error;
+ }
+ pos_y = tile_out->maxy;
+ x = 0;
+ y = 0;
+ for (row = 0; row < tileHeight; row += tic_y)
+ {
+ pos_x = tile_out->minx;
+ for (col = 0; col < tileWidth; col += tic_x)
+ {
+ if (tile_in->child->cy < pos_y
+ && tile_in->child->cy > (pos_y - geo_y)
+ && tile_in->child->cx > pos_x
+ && tile_in->child->cx < (pos_x + geo_x))
+ {
+ x = col;
+ y = row;
+ break;
+ }
+ pos_x += geo_x;
+ }
+ pos_y -= geo_y;
+ }
+ rl2_graph_draw_rescaled_bitmap (ctx, base_tile,
+ 1.0 / pyr->scale,
+ 1.0 / pyr->scale, x, y);
+ rl2_graph_destroy_bitmap (base_tile);
+ tile_in = tile_in->next;
+ }
+
+ rgb = rl2_graph_get_context_rgb_array (ctx);
+ if (rgb == NULL)
+ goto error;
+ alpha = rl2_graph_get_context_alpha_array (ctx);
+ if (alpha == NULL)
+ goto error;
+ p = alpha;
+ for (row = 0; row < tileHeight; row++)
+ {
+ unsigned int x_row = tile_out->row + row;
+ for (col = 0; col < tileWidth; col++)
+ {
+ unsigned int x_col = tile_out->col + col;
+ if (x_row >= pyr->scaled_height
+ || x_col >= pyr->scaled_width)
+ {
+ /* masking any portion of the tile exceeding the scaled section size */
+ *p++ = 0;
+ }
+ else
+ {
+ if (*p == 0)
+ p++;
+ else
+ *p++ = 1;
+ }
+ }
+ }
+
+ raster = NULL;
+ if (pyr->pixel_type == RL2_PIXEL_GRAYSCALE
+ || pyr->pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ /* Grayscale Pyramid */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *gray = malloc (tileWidth * tileHeight);
+ if (gray == NULL)
+ goto error;
+ p_in = rgb;
+ p_out = gray;
+ for (row = 0; row < tileHeight; row++)
+ {
+ for (col = 0; col < tileWidth; col++)
+ {
+ *p_out++ = *p_in++;
+ p_in += 2;
+ }
+ }
+ free (rgb);
+ if (pyr->pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ if (no_data == NULL)
+ nd = NULL;
+ else
+ {
+ /* converting the NO-DATA pixel */
+ rl2PrivPixelPtr pxl = (rl2PrivPixelPtr) no_data;
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd = rl2_create_pixel (RL2_SAMPLE_UINT8,
+ RL2_PIXEL_GRAYSCALE, 1);
+ if (sample->uint8 == 0)
+ rl2_set_pixel_sample_uint8 (nd,
+ RL2_GRAYSCALE_BAND,
+ 255);
+ else
+ rl2_set_pixel_sample_uint8 (nd,
+ RL2_GRAYSCALE_BAND,
+ 0);
+ }
+ compression = RL2_COMPRESSION_PNG;
+ }
+ else
+ {
+ nd = rl2_clone_pixel (no_data);
+ compression = RL2_COMPRESSION_JPEG;
+ }
+ raster =
+ rl2_create_raster (tileWidth, tileHeight, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_GRAYSCALE, 1, gray,
+ tileWidth * tileHeight, NULL, alpha,
+ tileWidth * tileHeight, nd);
+ }
+ else if (pyr->pixel_type == RL2_PIXEL_RGB)
+ {
+ /* RGB Pyramid */
+ nd = rl2_clone_pixel (no_data);
+ raster =
+ rl2_create_raster (tileWidth, tileHeight, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_RGB, 3, rgb,
+ tileWidth * tileHeight * 3, NULL, alpha,
+ tileWidth * tileHeight, nd);
+ compression = RL2_COMPRESSION_JPEG;
+ }
+ if (raster == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to create a Pyramid Tile\n");
+ goto error;
+ }
+ if (rl2_raster_encode
+ (raster, compression, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 80, 1) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to encode a Pyramid tile\n");
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ raster = NULL;
+ rl2_graph_destroy_context (ctx);
+ ctx = NULL;
+
+ /* INSERTing the tile */
+ if (!do_insert_pyramid_tile
+ (handle, blob_odd, blob_odd_sz, blob_even, blob_even_sz, id_level,
+ pyr->section_id, pyr->srid, tile_out->minx, tile_out->miny,
+ tile_out->maxx, tile_out->maxy, stmt_tils, stmt_data))
+ goto error;
+
+ tile_out = tile_out->next;
+ }
+
+ return 1;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (ctx != NULL)
+ rl2_graph_destroy_context (ctx);
+ return 0;
+}
+
+static int
+rescale_monolithic_rgba (int id_level,
+ unsigned int tileWidth, unsigned int tileHeight,
+ int factor, double res_x, double res_y, double minx,
+ double miny, double maxx, double maxy,
+ unsigned char *buffer, int buf_size,
+ unsigned char *mask, int *mask_size,
+ rl2PalettePtr palette, rl2PixelPtr no_data,
+ sqlite3_stmt * stmt_geo, sqlite3_stmt * stmt_data)
+{
+/* rescaling a monolithic RGBA tile */
+ rl2GraphicsContextPtr ctx = NULL;
+ rl2GraphicsBitmapPtr base_tile = NULL;
+ unsigned char *rgba = NULL;
+ unsigned int x;
+ unsigned int y;
+ int ret;
+ double shift_x;
+ double shift_y;
+ double scale_x;
+ double scale_y;
+ unsigned char *rgb = NULL;
+ unsigned char *alpha = NULL;
+ int valid_mask = 0;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+
+/* creating a graphics context */
+ ctx = rl2_graph_create_context (tileWidth, tileHeight);
+ if (ctx == NULL)
+ goto error;
+/* binding the BBOX to be queried */
+ sqlite3_reset (stmt_geo);
+ sqlite3_clear_bindings (stmt_geo);
+ sqlite3_bind_int (stmt_geo, 1, id_level);
+ sqlite3_bind_double (stmt_geo, 2, minx);
+ sqlite3_bind_double (stmt_geo, 3, miny);
+ sqlite3_bind_double (stmt_geo, 4, maxx);
+ sqlite3_bind_double (stmt_geo, 5, maxy);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt_geo);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ sqlite3_int64 tile_id = sqlite3_column_int64 (stmt_geo, 0);
+ double tile_x = sqlite3_column_double (stmt_geo, 1);
+ double tile_y = sqlite3_column_double (stmt_geo, 2);
+
+ rgba = load_tile_base (stmt_data, tile_id, palette, no_data);
+ if (rgba == NULL)
+ goto error;
+ base_tile =
+ rl2_graph_create_bitmap (rgba, tileWidth, tileHeight);
+ if (base_tile == NULL)
+ {
+ free (rgba);
+ goto error;
+ }
+ shift_x = tile_x - minx;
+ shift_y = maxy - tile_y;
+ scale_x = 1.0 / (double) factor;
+ scale_y = 1.0 / (double) factor;
+ x = (int) (shift_x / res_x);
+ y = (int) (shift_y / res_y);
+ rl2_graph_draw_rescaled_bitmap (ctx, base_tile,
+ scale_x, scale_y, x, y);
+ rl2_graph_destroy_bitmap (base_tile);
+ }
+ }
+
+ rgb = rl2_graph_get_context_rgb_array (ctx);
+ if (rgb == NULL)
+ goto error;
+ alpha = rl2_graph_get_context_alpha_array (ctx);
+ if (alpha == NULL)
+ goto error;
+ rl2_graph_destroy_context (ctx);
+ if (buf_size == (int) (tileWidth * tileHeight))
+ {
+ /* Grayscale */
+ p_in = rgb;
+ p_msk = alpha;
+ p_out = buffer;
+ for (y = 0; y < tileHeight; y++)
+ {
+ for (x = 0; x < tileWidth; x++)
+ {
+ if (*p_msk++ < 128)
+ {
+ /* skipping a transparent pixel */
+ p_in += 3;
+ p_out += 3;
+ }
+ else
+ {
+ /* copying an opaque pixel */
+ *p_out++ = *p_in++;
+ p_in += 2;
+ }
+ }
+ }
+ }
+ else
+ {
+ /* RGB */
+ p_in = rgb;
+ p_msk = alpha;
+ p_out = buffer;
+ for (y = 0; y < tileHeight; y++)
+ {
+ for (x = 0; x < tileWidth; x++)
+ {
+ if (*p_msk++ < 128)
+ {
+ /* skipping a transparent pixel */
+ p_in += 3;
+ p_out += 3;
+ }
+ else
+ {
+ /* copying an opaque pixel */
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ }
+ }
+ }
+ }
+ free (rgb);
+ p_in = alpha;
+ p_out = mask;
+ for (y = 0; y < tileHeight; y++)
+ {
+ for (x = 0; x < tileWidth; x++)
+ {
+ if (*p_in++ < 128)
+ {
+ *p_out++ = 0;
+ valid_mask = 1;
+ }
+ else
+ *p_out++ = 1;
+ }
+ }
+ free (alpha);
+ if (!valid_mask)
+ {
+ free (mask);
+ *mask_size = 0;
+ }
+
+ return 1;
+ error:
+ if (rgb != NULL)
+ free (rgb);
+ if (alpha != NULL)
+ free (alpha);
+ if (ctx != NULL)
+ rl2_graph_destroy_context (ctx);
+ return 0;
+}
+
+#define floor2(exp) ((long) exp)
+
+static rl2RasterPtr
+create_124_rescaled_raster (const unsigned char *rgba, unsigned char pixel_type,
+ unsigned int tileWidth, unsigned int tileHeight,
+ int scale)
+{
+/* creating a rescaled raster (1,2 or 4 bit pyramids)
+/
+/ this function builds an high quality rescaled sub-image by applying pixel interpolation
+/
+/ this code is widely inspired by the original GD gdImageCopyResampled() function
+*/
+ rl2RasterPtr raster;
+ unsigned int x;
+ unsigned int y;
+ double sy1;
+ double sy2;
+ double sx1;
+ double sx2;
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ unsigned char a;
+ unsigned char *rgb = NULL;
+ int rgb_sz;
+ unsigned char *mask = NULL;
+ int mask_sz;
+ unsigned char num_bands;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int out_width = tileWidth / scale;
+ unsigned int out_height = tileHeight / scale;
+
+ mask_sz = out_width * out_height;
+ if (pixel_type == RL2_PIXEL_RGB)
+ {
+ num_bands = 3;
+ rgb_sz = out_width * out_height * 3;
+ rgb = malloc (rgb_sz);
+ if (rgb == NULL)
+ return NULL;
+ mask = malloc (mask_sz);
+ if (mask == NULL)
+ {
+ free (rgb);
+ return NULL;
+ }
+ }
+ else
+ {
+ num_bands = 1;
+ rgb_sz = out_width * out_height;
+ rgb = malloc (rgb_sz);
+ if (rgb == NULL)
+ return NULL;
+ mask = malloc (mask_sz);
+ if (mask == NULL)
+ {
+ free (rgb);
+ return NULL;
+ }
+ }
+ memset (mask, 0, mask_sz);
+
+ for (y = 0; y < out_height; y++)
+ {
+ sy1 = ((double) y) * (double) tileHeight / (double) out_height;
+ sy2 = ((double) (y + 1)) * (double) tileHeight / (double) out_height;
+ for (x = 0; x < out_width; x++)
+ {
+ double sx;
+ double sy;
+ double spixels = 0;
+ double red = 0.0;
+ double green = 0.0;
+ double blue = 0.0;
+ double alpha = 0.0;
+ sx1 = ((double) x) * (double) tileWidth / (double) out_width;
+ sx2 =
+ ((double) (x + 1)) * (double) tileWidth /
+ (double) out_width;
+ sy = sy1;
+ do
+ {
+ double yportion;
+ if (floor2 (sy) == floor2 (sy1))
+ {
+ yportion = 1.0 - (sy - floor2 (sy));
+ if (yportion > sy2 - sy1)
+ {
+ yportion = sy2 - sy1;
+ }
+ sy = floor2 (sy);
+ }
+ else if (sy == floor2 (sy2))
+ {
+ yportion = sy2 - floor2 (sy2);
+ }
+ else
+ {
+ yportion = 1.0;
+ }
+ sx = sx1;
+ do
+ {
+ double xportion;
+ double pcontribution;
+ if (floor2 (sx) == floor2 (sx1))
+ {
+ xportion = 1.0 - (sx - floor2 (sx));
+ if (xportion > sx2 - sx1)
+ {
+ xportion = sx2 - sx1;
+ }
+ sx = floor2 (sx);
+ }
+ else if (sx == floor2 (sx2))
+ {
+ xportion = sx2 - floor2 (sx2);
+ }
+ else
+ {
+ xportion = 1.0;
+ }
+ pcontribution = xportion * yportion;
+ /* retrieving the origin pixel */
+ p_in = rgba + ((unsigned int) sy * tileWidth * 4);
+ p_in += (unsigned int) sx *4;
+ r = *p_in++;
+ g = *p_in++;
+ b = *p_in++;
+ a = *p_in++;
+
+ red += r * pcontribution;
+ green += g * pcontribution;
+ blue += b * pcontribution;
+ alpha += a * pcontribution;
+ spixels += xportion * yportion;
+ sx += 1.0;
+ }
+ while (sx < sx2);
+ sy += 1.0;
+ }
+ while (sy < sy2);
+ if (spixels != 0.0)
+ {
+ red /= spixels;
+ green /= spixels;
+ blue /= spixels;
+ }
+ if (red > 255.0)
+ red = 255.0;
+ if (green > 255.0)
+ green = 255.0;
+ if (blue > 255.0)
+ blue = 255.0;
+ if (alpha < 192.0)
+ {
+ /* skipping almost transparent pixels */
+ continue;
+ }
+ /* setting the destination pixel */
+ if (pixel_type == RL2_PIXEL_RGB)
+ p_out = rgb + (y * out_width * 3);
+ else
+ p_out = rgb + (y * out_width);
+ p_msk = mask + (y * out_width);
+ if (pixel_type == RL2_PIXEL_RGB)
+ {
+ p_out += x * 3;
+ *p_out++ = (unsigned char) red;
+ *p_out++ = (unsigned char) green;
+ *p_out = (unsigned char) blue;
+ p_msk += x;
+ *p_msk = 1;
+ }
+ else
+ {
+ if (red <= 224.0)
+ {
+ p_out += x;
+ *p_out = (unsigned char) red;
+ p_msk += x;
+ *p_msk = 1;
+ }
+ }
+ }
+ }
+
+ raster =
+ rl2_create_raster (out_width, out_height, RL2_SAMPLE_UINT8, pixel_type,
+ num_bands, rgb, rgb_sz, NULL, mask, mask_sz, NULL);
+ return raster;
+}
+
+static void
+copy_124_rescaled (rl2RasterPtr raster_out, rl2RasterPtr raster_in,
+ unsigned int base_x, unsigned int base_y)
+{
+/* copying pixels from rescaled to destination tile buffer */
+ rl2PrivRasterPtr rst_in = (rl2PrivRasterPtr) raster_in;
+ rl2PrivRasterPtr rst_out = (rl2PrivRasterPtr) raster_out;
+ unsigned int x;
+ unsigned int y;
+ int dx;
+ int dy;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk_in;
+ unsigned char *p_msk_out;
+
+ if (rst_in->sampleType == RL2_SAMPLE_UINT8
+ && rst_out->sampleType == RL2_SAMPLE_UINT8
+ && rst_in->pixelType == RL2_PIXEL_GRAYSCALE
+ && rst_out->pixelType == RL2_PIXEL_GRAYSCALE && rst_in->nBands == 1
+ && rst_out->nBands == 1 && rst_in->maskBuffer != NULL
+ && rst_out->maskBuffer != NULL)
+ {
+ /* Grayscale */
+ p_in = rst_in->rasterBuffer;
+ p_msk_in = rst_in->maskBuffer;
+ for (y = 0; y < rst_in->height; y++)
+ {
+ dy = base_y + y;
+ if (dy < 0 || dy >= (int) (rst_out->height))
+ {
+ p_in += rst_in->width;
+ p_msk_in += rst_in->width;
+ continue;
+ }
+ for (x = 0; x < rst_in->width; x++)
+ {
+ dx = base_x + x;
+ if (dx < 0 || dx >= (int) (rst_out->width))
+ {
+ p_in++;
+ p_msk_in++;
+ continue;
+ }
+ p_out =
+ rst_out->rasterBuffer + (dy * rst_out->width) + dx;
+ p_msk_out =
+ rst_out->maskBuffer + (dy * rst_out->width) + dx;
+ if (*p_msk_in++ == 0)
+ p_in++;
+ else
+ {
+ *p_out++ = *p_in++;
+ *p_msk_out++ = 1;
+ }
+ }
+ }
+ }
+ if (rst_in->sampleType == RL2_SAMPLE_UINT8
+ && rst_out->sampleType == RL2_SAMPLE_UINT8
+ && rst_in->pixelType == RL2_PIXEL_RGB
+ && rst_out->pixelType == RL2_PIXEL_RGB && rst_in->nBands == 3
+ && rst_out->nBands == 3 && rst_in->maskBuffer != NULL
+ && rst_out->maskBuffer != NULL)
+ {
+ /* RGB */
+ p_in = rst_in->rasterBuffer;
+ p_msk_in = rst_in->maskBuffer;
+ for (y = 0; y < rst_in->height; y++)
+ {
+ dy = base_y + y;
+ if (dy < 0 || dy >= (int) (rst_out->height))
+ {
+ p_in += rst_in->width * 3;
+ p_msk_in += rst_in->width;
+ continue;
+ }
+ for (x = 0; x < rst_in->width; x++)
+ {
+ dx = base_x + x;
+ if (dx < 0 || dx >= (int) (rst_out->width))
+ {
+ p_in += 3;
+ p_msk_in++;
+ continue;
+ }
+ p_out =
+ rst_out->rasterBuffer + (dy * rst_out->width * 3) +
+ (dx * 3);
+ p_msk_out =
+ rst_out->maskBuffer + (dy * rst_out->width) + dx;
+ if (*p_msk_in++ == 0)
+ p_in += 3;
+ else
+ {
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_msk_out++ = 1;
+ }
+ }
+ }
+ }
+}
+
+static int
+rescale_monolithic_124 (int id_level,
+ unsigned int tileWidth, unsigned int tileHeight,
+ int factor, unsigned char pixel_type, double res_x,
+ double res_y, double minx, double miny, double maxx,
+ double maxy, unsigned char *buffer, int buf_size,
+ unsigned char *mask, int *mask_size,
+ rl2PalettePtr palette, rl2PixelPtr no_data,
+ sqlite3_stmt * stmt_geo, sqlite3_stmt * stmt_data)
+{
+/* rescaling a monolithic 1,2 or 4 bit tile */
+ rl2RasterPtr raster = NULL;
+ rl2RasterPtr base_tile = NULL;
+ rl2PrivRasterPtr rst;
+ unsigned char *rgba = NULL;
+ unsigned int x;
+ unsigned int y;
+ int ret;
+ double shift_x;
+ double shift_y;
+ int valid_mask = 0;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char out_pixel_type;
+ unsigned char out_num_bands;
+ rl2PixelPtr nd = NULL;
+
+/* creating the output buffers */
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ out_pixel_type = RL2_PIXEL_GRAYSCALE;
+ out_num_bands = 1;
+ p_out = buffer;
+ for (y = 0; y < tileHeight; y++)
+ {
+ /* priming the background color */
+ for (x = 0; x < tileWidth; x++)
+ *p_out++ = 255;
+ }
+ nd = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1);
+ rl2_set_pixel_sample_uint8 (nd, RL2_GRAYSCALE_BAND, 255);
+ }
+ else
+ {
+ out_pixel_type = RL2_PIXEL_RGB;
+ out_num_bands = 3;
+ p_out = buffer;
+ for (y = 0; y < tileHeight; y++)
+ {
+ /* priming the background color */
+ for (x = 0; x < tileWidth; x++)
+ {
+ *p_out++ = 255;
+ *p_out++ = 255;
+ *p_out++ = 255;
+ }
+ }
+ nd = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3);
+ rl2_set_pixel_sample_uint8 (nd, RL2_RED_BAND, 255);
+ rl2_set_pixel_sample_uint8 (nd, RL2_GREEN_BAND, 255);
+ rl2_set_pixel_sample_uint8 (nd, RL2_BLUE_BAND, 255);
+ }
+ p_out = mask;
+ for (y = 0; y < tileHeight; y++)
+ {
+ /* priming full transparency */
+ for (x = 0; x < tileWidth; x++)
+ *p_out++ = 0;
+ }
+/* creating the output raster */
+ raster =
+ rl2_create_raster (tileWidth, tileHeight, RL2_SAMPLE_UINT8,
+ out_pixel_type, out_num_bands, buffer, buf_size,
+ NULL, mask, *mask_size, nd);
+ if (raster == NULL)
+ goto error;
+
+/* binding the BBOX to be queried */
+ sqlite3_reset (stmt_geo);
+ sqlite3_clear_bindings (stmt_geo);
+ sqlite3_bind_int (stmt_geo, 1, id_level);
+ sqlite3_bind_double (stmt_geo, 2, minx);
+ sqlite3_bind_double (stmt_geo, 3, miny);
+ sqlite3_bind_double (stmt_geo, 4, maxx);
+ sqlite3_bind_double (stmt_geo, 5, maxy);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt_geo);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ sqlite3_int64 tile_id = sqlite3_column_int64 (stmt_geo, 0);
+ double tile_x = sqlite3_column_double (stmt_geo, 1);
+ double tile_y = sqlite3_column_double (stmt_geo, 2);
+
+ rgba = load_tile_base (stmt_data, tile_id, palette, no_data);
+ if (rgba == NULL)
+ goto error;
+ base_tile =
+ create_124_rescaled_raster (rgba, out_pixel_type, tileWidth,
+ tileHeight, factor);
+ free (rgba);
+ if (base_tile == NULL)
+ goto error;
+ shift_x = tile_x - minx;
+ shift_y = maxy - tile_y;
+ x = (int) (shift_x / res_x);
+ y = (int) (shift_y / res_y);
+ copy_124_rescaled (raster, base_tile, x, y);
+ rl2_destroy_raster (base_tile);
+ }
+ }
+
+/* releasing buffers ownership */
+ rst = (rl2PrivRasterPtr) raster;
+ rst->rasterBuffer = NULL;
+ rst->maskBuffer = NULL;
+ rl2_destroy_raster (raster);
+
+ p_in = mask;
+ for (y = 0; y < tileHeight; y++)
+ {
+ for (x = 0; x < tileWidth; x++)
+ {
+ if (*p_in++ == 0)
+ valid_mask = 1;
+ }
+ }
+ if (!valid_mask)
+ {
+ free (mask);
+ *mask_size = 0;
+ }
+
+ return 1;
+ error:
+ if (raster != NULL)
+ {
+ /* releasing buffers ownership */
+ rst = (rl2PrivRasterPtr) raster;
+ rst->rasterBuffer = NULL;
+ rst->maskBuffer = NULL;
+ rl2_destroy_raster (raster);
+ }
+ return 0;
+}
+
+static void
+copy_multiband_rescaled (rl2RasterPtr raster_out, rl2RasterPtr raster_in,
+ unsigned int base_x, unsigned int base_y)
+{
+/* copying pixels from rescaled to destination tile buffer */
+ rl2PrivRasterPtr rst_in = (rl2PrivRasterPtr) raster_in;
+ rl2PrivRasterPtr rst_out = (rl2PrivRasterPtr) raster_out;
+ unsigned int x;
+ unsigned int y;
+ int dx;
+ int dy;
+ unsigned char *p_in_u8;
+ unsigned char *p_out_u8;
+ unsigned short *p_in_u16;
+ unsigned short *p_out_u16;
+ unsigned char *p_msk_in;
+ unsigned char *p_msk_out;
+ int mismatch = 0;
+ int ib;
+
+ if (rst_in->sampleType != rst_out->sampleType)
+ mismatch = 1;
+ if (rst_in->pixelType != RL2_PIXEL_MULTIBAND
+ || rst_out->pixelType != RL2_PIXEL_MULTIBAND)
+ mismatch = 1;
+ if (rst_in->nBands != rst_out->nBands)
+ mismatch = 1;
+ if (rst_in->maskBuffer == NULL || rst_out->maskBuffer == NULL)
+ mismatch = 1;
+ if (mismatch)
+ {
+ fprintf (stderr,
+ "ERROR: Copy MultiBand Rescaled mismatching in/out\n");
+ return;
+ }
+
+ switch (rst_in->sampleType)
+ {
+ case RL2_SAMPLE_UINT8:
+ p_in_u8 = (unsigned char *) (rst_in->rasterBuffer);
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_in_u16 = (unsigned short *) (rst_in->rasterBuffer);
+ break;
+ };
+ p_msk_in = rst_in->maskBuffer;
+ for (y = 0; y < rst_in->height; y++)
+ {
+ dy = base_y + y;
+ if (dy < 0 || dy >= (int) (rst_out->height))
+ {
+ switch (rst_in->sampleType)
+ {
+ case RL2_SAMPLE_UINT8:
+ p_in_u8 += rst_in->width * rst_in->nBands;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_in_u16 += rst_in->width * rst_in->nBands;
+ break;
+ };
+ p_msk_in += rst_in->width;
+ continue;
+ }
+ for (x = 0; x < rst_in->width; x++)
+ {
+ dx = base_x + x;
+ if (dx < 0 || dx >= (int) (rst_out->width))
+ {
+ switch (rst_in->sampleType)
+ {
+ case RL2_SAMPLE_UINT8:
+ p_in_u8 += rst_in->nBands;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_in_u16 += rst_in->nBands;
+ break;
+ };
+ p_msk_in++;
+ continue;
+ }
+ switch (rst_out->sampleType)
+ {
+ case RL2_SAMPLE_UINT8:
+ p_out_u8 = (unsigned char *) (rst_out->rasterBuffer);
+ p_out_u8 +=
+ (dy * rst_out->width * rst_out->nBands) +
+ (dx * rst_out->nBands);
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_out_u16 = (unsigned short *) (rst_out->rasterBuffer);
+ p_out_u16 +=
+ (dy * rst_out->width * rst_out->nBands) +
+ (dx * rst_out->nBands);
+ break;
+ };
+ p_msk_out = rst_out->maskBuffer + (dy * rst_out->width) + dx;
+ if (*p_msk_in++ == 0)
+ {
+ switch (rst_in->sampleType)
+ {
+ case RL2_SAMPLE_UINT8:
+ p_in_u8 += rst_out->nBands;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_in_u16 += rst_out->nBands;
+ break;
+ };
+ }
+ else
+ {
+ for (ib = 0; ib < rst_out->nBands; ib++)
+ {
+ switch (rst_out->sampleType)
+ {
+ case RL2_SAMPLE_UINT8:
+ *p_out_u8++ = *p_in_u8++;
+ break;
+ case RL2_SAMPLE_UINT16:
+ *p_out_u16++ = *p_in_u16++;
+ break;
+ };
+ }
+ *p_msk_out++ = 1;
+ }
+ }
+ }
+}
+
+static int
+is_mb_nodata_u8 (const unsigned char *pixel, unsigned char num_bands,
+ rl2PixelPtr no_data)
+{
+/* testing for NO-DATA pixel */
+ int is_valid = 0;
+ rl2PrivPixelPtr nd = (rl2PrivPixelPtr) no_data;
+ unsigned char ib;
+ const unsigned char *p_in = pixel;
+ if (nd != NULL)
+ {
+ if (nd->nBands == num_bands && nd->sampleType == RL2_SAMPLE_UINT8
+ && nd->pixelType == RL2_PIXEL_MULTIBAND)
+ is_valid = 1;
+ }
+ if (!is_valid)
+ return 0;
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ if (*p_in++ != (nd->Samples + ib)->uint8)
+ return 0;
+ }
+ return 1;
+}
+
+static void
+rescale_multiband_u8 (unsigned int tileWidth, unsigned int tileHeight,
+ unsigned char num_bands, unsigned int out_width,
+ unsigned int out_height, unsigned int factor,
+ unsigned char *buf_in, const unsigned char *mask_in,
+ unsigned char *buf_out, unsigned char *mask,
+ unsigned int x, unsigned int y, unsigned int ox,
+ unsigned int oy, rl2PixelPtr no_data)
+{
+/* rescaling a MultiBand (monolithic)- UINT8 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ unsigned char ib;
+ double *sum;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+
+ if (ox >= out_width || oy >= out_height)
+ return;
+ p_out = buf_out + (out_width * oy * num_bands) + (ox * num_bands);
+ p_msk = mask + (out_width * oy) + ox;
+ sum = malloc (sizeof (double) * num_bands);
+ for (ib = 0; ib < num_bands; ib++)
+ *(sum + ib) = 0.0;
+
+ for (row = 0; row < factor; row++)
+ {
+ const unsigned char *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth * num_bands);
+ for (col = 0; col < factor; col++)
+ {
+ const unsigned char *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + (xx * num_bands);
+ if (mask_in != NULL)
+ {
+ /* checking the transparency mask */
+ const unsigned char *p_msk_in =
+ mask_in + (yy * tileWidth) + xx;
+ if (*p_msk_in == 0)
+ {
+ nodata++;
+ continue;
+ }
+ }
+ if (is_mb_nodata_u8 (p_in, num_bands, no_data))
+ nodata++;
+ else
+ {
+ valid++;
+ for (ib = 0; ib < num_bands; ib++)
+ *(sum + ib) += *p_in++;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ {
+ free (sum);
+ return;
+ }
+ for (ib = 0; ib < num_bands; ib++)
+ *p_out++ = (unsigned char) (*(sum + ib) / (double) valid);
+ free (sum);
+ *p_msk = 1;
+}
+
+static int
+is_mb_nodata_u16 (const unsigned short *pixel, unsigned char num_bands,
+ rl2PixelPtr no_data)
+{
+/* testing for NO-DATA pixel */
+ int is_valid = 0;
+ rl2PrivPixelPtr nd = (rl2PrivPixelPtr) no_data;
+ unsigned char ib;
+ const unsigned short *p_in = pixel;
+ if (nd != NULL)
+ {
+ if (nd->nBands == num_bands && nd->sampleType == RL2_SAMPLE_UINT16
+ && nd->pixelType == RL2_PIXEL_MULTIBAND)
+ is_valid = 1;
+ }
+ if (!is_valid)
+ return 0;
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ if (*p_in++ != (nd->Samples + ib)->uint16)
+ return 0;
+ }
+ return 1;
+}
+
+static void
+rescale_multiband_u16 (unsigned int tileWidth, unsigned int tileHeight,
+ unsigned char num_bands, unsigned int out_width,
+ unsigned int out_height, unsigned int factor,
+ unsigned short *buf_in, const unsigned char *mask_in,
+ unsigned short *buf_out, unsigned char *mask,
+ unsigned int x, unsigned int y, unsigned int ox,
+ unsigned int oy, rl2PixelPtr no_data)
+{
+/* rescaling a MultiBand (monolithic)- UINT16 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ unsigned char ib;
+ double *sum;
+ unsigned short *p_out;
+ unsigned char *p_msk;
+
+ if (ox >= out_width || oy >= out_height)
+ return;
+ p_out = buf_out + (out_width * oy * num_bands) + (ox * num_bands);
+ p_msk = mask + (out_width * oy) + ox;
+ sum = malloc (sizeof (double) * num_bands);
+ for (ib = 0; ib < num_bands; ib++)
+ *(sum + ib) = 0.0;
+
+ for (row = 0; row < factor; row++)
+ {
+ const unsigned short *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth * num_bands);
+ for (col = 0; col < factor; col++)
+ {
+ const unsigned short *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ if (mask_in != NULL)
+ {
+ /* checking the transparency mask */
+ const unsigned char *p_msk_in =
+ mask_in + (yy * tileWidth) + xx;
+ if (*p_msk_in == 0)
+ {
+ nodata++;
+ continue;
+ }
+ }
+ p_in = p_in_base + (xx * num_bands);
+ if (is_mb_nodata_u16 (p_in, num_bands, no_data))
+ nodata++;
+ else
+ {
+ valid++;
+ for (ib = 0; ib < num_bands; ib++)
+ *(sum + ib) += *p_in++;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ {
+ free (sum);
+ return;
+ }
+ for (ib = 0; ib < num_bands; ib++)
+ *p_out++ = (unsigned char) (*(sum + ib) / (double) valid);
+ free (sum);
+ *p_msk = 1;
+}
+
+static void
+mb_prime_nodata_u8 (unsigned char *buf, unsigned int width, unsigned int height,
+ unsigned char num_bands, rl2PixelPtr no_data)
+{
+/* priming a void buffer */
+ rl2PrivPixelPtr nd = (rl2PrivPixelPtr) no_data;
+ unsigned int x;
+ unsigned int y;
+ unsigned char ib;
+ unsigned char *p = buf;
+ int is_valid = 0;
+
+ if (nd != NULL)
+ {
+ if (nd->nBands == num_bands && nd->sampleType == RL2_SAMPLE_UINT8
+ && nd->pixelType == RL2_PIXEL_MULTIBAND)
+ is_valid = 1;
+ }
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ if (is_valid)
+ *p++ = (nd->Samples + ib)->uint8;
+ else
+ *p++ = 0;
+ }
+ }
+ }
+}
+
+static void
+mb_prime_nodata_u16 (unsigned short *buf, unsigned int width,
+ unsigned int height, unsigned char num_bands,
+ rl2PixelPtr no_data)
+{
+/* priming a void buffer */
+ rl2PrivPixelPtr nd = (rl2PrivPixelPtr) no_data;
+ unsigned int x;
+ unsigned int y;
+ unsigned char ib;
+ unsigned short *p = buf;
+ int is_valid = 0;
+
+ if (nd != NULL)
+ {
+ if (nd->nBands == num_bands && nd->sampleType == RL2_SAMPLE_UINT16
+ && nd->pixelType == RL2_PIXEL_MULTIBAND)
+ is_valid = 1;
+ }
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ for (ib = 0; ib < num_bands; ib++)
+ {
+ if (is_valid)
+ *p++ = (nd->Samples + ib)->uint16;
+ else
+ *p++ = 0;
+ }
+ }
+ }
+}
+
+static rl2RasterPtr
+create_rescaled_multiband_raster (unsigned int factor, unsigned int tileWidth,
+ unsigned int tileHeight, const void *buf_in,
+ const unsigned char *mask_in,
+ unsigned char sample_type,
+ unsigned char num_bands, rl2PixelPtr no_data)
+{
+/* rescaling a Multiband tile */
+ unsigned int x;
+ unsigned int y;
+ unsigned int ox;
+ unsigned int oy;
+ rl2RasterPtr raster = NULL;
+ unsigned char *mask;
+ void *buf;
+ unsigned int mask_sz;
+ unsigned char pix_sz = 1;
+ unsigned int buf_sz;
+ unsigned int out_width = tileWidth / factor;
+ unsigned int out_height = tileHeight / factor;
+
+ mask_sz = out_width * out_height;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pix_sz = 2;
+ break;
+ };
+ buf_sz = out_width * out_height * pix_sz * num_bands;
+ buf = malloc (buf_sz);
+ if (buf == NULL)
+ return NULL;
+ mask = malloc (mask_sz);
+ if (mask == NULL)
+ {
+ free (buf);
+ return NULL;
+ }
+ memset (mask, 0, mask_sz);
+ if (sample_type == RL2_SAMPLE_UINT16)
+ mb_prime_nodata_u16 (buf, out_width, out_height, num_bands, no_data);
+ else
+ mb_prime_nodata_u8 (buf, out_width, out_height, num_bands, no_data);
+
+ oy = 0;
+ for (y = 0; y < tileHeight; y += factor)
+ {
+ ox = 0;
+ for (x = 0; x < tileWidth; x += factor)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ rescale_multiband_u8 (tileWidth, tileHeight, num_bands,
+ out_width, out_height, factor,
+ (unsigned char *) buf_in, mask_in,
+ (unsigned char *) buf, mask, x, y,
+ ox, oy, no_data);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rescale_multiband_u16 (tileWidth, tileHeight, num_bands,
+ out_width, out_height, factor,
+ (unsigned short *) buf_in, mask_in,
+ (unsigned short *) buf, mask, x, y,
+ ox, oy, no_data);
+ break;
+ };
+ ox++;
+ }
+ oy++;
+ }
+
+ raster =
+ rl2_create_raster (out_width, out_height, sample_type,
+ RL2_PIXEL_MULTIBAND, num_bands, buf, buf_sz, NULL,
+ mask, mask_sz, NULL);
+ return raster;
+}
+
+static void
+copy_datagrid_rescaled (rl2RasterPtr raster_out, rl2RasterPtr raster_in,
+ unsigned int base_x, unsigned int base_y)
+{
+/* copying pixels from rescaled to destination tile buffer */
+ rl2PrivRasterPtr rst_in = (rl2PrivRasterPtr) raster_in;
+ rl2PrivRasterPtr rst_out = (rl2PrivRasterPtr) raster_out;
+ unsigned int x;
+ unsigned int y;
+ int dx;
+ int dy;
+ char *p_in_8;
+ char *p_out_8;
+ unsigned char *p_in_u8;
+ unsigned char *p_out_u8;
+ short *p_in_16;
+ short *p_out_16;
+ unsigned short *p_in_u16;
+ unsigned short *p_out_u16;
+ int *p_in_32;
+ int *p_out_32;
+ unsigned int *p_in_u32;
+ unsigned int *p_out_u32;
+ float *p_in_flt;
+ float *p_out_flt;
+ double *p_in_dbl;
+ double *p_out_dbl;
+ unsigned char *p_msk_in;
+ unsigned char *p_msk_out;
+ int mismatch = 0;
+
+ if (rst_in->sampleType != rst_out->sampleType)
+ mismatch = 1;
+ if (rst_in->pixelType != RL2_PIXEL_DATAGRID
+ || rst_out->pixelType != RL2_PIXEL_DATAGRID)
+ mismatch = 1;
+ if (rst_in->nBands != 1 || rst_out->nBands != 1)
+ mismatch = 1;
+ if (rst_in->maskBuffer == NULL || rst_out->maskBuffer == NULL)
+ mismatch = 1;
+ if (mismatch)
+ {
+ fprintf (stderr,
+ "ERROR: Copy DataGrid Rescaled mismatching in/out\n");
+ return;
+ }
+
+ switch (rst_in->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ p_in_8 = (char *) (rst_in->rasterBuffer);
+ break;
+ case RL2_SAMPLE_UINT8:
+ p_in_u8 = (unsigned char *) (rst_in->rasterBuffer);
+ break;
+ case RL2_SAMPLE_INT16:
+ p_in_16 = (short *) (rst_in->rasterBuffer);
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_in_u16 = (unsigned short *) (rst_in->rasterBuffer);
+ break;
+ case RL2_SAMPLE_INT32:
+ p_in_32 = (int *) (rst_in->rasterBuffer);
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_in_u32 = (unsigned int *) (rst_in->rasterBuffer);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_in_flt = (float *) (rst_in->rasterBuffer);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_in_dbl = (double *) (rst_in->rasterBuffer);
+ break;
+ };
+ p_msk_in = rst_in->maskBuffer;
+ for (y = 0; y < rst_in->height; y++)
+ {
+ dy = base_y + y;
+ if (dy < 0 || dy >= (int) (rst_out->height))
+ {
+ switch (rst_in->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ p_in_8 += rst_in->width;
+ break;
+ case RL2_SAMPLE_UINT8:
+ p_in_u8 += rst_in->width;
+ break;
+ case RL2_SAMPLE_INT16:
+ p_in_16 += rst_in->width;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_in_u16 += rst_in->width;
+ break;
+ case RL2_SAMPLE_INT32:
+ p_in_32 += rst_in->width;
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_in_u32 += rst_in->width;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_in_flt += rst_in->width;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_in_dbl += rst_in->width;
+ break;
+ };
+ p_msk_in += rst_in->width;
+ continue;
+ }
+ for (x = 0; x < rst_in->width; x++)
+ {
+ dx = base_x + x;
+ if (dx < 0 || dx >= (int) (rst_out->width))
+ {
+ switch (rst_in->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ p_in_8++;
+ break;
+ case RL2_SAMPLE_UINT8:
+ p_in_u8++;
+ break;
+ case RL2_SAMPLE_INT16:
+ p_in_16++;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_in_u16++;
+ break;
+ case RL2_SAMPLE_INT32:
+ p_in_32++;
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_in_u32++;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_in_flt++;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_in_dbl++;
+ break;
+ };
+ p_msk_in++;
+ continue;
+ }
+ switch (rst_out->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ p_out_8 = (char *) (rst_out->rasterBuffer);
+ p_out_8 += (dy * rst_out->width) + dx;
+ break;
+ case RL2_SAMPLE_UINT8:
+ p_out_u8 = (unsigned char *) (rst_out->rasterBuffer);
+ p_out_u8 += (dy * rst_out->width) + dx;
+ break;
+ case RL2_SAMPLE_INT16:
+ p_out_16 = (short *) (rst_out->rasterBuffer);
+ p_out_16 += (dy * rst_out->width) + dx;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_out_u16 = (unsigned short *) (rst_out->rasterBuffer);
+ p_out_u16 += (dy * rst_out->width) + dx;
+ break;
+ case RL2_SAMPLE_INT32:
+ p_out_32 = (int *) (rst_out->rasterBuffer);
+ p_out_32 += (dy * rst_out->width) + dx;
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_out_u32 = (unsigned int *) (rst_out->rasterBuffer);
+ p_out_u32 += (dy * rst_out->width) + dx;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_out_flt = (float *) (rst_out->rasterBuffer);
+ p_out_flt += (dy * rst_out->width) + dx;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_out_dbl = (double *) (rst_out->rasterBuffer);
+ p_out_dbl += (dy * rst_out->width) + dx;
+ break;
+ };
+ p_msk_out = rst_out->maskBuffer + (dy * rst_out->width) + dx;
+ if (*p_msk_in++ == 0)
+ {
+ switch (rst_in->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ p_in_8++;
+ break;
+ case RL2_SAMPLE_UINT8:
+ p_in_u8++;
+ break;
+ case RL2_SAMPLE_INT16:
+ p_in_16++;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_in_u16++;
+ break;
+ case RL2_SAMPLE_INT32:
+ p_in_32++;
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_in_u32++;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_in_flt++;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_in_dbl++;
+ break;
+ };
+ }
+ else
+ {
+ switch (rst_out->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ *p_out_8++ = *p_in_8++;
+ break;
+ case RL2_SAMPLE_UINT8:
+ *p_out_u8 = *p_in_u8++;
+ break;
+ case RL2_SAMPLE_INT16:
+ *p_out_16 = *p_in_16++;
+ break;
+ case RL2_SAMPLE_UINT16:
+ *p_out_u16 = *p_in_u16++;
+ break;
+ case RL2_SAMPLE_INT32:
+ *p_out_32 = *p_in_32++;
+ break;
+ case RL2_SAMPLE_UINT32:
+ *p_out_u32 = *p_in_u32++;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ *p_out_flt = *p_in_flt++;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ *p_out_dbl = *p_in_dbl++;
+ break;
+ };
+ *p_msk_out++ = 1;
+ }
+ }
+ }
+}
+
+static void
+rescale_datagrid_8 (unsigned int tileWidth, unsigned int tileHeight,
+ unsigned int out_width, unsigned int out_height,
+ unsigned int factor, char *buf_in, char *buf_out,
+ unsigned char *mask, unsigned int x, unsigned int y,
+ unsigned int ox, unsigned int oy, char nd)
+{
+/* rescaling a DataGrid (monolithic)- INT8 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+ char *p_out;
+ unsigned char *p_msk;
+
+ if (ox >= out_width || oy >= out_height)
+ return;
+ p_out = buf_out + (out_width * oy) + ox;
+ p_msk = mask + (out_width * oy) + ox;
+
+ for (row = 0; row < factor; row++)
+ {
+ const char *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < factor; col++)
+ {
+ const char *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + xx;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return;
+ *p_out = (char) (sum / (double) valid);
+ *p_msk = 1;
+}
+
+static void
+rescale_datagrid_u8 (unsigned int tileWidth, unsigned int tileHeight,
+ unsigned int out_width, unsigned int out_height,
+ unsigned int factor, unsigned char *buf_in,
+ unsigned char *buf_out, unsigned char *mask,
+ unsigned int x, unsigned int y, unsigned int ox,
+ unsigned int oy, unsigned char nd)
+{
+/* rescaling a DataGrid (monolithic)- UINT8 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+
+ if (ox >= out_width || oy >= out_height)
+ return;
+ p_out = buf_out + (out_width * oy) + ox;
+ p_msk = mask + (out_width * oy) + ox;
+
+ for (row = 0; row < factor; row++)
+ {
+ const unsigned char *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < factor; col++)
+ {
+ const unsigned char *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + xx;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return;
+ *p_out = (unsigned char) (sum / (double) valid);
+ *p_msk = 1;
+}
+
+static void
+rescale_datagrid_16 (unsigned int tileWidth, unsigned int tileHeight,
+ unsigned int out_width, unsigned int out_height,
+ unsigned int factor, short *buf_in, short *buf_out,
+ unsigned char *mask, unsigned int x, unsigned int y,
+ unsigned int ox, unsigned int oy, short nd)
+{
+/* rescaling a DataGrid (monolithic)- INT16 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+ short *p_out;
+ unsigned char *p_msk;
+
+ if (ox >= out_width || oy >= out_height)
+ return;
+ p_out = buf_out + (out_width * oy) + ox;
+ p_msk = mask + (out_width * oy) + ox;
+
+ for (row = 0; row < factor; row++)
+ {
+ const short *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < factor; col++)
+ {
+ const short *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + xx;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return;
+ *p_out = (short) (sum / (double) valid);
+ *p_msk = 1;
+}
+
+static void
+rescale_datagrid_u16 (unsigned int tileWidth, unsigned int tileHeight,
+ unsigned int out_width, unsigned int out_height,
+ unsigned int factor, unsigned short *buf_in,
+ unsigned short *buf_out, unsigned char *mask,
+ unsigned int x, unsigned int y, unsigned int ox,
+ unsigned int oy, unsigned short nd)
+{
+/* rescaling a DataGrid (monolithic)- UINT16 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+ unsigned short *p_out;
+ unsigned char *p_msk;
+
+ if (ox >= out_width || oy >= out_height)
+ return;
+ p_out = buf_out + (out_width * oy) + ox;
+ p_msk = mask + (out_width * oy) + ox;
+
+ for (row = 0; row < factor; row++)
+ {
+ const unsigned short *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < factor; col++)
+ {
+ const unsigned short *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + xx;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return;
+ *p_out = (unsigned short) (sum / (double) valid);
+ *p_msk = 1;
+}
+
+static void
+rescale_datagrid_32 (unsigned int tileWidth, unsigned int tileHeight,
+ unsigned int out_width, unsigned int out_height,
+ unsigned int factor, int *buf_in, int *buf_out,
+ unsigned char *mask, unsigned int x, unsigned int y,
+ unsigned int ox, unsigned int oy, int nd)
+{
+/* rescaling a DataGrid (monolithic)- INT32 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+ int *p_out;
+ unsigned char *p_msk;
+
+ if (ox >= out_width || oy >= out_height)
+ return;
+ p_out = buf_out + (out_width * oy) + ox;
+ p_msk = mask + (out_width * oy) + ox;
+
+ for (row = 0; row < factor; row++)
+ {
+ const int *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < factor; col++)
+ {
+ const int *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + xx;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return;
+ *p_out = (int) (sum / (double) valid);
+ *p_msk = 1;
+}
+
+static void
+rescale_datagrid_u32 (unsigned int tileWidth, unsigned int tileHeight,
+ unsigned int out_width, unsigned int out_height,
+ unsigned int factor, unsigned int *buf_in,
+ unsigned int *buf_out, unsigned char *mask,
+ unsigned int x, unsigned int y, unsigned int ox,
+ unsigned int oy, unsigned int nd)
+{
+/* rescaling a DataGrid (monolithic)- UINT32 */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+ unsigned int *p_out;
+ unsigned char *p_msk;
+
+ if (ox >= out_width || oy >= out_height)
+ return;
+ p_out = buf_out + (out_width * oy) + ox;
+ p_msk = mask + (out_width * oy) + ox;
+
+ for (row = 0; row < factor; row++)
+ {
+ const unsigned int *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < factor; col++)
+ {
+ const unsigned int *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + xx;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return;
+ *p_out = (unsigned int) (sum / (double) valid);
+ *p_msk = 1;
+}
+
+static void
+rescale_datagrid_flt (unsigned int tileWidth, unsigned int tileHeight,
+ unsigned int out_width, unsigned int out_height,
+ unsigned int factor, float *buf_in, float *buf_out,
+ unsigned char *mask, unsigned int x, unsigned int y,
+ unsigned int ox, unsigned int oy, float nd)
+{
+/* rescaling a DataGrid (monolithic)- FLOAT */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+ float *p_out;
+ unsigned char *p_msk;
+
+ if (ox >= out_width || oy >= out_height)
+ return;
+ p_out = buf_out + (out_width * oy) + ox;
+ p_msk = mask + (out_width * oy) + ox;
+
+ for (row = 0; row < factor; row++)
+ {
+ const float *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < factor; col++)
+ {
+ const float *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + xx;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return;
+ *p_out = (float) (sum / (double) valid);
+ *p_msk = 1;
+}
+
+static void
+rescale_datagrid_dbl (unsigned int tileWidth, unsigned int tileHeight,
+ unsigned int out_width, unsigned int out_height,
+ unsigned int factor, double *buf_in, double *buf_out,
+ unsigned char *mask, unsigned int x, unsigned int y,
+ unsigned int ox, unsigned int oy, double nd)
+{
+/* rescaling a DataGrid (monolithic)- DOUBLE */
+ unsigned int row;
+ unsigned int col;
+ int nodata = 0;
+ int valid = 0;
+ double sum = 0.0;
+ double *p_out;
+ unsigned char *p_msk;
+
+ if (ox >= out_width || oy >= out_height)
+ return;
+ p_out = buf_out + (out_width * oy) + ox;
+ p_msk = mask + (out_width * oy) + ox;
+
+ for (row = 0; row < factor; row++)
+ {
+ const double *p_in_base;
+ unsigned int yy = y + row;
+ if (yy >= tileHeight)
+ break;
+ p_in_base = buf_in + (yy * tileWidth);
+ for (col = 0; col < factor; col++)
+ {
+ const double *p_in;
+ unsigned int xx = x + col;
+ if (xx >= tileWidth)
+ break;
+ p_in = p_in_base + xx;
+ if (*p_in == nd)
+ nodata++;
+ else
+ {
+ valid++;
+ sum += *p_in;
+ }
+ }
+ }
+
+ if (nodata >= valid)
+ return;
+ *p_out = (double) (sum / (double) valid);
+ *p_msk = 1;
+}
+
+static rl2RasterPtr
+create_rescaled_datagrid_raster (unsigned int factor, unsigned int tileWidth,
+ unsigned int tileHeight, const void *buf_in,
+ unsigned char sample_type, rl2PixelPtr no_data)
+{
+/* rescaling a Datagrid tile */
+ rl2PrivPixelPtr pxl;
+ unsigned int x;
+ unsigned int y;
+ unsigned int ox;
+ unsigned int oy;
+ rl2RasterPtr raster = NULL;
+ unsigned char *mask;
+ void *buf;
+ unsigned int mask_sz;
+ unsigned char pix_sz = 1;
+ unsigned int buf_sz;
+ unsigned int out_width = tileWidth / factor;
+ unsigned int out_height = tileHeight / factor;
+ char no_data_8 = 0;
+ unsigned char no_data_u8 = 0;
+ short no_data_16 = 0;
+ unsigned short no_data_u16 = 0;
+ int no_data_32 = 0;
+ unsigned int no_data_u32 = 0;
+ float no_data_flt = 0.0;
+ double no_data_dbl = 0.0;
+
+/* retrieving NO-DATA */
+ pxl = (rl2PrivPixelPtr) no_data;
+ if (pxl != NULL)
+ {
+ if (pxl->nBands == 1 && pxl->pixelType == RL2_PIXEL_DATAGRID
+ && pxl->sampleType == sample_type)
+ {
+ rl2PrivSamplePtr sample = pxl->Samples;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ no_data_8 = sample->int8;
+ break;
+ case RL2_SAMPLE_UINT8:
+ no_data_u8 = sample->uint8;
+ break;
+ case RL2_SAMPLE_INT16:
+ no_data_16 = sample->int16;
+ break;
+ case RL2_SAMPLE_UINT16:
+ no_data_u16 = sample->uint16;
+ break;
+ case RL2_SAMPLE_INT32:
+ no_data_32 = sample->int32;
+ break;
+ case RL2_SAMPLE_UINT32:
+ no_data_u32 = sample->uint32;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ no_data_flt = sample->float32;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ no_data_dbl = sample->float64;
+ break;
+ };
+ }
+ }
+/* computing sizes */
+ mask_sz = out_width * out_height;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pix_sz = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pix_sz = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pix_sz = 8;
+ break;
+ };
+ buf_sz = out_width * out_height * pix_sz;
+ buf = malloc (buf_sz);
+ if (buf == NULL)
+ return NULL;
+ mask = malloc (mask_sz);
+ if (mask == NULL)
+ {
+ free (buf);
+ return NULL;
+ }
+ rl2_prime_void_tile (buf, out_width, out_height, sample_type, 1, no_data);
+ memset (mask, 0, mask_sz);
+
+ oy = 0;
+ for (y = 0; y < tileHeight; y += factor)
+ {
+ ox = 0;
+ for (x = 0; x < tileWidth; x += factor)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ rescale_datagrid_8 (tileWidth, tileHeight, out_width,
+ out_height, factor, (char *) buf_in,
+ (char *) buf, mask, x, y, ox, oy,
+ no_data_8);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rescale_datagrid_u8 (tileWidth, tileHeight, out_width,
+ out_height, factor,
+ (unsigned char *) buf_in,
+ (unsigned char *) buf, mask, x, y,
+ ox, oy, no_data_u8);
+ break;
+ case RL2_SAMPLE_INT16:
+ rescale_datagrid_16 (tileWidth, tileHeight, out_width,
+ out_height, factor, (short *) buf_in,
+ (short *) buf, mask, x, y, ox, oy,
+ no_data_16);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rescale_datagrid_u16 (tileWidth, tileHeight, out_width,
+ out_height, factor,
+ (unsigned short *) buf_in,
+ (unsigned short *) buf, mask, x, y,
+ ox, oy, no_data_u16);
+ break;
+ case RL2_SAMPLE_INT32:
+ rescale_datagrid_32 (tileWidth, tileHeight, out_width,
+ out_height, factor, (int *) buf_in,
+ (int *) buf, mask, x, y, ox, oy,
+ no_data_32);
+ break;
+ case RL2_SAMPLE_UINT32:
+ rescale_datagrid_u32 (tileWidth, tileHeight, out_width,
+ out_height, factor,
+ (unsigned int *) buf_in,
+ (unsigned int *) buf, mask, x, y,
+ ox, oy, no_data_u32);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ rescale_datagrid_flt (tileWidth, tileHeight, out_width,
+ out_height, factor,
+ (float *) buf_in, (float *) buf,
+ mask, x, y, ox, oy, no_data_flt);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ rescale_datagrid_dbl (tileWidth, tileHeight, out_width,
+ out_height, factor,
+ (double *) buf_in, (double *) buf,
+ mask, x, y, ox, oy, no_data_dbl);
+ break;
+ };
+ ox++;
+ }
+ oy++;
+ }
+
+ raster =
+ rl2_create_raster (out_width, out_height, sample_type,
+ RL2_PIXEL_DATAGRID, 1, buf, buf_sz, NULL, mask,
+ mask_sz, NULL);
+ return raster;
+}
+
+static int
+rescale_monolithic_multiband (int id_level,
+ unsigned int tileWidth, unsigned int tileHeight,
+ unsigned char sample_type,
+ unsigned char num_bands, int factor, double res_x,
+ double res_y, double minx, double miny,
+ double maxx, double maxy, unsigned char *buffer,
+ int buf_size, unsigned char *mask, int *mask_size,
+ rl2PixelPtr no_data, sqlite3_stmt * stmt_geo,
+ sqlite3_stmt * stmt_data)
+{
+/* rescaling monolithic MultiBand */
+ rl2RasterPtr raster = NULL;
+ rl2RasterPtr base_tile = NULL;
+ rl2PrivRasterPtr rst;
+ unsigned int x;
+ unsigned int y;
+ int ret;
+ double shift_x;
+ double shift_y;
+ int valid_mask = 0;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ rl2PixelPtr nd = NULL;
+
+ nd = rl2_clone_pixel (no_data);
+ p_out = mask;
+ for (y = 0; y < tileHeight; y++)
+ {
+ /* priming full transparency */
+ for (x = 0; x < tileWidth; x++)
+ *p_out++ = 0;
+ }
+ rl2_prime_void_tile (buffer, tileWidth, tileHeight, sample_type, num_bands,
+ no_data);
+/* creating the output raster */
+ raster =
+ rl2_create_raster (tileWidth, tileHeight, sample_type,
+ RL2_PIXEL_MULTIBAND, num_bands, buffer, buf_size,
+ NULL, mask, *mask_size, nd);
+ if (raster == NULL)
+ goto error;
+
+/* binding the BBOX to be queried */
+ sqlite3_reset (stmt_geo);
+ sqlite3_clear_bindings (stmt_geo);
+ sqlite3_bind_int (stmt_geo, 1, id_level);
+ sqlite3_bind_double (stmt_geo, 2, minx);
+ sqlite3_bind_double (stmt_geo, 3, miny);
+ sqlite3_bind_double (stmt_geo, 4, maxx);
+ sqlite3_bind_double (stmt_geo, 5, maxy);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt_geo);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ rl2RasterPtr raster_in = NULL;
+ rl2PrivRasterPtr rst_in;
+ sqlite3_int64 tile_id = sqlite3_column_int64 (stmt_geo, 0);
+ double tile_x = sqlite3_column_double (stmt_geo, 1);
+ double tile_y = sqlite3_column_double (stmt_geo, 2);
+
+ raster_in = load_tile_base_generic (stmt_data, tile_id);
+ rst_in = (rl2PrivRasterPtr) raster_in;
+ base_tile =
+ create_rescaled_multiband_raster (factor, tileWidth,
+ tileHeight,
+ rst_in->rasterBuffer,
+ rst_in->maskBuffer,
+ sample_type, num_bands,
+ no_data);
+ rl2_destroy_raster (raster_in);
+ raster_in = NULL;
+
+ if (base_tile == NULL)
+ goto error;
+ shift_x = tile_x - minx;
+ shift_y = maxy - tile_y;
+ x = (int) (shift_x / res_x);
+ y = (int) (shift_y / res_y);
+ copy_multiband_rescaled (raster, base_tile, x, y);
+ rl2_destroy_raster (base_tile);
+ }
+ }
+
+/* releasing buffers ownership */
+ rst = (rl2PrivRasterPtr) raster;
+ rst->rasterBuffer = NULL;
+ rst->maskBuffer = NULL;
+ rl2_destroy_raster (raster);
+
+ p_in = mask;
+ for (y = 0; y < tileHeight; y++)
+ {
+ for (x = 0; x < tileWidth; x++)
+ {
+ if (*p_in++ == 0)
+ valid_mask = 1;
+ }
+ }
+ if (!valid_mask)
+ {
+ free (mask);
+ *mask_size = 0;
+ }
+
+ return 1;
+ error:
+ if (raster != NULL)
+ {
+ /* releasing buffers ownership */
+ rst = (rl2PrivRasterPtr) raster;
+ rst->rasterBuffer = NULL;
+ rst->maskBuffer = NULL;
+ rl2_destroy_raster (raster);
+ }
+ return 0;
+}
+
+static int
+rescale_monolithic_datagrid (int id_level,
+ unsigned int tileWidth, unsigned int tileHeight,
+ unsigned char sample_type, int factor,
+ double res_x, double res_y, double minx,
+ double miny, double maxx, double maxy,
+ unsigned char *buffer, int buf_size,
+ unsigned char *mask, int *mask_size,
+ rl2PixelPtr no_data, sqlite3_stmt * stmt_geo,
+ sqlite3_stmt * stmt_data)
+{
+/* rescaling monolithic DataGrid */
+ rl2RasterPtr raster = NULL;
+ rl2RasterPtr base_tile = NULL;
+ rl2PrivRasterPtr rst;
+ unsigned int x;
+ unsigned int y;
+ int ret;
+ double shift_x;
+ double shift_y;
+ int valid_mask = 0;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ rl2PixelPtr nd = NULL;
+
+ nd = rl2_clone_pixel (no_data);
+ p_out = mask;
+ for (y = 0; y < tileHeight; y++)
+ {
+ /* priming full transparency */
+ for (x = 0; x < tileWidth; x++)
+ *p_out++ = 0;
+ }
+ rl2_prime_void_tile (buffer, tileWidth, tileHeight, sample_type, 1,
+ no_data);
+/* creating the output raster */
+ raster =
+ rl2_create_raster (tileWidth, tileHeight, sample_type,
+ RL2_PIXEL_DATAGRID, 1, buffer, buf_size,
+ NULL, mask, *mask_size, nd);
+ if (raster == NULL)
+ goto error;
+
+/* binding the BBOX to be queried */
+ sqlite3_reset (stmt_geo);
+ sqlite3_clear_bindings (stmt_geo);
+ sqlite3_bind_int (stmt_geo, 1, id_level);
+ sqlite3_bind_double (stmt_geo, 2, minx);
+ sqlite3_bind_double (stmt_geo, 3, miny);
+ sqlite3_bind_double (stmt_geo, 4, maxx);
+ sqlite3_bind_double (stmt_geo, 5, maxy);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt_geo);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ rl2RasterPtr raster_in = NULL;
+ rl2PrivRasterPtr rst_in;
+ sqlite3_int64 tile_id = sqlite3_column_int64 (stmt_geo, 0);
+ double tile_x = sqlite3_column_double (stmt_geo, 1);
+ double tile_y = sqlite3_column_double (stmt_geo, 2);
+
+ raster_in = load_tile_base_generic (stmt_data, tile_id);
+ rst_in = (rl2PrivRasterPtr) raster_in;
+ base_tile =
+ create_rescaled_datagrid_raster (factor, tileWidth,
+ tileHeight,
+ rst_in->rasterBuffer,
+ sample_type, no_data);
+ rl2_destroy_raster (raster_in);
+ raster_in = NULL;
+
+ if (base_tile == NULL)
+ goto error;
+ shift_x = tile_x - minx;
+ shift_y = maxy - tile_y;
+ x = (int) (shift_x / res_x);
+ y = (int) (shift_y / res_y);
+ copy_datagrid_rescaled (raster, base_tile, x, y);
+ rl2_destroy_raster (base_tile);
+ }
+ }
+
+/* releasing buffers ownership */
+ rst = (rl2PrivRasterPtr) raster;
+ rst->rasterBuffer = NULL;
+ rst->maskBuffer = NULL;
+ rl2_destroy_raster (raster);
+
+ p_in = mask;
+ for (y = 0; y < tileHeight; y++)
+ {
+ for (x = 0; x < tileWidth; x++)
+ {
+ if (*p_in++ == 0)
+ valid_mask = 1;
+ }
+ }
+ if (!valid_mask)
+ {
+ free (mask);
+ *mask_size = 0;
+ }
+
+ return 1;
+ error:
+ if (raster != NULL)
+ {
+ /* releasing buffers ownership */
+ rst = (rl2PrivRasterPtr) raster;
+ rst->rasterBuffer = NULL;
+ rst->maskBuffer = NULL;
+ rl2_destroy_raster (raster);
+ }
+ return 0;
+}
+
+static int
+prepare_section_pyramid_stmts (sqlite3 * handle, const char *coverage,
+ sqlite3_stmt ** xstmt_rd,
+ sqlite3_stmt ** xstmt_levl,
+ sqlite3_stmt ** xstmt_tils,
+ sqlite3_stmt ** xstmt_data)
+{
+/* preparing the section pyramid related SQL statements */
+ char *table_tile_data;
+ char *xtable_tile_data;
+ char *table;
+ char *xtable;
+ char *sql;
+ sqlite3_stmt *stmt_rd = NULL;
+ sqlite3_stmt *stmt_levl = NULL;
+ sqlite3_stmt *stmt_tils = NULL;
+ sqlite3_stmt *stmt_data = NULL;
+ int ret;
+
+ *xstmt_rd = NULL;
+ *xstmt_levl = NULL;
+ *xstmt_tils = NULL;
+ *xstmt_data = NULL;
+
+ table_tile_data = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable_tile_data = gaiaDoubleQuotedSql (table_tile_data);
+ sqlite3_free (table_tile_data);
+ sql = sqlite3_mprintf ("SELECT tile_data_odd, tile_data_even "
+ "FROM \"%s\" WHERE tile_id = ?", xtable_tile_data);
+ free (xtable_tile_data);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_rd, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ table = sqlite3_mprintf ("%s_levels", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("INSERT OR IGNORE INTO \"%s\" (pyramid_level, "
+ "x_resolution_1_1, y_resolution_1_1, "
+ "x_resolution_1_2, y_resolution_1_2, x_resolution_1_4, "
+ "y_resolution_1_4, x_resolution_1_8, y_resolution_1_8) "
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_levl, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO levels SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ table = sqlite3_mprintf ("%s_tiles", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("INSERT INTO \"%s\" (tile_id, pyramid_level, section_id, geometry) "
+ "VALUES (NULL, ?, ?, ?)", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_tils, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO tiles SQL error: %s\n", sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ table = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("INSERT INTO \"%s\" (tile_id, tile_data_odd, tile_data_even) "
+ "VALUES (?, ?, ?)", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_data, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO tile_data SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ *xstmt_rd = stmt_rd;
+ *xstmt_levl = stmt_levl;
+ *xstmt_tils = stmt_tils;
+ *xstmt_data = stmt_data;
+ return 1;
+
+ error:
+ if (stmt_rd != NULL)
+ sqlite3_finalize (stmt_rd);
+ if (stmt_levl != NULL)
+ sqlite3_finalize (stmt_levl);
+ if (stmt_tils != NULL)
+ sqlite3_finalize (stmt_tils);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ return 0;
+}
+
+static int
+do_build_section_pyramid (sqlite3 * handle, const char *coverage,
+ const char *section, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_samples,
+ unsigned char compression, int quality, int srid,
+ unsigned int tileWidth, unsigned int tileHeight)
+{
+/* attempting to (re)build a section pyramid from scratch */
+ char *table_levels;
+ char *xtable_levels;
+ char *table_tiles;
+ char *xtable_tiles;
+ char *sql;
+ int id_level = 0;
+ double new_res_x;
+ double new_res_y;
+ sqlite3_int64 sect_id;
+ unsigned int sect_width;
+ unsigned int sect_height;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ unsigned int row;
+ unsigned int col;
+ double out_minx;
+ double out_miny;
+ double out_maxx;
+ double out_maxy;
+ sqlite3_stmt *stmt = NULL;
+ sqlite3_stmt *stmt_rd = NULL;
+ sqlite3_stmt *stmt_levl = NULL;
+ sqlite3_stmt *stmt_tils = NULL;
+ sqlite3_stmt *stmt_data = NULL;
+ SectionPyramid *pyr = NULL;
+ int ret;
+ int first;
+ int scale;
+ rl2PalettePtr palette = NULL;
+ rl2PixelPtr no_data = NULL;
+
+ if (!get_section_infos
+ (handle, coverage, section, §_id, §_width, §_height, &minx,
+ &miny, &maxx, &maxy, &palette, &no_data))
+ goto error;
+
+ if (!prepare_section_pyramid_stmts
+ (handle, coverage, &stmt_rd, &stmt_levl, &stmt_tils, &stmt_data))
+ goto error;
+
+ while (1)
+ {
+ /* looping on pyramid levels */
+ table_levels = sqlite3_mprintf ("%s_levels", coverage);
+ xtable_levels = gaiaDoubleQuotedSql (table_levels);
+ sqlite3_free (table_levels);
+ table_tiles = sqlite3_mprintf ("%s_tiles", coverage);
+ xtable_tiles = gaiaDoubleQuotedSql (table_tiles);
+ sqlite3_free (table_tiles);
+ sql =
+ sqlite3_mprintf ("SELECT l.x_resolution_1_1, l.y_resolution_1_1, "
+ "t.tile_id, MbrMinX(t.geometry), MbrMinY(t.geometry), "
+ "MbrMaxX(t.geometry), MbrMaxY(t.geometry) "
+ "FROM \"%s\" AS l "
+ "JOIN \"%s\" AS t ON (l.pyramid_level = t.pyramid_level) "
+ "WHERE l.pyramid_level = %d AND t.section_id = %d",
+ xtable_levels, xtable_tiles, id_level, sect_id);
+ free (xtable_levels);
+ free (xtable_tiles);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql,
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ first = 1;
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ double res_x = sqlite3_column_double (stmt, 0);
+ double res_y = sqlite3_column_double (stmt, 1);
+ sqlite3_int64 tile_id = sqlite3_column_int64 (stmt, 2);
+ double tminx = sqlite3_column_double (stmt, 3);
+ double tminy = sqlite3_column_double (stmt, 4);
+ double tmaxx = sqlite3_column_double (stmt, 5);
+ double tmaxy = sqlite3_column_double (stmt, 6);
+ new_res_x = res_x * 8.0;
+ new_res_y = res_y * 8.0;
+ scale = 8;
+ if (first)
+ {
+ pyr =
+ alloc_sect_pyramid (sect_id, sect_width,
+ sect_height, sample_type,
+ pixel_type, num_samples,
+ compression, quality, srid,
+ new_res_x, new_res_y,
+ (double) tileWidth *
+ new_res_x,
+ (double) tileHeight *
+ new_res_y, minx, miny, maxx,
+ maxy, scale);
+ first = 0;
+ if (pyr == NULL)
+ goto error;
+ }
+ if (!insert_tile_into_section_pyramid
+ (pyr, tile_id, tminx, tminy, tmaxx, tmaxy))
+ goto error;
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT base level; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ stmt = NULL;
+ if (pyr == NULL)
+ goto error;
+
+ out_maxy = maxy;
+ for (row = 0; row < pyr->scaled_height; row += tileHeight)
+ {
+ out_miny = out_maxy - pyr->tile_height;
+ out_minx = minx;
+ for (col = 0; col < pyr->scaled_width; col += tileWidth)
+ {
+ out_maxx = out_minx + pyr->tile_width;
+ set_pyramid_tile_destination (pyr, out_minx, out_miny,
+ out_maxx, out_maxy, row,
+ col);
+ out_minx += pyr->tile_width;
+ }
+ out_maxy -= pyr->tile_height;
+ }
+ id_level++;
+ if (pyr->scaled_width <= tileWidth
+ && pyr->scaled_height <= tileHeight)
+ break;
+ if (!do_insert_pyramid_levels
+ (handle, id_level, pyr->res_x, pyr->res_y, stmt_levl))
+ goto error;
+ if (pixel_type == RL2_PIXEL_DATAGRID)
+ {
+ /* DataGrid Pyramid */
+ if (!update_sect_pyramid_grid
+ (handle, stmt_rd, stmt_tils, stmt_data, pyr, tileWidth,
+ tileHeight, id_level, no_data, sample_type))
+ goto error;
+ }
+ else if (pixel_type == RL2_PIXEL_MULTIBAND)
+ {
+ /* MultiBand Pyramid */
+ if (!update_sect_pyramid_multiband
+ (handle, stmt_rd, stmt_tils, stmt_data, pyr, tileWidth,
+ tileHeight, id_level, no_data, sample_type, num_samples))
+ goto error;
+ }
+ else
+ {
+ /* any other Pyramid [not a DataGrid] */
+ if (!update_sect_pyramid
+ (handle, stmt_rd, stmt_tils, stmt_data, pyr, tileWidth,
+ tileHeight, id_level, palette, no_data))
+ goto error;
+ }
+ delete_sect_pyramid (pyr);
+ pyr = NULL;
+ }
+
+ if (pyr != NULL)
+ {
+ if (!do_insert_pyramid_levels
+ (handle, id_level, pyr->res_x, pyr->res_y, stmt_levl))
+ goto error;
+ if (pixel_type == RL2_PIXEL_DATAGRID)
+ {
+ /* DataGrid Pyramid */
+ if (!update_sect_pyramid_grid
+ (handle, stmt_rd, stmt_tils, stmt_data, pyr, tileWidth,
+ tileHeight, id_level, no_data, sample_type))
+ goto error;
+ }
+ else if (pixel_type == RL2_PIXEL_MULTIBAND)
+ {
+ /* MultiBand Pyramid */
+ if (!update_sect_pyramid_multiband
+ (handle, stmt_rd, stmt_tils, stmt_data, pyr, tileWidth,
+ tileHeight, id_level, no_data, sample_type, num_samples))
+ goto error;
+ }
+ else
+ {
+ /* any other Pyramid [not a DataGrid] */
+ if (!update_sect_pyramid
+ (handle, stmt_rd, stmt_tils, stmt_data, pyr, tileWidth,
+ tileHeight, id_level, palette, no_data))
+ goto error;
+ }
+ delete_sect_pyramid (pyr);
+ }
+ sqlite3_finalize (stmt_rd);
+ sqlite3_finalize (stmt_levl);
+ sqlite3_finalize (stmt_tils);
+ sqlite3_finalize (stmt_data);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return 1;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (stmt_rd != NULL)
+ sqlite3_finalize (stmt_rd);
+ if (pyr != NULL)
+ delete_sect_pyramid (pyr);
+ if (stmt_levl != NULL)
+ sqlite3_finalize (stmt_levl);
+ if (stmt_tils != NULL)
+ sqlite3_finalize (stmt_tils);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ return 0;
+}
+
+static int
+get_coverage_extent (sqlite3 * handle, const char *coverage, double *minx,
+ double *miny, double *maxx, double *maxy)
+{
+/* attempting to get the Extent from a Coverage Object */
+ char *sql;
+ int ret;
+ sqlite3_stmt *stmt;
+ double extent_minx;
+ double extent_miny;
+ double extent_maxx;
+ double extent_maxy;
+ int ok = 0;
+
+/* querying the Coverage metadata defs */
+ sql =
+ "SELECT extent_minx, extent_miny, extent_maxx, extent_maxy "
+ "FROM raster_coverages WHERE Lower(coverage_name) = Lower(?)";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ return 0;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ int ok_minx = 0;
+ int ok_miny = 0;
+ int ok_maxx = 0;
+ int ok_maxy = 0;
+ if (sqlite3_column_type (stmt, 0) == SQLITE_FLOAT)
+ {
+ extent_minx = sqlite3_column_double (stmt, 0);
+ ok_minx = 1;
+ }
+ if (sqlite3_column_type (stmt, 1) == SQLITE_FLOAT)
+ {
+ extent_miny = sqlite3_column_double (stmt, 1);
+ ok_miny = 1;
+ }
+ if (sqlite3_column_type (stmt, 2) == SQLITE_FLOAT)
+ {
+ extent_maxx = sqlite3_column_double (stmt, 2);
+ ok_maxx = 1;
+ }
+ if (sqlite3_column_type (stmt, 3) == SQLITE_FLOAT)
+ {
+ extent_maxy = sqlite3_column_double (stmt, 3);
+ ok_maxy = 1;
+ }
+ if (ok_minx && ok_miny && ok_maxx && ok_maxy)
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+
+ if (!ok)
+ return 0;
+ *minx = extent_minx;
+ *miny = extent_miny;
+ *maxx = extent_maxx;
+ *maxy = extent_maxy;
+ return 1;
+}
+
+static int
+find_base_resolution (sqlite3 * handle, const char *coverage,
+ double *x_res, double *y_res)
+{
+/* attempting to identify the base resolution level */
+ int ret;
+ int found = 0;
+ double xx_res;
+ double yy_res;
+ char *xcoverage;
+ char *xxcoverage;
+ char *sql;
+ sqlite3_stmt *stmt = NULL;
+
+ xcoverage = sqlite3_mprintf ("%s_levels", coverage);
+ xxcoverage = gaiaDoubleQuotedSql (xcoverage);
+ sqlite3_free (xcoverage);
+ sql =
+ sqlite3_mprintf ("SELECT x_resolution_1_1, y_resolution_1_1 "
+ "FROM \"%s\" WHERE pyramid_level = 0", xxcoverage);
+ free (xxcoverage);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ sqlite3_free (sql);
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 1) == SQLITE_FLOAT)
+ {
+ found = 1;
+ xx_res = sqlite3_column_double (stmt, 0);
+ yy_res = sqlite3_column_double (stmt, 1);
+ }
+ }
+ else
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql,
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (found)
+ {
+ *x_res = xx_res;
+ *y_res = yy_res;
+ return 1;
+ }
+ return 0;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ return 0;
+}
+
+static int
+get_section_raw_raster_data (sqlite3 * handle, const char *coverage,
+ sqlite3_int64 sect_id, unsigned int width,
+ unsigned int height, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_bands,
+ double minx, double maxy,
+ double x_res, double y_res, unsigned char **buffer,
+ int *buf_size, rl2PalettePtr palette,
+ rl2PixelPtr no_data)
+{
+/* attempting to return a buffer containing raw pixels from the whole DBMS Section */
+ unsigned char *bufpix = NULL;
+ int bufpix_size;
+ char *xtiles;
+ char *xxtiles;
+ char *xdata;
+ char *xxdata;
+ char *sql;
+ sqlite3_stmt *stmt_tiles = NULL;
+ sqlite3_stmt *stmt_data = NULL;
+ int ret;
+
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ break;
+ case RL2_SAMPLE_UINT8:
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ goto error;
+ break;
+ default:
+ goto error;
+ break;
+ };
+ bufpix_size = num_bands * width * height;
+ bufpix = malloc (bufpix_size);
+ if (bufpix == NULL)
+ {
+ fprintf (stderr,
+ "get_section_raw_raster_data: Insufficient Memory !!!\n");
+ goto error;
+ }
+ memset (bufpix, 0, bufpix_size);
+
+/* preparing the "tiles" SQL query */
+ xtiles = sqlite3_mprintf ("%s_tiles", coverage);
+ xxtiles = gaiaDoubleQuotedSql (xtiles);
+ sql =
+ sqlite3_mprintf ("SELECT tile_id, MbrMinX(geometry), MbrMaxY(geometry) "
+ "FROM \"%s\" "
+ "WHERE pyramid_level = 0 AND section_id = ?", xxtiles);
+ sqlite3_free (xtiles);
+ free (xxtiles);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_tiles, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT section raw tiles SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+/* preparing the data SQL query - both ODD and EVEN */
+ xdata = sqlite3_mprintf ("%s_tile_data", coverage);
+ xxdata = gaiaDoubleQuotedSql (xdata);
+ sqlite3_free (xdata);
+ sql = sqlite3_mprintf ("SELECT tile_data_odd, tile_data_even "
+ "FROM \"%s\" WHERE tile_id = ?", xxdata);
+ free (xxdata);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_data, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT section raw tiles data(2) SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+/* preparing a raw pixels buffer */
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ void_raw_buffer_palette (bufpix, width, height, no_data);
+ else
+ void_raw_buffer (bufpix, width, height, sample_type, num_bands,
+ no_data);
+ if (!load_dbms_tiles_section
+ (handle, sect_id, stmt_tiles, stmt_data, bufpix, width, height,
+ sample_type, num_bands, x_res, y_res, minx, maxy, RL2_SCALE_1, palette,
+ no_data))
+ goto error;
+ sqlite3_finalize (stmt_tiles);
+ sqlite3_finalize (stmt_data);
+ *buffer = bufpix;
+ *buf_size = bufpix_size;
+ return 1;
+
+ error:
+ if (stmt_tiles != NULL)
+ sqlite3_finalize (stmt_tiles);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ if (bufpix != NULL)
+ free (bufpix);
+ return 0;
+}
+
+static void
+raster_tile_124_rescaled (unsigned char *outbuf,
+ unsigned char pixel_type, const unsigned char *inbuf,
+ unsigned int section_width,
+ unsigned int section_height, unsigned int out_width,
+ unsigned int out_height, rl2PalettePtr palette)
+{
+/*
+/ this function builds an high quality rescaled sub-image by applying pixel interpolation
+/
+/ this code is widely inspired by the original GD gdImageCopyResampled() function
+*/
+ unsigned int x;
+ unsigned int y;
+ double sy1;
+ double sy2;
+ double sx1;
+ double sx2;
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+
+ if (pixel_type == RL2_PIXEL_PALETTE && palette == NULL)
+ return;
+
+ for (y = 0; y < out_height; y++)
+ {
+ sy1 = ((double) y) * (double) section_height / (double) out_height;
+ sy2 =
+ ((double) (y + 1)) * (double) section_height /
+ (double) out_height;
+ for (x = 0; x < out_width; x++)
+ {
+ double sx;
+ double sy;
+ double spixels = 0;
+ double red = 0.0;
+ double green = 0.0;
+ double blue = 0.0;
+ sx1 =
+ ((double) x) * (double) section_width / (double) out_width;
+ sx2 =
+ ((double) (x + 1)) * (double) section_width /
+ (double) out_width;
+ sy = sy1;
+ do
+ {
+ double yportion;
+ if (floor2 (sy) == floor2 (sy1))
+ {
+ yportion = 1.0 - (sy - floor2 (sy));
+ if (yportion > sy2 - sy1)
+ {
+ yportion = sy2 - sy1;
+ }
+ sy = floor2 (sy);
+ }
+ else if (sy == floor2 (sy2))
+ {
+ yportion = sy2 - floor2 (sy2);
+ }
+ else
+ {
+ yportion = 1.0;
+ }
+ sx = sx1;
+ do
+ {
+ double xportion;
+ double pcontribution;
+ if (floor2 (sx) == floor2 (sx1))
+ {
+ xportion = 1.0 - (sx - floor2 (sx));
+ if (xportion > sx2 - sx1)
+ {
+ xportion = sx2 - sx1;
+ }
+ sx = floor2 (sx);
+ }
+ else if (sx == floor2 (sx2))
+ {
+ xportion = sx2 - floor2 (sx2);
+ }
+ else
+ {
+ xportion = 1.0;
+ }
+ pcontribution = xportion * yportion;
+ /* retrieving the origin pixel */
+ if (pixel_type == RL2_PIXEL_RGB)
+ p_in =
+ inbuf +
+ ((unsigned int) sy * section_width * 3);
+ else
+ p_in =
+ inbuf + ((unsigned int) sy * section_width);
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ rl2PrivPalettePtr plt =
+ (rl2PrivPalettePtr) palette;
+ unsigned char index;
+ p_in += (unsigned int) sx;
+ index = *p_in;
+ if (index < plt->nEntries)
+ {
+ /* resolving the Palette color by index */
+ rl2PrivPaletteEntryPtr entry =
+ plt->entries + index;
+ r = entry->red;
+ g = entry->green;
+ b = entry->red;
+ }
+ else
+ {
+ r = 0;
+ g = 0;
+ b = 0;
+ }
+ }
+ else
+ {
+ p_in += (unsigned int) sx;
+ if (*p_in == 1)
+ {
+ /* black monochrome pixel */
+ r = 0;
+ g = 0;
+ b = 0;
+ }
+ else
+ {
+ /* white monochrome pixel */
+ r = 255;
+ g = 255;
+ b = 255;
+ }
+ }
+ red += r * pcontribution;
+ green += g * pcontribution;
+ blue += b * pcontribution;
+ spixels += xportion * yportion;
+ sx += 1.0;
+ }
+ while (sx < sx2);
+ sy += 1.0;
+ }
+ while (sy < sy2);
+ if (spixels != 0.0)
+ {
+ red /= spixels;
+ green /= spixels;
+ blue /= spixels;
+ }
+ if (red > 255.0)
+ red = 255.0;
+ if (green > 255.0)
+ green = 255.0;
+ if (blue > 255.0)
+ blue = 255.0;
+ /* setting the destination pixel */
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ p_out = outbuf + (y * out_width * 3);
+ else
+ p_out = outbuf + (y * out_width);
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ p_out += x * 3;
+ *p_out++ = (unsigned char) red;
+ *p_out++ = (unsigned char) green;
+ *p_out = (unsigned char) blue;
+ }
+ else
+ {
+ if (red <= 224.0)
+ {
+ p_out += x;
+ if (red < *p_out)
+ *p_out = (unsigned char) red;
+ }
+ }
+ }
+ }
+}
+
+static int
+copy_124_tile (unsigned char pixel_type, const unsigned char *outbuf,
+ unsigned char **tilebuf,
+ int *tilebuf_sz, unsigned char **tilemask, int *tilemask_sz,
+ unsigned int row, unsigned int col, unsigned int out_width,
+ unsigned int out_height, unsigned int tileWidth,
+ unsigned int tileHeight, rl2PixelPtr no_data)
+{
+/* allocating and initializing the resized tile buffers */
+ unsigned char *pixels = NULL;
+ int pixels_sz = 0;
+ unsigned char *mask = NULL;
+ int mask_sz = 0;
+ int has_mask = 0;
+ unsigned int x;
+ unsigned int y;
+ const unsigned char *p_inp;
+ unsigned char *p_outp;
+
+ if (pixel_type == RL2_PIXEL_RGB)
+ pixels_sz = tileWidth * tileHeight * 3;
+ else
+ pixels_sz = tileWidth * tileHeight;
+ pixels = malloc (pixels_sz);
+ if (pixels == NULL)
+ goto error;
+
+ if (pixel_type == RL2_PIXEL_RGB)
+ rl2_prime_void_tile (pixels, tileWidth, tileHeight, RL2_SAMPLE_UINT8,
+ 3, no_data);
+ else
+ rl2_prime_void_tile (pixels, tileWidth, tileHeight, RL2_SAMPLE_UINT8,
+ 1, no_data);
+
+ if (row + tileHeight > out_height)
+ has_mask = 1;
+ if (col + tileWidth > out_width)
+ has_mask = 1;
+ if (has_mask)
+ {
+ /* masking the unused portion of this tile */
+ mask_sz = tileWidth * tileHeight;
+ mask = malloc (mask_sz);
+ if (mask == NULL)
+ goto error;
+ memset (mask, 0, mask_sz);
+ for (y = 0; y < tileHeight; y++)
+ {
+ unsigned int y_in = y + row;
+ if (y_in >= out_height)
+ continue;
+ for (x = 0; x < tileWidth; x++)
+ {
+ unsigned int x_in = x + col;
+ if (x_in >= out_width)
+ continue;
+ p_outp = mask + (y * tileWidth);
+ p_outp += x;
+ *p_outp = 1;
+ }
+ }
+ }
+
+ for (y = 0; y < tileHeight; y++)
+ {
+ unsigned int y_in = y + row;
+ if (y_in >= out_height)
+ continue;
+ for (x = 0; x < tileWidth; x++)
+ {
+ unsigned int x_in = x + col;
+ if (x_in >= out_width)
+ continue;
+ if (pixel_type == RL2_PIXEL_RGB)
+ {
+ p_inp = outbuf + (y_in * out_width * 3);
+ p_inp += x_in * 3;
+ p_outp = pixels + (y * tileWidth * 3);
+ p_outp += x * 3;
+ *p_outp++ = *p_inp++;
+ *p_outp++ = *p_inp++;
+ *p_outp = *p_inp;
+ }
+ else
+ {
+ p_inp = outbuf + (y_in * out_width);
+ p_inp += x_in;
+ p_outp = pixels + (y * tileWidth);
+ p_outp += x;
+ *p_outp = *p_inp;
+ }
+ }
+ }
+
+ *tilebuf = pixels;
+ *tilebuf_sz = pixels_sz;
+ *tilemask = mask;
+ *tilemask_sz = mask_sz;
+ return 1;
+
+ error:
+ if (pixels != NULL)
+ free (pixels);
+ return 0;
+}
+
+static int
+do_build_124_bit_section_pyramid (sqlite3 * handle, const char *coverage,
+ const char *section,
+ unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_samples, int srid,
+ unsigned int tileWidth,
+ unsigned int tileHeight,
+ unsigned char bgRed, unsigned char bgGreen,
+ unsigned char bgBlue)
+{
+/* attempting to (re)build a 1,2,4-bit section pyramid from scratch */
+ double base_res_x;
+ double base_res_y;
+ sqlite3_int64 sect_id;
+ unsigned int sect_width;
+ unsigned int sect_height;
+ int id_level = 0;
+ int scale;
+ double x_res;
+ double y_res;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ unsigned int row;
+ unsigned int col;
+ sqlite3_stmt *stmt = NULL;
+ sqlite3_stmt *stmt_rd = NULL;
+ sqlite3_stmt *stmt_levl = NULL;
+ sqlite3_stmt *stmt_tils = NULL;
+ sqlite3_stmt *stmt_data = NULL;
+ rl2PalettePtr palette = NULL;
+ rl2PixelPtr no_data = NULL;
+ rl2PixelPtr nd = NULL;
+ unsigned char *inbuf = NULL;
+ int inbuf_size = 0;
+ unsigned char *outbuf = NULL;
+ int outbuf_sz = 0;
+ unsigned char out_pixel_type;
+ unsigned char out_bands;
+ unsigned char *tilebuf = NULL;
+ int tilebuf_sz = 0;
+ unsigned char *tilemask = NULL;
+ int tilemask_sz = 0;
+ unsigned char *blob_odd = NULL;
+ unsigned char *blob_even = NULL;
+ int blob_odd_sz;
+ int blob_even_sz;
+ unsigned int x;
+ unsigned int y;
+ unsigned char *p_out;
+
+ if (!get_section_infos
+ (handle, coverage, section, §_id, §_width, §_height, &minx,
+ &miny, &maxx, &maxy, &palette, &no_data))
+ goto error;
+
+ if (!find_base_resolution (handle, coverage, &base_res_x, &base_res_y))
+ goto error;
+ if (!get_section_raw_raster_data
+ (handle, coverage, sect_id, sect_width, sect_height, sample_type,
+ pixel_type, num_samples, minx, maxy, base_res_x,
+ base_res_y, &inbuf, &inbuf_size, palette, no_data))
+ goto error;
+
+ if (!prepare_section_pyramid_stmts
+ (handle, coverage, &stmt_rd, &stmt_levl, &stmt_tils, &stmt_data))
+ goto error;
+
+ id_level = 1;
+ scale = 2;
+ x_res = base_res_x * 2.0;
+ y_res = base_res_y * 2.0;
+ while (1)
+ {
+ /* looping on Pyramid levels */
+ double t_minx;
+ double t_miny;
+ double t_maxx;
+ double t_maxy;
+ unsigned int out_width = sect_width / scale;
+ unsigned int out_height = sect_height / scale;
+ rl2RasterPtr raster = NULL;
+
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ out_pixel_type = RL2_PIXEL_GRAYSCALE;
+ out_bands = 1;
+ outbuf_sz = out_width * out_height;
+ outbuf = malloc (outbuf_sz);
+ if (outbuf == NULL)
+ goto error;
+ p_out = outbuf;
+ for (y = 0; y < out_height; y++)
+ {
+ /* priming the background color */
+ for (x = 0; x < out_width; x++)
+ *p_out++ = bgRed;
+ }
+ }
+ else
+ {
+ out_pixel_type = RL2_PIXEL_RGB;
+ out_bands = 3;
+ outbuf_sz = out_width * out_height * 3;
+ outbuf = malloc (outbuf_sz);
+ if (outbuf == NULL)
+ goto error;
+ p_out = outbuf;
+ for (y = 0; y < out_height; y++)
+ {
+ /* priming the background color */
+ for (x = 0; x < out_width; x++)
+ {
+ *p_out++ = bgRed;
+ *p_out++ = bgGreen;
+ *p_out++ = bgBlue;
+ }
+ }
+ }
+ t_maxy = maxy;
+ raster_tile_124_rescaled (outbuf, pixel_type, inbuf,
+ sect_width, sect_height, out_width,
+ out_height, palette);
+
+ if (!do_insert_pyramid_levels
+ (handle, id_level, x_res, y_res, stmt_levl))
+ goto error;
+
+ for (row = 0; row < out_height; row += tileHeight)
+ {
+ t_minx = minx;
+ t_miny = t_maxy - (tileHeight * y_res);
+ for (col = 0; col < out_width; col += tileWidth)
+ {
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ if (no_data == NULL)
+ nd = NULL;
+ else
+ {
+ /* creating a NO-DATA pixel */
+ nd = rl2_create_pixel (RL2_SAMPLE_UINT8,
+ RL2_PIXEL_GRAYSCALE,
+ 1);
+ rl2_set_pixel_sample_uint8 (nd,
+ RL2_GRAYSCALE_BAND,
+ bgRed);
+ }
+ }
+ else
+ {
+ if (no_data == NULL)
+ nd = NULL;
+ else
+ {
+ /* converting the NO-DATA pixel */
+ nd = rl2_create_pixel (RL2_SAMPLE_UINT8,
+ RL2_PIXEL_RGB, 3);
+ rl2_set_pixel_sample_uint8 (nd, RL2_RED_BAND,
+ bgRed);
+ rl2_set_pixel_sample_uint8 (nd,
+ RL2_GREEN_BAND,
+ bgGreen);
+ rl2_set_pixel_sample_uint8 (nd, RL2_BLUE_BAND,
+ bgBlue);
+ }
+ }
+ t_maxx = t_minx + (tileWidth * x_res);
+ if (!copy_124_tile
+ (out_pixel_type, outbuf, &tilebuf,
+ &tilebuf_sz, &tilemask, &tilemask_sz, row, col,
+ out_width, out_height, tileWidth, tileHeight,
+ no_data))
+ {
+ fprintf (stderr,
+ "ERROR: unable to extract a Pyramid Tile\n");
+ goto error;
+ }
+
+ raster =
+ rl2_create_raster (tileWidth, tileHeight,
+ RL2_SAMPLE_UINT8, out_pixel_type,
+ out_bands, tilebuf, tilebuf_sz,
+ NULL, tilemask, tilemask_sz, nd);
+ tilebuf = NULL;
+ tilemask = NULL;
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "ERROR: unable to create a Pyramid Tile\n");
+ goto error;
+ }
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_PNG, &blob_odd, &blob_odd_sz,
+ &blob_even, &blob_even_sz, 100, 1) != RL2_OK)
+ {
+ fprintf (stderr,
+ "ERROR: unable to encode a Pyramid tile\n");
+ goto error;
+ }
+
+ /* INSERTing the tile */
+ if (!do_insert_pyramid_tile
+ (handle, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, id_level, sect_id, srid, t_minx,
+ t_miny, t_maxx, t_maxy, stmt_tils, stmt_data))
+ goto error;
+ rl2_destroy_raster (raster);
+ t_minx += (tileWidth * x_res);
+ }
+ t_maxy -= (tileHeight * y_res);
+ }
+
+ free (outbuf);
+ if (out_width < tileWidth && out_height < tileHeight)
+ break;
+ x_res *= 2.0;
+ y_res *= 2.0;
+ scale *= 2;
+ id_level++;
+ }
+
+ free (inbuf);
+ sqlite3_finalize (stmt_rd);
+ sqlite3_finalize (stmt_levl);
+ sqlite3_finalize (stmt_tils);
+ sqlite3_finalize (stmt_data);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return 1;
+
+ error:
+ if (outbuf != NULL)
+ free (outbuf);
+ if (tilebuf != NULL)
+ free (tilebuf);
+ if (tilemask != NULL)
+ free (tilemask);
+ if (inbuf != NULL)
+ free (inbuf);
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (stmt_rd != NULL)
+ sqlite3_finalize (stmt_rd);
+ if (stmt_levl != NULL)
+ sqlite3_finalize (stmt_levl);
+ if (stmt_tils != NULL)
+ sqlite3_finalize (stmt_tils);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return 0;
+}
+
+static int
+do_build_palette_section_pyramid (sqlite3 * handle, const char *coverage,
+ const char *section, int srid,
+ unsigned int tileWidth,
+ unsigned int tileHeight,
+ unsigned char bgRed, unsigned char bgGreen,
+ unsigned char bgBlue)
+{
+/* attempting to (re)build a Palette section pyramid from scratch */
+ double base_res_x;
+ double base_res_y;
+ sqlite3_int64 sect_id;
+ unsigned int sect_width;
+ unsigned int sect_height;
+ int id_level = 0;
+ int scale;
+ double x_res;
+ double y_res;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ unsigned int row;
+ unsigned int col;
+ sqlite3_stmt *stmt = NULL;
+ sqlite3_stmt *stmt_rd = NULL;
+ sqlite3_stmt *stmt_levl = NULL;
+ sqlite3_stmt *stmt_tils = NULL;
+ sqlite3_stmt *stmt_data = NULL;
+ rl2PalettePtr palette = NULL;
+ rl2PixelPtr no_data = NULL;
+ rl2PixelPtr nd = NULL;
+ unsigned char *inbuf = NULL;
+ int inbuf_size = 0;
+ unsigned char *outbuf = NULL;
+ int outbuf_sz = 0;
+ unsigned char out_pixel_type;
+ unsigned char out_bands;
+ unsigned char *tilebuf = NULL;
+ int tilebuf_sz = 0;
+ unsigned char *tilemask = NULL;
+ int tilemask_sz = 0;
+ unsigned char *blob_odd = NULL;
+ unsigned char *blob_even = NULL;
+ int blob_odd_sz;
+ int blob_even_sz;
+ unsigned int x;
+ unsigned int y;
+ unsigned char *p_out;
+
+ if (!get_section_infos
+ (handle, coverage, section, §_id, §_width, §_height, &minx,
+ &miny, &maxx, &maxy, &palette, &no_data))
+ goto error;
+ if (palette == NULL)
+ goto error;
+
+ if (!find_base_resolution (handle, coverage, &base_res_x, &base_res_y))
+ goto error;
+ if (!get_section_raw_raster_data
+ (handle, coverage, sect_id, sect_width, sect_height, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_PALETTE, 1, minx, maxy, base_res_x,
+ base_res_y, &inbuf, &inbuf_size, palette, no_data))
+ goto error;
+
+ if (!prepare_section_pyramid_stmts
+ (handle, coverage, &stmt_rd, &stmt_levl, &stmt_tils, &stmt_data))
+ goto error;
+
+ id_level = 1;
+ scale = 2;
+ x_res = base_res_x * 2.0;
+ y_res = base_res_y * 2.0;
+ while (1)
+ {
+ /* looping on Pyramid levels */
+ double t_minx;
+ double t_miny;
+ double t_maxx;
+ double t_maxy;
+ unsigned int out_width = sect_width / scale;
+ unsigned int out_height = sect_height / scale;
+ rl2RasterPtr raster = NULL;
+
+ out_pixel_type = RL2_PIXEL_RGB;
+ out_bands = 3;
+ outbuf_sz = out_width * out_height * 3;
+ outbuf = malloc (outbuf_sz);
+ if (outbuf == NULL)
+ goto error;
+ p_out = outbuf;
+ for (y = 0; y < out_height; y++)
+ {
+ /* priming the background color */
+ for (x = 0; x < out_width; x++)
+ {
+ *p_out++ = bgRed;
+ *p_out++ = bgGreen;
+ *p_out++ = bgBlue;
+ }
+ }
+ t_maxy = maxy;
+ raster_tile_124_rescaled (outbuf, RL2_PIXEL_PALETTE, inbuf,
+ sect_width, sect_height, out_width,
+ out_height, palette);
+
+ if (!do_insert_pyramid_levels
+ (handle, id_level, x_res, y_res, stmt_levl))
+ goto error;
+
+ for (row = 0; row < out_height; row += tileHeight)
+ {
+ t_minx = minx;
+ t_miny = t_maxy - (tileHeight * y_res);
+ for (col = 0; col < out_width; col += tileWidth)
+ {
+ if (no_data == NULL)
+ nd = NULL;
+ else
+ {
+ /* converting the NO-DATA pixel */
+ nd = rl2_create_pixel (RL2_SAMPLE_UINT8,
+ RL2_PIXEL_RGB, 3);
+ rl2_set_pixel_sample_uint8 (nd, RL2_RED_BAND,
+ bgRed);
+ rl2_set_pixel_sample_uint8 (nd,
+ RL2_GREEN_BAND,
+ bgGreen);
+ rl2_set_pixel_sample_uint8 (nd, RL2_BLUE_BAND,
+ bgBlue);
+ }
+ t_maxx = t_minx + (tileWidth * x_res);
+ if (!copy_124_tile (out_pixel_type, outbuf, &tilebuf,
+ &tilebuf_sz, &tilemask, &tilemask_sz,
+ row, col, out_width, out_height,
+ tileWidth, tileHeight, no_data))
+ {
+ fprintf (stderr,
+ "ERROR: unable to extract a Pyramid Tile\n");
+ goto error;
+ }
+
+ raster =
+ rl2_create_raster (tileWidth, tileHeight,
+ RL2_SAMPLE_UINT8, out_pixel_type,
+ out_bands, tilebuf, tilebuf_sz,
+ NULL, tilemask, tilemask_sz, nd);
+ tilebuf = NULL;
+ tilemask = NULL;
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "ERROR: unable to create a Pyramid Tile\n");
+ goto error;
+ }
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_JPEG, &blob_odd,
+ &blob_odd_sz, &blob_even, &blob_even_sz, 100,
+ 1) != RL2_OK)
+ {
+ fprintf (stderr,
+ "ERROR: unable to encode a Pyramid tile\n");
+ goto error;
+ }
+
+ /* INSERTing the tile */
+ if (!do_insert_pyramid_tile
+ (handle, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, id_level, sect_id, srid, t_minx,
+ t_miny, t_maxx, t_maxy, stmt_tils, stmt_data))
+ goto error;
+ rl2_destroy_raster (raster);
+ t_minx += (tileWidth * x_res);
+ }
+ t_maxy -= (tileHeight * y_res);
+ }
+
+ free (outbuf);
+ if (out_width < tileWidth && out_height < tileHeight)
+ break;
+ x_res *= 4.0;
+ y_res *= 4.0;
+ scale *= 4;
+ id_level++;
+ }
+
+ free (inbuf);
+ sqlite3_finalize (stmt_rd);
+ sqlite3_finalize (stmt_levl);
+ sqlite3_finalize (stmt_tils);
+ sqlite3_finalize (stmt_data);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return 1;
+
+ error:
+ if (outbuf != NULL)
+ free (outbuf);
+ if (tilebuf != NULL)
+ free (tilebuf);
+ if (tilemask != NULL)
+ free (tilemask);
+ if (inbuf != NULL)
+ free (inbuf);
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (stmt_rd != NULL)
+ sqlite3_finalize (stmt_rd);
+ if (stmt_levl != NULL)
+ sqlite3_finalize (stmt_levl);
+ if (stmt_tils != NULL)
+ sqlite3_finalize (stmt_tils);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return 0;
+}
+
+static void
+get_background_color (sqlite3 * handle, rl2CoveragePtr coverage,
+ unsigned char *bgRed, unsigned char *bgGreen,
+ unsigned char *bgBlue)
+{
+/* retrieving the background color for 1,2,4 bit samples */
+ sqlite3_stmt *stmt = NULL;
+ char *sql;
+ int ret;
+ rl2PrivPalettePtr plt;
+ rl2PalettePtr palette = NULL;
+ rl2PrivSamplePtr smp;
+ rl2PrivPixelPtr pxl;
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) coverage;
+ unsigned char index;
+ *bgRed = 255;
+ *bgGreen = 255;
+ *bgBlue = 255;
+
+ if (cvg == NULL)
+ return;
+ if (cvg->noData == NULL)
+ return;
+ pxl = (rl2PrivPixelPtr) (cvg->noData);
+ smp = pxl->Samples;
+ index = smp->uint8;
+
+ if (cvg->pixelType == RL2_PIXEL_MONOCHROME)
+ {
+ if (index == 1)
+ {
+ *bgRed = 0;
+ *bgGreen = 0;
+ *bgBlue = 0;
+ }
+ return;
+ }
+
+/* Coverage's palette */
+ sql = sqlite3_mprintf ("SELECT palette FROM raster_coverages "
+ "WHERE Lower(coverage_name) = Lower(%Q)",
+ cvg->coverageName);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ palette = rl2_deserialize_dbms_palette (blob, blob_sz);
+ }
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT section_info; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (palette == NULL)
+ goto error;
+
+ plt = (rl2PrivPalettePtr) palette;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr rgb = plt->entries + index;
+ *bgRed = rgb->red;
+ *bgGreen = rgb->green;
+ *bgBlue = rgb->blue;
+ }
+ rl2_destroy_palette (palette);
+ return;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+}
+
+RL2_DECLARE int
+rl2_build_section_pyramid (sqlite3 * handle, const char *coverage,
+ const char *section, int forced_rebuild)
+{
+/* (re)building section-level pyramid for a single Section */
+ rl2CoveragePtr cvg = NULL;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned char compression;
+ int quality;
+ unsigned int tileWidth;
+ unsigned int tileHeight;
+ int srid;
+ int build = 0;
+ unsigned char bgRed;
+ unsigned char bgGreen;
+ unsigned char bgBlue;
+
+ cvg = rl2_create_coverage_from_dbms (handle, coverage);
+ if (cvg == NULL)
+ goto error;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (rl2_get_coverage_compression (cvg, &compression, &quality) != RL2_OK)
+ goto error;
+ if (rl2_get_coverage_tile_size (cvg, &tileWidth, &tileHeight) != RL2_OK)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &srid) != RL2_OK)
+ goto error;
+
+ if (!forced_rebuild)
+ {
+ /* checking if the section pyramid already exists */
+ build = check_section_pyramid (handle, coverage, section);
+ }
+ else
+ {
+ /* unconditional rebuilding */
+ build = 1;
+ }
+
+ if (build)
+ {
+ /* attempting to delete the section pyramid */
+ if (!delete_section_pyramid (handle, coverage, section))
+ goto error;
+ /* attempting to (re)build the section pyramid */
+ if ((sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_MONOCHROME && num_bands == 1)
+ || (sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1)
+ || (sample_type == RL2_SAMPLE_2_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1)
+ || (sample_type == RL2_SAMPLE_4_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1))
+ {
+ /* special case: 1,2,4 bit Pyramid */
+ get_background_color (handle, cvg, &bgRed, &bgGreen, &bgBlue);
+ if (!do_build_124_bit_section_pyramid
+ (handle, coverage, section, sample_type, pixel_type,
+ num_bands, srid, tileWidth, tileHeight, bgRed, bgGreen,
+ bgBlue))
+ goto error;
+ }
+ else if (sample_type == RL2_SAMPLE_UINT8
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1)
+ {
+ /* special case: 8 bit Palette Pyramid */
+ get_background_color (handle, cvg, &bgRed, &bgGreen, &bgBlue);
+ if (!do_build_palette_section_pyramid
+ (handle, coverage, section, srid, tileWidth, tileHeight,
+ bgRed, bgGreen, bgBlue))
+ goto error;
+ }
+ else
+ {
+ /* ordinary RGB, Grayscale, MultiBand or DataGrid Pyramid */
+ if (!do_build_section_pyramid
+ (handle, coverage, section, sample_type, pixel_type,
+ num_bands, compression, quality, srid, tileWidth,
+ tileHeight))
+ goto error;
+ }
+ printf (" ----------\n");
+ printf (" Pyramid levels successfully built for: %s\n", section);
+ }
+ rl2_destroy_coverage (cvg);
+
+ return RL2_OK;
+
+ error:
+ if (cvg != NULL)
+ rl2_destroy_coverage (cvg);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_build_all_section_pyramids (sqlite3 * handle, const char *coverage,
+ int forced_rebuild)
+{
+/* (re)building section-level pyramids for a whole Coverage */
+ char *table;
+ char *xtable;
+ int ret;
+ int i;
+ char **results;
+ int rows;
+ int columns;
+ char *sql;
+
+ table = sqlite3_mprintf ("%s_sections", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("SELECT section_name FROM \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ goto error;
+ if (rows < 1)
+ ;
+ else
+ {
+ for (i = 1; i <= rows; i++)
+ {
+ const char *section = results[(i * columns) + 0];
+ if (rl2_build_section_pyramid
+ (handle, coverage, section, forced_rebuild) != RL2_OK)
+ goto error;
+ }
+ }
+ sqlite3_free_table (results);
+ return RL2_OK;
+
+ error:
+ return RL2_ERROR;
+}
+
+static int
+is_full_mask (const unsigned char *mask, int mask_size)
+{
+/* testing for a completely transparent mask */
+ const unsigned char *p = mask;
+ int i;
+ int count = 0;
+ if (mask == NULL)
+ return 0;
+ for (i = 0; i < mask_size; i++)
+ {
+ if (*p++ == 0)
+ count++;
+ }
+ if (count == mask_size)
+ return 1;
+ return 0;
+}
+
+RL2_DECLARE int
+rl2_build_monolithic_pyramid (sqlite3 * handle, const char *coverage,
+ int virt_levels)
+{
+/* (re)building monolithic pyramid for a whole coverage */
+ rl2CoveragePtr cvg = NULL;
+ rl2PrivCoveragePtr cov;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned char compression;
+ int quality;
+ unsigned int tileWidth;
+ unsigned int tileHeight;
+ int srid;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ unsigned int row;
+ unsigned int col;
+ unsigned int tot_rows;
+ double res_x;
+ double res_y;
+ int factor;
+ int resize_factor;
+ int id_level = 0;
+ unsigned char out_sample_type;
+ unsigned char out_pixel_type;
+ unsigned char out_num_bands;
+ unsigned char out_compression;
+ int out_quality;
+ rl2PixelPtr no_data = NULL;
+ rl2PixelPtr nd = NULL;
+ rl2PalettePtr palette = NULL;
+ unsigned char *buffer = NULL;
+ int buf_size;
+ int sample_sz;
+ unsigned char *mask = NULL;
+ int mask_size;
+ rl2RasterPtr raster = NULL;
+ unsigned char *blob_odd = NULL;
+ unsigned char *blob_even = NULL;
+ int blob_odd_sz;
+ int blob_even_sz;
+ sqlite3_stmt *stmt_geo = NULL;
+ sqlite3_stmt *stmt_rd = NULL;
+ sqlite3_stmt *stmt_levl = NULL;
+ sqlite3_stmt *stmt_tils = NULL;
+ sqlite3_stmt *stmt_data = NULL;
+ char *xtiles;
+ char *xxtiles;
+ int ret;
+ char *sql;
+ double tile_minx;
+ double tile_miny;
+ double tile_maxx;
+ double tile_maxy;
+ double end_x;
+ double end_y;
+ int stop = 0;
+
+/* preparing the "tiles" SQL query */
+ xtiles = sqlite3_mprintf ("%s_tiles", coverage);
+ xxtiles = gaiaDoubleQuotedSql (xtiles);
+ sql =
+ sqlite3_mprintf
+ ("SELECT tile_id, MbrMinX(geometry), MbrMaxY(geometry) FROM \"%s\" "
+ "WHERE pyramid_level = ? AND ROWID IN (SELECT ROWID FROM SpatialIndex "
+ "WHERE f_table_name = %Q AND search_frame = BuildMBR(?, ?, ?, ?)) "
+ "ORDER BY ST_Area(geometry)", xxtiles, xtiles);
+ sqlite3_free (xtiles);
+ free (xxtiles);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_geo, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT monolithic RGBA tiles SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ cvg = rl2_create_coverage_from_dbms (handle, coverage);
+ if (cvg == NULL)
+ goto error;
+ cov = (rl2PrivCoveragePtr) cvg;
+
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (rl2_get_coverage_compression (cvg, &compression, &quality) != RL2_OK)
+ goto error;
+ if (rl2_get_coverage_tile_size (cvg, &tileWidth, &tileHeight) != RL2_OK)
+ goto error;
+ if (rl2_get_coverage_srid (cvg, &srid) != RL2_OK)
+ goto error;
+ if (!get_coverage_extent (handle, coverage, &minx, &miny, &maxx, &maxy))
+ goto error;
+ no_data = rl2_get_coverage_no_data (cvg);
+ palette = rl2_get_dbms_palette (handle, coverage);
+ if (!prepare_section_pyramid_stmts
+ (handle, coverage, &stmt_rd, &stmt_levl, &stmt_tils, &stmt_data))
+ goto error;
+
+ if (sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_MONOCHROME && num_bands == 1)
+ {
+ /* monochrome: output colorspace is Grayscale */
+ out_sample_type = RL2_SAMPLE_UINT8;
+ out_pixel_type = RL2_PIXEL_GRAYSCALE;
+ out_num_bands = 1;
+ out_compression = RL2_COMPRESSION_PNG;
+ out_quality = 100;
+ factor = 2;
+ resize_factor = 2;
+ }
+ else if ((sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1)
+ || (sample_type == RL2_SAMPLE_2_BIT
+ && pixel_type == RL2_PIXEL_PALETTE && num_bands == 1)
+ || (sample_type == RL2_SAMPLE_4_BIT))
+ {
+ /* palette 1,2,4: output colorspace is RGB */
+ out_sample_type = RL2_SAMPLE_UINT8;
+ out_pixel_type = RL2_PIXEL_RGB;
+ out_num_bands = 3;
+ out_compression = RL2_COMPRESSION_PNG;
+ out_quality = 100;
+ factor = 2;
+ resize_factor = 2;
+ }
+ else if (sample_type == RL2_SAMPLE_UINT8 && pixel_type == RL2_PIXEL_PALETTE
+ && num_bands == 1)
+ {
+ /* palette 8: RGB JPEG pyramid level */
+ out_sample_type = RL2_SAMPLE_UINT8;
+ out_pixel_type = RL2_PIXEL_RGB;
+ out_num_bands = 3;
+ out_compression = RL2_COMPRESSION_JPEG;
+ out_quality = 80;
+ }
+ else
+ {
+ /* unaltered output colorspace */
+ out_sample_type = sample_type;
+ out_pixel_type = pixel_type;
+ out_num_bands = num_bands;
+ if (sample_type == RL2_SAMPLE_UINT8
+ && ((pixel_type == RL2_PIXEL_RGB && num_bands == 3)
+ || (pixel_type == RL2_PIXEL_GRAYSCALE && num_bands == 1)))
+ {
+ out_compression = RL2_COMPRESSION_JPEG;
+ out_quality = quality;
+ }
+ else
+ {
+ out_compression = RL2_COMPRESSION_DEFLATE;
+ out_quality = 100;
+ }
+ /* setting the requested virt_levels */
+ switch (virt_levels)
+ {
+ case 1: /* separating each physical level */
+ resize_factor = 2;
+ break;
+ case 2: /* one physical + one virtual */
+ resize_factor = 4;
+ break;
+ case 3: /* one physical + two virtuals */
+ resize_factor = 8;
+ break;
+ default:
+ resize_factor = 8;
+ break;
+ };
+ factor = resize_factor;
+ }
+
+/* computing output tile buffers */
+ switch (out_sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ sample_sz = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ sample_sz = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample_sz = 8;
+ break;
+ default:
+ sample_sz = 1;
+ break;
+ }
+ buf_size = tileWidth * tileHeight * out_num_bands * sample_sz;
+
+/* attempting to delete the section pyramid */
+ if (rl2_delete_all_pyramids (handle, coverage) != RL2_OK)
+ goto error;
+
+/* attempting to (re)build the section pyramid */
+ while (1)
+ {
+ /* looping on pyramid levels */
+ tile_maxy = maxy;
+ row = 0;
+ res_x = cov->hResolution * (double) factor;
+ res_y = cov->vResolution * (double) factor;
+ if (!do_insert_pyramid_levels
+ (handle, id_level + 1, res_x, res_y, stmt_levl))
+ goto error;
+ tot_rows = 0;
+ while (1)
+ {
+ /* pre-computing the max row-number */
+ tile_miny = tile_maxy - ((double) tileHeight * res_y);
+ tile_minx = minx;
+ if (tile_maxy < miny)
+ break;
+ tot_rows++;
+ tile_maxy = tile_miny;
+ }
+
+ tile_maxy = maxy;
+ while (1)
+ {
+ /* looping on rows */
+ tile_miny = tile_maxy - ((double) tileHeight * res_y);
+ tile_minx = minx;
+ if (tile_maxy < miny)
+ break;
+ col = 0;
+ while (1)
+ {
+ /* looping on columns */
+ tile_maxx = tile_minx + ((double) tileWidth * res_x);
+ if (tile_minx > maxx)
+ break;
+ /* allocating output tile buffers */
+ buffer = malloc (buf_size);
+ if (buffer == NULL)
+ goto error;
+ mask_size = tileWidth * tileHeight;
+ mask = malloc (mask_size);
+ if (mask == NULL)
+ goto error;
+ end_x = tile_maxx;
+ if (tile_maxx > maxx)
+ end_x = maxx;
+ end_y = tile_miny;
+ if (tile_miny < miny)
+ end_y = miny;
+
+ if ((sample_type == RL2_SAMPLE_UINT8
+ && pixel_type == RL2_PIXEL_GRAYSCALE
+ && num_bands == 1)
+ || (sample_type == RL2_SAMPLE_UINT8
+ && pixel_type == RL2_PIXEL_RGB && num_bands == 3)
+ || (sample_type == RL2_SAMPLE_UINT8
+ && pixel_type == RL2_PIXEL_PALETTE
+ && num_bands == 1))
+ {
+ /* RGB, PALETTE or GRAYSCALE datasource (UINT8) */
+ if (!rescale_monolithic_rgba
+ (id_level, tileWidth, tileHeight, resize_factor,
+ res_x, res_y, tile_minx, tile_miny,
+ tile_maxx, tile_maxy, buffer, buf_size, mask,
+ &mask_size, palette, no_data, stmt_geo,
+ stmt_rd))
+ goto error;
+ if (mask_size == 0)
+ mask = NULL;
+ }
+ else if (((sample_type == RL2_SAMPLE_1_BIT
+ || sample_type == RL2_SAMPLE_2_BIT
+ || sample_type == RL2_SAMPLE_4_BIT)
+ && pixel_type == RL2_PIXEL_PALETTE
+ && num_bands == 1)
+ || (sample_type == RL2_SAMPLE_1_BIT
+ && pixel_type == RL2_PIXEL_MONOCHROME
+ && num_bands == 1))
+ {
+ /* MONOCHROME and 1,2,4 bit PALETTE */
+ if (!rescale_monolithic_124
+ (id_level, tileWidth,
+ tileHeight, resize_factor, pixel_type,
+ res_x, res_y, tile_minx, tile_miny,
+ tile_maxx, tile_maxy, buffer, buf_size, mask,
+ &mask_size, palette, no_data, stmt_geo,
+ stmt_rd))
+ goto error;
+ if (mask_size == 0)
+ mask = NULL;
+ }
+ else if (pixel_type == RL2_PIXEL_MULTIBAND)
+ {
+ /* MultiBand */
+ if (!rescale_monolithic_multiband
+ (id_level, tileWidth, tileHeight, sample_type,
+ num_bands, resize_factor, res_x, res_y,
+ tile_minx, tile_miny, tile_maxx, tile_maxy,
+ buffer, buf_size, mask, &mask_size, no_data,
+ stmt_geo, stmt_rd))
+ goto error;
+ if (mask_size == 0)
+ mask = NULL;
+ }
+ else if (pixel_type == RL2_PIXEL_DATAGRID)
+ {
+ /* DataGrid */
+ if (!rescale_monolithic_datagrid
+ (id_level, tileWidth, tileHeight, sample_type,
+ resize_factor, res_x, res_y, tile_minx,
+ tile_miny, tile_maxx, tile_maxy, buffer,
+ buf_size, mask, &mask_size, no_data, stmt_geo,
+ stmt_rd))
+ goto error;
+ if (mask_size == 0)
+ mask = NULL;
+ }
+ else
+ {
+ /* unknown */
+ fprintf (stderr,
+ "ERROR: unsupported Monolithic pyramid type\n");
+ goto error;
+ }
+ if (is_full_mask (mask, mask_size))
+ {
+ /* skipping a completely void tile */
+ free (buffer);
+ free (mask);
+ buffer = NULL;
+ mask = NULL;
+ goto done;
+ }
+
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ if (no_data == NULL)
+ nd = NULL;
+ else
+ {
+ rl2PrivPixelPtr pxl =
+ (rl2PrivPixelPtr) no_data;
+ rl2PrivSamplePtr sample = pxl->Samples + 0;
+ nd = rl2_create_pixel (RL2_SAMPLE_UINT8,
+ RL2_PIXEL_GRAYSCALE,
+ 1);
+ if (sample->uint8 == 0)
+ rl2_set_pixel_sample_uint8 (nd,
+ RL2_GRAYSCALE_BAND,
+ 255);
+ else
+ rl2_set_pixel_sample_uint8 (nd,
+ RL2_GRAYSCALE_BAND,
+ 0);
+ }
+ }
+ else if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ if (no_data == NULL)
+ nd = NULL;
+ else
+ {
+ nd = rl2_create_pixel (RL2_SAMPLE_UINT8,
+ RL2_PIXEL_RGB, 3);
+ rl2_set_pixel_sample_uint8 (nd, RL2_RED_BAND,
+ 255);
+ rl2_set_pixel_sample_uint8 (nd,
+ RL2_GREEN_BAND,
+ 255);
+ rl2_set_pixel_sample_uint8 (nd, RL2_BLUE_BAND,
+ 255);
+ }
+ }
+ else
+ nd = rl2_clone_pixel (no_data);
+
+ raster =
+ rl2_create_raster (tileWidth, tileHeight,
+ out_sample_type, out_pixel_type,
+ out_num_bands, buffer, buf_size,
+ NULL, mask, mask_size, nd);
+ buffer = NULL;
+ mask = NULL;
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "ERROR: unable to create a Pyramid Tile\n");
+ goto error;
+ }
+ if (rl2_raster_encode
+ (raster, out_compression, &blob_odd, &blob_odd_sz,
+ &blob_even, &blob_even_sz, out_quality, 1) != RL2_OK)
+ {
+ fprintf (stderr,
+ "ERROR: unable to encode a Pyramid tile\n");
+ goto error;
+ }
+
+ /* INSERTing the tile */
+ if (!do_insert_pyramid_tile
+ (handle, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, id_level + 1, -1, srid, tile_minx,
+ end_y, end_x, tile_maxy, stmt_tils, stmt_data))
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+
+ done:
+ tile_minx = tile_maxx;
+ col++;
+ }
+ tile_maxy = tile_miny;
+ row++;
+ printf (" ----------\n");
+ printf
+ (" %s: Monolithic Pyramid Level %d - Row %d of %d successfully built\n",
+ coverage, id_level + 1, row, tot_rows);
+ }
+ if (stop)
+ break;
+ if ((minx +
+ ((double) tileWidth * res_x) > maxx)
+ && (maxy - ((double) tileHeight * res_y) < maxy))
+ stop = 1;
+ /* setting the requested virt_levels */
+ switch (virt_levels)
+ {
+ case 1: /* separating each physical level */
+ resize_factor = 2;
+ break;
+ case 2: /* one physical + one virtual */
+ resize_factor = 4;
+ break;
+ case 3: /* one physical + two virtuals */
+ resize_factor = 8;
+ break;
+ };
+ factor *= resize_factor;
+ id_level++;
+ if (palette != NULL)
+ {
+ /* destroying an eventual Palette after completing the first level */
+ rl2_destroy_palette (palette);
+ palette = NULL;
+ }
+ }
+ sqlite3_finalize (stmt_geo);
+ sqlite3_finalize (stmt_rd);
+ sqlite3_finalize (stmt_levl);
+ sqlite3_finalize (stmt_tils);
+ sqlite3_finalize (stmt_data);
+ printf (" ----------\n");
+ printf (" Monolithic Pyramid levels successfully built for: %s\n",
+ coverage);
+ free (buffer);
+ free (mask);
+ rl2_destroy_coverage (cvg);
+
+ return RL2_OK;
+
+ error:
+ if (stmt_geo != NULL)
+ sqlite3_finalize (stmt_geo);
+ if (stmt_rd != NULL)
+ sqlite3_finalize (stmt_rd);
+ if (stmt_levl != NULL)
+ sqlite3_finalize (stmt_levl);
+ if (stmt_tils != NULL)
+ sqlite3_finalize (stmt_tils);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ if (buffer != NULL)
+ free (buffer);
+ if (mask != NULL)
+ free (mask);
+ if (cvg != NULL)
+ rl2_destroy_coverage (cvg);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_delete_all_pyramids (sqlite3 * handle, const char *coverage)
+{
+/* deleting all pyramids for a whole Coverage */
+ char *sql;
+ char *table;
+ char *xtable;
+ int ret;
+ char *err_msg = NULL;
+
+ table = sqlite3_mprintf ("%s_tiles", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf ("DELETE FROM \"%s\" WHERE pyramid_level > 0", xtable);
+ free (xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DELETE FROM \"%s_tiles\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ return RL2_ERROR;
+ }
+
+ table = sqlite3_mprintf ("%s_levels", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf ("DELETE FROM \"%s\" WHERE pyramid_level > 0", xtable);
+ free (xtable);
+ ret = sqlite3_exec (handle, sql, NULL, NULL, &err_msg);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DELETE FROM \"%s_levels\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ return RL2_ERROR;
+ }
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_delete_section_pyramid (sqlite3 * handle, const char *coverage,
+ const char *section)
+{
+/* deleting section-level pyramid for a single Section */
+ if (!delete_section_pyramid (handle, coverage, section))
+ return RL2_ERROR;
+ return RL2_OK;
+}
diff --git a/src/rl2rastersym.c b/src/rl2rastersym.c
new file mode 100644
index 0000000..801ae03
--- /dev/null
+++ b/src/rl2rastersym.c
@@ -0,0 +1,4405 @@
+/*
+
+ rl2rastersym -- Raster Symbolizer - applying the style
+
+ version 0.1, 2014 March 23
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2_private.h"
+
+#include <spatialite/gaiaaux.h>
+
+/* 64 bit integer: portable format for printf() */
+#if defined(_WIN32) && !defined(__MINGW32__)
+#define ERR_FRMT64 "ERROR: unable to decode Tile ID=%I64d\n"
+#else
+#define ERR_FRMT64 "ERROR: unable to decode Tile ID=%lld\n"
+#endif
+
+static void
+copy_int8_raw_pixels (const char *buffer, const unsigned char *mask,
+ char *outbuf, unsigned short width,
+ unsigned short height, double x_res, double y_res,
+ double minx, double maxy, double tile_minx,
+ double tile_maxy, unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data)
+{
+/* copying INT8 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const char *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ char *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_INT8)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = outbuf + (out_y * width) + out_x;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out++;
+ p_in++;
+ }
+ else
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const char *p_save = p_in;
+ char sample = 0;
+ rl2_get_pixel_sample_int8 (no_data, &sample);
+ if (sample == *p_in++)
+ match = 1;
+ if (!match)
+ {
+ /* opaque pixel */
+ p_in = p_save;
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out++;
+ }
+ }
+ }
+ }
+}
+
+static unsigned char *
+apply_color_map (double mono, unsigned char *p_out,
+ rl2BandHandlingPtr mono_handling)
+{
+/* applying a ColorMap */
+ int found = 0;
+ rl2ColorMapRefPtr rule;
+ rl2ColorMapItemPtr color;
+ double scaled =
+ ((double) mono - mono_handling->minValue) / mono_handling->scaleFactor;
+ int i = (int) scaled;
+ if (i < 0)
+ i = 0;
+ if (i > 255)
+ i = 255;
+ color = &(mono_handling->colorMap->look_up[i]);
+ rule = color->first;
+ while (rule != NULL)
+ {
+ if (rule->min <= mono && rule->max > mono)
+ {
+ if (mono_handling->colorMap->interpolate)
+ {
+ /* Interpolate */
+ double span = rule->max - rule->min;
+ double pos = (double) mono - rule->min;
+ double scale = pos / span;
+ double red_span = (double) (rule->maxRed - rule->red);
+ double green_span =
+ (double) (rule->maxGreen - rule->green);
+ double blue_span = (double) (rule->maxBlue - rule->blue);
+ double red = (double) (rule->red) + (red_span * scale);
+ double green =
+ (double) (rule->green) + (green_span * scale);
+ double blue = (double) (rule->blue) + (blue_span * scale);
+ *p_out++ = (unsigned char) red;
+ *p_out++ = (unsigned char) green;
+ *p_out++ = (unsigned char) blue;
+ }
+ else
+ {
+ /* Categorize */
+ *p_out++ = rule->red;
+ *p_out++ = rule->green;
+ *p_out++ = rule->blue;
+ }
+ found = 1;
+ break;
+ }
+ rule = rule->next;
+ }
+ if (!found)
+ {
+ /* applying the default RGB color */
+ *p_out++ = mono_handling->colorMap->red;
+ *p_out++ = mono_handling->colorMap->green;
+ *p_out++ = mono_handling->colorMap->blue;
+ }
+ return p_out;
+}
+
+static unsigned char *
+apply_contrast_enhancement (double mono, unsigned char *p_out,
+ rl2BandHandlingPtr mono_handling)
+{
+/* applying Contrast Enhancement */
+ double scaled;
+ if (mono_handling->contrastEnhancement == RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ /* applying Gamma Value */
+ if (mono <= mono_handling->minValue)
+ *p_out++ = mono_handling->look_up[0];
+ else if (mono >= mono_handling->maxValue)
+ *p_out++ = mono_handling->look_up[255];
+ else
+ {
+ scaled =
+ 1.0 +
+ (((double) mono -
+ mono_handling->minValue) / mono_handling->scaleFactor);
+ *p_out++ = mono_handling->look_up[(unsigned char) scaled];
+ }
+ }
+ else if (mono_handling->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE)
+ {
+ /* applying Stretching/Normalize */
+ if (mono <= mono_handling->minValue)
+ *p_out++ = 0;
+ else if (mono >= mono_handling->maxValue)
+ *p_out++ = 255;
+ else
+ {
+ scaled =
+ 1.0 +
+ (((double) mono -
+ mono_handling->minValue) / mono_handling->scaleFactor);
+ *p_out++ = (unsigned char) scaled;
+ }
+ }
+ else if (mono_handling->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM)
+ {
+ /* applying Histogram Equalization */
+ if (mono <= mono_handling->minValue)
+ *p_out++ = mono_handling->look_up[0];
+ else if (mono >= mono_handling->maxValue)
+ *p_out++ = mono_handling->look_up[255];
+ else
+ {
+ scaled =
+ 1.0 +
+ (((double) mono -
+ mono_handling->minValue) / mono_handling->scaleFactor);
+ *p_out++ = mono_handling->look_up[(unsigned char) scaled];
+ }
+ }
+ else
+ {
+ /* applying Trivial Normalization */
+ if (mono_handling->scaleFactor == 1.0)
+ *p_out++ = mono - mono_handling->minValue;
+ else
+ {
+ if (mono <= mono_handling->minValue)
+ *p_out++ = 0;
+ else if (mono >= mono_handling->maxValue)
+ *p_out++ = 255;
+ else
+ {
+ scaled =
+ 1.0 +
+ (((double) mono -
+ mono_handling->minValue) /
+ mono_handling->scaleFactor);
+ *p_out++ = (char) scaled;
+ }
+ }
+ }
+ return p_out;
+}
+
+static unsigned char *
+mono_int8_pixel_handler (const char *p_in, unsigned char *p_out,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* styling an opaque pixel - INT8 */
+ char mono = *(p_in + mono_band);
+ if (mono_handling->colorMap != NULL)
+ {
+ /* applying a ColorMap */
+ return apply_color_map ((double) mono, p_out, mono_handling);
+ }
+ return apply_contrast_enhancement ((double) mono, p_out, mono_handling);
+}
+
+static void
+copy_int8_raw_mono_pixels (const char *buffer,
+ const unsigned char *mask, unsigned char *outbuf,
+ unsigned short width, unsigned short height,
+ unsigned char out_num_bands, double x_res,
+ double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* copying INT8 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const char *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned char *p_out;
+ int ib;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_INT8)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out =
+ outbuf + (out_y * width * out_num_bands) +
+ (out_x * out_num_bands);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ else
+ {
+ /* opaque pixel */
+ p_out =
+ mono_int8_pixel_handler (p_in, p_out, mono_band,
+ mono_handling);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const char *p_save = p_in;
+ char sample = 0;
+ rl2_get_pixel_sample_int8 (no_data, &sample);
+ if (sample == *p_save++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ p_out =
+ mono_int8_pixel_handler (p_in, p_out, mono_band,
+ mono_handling);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ }
+ p_in++;
+ }
+ }
+}
+
+static void
+copy_uint8_raw_pixels (const unsigned char *buffer, const unsigned char *mask,
+ unsigned char *outbuf, unsigned short width,
+ unsigned short height, unsigned char num_bands,
+ double x_res, double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ unsigned short tile_width, unsigned short tile_height,
+ rl2PixelPtr no_data)
+{
+/* copying UINT8 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int b;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned char *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned char *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != num_bands)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_1_BIT || sample_type == RL2_SAMPLE_2_BIT
+ || sample_type == RL2_SAMPLE_4_BIT
+ || sample_type == RL2_SAMPLE_UINT8)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width * num_bands;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in += num_bands;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out =
+ outbuf + (out_y * width * num_bands) + (out_x * num_bands);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ for (b = 0; b < num_bands; b++)
+ {
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out++;
+ p_in++;
+ }
+ else
+ *p_out++ = *p_in++;
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned char *p_save = p_in;
+ for (b = 0; b < num_bands; b++)
+ {
+ unsigned char sample = 0;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ rl2_get_pixel_sample_1bit (no_data, &sample);
+ break;
+ case RL2_SAMPLE_2_BIT:
+ rl2_get_pixel_sample_2bit (no_data, &sample);
+ break;
+ case RL2_SAMPLE_4_BIT:
+ rl2_get_pixel_sample_4bit (no_data, &sample);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_get_pixel_sample_uint8 (no_data, b,
+ &sample);
+ break;
+ };
+ if (sample == *p_in++)
+ match++;
+ }
+ if (match != num_bands)
+ {
+ /* opaque pixel */
+ p_in = p_save;
+ for (b = 0; b < num_bands; b++)
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ for (b = 0; b < num_bands; b++)
+ p_out++;
+ }
+ }
+ }
+ }
+}
+
+static unsigned char *
+mono_uint8_pixel_handler (const unsigned char *p_in, unsigned char *p_out,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* styling an opaque pixel - UINT8 */
+ unsigned char mono = *(p_in + mono_band);
+ if (mono_handling->colorMap != NULL)
+ {
+ /* applying a ColorMap */
+ return apply_color_map ((double) mono, p_out, mono_handling);
+ }
+ return apply_contrast_enhancement ((double) mono, p_out, mono_handling);
+}
+
+static void
+copy_uint8_raw_selected_pixels (const unsigned char *buffer,
+ const unsigned char *mask,
+ unsigned char *outbuf, unsigned short width,
+ unsigned short height, unsigned char num_bands,
+ double x_res, double y_res, double minx,
+ double maxy, double tile_minx, double tile_maxy,
+ unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data,
+ unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band,
+ rl2BandHandlingPtr red_handling,
+ rl2BandHandlingPtr green_handling,
+ rl2BandHandlingPtr blue_handling)
+{
+/* copying UINT8 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int b;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned char *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned char *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != num_bands)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_UINT8)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width * num_bands;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in += num_bands;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = outbuf + (out_y * width * 3) + (out_x * 3);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out += 3;
+ }
+ else
+ {
+ /* opaque pixel */
+ p_out =
+ mono_uint8_pixel_handler (p_in, p_out, red_band,
+ red_handling);
+ p_out =
+ mono_uint8_pixel_handler (p_in, p_out,
+ green_band,
+ green_handling);
+ p_out =
+ mono_uint8_pixel_handler (p_in, p_out,
+ blue_band,
+ blue_handling);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned char *p_save = p_in;
+ for (b = 0; b < num_bands; b++)
+ {
+ unsigned char sample = 0;
+ rl2_get_pixel_sample_uint8 (no_data, b, &sample);
+ if (sample == *p_save++)
+ match++;
+ }
+ if (match != num_bands)
+ {
+ /* opaque pixel */
+ p_out =
+ mono_uint8_pixel_handler (p_in, p_out, red_band,
+ red_handling);
+ p_out =
+ mono_uint8_pixel_handler (p_in, p_out,
+ green_band,
+ green_handling);
+ p_out =
+ mono_uint8_pixel_handler (p_in, p_out,
+ blue_band,
+ blue_handling);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out += 3;
+ }
+ }
+ p_in += num_bands;
+ }
+ }
+}
+
+static void
+copy_uint8_raw_mono_pixels (const unsigned char *buffer,
+ const unsigned char *mask, unsigned char *outbuf,
+ unsigned short width, unsigned short height,
+ unsigned char out_num_bands,
+ unsigned char num_bands, double x_res, double y_res,
+ double minx, double maxy, double tile_minx,
+ double tile_maxy, unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* copying UINT8 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int b;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned char *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned char *p_out;
+ int ib;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != num_bands)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_UINT8)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width * num_bands;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in += num_bands;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out =
+ outbuf + (out_y * width * out_num_bands) +
+ (out_x * out_num_bands);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ else
+ {
+ /* opaque pixel */
+ p_out =
+ mono_uint8_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned char *p_save = p_in;
+ for (b = 0; b < num_bands; b++)
+ {
+ unsigned char sample = 0;
+ rl2_get_pixel_sample_uint8 (no_data, b, &sample);
+ if (sample == *p_save++)
+ match++;
+ }
+ if (match != num_bands)
+ {
+ /* opaque pixel */
+ p_out =
+ mono_uint8_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ }
+ p_in += num_bands;
+ }
+ }
+}
+
+static void
+copy_int16_raw_pixels (const short *buffer, const unsigned char *mask,
+ short *outbuf, unsigned short width,
+ unsigned short height, double x_res, double y_res,
+ double minx, double maxy, double tile_minx,
+ double tile_maxy, unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data)
+{
+/* copying INT16 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const short *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ short *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_INT16)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = outbuf + (out_y * width) + out_x;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out++;
+ p_in++;
+ }
+ else
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const short *p_save = p_in;
+ short sample = 0;
+ rl2_get_pixel_sample_int16 (no_data, &sample);
+ if (sample == *p_in++)
+ match = 1;
+ if (!match)
+ {
+ /* opaque pixel */
+ p_in = p_save;
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out++;
+ }
+ }
+ }
+ }
+}
+
+static unsigned char *
+mono_int16_pixel_handler (const short *p_in, unsigned char *p_out,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* styling an opaque pixel - INT16 */
+ short mono = *(p_in + mono_band);
+ if (mono_handling->colorMap != NULL)
+ {
+ /* applying a ColorMap */
+ return apply_color_map ((double) mono, p_out, mono_handling);
+ }
+ return apply_contrast_enhancement ((double) mono, p_out, mono_handling);
+}
+
+static void
+copy_int16_raw_mono_pixels (const short *buffer,
+ const unsigned char *mask, unsigned char *outbuf,
+ unsigned short width, unsigned short height,
+ unsigned char out_num_bands, double x_res,
+ double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* copying INT16 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const short *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned char *p_out;
+ int ib;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_INT16)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out =
+ outbuf + (out_y * width * out_num_bands) +
+ (out_x * out_num_bands);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ else
+ {
+ /* opaque pixel */
+ p_out =
+ mono_int16_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const short *p_save = p_in;
+ short sample = 0;
+ rl2_get_pixel_sample_int16 (no_data, &sample);
+ if (sample == *p_save++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ p_out =
+ mono_int16_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ }
+ p_in++;
+ }
+ }
+}
+
+static void
+copy_uint16_raw_pixels (const unsigned short *buffer, const unsigned char *mask,
+ unsigned short *outbuf, unsigned short width,
+ unsigned short height, unsigned char num_bands,
+ double x_res, double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ unsigned short tile_width, unsigned short tile_height,
+ rl2PixelPtr no_data)
+{
+/* copying UINT16 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int b;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned short *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned short *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != num_bands)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width * num_bands;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in += num_bands;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out =
+ outbuf + (out_y * width * num_bands) + (out_x * num_bands);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ for (b = 0; b < num_bands; b++)
+ {
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out++;
+ p_in++;
+ }
+ else
+ *p_out++ = *p_in++;
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned short *p_save = p_in;
+ for (b = 0; b < num_bands; b++)
+ {
+ unsigned short sample = 0;
+ rl2_get_pixel_sample_uint16 (no_data, b, &sample);
+ if (sample == *p_in++)
+ match++;
+ }
+ if (match != num_bands)
+ {
+ /* opaque pixel */
+ p_in = p_save;
+ for (b = 0; b < num_bands; b++)
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ for (b = 0; b < num_bands; b++)
+ p_out++;
+ }
+ }
+ }
+ }
+}
+
+static unsigned char *
+mono_uint16_pixel_handler (const unsigned short *p_in, unsigned char *p_out,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* styling an opaque pixel - UINT16 */
+ unsigned short mono = *(p_in + mono_band);
+ if (mono_handling->colorMap != NULL)
+ {
+ /* applying a ColorMap */
+ return apply_color_map ((double) mono, p_out, mono_handling);
+ }
+ return apply_contrast_enhancement ((double) mono, p_out, mono_handling);
+}
+
+static void
+copy_uint16_raw_selected_pixels (const unsigned short *buffer,
+ const unsigned char *mask,
+ unsigned char *outbuf, unsigned short width,
+ unsigned short height, unsigned char num_bands,
+ double x_res, double y_res, double minx,
+ double maxy, double tile_minx,
+ double tile_maxy, unsigned short tile_width,
+ unsigned short tile_height,
+ rl2PixelPtr no_data, unsigned char red_band,
+ unsigned char green_band,
+ unsigned char blue_band,
+ rl2BandHandlingPtr red_handling,
+ rl2BandHandlingPtr green_handling,
+ rl2BandHandlingPtr blue_handling)
+{
+/* copying UINT16 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int b;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned short *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned char *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != num_bands)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width * num_bands;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in += num_bands;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = outbuf + (out_y * width * 3) + (out_x * 3);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out += 3;
+ }
+ else
+ {
+ /* opaque pixel */
+ p_out =
+ mono_uint16_pixel_handler (p_in, p_out,
+ red_band,
+ red_handling);
+ p_out =
+ mono_uint16_pixel_handler (p_in, p_out,
+ green_band,
+ green_handling);
+ p_out =
+ mono_uint16_pixel_handler (p_in, p_out,
+ blue_band,
+ blue_handling);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned short *p_save = p_in;
+ for (b = 0; b < num_bands; b++)
+ {
+ unsigned short sample = 0;
+ rl2_get_pixel_sample_uint16 (no_data, b, &sample);
+ if (sample == *p_save++)
+ match++;
+ }
+ if (match != num_bands)
+ {
+ /* opaque pixel */
+ p_out =
+ mono_uint16_pixel_handler (p_in, p_out,
+ red_band,
+ red_handling);
+ p_out =
+ mono_uint16_pixel_handler (p_in, p_out,
+ green_band,
+ green_handling);
+ p_out =
+ mono_uint16_pixel_handler (p_in, p_out,
+ blue_band,
+ blue_handling);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out += 3;
+ }
+ }
+ p_in += num_bands;
+ }
+ }
+}
+
+static void
+copy_uint16_raw_mono_pixels (const unsigned short *buffer,
+ const unsigned char *mask, unsigned char *outbuf,
+ unsigned short width, unsigned short height,
+ unsigned char out_num_bands,
+ unsigned char num_bands, double x_res,
+ double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* copying UINT16 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int b;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned short *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned char *p_out;
+ int ib;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != num_bands)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width * num_bands;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in += num_bands;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out =
+ outbuf + (out_y * width * out_num_bands) +
+ (out_x * out_num_bands);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ else
+ {
+ /* opaque pixel */
+ p_out =
+ mono_uint16_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned short *p_save = p_in;
+ for (b = 0; b < num_bands; b++)
+ {
+ unsigned short sample = 0;
+ rl2_get_pixel_sample_uint16 (no_data, b, &sample);
+ if (sample == *p_save++)
+ match++;
+ }
+ if (match != num_bands)
+ {
+ /* opaque pixel */
+ p_out =
+ mono_uint16_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ }
+ p_in += num_bands;
+ }
+ }
+}
+
+static void
+copy_int32_raw_pixels (const int *buffer, const unsigned char *mask,
+ int *outbuf, unsigned short width,
+ unsigned short height, double x_res, double y_res,
+ double minx, double maxy, double tile_minx,
+ double tile_maxy, unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data)
+{
+/* copying INT32 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const int *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ int *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_INT32)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = outbuf + (out_y * width) + out_x;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out++;
+ p_in++;
+ }
+ else
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const int *p_save = p_in;
+ int sample = 0;
+ rl2_get_pixel_sample_int32 (no_data, &sample);
+ if (sample == *p_in++)
+ match = 1;
+ if (!match)
+ {
+ /* opaque pixel */
+ p_in = p_save;
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out++;
+ }
+ }
+ }
+ }
+}
+
+static unsigned char *
+mono_int32_pixel_handler (const int *p_in, unsigned char *p_out,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* styling an opaque pixel - INT32 */
+ int mono = *(p_in + mono_band);
+ if (mono_handling->colorMap != NULL)
+ {
+ /* applying a ColorMap */
+ return apply_color_map ((double) mono, p_out, mono_handling);
+ }
+ return apply_contrast_enhancement ((double) mono, p_out, mono_handling);
+}
+
+static void
+copy_int32_raw_mono_pixels (const int *buffer,
+ const unsigned char *mask, unsigned char *outbuf,
+ unsigned short width, unsigned short height,
+ unsigned char out_num_bands, double x_res,
+ double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* copying INT32 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const int *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned char *p_out;
+ int ib;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_INT32)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out =
+ outbuf + (out_y * width * out_num_bands) +
+ (out_x * out_num_bands);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ else
+ {
+ /* opaque pixel */
+ p_out =
+ mono_int32_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const int *p_save = p_in;
+ int sample = 0;
+ rl2_get_pixel_sample_int32 (no_data, &sample);
+ if (sample == *p_save++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ p_out =
+ mono_int32_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ }
+ p_in++;
+ }
+ }
+}
+
+static void
+copy_uint32_raw_pixels (const unsigned int *buffer, const unsigned char *mask,
+ unsigned int *outbuf, unsigned short width,
+ unsigned short height, double x_res, double y_res,
+ double minx, double maxy, double tile_minx,
+ double tile_maxy, unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data)
+{
+/* copying INT16 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned int *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned int *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_UINT32)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = outbuf + (out_y * width) + out_x;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out++;
+ p_in++;
+ }
+ else
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned int *p_save = p_in;
+ unsigned int sample = 0;
+ rl2_get_pixel_sample_uint32 (no_data, &sample);
+ if (sample == *p_in++)
+ match = 1;
+ if (!match)
+ {
+ /* opaque pixel */
+ p_in = p_save;
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out++;
+ }
+ }
+ }
+ }
+}
+
+static unsigned char *
+mono_uint32_pixel_handler (const unsigned int *p_in, unsigned char *p_out,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* styling an opaque pixel - UINT32 */
+ unsigned int mono = *(p_in + mono_band);
+ if (mono_handling->colorMap != NULL)
+ {
+ /* applying a ColorMap */
+ return apply_color_map ((double) mono, p_out, mono_handling);
+ }
+ return apply_contrast_enhancement ((double) mono, p_out, mono_handling);
+}
+
+static void
+copy_uint32_raw_mono_pixels (const unsigned int *buffer,
+ const unsigned char *mask, unsigned char *outbuf,
+ unsigned short width, unsigned short height,
+ unsigned char out_num_bands, double x_res,
+ double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* copying UINT32 raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const unsigned int *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned char *p_out;
+ int ib;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_UINT32)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out =
+ outbuf + (out_y * width * out_num_bands) +
+ (out_x * out_num_bands);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ else
+ {
+ /* opaque pixel */
+ p_out =
+ mono_uint32_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const unsigned int *p_save = p_in;
+ unsigned int sample = 0;
+ rl2_get_pixel_sample_uint32 (no_data, &sample);
+ if (sample == *p_save++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ p_out =
+ mono_uint32_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ }
+ p_in++;
+ }
+ }
+}
+
+static void
+copy_float_raw_pixels (const float *buffer, const unsigned char *mask,
+ float *outbuf, unsigned short width,
+ unsigned short height, double x_res, double y_res,
+ double minx, double maxy, double tile_minx,
+ double tile_maxy, unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data)
+{
+/* copying FLOAT raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const float *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ float *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_FLOAT)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = outbuf + (out_y * width) + out_x;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out++;
+ p_in++;
+ }
+ else
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const float *p_save = p_in;
+ float sample = 0;
+ rl2_get_pixel_sample_float (no_data, &sample);
+ if (sample == *p_in++)
+ match = 1;
+ if (!match)
+ {
+ /* opaque pixel */
+ p_in = p_save;
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out++;
+ }
+ }
+ }
+ }
+}
+
+static unsigned char *
+mono_float_pixel_handler (const float *p_in, unsigned char *p_out,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* styling an opaque pixel - FLOAT */
+ float mono = *(p_in + mono_band);
+ if (mono_handling->colorMap != NULL)
+ {
+ /* applying a ColorMap */
+ return apply_color_map ((double) mono, p_out, mono_handling);
+ }
+ return apply_contrast_enhancement ((double) mono, p_out, mono_handling);
+}
+
+static void
+copy_float_raw_mono_pixels (const float *buffer,
+ const unsigned char *mask, unsigned char *outbuf,
+ unsigned short width, unsigned short height,
+ unsigned char out_num_bands, double x_res,
+ double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* copying FLOAT raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const float *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned char *p_out;
+ int ib;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_FLOAT)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out =
+ outbuf + (out_y * width * out_num_bands) +
+ (out_x * out_num_bands);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ else
+ {
+ /* opaque pixel */
+ p_out =
+ mono_float_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ float sample = 0.0;
+ rl2_get_pixel_sample_float (no_data, &sample);
+ if (sample == *p_in)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ p_out =
+ mono_float_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ }
+ p_in++;
+ }
+ }
+}
+
+static void
+copy_double_raw_pixels (const double *buffer, const unsigned char *mask,
+ double *outbuf, unsigned short width,
+ unsigned short height, double x_res, double y_res,
+ double minx, double maxy, double tile_minx,
+ double tile_maxy, unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data)
+{
+/* copying DOUBLE raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const double *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ double *p_out;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_DOUBLE)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out = outbuf + (out_y * width) + out_x;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ p_out++;
+ p_in++;
+ }
+ else
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const double *p_save = p_in;
+ double sample = 0;
+ rl2_get_pixel_sample_double (no_data, &sample);
+ if (sample == *p_in++)
+ match = 1;
+ if (!match)
+ {
+ /* opaque pixel */
+ p_in = p_save;
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ p_out++;
+ }
+ }
+ }
+ }
+}
+
+static unsigned char *
+mono_double_pixel_handler (const double *p_in, unsigned char *p_out,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* styling an opaque pixel - DOUBLE */
+ double mono = *(p_in + mono_band);
+ if (mono_handling->colorMap != NULL)
+ {
+ /* applying a ColorMap */
+ return apply_color_map ((double) mono, p_out, mono_handling);
+ }
+ return apply_contrast_enhancement ((double) mono, p_out, mono_handling);
+}
+
+static void
+copy_double_raw_mono_pixels (const double *buffer,
+ const unsigned char *mask, unsigned char *outbuf,
+ unsigned short width, unsigned short height,
+ unsigned char out_num_bands, double x_res,
+ double y_res, double minx, double maxy,
+ double tile_minx, double tile_maxy,
+ unsigned short tile_width,
+ unsigned short tile_height, rl2PixelPtr no_data,
+ unsigned char mono_band,
+ rl2BandHandlingPtr mono_handling)
+{
+/* copying DOUBLE raw pixels from the DBMS tile into the output image */
+ int x;
+ int y;
+ int out_x;
+ int out_y;
+ double geo_x;
+ double geo_y;
+ const double *p_in = buffer;
+ const unsigned char *p_msk = mask;
+ unsigned char *p_out;
+ int ib;
+ int transparent;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char nbands;
+ int ignore_no_data = 1;
+ double y_res2 = y_res / 2.0;
+ double x_res2 = x_res / 2.0;
+
+ if (no_data != NULL)
+ {
+ ignore_no_data = 0;
+ if (rl2_get_pixel_type (no_data, &sample_type, &pixel_type, &nbands)
+ != RL2_OK)
+ ignore_no_data = 1;
+ if (nbands != 1)
+ ignore_no_data = 1;
+ if (sample_type == RL2_SAMPLE_DOUBLE)
+ ;
+ else
+ ignore_no_data = 1;
+ }
+
+ geo_y = tile_maxy + y_res2;
+ for (y = 0; y < tile_height; y++)
+ {
+ geo_y -= y_res;
+ out_y = (maxy - geo_y) / y_res;
+ if (out_y < 0 || out_y >= height)
+ {
+ p_in += tile_width;
+ if (p_msk != NULL)
+ p_msk += tile_width;
+ continue;
+ }
+ geo_x = tile_minx - x_res2;
+ for (x = 0; x < tile_width; x++)
+ {
+ geo_x += x_res;
+ out_x = (geo_x - minx) / x_res;
+ if (out_x < 0 || out_x >= width)
+ {
+ p_in++;
+ if (p_msk != NULL)
+ p_msk++;
+ continue;
+ }
+ p_out =
+ outbuf + (out_y * width * out_num_bands) +
+ (out_x * out_num_bands);
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent || ignore_no_data)
+ {
+ /* already transparent or missing NO-DATA value */
+ if (transparent)
+ {
+ /* skipping a transparent pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ else
+ {
+ /* opaque pixel */
+ p_out =
+ mono_double_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ }
+ else
+ {
+ /* testing for NO-DATA values */
+ int match = 0;
+ const double *p_save = p_in;
+ double sample = 0;
+ rl2_get_pixel_sample_double (no_data, &sample);
+ if (sample == *p_save++)
+ match++;
+ if (match != 1)
+ {
+ /* opaque pixel */
+ p_out =
+ mono_double_pixel_handler (p_in, p_out,
+ mono_band,
+ mono_handling);
+ }
+ else
+ {
+ /* NO-DATA pixel */
+ for (ib = 0; ib < out_num_bands; ib++)
+ p_out++;
+ }
+ }
+ p_in++;
+ }
+ }
+}
+
+static void
+compute_stretching (rl2PrivBandStatisticsPtr band, double *min, double *max,
+ double *scale_factor)
+{
+/* computing the Stretching/Normalize values */
+ int i;
+ double total;
+ double sum = 0.0;
+ double percentile_2;
+ double percentile_98;
+ double vmin;
+ double vmax;
+ double range;
+
+ for (i = 0; i < band->nHistogram; i++)
+ sum += *(band->histogram + i);
+ total = sum;
+ percentile_2 = (sum / 100.0) * 2.0;
+ percentile_98 = sum - percentile_2;
+
+ sum = 0.0;
+ for (i = 0; i < band->nHistogram; i++)
+ {
+ /* identifying the 2^ percentile */
+ if (sum >= percentile_2)
+ {
+ double r = (band->max - band->min) / 254.0;
+ vmin = band->min + ((double) i * r);
+ break;
+ }
+ sum += *(band->histogram + i);
+ }
+ sum = total;
+ for (i = band->nHistogram - 1; i >= 0; i--)
+ {
+ /* identifying the 98^ percentile */
+ if (sum <= percentile_98)
+ {
+ double r = (band->max - band->min) / 254.0;
+ vmax = band->min + ((double) i * r);
+ break;
+ }
+ sum -= *(band->histogram + i);
+ }
+ *min = vmin;
+ *max = vmax;
+ range = vmax - vmin;
+ *scale_factor = range / 254.0;
+}
+
+static void
+build_triple_band_handling (rl2PrivRasterStylePtr style,
+ rl2PrivRasterStatisticsPtr stats,
+ unsigned char red_band, unsigned char green_band,
+ unsigned char blue_band,
+ rl2BandHandlingPtr * red_handling,
+ rl2BandHandlingPtr * green_handling,
+ rl2BandHandlingPtr * blue_handling)
+{
+/* creating BandContrastEnhancement helper structs */
+ rl2BandHandlingPtr r = NULL;
+ rl2BandHandlingPtr g = NULL;
+ rl2BandHandlingPtr b = NULL;
+ rl2PrivBandStatisticsPtr band;
+ double range;
+ int i;
+ if (style->bandSelection != NULL)
+ {
+ /* attempting to use band specific settings */
+ if (style->bandSelection->selectionType == RL2_BAND_SELECTION_TRIPLE)
+ {
+ if (red_band < stats->nBands)
+ {
+ band = stats->band_stats + red_band;
+ if (style->bandSelection->redContrast ==
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE)
+ {
+ r = malloc (sizeof (rl2BandHandling));
+ r->colorMap = NULL;
+ r->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE;
+ compute_stretching (band, &(r->minValue),
+ &(r->maxValue),
+ &(r->scaleFactor));
+ }
+ else if (style->bandSelection->redContrast ==
+ RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ r = malloc (sizeof (rl2BandHandling));
+ r->colorMap = NULL;
+ r->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_GAMMA;
+ r->minValue = band->min;
+ r->maxValue = band->max;
+ range = band->max - band->min;
+ r->scaleFactor = range / 254.0;
+ r->look_up[0] = 0;
+ for (i = 1; i < 255; i++)
+ r->look_up[i] =
+ (unsigned
+ char) (pow ((double) i / 254.0,
+ 1.0 /
+ style->bandSelection->
+ redGamma) * 254 + 0.5);
+ r->look_up[255] = 255;
+ }
+ else if (style->bandSelection->redContrast ==
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM)
+ {
+ int j;
+ double count = 0.0;
+ double sum;
+ double his[256];
+ r = malloc (sizeof (rl2BandHandling));
+ r->colorMap = NULL;
+ r->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM;
+ r->minValue = band->min;
+ r->maxValue = band->max;
+ range = band->max - band->min;
+ r->scaleFactor = range / 254.0;
+ r->look_up[0] = 0;
+ for (i = 1; i < 256; i++)
+ count += *(band->histogram + i);
+ for (i = 1; i < 256; i++)
+ his[i] = *(band->histogram + i) / count;
+ for (i = 1; i < 256; i++)
+ {
+ sum = 0.0;
+ for (j = 1; j <= i; j++)
+ sum += his[j];
+ r->look_up[i] =
+ (unsigned char) (254.0 * sum + 0.5);
+ r->look_up[255] = 255;
+ }
+ }
+ }
+ if (green_band < stats->nBands)
+ {
+ band = stats->band_stats + green_band;
+ if (style->bandSelection->greenContrast ==
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE)
+ {
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE;
+ compute_stretching (band, &(g->minValue),
+ &(g->maxValue),
+ &(g->scaleFactor));
+ }
+ else if (style->bandSelection->greenContrast ==
+ RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_GAMMA;
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 254.0;
+ g->look_up[0] = 0;
+ for (i = 1; i < 255; i++)
+ g->look_up[i] =
+ (unsigned
+ char) (pow ((double) i / 254.0,
+ 1.0 /
+ style->bandSelection->
+ greenGamma) * 254 + 0.5);
+ g->look_up[255] = 255;
+ }
+ else if (style->bandSelection->greenContrast ==
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM)
+ {
+ int j;
+ double count = 0.0;
+ double sum;
+ double his[256];
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM;
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 254.0;
+ g->look_up[0] = 0;
+ for (i = 1; i < 256; i++)
+ count += *(band->histogram + i);
+ for (i = 1; i < 256; i++)
+ his[i] = *(band->histogram + i) / count;
+ for (i = 1; i < 256; i++)
+ {
+ sum = 0.0;
+ for (j = 1; j <= i; j++)
+ sum += his[j];
+ g->look_up[i] =
+ (unsigned char) (254.0 * sum + 0.5);
+ g->look_up[255] = 255;
+ }
+ }
+ }
+ if (blue_band < stats->nBands)
+ {
+ band = stats->band_stats + blue_band;
+ if (style->bandSelection->blueContrast ==
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE)
+ {
+ b = malloc (sizeof (rl2BandHandling));
+ b->colorMap = NULL;
+ b->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE;
+ compute_stretching (band, &(b->minValue),
+ &(b->maxValue),
+ &(b->scaleFactor));
+ }
+ else if (style->bandSelection->blueContrast ==
+ RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ b = malloc (sizeof (rl2BandHandling));
+ b->colorMap = NULL;
+ b->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_GAMMA;
+ b->minValue = band->min;
+ b->maxValue = band->max;
+ range = band->max - band->min;
+ b->scaleFactor = range / 254.0;
+ b->look_up[0] = 0;
+ for (i = 1; i < 255; i++)
+ b->look_up[i] =
+ (unsigned
+ char) (pow ((double) i / 254.0,
+ 1.0 /
+ style->bandSelection->
+ blueGamma) * 254 + 0.5);
+ b->look_up[255] = 255;
+ }
+ else if (style->bandSelection->blueContrast ==
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM)
+ {
+ int j;
+ double count = 0.0;
+ double sum;
+ double his[256];
+ b = malloc (sizeof (rl2BandHandling));
+ b->colorMap = NULL;
+ b->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM;
+ b->minValue = band->min;
+ b->maxValue = band->max;
+ range = band->max - band->min;
+ b->scaleFactor = range / 254.0;
+ b->look_up[0] = 0;
+ for (i = 1; i < 256; i++)
+ count += *(band->histogram + i);
+ for (i = 1; i < 256; i++)
+ his[i] = *(band->histogram + i) / count;
+ for (i = 1; i < 256; i++)
+ {
+ sum = 0.0;
+ for (j = 1; j <= i; j++)
+ sum += his[j];
+ b->look_up[i] =
+ (unsigned char) (254.0 * sum + 0.5);
+ }
+ b->look_up[255] = 255;
+ }
+ }
+ }
+ }
+ if (r == NULL)
+ {
+ /* using overall settings */
+ if (red_band < stats->nBands)
+ {
+ band = stats->band_stats + red_band;
+ if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE)
+ {
+ r = malloc (sizeof (rl2BandHandling));
+ r->colorMap = NULL;
+ r->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE;
+ compute_stretching (band, &(r->minValue), &(r->maxValue),
+ &(r->scaleFactor));
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_NONE)
+ {
+ r = malloc (sizeof (rl2BandHandling));
+ r->colorMap = NULL;
+ r->contrastEnhancement = RL2_CONTRAST_ENHANCEMENT_NONE;
+ if (band->min >= 0.0 && band->max <= 255.0)
+ {
+ r->minValue = 0.0;
+ r->maxValue = 255.0;
+ r->scaleFactor = 1.0;
+ }
+ else
+ {
+ r->minValue = band->min;
+ r->maxValue = band->max;
+ range = band->max - band->min;
+ r->scaleFactor = range / 254.0;
+ }
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ r = malloc (sizeof (rl2BandHandling));
+ r->colorMap = NULL;
+ r->contrastEnhancement = RL2_CONTRAST_ENHANCEMENT_GAMMA;
+ r->minValue = band->min;
+ r->maxValue = band->max;
+ range = band->max - band->min;
+ r->scaleFactor = range / 254.0;
+ r->look_up[0] = 0;
+ for (i = 1; i < 255; i++)
+ r->look_up[i] =
+ (unsigned
+ char) (pow ((double) i / 254.0,
+ 1.0 / style->gammaValue) * 254 +
+ 0.5);
+ r->look_up[255] = 255;
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM)
+ {
+ int j;
+ double count = 0.0;
+ double sum;
+ double his[256];
+ r = malloc (sizeof (rl2BandHandling));
+ r->colorMap = NULL;
+ r->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM;
+ r->minValue = band->min;
+ r->maxValue = band->max;
+ range = band->max - band->min;
+ r->scaleFactor = range / 254.0;
+ r->look_up[0] = 0;
+ for (i = 1; i < 256; i++)
+ count += *(band->histogram + i);
+ for (i = 1; i < 256; i++)
+ his[i] = *(band->histogram + i) / count;
+ for (i = 1; i < 256; i++)
+ {
+ sum = 0.0;
+ for (j = 1; j <= i; j++)
+ sum += his[j];
+ r->look_up[i] = (unsigned char) (254.0 * sum + 0.5);
+ }
+ r->look_up[255] = 255;
+ }
+ }
+ }
+ if (g == NULL)
+ {
+ /* using overall settings */
+ if (green_band < stats->nBands)
+ {
+ band = stats->band_stats + green_band;
+ if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE)
+ {
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE;
+ compute_stretching (band, &(g->minValue), &(g->maxValue),
+ &(g->scaleFactor));
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_NONE)
+ {
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement = RL2_CONTRAST_ENHANCEMENT_NONE;
+ if (band->min >= 0.0 && band->max <= 255.0)
+ {
+ g->minValue = 0.0;
+ g->maxValue = 255.0;
+ g->scaleFactor = 1.0;
+ }
+ else
+ {
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 254.0;
+ }
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement = RL2_CONTRAST_ENHANCEMENT_GAMMA;
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 254.0;
+ g->look_up[0] = 0;
+ for (i = 1; i < 255; i++)
+ g->look_up[i] =
+ (unsigned
+ char) (pow ((double) i / 254.0,
+ 1.0 / style->gammaValue) * 254 +
+ 0.5);
+ g->look_up[255] = 255;
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM)
+ {
+ int j;
+ double count = 0.0;
+ double sum;
+ double his[256];
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM;
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 254.0;
+ g->look_up[0] = 0;
+ for (i = 1; i < 256; i++)
+ count += *(band->histogram + i);
+ for (i = 1; i < 256; i++)
+ his[i] = *(band->histogram + i) / count;
+ for (i = 1; i < 256; i++)
+ {
+ sum = 0.0;
+ for (j = 1; j <= i; j++)
+ sum += his[j];
+ g->look_up[i] = (unsigned char) (254.0 * sum + 0.5);
+ }
+ g->look_up[255] = 255;
+ }
+ }
+ }
+ if (b == NULL)
+ {
+ /* using overall settings */
+ if (blue_band < stats->nBands)
+ {
+ band = stats->band_stats + blue_band;
+ if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE)
+ {
+ b = malloc (sizeof (rl2BandHandling));
+ b->colorMap = NULL;
+ b->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE;
+ compute_stretching (band, &(b->minValue), &(b->maxValue),
+ &(b->scaleFactor));
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_NONE)
+ {
+ b = malloc (sizeof (rl2BandHandling));
+ b->colorMap = NULL;
+ b->contrastEnhancement = RL2_CONTRAST_ENHANCEMENT_NONE;
+ if (band->min >= 0.0 && band->max <= 255.0)
+ {
+ b->minValue = 0.0;
+ b->maxValue = 255.0;
+ b->scaleFactor = 1.0;
+ }
+ else
+ {
+ b->minValue = band->min;
+ b->maxValue = band->max;
+ range = band->max - band->min;
+ b->scaleFactor = range / 254.0;
+ }
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ b = malloc (sizeof (rl2BandHandling));
+ b->colorMap = NULL;
+ b->contrastEnhancement = RL2_CONTRAST_ENHANCEMENT_GAMMA;
+ b->minValue = band->min;
+ b->maxValue = band->max;
+ range = band->max - band->min;
+ b->scaleFactor = range / 254.0;
+ b->look_up[0] = 0;
+ for (i = 1; i < 255; i++)
+ b->look_up[i] =
+ (unsigned
+ char) (pow ((double) i / 254.0,
+ 1.0 / style->gammaValue) * 254 +
+ 0.5);
+ b->look_up[255] = 255;
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM)
+ {
+ int j;
+ double count = 0.0;
+ double sum;
+ double his[256];
+ b = malloc (sizeof (rl2BandHandling));
+ b->colorMap = NULL;
+ b->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM;
+ b->minValue = band->min;
+ b->maxValue = band->max;
+ range = band->max - band->min;
+ b->scaleFactor = range / 254.0;
+ b->look_up[0] = 0;
+ for (i = 1; i < 256; i++)
+ count += *(band->histogram + i);
+ for (i = 1; i < 256; i++)
+ his[i] = *(band->histogram + i) / count;
+ for (i = 1; i < 256; i++)
+ {
+ sum = 0.0;
+ for (j = 1; j <= i; j++)
+ sum += his[j];
+ b->look_up[i] = (unsigned char) (254.0 * sum + 0.5);
+ }
+ b->look_up[255] = 255;
+ }
+ }
+ }
+ *red_handling = r;
+ *green_handling = g;
+ *blue_handling = b;
+}
+
+static void
+add_color_rule (rl2ColorMapItemPtr c, rl2ColorMapRefPtr col)
+{
+/* appending a color rule to the look-up table enty */
+ rl2ColorMapRefPtr rule = malloc (sizeof (rl2ColorMapRef));
+ rule->min = col->min;
+ rule->max = col->max;
+ rule->red = col->red;
+ rule->green = col->green;
+ rule->blue = col->blue;
+ rule->maxRed = col->maxRed;
+ rule->maxGreen = col->maxGreen;
+ rule->maxBlue = col->maxBlue;
+ rule->next = NULL;
+ if (c->first == NULL)
+ c->first = rule;
+ if (c->last != NULL)
+ c->last->next = rule;
+ c->last = rule;
+}
+
+static void
+build_mono_band_handling (rl2PrivRasterStylePtr style,
+ rl2PrivRasterStatisticsPtr stats,
+ unsigned char mono_band,
+ rl2BandHandlingPtr * mono_handling)
+{
+/* creating BandContrastEnhancement helper structs */
+ rl2BandHandlingPtr g = NULL;
+ rl2PrivBandStatisticsPtr band;
+ double range;
+ int i;
+ rl2PrivColorMapPointPtr color;
+ rl2PrivColorMapPointPtr prev_color;
+ if (style->categorize != NULL)
+ {
+ /* using the Categorize ColorMap */
+ band = stats->band_stats + mono_band;
+ g = malloc (sizeof (rl2BandHandling));
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 256.0;
+ g->colorMap = malloc (sizeof (rl2ColorMapLocator));
+ g->colorMap->interpolate = 0;
+ for (i = 0; i < 256; i++)
+ {
+ rl2ColorMapItemPtr c = &(g->colorMap->look_up[i]);
+ c->first = NULL;
+ c->last = NULL;
+ }
+ g->colorMap->red = style->categorize->dfltRed;
+ g->colorMap->green = style->categorize->dfltGreen;
+ g->colorMap->blue = style->categorize->dfltBlue;
+ color = style->categorize->first;
+ prev_color = NULL;
+ while (color != NULL)
+ {
+ rl2ColorMapRef col;
+ if (prev_color == NULL)
+ {
+ /* first category */
+ col.min = 0.0 - DBL_MAX;
+ col.max = color->value;
+ col.red = style->categorize->baseRed;
+ col.green = style->categorize->baseGreen;
+ col.blue = style->categorize->baseBlue;
+ for (i = 0; i < 256; i++)
+ {
+ rl2ColorMapItemPtr c = &(g->colorMap->look_up[i]);
+ double v1 =
+ band->min + ((double) i * g->scaleFactor);
+ double v2 =
+ band->min + ((double) (i + 1) * g->scaleFactor);
+ if ((v1 >= col.min && v1 < col.max)
+ || (v2 >= col.min && v2 < col.max)
+ || (col.min >= v1 && col.min < v2)
+ || (col.max >= v2 && col.max < v2))
+ add_color_rule (c, &col);
+ }
+ }
+ else
+ {
+ /* any other category */
+ col.min = prev_color->value;
+ col.max = color->value;
+ col.red = prev_color->red;
+ col.green = prev_color->green;
+ col.blue = prev_color->blue;
+ for (i = 0; i < 256; i++)
+ {
+ rl2ColorMapItemPtr c = &(g->colorMap->look_up[i]);
+ double v1 =
+ band->min + ((double) i * g->scaleFactor);
+ double v2 =
+ band->min + ((double) (i + 1) * g->scaleFactor);
+ if ((v1 >= col.min && v1 < col.max)
+ || (v2 >= col.min && v2 < col.max)
+ || (col.min >= v1 && col.min < v2)
+ || (col.max >= v2 && col.max < v2))
+ add_color_rule (c, &col);
+ }
+ }
+ if (color->next == NULL)
+ {
+ /* last category */
+ col.min = color->value;
+ col.max = DBL_MAX;
+ col.red = color->red;
+ col.green = color->green;
+ col.blue = color->blue;
+ for (i = 0; i < 256; i++)
+ {
+ rl2ColorMapItemPtr c = &(g->colorMap->look_up[i]);
+ double v1 =
+ band->min + ((double) i * g->scaleFactor);
+ double v2 =
+ band->min + ((double) (i + 1) * g->scaleFactor);
+ if ((v1 >= col.min && v1 < col.max)
+ || (v2 >= col.min && v2 < col.max)
+ || (col.min >= v1 && col.min < v2)
+ || (col.max >= v2 && col.max < v2))
+ add_color_rule (c, &col);
+ }
+ }
+ prev_color = color;
+ color = color->next;
+ }
+ *mono_handling = g;
+ return;
+ }
+ if (style->interpolate != NULL)
+ {
+ /* using the Interpolate ColorMap */
+ band = stats->band_stats + mono_band;
+ g = malloc (sizeof (rl2BandHandling));
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 256.0;
+ g->colorMap = malloc (sizeof (rl2ColorMapLocator));
+ g->colorMap->interpolate = 1;
+ for (i = 0; i < 256; i++)
+ {
+ rl2ColorMapItemPtr c = &(g->colorMap->look_up[i]);
+ c->first = NULL;
+ c->last = NULL;
+ }
+ g->colorMap->red = style->interpolate->dfltRed;
+ g->colorMap->green = style->interpolate->dfltGreen;
+ g->colorMap->blue = style->interpolate->dfltBlue;
+ color = style->interpolate->first;
+ prev_color = NULL;
+ while (color != NULL)
+ {
+ rl2ColorMapRef col;
+ if (prev_color != NULL)
+ {
+ col.min = prev_color->value;
+ col.max = color->value;
+ col.red = prev_color->red;
+ col.green = prev_color->green;
+ col.blue = prev_color->blue;
+ col.maxRed = color->red;
+ col.maxGreen = color->green;
+ col.maxBlue = color->blue;
+ for (i = 0; i < 256; i++)
+ {
+ rl2ColorMapItemPtr c = &(g->colorMap->look_up[i]);
+ double v1 =
+ band->min + ((double) i * g->scaleFactor);
+ double v2 =
+ band->min + ((double) (i + 1) * g->scaleFactor);
+ if ((v1 >= col.min && v1 < col.max)
+ || (v2 >= col.min && v2 < col.max)
+ || (col.min >= v1 && col.min < v2)
+ || (col.max >= v2 && col.max < v2))
+ add_color_rule (c, &col);
+ }
+ }
+ prev_color = color;
+ color = color->next;
+ }
+ *mono_handling = g;
+ return;
+ }
+
+ if (style->bandSelection != NULL)
+ {
+ /* attempting to use band specific settings */
+ if (style->bandSelection->selectionType == RL2_BAND_SELECTION_MONO)
+ {
+ if (mono_band < stats->nBands)
+ {
+ band = stats->band_stats + mono_band;
+ if (style->bandSelection->grayContrast ==
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE)
+ {
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE;
+ compute_stretching (band, &(g->minValue),
+ &(g->maxValue),
+ &(g->scaleFactor));
+ }
+ else if (style->bandSelection->grayContrast ==
+ RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_GAMMA;
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 254.0;
+ g->colorMap = NULL;
+ g->look_up[0] = 0;
+ for (i = 1; i < 255; i++)
+ g->look_up[i] =
+ (unsigned
+ char) (pow ((double) i / 254.0,
+ 1.0 /
+ style->bandSelection->
+ grayGamma) * 254 + 0.5);
+ g->look_up[255] = 255;
+ }
+ else if (style->bandSelection->grayContrast ==
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM)
+ {
+ int j;
+ double count = 0.0;
+ double sum;
+ double his[256];
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM;
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 254.0;
+ g->look_up[0] = 0;
+ for (i = 1; i < 256; i++)
+ count += *(band->histogram + i);
+ for (i = 1; i < 256; i++)
+ his[i] = *(band->histogram + i) / count;
+ for (i = 1; i < 256; i++)
+ {
+ sum = 0.0;
+ for (j = 1; j <= i; j++)
+ sum += his[j];
+ g->look_up[i] =
+ (unsigned char) (254.0 * sum + 0.5);
+ }
+ g->look_up[255] = 255;
+ }
+ }
+ }
+ }
+ if (g == NULL)
+ {
+ /* using overall settings */
+ if (mono_band < stats->nBands)
+ {
+ band = stats->band_stats + mono_band;
+ if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE)
+ {
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE;
+ compute_stretching (band, &(g->minValue), &(g->maxValue),
+ &(g->scaleFactor));
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_NONE)
+ {
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement = RL2_CONTRAST_ENHANCEMENT_NONE;
+ if (band->min >= 0.0 && band->max <= 255.0)
+ {
+ g->minValue = 0.0;
+ g->maxValue = 255.0;
+ g->scaleFactor = 1.0;
+ }
+ else
+ {
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 254.0;
+ g->colorMap = NULL;
+ }
+ g->colorMap = NULL;
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement = RL2_CONTRAST_ENHANCEMENT_GAMMA;
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 254.0;
+ g->colorMap = NULL;
+ g->look_up[0] = 0;
+ for (i = 1; i < 255; i++)
+ g->look_up[i] =
+ (unsigned
+ char) (pow ((double) i / 254.0,
+ 1.0 / style->gammaValue) * 254 +
+ 0.5);
+ g->look_up[255] = 255;
+ }
+ else if (style->contrastEnhancement ==
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM)
+ {
+ int j;
+ double count = 0.0;
+ double sum;
+ double his[256];
+ g = malloc (sizeof (rl2BandHandling));
+ g->colorMap = NULL;
+ g->contrastEnhancement =
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM;
+ g->minValue = band->min;
+ g->maxValue = band->max;
+ range = band->max - band->min;
+ g->scaleFactor = range / 254.0;
+ g->look_up[0] = 0;
+ for (i = 1; i < 256; i++)
+ count += *(band->histogram + i);
+ for (i = 1; i < 256; i++)
+ his[i] = *(band->histogram + i) / count;
+ for (i = 1; i < 256; i++)
+ {
+ sum = 0.0;
+ for (j = 1; j <= i; j++)
+ sum += his[j];
+ g->look_up[i] = (unsigned char) (254.0 * sum + 0.5);
+ }
+ g->look_up[255] = 255;
+ }
+ }
+ }
+ *mono_handling = g;
+}
+
+static void
+destroy_mono_handling (rl2BandHandlingPtr mono)
+{
+/* memory cleanup - destroying a MONO handler */
+ if (mono == NULL)
+ return;
+ if (mono->colorMap != NULL)
+ {
+ int i;
+ for (i = 0; i < 256; i++)
+ {
+ rl2ColorMapRefPtr rule;
+ rl2ColorMapRefPtr n_rule;
+ rl2ColorMapItemPtr item = &(mono->colorMap->look_up[i]);
+ rule = item->first;
+ while (rule != NULL)
+ {
+ n_rule = rule->next;
+ free (rule);
+ rule = n_rule;
+ }
+ }
+ free (mono->colorMap);
+ }
+ free (mono);
+}
+
+RL2_PRIVATE int
+copy_raw_pixels (rl2RasterPtr raster, unsigned char *outbuf,
+ unsigned int width,
+ unsigned int height, unsigned char sample_type,
+ unsigned char num_bands, double x_res, double y_res,
+ double minx, double maxy, double tile_minx, double tile_maxy,
+ rl2PixelPtr no_data, rl2RasterStylePtr style,
+ rl2RasterStatisticsPtr stats)
+{
+/* copying raw pixels into the output buffer */
+ unsigned int tile_width;
+ unsigned int tile_height;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) raster;
+
+ if (rl2_get_raster_size (raster, &tile_width, &tile_height) != RL2_OK)
+ return 0;
+ if (style != NULL && stats != NULL)
+ {
+ /* attempting to apply a RasterSymbolizer */
+ int yes_no;
+ if (rl2_is_raster_style_triple_band_selected (style, &yes_no) ==
+ RL2_OK)
+ {
+ if ((rst->sampleType == RL2_SAMPLE_UINT8
+ || rst->sampleType == RL2_SAMPLE_UINT16)
+ && (rst->pixelType == RL2_PIXEL_RGB
+ || rst->pixelType == RL2_PIXEL_MULTIBAND) && yes_no)
+ {
+ /* triple band selection - false color RGB */
+ unsigned char red_band;
+ unsigned char green_band;
+ unsigned char blue_band;
+ rl2BandHandlingPtr red_handling = NULL;
+ rl2BandHandlingPtr green_handling = NULL;
+ rl2BandHandlingPtr blue_handling = NULL;
+ if (rl2_get_raster_style_triple_band_selection
+ (style, &red_band, &green_band, &blue_band) != RL2_OK)
+ return 0;
+ if (red_band >= rst->nBands)
+ return 0;
+ if (green_band >= rst->nBands)
+ return 0;
+ if (blue_band >= rst->nBands)
+ return 0;
+ build_triple_band_handling ((rl2PrivRasterStylePtr) style,
+ (rl2PrivRasterStatisticsPtr)
+ stats, red_band, green_band,
+ blue_band, &red_handling,
+ &green_handling,
+ &blue_handling);
+ if (red_handling == NULL || green_handling == NULL
+ || blue_handling == NULL)
+ return 0;
+ switch (rst->sampleType)
+ {
+ case RL2_SAMPLE_UINT8:
+ copy_uint8_raw_selected_pixels ((const unsigned char
+ *)
+ (rst->rasterBuffer),
+ (const unsigned char
+ *)
+ (rst->maskBuffer),
+ (unsigned char *)
+ outbuf, width,
+ height, rst->nBands,
+ x_res, y_res, minx,
+ maxy, tile_minx,
+ tile_maxy,
+ tile_width,
+ tile_height,
+ no_data, red_band,
+ green_band,
+ blue_band,
+ red_handling,
+ green_handling,
+ blue_handling);
+ if (red_handling != NULL)
+ free (red_handling);
+ if (green_handling != NULL)
+ free (green_handling);
+ if (blue_handling != NULL)
+ free (blue_handling);
+ return 1;
+ case RL2_SAMPLE_UINT16:
+ copy_uint16_raw_selected_pixels ((const unsigned
+ short
+ *)
+ (rst->rasterBuffer),
+ (const unsigned
+ char
+ *)
+ (rst->maskBuffer),
+ (unsigned char *)
+ outbuf, width,
+ height,
+ rst->nBands, x_res,
+ y_res, minx, maxy,
+ tile_minx,
+ tile_maxy,
+ tile_width,
+ tile_height,
+ no_data, red_band,
+ green_band,
+ blue_band,
+ red_handling,
+ green_handling,
+ blue_handling);
+ if (red_handling != NULL)
+ free (red_handling);
+ if (green_handling != NULL)
+ free (green_handling);
+ if (blue_handling != NULL)
+ free (blue_handling);
+ return 1;
+ };
+ }
+ }
+ if (rl2_is_raster_style_mono_band_selected (style, &yes_no) == RL2_OK)
+ {
+ if (((rst->sampleType == RL2_SAMPLE_UINT8
+ || rst->sampleType == RL2_SAMPLE_UINT16)
+ || rst->pixelType == RL2_PIXEL_DATAGRID) && yes_no)
+ {
+ /* mono band selection - false color Grayscale */
+ unsigned char mono_band;
+ rl2BandHandlingPtr mono_handling = NULL;
+ if (rl2_get_raster_style_mono_band_selection
+ (style, &mono_band) != RL2_OK)
+ return 0;
+ if (mono_band >= rst->nBands)
+ return 0;
+ build_mono_band_handling ((rl2PrivRasterStylePtr) style,
+ (rl2PrivRasterStatisticsPtr)
+ stats, mono_band,
+ &mono_handling);
+ if (mono_handling == NULL)
+ return 0;
+ switch (rst->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ copy_int8_raw_mono_pixels ((const char
+ *) (rst->rasterBuffer),
+ (const unsigned char
+ *) (rst->maskBuffer),
+ (unsigned char *) outbuf,
+ width, height, num_bands,
+ x_res, y_res, minx, maxy,
+ tile_minx, tile_maxy,
+ tile_width, tile_height,
+ no_data, mono_band,
+ mono_handling);
+ if (mono_handling != NULL)
+ destroy_mono_handling (mono_handling);
+ return 1;
+ case RL2_SAMPLE_UINT8:
+ copy_uint8_raw_mono_pixels ((const unsigned char
+ *) (rst->rasterBuffer),
+ (const unsigned char
+ *) (rst->maskBuffer),
+ (unsigned char *)
+ outbuf, width, height,
+ num_bands, rst->nBands,
+ x_res, y_res, minx,
+ maxy, tile_minx,
+ tile_maxy, tile_width,
+ tile_height, no_data,
+ mono_band,
+ mono_handling);
+ if (mono_handling != NULL)
+ destroy_mono_handling (mono_handling);
+ return 1;
+ case RL2_SAMPLE_INT16:
+ copy_int16_raw_mono_pixels ((const short
+ *) (rst->rasterBuffer),
+ (const unsigned char
+ *) (rst->maskBuffer),
+ (unsigned char *)
+ outbuf, width, height,
+ num_bands, x_res, y_res,
+ minx, maxy, tile_minx,
+ tile_maxy, tile_width,
+ tile_height, no_data,
+ mono_band,
+ mono_handling);
+ if (mono_handling != NULL)
+ destroy_mono_handling (mono_handling);
+ return 1;
+ case RL2_SAMPLE_UINT16:
+ copy_uint16_raw_mono_pixels ((const unsigned short
+ *)
+ (rst->rasterBuffer),
+ (const unsigned char
+ *) (rst->maskBuffer),
+ (unsigned char *)
+ outbuf, width, height,
+ num_bands, rst->nBands,
+ x_res, y_res, minx,
+ maxy, tile_minx,
+ tile_maxy, tile_width,
+ tile_height, no_data,
+ mono_band,
+ mono_handling);
+ if (mono_handling != NULL)
+ destroy_mono_handling (mono_handling);
+ return 1;
+ case RL2_SAMPLE_INT32:
+ copy_int32_raw_mono_pixels ((const int
+ *) (rst->rasterBuffer),
+ (const unsigned char
+ *) (rst->maskBuffer),
+ (unsigned char *)
+ outbuf, width, height,
+ num_bands, x_res, y_res,
+ minx, maxy, tile_minx,
+ tile_maxy, tile_width,
+ tile_height, no_data,
+ mono_band,
+ mono_handling);
+ if (mono_handling != NULL)
+ destroy_mono_handling (mono_handling);
+ return 1;
+ case RL2_SAMPLE_UINT32:
+ copy_uint32_raw_mono_pixels ((const unsigned int
+ *)
+ (rst->rasterBuffer),
+ (const unsigned char
+ *) (rst->maskBuffer),
+ (unsigned char *)
+ outbuf, width, height,
+ num_bands, x_res,
+ y_res, minx, maxy,
+ tile_minx, tile_maxy,
+ tile_width,
+ tile_height, no_data,
+ mono_band,
+ mono_handling);
+ if (mono_handling != NULL)
+ destroy_mono_handling (mono_handling);
+ return 1;
+ case RL2_SAMPLE_FLOAT:
+ copy_float_raw_mono_pixels ((const float
+ *) (rst->rasterBuffer),
+ (const unsigned char
+ *) (rst->maskBuffer),
+ (unsigned char *)
+ outbuf, width, height,
+ num_bands, x_res, y_res,
+ minx, maxy, tile_minx,
+ tile_maxy, tile_width,
+ tile_height, no_data,
+ mono_band,
+ mono_handling);
+ if (mono_handling != NULL)
+ destroy_mono_handling (mono_handling);
+ return 1;
+ case RL2_SAMPLE_DOUBLE:
+ copy_double_raw_mono_pixels ((const double
+ *)
+ (rst->rasterBuffer),
+ (const unsigned char
+ *) (rst->maskBuffer),
+ (unsigned char *)
+ outbuf, width, height,
+ num_bands, x_res,
+ y_res, minx, maxy,
+ tile_minx, tile_maxy,
+ tile_width,
+ tile_height, no_data,
+ mono_band,
+ mono_handling);
+ if (mono_handling != NULL)
+ destroy_mono_handling (mono_handling);
+ return 1;
+ };
+ }
+ }
+ }
+
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ copy_int8_raw_pixels ((const char *) (rst->rasterBuffer),
+ (const unsigned char *) (rst->maskBuffer),
+ (char *) outbuf, width, height,
+ x_res, y_res, minx, maxy, tile_minx,
+ tile_maxy, tile_width, tile_height, no_data);
+ return 1;
+ case RL2_SAMPLE_INT16:
+ copy_int16_raw_pixels ((const short *) (rst->rasterBuffer),
+ (const unsigned char *) (rst->maskBuffer),
+ (short *) outbuf, width, height,
+ x_res, y_res, minx, maxy, tile_minx,
+ tile_maxy, tile_width, tile_height, no_data);
+ return 1;
+ case RL2_SAMPLE_UINT16:
+ copy_uint16_raw_pixels ((const unsigned short *) (rst->rasterBuffer),
+ (const unsigned char *) (rst->maskBuffer),
+ (unsigned short *) outbuf, width, height,
+ num_bands, x_res, y_res, minx, maxy,
+ tile_minx, tile_maxy, tile_width,
+ tile_height, no_data);
+ return 1;
+ case RL2_SAMPLE_INT32:
+ copy_int32_raw_pixels ((const int *) (rst->rasterBuffer),
+ (const unsigned char *) (rst->maskBuffer),
+ (int *) outbuf, width, height,
+ x_res, y_res, minx, maxy, tile_minx,
+ tile_maxy, tile_width, tile_height, no_data);
+ return 1;
+ case RL2_SAMPLE_UINT32:
+ copy_uint32_raw_pixels ((const unsigned int *) (rst->rasterBuffer),
+ (const unsigned char *) (rst->maskBuffer),
+ (unsigned int *) outbuf, width, height,
+ x_res, y_res, minx, maxy,
+ tile_minx, tile_maxy, tile_width,
+ tile_height, no_data);
+ return 1;
+ case RL2_SAMPLE_FLOAT:
+ copy_float_raw_pixels ((const float *) (rst->rasterBuffer),
+ (const unsigned char *) (rst->maskBuffer),
+ (float *) outbuf, width, height,
+ x_res, y_res, minx, maxy, tile_minx,
+ tile_maxy, tile_width, tile_height, no_data);
+ return 1;
+ case RL2_SAMPLE_DOUBLE:
+ copy_double_raw_pixels ((const double *) (rst->rasterBuffer),
+ (const unsigned char *) (rst->maskBuffer),
+ (double *) outbuf, width, height,
+ x_res, y_res, minx, maxy,
+ tile_minx, tile_maxy, tile_width,
+ tile_height, no_data);
+ return 1;
+ default:
+ copy_uint8_raw_pixels ((const unsigned char *) (rst->rasterBuffer),
+ (const unsigned char *) (rst->maskBuffer),
+ (unsigned char *) outbuf, width, height,
+ num_bands, x_res, y_res, minx, maxy, tile_minx,
+ tile_maxy, tile_width, tile_height, no_data);
+ return 1;
+ };
+
+ return 0;
+}
+
+static void
+get_int8_ennuple (const char *rawbuf, unsigned short row, unsigned short col,
+ unsigned short row_stride, rl2PixelPtr no_data,
+ double ennuple[], int *has_no_data)
+{
+/* extracting a 3x3 "super-pixel" - INT8 */
+ const char *p_in;
+ char nd_val = 0;
+ int i;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) == RL2_OK)
+ {
+ if (sample_type == RL2_SAMPLE_INT8 || num_bands == 1)
+ rl2_get_pixel_sample_int8 (no_data, &nd_val);
+ }
+ }
+ p_in = rawbuf + (row * row_stride) + col;
+ ennuple[0] = *p_in++;
+ ennuple[1] = *p_in++;
+ ennuple[2] = *p_in++;
+ p_in = rawbuf + ((row + 1) * row_stride) + col;
+ ennuple[3] = *p_in++;
+ ennuple[4] = *p_in++;
+ ennuple[5] = *p_in++;
+ p_in = rawbuf + ((row + 2) * row_stride) + col;
+ ennuple[6] = *p_in++;
+ ennuple[7] = *p_in++;
+ ennuple[8] = *p_in++;
+ *has_no_data = 0;
+ for (i = 0; i < 9; i++)
+ {
+ /* checking for NoData values */
+ if (ennuple[i] == nd_val)
+ *has_no_data = 1;
+ }
+}
+
+static void
+get_uint8_ennuple (const unsigned char *rawbuf, unsigned short row,
+ unsigned short col, unsigned short row_stride,
+ rl2PixelPtr no_data, double ennuple[], int *has_no_data)
+{
+/* extracting a 3x3 "super-pixel" - UINT16 */
+ const unsigned char *p_in;
+ unsigned char nd_val = 0;
+ int i;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) == RL2_OK)
+ {
+ if (sample_type == RL2_SAMPLE_UINT8 || num_bands == 1)
+ rl2_get_pixel_sample_uint8 (no_data, 0, &nd_val);
+ }
+ }
+ p_in = rawbuf + (row * row_stride) + col;
+ ennuple[0] = *p_in++;
+ ennuple[1] = *p_in++;
+ ennuple[2] = *p_in++;
+ p_in = rawbuf + ((row + 1) * row_stride) + col;
+ ennuple[3] = *p_in++;
+ ennuple[4] = *p_in++;
+ ennuple[5] = *p_in++;
+ p_in = rawbuf + ((row + 2) * row_stride) + col;
+ ennuple[6] = *p_in++;
+ ennuple[7] = *p_in++;
+ ennuple[8] = *p_in++;
+ *has_no_data = 0;
+ for (i = 0; i < 9; i++)
+ {
+ /* checking for NoData values */
+ if (ennuple[i] == nd_val)
+ *has_no_data = 1;
+ }
+}
+
+static void
+get_int16_ennuple (const short *rawbuf, unsigned short row, unsigned short col,
+ unsigned short row_stride, rl2PixelPtr no_data,
+ double ennuple[], int *has_no_data)
+{
+/* extracting a 3x3 "super-pixel" - INT16 */
+ const short *p_in;
+ short nd_val = 0;
+ int i;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) == RL2_OK)
+ {
+ if (sample_type == RL2_SAMPLE_INT16 || num_bands == 1)
+ rl2_get_pixel_sample_int16 (no_data, &nd_val);
+ }
+ }
+ p_in = rawbuf + (row * row_stride) + col;
+ ennuple[0] = *p_in++;
+ ennuple[1] = *p_in++;
+ ennuple[2] = *p_in++;
+ p_in = rawbuf + ((row + 1) * row_stride) + col;
+ ennuple[3] = *p_in++;
+ ennuple[4] = *p_in++;
+ ennuple[5] = *p_in++;
+ p_in = rawbuf + ((row + 2) * row_stride) + col;
+ ennuple[6] = *p_in++;
+ ennuple[7] = *p_in++;
+ ennuple[8] = *p_in++;
+ *has_no_data = 0;
+ for (i = 0; i < 9; i++)
+ {
+ /* checking for NoData values */
+ if (ennuple[i] == nd_val)
+ *has_no_data = 1;
+ }
+}
+
+static void
+get_uint16_ennuple (const unsigned short *rawbuf, unsigned short row,
+ unsigned short col, unsigned short row_stride,
+ rl2PixelPtr no_data, double ennuple[], int *has_no_data)
+{
+/* extracting a 3x3 "super-pixel" - UINT16 */
+ const unsigned short *p_in;
+ unsigned short nd_val = 0;
+ int i;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) == RL2_OK)
+ {
+ if (sample_type == RL2_SAMPLE_UINT16 || num_bands == 1)
+ rl2_get_pixel_sample_uint16 (no_data, 0, &nd_val);
+ }
+ }
+ p_in = rawbuf + (row * row_stride) + col;
+ ennuple[0] = *p_in++;
+ ennuple[1] = *p_in++;
+ ennuple[2] = *p_in++;
+ p_in = rawbuf + ((row + 1) * row_stride) + col;
+ ennuple[3] = *p_in++;
+ ennuple[4] = *p_in++;
+ ennuple[5] = *p_in++;
+ p_in = rawbuf + ((row + 2) * row_stride) + col;
+ ennuple[6] = *p_in++;
+ ennuple[7] = *p_in++;
+ ennuple[8] = *p_in++;
+ *has_no_data = 0;
+ for (i = 0; i < 9; i++)
+ {
+ /* checking for NoData values */
+ if (ennuple[i] == nd_val)
+ *has_no_data = 1;
+ }
+}
+
+static void
+get_int32_ennuple (const int *rawbuf, unsigned short row, unsigned short col,
+ unsigned short row_stride, rl2PixelPtr no_data,
+ double ennuple[], int *has_no_data)
+{
+/* extracting a 3x3 "super-pixel" - INT32 */
+ const int *p_in;
+ int nd_val = 0;
+ int i;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) == RL2_OK)
+ {
+ if (sample_type == RL2_SAMPLE_INT32 || num_bands == 1)
+ rl2_get_pixel_sample_int32 (no_data, &nd_val);
+ }
+ }
+ p_in = rawbuf + (row * row_stride) + col;
+ ennuple[0] = *p_in++;
+ ennuple[1] = *p_in++;
+ ennuple[2] = *p_in++;
+ p_in = rawbuf + ((row + 1) * row_stride) + col;
+ ennuple[3] = *p_in++;
+ ennuple[4] = *p_in++;
+ ennuple[5] = *p_in++;
+ p_in = rawbuf + ((row + 2) * row_stride) + col;
+ ennuple[6] = *p_in++;
+ ennuple[7] = *p_in++;
+ ennuple[8] = *p_in++;
+ *has_no_data = 0;
+ for (i = 0; i < 9; i++)
+ {
+ /* checking for NoData values */
+ if (ennuple[i] == nd_val)
+ *has_no_data = 1;
+ }
+}
+
+static void
+get_uint32_ennuple (const unsigned int *rawbuf, unsigned short row,
+ unsigned short col, unsigned short row_stride,
+ rl2PixelPtr no_data, double ennuple[], int *has_no_data)
+{
+/* extracting a 3x3 "super-pixel" - UINT32 */
+ const unsigned int *p_in;
+ unsigned int nd_val = 0;
+ int i;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) == RL2_OK)
+ {
+ if (sample_type == RL2_SAMPLE_UINT32 || num_bands == 1)
+ rl2_get_pixel_sample_uint32 (no_data, &nd_val);
+ }
+ }
+ p_in = rawbuf + (row * row_stride) + col;
+ ennuple[0] = *p_in++;
+ ennuple[1] = *p_in++;
+ ennuple[2] = *p_in++;
+ p_in = rawbuf + ((row + 1) * row_stride) + col;
+ ennuple[3] = *p_in++;
+ ennuple[4] = *p_in++;
+ ennuple[5] = *p_in++;
+ p_in = rawbuf + ((row + 2) * row_stride) + col;
+ ennuple[6] = *p_in++;
+ ennuple[7] = *p_in++;
+ ennuple[8] = *p_in++;
+ *has_no_data = 0;
+ for (i = 0; i < 9; i++)
+ {
+ /* checking for NoData values */
+ if (ennuple[i] == nd_val)
+ *has_no_data = 1;
+ }
+}
+
+static void
+get_float_ennuple (const float *rawbuf, unsigned short row, unsigned short col,
+ unsigned short row_stride, rl2PixelPtr no_data,
+ double ennuple[], int *has_no_data)
+{
+/* extracting a 3x3 "super-pixel" - FLOAT */
+ const float *p_in;
+ float nd_val = 0.0;
+ int i;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) == RL2_OK)
+ {
+ if (sample_type == RL2_SAMPLE_FLOAT || num_bands == 1)
+ rl2_get_pixel_sample_float (no_data, &nd_val);
+ }
+ }
+ p_in = rawbuf + (row * row_stride) + col;
+ ennuple[0] = *p_in++;
+ ennuple[1] = *p_in++;
+ ennuple[2] = *p_in++;
+ p_in = rawbuf + ((row + 1) * row_stride) + col;
+ ennuple[3] = *p_in++;
+ ennuple[4] = *p_in++;
+ ennuple[5] = *p_in++;
+ p_in = rawbuf + ((row + 2) * row_stride) + col;
+ ennuple[6] = *p_in++;
+ ennuple[7] = *p_in++;
+ ennuple[8] = *p_in++;
+ *has_no_data = 0;
+ for (i = 0; i < 9; i++)
+ {
+ /* checking for NoData values */
+ if (ennuple[i] == nd_val)
+ *has_no_data = 1;
+ }
+}
+
+static void
+get_double_ennuple (const double *rawbuf, unsigned short row,
+ unsigned short col, unsigned short row_stride,
+ rl2PixelPtr no_data, double ennuple[], int *has_no_data)
+{
+/* extracting a 3x3 "super-pixel" - DOUBLE */
+ const double *p_in;
+ double nd_val = 0.0;
+ int i;
+
+ if (no_data != NULL)
+ {
+ /* retrieving the NO-DATA value */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ if (rl2_get_pixel_type
+ (no_data, &sample_type, &pixel_type, &num_bands) == RL2_OK)
+ {
+ if (sample_type == RL2_SAMPLE_DOUBLE || num_bands == 1)
+ rl2_get_pixel_sample_double (no_data, &nd_val);
+ }
+ }
+ p_in = rawbuf + (row * row_stride) + col;
+ ennuple[0] = *p_in++;
+ ennuple[1] = *p_in++;
+ ennuple[2] = *p_in++;
+ p_in = rawbuf + ((row + 1) * row_stride) + col;
+ ennuple[3] = *p_in++;
+ ennuple[4] = *p_in++;
+ ennuple[5] = *p_in++;
+ p_in = rawbuf + ((row + 2) * row_stride) + col;
+ ennuple[6] = *p_in++;
+ ennuple[7] = *p_in++;
+ ennuple[8] = *p_in++;
+ *has_no_data = 0;
+ for (i = 0; i < 9; i++)
+ {
+ /* checking for NoData values */
+ if (ennuple[i] == nd_val)
+ *has_no_data = 1;
+ }
+}
+
+static float
+compute_shaded_relief (double relief_factor, double scale_factor,
+ double altRadians, double azRadians, double ennuple[])
+{
+/* actual computation */
+ double x;
+ double y;
+ double z_factor = 0.0033333333 * (relief_factor / 55.0);
+ double aspect;
+ double slope;
+ double value;
+
+/* First Slope ... */
+ x = z_factor * ((ennuple[0] + ennuple[3] + ennuple[3] + ennuple[6]) -
+ (ennuple[2] + ennuple[5] + ennuple[5] +
+ ennuple[8])) / scale_factor;
+ y = z_factor * ((ennuple[6] + ennuple[7] + ennuple[7] + ennuple[8]) -
+ (ennuple[0] + ennuple[1] + ennuple[1] +
+ ennuple[2])) / scale_factor;
+ slope = M_PI / 2 - atan (sqrt (x * x + y * y));
+/* ... then aspect... */
+ aspect = atan2 (x, y);
+/* ... then the shade value */
+ value =
+ sin (altRadians) * sin (slope) +
+ cos (altRadians) * cos (slope) * cos (azRadians - M_PI / 2 - aspect);
+/* normalizing */
+ if (value < 0.0)
+ value = 0.0;
+ if (value > 1.0)
+ value = 1.0;
+ return value;
+}
+
+static float
+shaded_relief_value (double relief_factor, double scale_factor,
+ double altRadians, double azRadians, void *rawbuf,
+ unsigned short row, unsigned short col,
+ unsigned short row_stride, unsigned char sample_type,
+ rl2PixelPtr no_data)
+{
+/* computing a ShadedRelief Pixel value */
+ double ennuple[9];
+ int has_no_data;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ get_int8_ennuple (rawbuf, row, col, row_stride, no_data,
+ ennuple, &has_no_data);
+ break;
+ case RL2_SAMPLE_UINT8:
+ get_uint8_ennuple (rawbuf, row, col, row_stride, no_data,
+ ennuple, &has_no_data);
+ break;
+ case RL2_SAMPLE_INT16:
+ get_int16_ennuple (rawbuf, row, col, row_stride, no_data,
+ ennuple, &has_no_data);
+ break;
+ case RL2_SAMPLE_UINT16:
+ get_uint16_ennuple (rawbuf, row, col, row_stride, no_data,
+ ennuple, &has_no_data);
+ break;
+ case RL2_SAMPLE_INT32:
+ get_int32_ennuple (rawbuf, row, col, row_stride, no_data,
+ ennuple, &has_no_data);
+ break;
+ case RL2_SAMPLE_UINT32:
+ get_uint32_ennuple (rawbuf, row, col, row_stride, no_data,
+ ennuple, &has_no_data);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ get_float_ennuple (rawbuf, row, col, row_stride, no_data,
+ ennuple, &has_no_data);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ get_double_ennuple (rawbuf, row, col, row_stride, no_data,
+ ennuple, &has_no_data);
+ break;
+ default:
+ return -1.0;
+ };
+ if (has_no_data)
+ return -1.0;
+ return compute_shaded_relief (relief_factor, scale_factor, altRadians,
+ azRadians, ennuple);
+}
+
+RL2_PRIVATE int
+rl2_build_shaded_relief_mask (sqlite3 * handle, rl2CoveragePtr cvg,
+ double relief_factor, double scale_factor,
+ unsigned int width, unsigned int height,
+ double minx, double miny, double maxx,
+ double maxy, double x_res, double y_res,
+ float **shaded_relief, int *shaded_relief_sz)
+{
+/* attempting to return a Shaded Relief mask from the DBMS Coverage */
+ rl2PixelPtr no_data = NULL;
+ const char *coverage;
+ unsigned char level;
+ unsigned char scale;
+ double xx_res = x_res;
+ double yy_res = y_res;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ char *xtiles;
+ char *xxtiles;
+ char *xdata;
+ char *xxdata;
+ char *sql;
+ sqlite3_stmt *stmt_tiles = NULL;
+ sqlite3_stmt *stmt_data = NULL;
+ int ret;
+ void *rawbuf = NULL;
+ int rawbuf_size;
+ int pix_sz = 1;
+ float *sr_mask = NULL;
+ int sr_mask_size;
+ float *p_out;
+ unsigned short row;
+ unsigned short col;
+ unsigned short row_stride;
+ double degreesToRadians = M_PI / 180.0;
+ double altRadians = 45.0 * degreesToRadians; /* altitude: 45.0 */
+ double azRadians = 315.0 * degreesToRadians; /* azimuth: 315.0 */
+
+ if (cvg == NULL || handle == NULL)
+ goto error;
+ coverage = rl2_get_coverage_name (cvg);
+ if (coverage == NULL)
+ goto error;
+ if (rl2_find_matching_resolution
+ (handle, cvg, &xx_res, &yy_res, &level, &scale) != RL2_OK)
+ goto error;
+ if (rl2_get_coverage_type (cvg, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ goto error;
+ if (pixel_type != RL2_PIXEL_DATAGRID && num_bands != 1)
+ goto error;
+ no_data = rl2_get_coverage_no_data (cvg);
+ if (no_data == NULL)
+ goto error;
+
+/* preparing the "tiles" SQL query */
+ xtiles = sqlite3_mprintf ("%s_tiles", coverage);
+ xxtiles = gaiaDoubleQuotedSql (xtiles);
+ sql =
+ sqlite3_mprintf ("SELECT tile_id, MbrMinX(geometry), MbrMaxY(geometry) "
+ "FROM \"%s\" "
+ "WHERE pyramid_level = ? AND ROWID IN ( "
+ "SELECT ROWID FROM SpatialIndex WHERE f_table_name = %Q "
+ "AND search_frame = BuildMBR(?, ?, ?, ?))", xxtiles,
+ xtiles);
+ sqlite3_free (xtiles);
+ free (xxtiles);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_tiles, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT shadedRelief tiles SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+
+ if (scale == RL2_SCALE_1)
+ {
+ /* preparing the data SQL query - both ODD and EVEN */
+ xdata = sqlite3_mprintf ("%s_tile_data", coverage);
+ xxdata = gaiaDoubleQuotedSql (xdata);
+ sqlite3_free (xdata);
+ sql = sqlite3_mprintf ("SELECT tile_data_odd, tile_data_even "
+ "FROM \"%s\" WHERE tile_id = ?", xxdata);
+ free (xxdata);
+ ret =
+ sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_data, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT shadedRelief data(2) SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ else
+ {
+ /* preparing the data SQL query - only ODD */
+ xdata = sqlite3_mprintf ("%s_tile_data", coverage);
+ xxdata = gaiaDoubleQuotedSql (xdata);
+ sqlite3_free (xdata);
+ sql = sqlite3_mprintf ("SELECT tile_data_odd "
+ "FROM \"%s\" WHERE tile_id = ?", xxdata);
+ free (xxdata);
+ ret =
+ sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_data, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT shadedRelief data(1) SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+
+/* preparing a raw pixels buffer */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pix_sz = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pix_sz = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pix_sz = 8;
+ break;
+ };
+ row_stride = width + 2;
+ rawbuf_size = (pix_sz * row_stride) * (height + 2);
+ rawbuf = malloc (rawbuf_size);
+ if (rawbuf == NULL)
+ {
+ fprintf (stderr,
+ "rl2_build_shaded_relief_mask: Insufficient Memory !!!\n");
+ goto error;
+ }
+ void_raw_buffer (rawbuf, width + 2, height + 2, sample_type, 1, no_data);
+ if (!load_dbms_tiles
+ (handle, stmt_tiles, stmt_data, rawbuf, width + 2, height + 2,
+ sample_type, 1, xx_res, yy_res, minx - xx_res, miny - yy_res,
+ maxx + xx_res, maxy + yy_res, level, scale, NULL, no_data, NULL, NULL))
+ goto error;
+ sqlite3_finalize (stmt_tiles);
+ sqlite3_finalize (stmt_data);
+ stmt_tiles = NULL;
+ stmt_data = NULL;
+
+/* preparing the Shaded Relief mask */
+ sr_mask_size = sizeof (float) * width * height;
+ sr_mask = malloc (sr_mask_size);
+ if (sr_mask == NULL)
+ {
+ fprintf (stderr,
+ "rl2_build_shaded_relief_mask: Insufficient Memory !!!\n");
+ goto error;
+ }
+ p_out = sr_mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ *p_out++ =
+ shaded_relief_value (relief_factor, scale_factor, altRadians,
+ azRadians, rawbuf, row, col, row_stride,
+ sample_type, no_data);
+ }
+
+ free (rawbuf);
+ *shaded_relief = sr_mask;
+ *shaded_relief_sz = sr_mask_size;
+ return RL2_OK;
+
+ error:
+ if (stmt_tiles != NULL)
+ sqlite3_finalize (stmt_tiles);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ if (rawbuf != NULL)
+ free (rawbuf);
+ return RL2_ERROR;
+}
diff --git a/src/rl2raw.c b/src/rl2raw.c
new file mode 100644
index 0000000..d5f5ce7
--- /dev/null
+++ b/src/rl2raw.c
@@ -0,0 +1,1604 @@
+/*
+
+ rl2raw -- raw buffer export functions
+
+ version 0.1, 2013 April 1
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2_private.h"
+
+static int
+check_as_rgb (rl2PrivRasterPtr rst)
+{
+/* check if this raster could be exported as RGB */
+ switch (rst->pixelType)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_PALETTE:
+ case RL2_PIXEL_GRAYSCALE:
+ case RL2_PIXEL_RGB:
+ return 1;
+ };
+ return 0;
+}
+
+static void
+grayscale_as_rgb (unsigned char sample_type, unsigned char gray,
+ unsigned char *r, unsigned char *g, unsigned char *b)
+{
+/* grayscale 8bit resolution as RGB */
+ unsigned char index;
+ *r = 0;
+ *g = 0;
+ *b = 0;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_2_BIT:
+ switch (gray)
+ {
+ case 3:
+ index = 255;
+ break;
+ case 2:
+ index = 170;
+ break;
+ case 1:
+ index = 86;
+ break;
+ case 0:
+ default:
+ index = 0;
+ break;
+ };
+ *r = index;
+ *g = index;
+ *b = index;
+ break;
+ case RL2_SAMPLE_4_BIT:
+ switch (gray)
+ {
+ case 15:
+ index = 255;
+ break;
+ case 14:
+ index = 239;
+ break;
+ case 13:
+ index = 222;
+ break;
+ case 12:
+ index = 205;
+ break;
+ case 11:
+ index = 188;
+ break;
+ case 10:
+ index = 171;
+ break;
+ case 9:
+ index = 154;
+ break;
+ case 8:
+ index = 137;
+ break;
+ case 7:
+ index = 119;
+ break;
+ case 6:
+ index = 102;
+ break;
+ case 5:
+ index = 85;
+ break;
+ case 4:
+ index = 68;
+ break;
+ case 3:
+ index = 51;
+ break;
+ case 2:
+ index = 34;
+ break;
+ case 1:
+ index = 17;
+ break;
+ case 0:
+ default:
+ index = 0;
+ break;
+ };
+ *r = index;
+ *g = index;
+ *b = index;
+ break;
+ case RL2_SAMPLE_UINT8:
+ *r = gray;
+ *g = gray;
+ *b = gray;
+ break;
+ };
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_RGB (rl2RasterPtr ptr, unsigned char **buffer, int *buf_size)
+{
+/* attempting to export Raster pixel data as an RGB array */
+ unsigned char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned short max_palette;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+ unsigned char index;
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_rgb (rst))
+ return RL2_ERROR;
+
+ if (rst->pixelType == RL2_PIXEL_PALETTE)
+ {
+ /* there is a palette */
+ if (rl2_get_palette_colors
+ ((rl2PalettePtr) (rst->Palette), &max_palette, &red, &green,
+ &blue) != RL2_OK)
+ return RL2_ERROR;
+ }
+
+ sz = rst->width * rst->height * 3;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = rst->rasterBuffer;
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ {
+ switch (rst->pixelType)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (*p_in++ == 0)
+ index = 255;
+ else
+ index = 0;
+ *p_out++ = index;
+ *p_out++ = index;
+ *p_out++ = index;
+ break;
+ case RL2_PIXEL_PALETTE:
+ index = *p_in++;
+ if (index < max_palette)
+ {
+ *p_out++ = *(red + index);
+ *p_out++ = *(green + index);
+ *p_out++ = *(blue + index);
+ }
+ else
+ {
+ /* default - inserting a BLACK pixel */
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ }
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ grayscale_as_rgb (rst->sampleType, *p_in++, &r, &g, &b);
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ break;
+ case RL2_PIXEL_RGB:
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ break;
+ };
+ }
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ if (red != NULL)
+ free (red);
+ if (green != NULL)
+ free (green);
+ if (blue != NULL)
+ free (blue);
+ return RL2_OK;
+}
+
+static int
+eval_transparent_pixels (unsigned char r, unsigned char g, unsigned char b,
+ unsigned char transpR, unsigned char transpG,
+ unsigned char transpB)
+{
+/* evaluating a transparent color match */
+ if (r != transpR)
+ return 0;
+ if (g != transpG)
+ return 0;
+ if (b != transpB)
+ return 0;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_RGBA (rl2RasterPtr ptr, unsigned char **buffer,
+ int *buf_size)
+{
+/* attempting to export Raster pixel data as an RGBA array */
+ unsigned char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *p_in;
+ unsigned char *p_mask;
+ unsigned char *p_out;
+ unsigned short max_palette;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+ unsigned char index;
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ unsigned char a;
+ unsigned char transpR;
+ unsigned char transpG;
+ unsigned char transpB;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_rgb (rst))
+ return RL2_ERROR;
+
+ if (rst->pixelType == RL2_PIXEL_PALETTE)
+ {
+ /* there is a palette */
+ if (rl2_get_palette_colors
+ ((rl2PalettePtr) (rst->Palette), &max_palette, &red, &green,
+ &blue) != RL2_OK)
+ return RL2_ERROR;
+ }
+
+ sz = rst->width * rst->height * 4;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ if (rst->noData != NULL)
+ {
+ /* preparing the transparent color */
+ rl2PrivPixelPtr no_data = rst->noData;
+ switch (no_data->pixelType)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (no_data->Samples->uint8 == 0)
+ {
+ transpR = 255;
+ transpG = 255;
+ transpB = 255;
+ }
+ else
+ {
+ transpR = 0;
+ transpG = 0;
+ transpB = 0;
+ }
+ break;
+ case RL2_PIXEL_PALETTE:
+ index = no_data->Samples->uint8;
+ if (index < max_palette)
+ {
+ transpR = *(red + index);
+ transpG = *(green + index);
+ transpB = *(blue + index);
+ }
+ else
+ {
+ /* default - inserting a BLACK pixel */
+ transpR = 0;
+ transpG = 0;
+ transpB = 0;
+ }
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ grayscale_as_rgb (rst->sampleType, no_data->Samples->uint8,
+ &transpR, &transpG, &transpB);
+ break;
+ case RL2_PIXEL_RGB:
+ rl2_get_pixel_sample_uint8 ((rl2PixelPtr) no_data, RL2_RED_BAND,
+ &transpR);
+ rl2_get_pixel_sample_uint8 ((rl2PixelPtr) no_data,
+ RL2_GREEN_BAND, &transpG);
+ rl2_get_pixel_sample_uint8 ((rl2PixelPtr) no_data,
+ RL2_BLUE_BAND, &transpB);
+ break;
+ };
+ }
+
+ p_in = rst->rasterBuffer;
+ p_mask = rst->maskBuffer;
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ {
+ switch (rst->pixelType)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (*p_in++ == 0)
+ index = 255;
+ else
+ index = 0;
+ r = index;
+ g = index;
+ b = index;
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ a = 255;
+ if (p_mask != NULL)
+ {
+ if (*p_mask++ == 0)
+ a = 0;
+ }
+ if (rst->noData != NULL)
+ {
+ /* evaluating transparent color */
+ if (eval_transparent_pixels
+ (r, g, b, transpR, transpG, transpB))
+ a = 0;
+ }
+ *p_out++ = a;
+ break;
+ case RL2_PIXEL_PALETTE:
+ index = *p_in++;
+ if (index < max_palette)
+ {
+ r = *(red + index);
+ g = *(green + index);
+ b = *(blue + index);
+ }
+ else
+ {
+ /* default - inserting a BLACK pixel */
+ r = 0;
+ g = 0;
+ b = 0;
+ }
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ a = 255;
+ if (p_mask != NULL)
+ {
+ if (*p_mask++ == 0)
+ a = 0;
+ }
+ if (rst->noData != NULL)
+ {
+ /* evaluating transparent color */
+ if (eval_transparent_pixels
+ (r, g, b, transpR, transpG, transpB))
+ a = 0;
+ }
+ *p_out++ = a;
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ grayscale_as_rgb (rst->sampleType, *p_in++, &r, &g, &b);
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ a = 255;
+ if (p_mask != NULL)
+ {
+ if (*p_mask++ == 0)
+ a = 0;
+ }
+ if (rst->noData != NULL)
+ {
+ /* evaluating transparent color */
+ if (eval_transparent_pixels
+ (r, g, b, transpR, transpG, transpB))
+ a = 0;
+ }
+ *p_out++ = a;
+ break;
+ case RL2_PIXEL_RGB:
+ r = *p_in++;
+ g = *p_in++;
+ b = *p_in++;
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ a = 255;
+ if (p_mask != NULL)
+ {
+ if (*p_mask++ == 0)
+ a = 0;
+ }
+ if (rst->noData != NULL)
+ {
+ /* evaluating transparent color */
+ if (eval_transparent_pixels
+ (r, g, b, transpR, transpG, transpB))
+ a = 0;
+ }
+ *p_out++ = a;
+ break;
+ };
+ }
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ if (red != NULL)
+ free (red);
+ if (green != NULL)
+ free (green);
+ if (blue != NULL)
+ free (blue);
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_ARGB (rl2RasterPtr ptr, unsigned char **buffer,
+ int *buf_size)
+{
+/* attempting to export Raster pixel data as an ARGB array */
+ unsigned char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *p_in;
+ unsigned char *p_mask;
+ unsigned char *p_out;
+ unsigned short max_palette;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+ unsigned char index;
+ unsigned char a;
+ unsigned char *p_alpha;
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ unsigned char transpR;
+ unsigned char transpG;
+ unsigned char transpB;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_rgb (rst))
+ return RL2_ERROR;
+
+ if (rst->pixelType == RL2_PIXEL_PALETTE)
+ {
+ /* there is a palette */
+ if (rl2_get_palette_colors
+ ((rl2PalettePtr) (rst->Palette), &max_palette, &red, &green,
+ &blue) != RL2_OK)
+ return RL2_ERROR;
+ }
+
+ sz = rst->width * rst->height * 4;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ if (rst->noData != NULL)
+ {
+ /* preparing the transparent color */
+ rl2PrivPixelPtr no_data = rst->noData;
+ switch (no_data->pixelType)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (no_data->Samples->uint8 == 0)
+ {
+ transpR = 255;
+ transpG = 255;
+ transpB = 255;
+ }
+ else
+ {
+ transpR = 0;
+ transpG = 0;
+ transpB = 0;
+ }
+ break;
+ case RL2_PIXEL_PALETTE:
+ index = no_data->Samples->uint8;
+ if (index < max_palette)
+ {
+ transpR = *(red + index);
+ transpG = *(green + index);
+ transpB = *(blue + index);
+ }
+ else
+ {
+ /* default - inserting a BLACK pixel */
+ transpR = 0;
+ transpG = 0;
+ transpB = 0;
+ }
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ grayscale_as_rgb (rst->sampleType, no_data->Samples->uint8,
+ &transpR, &transpG, &transpB);
+ break;
+ case RL2_PIXEL_RGB:
+ rl2_get_pixel_sample_uint8 ((rl2PixelPtr) no_data, RL2_RED_BAND,
+ &transpR);
+ rl2_get_pixel_sample_uint8 ((rl2PixelPtr) no_data,
+ RL2_GREEN_BAND, &transpG);
+ rl2_get_pixel_sample_uint8 ((rl2PixelPtr) no_data,
+ RL2_BLUE_BAND, &transpB);
+ break;
+ };
+ }
+
+ p_in = rst->rasterBuffer;
+ p_mask = rst->maskBuffer;
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ {
+ if (p_mask == NULL)
+ a = 255;
+ else
+ {
+ if (*p_mask++ == 0)
+ a = 0;
+ else
+ a = 255;
+ }
+ switch (rst->pixelType)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (*p_in++ == 0)
+ index = 255;
+ else
+ index = 0;
+ p_alpha = p_out++;
+ r = *p_out++ = index;
+ g = *p_out++ = index;
+ b = *p_out++ = index;
+ break;
+ case RL2_PIXEL_PALETTE:
+ index = *p_in++;
+ if (index < max_palette)
+ {
+ *p_out++ = 255;
+ *p_out++ = *(red + index);
+ *p_out++ = *(green + index);
+ *p_out++ = *(blue + index);
+ }
+ else
+ {
+ /* default - inserting a BLACK pixel */
+ *p_out++ = 255;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ }
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ grayscale_as_rgb (rst->sampleType, *p_in++, &r, &g, &b);
+ p_alpha = p_out++;
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ break;
+ case RL2_PIXEL_RGB:
+ p_alpha = p_out++;
+ r = *p_out++ = *p_in++;
+ g = *p_out++ = *p_in++;
+ b = *p_out++ = *p_in++;
+ break;
+ };
+ if (rst->pixelType != RL2_PIXEL_PALETTE)
+ {
+ if (rst->noData != NULL)
+ {
+ /* evaluating transparent color */
+ if (eval_transparent_pixels
+ (r, g, b, transpR, transpG, transpB))
+ a = 0;
+ }
+ *p_alpha = a;
+ }
+ }
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ if (red != NULL)
+ free (red);
+ if (green != NULL)
+ free (green);
+ if (blue != NULL)
+ free (blue);
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_BGR (rl2RasterPtr ptr, unsigned char **buffer, int *buf_size)
+{
+/* attempting to export Raster pixel data as an BGR array */
+ unsigned char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned short max_palette;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+ unsigned char index;
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_rgb (rst))
+ return RL2_ERROR;
+
+ if (rst->pixelType == RL2_PIXEL_PALETTE)
+ {
+ /* there is a palette */
+ if (rl2_get_palette_colors
+ ((rl2PalettePtr) (rst->Palette), &max_palette, &red, &green,
+ &blue) != RL2_OK)
+ return RL2_ERROR;
+ }
+
+ sz = rst->width * rst->height * 3;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = rst->rasterBuffer;
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ {
+ switch (rst->pixelType)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (*p_in++ == 0)
+ index = 255;
+ else
+ index = 0;
+ *p_out++ = index;
+ *p_out++ = index;
+ *p_out++ = index;
+ break;
+ case RL2_PIXEL_PALETTE:
+ index = *p_in++;
+ if (index < max_palette)
+ {
+ *p_out++ = *(blue + index);
+ *p_out++ = *(green + index);
+ *p_out++ = *(red + index);
+ }
+ else
+ {
+ /* default - inserting a BLACK pixel */
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ }
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ grayscale_as_rgb (rst->sampleType, *p_in++, &r, &g, &b);
+ *p_out++ = b;
+ *p_out++ = g;
+ *p_out++ = r;
+ break;
+ case RL2_PIXEL_RGB:
+ r = *p_in++;
+ g = *p_in++;
+ b = *p_in++;
+ *p_out++ = b;
+ *p_out++ = g;
+ *p_out++ = r;
+ break;
+ };
+ }
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ if (red != NULL)
+ free (red);
+ if (green != NULL)
+ free (green);
+ if (blue != NULL)
+ free (blue);
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_BGRA (rl2RasterPtr ptr, unsigned char **buffer,
+ int *buf_size)
+{
+/* attempting to export Raster pixel data as an BGRA array */
+ unsigned char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *p_in;
+ unsigned char *p_mask;
+ unsigned char *p_out;
+ unsigned short max_palette;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+ unsigned char index;
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ unsigned char a;
+ unsigned char transpR;
+ unsigned char transpG;
+ unsigned char transpB;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_rgb (rst))
+ return RL2_ERROR;
+
+ if (rst->pixelType == RL2_PIXEL_PALETTE)
+ {
+ /* there is a palette */
+ if (rl2_get_palette_colors
+ ((rl2PalettePtr) (rst->Palette), &max_palette, &red, &green,
+ &blue) != RL2_OK)
+ return RL2_ERROR;
+ }
+
+ sz = rst->width * rst->height * 4;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ if (rst->noData != NULL)
+ {
+ /* preparing the transparent color */
+ rl2PrivPixelPtr no_data = rst->noData;
+ switch (no_data->pixelType)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (no_data->Samples->uint8 == 0)
+ {
+ transpR = 255;
+ transpG = 255;
+ transpB = 255;
+ }
+ else
+ {
+ transpR = 0;
+ transpG = 0;
+ transpB = 0;
+ }
+ break;
+ case RL2_PIXEL_PALETTE:
+ index = no_data->Samples->uint8;
+ if (index < max_palette)
+ {
+ transpR = *(red + index);
+ transpG = *(green + index);
+ transpB = *(blue + index);
+ }
+ else
+ {
+ /* default - inserting a BLACK pixel */
+ transpR = 0;
+ transpG = 0;
+ transpB = 0;
+ }
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ grayscale_as_rgb (rst->sampleType, no_data->Samples->uint8,
+ &transpR, &transpG, &transpB);
+ break;
+ case RL2_PIXEL_RGB:
+ rl2_get_pixel_sample_uint8 ((rl2PixelPtr) no_data, RL2_RED_BAND,
+ &transpR);
+ rl2_get_pixel_sample_uint8 ((rl2PixelPtr) no_data,
+ RL2_GREEN_BAND, &transpG);
+ rl2_get_pixel_sample_uint8 ((rl2PixelPtr) no_data,
+ RL2_BLUE_BAND, &transpB);
+ break;
+ };
+ }
+
+ p_in = rst->rasterBuffer;
+ p_mask = rst->maskBuffer;
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ {
+ if (p_mask == NULL)
+ a = 255;
+ else
+ {
+ if (*p_mask++ == 0)
+ a = 0;
+ else
+ a = 255;
+ }
+ switch (rst->pixelType)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (*p_in++ == 0)
+ index = 255;
+ else
+ index = 0;
+ b = *p_out++ = index;
+ g = *p_out++ = index;
+ r = *p_out++ = index;
+ break;
+ case RL2_PIXEL_PALETTE:
+ index = *p_in++;
+ if (index < max_palette)
+ {
+ *p_out++ = *(blue + index);
+ *p_out++ = *(green + index);
+ *p_out++ = *(red + index);
+ *p_out++ = 255;
+ }
+ else
+ {
+ /* default - inserting a BLACK pixel */
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 255;
+ }
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ grayscale_as_rgb (rst->sampleType, *p_in++, &r, &g, &b);
+ *p_out++ = b;
+ *p_out++ = g;
+ *p_out++ = r;
+ break;
+ case RL2_PIXEL_RGB:
+ r = *p_in++;
+ g = *p_in++;
+ b = *p_in++;
+ *p_out++ = b;
+ *p_out++ = g;
+ *p_out++ = r;
+ break;
+ };
+ if (rst->pixelType != RL2_PIXEL_PALETTE)
+ {
+ if (rst->noData != NULL)
+ {
+ /* evaluating transparent color */
+ if (eval_transparent_pixels
+ (r, g, b, transpR, transpG, transpB))
+ a = 0;
+ }
+ *p_out++ = a;
+ }
+ }
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ if (red != NULL)
+ free (red);
+ if (green != NULL)
+ free (green);
+ if (blue != NULL)
+ free (blue);
+ return RL2_OK;
+}
+
+static int
+check_as_datagrid (rl2PrivRasterPtr rst, unsigned char sample_type)
+{
+/* check if this raster could be exported as a DATAGRID */
+ if (rst->pixelType == RL2_PIXEL_DATAGRID && rst->sampleType == sample_type)
+ return 1;
+ return 0;
+}
+
+static int
+check_as_grayscale256 (rl2PrivRasterPtr rst)
+{
+/* check if this raster could be exported as a GRAYSCALE 8 bit */
+ if (rst->pixelType == RL2_PIXEL_GRAYSCALE
+ && rst->sampleType == RL2_SAMPLE_UINT8)
+ return 1;
+ return 0;
+}
+
+static int
+check_as_palette256 (rl2PrivRasterPtr rst)
+{
+/* check if this raster could be exported as a PALETTE 8 bit */
+ if (rst->pixelType == RL2_PIXEL_PALETTE
+ && rst->sampleType == RL2_SAMPLE_UINT8)
+ return 1;
+ return 0;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_int8 (rl2RasterPtr ptr, char **buffer, int *buf_size)
+{
+/* attempting to export Raster DATAGRID data as an INT-8 array */
+ char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ char *p_in;
+ char *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_datagrid (rst, RL2_SAMPLE_INT8))
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = (char *) (rst->rasterBuffer);
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ *p_out++ = *p_in++;
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_uint8 (rl2RasterPtr ptr, unsigned char **buffer,
+ int *buf_size)
+{
+/* attempting to export Raster DATAGRID/GRAYSCALE data as a UINT-8 array */
+ unsigned char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_datagrid (rst, RL2_SAMPLE_UINT8))
+ {
+ if (!check_as_grayscale256 (rst) && !check_as_palette256 (rst))
+ return RL2_ERROR;
+ }
+
+ sz = rst->width * rst->height;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = rst->rasterBuffer;
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ *p_out++ = *p_in++;
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_int16 (rl2RasterPtr ptr, short **buffer, int *buf_size)
+{
+/* attempting to export Raster DATAGRID data as an INT-16 array */
+ short *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ short *p_in;
+ short *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_datagrid (rst, RL2_SAMPLE_INT16))
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height * sizeof (short);
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = (short *) (rst->rasterBuffer);
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ *p_out++ = *p_in++;
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_uint16 (rl2RasterPtr ptr, unsigned short **buffer,
+ int *buf_size)
+{
+/* attempting to export Raster DATAGRID data as a UINT-16 array */
+ unsigned short *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ unsigned short *p_in;
+ unsigned short *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_datagrid (rst, RL2_SAMPLE_UINT16))
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height * sizeof (unsigned short);
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = (unsigned short *) (rst->rasterBuffer);
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ *p_out++ = *p_in++;
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_int32 (rl2RasterPtr ptr, int **buffer, int *buf_size)
+{
+/* attempting to export Raster DATAGRID data as an INT-32 array */
+ int *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ int *p_in;
+ int *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_datagrid (rst, RL2_SAMPLE_INT32))
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height * sizeof (int);
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = (int *) (rst->rasterBuffer);
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ *p_out++ = *p_in++;
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_uint32 (rl2RasterPtr ptr, unsigned int **buffer,
+ int *buf_size)
+{
+/* attempting to export Raster DATAGRID data as a UINT-32 array */
+ unsigned int *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ unsigned int *p_in;
+ unsigned int *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_datagrid (rst, RL2_SAMPLE_UINT32))
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height * sizeof (unsigned int);
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = (unsigned int *) (rst->rasterBuffer);
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ *p_out++ = *p_in++;
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_float (rl2RasterPtr ptr, float **buffer, int *buf_size)
+{
+/* attempting to export Raster DATAGRID data as a FLOAT array */
+ float *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ float *p_in;
+ float *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_datagrid (rst, RL2_SAMPLE_FLOAT))
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height * sizeof (float);
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = (float *) (rst->rasterBuffer);
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ *p_out++ = *p_in++;
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_double (rl2RasterPtr ptr, double **buffer, int *buf_size)
+{
+/* attempting to export Raster DATAGRID data as a DOUBLE array */
+ double *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ double *p_in;
+ double *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_datagrid (rst, RL2_SAMPLE_DOUBLE))
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height * sizeof (double);
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = (double *) (rst->rasterBuffer);
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ *p_out++ = *p_in++;
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+static int
+check_as_band (rl2PrivRasterPtr rst, int band, unsigned char sample_type)
+{
+/* check if this raster could be exported as a MULTIBAND */
+ if (rst->pixelType == RL2_PIXEL_MULTIBAND && rst->sampleType == sample_type)
+ {
+ if (band >= 0 && band < rst->nBands)
+ return 1;
+ }
+ if (rst->pixelType == RL2_PIXEL_RGB && rst->sampleType == sample_type)
+ {
+ if (band >= 0 && band < rst->nBands)
+ return 1;
+ }
+ return 0;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_1bit (rl2RasterPtr ptr, unsigned char **buffer,
+ int *buf_size)
+{
+/* attempting to export Raster PALETTE/MONOCHROME 1bit data as a UINT-8 array */
+ unsigned char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (rst->sampleType == RL2_SAMPLE_1_BIT
+ && (rst->pixelType == RL2_PIXEL_MONOCHROME
+ || rst->pixelType == RL2_PIXEL_PALETTE))
+ ;
+ else
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = rst->rasterBuffer;
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ *p_out++ = *p_in++;
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_2bit (rl2RasterPtr ptr, unsigned char **buffer,
+ int *buf_size)
+{
+/* attempting to export Raster PALETTE/GRAYSCALE 2bit data as a UINT-8 array */
+ unsigned char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (rst->sampleType == RL2_SAMPLE_2_BIT
+ && (rst->pixelType == RL2_PIXEL_PALETTE
+ || rst->pixelType == RL2_PIXEL_GRAYSCALE))
+ ;
+ else
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = rst->rasterBuffer;
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ *p_out++ = *p_in++;
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_data_to_4bit (rl2RasterPtr ptr, unsigned char **buffer,
+ int *buf_size)
+{
+/* attempting to export Raster PALETTE/GRAYSCALE 4bit data as a UINT-8 array */
+ unsigned char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (rst->sampleType == RL2_SAMPLE_4_BIT
+ && (rst->pixelType == RL2_PIXEL_PALETTE
+ || rst->pixelType == RL2_PIXEL_GRAYSCALE))
+ ;
+ else
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = rst->rasterBuffer;
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ *p_out++ = *p_in++;
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_band_to_uint8 (rl2RasterPtr ptr, int band, unsigned char **buffer,
+ int *buf_size)
+{
+/* attempting to export Raster BAND data as a UINT-8 array */
+ unsigned char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ int nBand;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_band (rst, band, RL2_SAMPLE_UINT8))
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = rst->rasterBuffer;
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ {
+ for (nBand = 0; nBand < rst->nBands; nBand++)
+ {
+ if (nBand == band)
+ *p_out++ = *p_in++;
+ else
+ p_in++;
+ }
+ }
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_band_to_uint16 (rl2RasterPtr ptr, int band, unsigned short **buffer,
+ int *buf_size)
+{
+/* attempting to export Raster BAND data as a UINT-16 array */
+ unsigned short *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ int nBand;
+ unsigned short *p_in;
+ unsigned short *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_band (rst, band, RL2_SAMPLE_UINT16))
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height * sizeof (unsigned short);
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = (unsigned short *) (rst->rasterBuffer);
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ {
+ for (nBand = 0; nBand < rst->nBands; nBand++)
+ {
+ if (nBand == band)
+ *p_out++ = *p_in++;
+ else
+ p_in++;
+ }
+ }
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_bands_to_RGB (rl2RasterPtr ptr, int bandR, int bandG, int bandB,
+ unsigned char **buffer, int *buf_size)
+{
+/* attempting to export Raster MULTIBAND data as an RGB array */
+ unsigned char *buf;
+ int sz;
+ unsigned int row;
+ unsigned int col;
+ int nBand;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+
+ *buffer = NULL;
+ *buf_size = 0;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (!check_as_band (rst, bandR, RL2_SAMPLE_UINT8))
+ return RL2_ERROR;
+ if (!check_as_band (rst, bandG, RL2_SAMPLE_UINT8))
+ return RL2_ERROR;
+ if (!check_as_band (rst, bandB, RL2_SAMPLE_UINT8))
+ return RL2_ERROR;
+
+ sz = rst->width * rst->height * 3;
+ buf = malloc (sz);
+ if (buf == NULL)
+ return RL2_ERROR;
+
+ p_in = rst->rasterBuffer;
+ p_out = buf;
+ for (row = 0; row < rst->height; row++)
+ {
+ for (col = 0; col < rst->width; col++)
+ {
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ for (nBand = 0; nBand < rst->nBands; nBand++)
+ {
+ if (nBand == bandR)
+ red = *p_in;
+ if (nBand == bandG)
+ green = *p_in;
+ if (nBand == bandB)
+ blue = *p_in;
+ p_in++;
+ }
+ *p_out++ = red;
+ *p_out++ = green;
+ *p_out++ = blue;
+ }
+ }
+
+ *buffer = buf;
+ *buf_size = sz;
+ return RL2_OK;
+}
diff --git a/src/rl2sql.c b/src/rl2sql.c
new file mode 100644
index 0000000..f224485
--- /dev/null
+++ b/src/rl2sql.c
@@ -0,0 +1,7040 @@
+/*
+
+ rl2sql -- main SQLite extension methods
+
+ version 0.1, 2013 December 22
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <limits.h>
+
+#ifdef _WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2wms.h"
+#include "rasterlite2/rl2graphics.h"
+#include "rasterlite2_private.h"
+
+#include <spatialite/gaiaaux.h>
+
+#define RL2_UNUSED() if (argc || argv) argc = argc;
+
+/* 64 bit integer: portable format for printf() */
+#if defined(_WIN32) && !defined(__MINGW32__)
+#define ERR_FRMT64 "ERROR: unable to decode Tile ID=%I64d\n"
+#else
+#define ERR_FRMT64 "ERROR: unable to decode Tile ID=%lld\n"
+#endif
+
+static void
+fnct_rl2_version (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ rl2_version()
+/
+/ return a text string representing the current RasterLite-2 version
+*/
+ int len;
+ const char *p_result = rl2_version ();
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+ len = strlen (p_result);
+ sqlite3_result_text (context, p_result, len, SQLITE_TRANSIENT);
+}
+
+static void
+fnct_rl2_target_cpu (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ rl2_target_cpu()
+/
+/ return a text string representing the current RasterLite-2 Target CPU
+*/
+ int len;
+ const char *p_result = rl2_target_cpu ();
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+ len = strlen (p_result);
+ sqlite3_result_text (context, p_result, len, SQLITE_TRANSIENT);
+}
+
+static void
+fnct_IsValidPixel (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ IsValidPixel(BLOBencoded pixel, text sample_type, int num_bands)
+/
+/ will return 1 (TRUE, valid) or 0 (FALSE, invalid)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int ret;
+ const unsigned char *blob;
+ int blob_sz;
+ const char *sample;
+ int bands;
+ unsigned char sample_type = RL2_SAMPLE_UNKNOWN;
+ unsigned char num_bands = RL2_BANDS_UNKNOWN;
+ int err = 0;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ sqlite3_result_int (context, -1);
+ else
+ {
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ sample = (const char *) sqlite3_value_text (argv[1]);
+ bands = sqlite3_value_int (argv[2]);
+ if (strcmp (sample, "1-BIT") == 0)
+ sample_type = RL2_SAMPLE_1_BIT;
+ if (strcmp (sample, "2-BIT") == 0)
+ sample_type = RL2_SAMPLE_2_BIT;
+ if (strcmp (sample, "4-BIT") == 0)
+ sample_type = RL2_SAMPLE_4_BIT;
+ if (strcmp (sample, "INT8") == 0)
+ sample_type = RL2_SAMPLE_INT8;
+ if (strcmp (sample, "UINT8") == 0)
+ sample_type = RL2_SAMPLE_UINT8;
+ if (strcmp (sample, "INT16") == 0)
+ sample_type = RL2_SAMPLE_INT16;
+ if (strcmp (sample, "UINT16") == 0)
+ sample_type = RL2_SAMPLE_UINT16;
+ if (strcmp (sample, "INT32") == 0)
+ sample_type = RL2_SAMPLE_INT32;
+ if (strcmp (sample, "UINT32") == 0)
+ sample_type = RL2_SAMPLE_UINT32;
+ if (strcmp (sample, "FLOAT") == 0)
+ sample_type = RL2_SAMPLE_FLOAT;
+ if (strcmp (sample, "DOUBLE") == 0)
+ sample_type = RL2_SAMPLE_DOUBLE;
+ if (bands > 0 && bands < 256)
+ num_bands = bands;
+ if (sample_type == RL2_SAMPLE_UNKNOWN
+ || num_bands == RL2_BANDS_UNKNOWN)
+ {
+ sqlite3_result_int (context, 0);
+ return;
+ }
+ ret = rl2_is_valid_dbms_pixel (blob, blob_sz, sample_type, num_bands);
+ if (ret == RL2_OK)
+ sqlite3_result_int (context, 1);
+ else
+ sqlite3_result_int (context, 0);
+ }
+}
+
+static void
+fnct_IsValidRasterPalette (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ IsValidRasterPalette(BLOBencoded palette, text sample_type)
+/
+/ will return 1 (TRUE, valid) or 0 (FALSE, invalid)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int ret;
+ const unsigned char *blob;
+ int blob_sz;
+ const char *sample;
+ unsigned char sample_type = RL2_SAMPLE_UNKNOWN;
+ int err = 0;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (err)
+ sqlite3_result_int (context, -1);
+ else
+ {
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ sample = (const char *) sqlite3_value_text (argv[1]);
+ if (strcmp (sample, "1-BIT") == 0)
+ sample_type = RL2_SAMPLE_1_BIT;
+ if (strcmp (sample, "2-BIT") == 0)
+ sample_type = RL2_SAMPLE_2_BIT;
+ if (strcmp (sample, "4-BIT") == 0)
+ sample_type = RL2_SAMPLE_4_BIT;
+ if (strcmp (sample, "INT8") == 0)
+ sample_type = RL2_SAMPLE_INT8;
+ if (strcmp (sample, "UINT8") == 0)
+ sample_type = RL2_SAMPLE_UINT8;
+ if (strcmp (sample, "INT16") == 0)
+ sample_type = RL2_SAMPLE_INT16;
+ if (strcmp (sample, "UINT16") == 0)
+ sample_type = RL2_SAMPLE_UINT16;
+ if (strcmp (sample, "INT32") == 0)
+ sample_type = RL2_SAMPLE_INT32;
+ if (strcmp (sample, "UINT32") == 0)
+ sample_type = RL2_SAMPLE_UINT32;
+ if (strcmp (sample, "FLOAT") == 0)
+ sample_type = RL2_SAMPLE_FLOAT;
+ if (strcmp (sample, "DOUBLE") == 0)
+ sample_type = RL2_SAMPLE_DOUBLE;
+ if (sample_type == RL2_SAMPLE_UNKNOWN)
+ {
+ sqlite3_result_int (context, 0);
+ return;
+ }
+ ret = rl2_is_valid_dbms_palette (blob, blob_sz, sample_type);
+ if (ret == RL2_OK)
+ sqlite3_result_int (context, 1);
+ else
+ sqlite3_result_int (context, 0);
+ }
+}
+
+static void
+fnct_IsValidRasterStatistics (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ IsValidRasterStatistics(text covarage, BLOBencoded statistics)
+/ or
+/ IsValidRasterStatistics((BLOBencoded statistics, text sample_type, int num_bands)
+/
+/ will return 1 (TRUE, valid) or 0 (FALSE, invalid)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int ret;
+ const unsigned char *blob;
+ int blob_sz;
+ const char *coverage;
+ const char *sample;
+ int bands;
+ unsigned char sample_type = RL2_SAMPLE_UNKNOWN;
+ unsigned char num_bands = RL2_BANDS_UNKNOWN;
+ sqlite3 *sqlite;
+ int err = 0;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (argc == 3)
+ {
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ sample = (const char *) sqlite3_value_text (argv[1]);
+ bands = sqlite3_value_int (argv[2]);
+ if (strcmp (sample, "1-BIT") == 0)
+ sample_type = RL2_SAMPLE_1_BIT;
+ if (strcmp (sample, "2-BIT") == 0)
+ sample_type = RL2_SAMPLE_2_BIT;
+ if (strcmp (sample, "4-BIT") == 0)
+ sample_type = RL2_SAMPLE_4_BIT;
+ if (strcmp (sample, "INT8") == 0)
+ sample_type = RL2_SAMPLE_INT8;
+ if (strcmp (sample, "UINT8") == 0)
+ sample_type = RL2_SAMPLE_UINT8;
+ if (strcmp (sample, "INT16") == 0)
+ sample_type = RL2_SAMPLE_INT16;
+ if (strcmp (sample, "UINT16") == 0)
+ sample_type = RL2_SAMPLE_UINT16;
+ if (strcmp (sample, "INT32") == 0)
+ sample_type = RL2_SAMPLE_INT32;
+ if (strcmp (sample, "UINT32") == 0)
+ sample_type = RL2_SAMPLE_UINT32;
+ if (strcmp (sample, "FLOAT") == 0)
+ sample_type = RL2_SAMPLE_FLOAT;
+ if (strcmp (sample, "DOUBLE") == 0)
+ sample_type = RL2_SAMPLE_DOUBLE;
+ if (bands > 0 && bands < 256)
+ num_bands = bands;
+ if (sample_type == RL2_SAMPLE_UNKNOWN
+ || num_bands == RL2_BANDS_UNKNOWN)
+ {
+ sqlite3_result_int (context, 0);
+ return;
+ }
+ }
+ else
+ {
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_BLOB)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = (const char *) sqlite3_value_text (argv[0]);
+ blob = sqlite3_value_blob (argv[1]);
+ blob_sz = sqlite3_value_bytes (argv[1]);
+ if (!get_coverage_sample_bands
+ (sqlite, coverage, &sample_type, &num_bands))
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ ret =
+ rl2_is_valid_dbms_raster_statistics (blob, blob_sz, sample_type,
+ num_bands);
+ if (ret == RL2_OK)
+ sqlite3_result_int (context, 1);
+ else
+ sqlite3_result_int (context, 0);
+}
+
+static void
+fnct_IsValidRasterTile (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ IsValidRasterTile(text coverage, integer level, BLOBencoded tile_odd,
+/ BLOBencoded tile_even)
+/
+/ will return 1 (TRUE, valid) or 0 (FALSE, invalid)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int ret;
+ int level;
+ const unsigned char *blob_odd;
+ int blob_odd_sz;
+ const unsigned char *blob_even;
+ int blob_even_sz;
+ const char *coverage;
+ unsigned int tile_width;
+ unsigned int tile_height;
+ unsigned char sample_type = RL2_SAMPLE_UNKNOWN;
+ unsigned char pixel_type = RL2_PIXEL_UNKNOWN;
+ unsigned char num_bands = RL2_BANDS_UNKNOWN;
+ unsigned char compression = RL2_COMPRESSION_UNKNOWN;
+ sqlite3 *sqlite;
+ int err = 0;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_BLOB
+ && sqlite3_value_type (argv[3]) != SQLITE_NULL)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = (const char *) sqlite3_value_text (argv[0]);
+ level = sqlite3_value_int (argv[1]);
+ blob_odd = sqlite3_value_blob (argv[2]);
+ blob_odd_sz = sqlite3_value_bytes (argv[2]);
+ if (sqlite3_value_type (argv[3]) == SQLITE_NULL)
+ {
+ blob_even = NULL;
+ blob_even_sz = 0;
+ }
+ else
+ {
+ blob_even = sqlite3_value_blob (argv[3]);
+ blob_even_sz = sqlite3_value_bytes (argv[3]);
+ }
+ if (!get_coverage_defs
+ (sqlite, coverage, &tile_width, &tile_height, &sample_type, &pixel_type,
+ &num_bands, &compression))
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ ret =
+ rl2_is_valid_dbms_raster_tile (level, tile_width, tile_height, blob_odd,
+ blob_odd_sz, blob_even, blob_even_sz,
+ sample_type, pixel_type, num_bands,
+ compression);
+ if (ret == RL2_OK)
+ sqlite3_result_int (context, 1);
+ else
+ sqlite3_result_int (context, 0);
+}
+
+static void
+fnct_GetPaletteNumEntries (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetPaletteNumEntries(BLOB pixel_obj)
+/
+/ will return the number of Color Entries
+/ or NULL on failure
+*/
+ const unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PalettePtr plt = NULL;
+ rl2PrivPalettePtr palette;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ plt = rl2_deserialize_dbms_palette (blob, blob_sz);
+ if (plt == NULL)
+ goto error;
+ palette = (rl2PrivPalettePtr) plt;
+ sqlite3_result_int (context, palette->nEntries);
+ rl2_destroy_palette (plt);
+ return;
+
+ error:
+ sqlite3_result_null (context);
+ if (plt != NULL)
+ rl2_destroy_palette (plt);
+}
+
+static void
+fnct_GetPaletteColorEntry (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetPaletteColorEntry(BLOB pixel_obj, INT index)
+/
+/ will return the corresponding Color entry
+/ or NULL on failure
+*/
+ const unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PalettePtr plt = NULL;
+ rl2PrivPalettePtr palette;
+ rl2PrivPaletteEntryPtr entry;
+ int entry_id;
+ char color[16];
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ goto error;
+
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ entry_id = sqlite3_value_int (argv[1]);
+ plt = rl2_deserialize_dbms_palette (blob, blob_sz);
+ if (plt == NULL)
+ goto error;
+ palette = (rl2PrivPalettePtr) plt;
+ if (entry_id >= 0 && entry_id < palette->nEntries)
+ ;
+ else
+ goto error;
+ entry = palette->entries + entry_id;
+ sprintf (color, "#%02x%02x%02x", entry->red, entry->green, entry->blue);
+ sqlite3_result_text (context, color, strlen (color), SQLITE_TRANSIENT);
+ rl2_destroy_palette (plt);
+ return;
+
+ error:
+ sqlite3_result_null (context);
+ if (plt != NULL)
+ rl2_destroy_palette (plt);
+}
+
+static void
+fnct_SetPaletteColorEntry (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ SetPaletteColorEntry(BLOB pixel_obj, INT index, TEXT color)
+/
+/ will return a new palette including the changed color
+/ or NULL on failure
+*/
+ const unsigned char *blob = NULL;
+ unsigned char *blb;
+ int blob_sz = 0;
+ rl2PalettePtr plt = NULL;
+ rl2PrivPalettePtr palette;
+ rl2PrivPaletteEntryPtr entry;
+ int entry_id;
+ const char *color;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ goto error;
+ if (sqlite3_value_type (argv[2]) != SQLITE_TEXT)
+ goto error;
+
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ entry_id = sqlite3_value_int (argv[1]);
+ color = (const char *) sqlite3_value_text (argv[2]);
+/* parsing the background color */
+ if (rl2_parse_hexrgb (color, &red, &green, &blue) != RL2_OK)
+ goto error;
+ plt = rl2_deserialize_dbms_palette (blob, blob_sz);
+ if (plt == NULL)
+ goto error;
+ palette = (rl2PrivPalettePtr) plt;
+ if (entry_id >= 0 && entry_id < palette->nEntries)
+ ;
+ else
+ goto error;
+ entry = palette->entries + entry_id;
+ entry->red = red;
+ entry->green = green;
+ entry->blue = blue;
+ rl2_serialize_dbms_palette (plt, &blb, &blob_sz);
+ sqlite3_result_blob (context, blb, blob_sz, free);
+ rl2_destroy_palette (plt);
+ return;
+
+ error:
+ sqlite3_result_null (context);
+ if (plt != NULL)
+ rl2_destroy_palette (plt);
+}
+
+static void
+fnct_PaletteEquals (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ PaletteEquals(BLOB palette_obj1, BLOB palette_obj2)
+/
+/ 1 (TRUE) or 0 (FALSE)
+/ or -1 on invalid argument
+*/
+ const unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PalettePtr plt1 = NULL;
+ rl2PalettePtr plt2 = NULL;
+ int ret;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+ if (sqlite3_value_type (argv[1]) != SQLITE_BLOB)
+ goto error;
+
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ plt1 = rl2_deserialize_dbms_palette (blob, blob_sz);
+ if (plt1 == NULL)
+ goto error;
+ blob = sqlite3_value_blob (argv[1]);
+ blob_sz = sqlite3_value_bytes (argv[1]);
+ plt2 = rl2_deserialize_dbms_palette (blob, blob_sz);
+ if (plt2 == NULL)
+ goto error;
+ ret = rl2_compare_palettes (plt1, plt2);
+ if (ret == RL2_TRUE)
+ sqlite3_result_int (context, 1);
+ else
+ sqlite3_result_int (context, 0);
+ rl2_destroy_palette (plt1);
+ rl2_destroy_palette (plt2);
+ return;
+
+ error:
+ sqlite3_result_int (context, -1);
+ if (plt1 != NULL)
+ rl2_destroy_palette (plt1);
+ if (plt2 != NULL)
+ rl2_destroy_palette (plt2);
+}
+
+static void
+fnct_CreatePixel (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ CreatePixel(text sample_type, text pixel_type, int num_bands)
+/
+/ will return a serialized binary Pixel Object
+/ or NULL on failure
+*/
+ int err = 0;
+ const char *sample_type;
+ const char *pixel_type;
+ int num_bands;
+ unsigned char sample;
+ unsigned char pixel;
+ rl2PixelPtr pxl = NULL;
+ unsigned char *blob = NULL;
+ int blob_sz = 0;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ goto error;
+
+/* retrieving the arguments */
+ sample_type = (const char *) sqlite3_value_text (argv[0]);
+ pixel_type = (const char *) sqlite3_value_text (argv[1]);
+ num_bands = sqlite3_value_int (argv[2]);
+
+/* preliminary arg checking */
+ if (num_bands < 1 || num_bands > 255)
+ goto error;
+
+ sample = RL2_SAMPLE_UNKNOWN;
+ if (strcasecmp (sample_type, "1-BIT") == 0)
+ sample = RL2_SAMPLE_1_BIT;
+ if (strcasecmp (sample_type, "2-BIT") == 0)
+ sample = RL2_SAMPLE_2_BIT;
+ if (strcasecmp (sample_type, "4-BIT") == 0)
+ sample = RL2_SAMPLE_4_BIT;
+ if (strcasecmp (sample_type, "INT8") == 0)
+ sample = RL2_SAMPLE_INT8;
+ if (strcasecmp (sample_type, "UINT8") == 0)
+ sample = RL2_SAMPLE_UINT8;
+ if (strcasecmp (sample_type, "INT16") == 0)
+ sample = RL2_SAMPLE_INT16;
+ if (strcasecmp (sample_type, "UINT16") == 0)
+ sample = RL2_SAMPLE_UINT16;
+ if (strcasecmp (sample_type, "INT32") == 0)
+ sample = RL2_SAMPLE_INT32;
+ if (strcasecmp (sample_type, "UINT32") == 0)
+ sample = RL2_SAMPLE_UINT32;
+ if (strcasecmp (sample_type, "FLOAT") == 0)
+ sample = RL2_SAMPLE_FLOAT;
+ if (strcasecmp (sample_type, "DOUBLE") == 0)
+ sample = RL2_SAMPLE_DOUBLE;
+
+ pixel = RL2_PIXEL_UNKNOWN;
+ if (strcasecmp (pixel_type, "MONOCHROME") == 0)
+ pixel = RL2_PIXEL_MONOCHROME;
+ if (strcasecmp (pixel_type, "GRAYSCALE") == 0)
+ pixel = RL2_PIXEL_GRAYSCALE;
+ if (strcasecmp (pixel_type, "PALETTE") == 0)
+ pixel = RL2_PIXEL_PALETTE;
+ if (strcasecmp (pixel_type, "RGB") == 0)
+ pixel = RL2_PIXEL_RGB;
+ if (strcasecmp (pixel_type, "DATAGRID") == 0)
+ pixel = RL2_PIXEL_DATAGRID;
+ if (strcasecmp (pixel_type, "MULTIBAND") == 0)
+ pixel = RL2_PIXEL_MULTIBAND;
+
+/* attempting to create the Pixel */
+ pxl = rl2_create_pixel (sample, pixel, (unsigned char) num_bands);
+ if (pxl == NULL)
+ goto error;
+ if (rl2_serialize_dbms_pixel (pxl, &blob, &blob_sz) != RL2_OK)
+ goto error;
+ sqlite3_result_blob (context, blob, blob_sz, free);
+ rl2_destroy_pixel (pxl);
+ return;
+
+ error:
+ sqlite3_result_null (context);
+ if (pxl != NULL)
+ rl2_destroy_pixel (pxl);
+}
+
+static void
+fnct_GetPixelSampleType (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetPixelSampleType(BLOB pixel_obj)
+/
+/ will return one of "1-BIT", "2-BIT", "4-BIT", "INT8", "UINT8", "INT16",
+/ "UINT16", "INT32", "UINT32", "FLOAT", "DOUBLE", "UNKNOWN"
+/ or NULL on failure
+*/
+ const unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PixelPtr pxl = NULL;
+ rl2PrivPixelPtr pixel;
+ const char *text;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ pxl = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (pxl == NULL)
+ goto error;
+ pixel = (rl2PrivPixelPtr) pxl;
+ switch (pixel->sampleType)
+ {
+ case RL2_SAMPLE_1_BIT:
+ text = "1-BIT";
+ break;
+ case RL2_SAMPLE_2_BIT:
+ text = "2-BIT";
+ break;
+ case RL2_SAMPLE_4_BIT:
+ text = "4-BIT";
+ break;
+ case RL2_SAMPLE_INT8:
+ text = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ text = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ text = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ text = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ text = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ text = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ text = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ text = "DOUBLE";
+ break;
+ default:
+ text = "UNKNOWN";
+ break;
+ };
+ sqlite3_result_text (context, text, strlen (text), SQLITE_TRANSIENT);
+ rl2_destroy_pixel (pxl);
+ return;
+
+ error:
+ sqlite3_result_null (context);
+ if (pxl != NULL)
+ rl2_destroy_pixel (pxl);
+}
+
+static void
+fnct_GetPixelType (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetPixelType(BLOB pixel_obj)
+/
+/ will return one of "MONOCHROME" "PALETTE", "GRAYSCALE", "RGB",
+/ "DATAGRID", "MULTIBAND", "UNKNOWN"
+/ or NULL on failure
+*/
+ const unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PixelPtr pxl = NULL;
+ rl2PrivPixelPtr pixel;
+ const char *text;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ pxl = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (pxl == NULL)
+ goto error;
+ pixel = (rl2PrivPixelPtr) pxl;
+ switch (pixel->pixelType)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ text = "MONOCHROME";
+ break;
+ case RL2_PIXEL_PALETTE:
+ text = "PALETTE";
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ text = "GRAYSCALE";
+ break;
+ case RL2_PIXEL_RGB:
+ text = "RGB";
+ break;
+ case RL2_PIXEL_DATAGRID:
+ text = "DATAGRID";
+ break;
+ case RL2_PIXEL_MULTIBAND:
+ text = "MULTIBAND";
+ break;
+ default:
+ text = "UNKNOWN";
+ break;
+ };
+ sqlite3_result_text (context, text, strlen (text), SQLITE_TRANSIENT);
+ rl2_destroy_pixel (pxl);
+ return;
+
+ error:
+ sqlite3_result_null (context);
+ if (pxl != NULL)
+ rl2_destroy_pixel (pxl);
+}
+
+static void
+fnct_GetPixelNumBands (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetPixelNumBands(BLOB pixel_obj)
+/
+/ will return the number of Bands
+/ or NULL on failure
+*/
+ const unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PixelPtr pxl = NULL;
+ rl2PrivPixelPtr pixel;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ pxl = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (pxl == NULL)
+ goto error;
+ pixel = (rl2PrivPixelPtr) pxl;
+ sqlite3_result_int (context, pixel->nBands);
+ rl2_destroy_pixel (pxl);
+ return;
+
+ error:
+ sqlite3_result_null (context);
+ if (pxl != NULL)
+ rl2_destroy_pixel (pxl);
+}
+
+static void
+fnct_GetPixelValue (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetPixelValue(BLOB pixel_obj, INT band)
+/
+/ will return the corresponding Band value
+/ or NULL on failure
+*/
+ const unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PixelPtr pxl = NULL;
+ rl2PrivPixelPtr pixel;
+ rl2PrivSamplePtr sample;
+ int band_id;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ goto error;
+
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ band_id = sqlite3_value_int (argv[1]);
+ pxl = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (pxl == NULL)
+ goto error;
+ pixel = (rl2PrivPixelPtr) pxl;
+ if (band_id >= 0 && band_id < pixel->nBands)
+ ;
+ else
+ goto error;
+ sample = pixel->Samples + band_id;
+ switch (pixel->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ sqlite3_result_int (context, sample->int8);
+ break;
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ sqlite3_result_int (context, sample->uint8);
+ break;
+ case RL2_SAMPLE_INT16:
+ sqlite3_result_int (context, sample->int16);
+ break;
+ case RL2_SAMPLE_UINT16:
+ sqlite3_result_int (context, sample->uint16);
+ break;
+ case RL2_SAMPLE_INT32:
+ sqlite3_result_int64 (context, sample->int32);
+ break;
+ case RL2_SAMPLE_UINT32:
+ sqlite3_result_int64 (context, sample->uint32);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sqlite3_result_double (context, sample->float32);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sqlite3_result_double (context, sample->float64);
+ break;
+ default:
+ goto error;
+ };
+ rl2_destroy_pixel (pxl);
+ return;
+
+ error:
+ sqlite3_result_null (context);
+ if (pxl != NULL)
+ rl2_destroy_pixel (pxl);
+}
+
+static void
+fnct_SetPixelValue (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ SetPixelValue(BLOB pixel_obj, INT band, INT value)
+/ SetPixelValue(BLOB pixel_obj, INT band, FLOAT value)
+/
+/ will return a new serialized Pixel Object
+/ or NULL on failure
+*/
+ unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PixelPtr pxl = NULL;
+ rl2PrivPixelPtr pixel;
+ rl2PrivSamplePtr sample;
+ int band_id;
+ int intval;
+ double dblval;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ goto error;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[2]) != SQLITE_FLOAT)
+ goto error;
+
+ blob = (unsigned char *) sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ band_id = sqlite3_value_int (argv[1]);
+ pxl = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (pxl == NULL)
+ goto error;
+ pixel = (rl2PrivPixelPtr) pxl;
+ if (band_id >= 0 && band_id < pixel->nBands)
+ ;
+ else
+ goto error;
+ if (pixel->sampleType == RL2_SAMPLE_FLOAT
+ || pixel->sampleType == RL2_SAMPLE_DOUBLE)
+ {
+ if (sqlite3_value_type (argv[2]) == SQLITE_FLOAT)
+ dblval = sqlite3_value_double (argv[2]);
+ else
+ {
+ intval = sqlite3_value_int (argv[2]);
+ dblval = intval;
+ }
+ }
+ else
+ {
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ goto error;
+ intval = sqlite3_value_int (argv[2]);
+ }
+ sample = pixel->Samples + band_id;
+ switch (pixel->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ if (intval < INT8_MIN || intval > INT8_MAX)
+ goto error;
+ break;
+ case RL2_SAMPLE_1_BIT:
+ if (intval < 0 || intval > 1)
+ goto error;
+ break;
+ case RL2_SAMPLE_2_BIT:
+ if (intval < 0 || intval > 3)
+ goto error;
+ break;
+ case RL2_SAMPLE_4_BIT:
+ if (intval < 0 || intval > 15)
+ goto error;
+ break;
+ case RL2_SAMPLE_UINT8:
+ if (intval < 0 || intval > UINT8_MAX)
+ goto error;
+ break;
+ case RL2_SAMPLE_INT16:
+ if (intval < INT16_MIN || intval > INT16_MAX)
+ goto error;
+ break;
+ case RL2_SAMPLE_UINT16:
+ if (intval < 0 || intval > UINT16_MAX)
+ goto error;
+ break;
+ };
+ switch (pixel->sampleType)
+ {
+ case RL2_SAMPLE_INT8:
+ sample->int8 = intval;
+ break;
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ sample->uint8 = intval;
+ break;
+ case RL2_SAMPLE_INT16:
+ sample->int16 = intval;
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample->uint16 = intval;
+ break;
+ case RL2_SAMPLE_INT32:
+ sample->int32 = intval;
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample->uint32 = (unsigned int) intval;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample->float32 = dblval;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample->float64 = dblval;
+ break;
+ default:
+ goto error;
+ };
+ if (rl2_serialize_dbms_pixel (pxl, &blob, &blob_sz) != RL2_OK)
+ goto error;
+ sqlite3_result_blob (context, blob, blob_sz, free);
+ rl2_destroy_pixel (pxl);
+ return;
+
+ error:
+ sqlite3_result_null (context);
+ if (pxl != NULL)
+ rl2_destroy_pixel (pxl);
+}
+
+static void
+fnct_IsTransparentPixel (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ IsTransparentPixel(BLOB pixel_obj)
+/
+/ 1 (TRUE) or 0 (FALSE)
+/ or -1 on invalid argument
+*/
+ const unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PixelPtr pxl = NULL;
+ rl2PrivPixelPtr pixel;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ pxl = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (pxl == NULL)
+ goto error;
+ pixel = (rl2PrivPixelPtr) pxl;
+ if (pixel->isTransparent == 0)
+ sqlite3_result_int (context, 0);
+ else
+ sqlite3_result_int (context, 1);
+ rl2_destroy_pixel (pxl);
+ return;
+
+ error:
+ sqlite3_result_int (context, -1);
+ if (pxl != NULL)
+ rl2_destroy_pixel (pxl);
+}
+
+static void
+fnct_IsOpaquePixel (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ IsOpaquePixel(BLOB pixel_obj)
+/
+/ 1 (TRUE) or 0 (FALSE)
+/ or -1 on invalid argument
+*/
+ const unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PixelPtr pxl = NULL;
+ rl2PrivPixelPtr pixel;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ pxl = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (pxl == NULL)
+ goto error;
+ pixel = (rl2PrivPixelPtr) pxl;
+ if (pixel->isTransparent == 0)
+ sqlite3_result_int (context, 1);
+ else
+ sqlite3_result_int (context, 0);
+ rl2_destroy_pixel (pxl);
+ return;
+
+ error:
+ sqlite3_result_int (context, -1);
+ if (pxl != NULL)
+ rl2_destroy_pixel (pxl);
+}
+
+static void
+fnct_SetTransparentPixel (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ SetTransparentPixel(BLOB pixel_obj)
+/
+/ will return a new serialized Pixel Object
+/ or NULL on failure
+*/
+ unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PixelPtr pxl = NULL;
+ rl2PrivPixelPtr pixel;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+
+ blob = (unsigned char *) sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ pxl = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (pxl == NULL)
+ goto error;
+ pixel = (rl2PrivPixelPtr) pxl;
+ pixel->isTransparent = 1;
+ if (rl2_serialize_dbms_pixel (pxl, &blob, &blob_sz) != RL2_OK)
+ goto error;
+ sqlite3_result_blob (context, blob, blob_sz, free);
+ rl2_destroy_pixel (pxl);
+ return;
+
+ error:
+ sqlite3_result_null (context);
+ if (pxl != NULL)
+ rl2_destroy_pixel (pxl);
+}
+
+static void
+fnct_SetOpaquePixel (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ SetOpaquePixel(BLOB pixel_obj)
+/
+/ will return a new serialized Pixel Object
+/ or NULL on failure
+*/
+ unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PixelPtr pxl = NULL;
+ rl2PrivPixelPtr pixel;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+
+ blob = (unsigned char *) sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ pxl = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (pxl == NULL)
+ goto error;
+ pixel = (rl2PrivPixelPtr) pxl;
+ pixel->isTransparent = 0;
+ if (rl2_serialize_dbms_pixel (pxl, &blob, &blob_sz) != RL2_OK)
+ goto error;
+ sqlite3_result_blob (context, blob, blob_sz, free);
+ rl2_destroy_pixel (pxl);
+ return;
+
+ error:
+ sqlite3_result_null (context);
+ if (pxl != NULL)
+ rl2_destroy_pixel (pxl);
+}
+
+static void
+fnct_PixelEquals (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ PixelEquals(BLOB pixel_obj1, BLOB pixel_obj2)
+/
+/ 1 (TRUE) or 0 (FALSE)
+/ or -1 on invalid argument
+*/
+ const unsigned char *blob = NULL;
+ int blob_sz = 0;
+ rl2PixelPtr pxl1 = NULL;
+ rl2PixelPtr pxl2 = NULL;
+ int ret;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ goto error;
+ if (sqlite3_value_type (argv[1]) != SQLITE_BLOB)
+ goto error;
+
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ pxl1 = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (pxl1 == NULL)
+ goto error;
+ blob = sqlite3_value_blob (argv[1]);
+ blob_sz = sqlite3_value_bytes (argv[1]);
+ pxl2 = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (pxl2 == NULL)
+ goto error;
+ ret = rl2_compare_pixels (pxl1, pxl2);
+ if (ret == RL2_TRUE)
+ sqlite3_result_int (context, 1);
+ else
+ sqlite3_result_int (context, 0);
+ rl2_destroy_pixel (pxl1);
+ rl2_destroy_pixel (pxl2);
+ return;
+
+ error:
+ sqlite3_result_int (context, -1);
+ if (pxl1 != NULL)
+ rl2_destroy_pixel (pxl1);
+ if (pxl2 != NULL)
+ rl2_destroy_pixel (pxl2);
+}
+
+static void
+fnct_GetRasterStatistics_NoDataPixelsCount (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetRasterStatistics_NoDataPixelsCount(BLOBencoded statistics)
+/
+/ will return the total count of NoData pixels
+/ or NULL (INVALID ARGS)
+/
+*/
+ const unsigned char *blob;
+ int blob_sz;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ stats = rl2_deserialize_dbms_raster_statistics (blob, blob_sz);
+ if (stats == NULL)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ sqlite3_result_int64 (context, st->no_data);
+ rl2_destroy_raster_statistics (stats);
+}
+
+static void
+fnct_GetRasterStatistics_ValidPixelsCount (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetRasterStatistics_ValidPixelsCount(BLOBencoded statistics)
+/
+/ will return the total count of valid pixels
+/ or NULL (INVALID ARGS)
+/
+*/
+ const unsigned char *blob;
+ int blob_sz;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ stats = rl2_deserialize_dbms_raster_statistics (blob, blob_sz);
+ if (stats == NULL)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ sqlite3_result_int64 (context, st->count);
+ rl2_destroy_raster_statistics (stats);
+}
+
+static void
+fnct_GetRasterStatistics_SampleType (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetRasterStatistics_SampleType(BLOBencoded statistics)
+/
+/ will return the name of the SampleType
+/ or NULL (INVALID ARGS)
+/
+*/
+ const unsigned char *blob;
+ int blob_sz;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ const char *name = NULL;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ stats = rl2_deserialize_dbms_raster_statistics (blob, blob_sz);
+ if (stats == NULL)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ switch (st->sampleType)
+ {
+ case RL2_SAMPLE_1_BIT:
+ name = "1-BIT";
+ break;
+ case RL2_SAMPLE_2_BIT:
+ name = "2-BIT";
+ break;
+ case RL2_SAMPLE_4_BIT:
+ name = "4-BIT";
+ break;
+ case RL2_SAMPLE_INT8:
+ name = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ name = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ name = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ name = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ name = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ name = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ name = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ name = "DOUBLE";
+ break;
+ };
+ if (name == NULL)
+ sqlite3_result_null (context);
+ else
+ sqlite3_result_text (context, name, strlen (name), SQLITE_STATIC);
+ rl2_destroy_raster_statistics (stats);
+}
+
+static void
+fnct_GetRasterStatistics_BandsCount (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetRasterStatistics_BandsCount(BLOBencoded statistics)
+/
+/ will return how many Bands are into this statistics object
+/ or NULL (INVALID ARGS)
+/
+*/
+ const unsigned char *blob;
+ int blob_sz;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ stats = rl2_deserialize_dbms_raster_statistics (blob, blob_sz);
+ if (stats == NULL)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ sqlite3_result_int (context, st->nBands);
+ rl2_destroy_raster_statistics (stats);
+}
+
+static void
+fnct_GetBandStatistics_Min (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetBandStatistics_Min(BLOBencoded statistics, int band_index)
+/
+/ will return the Minimum value for the given Band
+/ or NULL (INVALID ARGS)
+/
+*/
+ const unsigned char *blob;
+ int blob_sz;
+ int band_index;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ band_index = sqlite3_value_int (argv[1]);
+ stats = rl2_deserialize_dbms_raster_statistics (blob, blob_sz);
+ if (stats == NULL)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ if (band_index < 0 || band_index >= st->nBands)
+ sqlite3_result_null (context);
+ else
+ {
+ rl2PrivBandStatisticsPtr band = st->band_stats + band_index;
+ sqlite3_result_double (context, band->min);
+ }
+ rl2_destroy_raster_statistics (stats);
+}
+
+static void
+fnct_GetBandStatistics_Max (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetBandStatistics_Max(BLOBencoded statistics, int band_index)
+/
+/ will return the Maximum value for the given Band
+/ or NULL (INVALID ARGS)
+/
+*/
+ const unsigned char *blob;
+ int blob_sz;
+ int band_index;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ band_index = sqlite3_value_int (argv[1]);
+ stats = rl2_deserialize_dbms_raster_statistics (blob, blob_sz);
+ if (stats == NULL)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ if (band_index < 0 || band_index >= st->nBands)
+ sqlite3_result_null (context);
+ else
+ {
+ rl2PrivBandStatisticsPtr band = st->band_stats + band_index;
+ sqlite3_result_double (context, band->max);
+ }
+ rl2_destroy_raster_statistics (stats);
+}
+
+static void
+fnct_GetBandStatistics_Avg (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetBandStatistics_Avg(BLOBencoded statistics, int band_index)
+/
+/ will return the Average value for the given Band
+/ or NULL (INVALID ARGS)
+/
+*/
+ const unsigned char *blob;
+ int blob_sz;
+ int band_index;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ band_index = sqlite3_value_int (argv[1]);
+ stats = rl2_deserialize_dbms_raster_statistics (blob, blob_sz);
+ if (stats == NULL)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ if (band_index < 0 || band_index >= st->nBands)
+ sqlite3_result_null (context);
+ else
+ {
+ rl2PrivBandStatisticsPtr band = st->band_stats + band_index;
+ sqlite3_result_double (context, band->mean);
+ }
+ rl2_destroy_raster_statistics (stats);
+}
+
+static void
+fnct_GetBandStatistics_Var (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetBandStatistics_Var(BLOBencoded statistics, int band_index)
+/
+/ will return the Variance for the given Band
+/ or NULL (INVALID ARGS)
+/
+*/
+ const unsigned char *blob;
+ int blob_sz;
+ int band_index;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ double variance;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ band_index = sqlite3_value_int (argv[1]);
+ stats = rl2_deserialize_dbms_raster_statistics (blob, blob_sz);
+ if (stats == NULL)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ if (band_index < 0 || band_index >= st->nBands)
+ sqlite3_result_null (context);
+ else
+ {
+ rl2PrivBandStatisticsPtr band = st->band_stats + band_index;
+ if (band->first != NULL)
+ {
+ double count = 0.0;
+ double sum_var = 0.0;
+ double sum_count = 0.0;
+ rl2PoolVariancePtr pV = band->first;
+ while (pV != NULL)
+ {
+ count += 1.0;
+ sum_var += (pV->count - 1.0) * pV->variance;
+ sum_count += pV->count;
+ pV = pV->next;
+ }
+ variance = sum_var / (sum_count - count);
+ }
+ else
+ variance = band->sum_sq_diff / (st->count - 1.0);
+ sqlite3_result_double (context, variance);
+ }
+ rl2_destroy_raster_statistics (stats);
+}
+
+static void
+fnct_GetBandStatistics_StdDev (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetBandStatistics_StdDev(BLOBencoded statistics, int band_index)
+/
+/ will return the StandardDeviation for the given Band
+/ or NULL (INVALID ARGS)
+/
+*/
+ const unsigned char *blob;
+ int blob_sz;
+ int band_index;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ double variance;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ band_index = sqlite3_value_int (argv[1]);
+ stats = rl2_deserialize_dbms_raster_statistics (blob, blob_sz);
+ if (stats == NULL)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ if (band_index < 0 || band_index >= st->nBands)
+ sqlite3_result_null (context);
+ else
+ {
+ rl2PrivBandStatisticsPtr band = st->band_stats + band_index;
+ if (band->first != NULL)
+ {
+ double count = 0.0;
+ double sum_var = 0.0;
+ double sum_count = 0.0;
+ rl2PoolVariancePtr pV = band->first;
+ while (pV != NULL)
+ {
+ count += 1.0;
+ sum_var += (pV->count - 1.0) * pV->variance;
+ sum_count += pV->count;
+ pV = pV->next;
+ }
+ variance = sum_var / (sum_count - count);
+ }
+ else
+ variance = band->sum_sq_diff / (st->count - 1.0);
+ sqlite3_result_double (context, sqrt (variance));
+ }
+ rl2_destroy_raster_statistics (stats);
+}
+
+static void
+fnct_GetBandStatistics_Histogram (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetBandStatistics_Histogram(BLOBencoded statistics, int band_index)
+/
+/ will return a PNG image representing the Histogram for the given Band
+/ or NULL (INVALID ARGS)
+/
+*/
+ const unsigned char *blob;
+ int blob_sz;
+ int band_index;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ unsigned char *image = NULL;
+ int image_size;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ band_index = sqlite3_value_int (argv[1]);
+ stats = rl2_deserialize_dbms_raster_statistics (blob, blob_sz);
+ if (stats == NULL)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ if (band_index < 0 || band_index >= st->nBands)
+ sqlite3_result_null (context);
+ else
+ {
+ rl2PrivBandStatisticsPtr band = st->band_stats + band_index;
+ if (get_raster_band_histogram (band, &image, &image_size) == RL2_OK)
+ sqlite3_result_blob (context, image, image_size, free);
+ else
+ sqlite3_result_null (context);
+ }
+ rl2_destroy_raster_statistics (stats);
+}
+
+static void
+fnct_GetBandHistogramFromImage (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetBandHistogramFromImage(BLOBencoded statistics, TEXT mime_type, int band_index)
+/
+/ will return a PNG image representing the Histogram for the given Band
+/ or NULL (INVALID ARGS)
+/
+*/
+ const unsigned char *blob;
+ int blob_sz;
+ int band_index;
+ const char *mime_type = "text/plain";
+ rl2RasterPtr raster = NULL;
+ rl2RasterStatisticsPtr stats = NULL;
+ rl2PrivRasterStatisticsPtr st;
+ unsigned char *image = NULL;
+ int image_size;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_BLOB)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+ blob = sqlite3_value_blob (argv[0]);
+ blob_sz = sqlite3_value_bytes (argv[0]);
+ mime_type = (const char *) sqlite3_value_text (argv[1]);
+ band_index = sqlite3_value_int (argv[2]);
+/* validating the mime-type */
+ if (strcmp (mime_type, "image/png") == 0)
+ raster = rl2_raster_from_png (blob, blob_sz);
+ if (strcmp (mime_type, "image/jpeg") == 0)
+ raster = rl2_raster_from_jpeg (blob, blob_sz);
+ if (raster == NULL)
+ goto error;
+/* attempting to build Raster Statistics */
+ stats = rl2_build_raster_statistics (raster, NULL);
+ if (stats == NULL)
+ goto error;
+ rl2_destroy_raster (raster);
+ raster = NULL;
+/* attempting to build the Histogram */
+ st = (rl2PrivRasterStatisticsPtr) stats;
+ if (band_index < 0 || band_index >= st->nBands)
+ sqlite3_result_null (context);
+ else
+ {
+ rl2PrivBandStatisticsPtr band = st->band_stats + band_index;
+ if (get_raster_band_histogram (band, &image, &image_size) == RL2_OK)
+ sqlite3_result_blob (context, image, image_size, free);
+ else
+ sqlite3_result_null (context);
+ }
+ rl2_destroy_raster_statistics (stats);
+ return;
+
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (stats != NULL)
+ rl2_destroy_raster_statistics (stats);
+ sqlite3_result_null (context);
+}
+
+static void
+fnct_CreateCoverage (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ CreateCoverage(text coverage, text sample_type, text pixel_type,
+/ int num_bands, text compression, int quality,
+/ int tile_width, int tile_height, int srid,
+/ double res)
+/ CreateCoverage(text coverage, text sample_type, text pixel_type,
+/ int num_bands, text compression, int quality,
+/ int tile_width, int tile_height, int srid,
+/ double horz_res, double vert_res)
+/ CreateCoverage(text coverage, text sample_type, text pixel_type,
+/ int num_bands, text compression, int quality,
+/ int tile_width, int tile_height, int srid,
+/ double horz_res, double vert_res, BLOB no_data)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *coverage;
+ const char *sample_type;
+ const char *pixel_type;
+ int num_bands;
+ const char *compression;
+ int quality;
+ int tile_width;
+ int tile_height;
+ int srid;
+ double horz_res;
+ double vert_res;
+ unsigned char sample;
+ unsigned char pixel;
+ unsigned char compr;
+ sqlite3 *sqlite;
+ int ret;
+ rl2PixelPtr no_data = NULL;
+ rl2PalettePtr palette = NULL;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[4]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[5]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[6]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[7]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[8]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[9]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[9]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 10)
+ {
+ if (sqlite3_value_type (argv[10]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[10]) != SQLITE_FLOAT)
+ err = 1;
+ }
+ if (argc > 11)
+ {
+ if (sqlite3_value_type (argv[11]) != SQLITE_BLOB
+ && sqlite3_value_type (argv[11]) != SQLITE_NULL)
+ err = 1;
+ }
+ if (err)
+ goto error;
+
+/* retrieving the arguments */
+ coverage = (const char *) sqlite3_value_text (argv[0]);
+ sample_type = (const char *) sqlite3_value_text (argv[1]);
+ pixel_type = (const char *) sqlite3_value_text (argv[2]);
+ num_bands = sqlite3_value_int (argv[3]);
+ compression = (const char *) sqlite3_value_text (argv[4]);
+ quality = sqlite3_value_int (argv[5]);
+ tile_width = sqlite3_value_int (argv[6]);
+ tile_height = sqlite3_value_int (argv[7]);
+ srid = sqlite3_value_int (argv[8]);
+ if (sqlite3_value_type (argv[9]) == SQLITE_FLOAT)
+ horz_res = sqlite3_value_double (argv[9]);
+ else
+ {
+ int val = sqlite3_value_int (argv[9]);
+ horz_res = val;
+ }
+ if (argc > 10)
+ {
+ if (sqlite3_value_type (argv[10]) == SQLITE_FLOAT)
+ vert_res = sqlite3_value_double (argv[10]);
+ else
+ {
+ int val = sqlite3_value_int (argv[10]);
+ vert_res = val;
+ }
+ }
+ else
+ vert_res = horz_res;
+ if (argc > 11 && sqlite3_value_type (argv[11]) == SQLITE_BLOB)
+ {
+ /* NO-DATA pixel */
+ const unsigned char *blob = sqlite3_value_blob (argv[11]);
+ int blob_sz = sqlite3_value_bytes (argv[11]);
+ no_data = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ if (no_data == NULL)
+ goto error;
+ }
+
+/* preliminary arg checking */
+ if (num_bands < 1 || num_bands > 255)
+ goto error;
+ if (quality < 0)
+ quality = 0;
+ if (quality > 100)
+ quality = 100;
+ if (tile_width < 0 || tile_width > 65536)
+ goto error;
+ if (tile_height < 0 || tile_height > 65536)
+ goto error;
+
+ sample = RL2_SAMPLE_UNKNOWN;
+ if (strcasecmp (sample_type, "1-BIT") == 0)
+ sample = RL2_SAMPLE_1_BIT;
+ if (strcasecmp (sample_type, "2-BIT") == 0)
+ sample = RL2_SAMPLE_2_BIT;
+ if (strcasecmp (sample_type, "4-BIT") == 0)
+ sample = RL2_SAMPLE_4_BIT;
+ if (strcasecmp (sample_type, "INT8") == 0)
+ sample = RL2_SAMPLE_INT8;
+ if (strcasecmp (sample_type, "UINT8") == 0)
+ sample = RL2_SAMPLE_UINT8;
+ if (strcasecmp (sample_type, "INT16") == 0)
+ sample = RL2_SAMPLE_INT16;
+ if (strcasecmp (sample_type, "UINT16") == 0)
+ sample = RL2_SAMPLE_UINT16;
+ if (strcasecmp (sample_type, "INT32") == 0)
+ sample = RL2_SAMPLE_INT32;
+ if (strcasecmp (sample_type, "UINT32") == 0)
+ sample = RL2_SAMPLE_UINT32;
+ if (strcasecmp (sample_type, "FLOAT") == 0)
+ sample = RL2_SAMPLE_FLOAT;
+ if (strcasecmp (sample_type, "DOUBLE") == 0)
+ sample = RL2_SAMPLE_DOUBLE;
+
+ pixel = RL2_PIXEL_UNKNOWN;
+ if (strcasecmp (pixel_type, "MONOCHROME") == 0)
+ pixel = RL2_PIXEL_MONOCHROME;
+ if (strcasecmp (pixel_type, "GRAYSCALE") == 0)
+ pixel = RL2_PIXEL_GRAYSCALE;
+ if (strcasecmp (pixel_type, "PALETTE") == 0)
+ pixel = RL2_PIXEL_PALETTE;
+ if (strcasecmp (pixel_type, "RGB") == 0)
+ pixel = RL2_PIXEL_RGB;
+ if (strcasecmp (pixel_type, "DATAGRID") == 0)
+ pixel = RL2_PIXEL_DATAGRID;
+ if (strcasecmp (pixel_type, "MULTIBAND") == 0)
+ pixel = RL2_PIXEL_MULTIBAND;
+
+ compr = RL2_COMPRESSION_UNKNOWN;
+ if (strcasecmp (compression, "NONE") == 0)
+ compr = RL2_COMPRESSION_NONE;
+ if (strcasecmp (compression, "DEFLATE") == 0)
+ compr = RL2_COMPRESSION_DEFLATE;
+ if (strcasecmp (compression, "LZMA") == 0)
+ compr = RL2_COMPRESSION_LZMA;
+ if (strcasecmp (compression, "PNG") == 0)
+ compr = RL2_COMPRESSION_PNG;
+ if (strcasecmp (compression, "GIF") == 0)
+ compr = RL2_COMPRESSION_GIF;
+ if (strcasecmp (compression, "JPEG") == 0)
+ compr = RL2_COMPRESSION_JPEG;
+ if (strcasecmp (compression, "WEBP") == 0)
+ compr = RL2_COMPRESSION_LOSSY_WEBP;
+ if (strcasecmp (compression, "LL_WEBP") == 0)
+ compr = RL2_COMPRESSION_LOSSLESS_WEBP;
+ if (strcasecmp (compression, "FAX4") == 0)
+ compr = RL2_COMPRESSION_CCITTFAX4;
+
+ if (no_data == NULL)
+ {
+ /* creating a default NO-DATA value */
+ no_data = default_nodata (sample, pixel, num_bands);
+ }
+ if (pixel == RL2_PIXEL_PALETTE)
+ {
+/* creating a default PALETTE */
+ palette = rl2_create_palette (1);
+ rl2_set_palette_color (palette, 0, 255, 255, 255);
+ }
+
+/* attempting to create the DBMS Coverage */
+ sqlite = sqlite3_context_db_handle (context);
+ ret = rl2_create_dbms_coverage (sqlite, coverage, sample, pixel,
+ (unsigned char) num_bands,
+ compr, quality,
+ (unsigned short) tile_width,
+ (unsigned short) tile_height, srid,
+ horz_res, vert_res, no_data, palette);
+ if (ret == RL2_OK)
+ sqlite3_result_int (context, 1);
+ else
+ sqlite3_result_int (context, 0);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return;
+
+ error:
+ sqlite3_result_int (context, -1);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+}
+
+static void
+fnct_SetCoverageInfos (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ SetCoverageInfos(String coverage_name, String title,
+/ String abstract)
+/
+/ inserts or updates the descriptive infos supporting a Raster Coverage
+/ returns 1 on success
+/ 0 on failure, -1 on invalid arguments
+*/
+ int ret;
+ const char *coverage_name;
+ const char *title = NULL;
+ const char *abstract = NULL;
+ sqlite3 *sqlite = sqlite3_context_db_handle (context);
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ if (sqlite3_value_type (argv[2]) != SQLITE_TEXT)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ coverage_name = (const char *) sqlite3_value_text (argv[0]);
+ title = (const char *) sqlite3_value_text (argv[1]);
+ abstract = (const char *) sqlite3_value_text (argv[2]);
+ ret = set_coverage_infos (sqlite, coverage_name, title, abstract);
+ sqlite3_result_int (context, ret);
+}
+
+static void
+fnct_DeleteSection (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ DeleteSection(text coverage, text section)
+/ DeleteSection(text coverage, text section, int transaction)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *coverage;
+ const char *section;
+ int transaction = 1;
+ sqlite3 *sqlite;
+ int ret;
+ rl2CoveragePtr cvg = NULL;
+ sqlite3_int64 section_id;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 2 && sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ goto invalid;
+
+/* retrieving the arguments */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = (const char *) sqlite3_value_text (argv[0]);
+ section = (const char *) sqlite3_value_text (argv[1]);
+ if (argc > 2)
+ transaction = sqlite3_value_int (argv[2]);
+
+ cvg = rl2_create_coverage_from_dbms (sqlite, coverage);
+ if (cvg == NULL)
+ goto error;
+ if (rl2_get_dbms_section_id (sqlite, coverage, section, §ion_id) !=
+ RL2_OK)
+ goto error;
+
+ if (transaction)
+ {
+ /* starting a DBMS Transaction */
+ ret = sqlite3_exec (sqlite, "BEGIN", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ goto error;
+ }
+
+ if (rl2_delete_dbms_section (sqlite, coverage, section_id) != RL2_OK)
+ goto error;
+
+ if (transaction)
+ {
+ /* committing the still pending transaction */
+ ret = sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ goto error;
+ }
+ sqlite3_result_int (context, 1);
+ rl2_destroy_coverage (cvg);
+ return;
+
+ invalid:
+ sqlite3_result_int (context, -1);
+ return;
+ error:
+ if (cvg != NULL)
+ rl2_destroy_coverage (cvg);
+ sqlite3_result_int (context, 0);
+ if (transaction)
+ {
+ /* invalidating the pending transaction */
+ sqlite3_exec (sqlite, "ROLLBACK", NULL, NULL, NULL);
+ }
+ return;
+}
+
+static void
+fnct_DropCoverage (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ DropCoverage(text coverage)
+/ DropCoverage(text coverage, int transaction)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *coverage;
+ int transaction = 1;
+ sqlite3 *sqlite;
+ int ret;
+ rl2CoveragePtr cvg = NULL;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 1 && sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ goto invalid;
+
+/* retrieving the arguments */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = (const char *) sqlite3_value_text (argv[0]);
+ if (argc > 1)
+ transaction = sqlite3_value_int (argv[1]);
+
+ cvg = rl2_create_coverage_from_dbms (sqlite, coverage);
+ if (cvg == NULL)
+ goto error;
+
+ if (transaction)
+ {
+ /* starting a DBMS Transaction */
+ ret = sqlite3_exec (sqlite, "BEGIN", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ goto error;
+ }
+
+ if (rl2_drop_dbms_coverage (sqlite, coverage) != RL2_OK)
+ goto error;
+
+ if (transaction)
+ {
+ /* committing the still pending transaction */
+ ret = sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ goto error;
+ }
+ sqlite3_result_int (context, 1);
+ rl2_destroy_coverage (cvg);
+ return;
+
+ invalid:
+ sqlite3_result_int (context, -1);
+ return;
+ error:
+ if (cvg != NULL)
+ rl2_destroy_coverage (cvg);
+ sqlite3_result_int (context, 0);
+ if (transaction)
+ {
+ /* invalidating the pending transaction */
+ sqlite3_exec (sqlite, "ROLLBACK", NULL, NULL, NULL);
+ }
+ return;
+}
+
+static void
+fnct_LoadRaster (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ LoadRaster(text coverage, text path_to_raster)
+/ LoadRaster(text coverage, text path_to_raster, int with_worldfile)
+/ LoadRaster(text coverage, text path_to_raster, int with_worldfile,
+/ int force_srid)
+/ LoadRaster(text coverage, text path_to_raster, int with_worldfile,
+/ int force_srid, int pyramidize)
+/ LoadRaster(text coverage, text path_to_raster, int with_worldfile,
+/ int force_srid, int pyramidize, int transaction)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *path;
+ int worldfile = 0;
+ int force_srid = -1;
+ int transaction = 1;
+ int pyramidize = 1;
+ rl2CoveragePtr coverage = NULL;
+ sqlite3 *sqlite;
+ int ret;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 2 && sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 3 && sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 4 && sqlite3_value_type (argv[4]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 5 && sqlite3_value_type (argv[5]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* retrieving the arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ path = (const char *) sqlite3_value_text (argv[1]);
+ if (argc > 2)
+ worldfile = sqlite3_value_int (argv[2]);
+ if (argc > 3)
+ force_srid = sqlite3_value_int (argv[3]);
+ if (argc > 4)
+ pyramidize = sqlite3_value_int (argv[4]);
+ if (argc > 5)
+ transaction = sqlite3_value_int (argv[5]);
+
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* attempting to load the Raster into the DBMS */
+ if (transaction)
+ {
+ /* starting a DBMS Transaction */
+ ret = sqlite3_exec (sqlite, "BEGIN", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ ret = rl2_load_raster_into_dbms (sqlite, path, coverage,
+ worldfile, force_srid, pyramidize);
+ rl2_destroy_coverage (coverage);
+ if (ret != RL2_OK)
+ {
+ sqlite3_result_int (context, 0);
+ if (transaction)
+ {
+ /* invalidating the pending transaction */
+ sqlite3_exec (sqlite, "ROLLBACK", NULL, NULL, NULL);
+ }
+ return;
+ }
+ if (transaction)
+ {
+ /* committing the still pending transaction */
+ ret = sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ sqlite3_result_int (context, 1);
+}
+
+static void
+fnct_LoadRastersFromDir (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ LoadRastersFromDir(text coverage, text dir_path)
+/ LoadRastersFromDir(text coverage, text dir_path, text file_ext)
+/ LoadRastersFromDir(text coverage, text dir_path, text file_ext,
+/ int with_worldfile)
+/ LoadRastersFromDir(text coverage, text dir_path, text file_ext,
+/ int with_worldfile, int force_srid)
+/ LoadRastersFromDir(text coverage, text dir_path, text file_ext,
+/ int with_worldfile, int force_srid,
+/ int pyramidize)
+/ LoadRastersFromDir(text coverage, text dir_path, text file_ext,
+/ int with_worldfile, int force_srid,
+/ int pyramidize, int transaction)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *path;
+ const char *file_ext;
+ int worldfile = 0;
+ int force_srid = -1;
+ int transaction = 1;
+ int pyramidize = 1;
+ rl2CoveragePtr coverage = NULL;
+ sqlite3 *sqlite;
+ int ret;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 2 && sqlite3_value_type (argv[2]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 3 && sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 4 && sqlite3_value_type (argv[4]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 5 && sqlite3_value_type (argv[5]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 6 && sqlite3_value_type (argv[6]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* retrieving the arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ path = (const char *) sqlite3_value_text (argv[1]);
+ if (argc > 2)
+ file_ext = (const char *) sqlite3_value_text (argv[2]);
+ if (argc > 3)
+ worldfile = sqlite3_value_int (argv[3]);
+ if (argc > 4)
+ force_srid = sqlite3_value_int (argv[4]);
+ if (argc > 5)
+ pyramidize = sqlite3_value_int (argv[5]);
+ if (argc > 6)
+ transaction = sqlite3_value_int (argv[6]);
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* attempting to load the Rasters into the DBMS */
+ if (transaction)
+ {
+ /* starting a DBMS Transaction */
+ ret = sqlite3_exec (sqlite, "BEGIN", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ ret = rl2_load_mrasters_into_dbms (sqlite, path, file_ext, coverage,
+ worldfile, force_srid, pyramidize);
+ rl2_destroy_coverage (coverage);
+ if (ret != RL2_OK)
+ {
+ sqlite3_result_int (context, 0);
+ if (transaction)
+ {
+ /* invalidating the pending transaction */
+ sqlite3_exec (sqlite, "ROLLBACK", NULL, NULL, NULL);
+ }
+ return;
+ }
+ if (transaction)
+ {
+ /* committing the still pending transaction */
+ ret = sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ sqlite3_result_int (context, 1);
+}
+
+static void
+fnct_Pyramidize (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ Pyramidize(text coverage)
+/ Pyramidize(text coverage, text section)
+/ Pyramidize(text coverage, text section, int force_rebuild)
+/ Pyramidize(text coverage, text section, int force_rebuild,
+/ int transaction)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *sect_name = NULL;
+ int forced_rebuild = 0;
+ int transaction = 1;
+ sqlite3 *sqlite;
+ int ret;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 1 && sqlite3_value_type (argv[1]) != SQLITE_TEXT
+ && sqlite3_value_type (argv[1]) != SQLITE_NULL)
+ err = 1;
+ if (argc > 2 && sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 3 && sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+/* attempting to (re)build Pyramid levels */
+ sqlite = sqlite3_context_db_handle (context);
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ if (argc > 1)
+ {
+ if (sqlite3_value_type (argv[1]) == SQLITE_TEXT)
+ sect_name = (const char *) sqlite3_value_text (argv[1]);
+ }
+ if (argc > 2)
+ forced_rebuild = sqlite3_value_int (argv[2]);
+ if (argc > 3)
+ transaction = sqlite3_value_int (argv[3]);
+ if (transaction)
+ {
+ /* starting a DBMS Transaction */
+ ret = sqlite3_exec (sqlite, "BEGIN", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ if (sect_name == NULL)
+ ret = rl2_build_all_section_pyramids (sqlite, cvg_name, forced_rebuild);
+ else
+ ret =
+ rl2_build_section_pyramid (sqlite, cvg_name, sect_name,
+ forced_rebuild);
+ if (ret != RL2_OK)
+ {
+ sqlite3_result_int (context, 0);
+ if (transaction)
+ {
+ /* invalidating the pending transaction */
+ sqlite3_exec (sqlite, "ROLLBACK", NULL, NULL, NULL);
+ }
+ return;
+ }
+ if (transaction)
+ {
+ /* committing the still pending transaction */
+ ret = sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ sqlite3_result_int (context, 1);
+}
+
+static void
+fnct_PyramidizeMonolithic (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ PyramidizeMonolithic(text coverage)
+/ PyramidizeMonolithic(text coverage, int virt_levels)
+/ PyramidizeMonolithic(text coverage, int virt_levels, int transaction)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ int virt_levels = 0;
+ int transaction = 1;
+ sqlite3 *sqlite;
+ int ret;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 1 && sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 2 && sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+/* attempting to (re)build Pyramid levels */
+ sqlite = sqlite3_context_db_handle (context);
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ if (argc > 1)
+ virt_levels = sqlite3_value_int (argv[1]);
+ if (argc > 2)
+ transaction = sqlite3_value_int (argv[2]);
+ if (transaction)
+ {
+ /* starting a DBMS Transaction */
+ ret = sqlite3_exec (sqlite, "BEGIN", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ ret = rl2_build_monolithic_pyramid (sqlite, cvg_name, virt_levels);
+ if (ret != RL2_OK)
+ {
+ sqlite3_result_int (context, 0);
+ if (transaction)
+ {
+ /* invalidating the pending transaction */
+ sqlite3_exec (sqlite, "ROLLBACK", NULL, NULL, NULL);
+ }
+ return;
+ }
+ if (transaction)
+ {
+ /* committing the still pending transaction */
+ ret = sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ sqlite3_result_int (context, 1);
+}
+
+static void
+fnct_DePyramidize (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ DePyramidize(text coverage)
+/ DePyramidize(text coverage, text section)
+/ DePyramidize(text coverage, text section, int transaction)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *sect_name = NULL;
+ int transaction = 1;
+ sqlite3 *sqlite;
+ int ret;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 1 && sqlite3_value_type (argv[1]) != SQLITE_TEXT
+ && sqlite3_value_type (argv[1]) != SQLITE_NULL)
+ err = 1;
+ if (argc > 2 && sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+/* attempting to delete all Pyramid levels */
+ sqlite = sqlite3_context_db_handle (context);
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ if (argc > 1)
+ {
+ if (sqlite3_value_type (argv[1]) == SQLITE_TEXT)
+ sect_name = (const char *) sqlite3_value_text (argv[1]);
+ }
+ if (argc > 2)
+ transaction = sqlite3_value_int (argv[2]);
+ if (transaction)
+ {
+ /* starting a DBMS Transaction */
+ ret = sqlite3_exec (sqlite, "BEGIN", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ if (sect_name == NULL)
+ ret = rl2_delete_all_pyramids (sqlite, cvg_name);
+ else
+ ret = rl2_delete_section_pyramid (sqlite, cvg_name, sect_name);
+ if (ret != RL2_OK)
+ {
+ sqlite3_result_int (context, 0);
+ if (transaction)
+ {
+ /* invalidating the pending transaction */
+ sqlite3_exec (sqlite, "ROLLBACK", NULL, NULL, NULL);
+ }
+ return;
+ }
+ if (transaction)
+ {
+ /* committing the still pending transaction */
+ ret = sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ sqlite3_result_int (context, 1);
+}
+
+static void
+fnct_LoadRasterFromWMS (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ LoadRasterFromWMS(text coverage, text section, text getmap_url,
+/ BLOB geom, text wms_version, text wms_layer,
+/ text wms_style, text wms_format, double res)
+/ LoadRasterFromWMS(text coverage, text section, text getmap_url,
+/ BLOB geom, text wms_version, text wms_layer,
+/ text wms_style, text wms_format, double horz_res,
+/ double vert_res)
+/ LoadRasterFromWMS(text coverage, text section, text getmap_url,
+/ BLOB geom, text wms_version, text wms_layer,
+/ text wms_style, text wms_format, text wms_crs,
+/ double horz_res, double vert_res, int opaque)
+/ LoadRasterFromWMS(text coverage, text section, text getmap_url,
+/ BLOB geom, text wms_version, text wms_layer,
+/ text wms_style, text wms_format, double horz_res,
+/ double vert_res, int opaque,
+/ int swap_xy)
+/ LoadRasterFromWMS(text coverage, text section, text getmap_url,
+/ BLOB geom, text wms_version, text wms_layer,
+/ text wms_style, text wms_format, double horz_res,
+/ double vert_res, int opaque, int swap_xy, text proxy)
+/ LoadRasterFromWMS(text coverage, text section, text getmap_url,
+/ BLOB geom, text wms_version, text wms_layer,
+/ text wms_style, text wms_format, double horz_res,
+/ double vert_res, int opaque, int swap_xy,
+/ text proxy, int transaction)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *sect_name;
+ const char *url;
+ const char *proxy = NULL;
+ const char *wms_version;
+ const char *wms_layer;
+ const char *wms_style = NULL;
+ const char *wms_format;
+ char *wms_crs = NULL;
+ const unsigned char *blob;
+ int blob_sz;
+ double horz_res;
+ double vert_res;
+ int opaque = 0;
+ int swap_xy = 0;
+ int srid;
+ int transaction = 1;
+ double minx;
+ double maxx;
+ double miny;
+ double maxy;
+ int errcode = -1;
+ gaiaGeomCollPtr geom;
+ rl2CoveragePtr coverage = NULL;
+ rl2RasterStatisticsPtr section_stats = NULL;
+ sqlite3 *sqlite;
+ int ret;
+ int n;
+ double x;
+ double y;
+ double tilew;
+ double tileh;
+ unsigned int tile_width;
+ unsigned int tile_height;
+ WmsRetryListPtr retry_list = NULL;
+ char *table;
+ char *xtable;
+ char *sql;
+ sqlite3_stmt *stmt_data = NULL;
+ sqlite3_stmt *stmt_tils = NULL;
+ sqlite3_stmt *stmt_sect = NULL;
+ sqlite3_stmt *stmt_levl = NULL;
+ sqlite3_stmt *stmt_upd_sect = NULL;
+ int first = 1;
+ double ext_x;
+ double ext_y;
+ unsigned int width;
+ unsigned int height;
+ sqlite3_int64 section_id;
+ rl2PixelPtr no_data = NULL;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned char compression;
+ int quality;
+ InsertWms params;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[4]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[5]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[6]) != SQLITE_TEXT
+ && sqlite3_value_type (argv[6]) != SQLITE_NULL)
+ err = 1;
+ if (sqlite3_value_type (argv[7]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[8]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[8]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 9 && sqlite3_value_type (argv[9]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[9]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 10 && sqlite3_value_type (argv[10]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 11 && sqlite3_value_type (argv[11]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 12)
+ {
+ if (sqlite3_value_type (argv[12]) == SQLITE_TEXT)
+ ;
+ else if (sqlite3_value_type (argv[12]) == SQLITE_NULL)
+ ;
+ else
+ err = 1;
+ }
+ if (argc > 13 && sqlite3_value_type (argv[13]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* retrieving all arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ sect_name = (const char *) sqlite3_value_text (argv[1]);
+ url = (const char *) sqlite3_value_text (argv[2]);
+ blob = sqlite3_value_blob (argv[3]);
+ blob_sz = sqlite3_value_bytes (argv[3]);
+ wms_version = (const char *) sqlite3_value_text (argv[4]);
+ wms_layer = (const char *) sqlite3_value_text (argv[5]);
+ if (sqlite3_value_type (argv[6]) == SQLITE_TEXT)
+ wms_style = (const char *) sqlite3_value_text (argv[6]);
+ wms_format = (const char *) sqlite3_value_text (argv[7]);
+ if (sqlite3_value_type (argv[8]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[8]);
+ horz_res = ival;
+ }
+ else
+ horz_res = sqlite3_value_double (argv[8]);
+ if (argc > 9)
+ {
+ if (sqlite3_value_type (argv[9]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[9]);
+ vert_res = ival;
+ }
+ else
+ vert_res = sqlite3_value_double (argv[9]);
+ }
+ else
+ vert_res = horz_res;
+ if (argc > 10)
+ opaque = sqlite3_value_int (argv[10]);
+ if (argc > 11)
+ swap_xy = sqlite3_value_int (argv[11]);
+ if (argc > 12 && sqlite3_value_type (argv[12]) == SQLITE_TEXT)
+ proxy = (const char *) sqlite3_value_text (argv[12]);
+ if (argc > 13)
+ transaction = sqlite3_value_int (argv[13]);
+
+/* checking the Geometry */
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ if (geom == NULL)
+ {
+ errcode = -1;
+ goto error;
+ }
+/* retrieving the BBOX */
+ minx = geom->MinX;
+ maxx = geom->MaxX;
+ miny = geom->MinY;
+ maxy = geom->MaxY;
+ gaiaFreeGeomColl (geom);
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ if (rl2_get_coverage_tile_size (coverage, &tile_width, &tile_height) !=
+ RL2_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ if (rl2_get_coverage_srid (coverage, &srid) != RL2_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ if (rl2_get_coverage_type (coverage, &sample_type, &pixel_type, &num_bands)
+ != RL2_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ no_data = rl2_get_coverage_no_data (coverage);
+ if (rl2_get_coverage_compression (coverage, &compression, &quality)
+ != RL2_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+ tilew = (double) tile_width *horz_res;
+ tileh = (double) tile_height *vert_res;
+ ext_x = maxx - minx;
+ ext_y = maxy - miny;
+ width = ext_x / horz_res;
+ height = ext_y / horz_res;
+ if (((double) width * horz_res) < ext_x)
+ width++;
+ if (((double) height * vert_res) < ext_y)
+ height++;
+ if (width < tile_width || width > UINT16_MAX)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ if (height < tile_height || height > UINT16_MAX)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+ if (transaction)
+ {
+ /* starting a DBMS Transaction */
+ ret = sqlite3_exec (sqlite, "BEGIN", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+
+/* SQL prepared statements */
+ table = sqlite3_mprintf ("%s_sections", cvg_name);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("INSERT INTO \"%s\" (section_id, section_name, file_path, "
+ "width, height, geometry) VALUES (NULL, ?, ?, ?, ?, ?)", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt_sect, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO sections SQL error: %s\n",
+ sqlite3_errmsg (sqlite));
+ goto error;
+ }
+
+ table = sqlite3_mprintf ("%s_sections", cvg_name);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("UPDATE \"%s\" SET statistics = ? WHERE section_id = ?", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt_upd_sect, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("UPDATE sections SQL error: %s\n", sqlite3_errmsg (sqlite));
+ goto error;
+ }
+
+ table = sqlite3_mprintf ("%s_levels", cvg_name);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("INSERT OR IGNORE INTO \"%s\" (pyramid_level, "
+ "x_resolution_1_1, y_resolution_1_1, "
+ "x_resolution_1_2, y_resolution_1_2, x_resolution_1_4, "
+ "y_resolution_1_4, x_resolution_1_8, y_resolution_1_8) "
+ "VALUES (0, ?, ?, ?, ?, ?, ?, ?, ?)", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt_levl, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO levels SQL error: %s\n",
+ sqlite3_errmsg (sqlite));
+ goto error;
+ }
+
+ table = sqlite3_mprintf ("%s_tiles", cvg_name);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("INSERT INTO \"%s\" (tile_id, pyramid_level, section_id, geometry) "
+ "VALUES (NULL, 0, ?, ?)", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt_tils, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO tiles SQL error: %s\n", sqlite3_errmsg (sqlite));
+ goto error;
+ }
+
+ table = sqlite3_mprintf ("%s_tile_data", cvg_name);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql =
+ sqlite3_mprintf
+ ("INSERT INTO \"%s\" (tile_id, tile_data_odd, tile_data_even) "
+ "VALUES (?, ?, ?)", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt_data, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO tile_data SQL error: %s\n",
+ sqlite3_errmsg (sqlite));
+ goto error;
+ }
+
+/* preparing the WMS requests */
+ wms_crs = sqlite3_mprintf ("EPSG:%d", srid);
+ tilew = (double) tile_width *horz_res;
+ tileh = (double) tile_height *vert_res;
+ ext_x = maxx - minx;
+ ext_y = maxy - miny;
+ width = ext_x / horz_res;
+ height = ext_y / horz_res;
+ if ((width * horz_res) < ext_x)
+ width++;
+ if ((height * vert_res) < ext_y)
+ height++;
+ retry_list = alloc_retry_list ();
+ for (y = maxy; y > miny; y -= tileh)
+ {
+ for (x = minx; x < maxx; x += tilew)
+ {
+ char *err_msg = NULL;
+ unsigned char *rgba_tile =
+ do_wms_GetMap_get (NULL, url, proxy, wms_version, wms_layer,
+ wms_crs, swap_xy, x, y - tileh,
+ x + tilew, y, tile_width, tile_height,
+ wms_style, wms_format, opaque, 0,
+ &err_msg);
+ if (rgba_tile == NULL)
+ {
+ add_retry (retry_list, x, y - tileh, x + tilew, y);
+ continue;
+ }
+
+ params.sqlite = sqlite;
+ params.rgba_tile = rgba_tile;
+ params.coverage = coverage;
+ params.sect_name = sect_name;
+ params.x = x;
+ params.y = y;
+ params.width = width;
+ params.height = height;
+ params.tilew = tilew;
+ params.tileh = tileh;
+ params.srid = srid;
+ params.minx = minx;
+ params.miny = miny;
+ params.maxx = maxx;
+ params.maxy = maxy;
+ params.sample_type = sample_type;
+ params.num_bands = num_bands;
+ params.compression = compression;
+ params.horz_res = horz_res;
+ params.vert_res = vert_res;
+ params.tile_width = tile_width;
+ params.tile_height = tile_height;
+ params.no_data = no_data;
+ params.stmt_sect = stmt_sect;
+ params.stmt_levl = stmt_levl;
+ params.stmt_tils = stmt_tils;
+ params.stmt_data = stmt_data;
+ if (!insert_wms_tile
+ (¶ms, &first, §ion_stats, §ion_id))
+ goto error;
+ }
+ }
+ for (n = 0; n < 5; n++)
+ {
+ WmsRetryItemPtr retry = retry_list->first;
+ while (retry != NULL)
+ {
+ char *err_msg = NULL;
+ unsigned char *rgba_tile = NULL;
+ if (retry->done)
+ {
+ retry = retry->next;
+ continue;
+ }
+ retry->count += 1;
+ rgba_tile =
+ do_wms_GetMap_get (NULL, url, proxy, wms_version, wms_layer,
+ wms_crs, swap_xy, retry->minx,
+ retry->miny, retry->maxx, retry->maxy,
+ tile_width, tile_height, wms_style,
+ wms_format, opaque, 0, &err_msg);
+ if (rgba_tile == NULL)
+ {
+ retry = retry->next;
+ continue;
+ }
+
+ params.sqlite = sqlite;
+ params.rgba_tile = rgba_tile;
+ params.coverage = coverage;
+ params.sect_name = sect_name;
+ params.x = x;
+ params.y = y;
+ params.width = width;
+ params.height = height;
+ params.tilew = tilew;
+ params.tileh = tileh;
+ params.srid = srid;
+ params.minx = minx;
+ params.miny = miny;
+ params.maxx = maxx;
+ params.maxy = maxy;
+ params.sample_type = sample_type;
+ params.num_bands = num_bands;
+ params.compression = compression;
+ params.horz_res = horz_res;
+ params.vert_res = vert_res;
+ params.tile_width = tile_width;
+ params.tile_height = tile_height;
+ params.no_data = no_data;
+ params.stmt_sect = stmt_sect;
+ params.stmt_levl = stmt_levl;
+ params.stmt_tils = stmt_tils;
+ params.stmt_data = stmt_data;
+ if (!insert_wms_tile
+ (¶ms, &first, §ion_stats, §ion_id))
+ goto error;
+ retry->done = 1;
+ retry = retry->next;
+ }
+ }
+
+ if (!do_insert_stats (sqlite, section_stats, section_id, stmt_upd_sect))
+ goto error;
+ free_retry_list (retry_list);
+ retry_list = NULL;
+ sqlite3_free (wms_crs);
+ wms_crs = NULL;
+
+ sqlite3_finalize (stmt_upd_sect);
+ sqlite3_finalize (stmt_sect);
+ sqlite3_finalize (stmt_levl);
+ sqlite3_finalize (stmt_tils);
+ sqlite3_finalize (stmt_data);
+ stmt_upd_sect = NULL;
+ stmt_sect = NULL;
+ stmt_levl = NULL;
+ stmt_tils = NULL;
+ stmt_data = NULL;
+
+ rl2_destroy_raster_statistics (section_stats);
+ section_stats = NULL;
+ rl2_destroy_coverage (coverage);
+ coverage = NULL;
+ if (ret != RL2_OK)
+ {
+ sqlite3_result_int (context, 0);
+ if (transaction)
+ {
+ /* invalidating the pending transaction */
+ sqlite3_exec (sqlite, "ROLLBACK", NULL, NULL, NULL);
+ }
+ return;
+ }
+
+ if (rl2_update_dbms_coverage (sqlite, cvg_name) != RL2_OK)
+ {
+ fprintf (stderr, "unable to update the Coverage\n");
+ goto error;
+ }
+
+ if (transaction)
+ {
+ /* committing the still pending transaction */
+ ret = sqlite3_exec (sqlite, "COMMIT", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+ }
+ sqlite3_result_int (context, 1);
+ return;
+
+ error:
+ if (wms_crs != NULL)
+ sqlite3_free (wms_crs);
+ if (stmt_upd_sect != NULL)
+ sqlite3_finalize (stmt_upd_sect);
+ if (stmt_sect != NULL)
+ sqlite3_finalize (stmt_sect);
+ if (stmt_levl != NULL)
+ sqlite3_finalize (stmt_levl);
+ if (stmt_tils != NULL)
+ sqlite3_finalize (stmt_tils);
+ if (stmt_data != NULL)
+ sqlite3_finalize (stmt_data);
+ if (retry_list != NULL)
+ free_retry_list (retry_list);
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ if (section_stats != NULL)
+ rl2_destroy_raster_statistics (section_stats);
+ sqlite3_result_int (context, errcode);
+}
+
+static void
+fnct_WriteGeoTiff (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, BLOB geom, double resolution)
+/ WriteGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res)
+/ WriteGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, int with_worldfile)
+/ WriteGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, int with_worldfile,
+/ text compression)
+/ WriteGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, int with_worldfile,
+/ text compression, int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *path;
+ int width;
+ int height;
+ const unsigned char *blob;
+ int blob_sz;
+ double horz_res;
+ double vert_res;
+ int worldfile = 0;
+ unsigned char compression = RL2_COMPRESSION_NONE;
+ int tile_sz = 256;
+ rl2CoveragePtr coverage = NULL;
+ sqlite3 *sqlite;
+ int ret;
+ int errcode = -1;
+ gaiaGeomCollPtr geom;
+ double minx;
+ double maxx;
+ double miny;
+ double maxy;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[4]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[5]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[5]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 6 && sqlite3_value_type (argv[6]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[6]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 7 && sqlite3_value_type (argv[7]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 8 && sqlite3_value_type (argv[8]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 9 && sqlite3_value_type (argv[9]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* retrieving all arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ path = (const char *) sqlite3_value_text (argv[1]);
+ width = sqlite3_value_int (argv[2]);
+ height = sqlite3_value_int (argv[3]);
+ blob = sqlite3_value_blob (argv[4]);
+ blob_sz = sqlite3_value_bytes (argv[4]);
+ if (sqlite3_value_type (argv[5]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[5]);
+ horz_res = ival;
+ }
+ else
+ horz_res = sqlite3_value_double (argv[5]);
+ if (argc > 6)
+ {
+ if (sqlite3_value_type (argv[6]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[6]);
+ vert_res = ival;
+ }
+ else
+ vert_res = sqlite3_value_double (argv[6]);
+ }
+ else
+ vert_res = horz_res;
+ if (argc > 7)
+ worldfile = sqlite3_value_int (argv[7]);
+ if (argc > 8)
+ {
+ const char *compr = (const char *) sqlite3_value_text (argv[8]);
+ compression = RL2_COMPRESSION_UNKNOWN;
+ if (strcasecmp (compr, "NONE") == 0)
+ compression = RL2_COMPRESSION_NONE;
+ if (strcasecmp (compr, "DEFLATE") == 0)
+ compression = RL2_COMPRESSION_DEFLATE;
+ if (strcasecmp (compr, "LZW") == 0)
+ compression = RL2_COMPRESSION_LZW;
+ if (strcasecmp (compr, "JPEG") == 0)
+ compression = RL2_COMPRESSION_JPEG;
+ if (strcasecmp (compr, "FAX3") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX3;
+ if (strcasecmp (compr, "FAX4") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX4;
+ }
+ if (argc > 9)
+ tile_sz = sqlite3_value_int (argv[9]);
+
+/* coarse args validation */
+ if (width < 0 || width > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (height < 0 || height > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (tile_sz < 64 || tile_sz > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (compression == RL2_COMPRESSION_UNKNOWN)
+ {
+ errcode = -1;
+ goto error;
+ }
+
+/* checking the Geometry */
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ if (geom == NULL)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (is_point (geom))
+ {
+ /* assumed to be the GeoTiff Center Point */
+ gaiaPointPtr pt = geom->FirstPoint;
+ double ext_x = (double) width * horz_res;
+ double ext_y = (double) height * vert_res;
+ minx = pt->X - ext_x / 2.0;
+ maxx = minx + ext_x;
+ miny = pt->Y - ext_y / 2.0;
+ maxy = miny + ext_y;
+ }
+ else
+ {
+ /* assumed to be any possible Geometry defining a BBOX */
+ minx = geom->MinX;
+ maxx = geom->MaxX;
+ miny = geom->MinY;
+ maxy = geom->MaxY;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+ ret =
+ rl2_export_geotiff_from_dbms (sqlite, path, coverage, horz_res,
+ vert_res, minx, miny, maxx, maxy, width,
+ height, compression, tile_sz, worldfile);
+ if (ret != RL2_OK)
+ {
+ errcode = 0;
+ goto error;
+ }
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, 1);
+ return;
+
+ error:
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, errcode);
+}
+
+static void
+fnct_WriteTripleBandGeoTiff (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteTripleBandGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double resolution)
+/ WriteTripleBandGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res)
+/ WriteTripleBandGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res,
+/ int with_worldfile)
+/ WriteTripleBandGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res,
+/ int with_worldfile, text compression)
+/ WriteTripleBandGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res,
+/ int with_worldfile, text compression, int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *path;
+ int width;
+ int height;
+ int red_band;
+ int green_band;
+ int blue_band;
+ const unsigned char *blob;
+ int blob_sz;
+ double horz_res;
+ double vert_res;
+ int worldfile = 0;
+ unsigned char compression = RL2_COMPRESSION_NONE;
+ int tile_sz = 256;
+ rl2CoveragePtr coverage = NULL;
+ sqlite3 *sqlite;
+ int ret;
+ int errcode = -1;
+ gaiaGeomCollPtr geom;
+ double minx;
+ double maxx;
+ double miny;
+ double maxy;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[4]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[5]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[6]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[7]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[8]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[8]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 9 && sqlite3_value_type (argv[9]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[9]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 10 && sqlite3_value_type (argv[10]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 11 && sqlite3_value_type (argv[11]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 12 && sqlite3_value_type (argv[12]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* retrieving all arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ path = (const char *) sqlite3_value_text (argv[1]);
+ width = sqlite3_value_int (argv[2]);
+ height = sqlite3_value_int (argv[3]);
+ red_band = sqlite3_value_int (argv[4]);
+ green_band = sqlite3_value_int (argv[5]);
+ blue_band = sqlite3_value_int (argv[6]);
+ blob = sqlite3_value_blob (argv[7]);
+ blob_sz = sqlite3_value_bytes (argv[7]);
+ if (sqlite3_value_type (argv[8]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[8]);
+ horz_res = ival;
+ }
+ else
+ horz_res = sqlite3_value_double (argv[8]);
+ if (argc > 9)
+ {
+ if (sqlite3_value_type (argv[9]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[9]);
+ vert_res = ival;
+ }
+ else
+ vert_res = sqlite3_value_double (argv[9]);
+ }
+ else
+ vert_res = horz_res;
+ if (argc > 10)
+ worldfile = sqlite3_value_int (argv[10]);
+ if (argc > 11)
+ {
+ const char *compr = (const char *) sqlite3_value_text (argv[11]);
+ compression = RL2_COMPRESSION_UNKNOWN;
+ if (strcasecmp (compr, "NONE") == 0)
+ compression = RL2_COMPRESSION_NONE;
+ if (strcasecmp (compr, "DEFLATE") == 0)
+ compression = RL2_COMPRESSION_DEFLATE;
+ if (strcasecmp (compr, "LZW") == 0)
+ compression = RL2_COMPRESSION_LZW;
+ if (strcasecmp (compr, "JPEG") == 0)
+ compression = RL2_COMPRESSION_JPEG;
+ if (strcasecmp (compr, "FAX3") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX3;
+ if (strcasecmp (compr, "FAX4") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX4;
+ }
+ if (argc > 12)
+ tile_sz = sqlite3_value_int (argv[12]);
+
+/* coarse args validation */
+ if (width < 0 || width > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (height < 0 || height > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (red_band < 0 || red_band > 255)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (green_band < 0 || green_band > 255)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (blue_band < 0 || blue_band > 255)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (tile_sz < 64 || tile_sz > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (compression == RL2_COMPRESSION_UNKNOWN)
+ {
+ errcode = -1;
+ goto error;
+ }
+
+/* checking the Geometry */
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ if (geom == NULL)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (is_point (geom))
+ {
+ /* assumed to be the GeoTiff Center Point */
+ gaiaPointPtr pt = geom->FirstPoint;
+ double ext_x = (double) width * horz_res;
+ double ext_y = (double) height * vert_res;
+ minx = pt->X - ext_x / 2.0;
+ maxx = minx + ext_x;
+ miny = pt->Y - ext_y / 2.0;
+ maxy = miny + ext_y;
+ }
+ else
+ {
+ /* assumed to be any possible Geometry defining a BBOX */
+ minx = geom->MinX;
+ maxx = geom->MaxX;
+ miny = geom->MinY;
+ maxy = geom->MaxY;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+ ret =
+ rl2_export_triple_band_geotiff_from_dbms (sqlite, path, coverage,
+ horz_res, vert_res, minx,
+ miny, maxx, maxy, width,
+ height, red_band,
+ green_band, blue_band,
+ compression, tile_sz,
+ worldfile);
+ if (ret != RL2_OK)
+ {
+ errcode = 0;
+ goto error;
+ }
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, 1);
+ return;
+
+ error:
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, errcode);
+}
+
+static void
+fnct_WriteMonoBandGeoTiff (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteMonoBandGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, int mono_band, BLOB geom, double resolution)
+/ WriteMonoBandGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res)
+/ WriteMonoBandGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res, int with_worldfile)
+/ WriteMonoBandGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res, int with_worldfile, text compression)
+/ WriteMonoBandGeoTiff(text coverage, text geotiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res, int with_worldfile, text compression,
+/ int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *path;
+ int width;
+ int height;
+ int mono_band;
+ const unsigned char *blob;
+ int blob_sz;
+ double horz_res;
+ double vert_res;
+ int worldfile = 0;
+ unsigned char compression = RL2_COMPRESSION_NONE;
+ int tile_sz = 256;
+ rl2CoveragePtr coverage = NULL;
+ sqlite3 *sqlite;
+ int ret;
+ int errcode = -1;
+ gaiaGeomCollPtr geom;
+ double minx;
+ double maxx;
+ double miny;
+ double maxy;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[4]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[5]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[6]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[6]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 7 && sqlite3_value_type (argv[7]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[7]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 8 && sqlite3_value_type (argv[8]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 9 && sqlite3_value_type (argv[9]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 10 && sqlite3_value_type (argv[10]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* retrieving all arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ path = (const char *) sqlite3_value_text (argv[1]);
+ width = sqlite3_value_int (argv[2]);
+ height = sqlite3_value_int (argv[3]);
+ mono_band = sqlite3_value_int (argv[4]);
+ blob = sqlite3_value_blob (argv[5]);
+ blob_sz = sqlite3_value_bytes (argv[5]);
+ if (sqlite3_value_type (argv[6]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[6]);
+ horz_res = ival;
+ }
+ else
+ horz_res = sqlite3_value_double (argv[6]);
+ if (argc > 7)
+ {
+ if (sqlite3_value_type (argv[7]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[7]);
+ vert_res = ival;
+ }
+ else
+ vert_res = sqlite3_value_double (argv[7]);
+ }
+ else
+ vert_res = horz_res;
+ if (argc > 8)
+ worldfile = sqlite3_value_int (argv[8]);
+ if (argc > 9)
+ {
+ const char *compr = (const char *) sqlite3_value_text (argv[9]);
+ compression = RL2_COMPRESSION_UNKNOWN;
+ if (strcasecmp (compr, "NONE") == 0)
+ compression = RL2_COMPRESSION_NONE;
+ if (strcasecmp (compr, "DEFLATE") == 0)
+ compression = RL2_COMPRESSION_DEFLATE;
+ if (strcasecmp (compr, "LZW") == 0)
+ compression = RL2_COMPRESSION_LZW;
+ if (strcasecmp (compr, "JPEG") == 0)
+ compression = RL2_COMPRESSION_JPEG;
+ if (strcasecmp (compr, "FAX3") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX3;
+ if (strcasecmp (compr, "FAX4") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX4;
+ }
+ if (argc > 10)
+ tile_sz = sqlite3_value_int (argv[10]);
+
+/* coarse args validation */
+ if (width < 0 || width > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (height < 0 || height > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (mono_band < 0 || mono_band > 255)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (tile_sz < 64 || tile_sz > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (compression == RL2_COMPRESSION_UNKNOWN)
+ {
+ errcode = -1;
+ goto error;
+ }
+
+/* checking the Geometry */
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ if (geom == NULL)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (is_point (geom))
+ {
+ /* assumed to be the GeoTiff Center Point */
+ gaiaPointPtr pt = geom->FirstPoint;
+ double ext_x = (double) width * horz_res;
+ double ext_y = (double) height * vert_res;
+ minx = pt->X - ext_x / 2.0;
+ maxx = minx + ext_x;
+ miny = pt->Y - ext_y / 2.0;
+ maxy = miny + ext_y;
+ }
+ else
+ {
+ /* assumed to be any possible Geometry defining a BBOX */
+ minx = geom->MinX;
+ maxx = geom->MaxX;
+ miny = geom->MinY;
+ maxy = geom->MaxY;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+ ret =
+ rl2_export_mono_band_geotiff_from_dbms (sqlite, path, coverage,
+ horz_res, vert_res, minx,
+ miny, maxx, maxy, width,
+ height, mono_band,
+ compression, tile_sz,
+ worldfile);
+ if (ret != RL2_OK)
+ {
+ errcode = 0;
+ goto error;
+ }
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, 1);
+ return;
+
+ error:
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, errcode);
+}
+
+static void
+common_write_tiff (int with_worldfile, sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteTiff?(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double resolution)
+/ WriteTiff?(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res)
+/ WriteTiff?(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, text compression)
+/ WriteTiff?(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, text compression, int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *path;
+ int width;
+ int height;
+ const unsigned char *blob;
+ int blob_sz;
+ double horz_res;
+ double vert_res;
+ unsigned char compression = RL2_COMPRESSION_NONE;
+ int tile_sz = 256;
+ rl2CoveragePtr coverage = NULL;
+ sqlite3 *sqlite;
+ int ret;
+ int errcode = -1;
+ gaiaGeomCollPtr geom;
+ double minx;
+ double maxx;
+ double miny;
+ double maxy;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[4]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[5]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[5]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 6 && sqlite3_value_type (argv[6]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[6]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 7 && sqlite3_value_type (argv[7]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 8 && sqlite3_value_type (argv[8]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* retrieving all arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ path = (const char *) sqlite3_value_text (argv[1]);
+ width = sqlite3_value_int (argv[2]);
+ height = sqlite3_value_int (argv[3]);
+ blob = sqlite3_value_blob (argv[4]);
+ blob_sz = sqlite3_value_bytes (argv[4]);
+ if (sqlite3_value_type (argv[5]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[5]);
+ horz_res = ival;
+ }
+ else
+ horz_res = sqlite3_value_double (argv[5]);
+ if (argc > 6)
+ {
+ if (sqlite3_value_type (argv[6]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[6]);
+ vert_res = ival;
+ }
+ else
+ vert_res = sqlite3_value_double (argv[6]);
+ }
+ else
+ vert_res = horz_res;
+ if (argc > 7)
+ {
+ const char *compr = (const char *) sqlite3_value_text (argv[7]);
+ compression = RL2_COMPRESSION_UNKNOWN;
+ if (strcasecmp (compr, "NONE") == 0)
+ compression = RL2_COMPRESSION_NONE;
+ if (strcasecmp (compr, "DEFLATE") == 0)
+ compression = RL2_COMPRESSION_DEFLATE;
+ if (strcasecmp (compr, "LZW") == 0)
+ compression = RL2_COMPRESSION_LZW;
+ if (strcasecmp (compr, "JPEG") == 0)
+ compression = RL2_COMPRESSION_JPEG;
+ if (strcasecmp (compr, "FAX3") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX3;
+ if (strcasecmp (compr, "FAX4") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX4;
+ }
+ if (argc > 8)
+ tile_sz = sqlite3_value_int (argv[8]);
+
+/* coarse args validation */
+ if (width < 0 || width > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (height < 0 || height > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (tile_sz < 64 || tile_sz > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (compression == RL2_COMPRESSION_UNKNOWN)
+ {
+ errcode = -1;
+ goto error;
+ }
+
+/* checking the Geometry */
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ if (geom == NULL)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (is_point (geom))
+ {
+ /* assumed to be the GeoTiff Center Point */
+ gaiaPointPtr pt = geom->FirstPoint;
+ double ext_x = (double) width * horz_res;
+ double ext_y = (double) height * vert_res;
+ minx = pt->X - ext_x / 2.0;
+ maxx = minx + ext_x;
+ miny = pt->Y - ext_y / 2.0;
+ maxy = miny + ext_y;
+ }
+ else
+ {
+ /* assumed to be any possible Geometry defining a BBOX */
+ minx = geom->MinX;
+ maxx = geom->MaxX;
+ miny = geom->MinY;
+ maxy = geom->MaxY;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+ if (with_worldfile)
+ {
+ /* TIFF + Worldfile */
+ ret =
+ rl2_export_tiff_worldfile_from_dbms (sqlite, path, coverage,
+ horz_res, vert_res, minx,
+ miny, maxx, maxy, width,
+ height, compression,
+ tile_sz);
+ }
+ else
+ {
+ /* plain TIFF, no Worldfile */
+ ret =
+ rl2_export_tiff_from_dbms (sqlite, path, coverage, horz_res,
+ vert_res, minx, miny, maxx, maxy,
+ width, height, compression, tile_sz);
+ }
+ if (ret != RL2_OK)
+ {
+ errcode = 0;
+ goto error;
+ }
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, 1);
+ return;
+
+ error:
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, errcode);
+}
+
+static void
+fnct_WriteTiffTfw (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteTiffTfw(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double resolution)
+/ WriteTiffTfw(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res)
+/ WriteTiffTfw(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, text compression)
+/ WriteTiffTfw(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, text compression, int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ common_write_tiff (1, context, argc, argv);
+}
+
+static void
+fnct_WriteTiff (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteTiff(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double resolution)
+/ WriteTiff(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res)
+/ WriteTiff(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, text compression)
+/ WriteTiff(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, text compression, int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ common_write_tiff (0, context, argc, argv);
+}
+
+static void
+common_write_jpeg (int with_worldfile, sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteJpeg?(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double resolution)
+/ WriteJpeg?(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res)
+/ WriteJpeg?(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, int quality)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *path;
+ int width;
+ int height;
+ const unsigned char *blob;
+ int blob_sz;
+ double horz_res;
+ double vert_res;
+ int quality = 80;
+ rl2CoveragePtr coverage = NULL;
+ sqlite3 *sqlite;
+ int ret;
+ int errcode = -1;
+ gaiaGeomCollPtr geom;
+ double minx;
+ double maxx;
+ double miny;
+ double maxy;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[4]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[5]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[5]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 6 && sqlite3_value_type (argv[6]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[6]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 7 && sqlite3_value_type (argv[7]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* retrieving all arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ path = (const char *) sqlite3_value_text (argv[1]);
+ width = sqlite3_value_int (argv[2]);
+ height = sqlite3_value_int (argv[3]);
+ blob = sqlite3_value_blob (argv[4]);
+ blob_sz = sqlite3_value_bytes (argv[4]);
+ if (sqlite3_value_type (argv[5]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[5]);
+ horz_res = ival;
+ }
+ else
+ horz_res = sqlite3_value_double (argv[5]);
+ if (argc > 6)
+ {
+ if (sqlite3_value_type (argv[6]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[6]);
+ vert_res = ival;
+ }
+ else
+ vert_res = sqlite3_value_double (argv[6]);
+ }
+ else
+ vert_res = horz_res;
+ if (argc > 7)
+ quality = sqlite3_value_int (argv[7]);
+
+/* coarse args validation */
+ if (width < 0 || width > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (height < 0 || height > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (quality < 0)
+ quality = 0;
+ if (quality > 100)
+ quality = 100;
+
+/* checking the Geometry */
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ if (geom == NULL)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (is_point (geom))
+ {
+ /* assumed to be the GeoTiff Center Point */
+ gaiaPointPtr pt = geom->FirstPoint;
+ double ext_x = (double) width * horz_res;
+ double ext_y = (double) height * vert_res;
+ minx = pt->X - ext_x / 2.0;
+ maxx = minx + ext_x;
+ miny = pt->Y - ext_y / 2.0;
+ maxy = miny + ext_y;
+ }
+ else
+ {
+ /* assumed to be any possible Geometry defining a BBOX */
+ minx = geom->MinX;
+ maxx = geom->MaxX;
+ miny = geom->MinY;
+ maxy = geom->MaxY;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+ ret =
+ rl2_export_jpeg_from_dbms (sqlite, path, coverage, horz_res,
+ vert_res, minx, miny, maxx, maxy,
+ width, height, quality, with_worldfile);
+ if (ret != RL2_OK)
+ {
+ errcode = 0;
+ goto error;
+ }
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, 1);
+ return;
+
+ error:
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, errcode);
+}
+
+static void
+fnct_WriteJpegJgw (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteJpegJgw(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double resolution)
+/ WriteJpegJgw(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res)
+/ WriteJpegJgw(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, int quality)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ common_write_jpeg (1, context, argc, argv);
+}
+
+static void
+fnct_WriteJpeg (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteJpeg(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double resolution)
+/ WriteJpeg(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res)
+/ WriteJpeg(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double horz_res,
+/ double vert_res, int quality)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ common_write_jpeg (0, context, argc, argv);
+}
+
+static void
+common_write_triple_band_tiff (int with_worldfile, sqlite3_context * context,
+ int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteTripleBandTiff?(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double resolution)
+/ WriteTripleBandTiff?(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res)
+/ WriteTripleBandTiff?(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res,
+/ text compression)
+/ WriteTripleBandTiff?(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res,
+/ text compression, int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *path;
+ int width;
+ int height;
+ int red_band;
+ int green_band;
+ int blue_band;
+ const unsigned char *blob;
+ int blob_sz;
+ double horz_res;
+ double vert_res;
+ unsigned char compression = RL2_COMPRESSION_NONE;
+ int tile_sz = 256;
+ rl2CoveragePtr coverage = NULL;
+ sqlite3 *sqlite;
+ int ret;
+ int errcode = -1;
+ gaiaGeomCollPtr geom;
+ double minx;
+ double maxx;
+ double miny;
+ double maxy;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[4]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[5]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[6]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[7]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[8]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[8]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 9 && sqlite3_value_type (argv[9]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[9]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 10 && sqlite3_value_type (argv[10]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 11 && sqlite3_value_type (argv[11]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* retrieving all arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ path = (const char *) sqlite3_value_text (argv[1]);
+ width = sqlite3_value_int (argv[2]);
+ height = sqlite3_value_int (argv[3]);
+ red_band = sqlite3_value_int (argv[4]);
+ green_band = sqlite3_value_int (argv[5]);
+ blue_band = sqlite3_value_int (argv[6]);
+ blob = sqlite3_value_blob (argv[7]);
+ blob_sz = sqlite3_value_bytes (argv[7]);
+ if (sqlite3_value_type (argv[8]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[8]);
+ horz_res = ival;
+ }
+ else
+ horz_res = sqlite3_value_double (argv[8]);
+ if (argc > 9)
+ {
+ if (sqlite3_value_type (argv[9]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[9]);
+ vert_res = ival;
+ }
+ else
+ vert_res = sqlite3_value_double (argv[9]);
+ }
+ else
+ vert_res = horz_res;
+ if (argc > 10)
+ {
+ const char *compr = (const char *) sqlite3_value_text (argv[10]);
+ compression = RL2_COMPRESSION_UNKNOWN;
+ if (strcasecmp (compr, "NONE") == 0)
+ compression = RL2_COMPRESSION_NONE;
+ if (strcasecmp (compr, "DEFLATE") == 0)
+ compression = RL2_COMPRESSION_DEFLATE;
+ if (strcasecmp (compr, "LZW") == 0)
+ compression = RL2_COMPRESSION_LZW;
+ if (strcasecmp (compr, "JPEG") == 0)
+ compression = RL2_COMPRESSION_JPEG;
+ if (strcasecmp (compr, "FAX3") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX3;
+ if (strcasecmp (compr, "FAX4") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX4;
+ }
+ if (argc > 11)
+ tile_sz = sqlite3_value_int (argv[11]);
+
+/* coarse args validation */
+ if (width < 0 || width > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (height < 0 || height > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (red_band < 0 || red_band > 255)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (green_band < 0 || green_band > 255)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (blue_band < 0 || blue_band > 255)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (tile_sz < 64 || tile_sz > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (compression == RL2_COMPRESSION_UNKNOWN)
+ {
+ errcode = -1;
+ goto error;
+ }
+
+/* checking the Geometry */
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ if (geom == NULL)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (is_point (geom))
+ {
+ /* assumed to be the GeoTiff Center Point */
+ gaiaPointPtr pt = geom->FirstPoint;
+ double ext_x = (double) width * horz_res;
+ double ext_y = (double) height * vert_res;
+ minx = pt->X - ext_x / 2.0;
+ maxx = minx + ext_x;
+ miny = pt->Y - ext_y / 2.0;
+ maxy = miny + ext_y;
+ }
+ else
+ {
+ /* assumed to be any possible Geometry defining a BBOX */
+ minx = geom->MinX;
+ maxx = geom->MaxX;
+ miny = geom->MinY;
+ maxy = geom->MaxY;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+ if (with_worldfile)
+ {
+ /* TIFF + Worldfile */
+ ret =
+ rl2_export_triple_band_tiff_worldfile_from_dbms (sqlite, path,
+ coverage,
+ horz_res,
+ vert_res, minx,
+ miny, maxx,
+ maxy, width,
+ height,
+ red_band,
+ green_band,
+ blue_band,
+ compression,
+ tile_sz);
+ }
+ else
+ {
+ /* plain TIFF, no Worldfile */
+ ret =
+ rl2_export_triple_band_tiff_from_dbms (sqlite, path, coverage,
+ horz_res, vert_res, minx,
+ miny, maxx, maxy, width,
+ height, red_band,
+ green_band, blue_band,
+ compression, tile_sz);
+ }
+ if (ret != RL2_OK)
+ {
+ errcode = 0;
+ goto error;
+ }
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, 1);
+ return;
+
+ error:
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, errcode);
+}
+
+static void
+fnct_WriteTripleBandTiffTfw (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteTripleBandTiffTfw(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double resolution)
+/ WriteTripleBandTiffTfw(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res)
+/ WriteTripleBandTiffTfw(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res,
+/ text compression)
+/ WriteTripleBandTiffTfw(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res,
+/ text compression, int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ common_write_triple_band_tiff (1, context, argc, argv);
+}
+
+static void
+fnct_WriteTripleBandTiff (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteTripleBandTiff(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double resolution)
+/ WriteTripleBandTiff(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res)
+/ WriteTripleBandTiff(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res,
+/ text compression)
+/ WriteTripleBandTiff(text coverage, text tiff_path, int width,
+/ int height, int red_band, int green_band, int blue_band,
+/ BLOB geom, double horz_res, double vert_res,
+/ text compression, int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ common_write_triple_band_tiff (0, context, argc, argv);
+}
+
+static void
+common_write_mono_band_tiff (int with_worldfile, sqlite3_context * context,
+ int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteMonoBandTiff?(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double resolution)
+/ WriteMonoBandTiff?(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res)
+/ WriteMonoBandTiff?(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res, text compression)
+/ WriteMonoBandTiff?(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res, text compression, int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *path;
+ int width;
+ int height;
+ int mono_band;
+ const unsigned char *blob;
+ int blob_sz;
+ double horz_res;
+ double vert_res;
+ unsigned char compression = RL2_COMPRESSION_NONE;
+ int tile_sz = 256;
+ rl2CoveragePtr coverage = NULL;
+ sqlite3 *sqlite;
+ int ret;
+ int errcode = -1;
+ gaiaGeomCollPtr geom;
+ double minx;
+ double maxx;
+ double miny;
+ double maxy;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[4]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[5]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[6]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[6]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 7 && sqlite3_value_type (argv[7]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[7]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 8 && sqlite3_value_type (argv[8]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 9 && sqlite3_value_type (argv[9]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* retrieving all arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ path = (const char *) sqlite3_value_text (argv[1]);
+ width = sqlite3_value_int (argv[2]);
+ height = sqlite3_value_int (argv[3]);
+ mono_band = sqlite3_value_int (argv[4]);
+ blob = sqlite3_value_blob (argv[5]);
+ blob_sz = sqlite3_value_bytes (argv[5]);
+ if (sqlite3_value_type (argv[6]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[6]);
+ horz_res = ival;
+ }
+ else
+ horz_res = sqlite3_value_double (argv[6]);
+ if (argc > 7)
+ {
+ if (sqlite3_value_type (argv[7]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[7]);
+ vert_res = ival;
+ }
+ else
+ vert_res = sqlite3_value_double (argv[7]);
+ }
+ else
+ vert_res = horz_res;
+ if (argc > 8)
+ {
+ const char *compr = (const char *) sqlite3_value_text (argv[8]);
+ compression = RL2_COMPRESSION_UNKNOWN;
+ if (strcasecmp (compr, "NONE") == 0)
+ compression = RL2_COMPRESSION_NONE;
+ if (strcasecmp (compr, "DEFLATE") == 0)
+ compression = RL2_COMPRESSION_DEFLATE;
+ if (strcasecmp (compr, "LZW") == 0)
+ compression = RL2_COMPRESSION_LZW;
+ if (strcasecmp (compr, "JPEG") == 0)
+ compression = RL2_COMPRESSION_JPEG;
+ if (strcasecmp (compr, "FAX3") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX3;
+ if (strcasecmp (compr, "FAX4") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX4;
+ }
+ if (argc > 9)
+ tile_sz = sqlite3_value_int (argv[9]);
+
+/* coarse args validation */
+ if (width < 0 || width > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (height < 0 || height > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (mono_band < 0 || mono_band > 255)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (tile_sz < 64 || tile_sz > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (compression == RL2_COMPRESSION_UNKNOWN)
+ {
+ errcode = -1;
+ goto error;
+ }
+
+/* checking the Geometry */
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ if (geom == NULL)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (is_point (geom))
+ {
+ /* assumed to be the GeoTiff Center Point */
+ gaiaPointPtr pt = geom->FirstPoint;
+ double ext_x = (double) width * horz_res;
+ double ext_y = (double) height * vert_res;
+ minx = pt->X - ext_x / 2.0;
+ maxx = minx + ext_x;
+ miny = pt->Y - ext_y / 2.0;
+ maxy = miny + ext_y;
+ }
+ else
+ {
+ /* assumed to be any possible Geometry defining a BBOX */
+ minx = geom->MinX;
+ maxx = geom->MaxX;
+ miny = geom->MinY;
+ maxy = geom->MaxY;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+ if (with_worldfile)
+ {
+ /* TIFF + Worldfile */
+ ret =
+ rl2_export_mono_band_tiff_worldfile_from_dbms (sqlite, path,
+ coverage,
+ horz_res,
+ vert_res, minx,
+ miny, maxx,
+ maxy, width,
+ height,
+ mono_band,
+ compression,
+ tile_sz);
+ }
+ else
+ {
+ /* plain TIFF, no Worldfile */
+ ret =
+ rl2_export_mono_band_tiff_from_dbms (sqlite, path, coverage,
+ horz_res, vert_res, minx,
+ miny, maxx, maxy, width,
+ height, mono_band,
+ compression, tile_sz);
+ }
+ if (ret != RL2_OK)
+ {
+ errcode = 0;
+ goto error;
+ }
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, 1);
+ return;
+
+ error:
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, errcode);
+}
+
+static void
+fnct_WriteMonoBandTiffTfw (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteMonoBandTiffTfw(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double resolution)
+/ WriteMonoBandTiffTfw(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res)
+/ WriteMonoBandTiffTfw(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res, text compression)
+/ WriteMonoBandTiffTfw(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res, text compression, int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ common_write_mono_band_tiff (1, context, argc, argv);
+}
+
+static void
+fnct_WriteMonoBandTiff (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteMonoBandTiff(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double resolution)
+/ WriteMonoBandTiff(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res)
+/ WriteMonoBandTiff(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res, text compression)
+/ WriteMonoBandTiff(text coverage, text tiff_path, int width,
+/ int height, int mono_band, BLOB geom, double horz_res,
+/ double vert_res, text compression, int tile_sz)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ common_write_mono_band_tiff (0, context, argc, argv);
+}
+
+static void
+fnct_WriteAsciiGrid (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ WriteAsciiGrid(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double resolution)
+/ WriteTiff(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double resolution,
+/ int is_centered)
+/ WriteTiff(text coverage, text tiff_path, int width,
+/ int height, BLOB geom, double resolution,
+/ int is_centered, int decimal_digits)
+/
+/ will return 1 (TRUE, success) or 0 (FALSE, failure)
+/ or -1 (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ const char *path;
+ int width;
+ int height;
+ const unsigned char *blob;
+ int blob_sz;
+ double resolution;
+ rl2CoveragePtr coverage = NULL;
+ sqlite3 *sqlite;
+ int ret;
+ int errcode = -1;
+ gaiaGeomCollPtr geom;
+ double minx;
+ double maxx;
+ double miny;
+ double maxy;
+ int is_centered = 1;
+ int decimal_digits = 4;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[4]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[5]) != SQLITE_INTEGER
+ && sqlite3_value_type (argv[5]) != SQLITE_FLOAT)
+ err = 1;
+ if (argc > 6 && sqlite3_value_type (argv[6]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 7 && sqlite3_value_type (argv[7]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+/* retrieving all arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ path = (const char *) sqlite3_value_text (argv[1]);
+ width = sqlite3_value_int (argv[2]);
+ height = sqlite3_value_int (argv[3]);
+ blob = sqlite3_value_blob (argv[4]);
+ blob_sz = sqlite3_value_bytes (argv[4]);
+ if (sqlite3_value_type (argv[5]) == SQLITE_INTEGER)
+ {
+ int ival = sqlite3_value_int (argv[5]);
+ resolution = ival;
+ }
+ else
+ resolution = sqlite3_value_double (argv[5]);
+ if (argc > 6)
+ is_centered = sqlite3_value_int (argv[6]);
+ if (argc > 7)
+ decimal_digits = sqlite3_value_int (argv[7]);
+
+ if (decimal_digits < 1)
+ decimal_digits = 0;
+ if (decimal_digits > 18)
+ decimal_digits = 18;
+
+/* coarse args validation */
+ if (width < 0 || width > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (height < 0 || height > UINT16_MAX)
+ {
+ errcode = -1;
+ goto error;
+ }
+
+/* checking the Geometry */
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ if (geom == NULL)
+ {
+ errcode = -1;
+ goto error;
+ }
+ if (is_point (geom))
+ {
+ /* assumed to be the GeoTiff Center Point */
+ gaiaPointPtr pt = geom->FirstPoint;
+ double ext_x = (double) width * resolution;
+ double ext_y = (double) height * resolution;
+ minx = pt->X - ext_x / 2.0;
+ maxx = minx + ext_x;
+ miny = pt->Y - ext_y / 2.0;
+ maxy = miny + ext_y;
+ }
+ else
+ {
+ /* assumed to be any possible Geometry defining a BBOX */
+ minx = geom->MinX;
+ maxx = geom->MaxX;
+ miny = geom->MinY;
+ maxy = geom->MaxY;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ {
+ sqlite3_result_int (context, -1);
+ return;
+ }
+
+ ret =
+ rl2_export_ascii_grid_from_dbms (sqlite, path, coverage,
+ resolution, minx,
+ miny, maxx, maxy, width,
+ height, is_centered, decimal_digits);
+ if (ret != RL2_OK)
+ {
+ errcode = 0;
+ goto error;
+ }
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, 1);
+ return;
+
+ error:
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ sqlite3_result_int (context, errcode);
+}
+
+static void
+fnct_GetMapImage (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetMapImage(text coverage, BLOB geom, int width, int height)
+/ GetMapImage(text coverage, BLOB geom, int width, int height,
+/ text style)
+/ GetMapImage(text coverage, BLOB geom, int width, int height,
+/ text style, text format)
+/ GetMapImage(text coverage, BLOB geom, int width, int height,
+/ text style, text format, text bg_color)
+/ GetMapImage(text coverage, BLOB geom, int width, int height,
+/ text style, text format, text bg_color, int transparent)
+/ GetMapImage(text coverage, BLOB geom, int width, int height,
+/ text style, text format, text bg_color, int transparent,
+/ int quality)
+/ GetMapImage(text coverage, BLOB geom, int width, int height,
+/ text style, text format, text bg_color, int transparent,
+/ int quality, int reaspect)
+/
+/ will return a BLOB containing the Image payload
+/ or NULL (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ rl2CoveragePtr coverage = NULL;
+ rl2PrivCoveragePtr cvg;
+ int width;
+ int height;
+ int base_width;
+ int base_height;
+ const unsigned char *blob;
+ int blob_sz;
+ const char *style = "default";
+ const char *format = "image/png";
+ const char *bg_color = "#ffffff";
+ unsigned char bg_red;
+ unsigned char bg_green;
+ unsigned char bg_blue;
+ int transparent = 0;
+ int quality = 80;
+ int reaspect = 0;
+ sqlite3 *sqlite;
+ gaiaGeomCollPtr geom;
+ double minx;
+ double maxx;
+ double miny;
+ double maxy;
+ double ext_x;
+ double ext_y;
+ double x_res;
+ double y_res;
+ int srid;
+ int level_id;
+ int scale;
+ int xscale;
+ double xx_res;
+ double yy_res;
+ double aspect_org;
+ double aspect_dst;
+ int ok_style;
+ int ok_format;
+ unsigned char *outbuf = NULL;
+ int outbuf_size;
+ unsigned char *image = NULL;
+ int image_size;
+ rl2PalettePtr palette = NULL;
+ double confidence;
+ unsigned char format_id = RL2_OUTPUT_FORMAT_UNKNOWN;
+ unsigned char out_pixel = RL2_PIXEL_UNKNOWN;
+ rl2RasterStylePtr symbolizer = NULL;
+ rl2RasterStatisticsPtr stats = NULL;
+ double opacity = 1.0;
+ struct aux_renderer aux;
+ int was_monochrome;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_BLOB)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 4 && sqlite3_value_type (argv[4]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 5 && sqlite3_value_type (argv[5]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 6 && sqlite3_value_type (argv[6]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 7 && sqlite3_value_type (argv[7]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 8 && sqlite3_value_type (argv[8]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 9 && sqlite3_value_type (argv[9]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+
+/* retrieving the arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ blob = sqlite3_value_blob (argv[1]);
+ blob_sz = sqlite3_value_bytes (argv[1]);
+ width = sqlite3_value_int (argv[2]);
+ height = sqlite3_value_int (argv[3]);
+ if (argc > 4)
+ style = (const char *) sqlite3_value_text (argv[4]);
+ if (argc > 5)
+ format = (const char *) sqlite3_value_text (argv[5]);
+ if (argc > 6)
+ bg_color = (const char *) sqlite3_value_text (argv[6]);
+ if (argc > 7)
+ transparent = sqlite3_value_int (argv[7]);
+ if (argc > 8)
+ quality = sqlite3_value_int (argv[8]);
+ if (argc > 9)
+ reaspect = sqlite3_value_int (argv[9]);
+
+/* coarse args validation */
+ sqlite = sqlite3_context_db_handle (context);
+ if (width < 64 || width > 5000)
+ goto error;
+ if (height < 64 || height > 5000)
+ goto error;
+/* validating the format */
+ ok_format = 0;
+ if (strcmp (format, "image/png") == 0)
+ {
+ format_id = RL2_OUTPUT_FORMAT_PNG;
+ ok_format = 1;
+ }
+ if (strcmp (format, "image/jpeg") == 0)
+ {
+ format_id = RL2_OUTPUT_FORMAT_JPEG;
+ ok_format = 1;
+ }
+ if (strcmp (format, "image/tiff") == 0)
+ {
+ format_id = RL2_OUTPUT_FORMAT_TIFF;
+ ok_format = 1;
+ }
+ if (strcmp (format, "application/x-pdf") == 0)
+ {
+ format_id = RL2_OUTPUT_FORMAT_PDF;
+ ok_format = 1;
+ }
+ if (!ok_format)
+ goto error;
+/* parsing the background color */
+ if (rl2_parse_hexrgb (bg_color, &bg_red, &bg_green, &bg_blue) != RL2_OK)
+ goto error;
+/* checking the Geometry */
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ if (geom == NULL)
+ goto error;
+ minx = geom->MinX;
+ maxx = geom->MaxX;
+ miny = geom->MinY;
+ maxy = geom->MaxY;
+ ext_x = maxx - minx;
+ ext_y = maxy - miny;
+ if (ext_x <= 0.0 || ext_y <= 0.0)
+ goto error;
+ gaiaFreeGeomColl (geom);
+ if (rl2_test_layer_group (sqlite, cvg_name))
+ {
+ /* switching the whole task to the Group renderer */
+ struct aux_group_renderer aux;
+ aux.context = context;
+ aux.group_name = cvg_name;
+ aux.minx = minx;
+ aux.maxx = maxx;
+ aux.miny = miny;
+ aux.maxy = maxy;
+ aux.width = width;
+ aux.height = height;
+ aux.style = style;
+ aux.format_id = format_id;
+ aux.bg_red = bg_red;
+ aux.bg_green = bg_green;
+ aux.bg_blue = bg_blue;
+ aux.transparent = transparent;
+ aux.quality = quality;
+ aux.reaspect = reaspect;
+ rl2_aux_group_renderer (&aux);
+ return;
+ }
+
+ x_res = ext_x / (double) width;
+ y_res = ext_y / (double) height;
+/* validating the style */
+ ok_style = 0;
+ if (strcasecmp (style, "default") == 0)
+ ok_style = 1;
+ else
+ {
+ /* attempting to get a RasterSymbolizer style */
+ symbolizer =
+ rl2_create_raster_style_from_dbms (sqlite, cvg_name, style);
+ if (symbolizer == NULL)
+ goto error;
+ stats = rl2_create_raster_statistics_from_dbms (sqlite, cvg_name);
+ if (stats == NULL)
+ goto error;
+ ok_style = 1;
+ }
+ if (!ok_style)
+ goto error;
+
+/* attempting to load the Coverage definitions from the DBMS */
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ goto error;
+ if (rl2_get_coverage_srid (coverage, &srid) != RL2_OK)
+ srid = -1;
+ cvg = (rl2PrivCoveragePtr) coverage;
+ out_pixel = RL2_PIXEL_UNKNOWN;
+ if (cvg->sampleType == RL2_SAMPLE_UINT8 && cvg->pixelType == RL2_PIXEL_RGB
+ && cvg->nBands == 3)
+ out_pixel = RL2_PIXEL_RGB;
+ if (cvg->sampleType == RL2_SAMPLE_UINT8
+ && cvg->pixelType == RL2_PIXEL_GRAYSCALE && cvg->nBands == 1)
+ out_pixel = RL2_PIXEL_GRAYSCALE;
+ if (cvg->pixelType == RL2_PIXEL_PALETTE && cvg->nBands == 1)
+ out_pixel = RL2_PIXEL_PALETTE;
+ if (cvg->pixelType == RL2_PIXEL_MONOCHROME && cvg->nBands == 1)
+ out_pixel = RL2_PIXEL_MONOCHROME;
+
+ if ((cvg->pixelType == RL2_PIXEL_DATAGRID
+ || cvg->pixelType == RL2_PIXEL_MULTIBAND) && symbolizer == NULL)
+ {
+ /* creating a default RasterStyle */
+ rl2PrivRasterStylePtr symb = malloc (sizeof (rl2PrivRasterStyle));
+ symbolizer = (rl2RasterStylePtr) symb;
+ symb->name = malloc (8);
+ strcpy (symb->name, "default");
+ symb->title = NULL;
+ symb->abstract = NULL;
+ symb->opacity = 1.0;
+ symb->contrastEnhancement = RL2_CONTRAST_ENHANCEMENT_NONE;
+ symb->bandSelection = malloc (sizeof (rl2PrivBandSelection));
+ symb->bandSelection->selectionType = RL2_BAND_SELECTION_MONO;
+ symb->bandSelection->grayBand = 0;
+ symb->bandSelection->grayContrast = RL2_CONTRAST_ENHANCEMENT_NONE;
+ symb->categorize = NULL;
+ symb->interpolate = NULL;
+ symb->shadedRelief = 0;
+ if (stats == NULL)
+ {
+ stats =
+ rl2_create_raster_statistics_from_dbms (sqlite, cvg_name);
+ if (stats == NULL)
+ goto error;
+ }
+ }
+
+ if (symbolizer != NULL)
+ {
+ /* applying a RasterSymbolizer */
+ int yes_no;
+ if (rl2_is_raster_style_triple_band_selected (symbolizer, &yes_no) ==
+ RL2_OK)
+ {
+ if ((cvg->sampleType == RL2_SAMPLE_UINT8
+ || cvg->sampleType == RL2_SAMPLE_UINT16)
+ && (cvg->pixelType == RL2_PIXEL_RGB
+ || cvg->pixelType == RL2_PIXEL_MULTIBAND) && yes_no)
+ out_pixel = RL2_PIXEL_RGB;
+ }
+ if (rl2_is_raster_style_mono_band_selected (symbolizer, &yes_no) ==
+ RL2_OK)
+ {
+ if ((cvg->sampleType == RL2_SAMPLE_UINT8
+ || cvg->sampleType == RL2_SAMPLE_UINT16)
+ && (cvg->pixelType == RL2_PIXEL_RGB
+ || cvg->pixelType == RL2_PIXEL_MULTIBAND
+ || cvg->pixelType == RL2_PIXEL_GRAYSCALE) && yes_no)
+ out_pixel = RL2_PIXEL_GRAYSCALE;
+ if ((cvg->sampleType == RL2_SAMPLE_INT8
+ || cvg->sampleType == RL2_SAMPLE_UINT8
+ || cvg->sampleType == RL2_SAMPLE_INT16
+ || cvg->sampleType == RL2_SAMPLE_UINT16
+ || cvg->sampleType == RL2_SAMPLE_INT32
+ || cvg->sampleType == RL2_SAMPLE_UINT32
+ || cvg->sampleType == RL2_SAMPLE_FLOAT
+ || cvg->sampleType == RL2_SAMPLE_DOUBLE)
+ && cvg->pixelType == RL2_PIXEL_DATAGRID && yes_no)
+ out_pixel = RL2_PIXEL_GRAYSCALE;
+ }
+ if (rl2_get_raster_style_opacity (symbolizer, &opacity) != RL2_OK)
+ opacity = 1.0;
+ if (opacity > 1.0)
+ opacity = 1.0;
+ if (opacity < 0.0)
+ opacity = 0.0;
+ if (opacity < 1.0)
+ transparent = 1;
+ }
+ if (out_pixel == RL2_PIXEL_UNKNOWN)
+ {
+ fprintf (stderr, "*** Unsupported Pixel !!!!\n");
+ goto error;
+ }
+
+/* retrieving the optimal resolution level */
+ if (!find_best_resolution_level
+ (sqlite, cvg_name, x_res, y_res, &level_id, &scale, &xscale, &xx_res,
+ &yy_res))
+ goto error;
+ base_width = (int) (ext_x / xx_res);
+ base_height = (int) (ext_y / yy_res);
+ if ((base_width <= 0 && base_width >= USHRT_MAX)
+ || (base_height <= 0 && base_height >= USHRT_MAX))
+ goto error;
+ if (base_width > 8192 || base_height > 8192)
+ {
+ /* warning: this usually implies missing Pyramid support */
+ fprintf (stderr,
+ "ERROR: a really huge image (%u x %u) has been requested;\n"
+ "this is usually caused by a missing multi-resolution Pyramid.\n"
+ "Please build a Pyramid supporting '%s'\n\n", base_width,
+ base_height, cvg_name);
+ goto error;
+ }
+ aspect_org = (double) base_width / (double) base_height;
+ aspect_dst = (double) width / (double) height;
+ confidence = aspect_org / 100.0;
+ if (aspect_dst >= (aspect_org - confidence)
+ || aspect_dst <= (aspect_org + confidence))
+ ;
+ else if (aspect_org != aspect_dst && !reaspect)
+ goto error;
+
+ was_monochrome = 0;
+ if (out_pixel == RL2_PIXEL_MONOCHROME)
+ {
+ if (level_id != 0 && scale != 1)
+ {
+ out_pixel = RL2_PIXEL_GRAYSCALE;
+ was_monochrome = 1;
+ }
+ }
+ if (out_pixel == RL2_PIXEL_PALETTE)
+ {
+ if (level_id != 0 && scale != 1)
+ out_pixel = RL2_PIXEL_RGB;
+ }
+ if (rl2_get_raw_raster_data_bgcolor
+ (sqlite, coverage, base_width, base_height,
+ minx, miny, maxx, maxy, xx_res, yy_res,
+ &outbuf, &outbuf_size, &palette, &out_pixel, bg_red, bg_green,
+ bg_blue, symbolizer, stats) != RL2_OK)
+ goto error;
+ if (was_monochrome && out_pixel == RL2_PIXEL_GRAYSCALE)
+ {
+ rl2_destroy_raster_style (symbolizer);
+ symbolizer = NULL;
+ }
+
+/* preparing the aux struct for passing rendering arguments */
+ aux.sqlite = sqlite;
+ aux.width = width;
+ aux.height = height;
+ aux.base_width = base_width;
+ aux.base_height = base_height;
+ aux.minx = minx;
+ aux.miny = miny;
+ aux.maxx = maxx;
+ aux.maxy = maxy;
+ aux.srid = srid;
+ aux.xx_res = xx_res;
+ aux.yy_res = yy_res;
+ aux.transparent = transparent;
+ aux.opacity = opacity;
+ aux.quality = quality;
+ aux.format_id = format_id;
+ aux.bg_red = bg_red;
+ aux.bg_green = bg_green;
+ aux.bg_blue = bg_blue;
+ aux.coverage = coverage;
+ aux.symbolizer = symbolizer;
+ aux.stats = stats;
+ aux.outbuf = outbuf;
+ aux.palette = palette;
+ aux.out_pixel = out_pixel;
+ if (!rl2_aux_render_image (&aux, &image, &image_size))
+ goto error;
+ sqlite3_result_blob (context, image, image_size, free);
+ rl2_destroy_coverage (coverage);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ if (symbolizer != NULL)
+ rl2_destroy_raster_style (symbolizer);
+ if (stats != NULL)
+ rl2_destroy_raster_statistics (stats);
+ return;
+
+ error:
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ if (symbolizer != NULL)
+ rl2_destroy_raster_style (symbolizer);
+ if (stats != NULL)
+ rl2_destroy_raster_statistics (stats);
+ sqlite3_result_null (context);
+}
+
+static void
+fnct_GetTileImage (sqlite3_context * context, int argc, sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetTileImage(text coverage, int tile_id)
+/ GetTileImage(text coverage, int tile_id, text bg_color)
+/ GetTileImage(text coverage, int tile_id, text bg_color,
+/ int transparent)
+/
+/ will return a BLOB containing the Image payload
+/ or NULL (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ rl2CoveragePtr coverage = NULL;
+ rl2PrivCoveragePtr cvg;
+ sqlite3_int64 tile_id;
+ int pyramid_level;
+ const char *bg_color = "#ffffff";
+ int transparent = 0;
+ unsigned char bg_red;
+ unsigned char bg_green;
+ unsigned char bg_blue;
+ unsigned short width;
+ unsigned short height;
+ sqlite3 *sqlite;
+ sqlite3_stmt *stmt = NULL;
+ int unsupported_tile;
+ int has_palette = 0;
+ char *table_tile_data;
+ char *xtable_tile_data;
+ char *table_tiles;
+ char *xtable_tiles;
+ char *sql;
+ int ret;
+ const unsigned char *blob_odd = NULL;
+ const unsigned char *blob_even = NULL;
+ int blob_odd_sz;
+ int blob_even_sz;
+ rl2RasterPtr raster = NULL;
+ rl2PrivRasterPtr rst;
+ rl2PalettePtr palette = NULL;
+ unsigned char *buffer = NULL;
+ unsigned char *mask = NULL;
+ unsigned char *rgba = NULL;
+ unsigned char *p_rgba;
+ unsigned short row;
+ unsigned short col;
+ unsigned char *image = NULL;
+ int image_size;
+ unsigned char *rgb = NULL;
+ unsigned char *alpha = NULL;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ rl2PrivPixelPtr no_data = NULL;
+ double opacity = 1.0;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 2 && sqlite3_value_type (argv[2]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 3 && sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+
+/* retrieving the arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ tile_id = sqlite3_value_int64 (argv[1]);
+ if (argc > 2)
+ bg_color = (const char *) sqlite3_value_text (argv[2]);
+ if (argc > 3)
+ transparent = sqlite3_value_int (argv[3]);
+
+/* parsing the background color */
+ if (rl2_parse_hexrgb (bg_color, &bg_red, &bg_green, &bg_blue) != RL2_OK)
+ goto error;
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ goto error;
+ cvg = (rl2PrivCoveragePtr) coverage;
+ unsupported_tile = 0;
+ switch (cvg->pixelType)
+ {
+ case RL2_PIXEL_PALETTE:
+ has_palette = 1;
+ break;
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_GRAYSCALE:
+ case RL2_PIXEL_RGB:
+ case RL2_PIXEL_DATAGRID:
+ break;
+ default:
+ unsupported_tile = 1;
+ break;
+ }
+ if (unsupported_tile)
+ {
+ fprintf (stderr, "*** Unsupported Tile Type !!!!\n");
+ goto error;
+ }
+ if (has_palette)
+ {
+ /* loading the Coverage's palette */
+ palette = rl2_get_dbms_palette (sqlite, cvg_name);
+ if (palette == NULL)
+ goto error;
+ }
+ no_data = cvg->noData;
+
+/* querying the tile */
+ table_tile_data = sqlite3_mprintf ("%s_tile_data", cvg_name);
+ xtable_tile_data = gaiaDoubleQuotedSql (table_tile_data);
+ sqlite3_free (table_tile_data);
+ table_tiles = sqlite3_mprintf ("%s_tiles", cvg_name);
+ xtable_tiles = gaiaDoubleQuotedSql (table_tiles);
+ sqlite3_free (table_tiles);
+ sql = sqlite3_mprintf ("SELECT d.tile_data_odd, d.tile_data_even, "
+ "t.pyramid_level FROM \"%s\" AS d "
+ "JOIN \"%s\" AS t ON (t.tile_id = d.tile_id) "
+ "WHERE t.tile_id = ?", xtable_tile_data,
+ xtable_tiles);
+ free (xtable_tile_data);
+ free (xtable_tiles);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (sqlite));
+ goto error;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_int64 (stmt, 1, tile_id);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ blob_odd = sqlite3_column_blob (stmt, 0);
+ blob_odd_sz = sqlite3_column_bytes (stmt, 0);
+ }
+ if (sqlite3_column_type (stmt, 1) == SQLITE_BLOB)
+ {
+ blob_even = sqlite3_column_blob (stmt, 1);
+ blob_even_sz = sqlite3_column_bytes (stmt, 1);
+ }
+ pyramid_level = sqlite3_column_int (stmt, 2);
+ if (has_palette && pyramid_level > 0)
+ {
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ palette = NULL;
+ }
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz,
+ blob_even, blob_even_sz, palette);
+ if (raster == NULL)
+ {
+ fprintf (stderr, ERR_FRMT64, tile_id);
+ goto error;
+ }
+ rst = (rl2PrivRasterPtr) raster;
+ width = rst->width;
+ height = rst->height;
+ sample_type = rst->sampleType;
+ pixel_type = rst->pixelType;
+ buffer = rst->rasterBuffer;
+ mask = rst->maskBuffer;
+ palette = (rl2PalettePtr) (rst->Palette);
+ rst->rasterBuffer = NULL;
+ rst->maskBuffer = NULL;
+ rst->Palette = NULL;
+ rl2_destroy_raster (raster);
+ rgba = malloc (width * height * 4);
+ if (rgba == NULL)
+ goto error;
+ /* priming the image background */
+ p_rgba = rgba;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ *p_rgba++ = bg_red;
+ *p_rgba++ = bg_green;
+ *p_rgba++ = bg_blue;
+ *p_rgba++ = 0; /* transparent */
+ }
+ }
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ ret =
+ get_rgba_from_monochrome_mask (width, height, buffer,
+ mask, no_data, rgba);
+ buffer = NULL;
+ mask = NULL;
+ if (!ret)
+ goto error;
+ if (!build_rgb_alpha
+ (width, height, rgba, &rgb, &alpha, bg_red, bg_green,
+ bg_blue))
+ goto error;
+ free (rgba);
+ rgba = NULL;
+ if (transparent)
+ {
+ if (!get_payload_from_gray_rgba_transparent
+ (width, height, rgb, alpha,
+ RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size, opacity))
+ goto error;
+ }
+ else
+ {
+ free (alpha);
+ alpha = NULL;
+ if (!get_payload_from_gray_rgba_opaque
+ (width, height, sqlite, 0, 0, 0, 0, -1,
+ rgb, RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size))
+ goto error;
+ }
+ sqlite3_result_blob (context, image, image_size, free);
+ break;
+ case RL2_PIXEL_PALETTE:
+ ret =
+ get_rgba_from_palette_mask (width, height, buffer,
+ mask, palette, no_data,
+ rgba);
+ buffer = NULL;
+ mask = NULL;
+ if (!ret)
+ goto error;
+ if (!build_rgb_alpha
+ (width, height, rgba, &rgb, &alpha, bg_red, bg_green,
+ bg_blue))
+ goto error;
+ free (rgba);
+ rgba = NULL;
+ if (transparent)
+ {
+ if (!get_payload_from_rgb_rgba_transparent
+ (width, height, rgb, alpha,
+ RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size, opacity))
+ goto error;
+ }
+ else
+ {
+ free (alpha);
+ alpha = NULL;
+ if (!get_payload_from_rgb_rgba_opaque
+ (width, height, sqlite, 0, 0, 0, 0, -1,
+ rgb, RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size))
+ goto error;
+ }
+ sqlite3_result_blob (context, image, image_size, free);
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ ret =
+ get_rgba_from_grayscale_mask (width, height, buffer,
+ mask, no_data, rgba);
+ buffer = NULL;
+ mask = NULL;
+ if (!ret)
+ goto error;
+ if (!build_rgb_alpha
+ (width, height, rgba, &rgb, &alpha, bg_red, bg_green,
+ bg_blue))
+ goto error;
+ free (rgba);
+ rgba = NULL;
+ if (transparent)
+ {
+ if (!get_payload_from_gray_rgba_transparent
+ (width, height, rgb, alpha,
+ RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size, opacity))
+ goto error;
+ }
+ else
+ {
+ free (alpha);
+ alpha = NULL;
+ if (!get_payload_from_gray_rgba_opaque
+ (width, height, sqlite, 0, 0, 0, 0, -1,
+ rgb, RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size))
+ goto error;
+ }
+ sqlite3_result_blob (context, image, image_size, free);
+ break;
+ case RL2_PIXEL_DATAGRID:
+ ret =
+ get_rgba_from_datagrid_mask (width, height,
+ sample_type, buffer,
+ mask, no_data, rgba);
+ buffer = NULL;
+ mask = NULL;
+ if (!ret)
+ goto error;
+ if (!build_rgb_alpha
+ (width, height, rgba, &rgb, &alpha, bg_red, bg_green,
+ bg_blue))
+ goto error;
+ free (rgba);
+ rgba = NULL;
+ if (transparent)
+ {
+ if (!get_payload_from_gray_rgba_transparent
+ (width, height, rgb, alpha,
+ RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size, opacity))
+ goto error;
+ }
+ else
+ {
+ free (alpha);
+ alpha = NULL;
+ if (!get_payload_from_gray_rgba_opaque
+ (width, height, sqlite, 0, 0, 0, 0, -1,
+ rgb, RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size))
+ goto error;
+ }
+ sqlite3_result_blob (context, image, image_size, free);
+ break;
+ case RL2_PIXEL_RGB:
+ if (sample_type == RL2_SAMPLE_UINT16)
+ {
+ ret =
+ get_rgba_from_multiband16 (width, height, 0, 1,
+ 2, 3,
+ (unsigned short *)
+ buffer, mask,
+ no_data, rgba);
+ }
+ else
+ {
+ ret =
+ get_rgba_from_rgb_mask (width, height, buffer,
+ mask, no_data, rgba);
+ }
+ buffer = NULL;
+ mask = NULL;
+ if (!ret)
+ goto error;
+ if (!build_rgb_alpha
+ (width, height, rgba, &rgb, &alpha, bg_red, bg_green,
+ bg_blue))
+ goto error;
+ free (rgba);
+ rgba = NULL;
+ if (transparent)
+ {
+ if (!get_payload_from_rgb_rgba_transparent
+ (width, height, rgb, alpha,
+ RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size, opacity))
+ goto error;
+ }
+ else
+ {
+ free (alpha);
+ alpha = NULL;
+ if (!get_payload_from_rgb_rgba_opaque
+ (width, height, sqlite, 0, 0, 0, 0, -1,
+ rgb, RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size))
+ goto error;
+ }
+ sqlite3_result_blob (context, image, image_size, free);
+ break;
+ default:
+ goto error;
+ break;
+ };
+ break;
+ }
+ else
+ goto error;
+ }
+ sqlite3_finalize (stmt);
+ stmt = NULL;
+
+ rl2_destroy_coverage (coverage);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ if (buffer != NULL)
+ free (buffer);
+ if (mask != NULL)
+ free (mask);
+ if (rgba != NULL)
+ free (rgba);
+ if (rgb != NULL)
+ free (rgb);
+ if (alpha != NULL)
+ free (alpha);
+ sqlite3_result_null (context);
+}
+
+static int
+get_triple_band_tile_image (sqlite3_context * context, const char *cvg_name,
+ sqlite3_int64 tile_id, unsigned char red_band,
+ unsigned char green_band, unsigned char blue_band,
+ unsigned char bg_red, unsigned char bg_green,
+ unsigned char bg_blue, int transparent)
+{
+/* common implementation: TileImage (mono/triple-band) */
+ rl2CoveragePtr coverage = NULL;
+ rl2PrivCoveragePtr cvg;
+ unsigned short width;
+ unsigned short height;
+ sqlite3 *sqlite;
+ sqlite3_stmt *stmt = NULL;
+ int unsupported_tile;
+ char *table_tile_data;
+ char *xtable_tile_data;
+ char *table_tiles;
+ char *xtable_tiles;
+ char *sql;
+ int ret;
+ const unsigned char *blob_odd = NULL;
+ const unsigned char *blob_even = NULL;
+ int blob_odd_sz;
+ int blob_even_sz;
+ rl2RasterPtr raster = NULL;
+ rl2PrivRasterPtr rst;
+ unsigned char *buffer = NULL;
+ unsigned char *mask = NULL;
+ unsigned char *rgba = NULL;
+ unsigned char *p_rgba;
+ unsigned short row;
+ unsigned short col;
+ unsigned char *image = NULL;
+ int image_size;
+ unsigned char *rgb = NULL;
+ unsigned char *alpha = NULL;
+ unsigned char sample_type;
+ unsigned char num_bands;
+ rl2PrivPixelPtr no_data = NULL;
+ double opacity = 1.0;
+
+/* attempting to load the Coverage definitions from the DBMS */
+ sqlite = sqlite3_context_db_handle (context);
+ coverage = rl2_create_coverage_from_dbms (sqlite, cvg_name);
+ if (coverage == NULL)
+ goto error;
+ cvg = (rl2PrivCoveragePtr) coverage;
+ unsupported_tile = 0;
+ switch (cvg->pixelType)
+ {
+ case RL2_PIXEL_RGB:
+ case RL2_PIXEL_MULTIBAND:
+ if (cvg->sampleType == RL2_SAMPLE_UINT8
+ || cvg->sampleType == RL2_SAMPLE_UINT16)
+ break;
+ unsupported_tile = 1;
+ break;
+ case RL2_PIXEL_DATAGRID:
+ if (cvg->sampleType == RL2_SAMPLE_INT8
+ || cvg->sampleType == RL2_SAMPLE_UINT8
+ || cvg->sampleType == RL2_SAMPLE_INT16
+ || cvg->sampleType == RL2_SAMPLE_UINT16
+ || cvg->sampleType == RL2_SAMPLE_INT32
+ || cvg->sampleType == RL2_SAMPLE_UINT32
+ || cvg->sampleType == RL2_SAMPLE_FLOAT
+ || cvg->sampleType == RL2_SAMPLE_DOUBLE)
+ break;
+ unsupported_tile = 1;
+ default:
+ unsupported_tile = 1;
+ break;
+ }
+ if (unsupported_tile)
+ {
+ fprintf (stderr, "*** Unsupported Tile Type !!!!\n");
+ goto error;
+ }
+ if (red_band >= cvg->nBands)
+ goto error;
+ if (green_band >= cvg->nBands)
+ goto error;
+ if (blue_band >= cvg->nBands)
+ goto error;
+ no_data = cvg->noData;
+
+/* querying the tile */
+ table_tile_data = sqlite3_mprintf ("%s_tile_data", cvg_name);
+ xtable_tile_data = gaiaDoubleQuotedSql (table_tile_data);
+ sqlite3_free (table_tile_data);
+ table_tiles = sqlite3_mprintf ("%s_tiles", cvg_name);
+ xtable_tiles = gaiaDoubleQuotedSql (table_tiles);
+ sqlite3_free (table_tiles);
+ sql = sqlite3_mprintf ("SELECT d.tile_data_odd, d.tile_data_even, "
+ "t.pyramid_level FROM \"%s\" AS d "
+ "JOIN \"%s\" AS t ON (t.tile_id = d.tile_id) "
+ "WHERE t.tile_id = ?", xtable_tile_data,
+ xtable_tiles);
+ free (xtable_tile_data);
+ free (xtable_tiles);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (sqlite));
+ goto error;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_int64 (stmt, 1, tile_id);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ blob_odd = sqlite3_column_blob (stmt, 0);
+ blob_odd_sz = sqlite3_column_bytes (stmt, 0);
+ }
+ if (sqlite3_column_type (stmt, 1) == SQLITE_BLOB)
+ {
+ blob_even = sqlite3_column_blob (stmt, 1);
+ blob_even_sz = sqlite3_column_bytes (stmt, 1);
+ }
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz,
+ blob_even, blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, ERR_FRMT64, tile_id);
+ goto error;
+ }
+ rst = (rl2PrivRasterPtr) raster;
+ width = rst->width;
+ height = rst->height;
+ sample_type = rst->sampleType;
+ num_bands = rst->nBands;
+ buffer = rst->rasterBuffer;
+ mask = rst->maskBuffer;
+ rst->rasterBuffer = NULL;
+ rst->maskBuffer = NULL;
+ rl2_destroy_raster (raster);
+ rgba = malloc (width * height * 4);
+ if (rgba == NULL)
+ goto error;
+ /* priming the image background */
+ p_rgba = rgba;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ *p_rgba++ = bg_red;
+ *p_rgba++ = bg_green;
+ *p_rgba++ = bg_blue;
+ *p_rgba++ = 0; /* transparent */
+ }
+ }
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ ret =
+ get_rgba_from_multiband8 (width, height, red_band,
+ green_band, blue_band,
+ num_bands, buffer, mask,
+ no_data, rgba);
+ buffer = NULL;
+ mask = NULL;
+ if (!ret)
+ goto error;
+ if (!build_rgb_alpha
+ (width, height, rgba, &rgb, &alpha, bg_red, bg_green,
+ bg_blue))
+ goto error;
+ free (rgba);
+ rgba = NULL;
+ if (transparent)
+ {
+ if (!get_payload_from_rgb_rgba_transparent
+ (width, height, rgb, alpha,
+ RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size, opacity))
+ goto error;
+ }
+ else
+ {
+ free (alpha);
+ alpha = NULL;
+ if (!get_payload_from_rgb_rgba_opaque
+ (width, height, sqlite, 0, 0, 0, 0, -1,
+ rgb, RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size))
+ goto error;
+ }
+ sqlite3_result_blob (context, image, image_size, free);
+ break;
+ case RL2_SAMPLE_UINT16:
+ ret =
+ get_rgba_from_multiband16 (width, height, red_band,
+ green_band, blue_band,
+ num_bands,
+ (unsigned short *) buffer,
+ mask, no_data, rgba);
+ if (!build_rgb_alpha
+ (width, height, rgba, &rgb, &alpha, bg_red, bg_green,
+ bg_blue))
+ goto error;
+ free (rgba);
+ rgba = NULL;
+ if (transparent)
+ {
+ if (!get_payload_from_rgb_rgba_transparent
+ (width, height, rgb, alpha,
+ RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size, opacity))
+ goto error;
+ }
+ else
+ {
+ free (alpha);
+ alpha = NULL;
+ if (!get_payload_from_rgb_rgba_opaque
+ (width, height, sqlite, 0, 0, 0, 0, -1,
+ rgb, RL2_OUTPUT_FORMAT_PNG, 100, &image,
+ &image_size))
+ goto error;
+ }
+ sqlite3_result_blob (context, image, image_size, free);
+ break;
+ default:
+ goto error;
+ break;
+ };
+ break;
+ }
+ else
+ goto error;
+ }
+ sqlite3_finalize (stmt);
+ stmt = NULL;
+
+ rl2_destroy_coverage (coverage);
+ return 1;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (coverage != NULL)
+ rl2_destroy_coverage (coverage);
+ if (buffer != NULL)
+ free (buffer);
+ if (mask != NULL)
+ free (mask);
+ if (rgba != NULL)
+ free (rgba);
+ if (rgb != NULL)
+ free (rgb);
+ if (alpha != NULL)
+ free (alpha);
+ return 0;
+}
+
+static void
+fnct_GetTripleBandTileImage (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetTripleBandTileImage(text coverage, int tile_id, int red_band,
+/ int green_band, int blue_band)
+/ GetTripleBandTileImage(text coverage, int tile_id, int red_band,
+/ int green_band, int blue_band, text bg_color)
+/ GetTripleBandTileImage(text coverage, int tile_id, int red_band,
+/ int green_band, int blue_band, text bg_color,
+/ int transparent)
+/
+/ will return a BLOB containing the Image payload
+/ or NULL (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ sqlite3_int64 tile_id;
+ const char *bg_color = "#ffffff";
+ int transparent = 0;
+ int red_band;
+ int green_band;
+ int blue_band;
+ unsigned char bg_red;
+ unsigned char bg_green;
+ unsigned char bg_blue;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[3]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[4]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 5 && sqlite3_value_type (argv[5]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 6 && sqlite3_value_type (argv[6]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+
+/* retrieving the arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ tile_id = sqlite3_value_int64 (argv[1]);
+ red_band = sqlite3_value_int (argv[2]);
+ green_band = sqlite3_value_int (argv[3]);
+ blue_band = sqlite3_value_int (argv[4]);
+ if (argc > 5)
+ bg_color = (const char *) sqlite3_value_text (argv[5]);
+ if (argc > 6)
+ transparent = sqlite3_value_int (argv[6]);
+
+/* coarse args validation */
+ if (red_band < 0 || red_band > 255)
+ goto error;
+ if (green_band < 0 || green_band > 255)
+ goto error;
+ if (blue_band < 0 || blue_band > 255)
+ goto error;
+
+/* parsing the background color */
+ if (rl2_parse_hexrgb (bg_color, &bg_red, &bg_green, &bg_blue) != RL2_OK)
+ goto error;
+
+ if (get_triple_band_tile_image
+ (context, cvg_name, tile_id, red_band, green_band, blue_band, bg_red,
+ bg_green, bg_blue, transparent))
+ return;
+
+ error:
+ sqlite3_result_null (context);
+}
+
+static void
+fnct_GetMonoBandTileImage (sqlite3_context * context, int argc,
+ sqlite3_value ** argv)
+{
+/* SQL function:
+/ GetMonoBandTileImage(text coverage, int tile_id, int mono_band)
+/ GetMonoBandTileImage(text coverage, int tile_id, int mono_band,
+/ text bg_color)
+/ GetMonoBandTileImage(text coverage, int tile_id, int mono_band,
+/ text bg_color, int transparent)
+/
+/ will return a BLOB containing the Image payload
+/ or NULL (INVALID ARGS)
+/
+*/
+ int err = 0;
+ const char *cvg_name;
+ sqlite3_int64 tile_id;
+ const char *bg_color = "#ffffff";
+ int transparent = 0;
+ int mono_band;
+ unsigned char bg_red;
+ unsigned char bg_green;
+ unsigned char bg_blue;
+ RL2_UNUSED (); /* LCOV_EXCL_LINE */
+
+ if (sqlite3_value_type (argv[0]) != SQLITE_TEXT)
+ err = 1;
+ if (sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+ err = 1;
+ if (sqlite3_value_type (argv[2]) != SQLITE_INTEGER)
+ err = 1;
+ if (argc > 3 && sqlite3_value_type (argv[3]) != SQLITE_TEXT)
+ err = 1;
+ if (argc > 4 && sqlite3_value_type (argv[4]) != SQLITE_INTEGER)
+ err = 1;
+ if (err)
+ {
+ sqlite3_result_null (context);
+ return;
+ }
+
+/* retrieving the arguments */
+ cvg_name = (const char *) sqlite3_value_text (argv[0]);
+ tile_id = sqlite3_value_int64 (argv[1]);
+ mono_band = sqlite3_value_int (argv[2]);
+ if (argc > 3)
+ bg_color = (const char *) sqlite3_value_text (argv[3]);
+ if (argc > 4)
+ transparent = sqlite3_value_int (argv[4]);
+
+/* coarse args validation */
+ if (mono_band < 0 || mono_band > 255)
+ goto error;
+
+/* parsing the background color */
+ if (rl2_parse_hexrgb (bg_color, &bg_red, &bg_green, &bg_blue) != RL2_OK)
+ goto error;
+
+ if (get_triple_band_tile_image
+ (context, cvg_name, tile_id, mono_band, mono_band, mono_band, bg_red,
+ bg_green, bg_blue, transparent))
+ return;
+
+ error:
+ sqlite3_result_null (context);
+}
+
+static void
+register_rl2_sql_functions (void *p_db)
+{
+ sqlite3 *db = p_db;
+ const char *security_level;
+ sqlite3_create_function (db, "rl2_version", 0, SQLITE_ANY, 0,
+ fnct_rl2_version, 0, 0);
+ sqlite3_create_function (db, "rl2_target_cpu", 0, SQLITE_ANY, 0,
+ fnct_rl2_target_cpu, 0, 0);
+ sqlite3_create_function (db, "IsValidPixel", 3, SQLITE_ANY, 0,
+ fnct_IsValidPixel, 0, 0);
+ sqlite3_create_function (db, "RL2_IsValidPixel", 3, SQLITE_ANY, 0,
+ fnct_IsValidPixel, 0, 0);
+ sqlite3_create_function (db, "IsValidRasterPalette", 2, SQLITE_ANY, 0,
+ fnct_IsValidRasterPalette, 0, 0);
+ sqlite3_create_function (db, "RL2_IsValidRasterPalette", 2, SQLITE_ANY, 0,
+ fnct_IsValidRasterPalette, 0, 0);
+ sqlite3_create_function (db, "IsValidRasterStatistics", 2, SQLITE_ANY, 0,
+ fnct_IsValidRasterStatistics, 0, 0);
+ sqlite3_create_function (db, "RL2_IsValidRasterStatistics", 2, SQLITE_ANY,
+ 0, fnct_IsValidRasterStatistics, 0, 0);
+ sqlite3_create_function (db, "IsValidRasterStatistics", 3, SQLITE_ANY, 0,
+ fnct_IsValidRasterStatistics, 0, 0);
+ sqlite3_create_function (db, "RL2_IsValidRasterStatistics", 3, SQLITE_ANY,
+ 0, fnct_IsValidRasterStatistics, 0, 0);
+ sqlite3_create_function (db, "IsValidRasterTile", 4, SQLITE_ANY, 0,
+ fnct_IsValidRasterTile, 0, 0);
+ sqlite3_create_function (db, "RL2_IsValidRasterTile", 4, SQLITE_ANY, 0,
+ fnct_IsValidRasterTile, 0, 0);
+ sqlite3_create_function (db, "CreateCoverage", 10, SQLITE_ANY, 0,
+ fnct_CreateCoverage, 0, 0);
+ sqlite3_create_function (db, "CreateCoverage", 11, SQLITE_ANY, 0,
+ fnct_CreateCoverage, 0, 0);
+ sqlite3_create_function (db, "CreateCoverage", 12, SQLITE_ANY, 0,
+ fnct_CreateCoverage, 0, 0);
+ sqlite3_create_function (db, "RL2_CreateCoverage", 10, SQLITE_ANY, 0,
+ fnct_CreateCoverage, 0, 0);
+ sqlite3_create_function (db, "RL2_CreateCoverage", 11, SQLITE_ANY, 0,
+ fnct_CreateCoverage, 0, 0);
+ sqlite3_create_function (db, "RL2_CreateCoverage", 12, SQLITE_ANY, 0,
+ fnct_CreateCoverage, 0, 0);
+ sqlite3_create_function (db, "DeleteSection", 2, SQLITE_ANY, 0,
+ fnct_DeleteSection, 0, 0);
+ sqlite3_create_function (db, "RL2_DeleteSection", 2, SQLITE_ANY, 0,
+ fnct_DeleteSection, 0, 0);
+ sqlite3_create_function (db, "DeleteSection", 3, SQLITE_ANY, 0,
+ fnct_DeleteSection, 0, 0);
+ sqlite3_create_function (db, "RL2_DeleteSection", 3, SQLITE_ANY, 0,
+ fnct_DeleteSection, 0, 0);
+ sqlite3_create_function (db, "DropCoverage", 1, SQLITE_ANY, 0,
+ fnct_DropCoverage, 0, 0);
+ sqlite3_create_function (db, "RL2_DropCoverage", 1, SQLITE_ANY, 0,
+ fnct_DropCoverage, 0, 0);
+ sqlite3_create_function (db, "DropCoverage", 2, SQLITE_ANY, 0,
+ fnct_DropCoverage, 0, 0);
+ sqlite3_create_function (db, "RL2_DropCoverage", 2, SQLITE_ANY, 0,
+ fnct_DropCoverage, 0, 0);
+ sqlite3_create_function (db, "SetCoverageInfos", 3, SQLITE_ANY, 0,
+ fnct_SetCoverageInfos, 0, 0);
+ sqlite3_create_function (db, "RL2_SetCoverageInfos", 3, SQLITE_ANY, 0,
+ fnct_SetCoverageInfos, 0, 0);
+ sqlite3_create_function (db, "GetPaletteNumEntries", 1, SQLITE_ANY, 0,
+ fnct_GetPaletteNumEntries, 0, 0);
+ sqlite3_create_function (db, "RL2_GetPaletteNumEntries", 1, SQLITE_ANY, 0,
+ fnct_GetPaletteNumEntries, 0, 0);
+ sqlite3_create_function (db, "GetPaletteColorEntry", 2, SQLITE_ANY, 0,
+ fnct_GetPaletteColorEntry, 0, 0);
+ sqlite3_create_function (db, "RL2_GetPaletteColorEntry", 2, SQLITE_ANY, 0,
+ fnct_GetPaletteColorEntry, 0, 0);
+ sqlite3_create_function (db, "SetPaletteColorEntry", 3, SQLITE_ANY, 0,
+ fnct_SetPaletteColorEntry, 0, 0);
+ sqlite3_create_function (db, "RL2_SetPaletteColorEntry", 3, SQLITE_ANY, 0,
+ fnct_SetPaletteColorEntry, 0, 0);
+ sqlite3_create_function (db, "PaletteEquals", 2, SQLITE_ANY, 0,
+ fnct_PaletteEquals, 0, 0);
+ sqlite3_create_function (db, "RL2_PaletteEquals", 2, SQLITE_ANY, 0,
+ fnct_PaletteEquals, 0, 0);
+ sqlite3_create_function (db, "CreatePixel", 3, SQLITE_ANY, 0,
+ fnct_CreatePixel, 0, 0);
+ sqlite3_create_function (db, "RL2_CreatePixel", 3, SQLITE_ANY, 0,
+ fnct_CreatePixel, 0, 0);
+ sqlite3_create_function (db, "GetPixelType", 1, SQLITE_ANY, 0,
+ fnct_GetPixelType, 0, 0);
+ sqlite3_create_function (db, "RL2_GetPixelType", 1, SQLITE_ANY, 0,
+ fnct_GetPixelType, 0, 0);
+ sqlite3_create_function (db, "GetPixelSampleType", 1, SQLITE_ANY, 0,
+ fnct_GetPixelSampleType, 0, 0);
+ sqlite3_create_function (db, "RL2_GetPixelSampleType", 1, SQLITE_ANY, 0,
+ fnct_GetPixelSampleType, 0, 0);
+ sqlite3_create_function (db, "GetPixelNumBands", 1, SQLITE_ANY, 0,
+ fnct_GetPixelNumBands, 0, 0);
+ sqlite3_create_function (db, "RL2_GetPixelNumBands", 1, SQLITE_ANY, 0,
+ fnct_GetPixelNumBands, 0, 0);
+ sqlite3_create_function (db, "GetPixelValue", 2, SQLITE_ANY, 0,
+ fnct_GetPixelValue, 0, 0);
+ sqlite3_create_function (db, "RL2_GetPixelValue", 2, SQLITE_ANY, 0,
+ fnct_GetPixelValue, 0, 0);
+ sqlite3_create_function (db, "SetPixelValue", 3, SQLITE_ANY, 0,
+ fnct_SetPixelValue, 0, 0);
+ sqlite3_create_function (db, "RL2_SetPixelValue", 3, SQLITE_ANY, 0,
+ fnct_SetPixelValue, 0, 0);
+ sqlite3_create_function (db, "IsTransparentPixel", 1, SQLITE_ANY, 0,
+ fnct_IsTransparentPixel, 0, 0);
+ sqlite3_create_function (db, "RL2_IsTransparentPixel", 1, SQLITE_ANY, 0,
+ fnct_IsTransparentPixel, 0, 0);
+ sqlite3_create_function (db, "IsOpaquePixel", 1, SQLITE_ANY, 0,
+ fnct_IsOpaquePixel, 0, 0);
+ sqlite3_create_function (db, "RL2_IsOpaquePixel", 1, SQLITE_ANY, 0,
+ fnct_IsOpaquePixel, 0, 0);
+ sqlite3_create_function (db, "SetTransparentPixel", 1, SQLITE_ANY, 0,
+ fnct_SetTransparentPixel, 0, 0);
+ sqlite3_create_function (db, "RL2_SetTransparentPixel", 1, SQLITE_ANY, 0,
+ fnct_SetTransparentPixel, 0, 0);
+ sqlite3_create_function (db, "SetOpaquePixel", 1, SQLITE_ANY, 0,
+ fnct_SetOpaquePixel, 0, 0);
+ sqlite3_create_function (db, "RL2_SetOpaquePixel", 1, SQLITE_ANY, 0,
+ fnct_SetOpaquePixel, 0, 0);
+ sqlite3_create_function (db, "PixelEquals", 2, SQLITE_ANY, 0,
+ fnct_PixelEquals, 0, 0);
+ sqlite3_create_function (db, "RL2_PixelEquals", 2, SQLITE_ANY, 0,
+ fnct_PixelEquals, 0, 0);
+ sqlite3_create_function (db, "GetRasterStatistics_NoDataPixelsCount", 1,
+ SQLITE_ANY, 0,
+ fnct_GetRasterStatistics_NoDataPixelsCount, 0, 0);
+ sqlite3_create_function (db, "RL2_GetRasterStatistics_NoDataPixelsCount", 1,
+ SQLITE_ANY, 0,
+ fnct_GetRasterStatistics_NoDataPixelsCount, 0, 0);
+ sqlite3_create_function (db, "GetRasterStatistics_ValidPixelsCount", 1,
+ SQLITE_ANY, 0,
+ fnct_GetRasterStatistics_ValidPixelsCount, 0, 0);
+ sqlite3_create_function (db, "RL2_GetRasterStatistics_ValidPixelsCount", 1,
+ SQLITE_ANY, 0,
+ fnct_GetRasterStatistics_ValidPixelsCount, 0, 0);
+ sqlite3_create_function (db, "GetRasterStatistics_SampleType", 1,
+ SQLITE_ANY, 0, fnct_GetRasterStatistics_SampleType,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_GetRasterStatistics_SampleType", 1,
+ SQLITE_ANY, 0, fnct_GetRasterStatistics_SampleType,
+ 0, 0);
+ sqlite3_create_function (db, "GetRasterStatistics_BandsCount", 1,
+ SQLITE_ANY, 0, fnct_GetRasterStatistics_BandsCount,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_GetRasterStatistics_BandsCount", 1,
+ SQLITE_ANY, 0, fnct_GetRasterStatistics_BandsCount,
+ 0, 0);
+ sqlite3_create_function (db, "GetBandStatistics_Min", 2, SQLITE_ANY, 0,
+ fnct_GetBandStatistics_Min, 0, 0);
+ sqlite3_create_function (db, "RL2_GetBandStatistics_Min", 2, SQLITE_ANY, 0,
+ fnct_GetBandStatistics_Min, 0, 0);
+ sqlite3_create_function (db, "GetBandStatistics_Max", 2, SQLITE_ANY, 0,
+ fnct_GetBandStatistics_Max, 0, 0);
+ sqlite3_create_function (db, "RL2_GetBandStatistics_Max", 2, SQLITE_ANY, 0,
+ fnct_GetBandStatistics_Max, 0, 0);
+ sqlite3_create_function (db, "GetBandStatistics_Avg", 2, SQLITE_ANY, 0,
+ fnct_GetBandStatistics_Avg, 0, 0);
+ sqlite3_create_function (db, "RL2_GetBandStatistics_Avg", 2, SQLITE_ANY, 0,
+ fnct_GetBandStatistics_Avg, 0, 0);
+ sqlite3_create_function (db, "GetBandStatistics_Var", 2, SQLITE_ANY, 0,
+ fnct_GetBandStatistics_Var, 0, 0);
+ sqlite3_create_function (db, "RL2_GetBandStatistics_Var", 2, SQLITE_ANY, 0,
+ fnct_GetBandStatistics_Var, 0, 0);
+ sqlite3_create_function (db, "GetBandStatistics_StdDev", 2, SQLITE_ANY, 0,
+ fnct_GetBandStatistics_StdDev, 0, 0);
+ sqlite3_create_function (db, "RL2_GetBandStatistics_StdDev", 2, SQLITE_ANY,
+ 0, fnct_GetBandStatistics_StdDev, 0, 0);
+ sqlite3_create_function (db, "GetBandStatistics_Histogram", 2, SQLITE_ANY,
+ 0, fnct_GetBandStatistics_Histogram, 0, 0);
+ sqlite3_create_function (db, "RL2_GetBandStatistics_Histogram", 2,
+ SQLITE_ANY, 0, fnct_GetBandStatistics_Histogram, 0,
+ 0);
+ sqlite3_create_function (db, "GetBandHistogramFromImage", 3, SQLITE_ANY,
+ 0, fnct_GetBandHistogramFromImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetBandHistogramFromImage", 3,
+ SQLITE_ANY, 0, fnct_GetBandHistogramFromImage, 0,
+ 0);
+ sqlite3_create_function (db, "Pyramidize", 1, SQLITE_ANY, 0,
+ fnct_Pyramidize, 0, 0);
+ sqlite3_create_function (db, "RL2_Pyramidize", 1, SQLITE_ANY, 0,
+ fnct_Pyramidize, 0, 0);
+ sqlite3_create_function (db, "Pyramidize", 2, SQLITE_ANY, 0,
+ fnct_Pyramidize, 0, 0);
+ sqlite3_create_function (db, "RL2_Pyramidize", 2, SQLITE_ANY, 0,
+ fnct_Pyramidize, 0, 0);
+ sqlite3_create_function (db, "Pyramidize", 3, SQLITE_ANY, 0,
+ fnct_Pyramidize, 0, 0);
+ sqlite3_create_function (db, "RL2_Pyramidize", 3, SQLITE_ANY, 0,
+ fnct_Pyramidize, 0, 0);
+ sqlite3_create_function (db, "Pyramidize", 4, SQLITE_ANY, 0,
+ fnct_Pyramidize, 0, 0);
+ sqlite3_create_function (db, "RL2_Pyramidize", 4, SQLITE_ANY, 0,
+ fnct_Pyramidize, 0, 0);
+ sqlite3_create_function (db, "PyramidizeMonolithic", 1, SQLITE_ANY, 0,
+ fnct_PyramidizeMonolithic, 0, 0);
+ sqlite3_create_function (db, "RL2_PyramidizeMonolithic", 1, SQLITE_ANY, 0,
+ fnct_PyramidizeMonolithic, 0, 0);
+ sqlite3_create_function (db, "PyramidizeMonolithic", 2, SQLITE_ANY, 0,
+ fnct_PyramidizeMonolithic, 0, 0);
+ sqlite3_create_function (db, "RL2_PyramidizeMonolithic", 2, SQLITE_ANY, 0,
+ fnct_PyramidizeMonolithic, 0, 0);
+ sqlite3_create_function (db, "PyramidizeMonolithic", 3, SQLITE_ANY, 0,
+ fnct_PyramidizeMonolithic, 0, 0);
+ sqlite3_create_function (db, "RL2_PyramidizeMonolithic", 3, SQLITE_ANY, 0,
+ fnct_PyramidizeMonolithic, 0, 0);
+ sqlite3_create_function (db, "DePyramidize", 1, SQLITE_ANY, 0,
+ fnct_DePyramidize, 0, 0);
+ sqlite3_create_function (db, "RL2_DePyramidize", 1, SQLITE_ANY, 0,
+ fnct_DePyramidize, 0, 0);
+ sqlite3_create_function (db, "DePyramidize", 2, SQLITE_ANY, 0,
+ fnct_DePyramidize, 0, 0);
+ sqlite3_create_function (db, "RL2_DePyramidize", 2, SQLITE_ANY, 0,
+ fnct_DePyramidize, 0, 0);
+ sqlite3_create_function (db, "DePyramidize", 3, SQLITE_ANY, 0,
+ fnct_DePyramidize, 0, 0);
+ sqlite3_create_function (db, "RL2_DePyramidize", 3, SQLITE_ANY, 0,
+ fnct_DePyramidize, 0, 0);
+ sqlite3_create_function (db, "GetMapImage", 4, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetMapImage", 4, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "GetMapImage", 5, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetMapImage", 5, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "GetMapImage", 6, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetMapImage", 6, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "GetMapImage", 7, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetMapImage", 7, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "GetMapImage", 8, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetMapImage", 8, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "GetMapImage", 9, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetMapImage", 9, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "GetMapImage", 10, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetMapImage", 10, SQLITE_ANY, 0,
+ fnct_GetMapImage, 0, 0);
+ sqlite3_create_function (db, "GetTileImage", 2, SQLITE_ANY, 0,
+ fnct_GetTileImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetTileImage", 2, SQLITE_ANY, 0,
+ fnct_GetTileImage, 0, 0);
+ sqlite3_create_function (db, "GetTileImage", 3, SQLITE_ANY, 0,
+ fnct_GetTileImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetTileImage", 3, SQLITE_ANY, 0,
+ fnct_GetTileImage, 0, 0);
+ sqlite3_create_function (db, "GetTileImage", 4, SQLITE_ANY, 0,
+ fnct_GetTileImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetTileImage", 4, SQLITE_ANY, 0,
+ fnct_GetTileImage, 0, 0);
+ sqlite3_create_function (db, "GetTripleBandTileImage", 5, SQLITE_ANY, 0,
+ fnct_GetTripleBandTileImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetTripleBandTileImage", 5, SQLITE_ANY, 0,
+ fnct_GetTripleBandTileImage, 0, 0);
+ sqlite3_create_function (db, "GetTripleBandTileImage", 6, SQLITE_ANY, 0,
+ fnct_GetTripleBandTileImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetTripleBandTileImage", 6, SQLITE_ANY, 0,
+ fnct_GetTripleBandTileImage, 0, 0);
+ sqlite3_create_function (db, "GetTripleBandTileImage", 7, SQLITE_ANY, 0,
+ fnct_GetTripleBandTileImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetTripleBandTileImage", 7, SQLITE_ANY, 0,
+ fnct_GetTripleBandTileImage, 0, 0);
+ sqlite3_create_function (db, "GetMonoBandTileImage", 3, SQLITE_ANY, 0,
+ fnct_GetMonoBandTileImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetMonoBandTileImage", 3, SQLITE_ANY, 0,
+ fnct_GetMonoBandTileImage, 0, 0);
+ sqlite3_create_function (db, "GetMonoBandTileImage", 4, SQLITE_ANY, 0,
+ fnct_GetMonoBandTileImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetMonoBandTileImage", 4, SQLITE_ANY, 0,
+ fnct_GetMonoBandTileImage, 0, 0);
+ sqlite3_create_function (db, "GetMonoBandTileImage", 5, SQLITE_ANY, 0,
+ fnct_GetMonoBandTileImage, 0, 0);
+ sqlite3_create_function (db, "RL2_GetMonoBandTileImage", 5, SQLITE_ANY, 0,
+ fnct_GetMonoBandTileImage, 0, 0);
+
+/*
+// enabling ImportRaster and ExportRaster
+//
+// these functions could potentially introduce serious security issues,
+// most notably when invoked from within some Trigger
+// - BlobToFile: some arbitrary code, possibly harmful (e.g. virus or
+// trojan) could be installed on the local file-system, the user being
+// completely unaware of this
+// - ImportRaster: some file could be maliciously "stolen" from the local
+// file system and then inserted into the DB
+// - ExportRaster could eventually install some malicious payload into the
+// local filesystem; or could potentially flood the local file-system by
+// outputting a huge size of data
+//
+// so by default such functions are disabled.
+// if for any good/legitimate reason the user really wants to enable them
+// the following environment variable has to be explicitly declared:
+//
+// SPATIALITE_SECURITY=relaxed
+//
+*/
+ security_level = getenv ("SPATIALITE_SECURITY");
+ if (security_level == NULL)
+ ;
+ else if (strcasecmp (security_level, "relaxed") == 0)
+ {
+ sqlite3_create_function (db, "LoadRaster", 2, SQLITE_ANY, 0,
+ fnct_LoadRaster, 0, 0);
+ sqlite3_create_function (db, "LoadRaster", 3, SQLITE_ANY, 0,
+ fnct_LoadRaster, 0, 0);
+ sqlite3_create_function (db, "LoadRaster", 4, SQLITE_ANY, 0,
+ fnct_LoadRaster, 0, 0);
+ sqlite3_create_function (db, "LoadRaster", 5, SQLITE_ANY, 0,
+ fnct_LoadRaster, 0, 0);
+ sqlite3_create_function (db, "LoadRaster", 6, SQLITE_ANY, 0,
+ fnct_LoadRaster, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRaster", 2, SQLITE_ANY, 0,
+ fnct_LoadRaster, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRaster", 3, SQLITE_ANY, 0,
+ fnct_LoadRaster, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRaster", 4, SQLITE_ANY, 0,
+ fnct_LoadRaster, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRaster", 5, SQLITE_ANY, 0,
+ fnct_LoadRaster, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRaster", 6, SQLITE_ANY, 0,
+ fnct_LoadRaster, 0, 0);
+ sqlite3_create_function (db, "LoadRastersFromDir", 2, SQLITE_ANY, 0,
+ fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "LoadRastersFromDir", 3, SQLITE_ANY, 0,
+ fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "LoadRastersFromDir", 4, SQLITE_ANY, 0,
+ fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "LoadRastersFromDir", 5, SQLITE_ANY, 0,
+ fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "LoadRastersFromDir", 6, SQLITE_ANY, 0,
+ fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "LoadRastersFromDir", 7, SQLITE_ANY, 0,
+ fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRastersFromDir", 2, SQLITE_ANY,
+ 0, fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRastersFromDir", 3, SQLITE_ANY,
+ 0, fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRastersFromDir", 4, SQLITE_ANY,
+ 0, fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRastersFromDir", 5, SQLITE_ANY,
+ 0, fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRastersFromDir", 6, SQLITE_ANY,
+ 0, fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRastersFromDir", 7, SQLITE_ANY,
+ 0, fnct_LoadRastersFromDir, 0, 0);
+ sqlite3_create_function (db, "LoadRasterFromWMS", 9, SQLITE_ANY, 0,
+ fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRasterFromWMS", 9, SQLITE_ANY,
+ 0, fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "LoadRasterFromWMS", 10, SQLITE_ANY, 0,
+ fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRasterFromWMS", 10, SQLITE_ANY,
+ 0, fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "LoadRasterFromWMS", 11, SQLITE_ANY, 0,
+ fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRasterFromWMS", 11, SQLITE_ANY,
+ 0, fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "LoadRasterFromWMS", 12, SQLITE_ANY, 0,
+ fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRasterFromWMS", 12, SQLITE_ANY,
+ 0, fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "LoadRasterFromWMS", 13, SQLITE_ANY, 0,
+ fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRasterFromWMS", 13, SQLITE_ANY,
+ 0, fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "LoadRasterFromWMS", 14, SQLITE_ANY, 0,
+ fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "RL2_LoadRasterFromWMS", 14, SQLITE_ANY,
+ 0, fnct_LoadRasterFromWMS, 0, 0);
+ sqlite3_create_function (db, "WriteGeoTiff", 6, SQLITE_ANY, 0,
+ fnct_WriteGeoTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteGeoTiff", 6, SQLITE_ANY, 0,
+ fnct_WriteGeoTiff, 0, 0);
+ sqlite3_create_function (db, "WriteGeoTiff", 7, SQLITE_ANY, 0,
+ fnct_WriteGeoTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteGeoTiff", 7, SQLITE_ANY, 0,
+ fnct_WriteGeoTiff, 0, 0);
+ sqlite3_create_function (db, "WriteGeoTiff", 8, SQLITE_ANY, 0,
+ fnct_WriteGeoTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteGeoTiff", 8, SQLITE_ANY, 0,
+ fnct_WriteGeoTiff, 0, 0);
+ sqlite3_create_function (db, "WriteGeoTiff", 9, SQLITE_ANY, 0,
+ fnct_WriteGeoTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteGeoTiff", 9, SQLITE_ANY, 0,
+ fnct_WriteGeoTiff, 0, 0);
+ sqlite3_create_function (db, "WriteGeoTiff", 10, SQLITE_ANY, 0,
+ fnct_WriteGeoTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteGeoTiff", 10, SQLITE_ANY, 0,
+ fnct_WriteGeoTiff, 0, 0);
+ sqlite3_create_function (db, "WriteTiffTfw", 6, SQLITE_ANY, 0,
+ fnct_WriteTiffTfw, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTiffTfw", 6, SQLITE_ANY, 0,
+ fnct_WriteTiffTfw, 0, 0);
+ sqlite3_create_function (db, "WriteTiffTfw", 7, SQLITE_ANY, 0,
+ fnct_WriteTiffTfw, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTiffTfw", 7, SQLITE_ANY, 0,
+ fnct_WriteTiffTfw, 0, 0);
+ sqlite3_create_function (db, "WriteTiffTfw", 8, SQLITE_ANY, 0,
+ fnct_WriteTiffTfw, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTiffTfw", 8, SQLITE_ANY, 0,
+ fnct_WriteTiffTfw, 0, 0);
+ sqlite3_create_function (db, "WriteTiffTfw", 9, SQLITE_ANY, 0,
+ fnct_WriteTiffTfw, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTiffTfw", 9, SQLITE_ANY, 0,
+ fnct_WriteTiffTfw, 0, 0);
+ sqlite3_create_function (db, "WriteTiff", 6, SQLITE_ANY, 0,
+ fnct_WriteTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTiff", 6, SQLITE_ANY, 0,
+ fnct_WriteTiff, 0, 0);
+ sqlite3_create_function (db, "WriteTiff", 7, SQLITE_ANY, 0,
+ fnct_WriteTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTiff", 7, SQLITE_ANY, 0,
+ fnct_WriteTiff, 0, 0);
+ sqlite3_create_function (db, "WriteTiff", 8, SQLITE_ANY, 0,
+ fnct_WriteTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTiff", 8, SQLITE_ANY, 0,
+ fnct_WriteTiff, 0, 0);
+ sqlite3_create_function (db, "WriteTiff", 9, SQLITE_ANY, 0,
+ fnct_WriteTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTiff", 9, SQLITE_ANY, 0,
+ fnct_WriteTiff, 0, 0);
+ sqlite3_create_function (db, "WriteJpegJgw", 6, SQLITE_ANY, 0,
+ fnct_WriteJpegJgw, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteJpegJgw", 6, SQLITE_ANY, 0,
+ fnct_WriteJpegJgw, 0, 0);
+ sqlite3_create_function (db, "WriteJpegJgw", 7, SQLITE_ANY, 0,
+ fnct_WriteJpegJgw, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteJpegJgw", 7, SQLITE_ANY, 0,
+ fnct_WriteJpegJgw, 0, 0);
+ sqlite3_create_function (db, "WriteJpegJgw", 8, SQLITE_ANY, 0,
+ fnct_WriteJpegJgw, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteJpegJgw", 8, SQLITE_ANY, 0,
+ fnct_WriteJpegJgw, 0, 0);
+ sqlite3_create_function (db, "WriteJpeg", 6, SQLITE_ANY, 0,
+ fnct_WriteJpeg, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteJpeg", 6, SQLITE_ANY, 0,
+ fnct_WriteJpeg, 0, 0);
+ sqlite3_create_function (db, "WriteJpeg", 7, SQLITE_ANY, 0,
+ fnct_WriteJpeg, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteJpeg", 7, SQLITE_ANY, 0,
+ fnct_WriteJpeg, 0, 0);
+ sqlite3_create_function (db, "WriteJpeg", 8, SQLITE_ANY, 0,
+ fnct_WriteJpeg, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteJpeg", 8, SQLITE_ANY, 0,
+ fnct_WriteJpeg, 0, 0);
+ sqlite3_create_function (db, "WriteTripleBandGeoTiff", 9,
+ SQLITE_ANY, 0, fnct_WriteTripleBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandGeoTiff", 9,
+ SQLITE_ANY, 0, fnct_WriteTripleBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "WriteTripleBandGeoTiff", 10,
+ SQLITE_ANY, 0, fnct_WriteTripleBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandGeoTiff", 10,
+ SQLITE_ANY, 0, fnct_WriteTripleBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "WriteTripleBandGeoTiff", 11,
+ SQLITE_ANY, 0, fnct_WriteTripleBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandGeoTiff", 11,
+ SQLITE_ANY, 0, fnct_WriteTripleBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "WriteTripleBandGeoTiff", 12,
+ SQLITE_ANY, 0, fnct_WriteTripleBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandGeoTiff", 12,
+ SQLITE_ANY, 0, fnct_WriteTripleBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "WriteTripleBandGeoTiff", 13,
+ SQLITE_ANY, 0, fnct_WriteTripleBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandGeoTiff", 13,
+ SQLITE_ANY, 0, fnct_WriteTripleBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandGeoTiff", 7,
+ SQLITE_ANY, 0, fnct_WriteMonoBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandGeoTiff", 7,
+ SQLITE_ANY, 0, fnct_WriteMonoBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandGeoTiff", 8,
+ SQLITE_ANY, 0, fnct_WriteMonoBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandGeoTiff", 8,
+ SQLITE_ANY, 0, fnct_WriteMonoBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandGeoTiff", 9,
+ SQLITE_ANY, 0, fnct_WriteMonoBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandGeoTiff", 9,
+ SQLITE_ANY, 0, fnct_WriteMonoBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandGeoTiff", 10,
+ SQLITE_ANY, 0, fnct_WriteMonoBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandGeoTiff", 10,
+ SQLITE_ANY, 0, fnct_WriteMonoBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandGeoTiff", 11,
+ SQLITE_ANY, 0, fnct_WriteMonoBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandGeoTiff", 11,
+ SQLITE_ANY, 0, fnct_WriteMonoBandGeoTiff,
+ 0, 0);
+ sqlite3_create_function (db, "WriteTripleBandTiffTfw", 9,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandTiffTfw", 9,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "WriteTripleBandTiffTfw", 10,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandTiffTfw", 10,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "WriteTripleBandTiffTfw", 11,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandTiffTfw", 11,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "WriteTripleBandTiffTfw", 12,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandTiffTfw", 12,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandTiffTfw", 7,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandTiffTfw", 7,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandTiffTfw", 8,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandTiffTfw", 8,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandTiffTfw", 9,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandTiffTfw", 9,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandTiffTfw", 10,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandTiffTfw", 10,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiffTfw,
+ 0, 0);
+ sqlite3_create_function (db, "WriteTripleBandTiff", 9, SQLITE_ANY,
+ 0, fnct_WriteTripleBandTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandTiff", 9,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiff, 0,
+ 0);
+ sqlite3_create_function (db, "WriteTripleBandTiff", 10, SQLITE_ANY,
+ 0, fnct_WriteTripleBandTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandTiff", 10,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiff, 0,
+ 0);
+ sqlite3_create_function (db, "WriteTripleBandTiff", 11, SQLITE_ANY,
+ 0, fnct_WriteTripleBandTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandTiff", 11,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiff, 0,
+ 0);
+ sqlite3_create_function (db, "WriteTripleBandTiff", 12, SQLITE_ANY,
+ 0, fnct_WriteTripleBandTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteTripleBandTiff", 12,
+ SQLITE_ANY, 0, fnct_WriteTripleBandTiff, 0,
+ 0);
+ sqlite3_create_function (db, "WriteMonoBandTiff", 7, SQLITE_ANY,
+ 0, fnct_WriteMonoBandTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandTiff", 7,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiff, 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandTiff", 8, SQLITE_ANY,
+ 0, fnct_WriteMonoBandTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandTiff", 8,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiff, 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandTiff", 9, SQLITE_ANY,
+ 0, fnct_WriteMonoBandTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandTiff", 9,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiff, 0, 0);
+ sqlite3_create_function (db, "WriteMonoBandTiff", 10, SQLITE_ANY,
+ 0, fnct_WriteMonoBandTiff, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteMonoBandTiff", 10,
+ SQLITE_ANY, 0, fnct_WriteMonoBandTiff, 0, 0);
+ sqlite3_create_function (db, "WriteAsciiGrid", 6, SQLITE_ANY, 0,
+ fnct_WriteAsciiGrid, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteAsciiGrid", 6, SQLITE_ANY, 0,
+ fnct_WriteAsciiGrid, 0, 0);
+ sqlite3_create_function (db, "WriteAsciiGrid", 7, SQLITE_ANY, 0,
+ fnct_WriteAsciiGrid, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteAsciiGrid", 7, SQLITE_ANY, 0,
+ fnct_WriteAsciiGrid, 0, 0);
+ sqlite3_create_function (db, "WriteAsciiGrid", 8, SQLITE_ANY, 0,
+ fnct_WriteAsciiGrid, 0, 0);
+ sqlite3_create_function (db, "RL2_WriteAsciiGrid", 8, SQLITE_ANY, 0,
+ fnct_WriteAsciiGrid, 0, 0);
+ }
+}
+
+static void
+rl2_splash_screen (int verbose)
+{
+ if (isatty (1))
+ {
+ /* printing "hello" message only when stdout is on console */
+ if (verbose)
+ {
+ printf ("RasterLite-2 version : %s\n", rl2_version ());
+ printf ("TARGET CPU ..........: %s\n", rl2_target_cpu ());
+ }
+ }
+}
+
+#ifndef LOADABLE_EXTENSION
+
+RL2_DECLARE void
+rl2_init (sqlite3 * handle, int verbose)
+{
+/* used when SQLite initializes as an ordinary lib */
+ register_rl2_sql_functions (handle);
+ rl2_splash_screen (verbose);
+}
+
+#else /* built as LOADABLE EXTENSION only */
+
+SQLITE_EXTENSION_INIT1 static int
+init_rl2_extension (sqlite3 * db, char **pzErrMsg,
+ const sqlite3_api_routines * pApi)
+{
+ SQLITE_EXTENSION_INIT2 (pApi);
+
+ register_rl2_sql_functions (db);
+ return 0;
+}
+
+#if !(defined _WIN32) || defined(__MINGW32__)
+/* MSVC is unable to understand this declaration */
+__attribute__ ((visibility ("default")))
+#endif
+ RL2_DECLARE int
+ sqlite3_modrasterlite_init (sqlite3 * db, char **pzErrMsg,
+ const sqlite3_api_routines * pApi)
+{
+/* SQLite invokes this routine once when it dynamically loads the extension. */
+ return init_rl2_extension (db, pzErrMsg, pApi);
+}
+
+#endif
diff --git a/src/rl2sqlaux.c b/src/rl2sqlaux.c
new file mode 100644
index 0000000..4f862a5
--- /dev/null
+++ b/src/rl2sqlaux.c
@@ -0,0 +1,4410 @@
+/*
+
+ rl2sqlaux -- private SQL helper methods
+
+ version 0.1, 2014 February 28
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+#include <limits.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+#ifdef _WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2wms.h"
+#include "rasterlite2/rl2graphics.h"
+#include "rasterlite2_private.h"
+
+#include <spatialite/gaiaaux.h>
+
+#define RL2_UNUSED() if (argc || argv) argc = argc;
+
+RL2_PRIVATE int
+get_coverage_sample_bands (sqlite3 * sqlite, const char *coverage,
+ unsigned char *sample_type, unsigned char *num_bands)
+{
+/* attempting to retrieve the SampleType and NumBands from a Coverage */
+ int i;
+ char **results;
+ int rows;
+ int columns;
+ char *sql;
+ int ret;
+ const char *sample;
+ int bands;
+ unsigned char xsample_type = RL2_SAMPLE_UNKNOWN;
+ unsigned char xnum_bands = RL2_BANDS_UNKNOWN;
+
+ sql =
+ sqlite3_mprintf ("SELECT sample_type, num_bands FROM raster_coverages "
+ "WHERE Lower(coverage_name) = Lower(%Q)", coverage);
+ ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ if (rows < 1)
+ ;
+ else
+ {
+ for (i = 1; i <= rows; i++)
+ {
+ sample = results[(i * columns) + 0];
+ if (strcmp (sample, "1-BIT") == 0)
+ xsample_type = RL2_SAMPLE_1_BIT;
+ if (strcmp (sample, "2-BIT") == 0)
+ xsample_type = RL2_SAMPLE_2_BIT;
+ if (strcmp (sample, "4-BIT") == 0)
+ xsample_type = RL2_SAMPLE_4_BIT;
+ if (strcmp (sample, "INT8") == 0)
+ xsample_type = RL2_SAMPLE_INT8;
+ if (strcmp (sample, "UINT8") == 0)
+ xsample_type = RL2_SAMPLE_UINT8;
+ if (strcmp (sample, "INT16") == 0)
+ xsample_type = RL2_SAMPLE_INT16;
+ if (strcmp (sample, "UINT16") == 0)
+ xsample_type = RL2_SAMPLE_UINT16;
+ if (strcmp (sample, "INT32") == 0)
+ xsample_type = RL2_SAMPLE_INT32;
+ if (strcmp (sample, "UINT32") == 0)
+ xsample_type = RL2_SAMPLE_UINT32;
+ if (strcmp (sample, "FLOAT") == 0)
+ xsample_type = RL2_SAMPLE_FLOAT;
+ if (strcmp (sample, "DOUBLE") == 0)
+ xsample_type = RL2_SAMPLE_DOUBLE;
+ bands = atoi (results[(i * columns) + 1]);
+ if (bands > 0 && bands < 256)
+ xnum_bands = bands;
+ }
+ }
+ sqlite3_free_table (results);
+ if (xsample_type == RL2_SAMPLE_UNKNOWN || xnum_bands == RL2_BANDS_UNKNOWN)
+ return 0;
+ *sample_type = xsample_type;
+ *num_bands = xnum_bands;
+ return 1;
+}
+
+RL2_PRIVATE int
+get_coverage_defs (sqlite3 * sqlite, const char *coverage,
+ unsigned int *tile_width, unsigned int *tile_height,
+ unsigned char *sample_type, unsigned char *pixel_type,
+ unsigned char *num_bands, unsigned char *compression)
+{
+/* attempting to retrieve the main definitions from a Coverage */
+ int i;
+ char **results;
+ int rows;
+ int columns;
+ char *sql;
+ int ret;
+ const char *sample;
+ const char *pixel;
+ const char *compr;
+ int bands;
+ unsigned char xsample_type = RL2_SAMPLE_UNKNOWN;
+ unsigned char xpixel_type = RL2_PIXEL_UNKNOWN;
+ unsigned char xnum_bands = RL2_BANDS_UNKNOWN;
+ unsigned char xcompression = RL2_COMPRESSION_UNKNOWN;
+ unsigned short xtile_width = RL2_TILESIZE_UNDEFINED;
+ unsigned short xtile_height = RL2_TILESIZE_UNDEFINED;
+
+ sql = sqlite3_mprintf ("SELECT sample_type, pixel_type, num_bands, "
+ "compression, tile_width, tile_height FROM raster_coverages "
+ "WHERE Lower(coverage_name) = Lower(%Q)", coverage);
+ ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ if (rows < 1)
+ ;
+ else
+ {
+ for (i = 1; i <= rows; i++)
+ {
+ sample = results[(i * columns) + 0];
+ if (strcmp (sample, "1-BIT") == 0)
+ xsample_type = RL2_SAMPLE_1_BIT;
+ if (strcmp (sample, "2-BIT") == 0)
+ xsample_type = RL2_SAMPLE_2_BIT;
+ if (strcmp (sample, "4-BIT") == 0)
+ xsample_type = RL2_SAMPLE_4_BIT;
+ if (strcmp (sample, "INT8") == 0)
+ xsample_type = RL2_SAMPLE_INT8;
+ if (strcmp (sample, "UINT8") == 0)
+ xsample_type = RL2_SAMPLE_UINT8;
+ if (strcmp (sample, "INT16") == 0)
+ xsample_type = RL2_SAMPLE_INT16;
+ if (strcmp (sample, "UINT16") == 0)
+ xsample_type = RL2_SAMPLE_UINT16;
+ if (strcmp (sample, "INT32") == 0)
+ xsample_type = RL2_SAMPLE_INT32;
+ if (strcmp (sample, "UINT32") == 0)
+ xsample_type = RL2_SAMPLE_UINT32;
+ if (strcmp (sample, "FLOAT") == 0)
+ xsample_type = RL2_SAMPLE_FLOAT;
+ if (strcmp (sample, "DOUBLE") == 0)
+ xsample_type = RL2_SAMPLE_DOUBLE;
+ pixel = results[(i * columns) + 1];
+ if (strcmp (pixel, "MONOCHROME") == 0)
+ xpixel_type = RL2_PIXEL_MONOCHROME;
+ if (strcmp (pixel, "PALETTE") == 0)
+ xpixel_type = RL2_PIXEL_PALETTE;
+ if (strcmp (pixel, "GRAYSCALE") == 0)
+ xpixel_type = RL2_PIXEL_GRAYSCALE;
+ if (strcmp (pixel, "RGB") == 0)
+ xpixel_type = RL2_PIXEL_RGB;
+ if (strcmp (pixel, "MULTIBAND") == 0)
+ xpixel_type = RL2_PIXEL_MULTIBAND;
+ if (strcmp (pixel, "DATAGRID") == 0)
+ xpixel_type = RL2_PIXEL_DATAGRID;
+ bands = atoi (results[(i * columns) + 2]);
+ if (bands > 0 && bands < 256)
+ xnum_bands = bands;
+ compr = results[(i * columns) + 3];
+ if (strcmp (compr, "NONE") == 0)
+ xcompression = RL2_COMPRESSION_NONE;
+ if (strcmp (compr, "DEFLATE") == 0)
+ xcompression = RL2_COMPRESSION_DEFLATE;
+ if (strcmp (compr, "LZMA") == 0)
+ xcompression = RL2_COMPRESSION_LZMA;
+ if (strcmp (compr, "GIF") == 0)
+ xcompression = RL2_COMPRESSION_GIF;
+ if (strcmp (compr, "PNG") == 0)
+ xcompression = RL2_COMPRESSION_PNG;
+ if (strcmp (compr, "JPEG") == 0)
+ xcompression = RL2_COMPRESSION_JPEG;
+ if (strcmp (compr, "LOSSY_WEBP") == 0)
+ xcompression = RL2_COMPRESSION_LOSSY_WEBP;
+ if (strcmp (compr, "LOSSLESS_WEBP") == 0)
+ xcompression = RL2_COMPRESSION_LOSSLESS_WEBP;
+ if (strcmp (compr, "CCITTFAX4") == 0)
+ xcompression = RL2_COMPRESSION_CCITTFAX4;
+ xtile_width = atoi (results[(i * columns) + 4]);
+ xtile_height = atoi (results[(i * columns) + 5]);
+ }
+ }
+ sqlite3_free_table (results);
+ if (xsample_type == RL2_SAMPLE_UNKNOWN || xpixel_type == RL2_PIXEL_UNKNOWN
+ || xnum_bands == RL2_BANDS_UNKNOWN
+ || xcompression == RL2_COMPRESSION_UNKNOWN
+ || xtile_width == RL2_TILESIZE_UNDEFINED
+ || xtile_height == RL2_TILESIZE_UNDEFINED)
+ return 0;
+ *sample_type = xsample_type;
+ *pixel_type = xpixel_type;
+ *num_bands = xnum_bands;
+ *compression = xcompression;
+ *tile_width = xtile_width;
+ *tile_height = xtile_height;
+ return 1;
+}
+
+RL2_PRIVATE rl2PixelPtr
+default_nodata (unsigned char sample, unsigned char pixel,
+ unsigned char num_bands)
+{
+/* creating a default NO-DATA value */
+ int nb;
+ rl2PixelPtr pxl = rl2_create_pixel (sample, pixel, num_bands);
+ if (pxl == NULL)
+ return NULL;
+ switch (pixel)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ rl2_set_pixel_sample_1bit (pxl, 0);
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (sample)
+ {
+ case RL2_SAMPLE_1_BIT:
+ rl2_set_pixel_sample_1bit (pxl, 0);
+ break;
+ case RL2_SAMPLE_2_BIT:
+ rl2_set_pixel_sample_2bit (pxl, 0);
+ break;
+ case RL2_SAMPLE_4_BIT:
+ rl2_set_pixel_sample_4bit (pxl, 0);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_set_pixel_sample_uint8 (pxl, 0, 0);
+ break;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (sample)
+ {
+ case RL2_SAMPLE_1_BIT:
+ rl2_set_pixel_sample_1bit (pxl, 1);
+ break;
+ case RL2_SAMPLE_2_BIT:
+ rl2_set_pixel_sample_2bit (pxl, 3);
+ break;
+ case RL2_SAMPLE_4_BIT:
+ rl2_set_pixel_sample_4bit (pxl, 15);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_set_pixel_sample_uint8 (pxl, 0, 255);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rl2_set_pixel_sample_uint16 (pxl, 0, 0);
+ break;
+ };
+ break;
+ case RL2_PIXEL_RGB:
+ switch (sample)
+ {
+ case RL2_SAMPLE_UINT8:
+ rl2_set_pixel_sample_uint8 (pxl, 0, 255);
+ rl2_set_pixel_sample_uint8 (pxl, 1, 255);
+ rl2_set_pixel_sample_uint8 (pxl, 2, 255);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rl2_set_pixel_sample_uint16 (pxl, 0, 0);
+ rl2_set_pixel_sample_uint16 (pxl, 1, 0);
+ rl2_set_pixel_sample_uint16 (pxl, 2, 0);
+ break;
+ };
+ break;
+ case RL2_PIXEL_DATAGRID:
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ rl2_set_pixel_sample_int8 (pxl, 0);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_set_pixel_sample_uint8 (pxl, 0, 0);
+ break;
+ case RL2_SAMPLE_INT16:
+ rl2_set_pixel_sample_int16 (pxl, 0);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rl2_set_pixel_sample_uint16 (pxl, 0, 0);
+ break;
+ case RL2_SAMPLE_INT32:
+ rl2_set_pixel_sample_int32 (pxl, 0);
+ break;
+ case RL2_SAMPLE_UINT32:
+ rl2_set_pixel_sample_uint32 (pxl, 0);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ rl2_set_pixel_sample_float (pxl, 0.0);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ rl2_set_pixel_sample_double (pxl, 0.0);
+ break;
+ };
+ break;
+ case RL2_PIXEL_MULTIBAND:
+ switch (sample)
+ {
+ case RL2_SAMPLE_UINT8:
+ for (nb = 0; nb < num_bands; nb++)
+ rl2_set_pixel_sample_uint8 (pxl, nb, 255);
+ break;
+ case RL2_SAMPLE_UINT16:
+ for (nb = 0; nb < num_bands; nb++)
+ rl2_set_pixel_sample_uint16 (pxl, nb, 0);
+ break;
+ };
+ break;
+ };
+ return pxl;
+}
+
+RL2_PRIVATE WmsRetryListPtr
+alloc_retry_list ()
+{
+/* initializing an empty WMS retry-list */
+ WmsRetryListPtr lst = malloc (sizeof (WmsRetryList));
+ lst->first = NULL;
+ lst->last = NULL;
+ return lst;
+}
+
+RL2_PRIVATE void
+free_retry_list (WmsRetryListPtr lst)
+{
+/* memory cleanup - destroying a list of WMS retry requests */
+ WmsRetryItemPtr p;
+ WmsRetryItemPtr pn;
+ if (lst == NULL)
+ return;
+ p = lst->first;
+ while (p != NULL)
+ {
+ pn = p->next;
+ free (p);
+ p = pn;
+ }
+ free (lst);
+}
+
+RL2_PRIVATE void
+add_retry (WmsRetryListPtr lst, double minx, double miny, double maxx,
+ double maxy)
+{
+/* inserting a WMS retry request into the list */
+ WmsRetryItemPtr p;
+ if (lst == NULL)
+ return;
+ p = malloc (sizeof (WmsRetryItem));
+ p->done = 0;
+ p->count = 0;
+ p->minx = minx;
+ p->miny = miny;
+ p->maxx = maxx;
+ p->maxy = maxy;
+ p->next = NULL;
+ if (lst->first == NULL)
+ lst->first = p;
+ if (lst->last != NULL)
+ lst->last->next = p;
+ lst->last = p;
+}
+
+RL2_PRIVATE gaiaGeomCollPtr
+build_extent (int srid, double minx, double miny, double maxx, double maxy)
+{
+/* building an MBR (Envelope) */
+ gaiaPolygonPtr pg;
+ gaiaRingPtr rng;
+ gaiaGeomCollPtr geom = gaiaAllocGeomColl ();
+ geom->Srid = srid;
+ pg = gaiaAddPolygonToGeomColl (geom, 5, 0);
+ rng = pg->Exterior;
+ gaiaSetPoint (rng->Coords, 0, minx, miny);
+ gaiaSetPoint (rng->Coords, 1, maxx, miny);
+ gaiaSetPoint (rng->Coords, 2, maxx, maxy);
+ gaiaSetPoint (rng->Coords, 3, minx, maxy);
+ gaiaSetPoint (rng->Coords, 4, minx, miny);
+ return geom;
+}
+
+RL2_PRIVATE int
+do_insert_wms_tile (sqlite3 * handle, unsigned char *blob_odd, int blob_odd_sz,
+ unsigned char *blob_even, int blob_even_sz,
+ sqlite3_int64 section_id, int srid, double res_x,
+ double res_y, unsigned int tile_w, unsigned int tile_h,
+ double miny, double maxx, double tile_minx,
+ double tile_miny, double tile_maxx, double tile_maxy,
+ rl2PalettePtr aux_palette, rl2PixelPtr no_data,
+ sqlite3_stmt * stmt_tils, sqlite3_stmt * stmt_data,
+ rl2RasterStatisticsPtr section_stats)
+{
+/* INSERTing the tile */
+ int ret;
+ sqlite3_int64 tile_id;
+ unsigned char *blob;
+ int blob_size;
+ gaiaGeomCollPtr geom;
+ rl2RasterStatisticsPtr stats = NULL;
+
+ stats = rl2_get_raster_statistics
+ (blob_odd, blob_odd_sz, blob_even, blob_even_sz, aux_palette, no_data);
+ if (stats == NULL)
+ goto error;
+ rl2_aggregate_raster_statistics (stats, section_stats);
+ sqlite3_reset (stmt_tils);
+ sqlite3_clear_bindings (stmt_tils);
+ sqlite3_bind_int64 (stmt_tils, 1, section_id);
+ tile_maxx = tile_minx + ((double) tile_w * res_x);
+ if (tile_maxx > maxx)
+ tile_maxx = maxx;
+ tile_miny = tile_maxy - ((double) tile_h * res_y);
+ if (tile_miny < miny)
+ tile_miny = miny;
+ geom = build_extent (srid, tile_minx, tile_miny, tile_maxx, tile_maxy);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ gaiaFreeGeomColl (geom);
+ sqlite3_bind_blob (stmt_tils, 2, blob, blob_size, free);
+ ret = sqlite3_step (stmt_tils);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "INSERT INTO tiles; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ tile_id = sqlite3_last_insert_rowid (handle);
+ /* INSERTing tile data */
+ sqlite3_reset (stmt_data);
+ sqlite3_clear_bindings (stmt_data);
+ sqlite3_bind_int64 (stmt_data, 1, tile_id);
+ sqlite3_bind_blob (stmt_data, 2, blob_odd, blob_odd_sz, free);
+ if (blob_even == NULL)
+ sqlite3_bind_null (stmt_data, 3);
+ else
+ sqlite3_bind_blob (stmt_data, 3, blob_even, blob_even_sz, free);
+ ret = sqlite3_step (stmt_data);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "INSERT INTO tile_data; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ rl2_destroy_raster_statistics (stats);
+ return 1;
+ error:
+ if (stats != NULL)
+ rl2_destroy_raster_statistics (stats);
+ return 0;
+}
+
+RL2_PRIVATE int
+do_insert_levels (sqlite3 * handle, double base_res_x, double base_res_y,
+ double factor, unsigned char sample_type,
+ sqlite3_stmt * stmt_levl)
+{
+/* INSERTing the base-levels */
+ int ret;
+ double res_x = base_res_x * factor;
+ double res_y = base_res_y * factor;
+ sqlite3_reset (stmt_levl);
+ sqlite3_clear_bindings (stmt_levl);
+ sqlite3_bind_double (stmt_levl, 1, res_x);
+ sqlite3_bind_double (stmt_levl, 2, res_y);
+ if (sample_type == RL2_SAMPLE_1_BIT || sample_type == RL2_SAMPLE_2_BIT
+ || sample_type == RL2_SAMPLE_4_BIT)
+ {
+ sqlite3_bind_null (stmt_levl, 3);
+ sqlite3_bind_null (stmt_levl, 4);
+ sqlite3_bind_null (stmt_levl, 5);
+ sqlite3_bind_null (stmt_levl, 6);
+ sqlite3_bind_null (stmt_levl, 7);
+ sqlite3_bind_null (stmt_levl, 8);
+ }
+ else
+ {
+ sqlite3_bind_double (stmt_levl, 3, res_x * 2.0);
+ sqlite3_bind_double (stmt_levl, 4, res_y * 2.0);
+ sqlite3_bind_double (stmt_levl, 5, res_x * 4.0);
+ sqlite3_bind_double (stmt_levl, 6, res_y * 4.0);
+ sqlite3_bind_double (stmt_levl, 7, res_x * 8.0);
+ sqlite3_bind_double (stmt_levl, 8, res_y * 8.0);
+ }
+ ret = sqlite3_step (stmt_levl);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "INSERT INTO levels; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ return 1;
+ error:
+ return 0;
+}
+
+RL2_PRIVATE int
+do_insert_stats (sqlite3 * handle, rl2RasterStatisticsPtr section_stats,
+ sqlite3_int64 section_id, sqlite3_stmt * stmt_upd_sect)
+{
+/* updating the Section's Statistics */
+ unsigned char *blob_stats;
+ int blob_stats_sz;
+ int ret;
+
+ sqlite3_reset (stmt_upd_sect);
+ sqlite3_clear_bindings (stmt_upd_sect);
+ rl2_serialize_dbms_raster_statistics (section_stats, &blob_stats,
+ &blob_stats_sz);
+ sqlite3_bind_blob (stmt_upd_sect, 1, blob_stats, blob_stats_sz, free);
+ sqlite3_bind_int64 (stmt_upd_sect, 2, section_id);
+ ret = sqlite3_step (stmt_upd_sect);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "UPDATE sections; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ return 1;
+ error:
+ return 0;
+}
+
+RL2_PRIVATE char *
+get_section_name (const char *src_path)
+{
+/* attempting to extract the section name from source path */
+ int pos1 = 0;
+ int pos2 = 0;
+ int xpos2;
+ int len;
+ char *name;
+ const char *p;
+ if (src_path == NULL)
+ return NULL;
+ pos2 = strlen (src_path) - 1;
+ xpos2 = pos2;
+ pos1 = 0;
+ p = src_path + pos2;
+ while (p >= src_path)
+ {
+ if (*p == '.' && pos2 == xpos2)
+ pos2 = (p - 1) - src_path;
+ if (*p == '/')
+ {
+ pos1 = (p + 1) - src_path;
+ break;
+ }
+ p--;
+ }
+ len = pos2 - pos1 + 1;
+ name = malloc (len + 1);
+ memset (name, '\0', len + 1);
+ memcpy (name, src_path + pos1, len);
+ return name;
+}
+
+RL2_PRIVATE int
+do_insert_section (sqlite3 * handle, const char *src_path,
+ const char *section, int srid, unsigned int width,
+ unsigned int height, double minx, double miny,
+ double maxx, double maxy, sqlite3_stmt * stmt_sect,
+ sqlite3_int64 * id)
+{
+/* INSERTing the section */
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+ gaiaGeomCollPtr geom;
+ sqlite3_int64 section_id;
+
+ sqlite3_reset (stmt_sect);
+ sqlite3_clear_bindings (stmt_sect);
+ if (section != NULL)
+ sqlite3_bind_text (stmt_sect, 1, section, strlen (section),
+ SQLITE_STATIC);
+ else
+ {
+ char *sect_name = get_section_name (src_path);
+ if (sect_name != NULL)
+ sqlite3_bind_text (stmt_sect, 1, sect_name, strlen (sect_name),
+ free);
+ }
+ sqlite3_bind_text (stmt_sect, 2, src_path, strlen (src_path),
+ SQLITE_STATIC);
+ sqlite3_bind_int (stmt_sect, 3, width);
+ sqlite3_bind_int (stmt_sect, 4, height);
+ geom = build_extent (srid, minx, miny, maxx, maxy);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ gaiaFreeGeomColl (geom);
+ sqlite3_bind_blob (stmt_sect, 5, blob, blob_size, free);
+ ret = sqlite3_step (stmt_sect);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ section_id = sqlite3_last_insert_rowid (handle);
+ else
+ {
+ fprintf (stderr,
+ "INSERT INTO sections; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ *id = section_id;
+ return 1;
+ error:
+ return 0;
+}
+
+RL2_PRIVATE rl2RasterPtr
+build_wms_tile (rl2CoveragePtr coverage, const unsigned char *rgba_tile)
+{
+/* building a raster starting from an RGBA buffer */
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) coverage;
+ rl2RasterPtr raster = NULL;
+ rl2PalettePtr palette = NULL;
+ unsigned char *pixels = NULL;
+ int pixels_sz = 0;
+ unsigned char *mask = NULL;
+ int mask_size = 0;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ int requires_mask = 0;
+ unsigned int x;
+ unsigned int y;
+
+ if (coverage == NULL || rgba_tile == NULL)
+ return NULL;
+
+ /* supporting only RGB, GRAYSCALE or MONOCHROME coverages */
+ if (cvg->pixelType == RL2_PIXEL_RGB && cvg->nBands == 3)
+ pixels_sz = cvg->tileWidth * cvg->tileHeight * 3;
+ if (cvg->pixelType == RL2_PIXEL_GRAYSCALE && cvg->nBands == 1)
+ pixels_sz = cvg->tileWidth * cvg->tileHeight;
+ if (cvg->pixelType == RL2_PIXEL_MONOCHROME && cvg->nBands == 1)
+ pixels_sz = cvg->tileWidth * cvg->tileHeight;
+ if (pixels_sz <= 0)
+ return NULL;
+ mask_size = cvg->tileWidth * cvg->tileHeight;
+
+ /* allocating the raster and mask buffers */
+ pixels = malloc (pixels_sz);
+ if (pixels == NULL)
+ return NULL;
+ mask = malloc (mask_size);
+ if (mask == NULL)
+ {
+ free (pixels);
+ return NULL;
+ }
+
+ p_msk = mask;
+ for (x = 0; x < (unsigned int) mask_size; x++)
+ {
+ /* priming a full opaque mask */
+ *p_msk++ = 1;
+ }
+
+ /* copying pixels */
+ p_in = rgba_tile;
+ p_out = pixels;
+ p_msk = mask;
+ if (cvg->pixelType == RL2_PIXEL_RGB && cvg->nBands == 3)
+ {
+ for (y = 0; y < cvg->tileHeight; y++)
+ {
+ for (x = 0; x < cvg->tileWidth; x++)
+ {
+ unsigned char red = *p_in++;
+ unsigned char green = *p_in++;
+ unsigned char blue = *p_in++;
+ *p_out++ = red;
+ *p_out++ = green;
+ *p_out++ = blue;
+ }
+ }
+ }
+ if (cvg->pixelType == RL2_PIXEL_GRAYSCALE && cvg->nBands == 1)
+ {
+ for (y = 0; y < cvg->tileHeight; y++)
+ {
+ for (x = 0; x < cvg->tileWidth; x++)
+ {
+ unsigned char red = *p_in++;
+ p_in += 3;
+ *p_out++ = red;
+ }
+ }
+ }
+ if (cvg->pixelType == RL2_PIXEL_MONOCHROME && cvg->nBands == 1)
+ {
+ for (y = 0; y < cvg->tileHeight; y++)
+ {
+ for (x = 0; x < cvg->tileWidth; x++)
+ {
+ unsigned char red = *p_in++;
+ p_in += 3;
+ if (red == 255)
+ *p_out++ = 0;
+ else
+ *p_out++ = 1;
+ }
+ }
+ }
+
+ if (!requires_mask)
+ {
+ /* no mask required */
+ free (mask);
+ mask = NULL;
+ mask_size = 0;
+ }
+
+ raster =
+ rl2_create_raster (cvg->tileWidth, cvg->tileHeight,
+ cvg->sampleType, cvg->pixelType,
+ cvg->nBands, pixels, pixels_sz, NULL, mask,
+ mask_size, NULL);
+ if (raster == NULL)
+ goto error;
+ return raster;
+
+ error:
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ if (pixels != NULL)
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return NULL;
+}
+
+RL2_PRIVATE int
+insert_wms_tile (InsertWmsPtr ptr, int *first,
+ rl2RasterStatisticsPtr * section_stats,
+ sqlite3_int64 * section_id)
+{
+ double tile_minx;
+ double tile_miny;
+ double tile_maxx;
+ double tile_maxy;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ rl2RasterPtr raster = NULL;
+ double base_res_x;
+ double base_res_y;
+
+ if (rl2_get_coverage_resolution (ptr->coverage, &base_res_x, &base_res_y) !=
+ RL2_OK)
+ goto error;
+ if (*first)
+ {
+ /* INSERTing the section */
+ *first = 0;
+ if (!do_insert_section
+ (ptr->sqlite, "WMS Service", ptr->sect_name, ptr->srid,
+ ptr->width, ptr->height, ptr->minx, ptr->miny, ptr->maxx,
+ ptr->maxy, ptr->stmt_sect, section_id))
+ goto error;
+ *section_stats =
+ rl2_create_raster_statistics (ptr->sample_type, ptr->num_bands);
+ if (*section_stats == NULL)
+ goto error;
+ /* INSERTing the base-levels */
+ if (!do_insert_levels
+ (ptr->sqlite, base_res_x, base_res_y, 1.0, RL2_SAMPLE_UNKNOWN,
+ ptr->stmt_levl))
+ goto error;
+ }
+
+ /* building the raster tile */
+ raster = build_wms_tile (ptr->coverage, ptr->rgba_tile);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to get a WMS tile\n");
+ goto error;
+ }
+ if (rl2_raster_encode
+ (raster, ptr->compression, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 100, 1) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to encode a WMS tile\n");
+ goto error;
+ }
+
+ /* INSERTing the tile */
+ tile_minx = ptr->x;
+ tile_maxx = tile_minx + ptr->tilew;
+ tile_maxy = ptr->y;
+ tile_miny = tile_maxy - ptr->tileh;
+ if (!do_insert_wms_tile
+ (ptr->sqlite, blob_odd, blob_odd_sz, blob_even, blob_even_sz,
+ *section_id, ptr->srid, ptr->horz_res, ptr->vert_res, ptr->tile_width,
+ ptr->tile_height, ptr->minx, ptr->maxy, tile_minx, tile_miny,
+ tile_maxx, tile_maxy, NULL, ptr->no_data, ptr->stmt_tils,
+ ptr->stmt_data, *section_stats))
+ goto error;
+ blob_odd = NULL;
+ blob_even = NULL;
+ rl2_destroy_raster (raster);
+ free (ptr->rgba_tile);
+ ptr->rgba_tile = NULL;
+ return 1;
+ error:
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (blob_odd != NULL)
+ free (blob_odd);
+ if (blob_even != NULL)
+ free (blob_even);
+ free (ptr->rgba_tile);
+ ptr->rgba_tile = NULL;
+ return 0;
+}
+
+RL2_PRIVATE int
+is_point (gaiaGeomCollPtr geom)
+{
+/* checking if the Geom is a simple Point */
+ int pts = 0;
+ int lns = 0;
+ int pgs = 0;
+ gaiaPointPtr pt;
+ gaiaLinestringPtr ln;
+ gaiaPolygonPtr pg;
+ pt = geom->FirstPoint;
+ while (pt != NULL)
+ {
+ pts++;
+ pt = pt->Next;
+ }
+ ln = geom->FirstLinestring;
+ while (ln != NULL)
+ {
+ lns++;
+ ln = ln->Next;
+ }
+ pg = geom->FirstPolygon;
+ while (pg != NULL)
+ {
+ pgs++;
+ pg = pg->Next;
+ }
+ if (pts == 1 && lns == 0 && pgs == 0)
+ return 1;
+ return 0;
+}
+
+RL2_PRIVATE ResolutionsListPtr
+alloc_resolutions_list ()
+{
+/* allocating an empty list */
+ ResolutionsListPtr list = malloc (sizeof (ResolutionsList));
+ if (list == NULL)
+ return NULL;
+ list->first = NULL;
+ list->last = NULL;
+ return list;
+}
+
+RL2_PRIVATE void
+destroy_resolutions_list (ResolutionsListPtr list)
+{
+/* memory cleanup - destroying a list */
+ ResolutionLevelPtr res;
+ ResolutionLevelPtr resn;
+ if (list == NULL)
+ return;
+ res = list->first;
+ while (res != NULL)
+ {
+ resn = res->next;
+ free (res);
+ res = resn;
+ }
+ free (list);
+}
+
+RL2_PRIVATE void
+add_base_resolution (ResolutionsListPtr list, int level, int scale,
+ double x_res, double y_res)
+{
+/* inserting a base resolution into the list */
+ ResolutionLevelPtr res;
+ if (list == NULL)
+ return;
+
+ res = list->first;
+ while (res != NULL)
+ {
+ if (res->x_resolution == x_res && res->y_resolution == y_res)
+ {
+ /* already defined: skipping */
+ return;
+ }
+ res = res->next;
+ }
+
+/* inserting */
+ res = malloc (sizeof (ResolutionLevel));
+ res->level = level;
+ res->scale = scale;
+ res->x_resolution = x_res;
+ res->y_resolution = y_res;
+ res->prev = list->last;
+ res->next = NULL;
+ if (list->first == NULL)
+ list->first = res;
+ if (list->last != NULL)
+ list->last->next = res;
+ list->last = res;
+}
+
+RL2_PRIVATE int
+find_best_resolution_level (sqlite3 * handle, const char *coverage,
+ double x_res, double y_res, int *level_id,
+ int *scale, int *real_scale, double *xx_res,
+ double *yy_res)
+{
+/* attempting to identify the optimal resolution level */
+ int ret;
+ int found = 0;
+ int z_level;
+ int z_scale;
+ int z_real;
+ double z_x_res;
+ double z_y_res;
+ char *xcoverage;
+ char *xxcoverage;
+ char *sql;
+ sqlite3_stmt *stmt = NULL;
+ ResolutionsListPtr list = NULL;
+ ResolutionLevelPtr res;
+
+ if (coverage == NULL)
+ return 0;
+
+ xcoverage = sqlite3_mprintf ("%s_levels", coverage);
+ xxcoverage = gaiaDoubleQuotedSql (xcoverage);
+ sqlite3_free (xcoverage);
+ sql =
+ sqlite3_mprintf
+ ("SELECT pyramid_level, x_resolution_1_8, y_resolution_1_8, "
+ "x_resolution_1_4, y_resolution_1_4, x_resolution_1_2, y_resolution_1_2, "
+ "x_resolution_1_1, y_resolution_1_1 FROM \"%s\" "
+ "ORDER BY pyramid_level DESC", xxcoverage);
+ free (xxcoverage);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql, sqlite3_errmsg (handle));
+ goto error;
+ }
+ sqlite3_free (sql);
+
+ list = alloc_resolutions_list ();
+ if (list == NULL)
+ goto error;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ int lvl = sqlite3_column_int (stmt, 0);
+ if (sqlite3_column_type (stmt, 1) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 2) == SQLITE_FLOAT)
+ {
+ z_x_res = sqlite3_column_double (stmt, 1);
+ z_y_res = sqlite3_column_double (stmt, 2);
+ add_base_resolution (list, lvl, RL2_SCALE_8, z_x_res,
+ z_y_res);
+ }
+ if (sqlite3_column_type (stmt, 3) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 4) == SQLITE_FLOAT)
+ {
+ z_x_res = sqlite3_column_double (stmt, 3);
+ z_y_res = sqlite3_column_double (stmt, 4);
+ add_base_resolution (list, lvl, RL2_SCALE_4, z_x_res,
+ z_y_res);
+ }
+ if (sqlite3_column_type (stmt, 5) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 6) == SQLITE_FLOAT)
+ {
+ z_x_res = sqlite3_column_double (stmt, 5);
+ z_y_res = sqlite3_column_double (stmt, 6);
+ add_base_resolution (list, lvl, RL2_SCALE_2, z_x_res,
+ z_y_res);
+ }
+ if (sqlite3_column_type (stmt, 7) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 8) == SQLITE_FLOAT)
+ {
+ z_x_res = sqlite3_column_double (stmt, 7);
+ z_y_res = sqlite3_column_double (stmt, 8);
+ add_base_resolution (list, lvl, RL2_SCALE_1, z_x_res,
+ z_y_res);
+ }
+ }
+ else
+ {
+ fprintf (stderr, "SQL error: %s\n%s\n", sql,
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+
+/* adjusting real scale factors */
+ z_real = 1;
+ res = list->last;
+ while (res != NULL)
+ {
+ res->real_scale = z_real;
+ z_real *= 2;
+ res = res->prev;
+ }
+/* retrieving the best resolution level */
+ found = 0;
+ res = list->last;
+ while (res != NULL)
+ {
+ if (res->x_resolution <= x_res && res->y_resolution <= y_res)
+ {
+ found = 1;
+ z_level = res->level;
+ z_scale = res->scale;
+ z_real = res->real_scale;
+ z_x_res = res->x_resolution;
+ z_y_res = res->y_resolution;
+ }
+ res = res->prev;
+ }
+ if (found)
+ {
+ *level_id = z_level;
+ *scale = z_scale;
+ *real_scale = z_real;
+ *xx_res = z_x_res;
+ *yy_res = z_y_res;
+ }
+ else if (list->last != NULL)
+ {
+ res = list->last;
+ *level_id = res->level;
+ *scale = res->scale;
+ *xx_res = res->x_resolution;
+ *yy_res = res->y_resolution;
+ }
+ else
+ goto error;
+ destroy_resolutions_list (list);
+ return 1;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (list != NULL)
+ destroy_resolutions_list (list);
+ return 0;
+}
+
+RL2_PRIVATE unsigned char
+get_palette_format (rl2PrivPalettePtr plt)
+{
+/* testing for a Grayscale or RGB palette */
+ int is_gray = 0;
+ int i;
+ for (i = 0; i < plt->nEntries; i++)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + i;
+ if (entry->red == entry->green && entry->red == entry->blue)
+ is_gray++;
+ }
+ if (is_gray == plt->nEntries)
+ return RL2_PIXEL_GRAYSCALE;
+ else
+ return RL2_PIXEL_RGB;
+}
+
+static unsigned char *
+gray_to_rgba (unsigned short width, unsigned short height, unsigned char *gray)
+{
+/* transforming an RGB buffer to RGBA */
+ unsigned char *rgba = NULL;
+ unsigned char *p_out;
+ const unsigned char *p_in;
+ int x;
+ int y;
+
+ rgba = malloc (width * height * 4);
+ if (rgba == NULL)
+ return NULL;
+ p_in = gray;
+ p_out = rgba;
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ unsigned char x = *p_in++;
+ *p_out++ = x; /* red */
+ *p_out++ = x; /* green */
+ *p_out++ = x; /* blue */
+ *p_out++ = 255; /* alpha */
+ }
+ }
+ return rgba;
+}
+
+static unsigned char *
+rgb_to_rgba (unsigned int width, unsigned int height, unsigned char *rgb)
+{
+/* transforming an RGB buffer to RGBA */
+ unsigned char *rgba = NULL;
+ unsigned char *p_out;
+ const unsigned char *p_in;
+ unsigned int x;
+ unsigned int y;
+
+ rgba = malloc (width * height * 4);
+ if (rgba == NULL)
+ return NULL;
+ p_in = rgb;
+ p_out = rgba;
+ for (y = 0; y < height; y++)
+ {
+ for (x = 0; x < width; x++)
+ {
+ *p_out++ = *p_in++; /* red */
+ *p_out++ = *p_in++; /* green */
+ *p_out++ = *p_in++; /* blue */
+ *p_out++ = 255; /* alpha */
+ }
+ }
+ return rgba;
+}
+
+RL2_PRIVATE int
+get_payload_from_monochrome_opaque (unsigned int width, unsigned int height,
+ sqlite3 * handle, double minx, double miny,
+ double maxx, double maxy, int srid,
+ unsigned char *pixels, unsigned char format,
+ int quality, unsigned char **image,
+ int *image_sz)
+{
+/* input: Monochrome output: Grayscale */
+ int ret;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *gray = NULL;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *rgba = NULL;
+
+ gray = malloc (width * height);
+ if (gray == NULL)
+ goto error;
+ p_in = pixels;
+ p_out = gray;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (*p_in++ == 1)
+ *p_out++ = 0; /* Black */
+ else
+ *p_out++ = 255; /* White */
+ }
+ }
+ free (pixels);
+ pixels = NULL;
+ if (format == RL2_OUTPUT_FORMAT_JPEG)
+ {
+ if (rl2_gray_to_jpeg (width, height, gray, quality, image, image_sz)
+ != RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_gray_to_png (width, height, gray, image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_TIFF)
+ {
+ if (srid > 0)
+ {
+ if (rl2_gray_to_geotiff
+ (width, height, handle, minx, miny, maxx, maxy, srid, gray,
+ image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else
+ {
+ if (rl2_gray_to_tiff (width, height, gray, image, image_sz) !=
+ RL2_OK)
+ goto error;
+ }
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PDF)
+ {
+ rgba = gray_to_rgba (width, height, gray);
+ if (rgba == NULL)
+ goto error;
+ ret = rl2_rgba_to_pdf (width, height, rgba, image, image_sz);
+ rgba = NULL;
+ if (ret != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (gray);
+ return 1;
+
+ error:
+ if (pixels != NULL)
+ free (pixels);
+ if (gray != NULL)
+ free (gray);
+ if (rgba != NULL)
+ free (rgba);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_payload_from_monochrome_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char format, int quality,
+ unsigned char **image, int *image_sz,
+ double opacity)
+{
+/* input: Monochrome output: Grayscale */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned char *gray = NULL;
+ unsigned char *mask = NULL;
+ unsigned int row;
+ unsigned int col;
+
+ if (quality > 100)
+ quality = 100;
+ gray = malloc (width * height);
+ if (gray == NULL)
+ goto error;
+ mask = malloc (width * height);
+ if (mask == NULL)
+ goto error;
+ p_in = pixels;
+ p_out = gray;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (*p_in++ == 1)
+ {
+ *p_out++ = 0; /* Black */
+ *p_msk++ = 1; /* Opaque */
+ }
+ else
+ {
+ *p_out++ = 1; /* White */
+ *p_msk++ = 0; /* Transparent */
+ }
+ }
+ }
+ free (pixels);
+ pixels = NULL;
+ if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_gray_alpha_to_png
+ (width, height, gray, mask, image, image_sz, opacity) != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (gray);
+ free (mask);
+ return 1;
+
+ error:
+ if (pixels != NULL)
+ free (pixels);
+ if (gray != NULL)
+ free (gray);
+ if (mask != NULL)
+ free (mask);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_payload_from_palette_opaque (unsigned int width, unsigned int height,
+ sqlite3 * handle, double minx, double miny,
+ double maxx, double maxy, int srid,
+ unsigned char *pixels, rl2PalettePtr palette,
+ unsigned char format, int quality,
+ unsigned char **image, int *image_sz)
+{
+/* input: Palette output: Grayscale or RGB */
+ int ret;
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) palette;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *gray = NULL;
+ unsigned char *rgb = NULL;
+ unsigned int row;
+ unsigned int col;
+ unsigned char out_format;
+ unsigned char *rgba = NULL;
+
+ out_format = get_palette_format (plt);
+ if (out_format == RL2_PIXEL_RGB)
+ {
+ /* converting from Palette to RGB */
+ rgb = malloc (width * height * 3);
+ p_in = pixels;
+ p_out = rgb;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char red = 0;
+ unsigned char green = 0;
+ unsigned char blue = 0;
+ unsigned char index = *p_in++;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + index;
+ red = entry->red;
+ green = entry->green;
+ blue = entry->blue;
+ }
+ *p_out++ = red; /* red */
+ *p_out++ = green; /* green */
+ *p_out++ = blue; /* blue */
+ }
+ }
+ free (pixels);
+ if (format == RL2_OUTPUT_FORMAT_JPEG)
+ {
+ if (rl2_rgb_to_jpeg
+ (width, height, rgb, quality, image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_rgb_to_png (width, height, rgb, image, image_sz) !=
+ RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_TIFF)
+ {
+ if (srid > 0)
+ {
+ if (rl2_rgb_to_geotiff
+ (width, height, handle, minx, miny, maxx, maxy, srid,
+ rgb, image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else
+ {
+ if (rl2_rgb_to_tiff (width, height, rgb, image, image_sz)
+ != RL2_OK)
+ goto error;
+ }
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PDF)
+ {
+ rgba = rgb_to_rgba (width, height, rgb);
+ if (rgba == NULL)
+ goto error;
+ ret = rl2_rgba_to_pdf (width, height, rgba, image, image_sz);
+ rgba = NULL;
+ if (ret != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (rgb);
+ }
+ else if (out_format == RL2_PIXEL_GRAYSCALE)
+ {
+ /* converting from Palette to Grayscale */
+ gray = malloc (width * height);
+ p_in = pixels;
+ p_out = gray;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char value = 0;
+ unsigned char index = *p_in++;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + index;
+ value = entry->red;
+ }
+ *p_out++ = value; /* gray */
+ }
+ }
+ free (pixels);
+ if (format == RL2_OUTPUT_FORMAT_JPEG)
+ {
+ if (rl2_gray_to_jpeg
+ (width, height, gray, quality, image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_gray_to_png (width, height, gray, image, image_sz) !=
+ RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_TIFF)
+ {
+ if (srid > 0)
+ {
+ if (rl2_gray_to_geotiff
+ (width, height, handle, minx, miny, maxx, maxy, srid,
+ gray, image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else
+ {
+ if (rl2_gray_to_tiff
+ (width, height, gray, image, image_sz) != RL2_OK)
+ goto error;
+ }
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PDF)
+ {
+ rgba = gray_to_rgba (width, height, gray);
+ if (rgba == NULL)
+ goto error;
+ ret = rl2_rgba_to_pdf (width, height, rgba, image, image_sz);
+ rgba = NULL;
+ if (ret != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (gray);
+ }
+ else
+ goto error;
+ return 1;
+
+ error:
+ if (pixels != NULL)
+ free (pixels);
+ if (gray != NULL)
+ free (gray);
+ if (rgb != NULL)
+ free (rgb);
+ if (rgba != NULL)
+ free (rgba);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_payload_from_palette_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ rl2PalettePtr palette,
+ unsigned char format, int quality,
+ unsigned char **image, int *image_sz,
+ unsigned char bg_red,
+ unsigned char bg_green,
+ unsigned char bg_blue, double opacity)
+{
+/* input: Palette output: Grayscale or RGB */
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) palette;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned char *gray = NULL;
+ unsigned char *rgb = NULL;
+ unsigned char *mask = NULL;
+ unsigned int row;
+ unsigned int col;
+ unsigned char out_format;
+
+ if (quality > 100)
+ quality = 100;
+ out_format = get_palette_format (plt);
+ if (out_format == RL2_PIXEL_RGB)
+ {
+ /* converting from Palette to RGB */
+ rgb = malloc (width * height * 3);
+ if (rgb == NULL)
+ goto error;
+ mask = malloc (width * height);
+ if (mask == NULL)
+ goto error;
+ p_in = pixels;
+ p_out = rgb;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char red = 0;
+ unsigned char green = 0;
+ unsigned char blue = 0;
+ unsigned char index = *p_in++;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + index;
+ red = entry->red;
+ green = entry->green;
+ blue = entry->blue;
+ }
+ *p_out++ = red; /* red */
+ *p_out++ = green; /* green */
+ *p_out++ = blue; /* blue */
+ if (red == bg_red && green == bg_green && blue == bg_blue)
+ *p_msk++ = 0; /* Transparent */
+ else
+ *p_msk++ = 1; /* Opaque */
+ }
+ }
+ free (pixels);
+ if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_rgb_to_png (width, height, rgb, image, image_sz) !=
+ RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (rgb);
+ free (mask);
+ }
+ else if (out_format == RL2_PIXEL_GRAYSCALE)
+ {
+ /* converting from Palette to Grayscale */
+ gray = malloc (width * height);
+ if (gray == NULL)
+ goto error;
+ mask = malloc (width * height);
+ if (mask == NULL)
+ goto error;
+ p_in = pixels;
+ p_out = gray;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char value = 0;
+ unsigned char index = *p_in++;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + index;
+ value = entry->red;
+ }
+ *p_out++ = value; /* gray */
+ if (value == bg_red)
+ *p_msk++ = 0; /* Transparent */
+ else
+ *p_msk++ = 1; /* Opaque */
+ }
+ }
+ free (pixels);
+ if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_gray_alpha_to_png
+ (width, height, gray, mask, image, image_sz,
+ opacity) != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (gray);
+ free (mask);
+ }
+ else
+ goto error;
+ return 1;
+
+ error:
+ if (pixels != NULL)
+ free (pixels);
+ if (gray != NULL)
+ free (gray);
+ if (rgb != NULL)
+ free (rgb);
+ if (mask != NULL)
+ free (mask);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_payload_from_grayscale_opaque (unsigned int width, unsigned int height,
+ sqlite3 * handle, double minx, double miny,
+ double maxx, double maxy, int srid,
+ unsigned char *pixels, unsigned char format,
+ int quality, unsigned char **image,
+ int *image_sz)
+{
+/* input: Grayscale output: Grayscale */
+ int ret;
+ unsigned char *rgba = NULL;
+
+ if (format == RL2_OUTPUT_FORMAT_JPEG)
+ {
+ if (rl2_gray_to_jpeg (width, height, pixels, quality, image, image_sz)
+ != RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_gray_to_png (width, height, pixels, image, image_sz) !=
+ RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_TIFF)
+ {
+ if (srid > 0)
+ {
+ if (rl2_gray_to_geotiff
+ (width, height, handle, minx, miny, maxx, maxy, srid,
+ pixels, image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else
+ {
+ if (rl2_gray_to_tiff (width, height, pixels, image, image_sz) !=
+ RL2_OK)
+ goto error;
+ }
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PDF)
+ {
+ rgba = gray_to_rgba (width, height, pixels);
+ if (rgba == NULL)
+ goto error;
+ ret = rl2_rgba_to_pdf (width, height, rgba, image, image_sz);
+ rgba = NULL;
+ if (ret != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (pixels);
+ if (rgba != NULL)
+ free (rgba);
+ return 1;
+
+ error:
+ free (pixels);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_payload_from_grayscale_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char format, int quality,
+ unsigned char **image, int *image_sz,
+ unsigned char bg_gray, double opacity)
+{
+/* input: Grayscale output: Grayscale */
+ unsigned char *p_in;
+ unsigned char *p_msk;
+ unsigned char *mask = NULL;
+ unsigned short row;
+ unsigned short col;
+
+ if (quality > 100)
+ quality = 100;
+ mask = malloc (width * height);
+ if (mask == NULL)
+ goto error;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (*p_in++ == bg_gray)
+ *p_msk++ = 0; /* Transparent */
+ else
+ *p_msk++ = 255; /* Opaque */
+ }
+ }
+ if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_gray_alpha_to_png
+ (width, height, pixels, mask, image, image_sz, opacity) != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (pixels);
+ free (mask);
+ return 1;
+
+ error:
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_payload_from_rgb_opaque (unsigned int width, unsigned int height,
+ sqlite3 * handle, double minx, double miny,
+ double maxx, double maxy, int srid,
+ unsigned char *pixels, unsigned char format,
+ int quality, unsigned char **image, int *image_sz)
+{
+/* input: RGB output: RGB */
+ int ret;
+ unsigned char *rgba = NULL;
+
+ if (format == RL2_OUTPUT_FORMAT_JPEG)
+ {
+ if (rl2_rgb_to_jpeg (width, height, pixels, quality, image, image_sz)
+ != RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_rgb_to_png (width, height, pixels, image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_TIFF)
+ {
+ if (srid > 0)
+ {
+ if (rl2_rgb_to_geotiff
+ (width, height, handle, minx, miny, maxx, maxy, srid,
+ pixels, image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else
+ {
+ if (rl2_rgb_to_tiff (width, height, pixels, image, image_sz) !=
+ RL2_OK)
+ goto error;
+ }
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PDF)
+ {
+ rgba = rgb_to_rgba (width, height, pixels);
+ if (rgba == NULL)
+ goto error;
+ ret = rl2_rgba_to_pdf (width, height, rgba, image, image_sz);
+ rgba = NULL;
+ if (ret != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (pixels);
+ return 1;
+
+ error:
+ free (pixels);
+ if (rgba != NULL)
+ free (rgba);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_payload_from_rgb_transparent (unsigned int width, unsigned int height,
+ unsigned char *pixels, unsigned char format,
+ int quality, unsigned char **image,
+ int *image_sz, unsigned char bg_red,
+ unsigned char bg_green, unsigned char bg_blue,
+ double opacity)
+{
+/* input: RGB output: RGB */
+ unsigned char *p_in;
+ unsigned char *p_msk;
+ unsigned char *mask = NULL;
+ unsigned int row;
+ unsigned int col;
+
+ if (quality > 100)
+ quality = 100;
+ mask = malloc (width * height);
+ if (mask == NULL)
+ goto error;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char red = *p_in++;
+ unsigned char green = *p_in++;
+ unsigned char blue = *p_in++;
+ if (red == bg_red && green == bg_green && blue == bg_blue)
+ *p_msk++ = 0; /* Transparent */
+ else
+ *p_msk++ = 1; /* Opaque */
+ }
+ }
+ if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_rgb_alpha_to_png
+ (width, height, pixels, mask, image, image_sz, opacity) != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (pixels);
+ free (mask);
+ return 1;
+
+ error:
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 0;
+}
+
+static int
+test_no_data_8 (rl2PrivPixelPtr no_data, unsigned char *p_in)
+{
+/* testing for NO-DATA */
+ if (no_data != NULL)
+ {
+ unsigned char band;
+ int match = 0;
+ rl2PrivSamplePtr sample;
+ for (band = 0; band < no_data->nBands; band++)
+ {
+ sample = no_data->Samples + band;
+ if (*(p_in + band) == sample->uint8)
+ match++;
+ }
+ if (match == no_data->nBands)
+ return 1;
+ }
+ return 0;
+}
+
+RL2_PRIVATE int
+get_rgba_from_monochrome_mask (unsigned int width, unsigned int height,
+ unsigned char *pixels, unsigned char *mask,
+ rl2PrivPixelPtr no_data, unsigned char *rgba)
+{
+/* input: Monochrome output: Grayscale */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ int transparent;
+
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char value = 255;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (!transparent)
+ transparent = test_no_data_8 (no_data, p_in);
+ if (transparent)
+ {
+ p_out += 4;
+ p_in++;
+ }
+ else
+ {
+ if (*p_in++ == 1)
+ value = 0;
+ *p_out++ = value;
+ *p_out++ = value;
+ *p_out++ = value;
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+get_rgba_from_monochrome_opaque (unsigned int width, unsigned int height,
+ unsigned char *pixels, unsigned char *rgba)
+{
+/* input: Monochrome output: Grayscale */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned int row;
+ unsigned int col;
+ p_in = pixels;
+ p_out = rgba;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (*p_in++ == 1)
+ {
+ *p_out++ = 0; /* Black */
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 255; /* alpha */
+ }
+ else
+ {
+ *p_out++ = 255; /* White */
+ *p_out++ = 255;
+ *p_out++ = 255;
+ *p_out++ = 255; /* alpha */
+ }
+ }
+ }
+ free (pixels);
+ return 1;
+}
+
+RL2_PRIVATE int
+get_rgba_from_monochrome_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels,
+ unsigned char *rgba)
+{
+/* input: Monochrome output: Grayscale */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = pixels;
+ p_out = rgba;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (*p_in++ == 1)
+ {
+ *p_out++ = 0; /* Black */
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 255; /* alpha */
+ }
+ else
+ {
+ *p_out++ = 255; /* White */
+ *p_out++ = 255;
+ *p_out++ = 255;
+ *p_out++ = 0; /* alpha */
+ }
+ }
+ }
+ free (pixels);
+ return 1;
+}
+
+RL2_PRIVATE int
+get_rgba_from_palette_mask (unsigned int width, unsigned int height,
+ unsigned char *pixels, unsigned char *mask,
+ rl2PalettePtr palette, rl2PrivPixelPtr no_data,
+ unsigned char *rgba)
+{
+/* input: Palette output: Grayscale or RGB */
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) palette;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ unsigned char out_format;
+ int transparent;
+
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ out_format = get_palette_format (plt);
+ if (out_format == RL2_PIXEL_RGB)
+ {
+ /* converting from Palette to RGB */
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char red = 0;
+ unsigned char green = 0;
+ unsigned char blue = 0;
+ unsigned char index;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (!transparent)
+ transparent = test_no_data_8 (no_data, p_in);
+ if (transparent)
+ {
+ p_out += 4;
+ p_in++;
+ }
+ else
+ {
+ index = *p_in++;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr entry =
+ plt->entries + index;
+ red = entry->red;
+ green = entry->green;
+ blue = entry->blue;
+ }
+ *p_out++ = red; /* red */
+ *p_out++ = green; /* green */
+ *p_out++ = blue; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ }
+ else if (out_format == RL2_PIXEL_GRAYSCALE)
+ {
+ /* converting from Palette to Grayscale */
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char value = 0;
+ unsigned char index = *p_in++;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + index;
+ value = entry->red;
+ }
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent)
+ p_out += 4;
+ else
+ {
+ *p_out++ = value; /* red */
+ *p_out++ = value; /* green */
+ *p_out++ = value; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ }
+ else
+ goto error;
+ free (pixels);
+ if (mask)
+ free (mask);
+ return 1;
+
+ error:
+ free (pixels);
+ if (mask)
+ free (mask);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_rgba_from_palette_opaque (unsigned int width, unsigned int height,
+ unsigned char *pixels, rl2PalettePtr palette,
+ unsigned char *rgba)
+{
+/* input: Palette output: Grayscale or RGB */
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) palette;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned int row;
+ unsigned int col;
+ unsigned char out_format;
+
+ p_in = pixels;
+ p_out = rgba;
+ out_format = get_palette_format (plt);
+ if (out_format == RL2_PIXEL_RGB)
+ {
+ /* converting from Palette to RGB */
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char red = 0;
+ unsigned char green = 0;
+ unsigned char blue = 0;
+ unsigned char index = *p_in++;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + index;
+ red = entry->red;
+ green = entry->green;
+ blue = entry->blue;
+ }
+ *p_out++ = red; /* red */
+ *p_out++ = green; /* green */
+ *p_out++ = blue; /* blue */
+ *p_out++ = 255; /* alpha */
+ }
+ }
+ }
+ else if (out_format == RL2_PIXEL_GRAYSCALE)
+ {
+ /* converting from Palette to Grayscale */
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char value = 0;
+ unsigned char index = *p_in++;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + index;
+ value = entry->red;
+ }
+ *p_out++ = value; /* red */
+ *p_out++ = value; /* green */
+ *p_out++ = value; /* blue */
+ *p_out++ = 255; /* alpha */
+ }
+ }
+ }
+ else
+ goto error;
+ free (pixels);
+ return 1;
+
+ error:
+ free (pixels);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_rgba_from_palette_transparent (unsigned int width, unsigned int height,
+ unsigned char *pixels, rl2PalettePtr palette,
+ unsigned char *rgba, unsigned char bg_red,
+ unsigned char bg_green,
+ unsigned char bg_blue)
+{
+/* input: Palette output: Grayscale or RGB */
+ rl2PrivPalettePtr plt = (rl2PrivPalettePtr) palette;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned int row;
+ unsigned int col;
+ unsigned char out_format;
+
+ p_in = pixels;
+ p_out = rgba;
+ out_format = get_palette_format (plt);
+ if (out_format == RL2_PIXEL_RGB)
+ {
+ /* converting from Palette to RGB */
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char red = 0;
+ unsigned char green = 0;
+ unsigned char blue = 0;
+ unsigned char index = *p_in++;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + index;
+ red = entry->red;
+ green = entry->green;
+ blue = entry->blue;
+ }
+ *p_out++ = red; /* red */
+ *p_out++ = green; /* green */
+ *p_out++ = blue; /* blue */
+ if (red == bg_red && green == bg_green && blue == bg_blue)
+ *p_out++ = 0; /* Transparent */
+ else
+ *p_out++ = 255; /* Opaque */
+ }
+ }
+ }
+ else if (out_format == RL2_PIXEL_GRAYSCALE)
+ {
+ /* converting from Palette to Grayscale */
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char value = 0;
+ unsigned char index = *p_in++;
+ if (index < plt->nEntries)
+ {
+ rl2PrivPaletteEntryPtr entry = plt->entries + index;
+ value = entry->red;
+ }
+ *p_out++ = value; /* red */
+ *p_out++ = value; /* green */
+ *p_out++ = value; /* blue */
+ if (value == bg_red)
+ *p_out++ = 0; /* Transparent */
+ else
+ *p_out++ = 255; /* Opaque */
+ }
+ }
+ }
+ else
+ goto error;
+ free (pixels);
+ return 1;
+
+ error:
+ free (pixels);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_rgba_from_grayscale_mask (unsigned int width, unsigned int height,
+ unsigned char *pixels, unsigned char *mask,
+ rl2PrivPixelPtr no_data, unsigned char *rgba)
+{
+/* input: Grayscale output: Grayscale */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ int transparent;
+
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (!transparent)
+ transparent = test_no_data_8 (no_data, p_in);
+ if (transparent)
+ {
+ p_out += 4;
+ p_in++;
+ }
+ else
+ {
+ unsigned char gray = *p_in++;
+ *p_out++ = gray; /* red */
+ *p_out++ = gray; /* green */
+ *p_out++ = gray; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+get_rgba_from_grayscale_opaque (unsigned int width, unsigned int height,
+ unsigned char *pixels, unsigned char *rgba)
+{
+/* input: Grayscale output: Grayscale */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = pixels;
+ p_out = rgba;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char gray = *p_in++;
+ *p_out++ = gray; /* red */
+ *p_out++ = gray; /* green */
+ *p_out++ = gray; /* blue */
+ *p_out++ = 255; /* alpha */
+ }
+ }
+ free (pixels);
+ return 1;
+}
+
+RL2_PRIVATE int
+get_rgba_from_grayscale_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *pixels, unsigned char *rgba,
+ unsigned char bg_gray)
+{
+/* input: Grayscale output: Grayscale */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = pixels;
+ p_out = rgba;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char gray = *p_in++;
+ *p_out++ = gray; /* red */
+ *p_out++ = gray; /* green */
+ *p_out++ = gray; /* blue */
+ if (gray == bg_gray)
+ *p_out++ = 0; /* Transparent */
+ else
+ *p_out++ = 255; /* Opaque */
+ }
+ }
+ free (pixels);
+ return 1;
+}
+
+RL2_PRIVATE int
+get_rgba_from_rgb_mask (unsigned int width, unsigned int height,
+ unsigned char *pixels, unsigned char *mask,
+ rl2PrivPixelPtr no_data, unsigned char *rgba)
+{
+/* input: RGB output: RGB */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ int transparent;
+
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (!transparent)
+ transparent = test_no_data_8 (no_data, p_in);
+ if (transparent)
+ {
+ p_out += 4;
+ p_in += 3;
+ }
+ else
+ {
+ *p_out++ = *p_in++; /* red */
+ *p_out++ = *p_in++; /* green */
+ *p_out++ = *p_in++; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+get_rgba_from_rgb_opaque (unsigned int width, unsigned int height,
+ unsigned char *pixels, unsigned char *rgba)
+{
+/* input: RGB output: RGB */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = pixels;
+ p_out = rgba;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ *p_out++ = *p_in++; /* red */
+ *p_out++ = *p_in++; /* green */
+ *p_out++ = *p_in++; /* blue */
+ *p_out++ = 255; /* alpha */
+ }
+ }
+ free (pixels);
+ return 1;
+}
+
+RL2_PRIVATE int
+get_rgba_from_rgb_transparent (unsigned int width, unsigned int height,
+ unsigned char *pixels, unsigned char *rgba,
+ unsigned char bg_red, unsigned char bg_green,
+ unsigned char bg_blue)
+{
+/* input: RGB output: RGB */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned int row;
+ unsigned int col;
+
+ p_in = pixels;
+ p_out = rgba;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char red = *p_in++;
+ unsigned char green = *p_in++;
+ unsigned char blue = *p_in++;
+ *p_out++ = red;
+ *p_out++ = green;
+ *p_out++ = blue;
+ if (red == bg_red && green == bg_green && blue == bg_blue)
+ *p_out++ = 0; /* Transparent */
+ else
+ *p_out++ = 255; /* Opaque */
+ }
+ }
+ free (pixels);
+ return 1;
+}
+
+RL2_PRIVATE int
+rgba_from_int8 (unsigned int width, unsigned int height,
+ char *pixels, unsigned char *mask, unsigned char *rgba)
+{
+/* input: DataGrid INT8 output: Grayscale */
+ char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ int transparent;
+
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ char gray = 128 + *p_in++;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent)
+ p_out += 4;
+ else
+ {
+ *p_out++ = gray; /* red */
+ *p_out++ = gray; /* green */
+ *p_out++ = gray; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+rgba_from_uint8 (unsigned int width, unsigned int height,
+ unsigned char *pixels, unsigned char *mask,
+ unsigned char *rgba)
+{
+/* input: DataGrid UINT8 output: Grayscale */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ int transparent;
+
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char gray = *p_in++;
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent)
+ p_out += 4;
+ else
+ {
+ *p_out++ = gray; /* red */
+ *p_out++ = gray; /* green */
+ *p_out++ = gray; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+rgba_from_int16 (unsigned int width, unsigned int height,
+ short *pixels, unsigned char *mask, unsigned char *rgba)
+{
+/* input: DataGrid INT16 output: Grayscale */
+ short *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ short min = SHRT_MAX;
+ short max = SHRT_MIN;
+ double min2;
+ double max2;
+ double tic;
+ double tic2;
+ int transparent;
+ int i;
+ int sum;
+ int total;
+ double percentile2;
+ int histogram[1024];
+
+/* identifying Min/Max values */
+ total = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ short gray = *p_in++;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (min > gray)
+ min = gray;
+ if (max < gray)
+ max = gray;
+ total++;
+ }
+ }
+ tic = (double) (max - min) / 1024.0;
+ percentile2 = ((double) total / 100.0) * 2.0;
+
+/* building an histogram */
+ for (i = 0; i < 1024; i++)
+ histogram[i] = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ double gray = (double) (*p_in++ - min) / tic;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 1023.0)
+ gray = 1023.0;
+ histogram[(int) gray] += 1;
+ }
+ }
+ sum = 0;
+ for (i = 0; i < 1024; i++)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ min2 = (double) min + ((double) i * tic);
+ break;
+ }
+ }
+ sum = 0;
+ for (i = 1023; i >= 0; i--)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ max2 = (double) min + ((double) (i + 1) * tic);
+ break;
+ }
+ }
+ tic2 = (double) (max2 - min2) / 254.0;
+
+/* rescaling gray-values 0-255 */
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent)
+ {
+ p_in++;
+ p_out += 4;
+ }
+ else
+ {
+ double gray;
+ short val = *p_in++;
+ if (val <= min2)
+ gray = 0.0;
+ else if (val >= max2)
+ gray = 255.0;
+ else
+ gray = 1.0 + (((double) val - min2) / tic2);
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 255.0)
+ gray = 255.0;
+ *p_out++ = (unsigned char) gray; /* red */
+ *p_out++ = (unsigned char) gray; /* green */
+ *p_out++ = (unsigned char) gray; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+rgba_from_uint16 (unsigned int width, unsigned int height,
+ unsigned short *pixels, unsigned char *mask,
+ unsigned char *rgba)
+{
+/* input: DataGrid UINT16 output: Grayscale */
+ unsigned short *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ unsigned short min = USHRT_MAX;
+ unsigned short max = 0;
+ double min2;
+ double max2;
+ double tic;
+ double tic2;
+ int transparent;
+ int i;
+ int sum;
+ int total;
+ double percentile2;
+ int histogram[1024];
+
+/* identifying Min/Max values */
+ total = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned short gray = *p_in++;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (min > gray)
+ min = gray;
+ if (max < gray)
+ max = gray;
+ total++;
+ }
+ }
+ tic = (double) (max - min) / 1024.0;
+ percentile2 = ((double) total / 100.0) * 2.0;
+
+/* building an histogram */
+ for (i = 0; i < 1024; i++)
+ histogram[i] = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ double gray = (double) (*p_in++ - min) / tic;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 1023.0)
+ gray = 1023.0;
+ histogram[(int) gray] += 1;
+ }
+ }
+ sum = 0;
+ for (i = 0; i < 1024; i++)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ min2 = (double) min + ((double) i * tic);
+ break;
+ }
+ }
+ sum = 0;
+ for (i = 1023; i >= 0; i--)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ max2 = (double) min + ((double) (i + 1) * tic);
+ break;
+ }
+ }
+ tic2 = (double) (max2 - min2) / 254.0;
+
+/* rescaling gray-values 0-255 */
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent)
+ {
+ p_in++;
+ p_out += 4;
+ }
+ else
+ {
+ double gray;
+ unsigned short val = *p_in++;
+ if (val <= min2)
+ gray = 0.0;
+ else if (val >= max2)
+ gray = 255.0;
+ else
+ gray = 1.0 + (((double) val - min2) / tic2);
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 255.0)
+ gray = 255.0;
+ *p_out++ = (unsigned char) gray; /* red */
+ *p_out++ = (unsigned char) gray; /* green */
+ *p_out++ = (unsigned char) gray; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+rgba_from_int32 (unsigned int width, unsigned int height,
+ int *pixels, unsigned char *mask, unsigned char *rgba)
+{
+/* input: DataGrid INT32 output: Grayscale */
+ int *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ int min = INT_MAX;
+ int max = INT_MIN;
+ double min2;
+ double max2;
+ double tic;
+ double tic2;
+ int transparent;
+ int i;
+ int sum;
+ int total;
+ double percentile2;
+ int histogram[1024];
+
+/* identifying Min/Max values */
+ total = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ int gray = *p_in++;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (min > gray)
+ min = gray;
+ if (max < gray)
+ max = gray;
+ total++;
+ }
+ }
+ tic = (double) (max - min) / 1024.0;
+ percentile2 = ((double) total / 100.0) * 2.0;
+
+/* building an histogram */
+ for (i = 0; i < 1024; i++)
+ histogram[i] = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ double gray = (double) (*p_in++ - min) / tic;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 1023.0)
+ gray = 1023.0;
+ histogram[(int) gray] += 1;
+ }
+ }
+ sum = 0;
+ for (i = 0; i < 1024; i++)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ min2 = (double) min + ((double) i * tic);
+ break;
+ }
+ }
+ sum = 0;
+ for (i = 1023; i >= 0; i--)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ max2 = (double) min + ((double) (i + 1) * tic);
+ break;
+ }
+ }
+ tic2 = (double) (max2 - min2) / 254.0;
+
+/* rescaling gray-values 0-255 */
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent)
+ {
+ p_in++;
+ p_out += 4;
+ }
+ else
+ {
+ double gray;
+ int val = *p_in++;
+ if (val <= min2)
+ gray = 0.0;
+ else if (val >= max2)
+ gray = 255.0;
+ else
+ gray = 1.0 + (((double) val - min2) / tic2);
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 255.0)
+ gray = 255.0;
+ *p_out++ = (unsigned char) gray; /* red */
+ *p_out++ = (unsigned char) gray; /* green */
+ *p_out++ = (unsigned char) gray; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+rgba_from_uint32 (unsigned int width, unsigned int height,
+ unsigned int *pixels, unsigned char *mask,
+ unsigned char *rgba)
+{
+/* input: DataGrid UINT32 output: Grayscale */
+ unsigned int *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ unsigned int min = UINT_MAX;
+ unsigned int max = 0;
+ double min2;
+ double max2;
+ double tic;
+ double tic2;
+ int transparent;
+ int i;
+ int sum;
+ int total;
+ double percentile2;
+ int histogram[1024];
+
+/* identifying Min/Max values */
+ total = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned int gray = *p_in++;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (min > gray)
+ min = gray;
+ if (max < gray)
+ max = gray;
+ total++;
+ }
+ }
+ tic = (double) (max - min) / 1024.0;
+ percentile2 = ((double) total / 100.0) * 2.0;
+
+/* building an histogram */
+ for (i = 0; i < 1024; i++)
+ histogram[i] = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ double gray = (double) (*p_in++ - min) / tic;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 1023.0)
+ gray = 1023.0;
+ histogram[(int) gray] += 1;
+ }
+ }
+ sum = 0;
+ for (i = 0; i < 1024; i++)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ min2 = (double) min + ((double) i * tic);
+ break;
+ }
+ }
+ sum = 0;
+ for (i = 1023; i >= 0; i--)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ max2 = (double) min + ((double) (i + 1) * tic);
+ break;
+ }
+ }
+ tic2 = (double) (max2 - min2) / 254.0;
+
+/* rescaling gray-values 0-255 */
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent)
+ {
+ p_in++;
+ p_out += 4;
+ }
+ else
+ {
+ double gray;
+ unsigned int val = *p_in++;
+ if (val <= min2)
+ gray = 0.0;
+ else if (val >= max2)
+ gray = 255.0;
+ else
+ gray = 1.0 + (((double) val - min2) / tic2);
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 255.0)
+ gray = 255.0;
+ *p_out++ = (unsigned char) gray; /* red */
+ *p_out++ = (unsigned char) gray; /* green */
+ *p_out++ = (unsigned char) gray; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+rgba_from_float (unsigned int width, unsigned int height,
+ float *pixels, unsigned char *mask, unsigned char *rgba)
+{
+/* input: DataGrid FLOAT output: Grayscale */
+ float *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ float min = FLT_MAX;
+ float max = 0.0 - FLT_MAX;
+ double min2;
+ double max2;
+ double tic;
+ double tic2;
+ int transparent;
+ int i;
+ int sum;
+ int total;
+ double percentile2;
+ int histogram[1024];
+
+/* identifying Min/Max values */
+ total = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ float gray = *p_in++;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (min > gray)
+ min = gray;
+ if (max < gray)
+ max = gray;
+ total++;
+ }
+ }
+ tic = (double) (max - min) / 1024.0;
+ percentile2 = ((double) total / 100.0) * 2.0;
+
+/* building an histogram */
+ for (i = 0; i < 1024; i++)
+ histogram[i] = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ double gray = (double) (*p_in++ - min) / tic;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 1023.0)
+ gray = 1023.0;
+ histogram[(int) gray] += 1;
+ }
+ }
+ sum = 0;
+ for (i = 0; i < 1024; i++)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ min2 = (double) min + ((double) i * tic);
+ break;
+ }
+ }
+ sum = 0;
+ for (i = 1023; i >= 0; i--)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ max2 = (double) min + ((double) (i + 1) * tic);
+ break;
+ }
+ }
+ tic2 = (double) (max2 - min2) / 254.0;
+
+/* rescaling gray-values 0-255 */
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent)
+ {
+ p_in++;
+ p_out += 4;
+ }
+ else
+ {
+ double gray;
+ float val = *p_in++;
+ if (val <= min2)
+ gray = 0.0;
+ else if (val >= max2)
+ gray = 255.0;
+ else
+ gray = 1.0 + (((double) val - min2) / tic2);
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 255.0)
+ gray = 255.0;
+ *p_out++ = (unsigned char) gray; /* red */
+ *p_out++ = (unsigned char) gray; /* green */
+ *p_out++ = (unsigned char) gray; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+rgba_from_double (unsigned int width, unsigned int height,
+ double *pixels, unsigned char *mask, unsigned char *rgba)
+{
+/* input: DataGrid DOUBLE output: Grayscale */
+ double *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ double min = DBL_MAX;
+ double max = 0.0 - DBL_MAX;
+ double min2;
+ double max2;
+ double tic;
+ double tic2;
+ int transparent;
+ int i;
+ int sum;
+ int total;
+ double percentile2;
+ int histogram[1024];
+
+/* identifying Min/Max values */
+ total = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ double gray = *p_in++;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (min > gray)
+ min = gray;
+ if (max < gray)
+ max = gray;
+ total++;
+ }
+ }
+ tic = (double) (max - min) / 1024.0;
+ percentile2 = ((double) total / 100.0) * 2.0;
+
+/* building an histogram */
+ for (i = 0; i < 1024; i++)
+ histogram[i] = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ double gray = (double) (*p_in++ - min) / tic;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ continue;
+ }
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 1023.0)
+ gray = 1023.0;
+ histogram[(int) gray] += 1;
+ }
+ }
+ sum = 0;
+ for (i = 0; i < 1024; i++)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ min2 = (double) min + ((double) i * tic);
+ break;
+ }
+ }
+ sum = 0;
+ for (i = 1023; i >= 0; i--)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ max2 = (double) min + ((double) (i + 1) * tic);
+ break;
+ }
+ }
+ tic2 = (double) (max2 - min2) / 254.0;
+
+/* rescaling gray-values 0-255 */
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (transparent)
+ {
+ p_in++;
+ p_out += 4;
+ }
+ else
+ {
+ double gray;
+ double val = *p_in++;
+ if (val <= min2)
+ gray = 0.0;
+ else if (val >= max2)
+ gray = 255.0;
+ else
+ gray = 1.0 + (((double) val - min2) / tic2);
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 255.0)
+ gray = 255.0;
+ *p_out++ = (unsigned char) gray; /* red */
+ *p_out++ = (unsigned char) gray; /* green */
+ *p_out++ = (unsigned char) gray; /* blue */
+ *p_out++ = 255; /* opaque */
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+get_rgba_from_datagrid_mask (unsigned int width, unsigned int height,
+ unsigned char sample_type, void *pixels,
+ unsigned char *mask, rl2PrivPixelPtr no_data,
+ unsigned char *rgba)
+{
+/* input: DataGrid output: Grayscale */
+ int ret = 0;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ ret = rgba_from_int8 (width, height, (char *) pixels, mask, rgba);
+ break;
+ case RL2_SAMPLE_UINT8:
+ ret =
+ rgba_from_uint8 (width, height, (unsigned char *) pixels, mask,
+ rgba);
+ break;
+ case RL2_SAMPLE_INT16:
+ ret = rgba_from_int16 (width, height, (short *) pixels, mask, rgba);
+ break;
+ case RL2_SAMPLE_UINT16:
+ ret =
+ rgba_from_uint16 (width, height, (unsigned short *) pixels, mask,
+ rgba);
+ break;
+ case RL2_SAMPLE_INT32:
+ ret = rgba_from_int32 (width, height, (int *) pixels, mask, rgba);
+ break;
+ case RL2_SAMPLE_UINT32:
+ ret =
+ rgba_from_uint32 (width, height, (unsigned int *) pixels, mask,
+ rgba);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ ret = rgba_from_float (width, height, (float *) pixels, mask, rgba);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ ret = rgba_from_double (width, height, (double *) pixels, mask, rgba);
+ break;
+ };
+ return ret;
+}
+
+RL2_PRIVATE int
+get_payload_from_gray_rgba_opaque (unsigned int width, unsigned int height,
+ sqlite3 * handle, double minx, double miny,
+ double maxx, double maxy, int srid,
+ unsigned char *rgb, unsigned char format,
+ int quality, unsigned char **image,
+ int *image_sz)
+{
+/* Grayscale, Opaque */
+ int ret;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *rgba = NULL;
+ unsigned char *gray = malloc (width * height);
+
+ if (gray == NULL)
+ goto error;
+ p_in = rgb;
+ p_out = gray;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ *p_out++ = *p_in++;
+ p_in += 2;
+ }
+ }
+ free (rgb);
+ rgb = NULL;
+ if (format == RL2_OUTPUT_FORMAT_JPEG)
+ {
+ if (rl2_gray_to_jpeg (width, height, gray, quality, image, image_sz)
+ != RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_gray_to_png (width, height, gray, image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_TIFF)
+ {
+ if (srid > 0)
+ {
+ if (rl2_gray_to_geotiff
+ (width, height, handle, minx, miny, maxx, maxy, srid, gray,
+ image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else
+ {
+ if (rl2_gray_to_tiff (width, height, gray, image, image_sz) !=
+ RL2_OK)
+ goto error;
+ }
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PDF)
+ {
+ rgba = gray_to_rgba (width, height, gray);
+ if (rgba == NULL)
+ goto error;
+ ret = rl2_rgba_to_pdf (width, height, rgba, image, image_sz);
+ rgba = NULL;
+ if (ret != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (gray);
+ return 1;
+ error:
+ free (rgb);
+ if (gray != NULL)
+ free (gray);
+ if (rgba != NULL)
+ free (rgba);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_payload_from_gray_rgba_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *rgb,
+ unsigned char *alpha,
+ unsigned char format, int quality,
+ unsigned char **image, int *image_sz,
+ double opacity)
+{
+/* Grayscale, Transparent */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned char *p_alpha;
+ unsigned short row;
+ unsigned short col;
+ unsigned char *gray = malloc (width * height);
+ unsigned char *mask = malloc (width * height);
+
+ if (quality > 100)
+ quality = 100;
+ if (gray == NULL)
+ goto error;
+ if (mask == NULL)
+ goto error;
+ p_in = rgb;
+ p_out = gray;
+ p_msk = mask;
+ p_alpha = alpha;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ *p_out++ = *p_in++;
+ p_in += 2;
+ if (*p_alpha++ >= 128)
+ *p_msk++ = 1; /* Opaque */
+ else
+ *p_msk++ = 0; /* Transparent */
+ }
+ }
+ free (rgb);
+ rgb = NULL;
+ free (alpha);
+ alpha = NULL;
+ if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_gray_alpha_to_png
+ (width, height, gray, mask, image, image_sz, opacity) != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (gray);
+ free (mask);
+ return 1;
+ error:
+ free (rgb);
+ if (gray != NULL)
+ free (gray);
+ if (mask != NULL)
+ free (mask);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_payload_from_rgb_rgba_opaque (unsigned int width, unsigned int height,
+ sqlite3 * handle, double minx, double miny,
+ double maxx, double maxy, int srid,
+ unsigned char *rgb, unsigned char format,
+ int quality, unsigned char **image,
+ int *image_sz)
+{
+/* RGB, Opaque */
+ int ret;
+ unsigned char *rgba = NULL;
+
+ if (format == RL2_OUTPUT_FORMAT_JPEG)
+ {
+ if (rl2_rgb_to_jpeg (width, height, rgb, quality, image, image_sz) !=
+ RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_rgb_to_png (width, height, rgb, image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else if (format == RL2_OUTPUT_FORMAT_TIFF)
+ {
+ if (srid > 0)
+ {
+ if (rl2_rgb_to_geotiff
+ (width, height, handle, minx, miny, maxx, maxy, srid, rgb,
+ image, image_sz) != RL2_OK)
+ goto error;
+ }
+ else
+ {
+ if (rl2_rgb_to_tiff (width, height, rgb, image, image_sz) !=
+ RL2_OK)
+ goto error;
+ }
+ }
+ else if (format == RL2_OUTPUT_FORMAT_PDF)
+ {
+ rgba = rgb_to_rgba (width, height, rgb);
+ if (rgba == NULL)
+ goto error;
+ ret = rl2_rgba_to_pdf (width, height, rgba, image, image_sz);
+ rgba = NULL;
+ if (ret != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (rgb);
+ return 1;
+ error:
+ free (rgb);
+ if (rgba != NULL)
+ free (rgba);
+ return 0;
+}
+
+RL2_PRIVATE int
+get_payload_from_rgb_rgba_transparent (unsigned int width,
+ unsigned int height,
+ unsigned char *rgb, unsigned char *alpha,
+ unsigned char format, int quality,
+ unsigned char **image, int *image_sz,
+ double opacity)
+{
+/* RGB, Transparent */
+ unsigned char *p_msk;
+ unsigned char *p_alpha;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *mask = malloc (width * height);
+
+ if (quality > 100)
+ quality = 100;
+ if (mask == NULL)
+ goto error;
+ p_msk = mask;
+ p_alpha = alpha;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (*p_alpha++ >= 128)
+ *p_msk++ = 1; /* Opaque */
+ else
+ *p_msk++ = 0; /* Transparent */
+ }
+ }
+ free (alpha);
+ alpha = NULL;
+ if (format == RL2_OUTPUT_FORMAT_PNG)
+ {
+ if (rl2_rgb_alpha_to_png
+ (width, height, rgb, mask, image, image_sz, opacity) != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ free (rgb);
+ free (mask);
+ return 1;
+ error:
+ free (rgb);
+ if (mask != NULL)
+ free (mask);
+ return 0;
+}
+
+RL2_PRIVATE int
+build_rgb_alpha (unsigned int width, unsigned int height,
+ unsigned char *rgba, unsigned char **rgb,
+ unsigned char **alpha, unsigned char bg_red,
+ unsigned char bg_green, unsigned char bg_blue)
+{
+/* creating separate RGB and Alpha buffers from RGBA */
+ unsigned int row;
+ unsigned int col;
+ unsigned char *p_in = rgba;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+
+ *rgb = NULL;
+ *alpha = NULL;
+ *rgb = malloc (width * height * 3);
+ if (*rgb == NULL)
+ goto error;
+ *alpha = malloc (width * height);
+ if (*alpha == NULL)
+ goto error;
+
+ p_out = *rgb;
+ p_msk = *alpha;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ unsigned char r = *p_in++;
+ unsigned char g = *p_in++;
+ unsigned char b = *p_in++;
+ unsigned char alpha = *p_in++;
+ *p_out++ = r;
+ *p_out++ = g;
+ *p_out++ = b;
+ if (r == bg_red && g == bg_green && b == bg_blue)
+ alpha = 0;
+ *p_msk++ = alpha;
+ }
+ }
+ return 1;
+
+ error:
+ if (*rgb != NULL)
+ free (*rgb);
+ if (*alpha != NULL)
+ free (*alpha);
+ *rgb = NULL;
+ *alpha = NULL;
+ return 0;
+}
+
+RL2_PRIVATE int
+get_rgba_from_multiband8 (unsigned int width, unsigned int height,
+ unsigned char red_band, unsigned char green_band,
+ unsigned char blue_band, unsigned char num_bands,
+ unsigned char *pixels, unsigned char *mask,
+ rl2PrivPixelPtr no_data, unsigned char *rgba)
+{
+/* input: MULTIBAND UINT8 output: RGB */
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ int transparent;
+
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (!transparent && no_data != NULL)
+ {
+ /* testing for NO-DATA */
+ int match = 0;
+ rl2PrivSamplePtr sample;
+ unsigned char value;
+ if (red_band < no_data->nBands)
+ {
+ sample = no_data->Samples + red_band;
+ value = sample->uint8;
+ if (*(p_in + red_band) == value)
+ match++;
+ }
+ if (green_band < no_data->nBands)
+ {
+ sample = no_data->Samples + green_band;
+ value = sample->uint8;
+ if (*(p_in + green_band) == value)
+ match++;
+ }
+ if (blue_band < no_data->nBands)
+ {
+ sample = no_data->Samples + blue_band;
+ value = sample->uint8;
+ if (*(p_in + blue_band) == value)
+ match++;
+ }
+ if (match == 3)
+ transparent = 1;
+ }
+ if (transparent)
+ {
+ p_out += 4;
+ p_in += num_bands;
+ }
+ else
+ {
+ *p_out++ = *(p_in + red_band); /* red */
+ *p_out++ = *(p_in + green_band); /* green */
+ *p_out++ = *(p_in + blue_band); /* blue */
+ *p_out++ = 255; /* opaque */
+ p_in += num_bands;
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+static int
+test_no_data_16 (rl2PrivPixelPtr no_data, unsigned short *p_in)
+{
+/* testing for NO-DATA */
+ if (no_data != NULL)
+ {
+ unsigned char band;
+ int match = 0;
+ rl2PrivSamplePtr sample;
+ for (band = 0; band < no_data->nBands; band++)
+ {
+ sample = no_data->Samples + band;
+ if (*(p_in + band) == sample->uint16)
+ match++;
+ }
+ if (match == no_data->nBands)
+ return 1;
+ }
+ return 0;
+}
+
+RL2_PRIVATE int
+get_rgba_from_multiband16 (unsigned int width, unsigned int height,
+ unsigned char red_band, unsigned char green_band,
+ unsigned char blue_band, unsigned char num_bands,
+ unsigned short *pixels, unsigned char *mask,
+ rl2PrivPixelPtr no_data, unsigned char *rgba)
+{
+/* input: MULTIBAND UINT16 output: RGB */
+ unsigned short *p_in;
+ unsigned char *p_out;
+ unsigned char *p_msk;
+ unsigned int row;
+ unsigned int col;
+ int transparent;
+ unsigned short min = USHRT_MAX;
+ unsigned short max = 0;
+ double tic;
+ double red_min;
+ double red_max;
+ double red_tic;
+ double green_min;
+ double green_max;
+ double green_tic;
+ double blue_min;
+ double blue_max;
+ double blue_tic;
+ int i;
+ int sum;
+ int total;
+ int band;
+ double percentile2;
+ int histogram[1024];
+
+/* identifying RED Min/Max values */
+ total = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ {
+ p_in += num_bands;
+ continue;
+ }
+ }
+ if (test_no_data_16 (no_data, p_in))
+ {
+ p_in += num_bands;
+ continue;
+ }
+ for (band = 0; band < num_bands; band++)
+ {
+ unsigned short gray = *p_in++;
+ if (band != red_band)
+ continue;
+ if (min > gray)
+ min = gray;
+ if (max < gray)
+ max = gray;
+ total++;
+ }
+ }
+ }
+ tic = (double) (max - min) / 1024.0;
+ percentile2 = ((double) total / 100.0) * 2.0;
+
+/* building the RED histogram */
+ for (i = 0; i < 1024; i++)
+ histogram[i] = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ {
+ p_in += num_bands;
+ continue;
+ }
+ }
+ if (test_no_data_16 (no_data, p_in))
+ {
+ p_in += num_bands;
+ continue;
+ }
+ for (band = 0; band < num_bands; band++)
+ {
+ double gray = (double) (*p_in++ - min) / tic;
+ if (band != red_band)
+ continue;
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 1023.0)
+ gray = 1023.0;
+ histogram[(int) gray] += 1;
+ }
+ }
+ }
+ sum = 0;
+ for (i = 0; i < 1024; i++)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ red_min = (double) min + ((double) i * tic);
+ break;
+ }
+ }
+ sum = 0;
+ for (i = 1023; i >= 0; i--)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ red_max = (double) min + ((double) (i + 1) * tic);
+ break;
+ }
+ }
+ red_tic = (double) (red_max - red_min) / 254.0;
+
+/* identifying GREEN Min/Max values */
+ total = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ {
+ p_in += num_bands;
+ continue;
+ }
+ }
+ if (test_no_data_16 (no_data, p_in))
+ {
+ p_in += num_bands;
+ continue;
+ }
+ for (band = 0; band < num_bands; band++)
+ {
+ unsigned short gray = *p_in++;
+ if (band != green_band)
+ continue;
+ if (min > gray)
+ min = gray;
+ if (max < gray)
+ max = gray;
+ total++;
+ }
+ }
+ }
+ tic = (double) (max - min) / 1024.0;
+ percentile2 = ((double) total / 100.0) * 2.0;
+
+/* building the GREEN histogram */
+ for (i = 0; i < 1024; i++)
+ histogram[i] = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ {
+ p_in += num_bands;
+ continue;
+ }
+ }
+ if (test_no_data_16 (no_data, p_in))
+ {
+ p_in += num_bands;
+ continue;
+ }
+ for (band = 0; band < num_bands; band++)
+ {
+ double gray = (double) (*p_in++ - min) / tic;
+ if (band != green_band)
+ continue;
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 1023.0)
+ gray = 1023.0;
+ histogram[(int) gray] += 1;
+ }
+ }
+ }
+ sum = 0;
+ for (i = 0; i < 1024; i++)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ green_min = (double) min + ((double) i * tic);
+ break;
+ }
+ }
+ sum = 0;
+ for (i = 1023; i >= 0; i--)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ green_max = (double) min + ((double) (i + 1) * tic);
+ break;
+ }
+ }
+ green_tic = (double) (green_max - green_min) / 254.0;
+
+/* identifying BLUE Min/Max values */
+ total = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ {
+ p_in += num_bands;
+ continue;
+ }
+ }
+ if (test_no_data_16 (no_data, p_in))
+ {
+ p_in += num_bands;
+ continue;
+ }
+ for (band = 0; band < num_bands; band++)
+ {
+ unsigned short gray = *p_in++;
+ if (band != blue_band)
+ continue;
+ if (min > gray)
+ min = gray;
+ if (max < gray)
+ max = gray;
+ total++;
+ }
+ }
+ }
+ tic = (double) (max - min) / 1024.0;
+ percentile2 = ((double) total / 100.0) * 2.0;
+
+/* building the BLUE histogram */
+ for (i = 0; i < 1024; i++)
+ histogram[i] = 0;
+ p_in = pixels;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ {
+ p_in += num_bands;
+ continue;
+ }
+ }
+ if (test_no_data_16 (no_data, p_in))
+ {
+ p_in += num_bands;
+ continue;
+ }
+ for (band = 0; band < num_bands; band++)
+ {
+ double gray = (double) (*p_in++ - min) / tic;
+ if (band != blue_band)
+ continue;
+ if (gray < 0.0)
+ gray = 0.0;
+ if (gray > 1023.0)
+ gray = 1023.0;
+ histogram[(int) gray] += 1;
+ }
+ }
+ }
+ sum = 0;
+ for (i = 0; i < 1024; i++)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ blue_min = (double) min + ((double) i * tic);
+ break;
+ }
+ }
+ sum = 0;
+ for (i = 1023; i >= 0; i--)
+ {
+ sum += histogram[i];
+ if (sum >= percentile2)
+ {
+ blue_max = (double) min + ((double) (i + 1) * tic);
+ break;
+ }
+ }
+ blue_tic = (double) (blue_max - blue_min) / 254.0;
+
+/* rescaling RGB-values 0-255 */
+ p_in = pixels;
+ p_out = rgba;
+ p_msk = mask;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ transparent = 0;
+ if (p_msk != NULL)
+ {
+ if (*p_msk++ == 0)
+ transparent = 1;
+ }
+ if (test_no_data_16 (no_data, p_in))
+ transparent = 1;
+ if (transparent)
+ {
+ p_out += 4;
+ p_in += num_bands;
+ }
+ else
+ {
+ double r;
+ double g;
+ double b;
+ unsigned short red = *(p_in + red_band);
+ unsigned short green = *(p_in + green_band);
+ unsigned short blue = *(p_in + blue_band);
+ if (red <= red_min)
+ r = 0.0;
+ else if (red >= red_max)
+ r = 255.0;
+ else
+ r = 1.0 + (((double) red - red_min) / red_tic);
+ if (r < 0.0)
+ r = 0.0;
+ if (r > 255.0)
+ r = 255.0;
+ if (green <= green_min)
+ g = 0.0;
+ else if (green >= green_max)
+ g = 255.0;
+ else
+ g = 1.0 + (((double) green - green_min) / green_tic);
+ if (g < 0.0)
+ g = 0.0;
+ if (g > 255.0)
+ g = 255.0;
+ if (blue <= blue_min)
+ b = 0.0;
+ else if (blue >= blue_max)
+ b = 255.0;
+ else
+ b = 1.0 + (((double) blue - blue_min) / blue_tic);
+ if (b < 0.0)
+ b = 0.0;
+ if (b > 255.0)
+ b = 255.0;
+ *p_out++ = (unsigned char) r; /* red */
+ *p_out++ = (unsigned char) g; /* green */
+ *p_out++ = (unsigned char) b; /* blue */
+ *p_out++ = 255; /* opaque */
+ p_in += num_bands;
+ }
+ }
+ }
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return 1;
+}
+
+RL2_PRIVATE int
+get_raster_band_histogram (rl2PrivBandStatisticsPtr band,
+ unsigned char **image, int *image_sz)
+{
+/* attempting to create an in-memory PNG image representing a Band Histogram */
+ int r;
+ int c;
+ int j;
+ int h;
+ double count = 0.0;
+ double max = 0.0;
+ unsigned short width = 512;
+ unsigned short height = 128 + 32;
+ double scale;
+ unsigned char *raster = malloc (width * height);
+ unsigned char *p = raster;
+ for (r = 0; r < height; r++)
+ {
+ /* priming a WHITE background */
+ for (c = 0; c < width; c++)
+ *p++ = 255;
+ }
+ for (j = 1; j < 256; j++)
+ {
+ /* computing optimal height */
+ double value = *(band->histogram + j);
+ count += value;
+ if (max < value)
+ max = value;
+ }
+ scale = 1.0 / (max / count);
+ for (j = 1; j < 256; j++)
+ {
+ /* drawing the histogram */
+ double freq = *(band->histogram + j);
+ double high = (height - 32.0) * scale * freq / count;
+ r = (j - 1) * 2;
+ for (c = 0, h = height - 32; c < high; c++, h--)
+ {
+ p = raster + (h * width) + r;
+ *p++ = 128;
+ *p = 128;
+ }
+ }
+ for (j = 1; j < 256; j++)
+ {
+ /* drawing the scale-bar */
+ r = (j - 1) * 2;
+ for (c = 0, h = height - 1; c < 25; c++, h--)
+ {
+ p = raster + (h * width) + r;
+ *p++ = j;
+ *p = j;
+ }
+ }
+ if (rl2_data_to_png
+ (raster, NULL, 1.0, NULL, width, height, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_GRAYSCALE, image, image_sz) == RL2_OK)
+ return RL2_OK;
+ free (raster);
+ return RL2_ERROR;
+}
+
+RL2_PRIVATE int
+set_coverage_infos (sqlite3 * sqlite, const char *coverage_name,
+ const char *title, const char *abstract)
+{
+/* auxiliary function: updates the Coverage descriptive infos */
+ int ret;
+ const char *sql;
+ sqlite3_stmt *stmt;
+ int exists = 0;
+ int retval = 0;
+
+ /* checking if the Group already exists */
+ sql = "SELECT coverage_name FROM raster_coverages "
+ "WHERE coverage_name = Lower(?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SetCoverageInfos: \"%s\"\n",
+ sqlite3_errmsg (sqlite));
+ goto stop;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage_name, strlen (coverage_name),
+ SQLITE_STATIC);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ exists = 1;
+ }
+ sqlite3_finalize (stmt);
+
+ if (!exists)
+ return 0;
+ /* update Coverage */
+ sql =
+ "UPDATE raster_coverages SET title = ?, abstract = ? WHERE coverage_name = ?";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SetCoverageInfos: \"%s\"\n",
+ sqlite3_errmsg (sqlite));
+ goto stop;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, title, strlen (title), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, abstract, strlen (abstract), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 3, coverage_name, strlen (coverage_name),
+ SQLITE_STATIC);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ retval = 1;
+ else
+ fprintf (stderr, "SetCoverageInfos() error: \"%s\"\n",
+ sqlite3_errmsg (sqlite));
+ sqlite3_finalize (stmt);
+ return retval;
+ stop:
+ return 0;
+}
+
+RL2_PRIVATE int
+rl2_test_layer_group (sqlite3 * handle, const char *name)
+{
+/* testing for an eventual Layer Group */
+ int ret;
+ char **results;
+ int rows;
+ int columns;
+ int i;
+ int ok = 0;
+/* testing if Layer Group exists */
+ char *sql = sqlite3_mprintf ("SELECT group_name FROM SE_styled_groups "
+ "WHERE Lower(group_name) = Lower(%Q)", name);
+ ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ for (i = 1; i <= rows; i++)
+ ok = 1;
+ sqlite3_free_table (results);
+ return ok;
+}
diff --git a/src/rl2svg.c b/src/rl2svg.c
new file mode 100644
index 0000000..6d5c4e4
--- /dev/null
+++ b/src/rl2svg.c
@@ -0,0 +1,2064 @@
+/*
+
+ rl2svg -- SVG related funcions
+
+ version 0.1, 2014 June 6
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#ifdef __ANDROID__ /* Android specific */
+#include <cairo.h>
+#else /* any other standard platform (Win, Linux, Mac) */
+#include <cairo/cairo.h>
+#endif /* end Android conditionals */
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2svg.h"
+#include "rasterlite2_private.h"
+#include "rl2svg_private.h"
+
+#define svg_PI 3.141592653589793
+
+struct svg_parent_ref
+{
+/* a parent reference (inheritance chain) */
+ rl2PrivSvgGroupPtr parent;
+ struct svg_parent_ref *next;
+};
+
+struct svg_parents
+{
+/* inheritance chain */
+ struct svg_parent_ref *first;
+ struct svg_parent_ref *last;
+};
+
+static void
+svg_free_parents (struct svg_parents *chain)
+{
+/* freeing an inheritance chain */
+ struct svg_parent_ref *pp;
+ struct svg_parent_ref *ppn;
+ pp = chain->first;
+ while (pp)
+ {
+ ppn = pp->next;
+ free (pp);
+ pp = ppn;
+ }
+}
+
+static void
+svg_add_parent (struct svg_parents *chain, rl2PrivSvgGroupPtr parent)
+{
+/* adding an inheritance item into the chain */
+ struct svg_parent_ref *p = malloc (sizeof (struct svg_parent_ref));
+ p->parent = parent;
+ p->next = chain->first;
+/* updating a reverse-ordered linked list */
+ if (chain->last == NULL)
+ chain->last = p;
+ chain->first = p;
+}
+
+static void
+svg_gradient_transformation (cairo_pattern_t * pattern,
+ rl2PrivSvgTransformPtr trans)
+{
+/* applying a single transformation */
+ double angle;
+ double tangent;
+ rl2PrivSvgMatrixPtr mtrx;
+ rl2PrivSvgTranslatePtr translate;
+ rl2PrivSvgScalePtr scale;
+ rl2PrivSvgRotatePtr rotate;
+ rl2PrivSvgSkewPtr skew;
+ cairo_matrix_t matrix;
+ cairo_matrix_t matrix_in;
+
+ if (trans->data == NULL)
+ return;
+ switch (trans->type)
+ {
+ case RL2_SVG_MATRIX:
+ mtrx = trans->data;
+ cairo_pattern_get_matrix (pattern, &matrix);
+ matrix_in.xx = mtrx->a;
+ matrix_in.yx = mtrx->b;
+ matrix_in.xy = mtrx->c;
+ matrix_in.yy = mtrx->d;
+ matrix_in.x0 = mtrx->e;
+ matrix_in.y0 = mtrx->f;
+ cairo_matrix_multiply (&matrix, &matrix, &matrix_in);
+ cairo_matrix_invert (&matrix);
+ cairo_pattern_set_matrix (pattern, &matrix);
+ break;
+ case RL2_SVG_TRANSLATE:
+ translate = trans->data;
+ cairo_pattern_get_matrix (pattern, &matrix);
+ cairo_matrix_translate (&matrix, translate->tx, translate->ty);
+ cairo_matrix_invert (&matrix);
+ cairo_pattern_set_matrix (pattern, &matrix);
+ break;
+ case RL2_SVG_SCALE:
+ scale = trans->data;
+ cairo_pattern_get_matrix (pattern, &matrix);
+ cairo_matrix_scale (&matrix, scale->sx, scale->sy);
+ cairo_matrix_invert (&matrix);
+ cairo_pattern_set_matrix (pattern, &matrix);
+ break;
+ case RL2_SVG_ROTATE:
+ rotate = trans->data;
+ cairo_pattern_get_matrix (pattern, &matrix);
+ angle = rotate->angle * (svg_PI / 180.0);
+ cairo_matrix_translate (&matrix, rotate->cx, rotate->cy);
+ cairo_matrix_rotate (&matrix, angle);
+ cairo_matrix_translate (&matrix, -1.0 * rotate->cx,
+ -1.0 * rotate->cy);
+ cairo_matrix_invert (&matrix);
+ cairo_pattern_set_matrix (pattern, &matrix);
+ break;
+ case RL2_SVG_SKEW_X:
+ skew = trans->data;
+ cairo_pattern_get_matrix (pattern, &matrix);
+ angle = skew->angle * (svg_PI / 180.0);
+ tangent = tan (angle);
+ matrix_in.xx = 1.0;
+ matrix_in.yx = 0.0;
+ matrix_in.xy = tangent;
+ matrix_in.yy = 1.0;
+ matrix_in.x0 = 0.0;
+ matrix_in.y0 = 0.0;
+ cairo_matrix_multiply (&matrix, &matrix_in, &matrix);
+ cairo_matrix_invert (&matrix);
+ cairo_pattern_set_matrix (pattern, &matrix);
+ break;
+ case RL2_SVG_SKEW_Y:
+ skew = trans->data;
+ cairo_pattern_get_matrix (pattern, &matrix);
+ angle = skew->angle * (svg_PI / 180.0);
+ tangent = tan (angle);
+ matrix_in.xx = 1.0;
+ matrix_in.yx = tangent;
+ matrix_in.xy = 0.0;
+ matrix_in.yy = 1.0;
+ matrix_in.x0 = 0.0;
+ matrix_in.y0 = 0.0;
+ cairo_matrix_multiply (&matrix, &matrix_in, &matrix);
+ cairo_matrix_invert (&matrix);
+ cairo_pattern_set_matrix (pattern, &matrix);
+ break;
+ };
+}
+
+static void
+svg_apply_gradient_transformations (cairo_pattern_t * pattern,
+ rl2PrivSvgGradientPtr grad)
+{
+/* applying all Gradient-related transformations */
+ rl2PrivSvgTransformPtr trans = grad->first_trans;
+ while (trans)
+ {
+ svg_gradient_transformation (pattern, trans);
+ trans = trans->next;
+ }
+}
+
+static void
+svg_set_pen (cairo_t * cairo, rl2PrivSvgStylePtr style)
+{
+/* setting up a Pen for Cairo */
+ cairo_pattern_t *pattern;
+ double lengths[4];
+ lengths[0] = 1.0;
+ cairo_set_line_width (cairo, style->stroke_width);
+ if (style->stroke_url != NULL && style->stroke_pointer != NULL)
+ {
+ rl2PrivSvgGradientPtr grad = style->stroke_pointer;
+ rl2PrivSvgGradientStopPtr stop;
+ if (grad->type == RL2_SVG_LINEAR_GRADIENT)
+ {
+ pattern =
+ cairo_pattern_create_linear (grad->x1, grad->y1, grad->x2,
+ grad->y2);
+ svg_apply_gradient_transformations (pattern, grad);
+ stop = grad->first_stop;
+ while (stop)
+ {
+ cairo_pattern_add_color_stop_rgba (pattern, stop->offset,
+ stop->red, stop->green,
+ stop->blue,
+ stop->opacity *
+ style->opacity);
+ stop = stop->next;
+ }
+ cairo_set_source (cairo, pattern);
+ cairo_set_line_cap (cairo, style->stroke_linecap);
+ cairo_set_line_join (cairo, style->stroke_linejoin);
+ cairo_set_miter_limit (cairo, style->stroke_miterlimit);
+ if (style->stroke_dashitems == 0
+ || style->stroke_dasharray == NULL)
+ cairo_set_dash (cairo, lengths, 0, 0.0);
+ else
+ cairo_set_dash (cairo, style->stroke_dasharray,
+ style->stroke_dashitems,
+ style->stroke_dashoffset);
+ cairo_pattern_destroy (pattern);
+ return;
+ }
+ else if (grad->type == RL2_SVG_RADIAL_GRADIENT)
+ {
+ pattern =
+ cairo_pattern_create_radial (grad->cx, grad->cy, 0.0,
+ grad->fx, grad->fy, grad->r);
+ svg_apply_gradient_transformations (pattern, grad);
+ stop = grad->first_stop;
+ while (stop)
+ {
+ cairo_pattern_add_color_stop_rgba (pattern, stop->offset,
+ stop->red, stop->green,
+ stop->blue,
+ stop->opacity *
+ style->opacity);
+ stop = stop->next;
+ }
+ cairo_set_source (cairo, pattern);
+ cairo_set_line_cap (cairo, style->stroke_linecap);
+ cairo_set_line_join (cairo, style->stroke_linejoin);
+ cairo_set_miter_limit (cairo, style->stroke_miterlimit);
+ if (style->stroke_dashitems == 0
+ || style->stroke_dasharray == NULL)
+ cairo_set_dash (cairo, lengths, 0, 0.0);
+ else
+ cairo_set_dash (cairo, style->stroke_dasharray,
+ style->stroke_dashitems,
+ style->stroke_dashoffset);
+ cairo_pattern_destroy (pattern);
+ return;
+ }
+ }
+ cairo_set_source_rgba (cairo, style->stroke_red, style->stroke_green,
+ style->stroke_blue,
+ style->stroke_opacity * style->opacity);
+ cairo_set_line_cap (cairo, style->stroke_linecap);
+ cairo_set_line_join (cairo, style->stroke_linejoin);
+ cairo_set_miter_limit (cairo, style->stroke_miterlimit);
+ if (style->stroke_dashitems == 0 || style->stroke_dasharray == NULL)
+ cairo_set_dash (cairo, lengths, 0, 0.0);
+ else
+ cairo_set_dash (cairo, style->stroke_dasharray, style->stroke_dashitems,
+ style->stroke_dashoffset);
+}
+
+static void
+svg_set_brush (cairo_t * cairo, rl2PrivSvgStylePtr style)
+{
+/* setting up a Brush for Cairo */
+ cairo_pattern_t *pattern;
+ if (style->fill_url != NULL && style->fill_pointer != NULL)
+ {
+ rl2PrivSvgGradientPtr grad = style->fill_pointer;
+ rl2PrivSvgGradientStopPtr stop;
+ if (grad->type == RL2_SVG_LINEAR_GRADIENT)
+ {
+ pattern =
+ cairo_pattern_create_linear (grad->x1, grad->y1, grad->x2,
+ grad->y2);
+ svg_apply_gradient_transformations (pattern, grad);
+ stop = grad->first_stop;
+ while (stop)
+ {
+ cairo_pattern_add_color_stop_rgba (pattern, stop->offset,
+ stop->red, stop->green,
+ stop->blue,
+ stop->opacity *
+ style->opacity);
+ stop = stop->next;
+ }
+ cairo_set_source (cairo, pattern);
+ cairo_pattern_destroy (pattern);
+ return;
+ }
+ else if (grad->type == RL2_SVG_RADIAL_GRADIENT)
+ {
+ pattern =
+ cairo_pattern_create_radial (grad->cx, grad->cy, 0.0,
+ grad->fx, grad->fy, grad->r);
+ svg_apply_gradient_transformations (pattern, grad);
+ stop = grad->first_stop;
+ while (stop)
+ {
+ cairo_pattern_add_color_stop_rgba (pattern, stop->offset,
+ stop->red, stop->green,
+ stop->blue,
+ stop->opacity *
+ style->opacity);
+ stop = stop->next;
+ }
+ cairo_set_source (cairo, pattern);
+ cairo_pattern_destroy (pattern);
+ return;
+ }
+ }
+
+ cairo_set_source_rgba (cairo, style->fill_red, style->fill_green,
+ style->fill_blue,
+ style->fill_opacity * style->opacity);
+ cairo_set_fill_rule (cairo, style->fill_rule);
+}
+
+static void
+svg_draw_rect (cairo_t * cairo, rl2PrivSvgShapePtr shape,
+ rl2PrivSvgStylePtr style)
+{
+/* drawing an SVG Rect */
+ rl2PrivSvgRectPtr rect = shape->data;
+ if (rect->width == 0 || rect->height == 0)
+ return;
+ if (style->visibility == 0)
+ return;
+ if (style->fill == 0 && style->stroke == 0)
+ return;
+
+ if (rect->rx <= 0 || rect->ry <= 0)
+ {
+ /* normal Rect */
+ cairo_rectangle (cairo, rect->x, rect->y, rect->width, rect->height);
+ }
+ else
+ {
+ /* rounded Rect */
+ cairo_new_sub_path (cairo);
+ cairo_save (cairo);
+ cairo_translate (cairo, rect->x + rect->rx, rect->y + rect->ry);
+ cairo_scale (cairo, rect->rx, rect->ry);
+ cairo_arc (cairo, 0.0, 0.0, 1.0, svg_PI, -1 * svg_PI / 2.0);
+ cairo_restore (cairo);
+ cairo_save (cairo);
+ cairo_translate (cairo, rect->x + rect->width - rect->rx,
+ rect->y + rect->ry);
+ cairo_scale (cairo, rect->rx, rect->ry);
+ cairo_arc (cairo, 0.0, 0.0, 1.0, -1 * svg_PI / 2.0, 0.0);
+ cairo_restore (cairo);
+ cairo_save (cairo);
+ cairo_translate (cairo, rect->x + rect->width - rect->rx,
+ rect->y + rect->height - rect->ry);
+ cairo_scale (cairo, rect->rx, rect->ry);
+ cairo_arc (cairo, 0.0, 0.0, 1.0, 0.0, svg_PI / 2.0);
+ cairo_restore (cairo);
+ cairo_save (cairo);
+ cairo_translate (cairo, rect->x + rect->rx,
+ rect->y + rect->height - rect->ry);
+ cairo_scale (cairo, rect->rx, rect->ry);
+ cairo_arc (cairo, 0.0, 0.0, 1.0, svg_PI / 2.0, svg_PI);
+ cairo_restore (cairo);
+ cairo_close_path (cairo);
+ }
+
+/* drawing the Rect */
+ if (style->fill)
+ {
+ /* filling */
+ svg_set_brush (cairo, style);
+ if (style->stroke)
+ cairo_fill_preserve (cairo);
+ else
+ cairo_fill (cairo);
+ }
+ if (style->stroke)
+ {
+ /* stroking */
+ svg_set_pen (cairo, style);
+ cairo_stroke (cairo);
+ }
+}
+
+static void
+svg_clip_rect (cairo_t * cairo, rl2PrivSvgShapePtr shape)
+{
+/* clipping an SVG Rect */
+ rl2PrivSvgRectPtr rect = shape->data;
+ if (rect->width == 0 || rect->height == 0)
+ return;
+
+ if (rect->rx <= 0 || rect->ry <= 0)
+ {
+ /* normal Rect */
+ cairo_rectangle (cairo, rect->x, rect->y, rect->width, rect->height);
+ }
+ else
+ {
+ /* rounded Rect */
+ cairo_new_sub_path (cairo);
+ cairo_save (cairo);
+ cairo_translate (cairo, rect->x + rect->rx, rect->y + rect->ry);
+ cairo_scale (cairo, rect->rx, rect->ry);
+ cairo_arc (cairo, 0.0, 0.0, 1.0, svg_PI, -1 * svg_PI / 2.0);
+ cairo_restore (cairo);
+ cairo_save (cairo);
+ cairo_translate (cairo, rect->x + rect->width - rect->rx,
+ rect->y + rect->ry);
+ cairo_scale (cairo, rect->rx, rect->ry);
+ cairo_arc (cairo, 0.0, 0.0, 1.0, -1 * svg_PI / 2.0, 0.0);
+ cairo_restore (cairo);
+ cairo_save (cairo);
+ cairo_translate (cairo, rect->x + rect->width - rect->rx,
+ rect->y + rect->height - rect->ry);
+ cairo_scale (cairo, rect->rx, rect->ry);
+ cairo_arc (cairo, 0.0, 0.0, 1.0, 0.0, svg_PI / 2.0);
+ cairo_restore (cairo);
+ cairo_save (cairo);
+ cairo_translate (cairo, rect->x + rect->rx,
+ rect->y + rect->height - rect->ry);
+ cairo_scale (cairo, rect->rx, rect->ry);
+ cairo_arc (cairo, 0.0, 0.0, 1.0, svg_PI / 2.0, svg_PI);
+ cairo_restore (cairo);
+ cairo_close_path (cairo);
+ }
+ cairo_clip (cairo);
+}
+
+static void
+svg_draw_circle (cairo_t * cairo, rl2PrivSvgShapePtr shape,
+ rl2PrivSvgStylePtr style)
+{
+/* drawing an SVG Circle */
+ rl2PrivSvgCirclePtr circle = shape->data;
+ if (circle->r <= 0)
+ return;
+ if (style->visibility == 0)
+ return;
+ if (style->fill == 0 && style->stroke == 0)
+ return;
+
+/* drawing the Arc */
+ cairo_arc (cairo, circle->cx, circle->cy, circle->r, 0.0, 2.0 * svg_PI);
+ if (style->fill)
+ {
+ /* filling */
+ svg_set_brush (cairo, style);
+ if (style->stroke)
+ cairo_fill_preserve (cairo);
+ else
+ cairo_fill (cairo);
+ }
+ if (style->stroke)
+ {
+ /* stroking */
+ svg_set_pen (cairo, style);
+ cairo_stroke (cairo);
+ }
+}
+
+static void
+svg_clip_circle (cairo_t * cairo, rl2PrivSvgShapePtr shape)
+{
+/* clipping an SVG Circle */
+ rl2PrivSvgCirclePtr circle = shape->data;
+ if (circle->r <= 0)
+ return;
+
+/* clipping the Arc */
+ cairo_arc (cairo, circle->cx, circle->cy, circle->r, 0.0, 2.0 * svg_PI);
+ cairo_clip (cairo);
+}
+
+static void
+svg_draw_ellipse (cairo_t * cairo, rl2PrivSvgShapePtr shape,
+ rl2PrivSvgStylePtr style)
+{
+/* drawing an SVG Ellipse */
+ rl2PrivSvgEllipsePtr ellipse = shape->data;
+ if (ellipse->rx <= 0 || ellipse->ry <= 0)
+ return;
+ if (style->visibility == 0)
+ return;
+ if (style->fill == 0 && style->stroke == 0)
+ return;
+
+/* drawing the Ellipse */
+ cairo_save (cairo);
+
+ cairo_translate (cairo, ellipse->cx + ellipse->rx / 2.0,
+ ellipse->cy + ellipse->ry / 2.0);
+ cairo_scale (cairo, ellipse->rx / 2.0, ellipse->ry / 2.0);
+ cairo_arc (cairo, 0.0, 0.0, 2.0, 0.0, 2.0 * svg_PI);
+ cairo_restore (cairo);
+ if (style->fill)
+ {
+ /* filling */
+ svg_set_brush (cairo, style);
+ if (style->stroke)
+ cairo_fill_preserve (cairo);
+ else
+ cairo_fill (cairo);
+ }
+ if (style->stroke)
+ {
+ /* stroking */
+ svg_set_pen (cairo, style);
+ cairo_stroke (cairo);
+ }
+}
+
+static void
+svg_clip_ellipse (cairo_t * cairo, rl2PrivSvgShapePtr shape)
+{
+/* clipping an SVG Ellipse */
+ rl2PrivSvgEllipsePtr ellipse = shape->data;
+ if (ellipse->rx <= 0 || ellipse->ry <= 0)
+ return;
+
+/* clipping the Ellipse */
+ cairo_save (cairo);
+
+ cairo_translate (cairo, ellipse->cx + ellipse->rx / 2.0,
+ ellipse->cy + ellipse->ry / 2.0);
+ cairo_scale (cairo, ellipse->rx / 2.0, ellipse->ry / 2.0);
+ cairo_arc (cairo, 0.0, 0.0, 2.0, 0.0, 2.0 * svg_PI);
+ cairo_restore (cairo);
+ cairo_clip (cairo);
+}
+
+static void
+svg_draw_line (cairo_t * cairo, rl2PrivSvgShapePtr shape,
+ rl2PrivSvgStylePtr style)
+{
+/* drawing an SVG Line */
+ rl2PrivSvgLinePtr line = shape->data;
+ if (style->visibility == 0)
+ return;
+ if (style->fill == 0 && style->stroke == 0)
+ return;
+
+/* drawing the Line */
+ cairo_move_to (cairo, line->x1, line->y1);
+ cairo_line_to (cairo, line->x2, line->y2);
+ if (style->fill)
+ {
+ /* filling */
+ svg_set_brush (cairo, style);
+ cairo_fill (cairo);
+ }
+ if (style->stroke)
+ {
+ /* stroking */
+ svg_set_pen (cairo, style);
+ cairo_stroke (cairo);
+ }
+}
+
+static void
+svg_clip_line (cairo_t * cairo, rl2PrivSvgShapePtr shape)
+{
+/* clipping an SVG Line */
+ rl2PrivSvgLinePtr line = shape->data;
+
+/* clipping the Line */
+ cairo_move_to (cairo, line->x1, line->y1);
+ cairo_line_to (cairo, line->x2, line->y2);
+ cairo_clip (cairo);
+}
+
+static void
+svg_draw_polyline (cairo_t * cairo, rl2PrivSvgShapePtr shape,
+ rl2PrivSvgStylePtr style)
+{
+/* drawing an SVG Polyline */
+ int iv;
+ rl2PrivSvgPolylinePtr poly = shape->data;
+ if (poly->points <= 0 || poly->x == NULL || poly->y == NULL)
+ return;
+ if (style->visibility == 0)
+ return;
+ if (style->fill == 0 && style->stroke == 0)
+ return;
+
+/* drawing the Polyline */
+ for (iv = 0; iv < poly->points; iv++)
+ {
+ if (iv == 0)
+ cairo_move_to (cairo, *(poly->x + iv), *(poly->y + iv));
+ else
+ cairo_line_to (cairo, *(poly->x + iv), *(poly->y + iv));
+ }
+ if (style->fill)
+ {
+ /* filling */
+ svg_set_brush (cairo, style);
+ if (style->stroke)
+ cairo_fill_preserve (cairo);
+ else
+ cairo_fill (cairo);
+ }
+ if (style->stroke)
+ {
+ /* stroking */
+ svg_set_pen (cairo, style);
+ cairo_stroke (cairo);
+ }
+}
+
+static void
+svg_clip_polyline (cairo_t * cairo, rl2PrivSvgShapePtr shape)
+{
+/* clipping an SVG Polyline */
+ int iv;
+ rl2PrivSvgPolylinePtr poly = shape->data;
+ if (poly->points <= 0 || poly->x == NULL || poly->y == NULL)
+ return;
+
+/* clipping the Polyline */
+ for (iv = 0; iv < poly->points; iv++)
+ {
+ if (iv == 0)
+ cairo_move_to (cairo, *(poly->x + iv), *(poly->y + iv));
+ else
+ cairo_line_to (cairo, *(poly->x + iv), *(poly->y + iv));
+ }
+ cairo_clip (cairo);
+}
+
+static void
+svg_draw_polygon (cairo_t * cairo, rl2PrivSvgShapePtr shape,
+ rl2PrivSvgStylePtr style)
+{
+/* drawing an SVG Polygon */
+ int iv;
+ rl2PrivSvgPolygonPtr poly = shape->data;
+ if (poly->points <= 0 || poly->x == NULL || poly->y == NULL)
+ return;
+ if (style->visibility == 0)
+ return;
+ if (style->fill == 0 && style->stroke == 0)
+ return;
+
+/* drawing the Polygon */
+ for (iv = 0; iv < poly->points; iv++)
+ {
+ if (iv == 0)
+ cairo_move_to (cairo, *(poly->x + iv), *(poly->y + iv));
+ else
+ cairo_line_to (cairo, *(poly->x + iv), *(poly->y + iv));
+ }
+ cairo_close_path (cairo);
+ if (style->fill)
+ {
+ /* filling */
+ svg_set_brush (cairo, style);
+ if (style->stroke)
+ cairo_fill_preserve (cairo);
+ else
+ cairo_fill (cairo);
+ }
+ if (style->stroke)
+ {
+ /* stroking */
+ svg_set_pen (cairo, style);
+ cairo_stroke (cairo);
+ }
+}
+
+static void
+svg_clip_polygon (cairo_t * cairo, rl2PrivSvgShapePtr shape)
+{
+/* clipping an SVG Polygon */
+ int iv;
+ rl2PrivSvgPolygonPtr poly = shape->data;
+ if (poly->points <= 0 || poly->x == NULL || poly->y == NULL)
+ return;
+
+/* clipping the Polygon */
+ for (iv = 0; iv < poly->points; iv++)
+ {
+ if (iv == 0)
+ cairo_move_to (cairo, *(poly->x + iv), *(poly->y + iv));
+ else
+ cairo_line_to (cairo, *(poly->x + iv), *(poly->y + iv));
+ }
+ cairo_close_path (cairo);
+ cairo_clip (cairo);
+}
+
+static void
+svg_rotate (double x, double y, double angle, double *rx, double *ry)
+{
+/* rotate a point of an angle around the origin point */
+ *rx = x * cos (angle) - y * sin (angle);
+ *ry = y * cos (angle) + x * sin (angle);
+}
+
+static double
+svg_point_angle (double cx, double cy, double px, double py)
+{
+/* return angle between x axis and point knowing given center */
+ return atan2 (py - cy, px - cx);
+}
+
+static void
+svg_arc_to_cairo (rl2PrivSvgPathEllipticArcPtr arc, double x1, double y1,
+ double *xc, double *yc, double *rx, double *rotation,
+ double *radii_ratio, double *angle1, double *angle2)
+{
+/*
+/ computing the arguments for CairoArc starting from an SVG Elliptic Arc
+/ (simply a C translation of pyCairo Python code)
+*/
+ double x3;
+ double y3;
+ double ry;
+ double xe;
+ double ye;
+ double angle;
+/* converting absolute x3 and y3 to relative */
+ x3 = arc->x - x1;
+ y3 = arc->y - y1;
+ *rx = arc->rx;
+ ry = arc->ry;
+ *radii_ratio = ry / *rx;
+ *rotation = arc->rotation * (svg_PI / 180.0);
+/* cancel the rotation of the second point */
+ svg_rotate (x3, y3, *rotation * -1, &xe, &ye);
+ ye /= *radii_ratio;
+/* find the angle between the second point and the x axis */
+ angle = svg_point_angle (0.0, 0.0, xe, ye);
+/* put the second point onto the x axis */
+ xe = sqrt ((xe * xe) + (ye * ye));
+ ye = 0.0;
+/* update the x radius if it is too small */
+ if (*rx < xe / 2.0)
+ *rx = xe / 2.0;
+/* find one circle centre */
+ *xc = xe / 2.0;
+ *yc = sqrt ((*rx * *rx) - (*xc * *xc));
+/* choose between the two circles according to flags */
+ if ((arc->large_arc ^ arc->sweep) == 0)
+ *yc = *yc * -1.0;
+/* put the second point and the center back to their positions */
+ svg_rotate (xe, ye, angle, &xe, &ye);
+ svg_rotate (*xc, *yc, angle, xc, yc);
+/* find the drawing angles */
+ *angle1 = svg_point_angle (*xc, *yc, 0.0, 0.0);
+ *angle2 = svg_point_angle (*xc, *yc, xe, ye);
+}
+
+static void
+svg_draw_path (cairo_t * cairo, rl2PrivSvgShapePtr shape,
+ rl2PrivSvgStylePtr style)
+{
+/* drawing an SVG Path */
+ rl2PrivSvgPathItemPtr item;
+ rl2PrivSvgPathPtr path = shape->data;
+ rl2PrivSvgPathMovePtr move;
+ rl2PrivSvgPathBezierPtr bezier;
+ rl2PrivSvgPathEllipticArcPtr arc;
+ double x;
+ double y;
+ double x0;
+ double y0;
+ double radii_ratio;
+ double xc;
+ double yc;
+ double rx;
+ double rotation;
+ double angle1;
+ double angle2;
+ int is_new_path = 0;
+ if (path->error)
+ return;
+ if (style->visibility == 0)
+ return;
+ if (style->fill == 0 && style->stroke == 0)
+ return;
+
+/* drawing the Path */
+ item = path->first;
+ while (item)
+ {
+ if (is_new_path && item->type != RL2_SVG_MOVE_TO)
+ {
+ /* implicit MoveTO */
+ cairo_get_current_point (cairo, &x, &y);
+ cairo_move_to (cairo, x, y);
+ }
+ is_new_path = 0;
+ switch (item->type)
+ {
+ case RL2_SVG_CLOSE_PATH:
+ cairo_close_path (cairo);
+ is_new_path = 1;
+ break;
+ case RL2_SVG_MOVE_TO:
+ move = item->data;
+ cairo_move_to (cairo, move->x, move->y);
+ break;
+ case RL2_SVG_LINE_TO:
+ move = item->data;
+ cairo_line_to (cairo, move->x, move->y);
+ break;
+ case RL2_SVG_CURVE_3:
+ bezier = item->data;
+ cairo_curve_to (cairo, bezier->x1, bezier->y1, bezier->x2,
+ bezier->y2, bezier->x, bezier->y);
+ break;
+ case RL2_SVG_CURVE_4:
+ bezier = item->data;
+ cairo_get_current_point (cairo, &x0, &y0);
+ cairo_curve_to (cairo, 2.0 / 3.0 * bezier->x1 + 1.0 / 3.0 * x0,
+ 2.0 / 3.0 * bezier->y1 + 1.0 / 3.0 * y0,
+ 2.0 / 3.0 * bezier->x1 + 1.0 / 3.0 * bezier->x2,
+ 2.0 / 3.0 * bezier->y1 + 1.0 / 3.0 * bezier->y2,
+ bezier->y1, bezier->y2);
+ break;
+ case RL2_SVG_ELLIPT_ARC:
+ arc = item->data;
+ cairo_get_current_point (cairo, &x0, &y0);
+ svg_arc_to_cairo (arc, x0, y0, &xc, &yc, &rx, &rotation,
+ &radii_ratio, &angle1, &angle2);
+ cairo_save (cairo);
+ cairo_translate (cairo, x0, y0);
+ cairo_rotate (cairo, rotation);
+ cairo_scale (cairo, 1.0, radii_ratio);
+ if (arc->sweep == 0)
+ cairo_arc_negative (cairo, xc, yc, rx, angle1, angle2);
+ else
+ cairo_arc (cairo, xc, yc, rx, angle1, angle2);
+ cairo_restore (cairo);
+ break;
+ };
+ item = item->next;
+ }
+ if (style->fill)
+ {
+ /* filling */
+ svg_set_brush (cairo, style);
+ if (style->stroke)
+ cairo_fill_preserve (cairo);
+ else
+ cairo_fill (cairo);
+ }
+ if (style->stroke)
+ {
+ /* stroking */
+ svg_set_pen (cairo, style);
+ cairo_stroke (cairo);
+ }
+}
+
+static void
+svg_clip_path (cairo_t * cairo, rl2PrivSvgShapePtr shape)
+{
+/* clipping an SVG Path */
+ rl2PrivSvgPathItemPtr item;
+ rl2PrivSvgPathPtr path = shape->data;
+ rl2PrivSvgPathMovePtr move;
+ rl2PrivSvgPathBezierPtr bezier;
+ rl2PrivSvgPathEllipticArcPtr arc;
+ double x;
+ double y;
+ double x0;
+ double y0;
+ double radii_ratio;
+ double xc;
+ double yc;
+ double rx;
+ double rotation;
+ double angle1;
+ double angle2;
+ int is_new_path = 0;
+ if (path->error)
+ return;
+/* clipping the Path */
+ item = path->first;
+ while (item)
+ {
+ if (is_new_path && item->type != RL2_SVG_MOVE_TO)
+ {
+ /* implicit MoveTO */
+ cairo_get_current_point (cairo, &x, &y);
+ cairo_move_to (cairo, x, y);
+ }
+ is_new_path = 0;
+ switch (item->type)
+ {
+ case RL2_SVG_CLOSE_PATH:
+ cairo_close_path (cairo);
+ is_new_path = 1;
+ break;
+ case RL2_SVG_MOVE_TO:
+ move = item->data;
+ cairo_move_to (cairo, move->x, move->y);
+ break;
+ case RL2_SVG_LINE_TO:
+ move = item->data;
+ cairo_line_to (cairo, move->x, move->y);
+ break;
+ case RL2_SVG_CURVE_3:
+ bezier = item->data;
+ cairo_curve_to (cairo, bezier->x1, bezier->y1, bezier->x2,
+ bezier->y2, bezier->x, bezier->y);
+ break;
+ case RL2_SVG_CURVE_4:
+ bezier = item->data;
+ cairo_get_current_point (cairo, &x0, &y0);
+ cairo_curve_to (cairo, 2.0 / 3.0 * bezier->x1 + 1.0 / 3.0 * x0,
+ 2.0 / 3.0 * bezier->y1 + 1.0 / 3.0 * y0,
+ 2.0 / 3.0 * bezier->x1 + 1.0 / 3.0 * bezier->x2,
+ 2.0 / 3.0 * bezier->y1 + 1.0 / 3.0 * bezier->y2,
+ bezier->y1, bezier->y2);
+ break;
+ case RL2_SVG_ELLIPT_ARC:
+ arc = item->data;
+ cairo_get_current_point (cairo, &x0, &y0);
+ svg_arc_to_cairo (arc, x0, y0, &xc, &yc, &rx, &rotation,
+ &radii_ratio, &angle1, &angle2);
+ cairo_save (cairo);
+ cairo_translate (cairo, x0, y0);
+ cairo_rotate (cairo, rotation);
+ cairo_scale (cairo, 1.0, radii_ratio);
+ if (arc->sweep == 0)
+ cairo_arc_negative (cairo, xc, yc, rx, angle1, angle2);
+ else
+ cairo_arc (cairo, xc, yc, rx, angle1, angle2);
+ cairo_restore (cairo);
+ break;
+ };
+ item = item->next;
+ }
+ cairo_clip (cairo);
+}
+
+static void
+svg_draw_shape (cairo_t * cairo, rl2PrivSvgShapePtr shape,
+ rl2PrivSvgStylePtr style)
+{
+/* drawing an SVG Shape */
+ if (shape->style.visibility == 0)
+ return;
+ switch (shape->type)
+ {
+ case RL2_SVG_RECT:
+ svg_draw_rect (cairo, shape, style);
+ break;
+ case RL2_SVG_CIRCLE:
+ svg_draw_circle (cairo, shape, style);
+ break;
+ case RL2_SVG_ELLIPSE:
+ svg_draw_ellipse (cairo, shape, style);
+ break;
+ case RL2_SVG_LINE:
+ svg_draw_line (cairo, shape, style);
+ break;
+ case RL2_SVG_POLYLINE:
+ svg_draw_polyline (cairo, shape, style);
+ break;
+ case RL2_SVG_POLYGON:
+ svg_draw_polygon (cairo, shape, style);
+ break;
+ case RL2_SVG_PATH:
+ svg_draw_path (cairo, shape, style);
+ break;
+ };
+}
+
+static void
+svg_transformation (cairo_t * cairo, rl2PrivSvgTransformPtr trans)
+{
+/* applying a single transformation */
+ double angle;
+ double tangent;
+ rl2PrivSvgMatrixPtr mtrx;
+ rl2PrivSvgTranslatePtr translate;
+ rl2PrivSvgScalePtr scale;
+ rl2PrivSvgRotatePtr rotate;
+ rl2PrivSvgSkewPtr skew;
+ cairo_matrix_t matrix;
+ cairo_matrix_t matrix_in;
+
+ if (trans->data == NULL)
+ return;
+ switch (trans->type)
+ {
+ case RL2_SVG_MATRIX:
+ mtrx = trans->data;
+ cairo_get_matrix (cairo, &matrix);
+ matrix_in.xx = mtrx->a;
+ matrix_in.yx = mtrx->b;
+ matrix_in.xy = mtrx->c;
+ matrix_in.yy = mtrx->d;
+ matrix_in.x0 = mtrx->e;
+ matrix_in.y0 = mtrx->f;
+ cairo_matrix_multiply (&matrix, &matrix_in, &matrix);
+ cairo_set_matrix (cairo, &matrix);
+ break;
+ case RL2_SVG_TRANSLATE:
+ translate = trans->data;
+ cairo_get_matrix (cairo, &matrix);
+ cairo_matrix_translate (&matrix, translate->tx, translate->ty);
+ cairo_set_matrix (cairo, &matrix);
+ break;
+ case RL2_SVG_SCALE:
+ scale = trans->data;
+ cairo_get_matrix (cairo, &matrix);
+ cairo_matrix_scale (&matrix, scale->sx, scale->sy);
+ cairo_set_matrix (cairo, &matrix);
+ break;
+ case RL2_SVG_ROTATE:
+ rotate = trans->data;
+ cairo_get_matrix (cairo, &matrix);
+ angle = rotate->angle * (svg_PI / 180.0);
+ cairo_matrix_translate (&matrix, rotate->cx, rotate->cy);
+ cairo_matrix_rotate (&matrix, angle);
+ cairo_matrix_translate (&matrix, -1.0 * rotate->cx,
+ -1.0 * rotate->cy);
+ cairo_set_matrix (cairo, &matrix);
+ break;
+ case RL2_SVG_SKEW_X:
+ skew = trans->data;
+ cairo_get_matrix (cairo, &matrix);
+ angle = skew->angle * (svg_PI / 180.0);
+ tangent = tan (angle);
+ matrix_in.xx = 1.0;
+ matrix_in.yx = 0.0;
+ matrix_in.xy = tangent;
+ matrix_in.yy = 1.0;
+ matrix_in.x0 = 0.0;
+ matrix_in.y0 = 0.0;
+ cairo_matrix_multiply (&matrix, &matrix_in, &matrix);
+ cairo_set_matrix (cairo, &matrix);
+ break;
+ case RL2_SVG_SKEW_Y:
+ skew = trans->data;
+ cairo_get_matrix (cairo, &matrix);
+ angle = skew->angle * (svg_PI / 180.0);
+ tangent = tan (angle);
+ matrix_in.xx = 1.0;
+ matrix_in.yx = tangent;
+ matrix_in.xy = 0.0;
+ matrix_in.yy = 1.0;
+ matrix_in.x0 = 0.0;
+ matrix_in.y0 = 0.0;
+ cairo_matrix_multiply (&matrix, &matrix_in, &matrix);
+ cairo_set_matrix (cairo, &matrix);
+ break;
+ };
+}
+
+static void
+svg_apply_transformations (cairo_t * cairo, rl2PrivSvgDocumentPtr svg_doc,
+ rl2PrivSvgShapePtr shape)
+{
+/* applying the whole transformations chain (supporting inheritance) */
+ rl2PrivSvgGroupPtr parent;
+ struct svg_parents chain;
+ struct svg_parent_ref *ref;
+ rl2PrivSvgGroupPtr group;
+ rl2PrivSvgTransformPtr trans;
+ cairo_matrix_t matrix;
+
+/* initializing the chain as empty */
+ chain.first = NULL;
+ chain.last = NULL;
+
+ parent = shape->parent;
+ if (parent != NULL)
+ {
+ /* identifying all direct parents in reverse order */
+ while (parent)
+ {
+ svg_add_parent (&chain, parent);
+ parent = parent->parent;
+ }
+ }
+
+/* starting from the SVG Document basic transformations */
+ matrix.xx = svg_doc->matrix.xx;
+ matrix.yx = svg_doc->matrix.yx;
+ matrix.xy = svg_doc->matrix.xy;
+ matrix.yy = svg_doc->matrix.yy;
+ matrix.x0 = svg_doc->matrix.x0;
+ matrix.y0 = svg_doc->matrix.y0;
+ cairo_set_matrix (cairo, &matrix);
+
+ ref = chain.first;
+ while (ref)
+ {
+ /* chaining all transformations inherited by ancestors */
+ group = ref->parent;
+ if (group != NULL)
+ {
+ trans = group->first_trans;
+ while (trans)
+ {
+ svg_transformation (cairo, trans);
+ trans = trans->next;
+ }
+ }
+ ref = ref->next;
+ }
+
+/* applying Shape specific transformations */
+ trans = shape->first_trans;
+ while (trans)
+ {
+ svg_transformation (cairo, trans);
+ trans = trans->next;
+ }
+
+ svg_free_parents (&chain);
+}
+
+static void
+svg_apply_style (rl2PrivSvgShapePtr shape, rl2PrivSvgStylePtr style)
+{
+/* applying the final style (supporting inheritance) */
+ rl2PrivSvgGroupPtr parent;
+ struct svg_parents chain;
+ struct svg_parent_ref *ref;
+ rl2PrivSvgGroupPtr group;
+
+/* initializing the chain as empty */
+ chain.first = NULL;
+ chain.last = NULL;
+
+ parent = shape->parent;
+ if (parent != NULL)
+ {
+ /* identifying all parents in reverse order */
+ while (parent)
+ {
+ svg_add_parent (&chain, parent);
+ parent = parent->parent;
+ }
+ }
+
+ ref = chain.first;
+ while (ref)
+ {
+ /* chaining all style definitions inherited by ancestors */
+ group = ref->parent;
+ if (group != NULL)
+ {
+ if (group->style.visibility >= 0)
+ style->visibility = group->style.visibility;
+ style->opacity = group->style.opacity;
+ if (group->style.fill >= 0)
+ style->fill = group->style.fill;
+ if (group->style.no_fill)
+ style->no_fill = group->style.no_fill;
+ if (group->style.fill_rule >= 0)
+ style->fill_rule = group->style.fill_rule;
+ if (group->style.fill_url != NULL)
+ svg_add_fill_gradient_url (style, group->style.fill_url);
+ if (group->style.fill_red >= 0.0)
+ style->fill_red = group->style.fill_red;
+ if (group->style.fill_green >= 0.0)
+ style->fill_green = group->style.fill_green;
+ if (group->style.fill_blue >= 0.0)
+ style->fill_blue = group->style.fill_blue;
+ if (group->style.fill_opacity >= 0.0)
+ style->fill_opacity = group->style.fill_opacity;
+ if (group->style.stroke >= 0)
+ style->stroke = group->style.stroke;
+ if (group->style.no_stroke >= 0)
+ style->no_stroke = group->style.no_stroke;
+ if (group->style.stroke_width >= 0.0)
+ style->stroke_width = group->style.stroke_width;
+ if (group->style.stroke_linecap >= 0)
+ style->stroke_linecap = group->style.stroke_linecap;
+ if (group->style.stroke_linejoin >= 0)
+ style->stroke_linejoin = group->style.stroke_linejoin;
+ if (group->style.stroke_miterlimit >= 0.0)
+ style->stroke_miterlimit = group->style.stroke_miterlimit;
+ if (group->style.stroke_dashitems > 0)
+ {
+ style->stroke_dashitems = group->style.stroke_dashitems;
+ if (style->stroke_dasharray != NULL)
+ free (style->stroke_dasharray);
+ style->stroke_dasharray = NULL;
+ if (group->style.stroke_dashitems > 0)
+ {
+ int i;
+ style->stroke_dasharray =
+ malloc (sizeof (double) *
+ group->style.stroke_dashitems);
+ for (i = 0; i < group->style.stroke_dashitems; i++)
+ style->stroke_dasharray[i] =
+ group->style.stroke_dasharray[i];
+ }
+ style->stroke_dashoffset = group->style.stroke_dashoffset;
+ }
+ if (group->style.stroke_url != NULL)
+ svg_add_stroke_gradient_url (style,
+ group->style.stroke_url);
+ if (group->style.stroke_red >= 0.0)
+ style->stroke_red = group->style.stroke_red;
+ if (group->style.stroke_green >= 0.0)
+ style->stroke_green = group->style.stroke_green;
+ if (group->style.stroke_blue >= 0.0)
+ style->stroke_blue = group->style.stroke_blue;
+ if (group->style.stroke_opacity >= 0.0)
+ style->stroke_opacity = group->style.stroke_opacity;
+ if (group->style.clip_url != NULL)
+ {
+ svg_add_clip_url (style, group->style.clip_url);
+ style->clip_pointer = group->style.clip_pointer;
+ }
+ }
+ ref = ref->next;
+ }
+
+/* applying Shape specific style definitions */
+ if (shape->style.visibility >= 0)
+ style->visibility = shape->style.visibility;
+ style->opacity = shape->style.opacity;
+ if (shape->style.fill >= 0)
+ style->fill = shape->style.fill;
+ if (shape->style.no_fill >= 0)
+ style->no_fill = shape->style.no_fill;
+ if (shape->style.fill_rule >= 0)
+ style->fill_rule = shape->style.fill_rule;
+ if (shape->style.fill_url != NULL)
+ svg_add_fill_gradient_url (style, shape->style.fill_url);
+ if (shape->style.fill_red >= 0.0)
+ style->fill_red = shape->style.fill_red;
+ if (shape->style.fill_green >= 0.0)
+ style->fill_green = shape->style.fill_green;
+ if (shape->style.fill_blue >= 0.0)
+ style->fill_blue = shape->style.fill_blue;
+ if (shape->style.fill_opacity >= 0.0)
+ style->fill_opacity = shape->style.fill_opacity;
+ if (shape->style.stroke >= 0)
+ style->stroke = shape->style.stroke;
+ if (shape->style.no_stroke >= 0)
+ style->no_stroke = shape->style.no_stroke;
+ if (shape->style.stroke_width >= 0.0)
+ style->stroke_width = shape->style.stroke_width;
+ if (shape->style.stroke_linecap >= 0)
+ style->stroke_linecap = shape->style.stroke_linecap;
+ if (shape->style.stroke_linejoin >= 0)
+ style->stroke_linejoin = shape->style.stroke_linejoin;
+ if (shape->style.stroke_miterlimit >= 0.0)
+ style->stroke_miterlimit = shape->style.stroke_miterlimit;
+ if (shape->style.stroke_dashitems > 0)
+ {
+ style->stroke_dashitems = shape->style.stroke_dashitems;
+ if (style->stroke_dasharray != NULL)
+ free (style->stroke_dasharray);
+ style->stroke_dasharray = NULL;
+ if (shape->style.stroke_dashitems > 0)
+ {
+ int i;
+ style->stroke_dasharray =
+ malloc (sizeof (double) * shape->style.stroke_dashitems);
+ for (i = 0; i < shape->style.stroke_dashitems; i++)
+ style->stroke_dasharray[i] =
+ shape->style.stroke_dasharray[i];
+ }
+ style->stroke_dashoffset = shape->style.stroke_dashoffset;
+ }
+ if (shape->style.stroke_url != NULL)
+ svg_add_stroke_gradient_url (style, shape->style.stroke_url);
+ if (shape->style.stroke_red >= 0.0)
+ style->stroke_red = shape->style.stroke_red;
+ if (shape->style.stroke_green >= 0.0)
+ style->stroke_green = shape->style.stroke_green;
+ if (shape->style.stroke_blue >= 0.0)
+ style->stroke_blue = shape->style.stroke_blue;
+ if (shape->style.stroke_opacity >= 0.0)
+ style->stroke_opacity = shape->style.stroke_opacity;
+ if (shape->style.clip_url != NULL)
+ {
+ svg_add_clip_url (style, shape->style.clip_url);
+ style->clip_pointer = shape->style.clip_pointer;
+ }
+/* final adjustements */
+ if (style->fill < 0)
+ style->fill = 1;
+ if (style->stroke < 0)
+ style->stroke = 1;
+ if (style->no_fill < 0)
+ style->no_fill = 0;
+ if (style->no_stroke < 0)
+ style->no_stroke = 0;
+ if (style->fill_red < 0.0 && style->fill_green < 0.0
+ && style->fill_blue < 0.0 && style->fill_url == NULL)
+ style->no_fill = 1;
+ if (style->stroke_red < 0.0 && style->stroke_green < 0.0
+ && style->stroke_blue < 0.0 && style->stroke_url == NULL)
+ style->no_stroke = 1;
+ if (style->no_fill)
+ style->fill = 0;
+ if (style->no_stroke)
+ style->stroke = 0;
+ if (style->fill)
+ {
+ if (style->fill_rule < 0)
+ style->fill_rule = CAIRO_FILL_RULE_WINDING;
+ if (style->fill_red < 0.0 || style->fill_red > 1.0)
+ style->fill_red = 0.0;
+ if (style->fill_green < 0.0 || style->fill_green > 1.0)
+ style->fill_green = 0.0;
+ if (style->fill_blue < 0.0 || style->fill_blue > 1.0)
+ style->fill_blue = 0.0;
+ if (style->fill_opacity < 0.0 || style->fill_opacity > 1.0)
+ style->fill_opacity = 1.0;
+ }
+ if (style->stroke)
+ {
+ if (style->stroke_width <= 0.0)
+ style->stroke_width = 1.0;
+ if (style->stroke_linecap < 0)
+ style->stroke_linecap = CAIRO_LINE_CAP_BUTT;
+ if (style->stroke_linejoin < 0)
+ style->stroke_linejoin = CAIRO_LINE_JOIN_MITER;
+ if (style->stroke_miterlimit < 0)
+ style->stroke_miterlimit = 4.0;
+ if (style->stroke_red < 0.0 || style->stroke_red > 1.0)
+ style->stroke_red = 0.0;
+ if (style->stroke_green < 0.0 || style->stroke_green > 1.0)
+ style->stroke_green = 0.0;
+ if (style->stroke_blue < 0.0 || style->stroke_blue > 1.0)
+ style->stroke_blue = 0.0;
+ if (style->stroke_opacity < 0.0 || style->stroke_opacity > 1.0)
+ style->stroke_opacity = 1.0;
+ }
+ svg_free_parents (&chain);
+}
+
+static void
+svg_resolve_fill_url (rl2PrivSvgDocumentPtr svg_doc, rl2PrivSvgStylePtr style)
+{
+/* attempting to resolve a FillGradient by URL */
+ rl2PrivSvgGradientPtr gradient = svg_doc->first_grad;
+ while (gradient)
+ {
+ if (gradient->id != NULL)
+ {
+ if (strcmp (style->fill_url, gradient->id) == 0)
+ {
+ style->fill_pointer = gradient;
+ return;
+ }
+ }
+ gradient = gradient->next;
+ }
+ style->fill_pointer = NULL;
+ style->fill = 0;
+}
+
+static void
+svg_resolve_stroke_url (rl2PrivSvgDocumentPtr svg_doc, rl2PrivSvgStylePtr style)
+{
+/* attempting to resolve a StrokeGradient by URL */
+ rl2PrivSvgGradientPtr gradient = svg_doc->first_grad;
+ while (gradient)
+ {
+ if (gradient->id != NULL)
+ {
+ if (strcmp (style->stroke_url, gradient->id) == 0)
+ {
+ style->stroke_pointer = gradient;
+ return;
+ }
+ }
+ gradient = gradient->next;
+ }
+ style->stroke_pointer = NULL;
+ style->stroke = 0;
+}
+
+static void
+svg_apply_clip2 (cairo_t * cairo, rl2PrivSvgItemPtr clip_path)
+{
+/* attempting to apply a ClipPath - actuation */
+ rl2PrivSvgGroupPtr group;
+ rl2PrivSvgShapePtr shape;
+ rl2PrivSvgClipPtr clip;
+ rl2PrivSvgItemPtr item = clip_path;
+ while (item)
+ {
+ /* looping on Items */
+ if (item->type == RL2_SVG_ITEM_SHAPE && item->pointer != NULL)
+ {
+ shape = item->pointer;
+ switch (shape->type)
+ {
+ case RL2_SVG_RECT:
+ svg_clip_rect (cairo, shape);
+ break;
+ case RL2_SVG_CIRCLE:
+ svg_clip_circle (cairo, shape);
+ break;
+ case RL2_SVG_ELLIPSE:
+ svg_clip_ellipse (cairo, shape);
+ break;
+ case RL2_SVG_LINE:
+ svg_clip_line (cairo, shape);
+ break;
+ case RL2_SVG_POLYLINE:
+ svg_clip_polyline (cairo, shape);
+ break;
+ case RL2_SVG_POLYGON:
+ svg_clip_polygon (cairo, shape);
+ break;
+ case RL2_SVG_PATH:
+ svg_clip_path (cairo, shape);
+ break;
+ };
+ }
+ if (item->type == RL2_SVG_ITEM_GROUP && item->pointer != NULL)
+ {
+ group = item->pointer;
+ svg_apply_clip2 (cairo, group->first);
+ }
+ if (item->type == RL2_SVG_ITEM_CLIP && item->pointer != NULL)
+ {
+ clip = item->pointer;
+ svg_apply_clip2 (cairo, clip->first);
+ }
+ item = item->next;
+ }
+}
+
+static void
+svg_apply_clip (cairo_t * cairo, rl2PrivSvgItemPtr item)
+{
+/* attempting to apply a ClipPath */
+ if (item->type == RL2_SVG_ITEM_CLIP && item->pointer != NULL)
+ {
+ rl2PrivSvgClipPtr clip = item->pointer;
+ svg_apply_clip2 (cairo, clip->first);
+ }
+}
+
+static void
+svg_render_item (cairo_t * cairo, rl2PrivSvgDocumentPtr svg_doc,
+ rl2PrivSvgItemPtr item)
+{
+/* rendering all SVG Items */
+ rl2PrivSvgGroupPtr group;
+ rl2PrivSvgShapePtr shape;
+ rl2PrivSvgStyle style;
+
+ svg_init_style (&style);
+ while (item)
+ {
+ /* looping on Items */
+ if (item->type == RL2_SVG_ITEM_SHAPE && item->pointer != NULL)
+ {
+ shape = item->pointer;
+ if (shape->is_defs || shape->is_flow_root)
+ ;
+ else
+ {
+ svg_apply_transformations (cairo, svg_doc, shape);
+ svg_apply_style (shape, &style);
+ if (style.visibility)
+ {
+ if (style.fill_url != NULL)
+ svg_resolve_fill_url (svg_doc, &style);
+ if (style.stroke_url != NULL)
+ svg_resolve_stroke_url (svg_doc, &style);
+ if (style.clip_url != NULL
+ && style.clip_pointer != NULL)
+ svg_apply_clip (cairo, style.clip_pointer);
+ svg_draw_shape (cairo, shape, &style);
+ cairo_reset_clip (cairo);
+ }
+ }
+ }
+ if (item->type == RL2_SVG_ITEM_GROUP && item->pointer != NULL)
+ {
+ group = item->pointer;
+ if (group->is_defs || group->is_flow_root)
+ ;
+ else
+ svg_render_item (cairo, svg_doc, group->first);
+ }
+ item = item->next;
+ }
+ svg_style_cleanup (&style);
+}
+
+static void
+svg_find_href (rl2PrivSvgDocumentPtr svg_doc, rl2PrivSvgItemPtr item,
+ const char *href, rl2PrivSvgItemPtr * pointer)
+{
+/* attempting to recursively resolve an xlink:href reference */
+ rl2PrivSvgGroupPtr group;
+ rl2PrivSvgShapePtr shape;
+
+ while (item)
+ {
+ /* looping on Items */
+ if (item->type == RL2_SVG_ITEM_SHAPE && item->pointer != NULL)
+ {
+ shape = item->pointer;
+ if (shape->id != NULL)
+ {
+ if (strcmp (shape->id, href + 1) == 0)
+ {
+ *pointer = item;
+ return;
+ }
+ }
+ }
+ if (item->type == RL2_SVG_ITEM_GROUP && item->pointer != NULL)
+ {
+ group = item->pointer;
+ if (group->id != NULL)
+ {
+ if (strcmp (group->id, href + 1) == 0)
+ {
+ *pointer = item;
+ return;
+ }
+ }
+ svg_find_href (svg_doc, group->first, href, pointer);
+ }
+ item = item->next;
+ }
+ *pointer = NULL;
+}
+
+static void
+svg_replace_use (rl2PrivSvgItemPtr item, rl2PrivSvgItemPtr repl)
+{
+/* replacing an Use with the corrensponding resolved item */
+ rl2PrivSvgUsePtr use = item->pointer;
+
+ if (repl->type == RL2_SVG_ITEM_SHAPE && repl->pointer)
+ {
+ rl2PrivSvgShapePtr shape = repl->pointer;
+ item->pointer = svg_clone_shape (shape, use);
+ item->type = RL2_SVG_ITEM_SHAPE;
+ }
+ if (repl->type == RL2_SVG_ITEM_GROUP && repl->pointer)
+ {
+ rl2PrivSvgGroupPtr group = repl->pointer;
+ item->pointer = svg_clone_group (group, use);
+ item->type = RL2_SVG_ITEM_GROUP;
+ }
+ svg_free_use (use);
+}
+
+static void
+svg_find_gradient_href (rl2PrivSvgDocumentPtr svg_doc, const char *href,
+ rl2PrivSvgGradientPtr * pointer)
+{
+/* attempting to recursively resolve an xlink:href reference (Gradients) */
+ rl2PrivSvgGradientPtr grad = svg_doc->first_grad;
+
+ while (grad)
+ {
+ /* looping on Gradients */
+ if (strcmp (grad->id, href + 1) == 0)
+ {
+ *pointer = grad;
+ return;
+ }
+ grad = grad->next;
+ }
+}
+
+static rl2PrivSvgGradientPtr
+svg_replace_gradient (rl2PrivSvgDocumentPtr svg_doc,
+ rl2PrivSvgGradientPtr gradient,
+ rl2PrivSvgGradientPtr repl)
+{
+/* replacing a Gradient with the corrensponding resolved item */
+ rl2PrivSvgGradientPtr new_grad = svg_clone_gradient (repl, gradient);
+ new_grad->prev = gradient->prev;
+ new_grad->next = gradient->next;
+ if (gradient->prev != NULL)
+ gradient->prev->next = new_grad;
+ if (gradient->next != NULL)
+ gradient->next->prev = new_grad;
+ if (svg_doc->first_grad == gradient)
+ svg_doc->first_grad = new_grad;
+ if (svg_doc->last_grad == gradient)
+ svg_doc->last_grad = new_grad;
+ svg_free_gradient (gradient);
+ return new_grad;
+}
+
+static void
+svg_resolve_gradients_xlink_href (rl2PrivSvgDocumentPtr svg_doc)
+{
+/* resolving any indirect reference: Gradient xlink:href */
+ rl2PrivSvgGradientPtr grad = svg_doc->first_grad;
+ rl2PrivSvgGradientPtr ret;
+
+ while (grad)
+ {
+ /* looping on Gradients */
+ if (grad->xlink_href != NULL)
+ {
+ svg_find_gradient_href (svg_doc, grad->xlink_href, &ret);
+ if (ret != NULL)
+ grad = svg_replace_gradient (svg_doc, grad, ret);
+ }
+ grad = grad->next;
+ }
+}
+
+static void
+svg_resolve_xlink_href (rl2PrivSvgDocumentPtr svg_doc, rl2PrivSvgItemPtr item)
+{
+/* recursively resolving any indirect reference: xlink:href */
+ rl2PrivSvgGroupPtr group;
+ rl2PrivSvgUsePtr use;
+ rl2PrivSvgClipPtr clip;
+ rl2PrivSvgItemPtr ret;
+
+ while (item)
+ {
+ /* looping on Items */
+ if (item->type == RL2_SVG_ITEM_USE && item->pointer != NULL)
+ {
+ use = item->pointer;
+ svg_find_href (svg_doc, svg_doc->first, use->xlink_href, &ret);
+ if (ret != NULL)
+ svg_replace_use (item, ret);
+ }
+ if (item->type == RL2_SVG_ITEM_GROUP && item->pointer != NULL)
+ {
+ group = item->pointer;
+ svg_resolve_xlink_href (svg_doc, group->first);
+ }
+ if (item->type == RL2_SVG_ITEM_CLIP && item->pointer != NULL)
+ {
+ clip = item->pointer;
+ svg_resolve_xlink_href (svg_doc, clip->first);
+ }
+ item = item->next;
+ }
+}
+
+static void
+svg_find_clip_href (rl2PrivSvgDocumentPtr svg_doc,
+ rl2PrivSvgItemPtr item, const char *href,
+ rl2PrivSvgItemPtr * pointer)
+{
+/* attempting to recursively resolve an xlink:href reference (ClipPath) */
+
+ rl2PrivSvgGroupPtr group;
+ rl2PrivSvgClipPtr clip;
+
+ while (item)
+ {
+ /* looping on Items */
+ if (item->type == RL2_SVG_ITEM_CLIP && item->pointer != NULL)
+ {
+ clip = item->pointer;
+ if (clip->id != NULL)
+ {
+ if (strcmp (clip->id, href) == 0)
+ {
+ *pointer = item;
+ return;
+ }
+ }
+ }
+ if (item->type == RL2_SVG_ITEM_GROUP && item->pointer != NULL)
+ {
+ group = item->pointer;
+ if (group->id != NULL)
+ {
+ if (strcmp (group->id, href + 1) == 0)
+ {
+ *pointer = item;
+ return;
+ }
+ }
+ svg_find_clip_href (svg_doc, group->first, href, pointer);
+ }
+ item = item->next;
+ }
+}
+
+static void
+svg_resolve_clip_xlink_href (rl2PrivSvgDocumentPtr svg_doc,
+ rl2PrivSvgItemPtr item)
+{
+/* recursively resolving any indirect reference: ClipPath url */
+ rl2PrivSvgGroupPtr group;
+ rl2PrivSvgShapePtr shape;
+ rl2PrivSvgUsePtr use;
+ rl2PrivSvgItemPtr ret = NULL;
+
+ while (item)
+ {
+ /* looping on Items */
+ if (item->type == RL2_SVG_ITEM_USE && item->pointer != NULL)
+ {
+ use = item->pointer;
+ if (use->style.clip_url != NULL)
+ {
+ svg_find_clip_href (svg_doc, svg_doc->first,
+ use->style.clip_url, &ret);
+ if (ret != NULL)
+ use->style.clip_pointer = ret;
+ }
+ }
+ if (item->type == RL2_SVG_ITEM_SHAPE && item->pointer != NULL)
+ {
+ shape = item->pointer;
+ if (shape->style.clip_url != NULL)
+ {
+ svg_find_clip_href (svg_doc, svg_doc->first,
+ shape->style.clip_url, &ret);
+ if (ret != NULL)
+ shape->style.clip_pointer = ret;
+ }
+ }
+ if (item->type == RL2_SVG_ITEM_GROUP && item->pointer != NULL)
+ {
+ group = item->pointer;
+ if (group->style.clip_url != NULL)
+ {
+ svg_find_clip_href (svg_doc, svg_doc->first,
+ group->style.clip_url, &ret);
+ if (ret != NULL)
+ group->style.clip_pointer = ret;
+ }
+ svg_resolve_clip_xlink_href (svg_doc, group->first);
+ }
+ item = item->next;
+ }
+}
+
+static int
+svg_endian_arch ()
+{
+/* checking if target CPU is a little-endian one */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static int
+svg_create_raster_buffers (const unsigned char *in_buf, int width, int height,
+ unsigned char **rgb, int *rgb_bytes,
+ unsigned char **mask, int *mask_bytes)
+{
+/* creating the RGB and Mask buffers from the Cairo Surface */
+ int x;
+ int y;
+ const unsigned char *p_in;
+ unsigned char *p_rgb;
+ unsigned char *p_mask;
+ int valid_mask = 0;
+
+/* creating the output buffers */
+ *rgb = NULL;
+ *mask = NULL;
+ *rgb_bytes = width * height * 3;
+ *mask_bytes = width * height;
+ *rgb = malloc (*rgb_bytes);
+ if (*rgb == NULL)
+ goto error;
+ *mask = malloc (*mask_bytes);
+ if (*mask == NULL)
+ goto error;
+ p_in = in_buf;
+ p_rgb = *rgb;
+ p_mask = *mask;
+
+ for (y = 0; y < height; y++)
+ {
+ /* looping on lines */
+ double multiplier;
+ double r;
+ double g;
+ double b;
+ for (x = 0; x < width; x++)
+ {
+ /* looping on columns */
+ unsigned char alpha;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ if (svg_endian_arch ())
+ {
+ /* little endian byte order */
+ alpha = *(p_in + 3);
+ red = *(p_in + 2);
+ green = *(p_in + 1);
+ blue = *(p_in + 0);
+ }
+ else
+ {
+ /* big endian byte order */
+ alpha = *(p_in + 0);
+ red = *(p_in + 1);
+ green = *(p_in + 2);
+ blue = *(p_in + 3);
+ }
+ /* Cairo colors are pre-multiplied; normalizing */
+ multiplier = 255.0 / (double) alpha;
+ r = (double) red *multiplier;
+ g = (double) green *multiplier;
+ b = (double) blue *multiplier;
+ if (r < 0.0)
+ red = 0;
+ else if (r > 255.0)
+ red = 255;
+ else
+ red = r;
+ if (g < 0.0)
+ green = 0;
+ else if (g > 255.0)
+ green = 255;
+ else
+ green = g;
+ if (b < 0.0)
+ blue = 0;
+ else if (b > 255.0)
+ blue = 255;
+ else
+ blue = b;
+ *p_rgb++ = red;
+ *p_rgb++ = green;
+ *p_rgb++ = blue;
+ if (alpha < 128)
+ {
+ *p_mask++ = 0;
+ valid_mask = 1;
+ }
+ else
+ *p_mask++ = 1;
+ p_in += 4;
+ }
+ }
+ if (!valid_mask)
+ {
+ free (*mask);
+ *mask = NULL;
+ *mask_bytes = 0;
+ }
+ return 1;
+
+ error:
+ if (*rgb != NULL)
+ free (*rgb);
+ if (*mask != NULL)
+ free (*mask);
+ *rgb = NULL;
+ *rgb_bytes = 0;
+ *mask = NULL;
+ *mask_bytes = 0;
+ return 0;
+}
+
+static rl2RasterPtr
+svg_to_raster (rl2PrivSvgDocument * svg, double size)
+{
+/* rendering an SVG document as an RGBA image */
+ cairo_surface_t *surface;
+ cairo_t *cairo;
+ double ratio_x;
+ double ratio_y;
+ double width;
+ double height;
+ double shift_x;
+ double shift_y;
+ rl2RasterPtr rst = NULL;
+ int w;
+ int h;
+ const unsigned char *in_buf;
+ unsigned char *rgb = NULL;
+ int rgb_bytes;
+ unsigned char *mask = NULL;
+ int mask_bytes;
+
+ if (svg->viewbox_x != DBL_MIN && svg->viewbox_y != DBL_MIN
+ && svg->viewbox_width != DBL_MIN && svg->viewbox_height != DBL_MIN)
+ {
+ /* setting the SVG dimensions from the ViewBox */
+ if (svg->width <= 0)
+ svg->width = svg->viewbox_width;
+ if (svg->height <= 0)
+ svg->height = svg->viewbox_height;
+ }
+ else
+ {
+ /* setting the ViewBox from the SVG dimensions */
+ svg->viewbox_x = 0.0;
+ svg->viewbox_y = 0.0;
+ svg->viewbox_width = svg->width;
+ svg->viewbox_height = svg->height;
+ }
+ if (svg->width <= 0.0 || svg->height <= 0.0)
+ return NULL;
+
+/* setting the image dimensions */
+ ratio_x = svg->width / (double) size;
+ ratio_y = svg->height / (double) size;
+ if (ratio_x > ratio_y)
+ {
+ width = svg->width / ratio_x;
+ height = svg->height / ratio_x;
+ }
+ else
+ {
+ width = svg->width / ratio_y;
+ height = svg->height / ratio_y;
+ }
+
+ surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
+ if (cairo_surface_status (surface) == CAIRO_STATUS_SUCCESS)
+ ;
+ else
+ return NULL;
+ cairo = cairo_create (surface);
+ if (cairo_status (cairo) == CAIRO_STATUS_NO_MEMORY)
+ {
+ fprintf (stderr, "CAIRO reports: Insufficient Memory\n");
+ goto stop;
+ }
+
+/* priming a transparent background */
+ cairo_rectangle (cairo, 0, 0, width, height);
+ cairo_set_source_rgba (cairo, 0.0, 0.0, 0.0, 0.0);
+ cairo_fill (cairo);
+/* setting the basic document matrix */
+ svg->matrix.xx = 1.0;
+ svg->matrix.yx = 0.0;
+ svg->matrix.xy = 0.0;
+ svg->matrix.yy = 1.0;
+ svg->matrix.x0 = 0.0;
+ svg->matrix.y0 = 0.0;
+ ratio_x = width / svg->viewbox_width;
+ ratio_y = height / svg->viewbox_height;
+ cairo_matrix_scale (&(svg->matrix), ratio_x, ratio_y);
+ shift_x = -1 * svg->viewbox_x;
+ shift_y = -1 * svg->viewbox_y;
+ cairo_matrix_translate (&(svg->matrix), shift_x, shift_y);
+
+/* resolving any xlink:href */
+ svg_resolve_gradients_xlink_href (svg);
+ svg_resolve_clip_xlink_href (svg, svg->first);
+ svg_resolve_xlink_href (svg, svg->first);
+
+/* recursively rendering all SVG Items */
+ svg_render_item (cairo, svg, svg->first);
+
+/* accessing the CairoSurface buffer */
+ w = cairo_image_surface_get_width (surface);
+ h = cairo_image_surface_get_height (surface);
+ cairo_surface_flush (surface);
+ in_buf = cairo_image_surface_get_data (surface);
+ if (in_buf == NULL)
+ goto stop;
+
+/* creating the Rasters buffer */
+ if (!svg_create_raster_buffers
+ (in_buf, w, h, &rgb, &rgb_bytes, &mask, &mask_bytes))
+ goto stop;
+
+/* creating the output Raster */
+ rst =
+ rl2_create_raster (w, h, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3, rgb,
+ rgb_bytes, NULL, mask, mask_bytes, NULL);
+
+ stop:
+ cairo_surface_destroy (surface);
+ cairo_destroy (cairo);
+ return rst;
+}
+
+RL2_DECLARE rl2SvgPtr
+rl2_create_svg (const unsigned char *svg_document, int svg_bytes)
+{
+/* allocating and initializing an SVG object */
+ rl2PrivSvgDocumentPtr svg = NULL;
+ svg = svg_parse_doc (svg_document, svg_bytes);
+ return (rl2SvgPtr) svg;
+}
+
+RL2_DECLARE void
+rl2_destroy_svg (rl2SvgPtr ptr)
+{
+/* memory cleanup - destroying an SVG object */
+ rl2PrivSvgDocumentPtr svg = (rl2PrivSvgDocumentPtr) ptr;
+ if (svg == NULL)
+ return;
+ svg_free_document (svg);
+}
+
+RL2_DECLARE int
+rl2_get_svg_size (rl2SvgPtr ptr, double *width, double *height)
+{
+/* return the SVG width and height */
+ rl2PrivSvgDocumentPtr svg = (rl2PrivSvgDocumentPtr) ptr;
+ if (svg == NULL)
+ return RL2_ERROR;
+ *width = svg->width;
+ *height = svg->height;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_raster_from_svg (rl2SvgPtr ptr, double size)
+{
+/* rendering the SVG Document into a raster image */
+ rl2PrivSvgDocumentPtr svg = (rl2PrivSvgDocumentPtr) ptr;
+ if (svg == NULL)
+ return NULL;
+/* SVG image rendering */
+ return svg_to_raster (svg, size);
+}
diff --git a/src/rl2svgaux.c b/src/rl2svgaux.c
new file mode 100644
index 0000000..7b8eb16
--- /dev/null
+++ b/src/rl2svgaux.c
@@ -0,0 +1,2059 @@
+/*
+
+ rl2svgaux -- SVG helper auxiliary funcions
+
+ version 0.1, 2014 June 6
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+
+#ifdef __ANDROID__ /* Android specific */
+#include <cairo.h>
+#else /* any other standard platform (Win, Linux, Mac) */
+#include <cairo/cairo.h>
+#endif /* end Android conditionals */
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2svg.h"
+#include "rasterlite2_private.h"
+#include "rl2svg_private.h"
+
+RL2_PRIVATE void
+svg_free_transform (rl2PrivSvgTransformPtr p)
+{
+/* freeing an SVG Transform */
+ if (p == NULL)
+ return;
+ if (p->data != NULL)
+ free (p->data);
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_polyline (rl2PrivSvgPolylinePtr p)
+{
+/* freeing an SVG Polyline */
+ if (p == NULL)
+ return;
+ if (p->x != NULL)
+ free (p->x);
+ if (p->y != NULL)
+ free (p->y);
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_polygon (rl2PrivSvgPolygonPtr p)
+{
+/* freeing an SVG Polygon */
+ if (p == NULL)
+ return;
+ if (p->x != NULL)
+ free (p->x);
+ if (p->y != NULL)
+ free (p->y);
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_path_item (rl2PrivSvgPathItemPtr p)
+{
+/* freeing an SVG Path item */
+ if (p == NULL)
+ return;
+ if (p->data != NULL)
+ free (p->data);
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_path (rl2PrivSvgPathPtr p)
+{
+/* freeing an SVG Path */
+ rl2PrivSvgPathItemPtr pp;
+ rl2PrivSvgPathItemPtr ppn;
+ if (p == NULL)
+ return;
+ pp = p->first;
+ while (pp != NULL)
+ {
+ ppn = pp->next;
+ svg_free_path_item (pp);
+ pp = ppn;
+ }
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_shape (rl2PrivSvgShapePtr p)
+{
+/* freeing an SVG Shape */
+ rl2PrivSvgTransformPtr ptn;
+ rl2PrivSvgTransformPtr pt = p->first_trans;
+ if (p->id != NULL)
+ free (p->id);
+ while (pt)
+ {
+ ptn = pt->next;
+ svg_free_transform (pt);
+ pt = ptn;
+ }
+ switch (p->type)
+ {
+ case RL2_SVG_POLYLINE:
+ svg_free_polyline (p->data);
+ break;
+ case RL2_SVG_POLYGON:
+ svg_free_polygon (p->data);
+ break;
+ case RL2_SVG_PATH:
+ svg_free_path (p->data);
+ break;
+ default:
+ if (p->data)
+ free (p->data);
+ break;
+ };
+ svg_style_cleanup (&(p->style));
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_use (rl2PrivSvgUsePtr p)
+{
+/* freeing an SVG Use (xlink:href) */
+ rl2PrivSvgTransformPtr pt;
+ rl2PrivSvgTransformPtr ptn;
+ if (p->xlink_href != NULL)
+ free (p->xlink_href);
+ pt = p->first_trans;
+ while (pt)
+ {
+ ptn = pt->next;
+ svg_free_transform (pt);
+ pt = ptn;
+ }
+ svg_style_cleanup (&(p->style));
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_item (rl2PrivSvgItemPtr p)
+{
+/* freeing an SVG Item */
+ if (p->type == RL2_SVG_ITEM_GROUP)
+ svg_free_group ((rl2PrivSvgGroupPtr) (p->pointer));
+ if (p->type == RL2_SVG_ITEM_SHAPE)
+ svg_free_shape ((rl2PrivSvgShapePtr) (p->pointer));
+ if (p->type == RL2_SVG_ITEM_CLIP)
+ svg_free_clip ((rl2PrivSvgClipPtr) (p->pointer));
+ if (p->type == RL2_SVG_ITEM_USE)
+ svg_free_use ((rl2PrivSvgUsePtr) (p->pointer));
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_clip (rl2PrivSvgClipPtr p)
+{
+/* freeing an SVG Clip */
+ rl2PrivSvgItemPtr pi;
+ rl2PrivSvgItemPtr pin;
+ if (p->id != NULL)
+ free (p->id);
+ pi = p->first;
+ while (pi)
+ {
+ pin = pi->next;
+ svg_free_item (pi);
+ pi = pin;
+ }
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_group (rl2PrivSvgGroupPtr p)
+{
+/* freeing an SVG Group <g> */
+ rl2PrivSvgItemPtr pi;
+ rl2PrivSvgItemPtr pin;
+ rl2PrivSvgTransformPtr pt;
+ rl2PrivSvgTransformPtr ptn;
+ if (p->id != NULL)
+ free (p->id);
+ pi = p->first;
+ while (pi)
+ {
+ pin = pi->next;
+ svg_free_item (pi);
+ pi = pin;
+ }
+ pt = p->first_trans;
+ while (pt)
+ {
+ ptn = pt->next;
+ svg_free_transform (pt);
+ pt = ptn;
+ }
+ svg_style_cleanup (&(p->style));
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_gradient_stop (rl2PrivSvgGradientStopPtr p)
+{
+/* freeing an SVG GradientStop */
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_gradient (rl2PrivSvgGradient * p)
+{
+/* freeing an SVG Gradient */
+ rl2PrivSvgTransformPtr pt;
+ rl2PrivSvgTransformPtr ptn;
+ rl2PrivSvgGradientStopPtr ps;
+ rl2PrivSvgGradientStopPtr psn;
+ if (p->id != NULL)
+ free (p->id);
+ if (p->xlink_href != NULL)
+ free (p->xlink_href);
+ pt = p->first_trans;
+ while (pt)
+ {
+ ptn = pt->next;
+ svg_free_transform (pt);
+ pt = ptn;
+ }
+ ps = p->first_stop;
+ while (ps)
+ {
+ psn = ps->next;
+ svg_free_gradient_stop (ps);
+ ps = psn;
+ }
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_free_document (rl2PrivSvgDocument * p)
+{
+/* freeing an SVG Document */
+ rl2PrivSvgItemPtr pi;
+ rl2PrivSvgItemPtr pin;
+ rl2PrivSvgGradientPtr pg;
+ rl2PrivSvgGradientPtr pgn;
+ pi = p->first;
+ while (pi)
+ {
+ pin = pi->next;
+ if (pi->type == RL2_SVG_ITEM_GROUP)
+ svg_free_group ((rl2PrivSvgGroupPtr) (pi->pointer));
+ if (pi->type == RL2_SVG_ITEM_SHAPE)
+ svg_free_shape ((rl2PrivSvgShapePtr) (pi->pointer));
+ if (pi->type == RL2_SVG_ITEM_USE)
+ svg_free_use ((rl2PrivSvgUsePtr) (pi->pointer));
+ if (pi->type == RL2_SVG_ITEM_CLIP)
+ svg_free_clip ((rl2PrivSvgClipPtr) (pi->pointer));
+ free (pi);
+ pi = pin;
+ }
+ pg = p->first_grad;
+ while (pg)
+ {
+ pgn = pg->next;
+ svg_free_gradient (pg);
+ pg = pgn;
+ }
+ free (p);
+}
+
+RL2_PRIVATE void
+svg_init_style (rl2PrivSvgStylePtr style)
+{
+/* initializing a void style */
+ style->visibility = -1;
+ style->opacity = 1.0;
+ style->fill = -1;
+ style->no_fill = -1;
+ style->fill_rule = -1;
+ style->fill_url = NULL;
+ style->fill_pointer = NULL;
+ style->fill_red = -1.0;
+ style->fill_green = -1.0;
+ style->fill_blue = -1.0;
+ style->fill_opacity = -1.0;
+ style->stroke = -1;
+ style->no_stroke = -1;
+ style->stroke_width = -1.0;
+ style->stroke_linecap = -1;
+ style->stroke_linejoin = -1;
+ style->stroke_miterlimit = -1.0;
+ style->stroke_dashitems = 0;
+ style->stroke_dasharray = NULL;
+ style->stroke_dashoffset = 0.0;
+ style->stroke_url = NULL;
+ style->stroke_pointer = NULL;
+ style->stroke_red = -1.0;
+ style->stroke_green = -1.0;
+ style->stroke_blue = -1.0;
+ style->stroke_opacity = -1.0;
+ style->clip_url = NULL;
+ style->clip_pointer = NULL;
+}
+
+RL2_PRIVATE void
+svg_style_cleanup (rl2PrivSvgStylePtr style)
+{
+/* style cleanup */
+ if (style->stroke_dasharray != NULL)
+ free (style->stroke_dasharray);
+ if (style->fill_url != NULL)
+ free (style->fill_url);
+ if (style->stroke_url != NULL)
+ free (style->stroke_url);
+ if (style->clip_url != NULL)
+ free (style->clip_url);
+}
+
+RL2_PRIVATE rl2PrivSvgMatrixPtr
+svg_alloc_matrix (double a, double b, double c, double d, double e, double f)
+{
+/* allocating and initializing an SVG Matrix */
+ rl2PrivSvgMatrixPtr p = malloc (sizeof (rl2PrivSvgMatrix));
+ p->a = a;
+ p->b = b;
+ p->c = c;
+ p->d = d;
+ p->e = e;
+ p->f = f;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgMatrixPtr
+svg_clone_matrix (rl2PrivSvgMatrixPtr in)
+{
+/* cloning an SVG Matrix */
+ rl2PrivSvgMatrixPtr p = malloc (sizeof (rl2PrivSvgMatrix));
+ p->a = in->a;
+ p->b = in->b;
+ p->c = in->c;
+ p->d = in->d;
+ p->e = in->e;
+ p->f = in->f;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgTranslatePtr
+svg_alloc_translate (double tx, double ty)
+{
+/* allocating and initializing an SVG Translate */
+ rl2PrivSvgTranslatePtr p = malloc (sizeof (rl2PrivSvgTranslate));
+ p->tx = tx;
+ p->ty = ty;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgTranslatePtr
+svg_clone_translate (rl2PrivSvgTranslatePtr in)
+{
+/* cloning an SVG Translate */
+ rl2PrivSvgTranslatePtr p = malloc (sizeof (rl2PrivSvgTranslate));
+ p->tx = in->tx;
+ p->ty = in->ty;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgScalePtr
+svg_alloc_scale (double sx, double sy)
+{
+/* allocating and initializing an SVG Scale */
+ rl2PrivSvgScalePtr p = malloc (sizeof (rl2PrivSvgScale));
+ p->sx = sx;
+ p->sy = sy;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgScalePtr
+svg_clone_scale (rl2PrivSvgScalePtr in)
+{
+/* cloning an SVG Scale */
+ rl2PrivSvgScalePtr p = malloc (sizeof (rl2PrivSvgScale));
+ p->sx = in->sx;
+ p->sy = in->sy;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgRotatePtr
+svg_alloc_rotate (double angle, double cx, double cy)
+{
+/* allocating and initializing an SVG Scale */
+ rl2PrivSvgRotatePtr p = malloc (sizeof (rl2PrivSvgRotate));
+ p->angle = angle;
+ p->cx = cx;
+ p->cy = cy;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgRotatePtr
+svg_clone_rotate (rl2PrivSvgRotatePtr in)
+{
+/* cloning an SVG Scale */
+ rl2PrivSvgRotatePtr p = malloc (sizeof (rl2PrivSvgRotate));
+ p->angle = in->angle;
+ p->cx = in->cx;
+ p->cy = in->cy;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgSkewPtr
+svg_alloc_skew (double angle)
+{
+/* allocating and initializing an SVG Skew */
+ rl2PrivSvgSkewPtr p = malloc (sizeof (rl2PrivSvgSkew));
+ p->angle = angle;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgSkewPtr
+svg_clone_skew (rl2PrivSvgSkewPtr in)
+{
+/* cloning an SVG Skew */
+ rl2PrivSvgSkewPtr p = malloc (sizeof (rl2PrivSvgSkew));
+ p->angle = in->angle;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgTransformPtr
+svg_alloc_transform (int type, void *data)
+{
+/* allocating and initializing an empty SVG Transform */
+ rl2PrivSvgTransformPtr p = malloc (sizeof (rl2PrivSvgTransform));
+ p->type = type;
+ p->data = data;
+ p->next = NULL;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgTransformPtr
+svg_clone_transform (rl2PrivSvgTransformPtr in)
+{
+/* cloning SVG Transform */
+ rl2PrivSvgMatrixPtr matrix;
+ rl2PrivSvgTranslatePtr translate;
+ rl2PrivSvgScalePtr scale;
+ rl2PrivSvgRotatePtr rotate;
+ rl2PrivSvgSkewPtr skew;
+ rl2PrivSvgTransformPtr p = malloc (sizeof (rl2PrivSvgTransform));
+ p->type = in->type;
+ switch (in->type)
+ {
+ case RL2_SVG_MATRIX:
+ matrix = in->data;
+ p->data = svg_clone_matrix (matrix);
+ break;
+ case RL2_SVG_TRANSLATE:
+ translate = in->data;
+ p->data = svg_clone_translate (translate);
+ break;
+ case RL2_SVG_SCALE:
+ scale = in->data;
+ p->data = svg_clone_scale (scale);
+ break;
+ case RL2_SVG_ROTATE:
+ rotate = in->data;
+ p->data = svg_clone_rotate (rotate);
+ break;
+ case RL2_SVG_SKEW_X:
+ case RL2_SVG_SKEW_Y:
+ skew = in->data;
+ p->data = svg_clone_skew (skew);
+ break;
+ };
+ p->next = NULL;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgRectPtr
+svg_alloc_rect (double x, double y, double width, double height, double rx,
+ double ry)
+{
+/* allocating and initializing an SVG Rect */
+ rl2PrivSvgRectPtr p = malloc (sizeof (rl2PrivSvgRect));
+ p->x = x;
+ p->y = y;
+ p->width = width;
+ p->height = height;
+ p->rx = rx;
+ p->ry = ry;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgRectPtr
+svg_clone_rect (rl2PrivSvgRectPtr in)
+{
+/* cloning an SVG Rect */
+ rl2PrivSvgRectPtr p = malloc (sizeof (rl2PrivSvgRect));
+ p->x = in->x;
+ p->y = in->y;
+ p->width = in->width;
+ p->height = in->height;
+ p->rx = in->rx;
+ p->ry = in->ry;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgCirclePtr
+svg_alloc_circle (double cx, double cy, double r)
+{
+/* allocating and initializing an SVG Circle */
+ rl2PrivSvgCirclePtr p = malloc (sizeof (rl2PrivSvgCircle));
+ p->cx = cx;
+ p->cy = cy;
+ p->r = r;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgCirclePtr
+svg_clone_circle (rl2PrivSvgCirclePtr in)
+{
+/* cloning an SVG Circle */
+ rl2PrivSvgCirclePtr p = malloc (sizeof (rl2PrivSvgCircle));
+ p->cx = in->cx;
+ p->cy = in->cy;
+ p->r = in->r;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgEllipsePtr
+svg_alloc_ellipse (double cx, double cy, double rx, double ry)
+{
+/* allocating and initializing an SVG Ellipse */
+ rl2PrivSvgEllipsePtr p = malloc (sizeof (rl2PrivSvgEllipse));
+ p->cx = cx;
+ p->cy = cy;
+ p->rx = rx;
+ p->ry = ry;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgEllipsePtr
+svg_clone_ellipse (rl2PrivSvgEllipsePtr in)
+{
+/* cloning an SVG Ellipse */
+ rl2PrivSvgEllipsePtr p = malloc (sizeof (rl2PrivSvgEllipse));
+ p->cx = in->cx;
+ p->cy = in->cy;
+ p->rx = in->rx;
+ p->ry = in->ry;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgLinePtr
+svg_alloc_line (double x1, double y1, double x2, double y2)
+{
+/* allocating and initializing an SVG Line */
+ rl2PrivSvgLinePtr p = malloc (sizeof (rl2PrivSvgLine));
+ p->x1 = x1;
+ p->y1 = y1;
+ p->x2 = x2;
+ p->y2 = y2;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgLinePtr
+svg_clone_line (rl2PrivSvgLinePtr in)
+{
+/* cloning an SVG Line */
+ rl2PrivSvgLinePtr p = malloc (sizeof (rl2PrivSvgLine));
+ p->x1 = in->x1;
+ p->y1 = in->y1;
+ p->x2 = in->x2;
+ p->y2 = in->y2;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPolylinePtr
+svg_alloc_polyline (int points, double *x, double *y)
+{
+/* allocating and initializing an SVG Polyline */
+ rl2PrivSvgPolylinePtr p = malloc (sizeof (rl2PrivSvgPolyline));
+ p->points = points;
+ p->x = x;
+ p->y = y;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPolylinePtr
+svg_clone_polyline (rl2PrivSvgPolylinePtr in)
+{
+/* cloning an SVG Polyline */
+ int iv;
+ rl2PrivSvgPolylinePtr p = malloc (sizeof (rl2PrivSvgPolyline));
+ p->points = in->points;
+ p->x = malloc (sizeof (double) * in->points);
+ p->y = malloc (sizeof (double) * in->points);
+ for (iv = 0; iv < in->points; iv++)
+ {
+ *(p->x + iv) = *(in->x + iv);
+ *(p->y + iv) = *(in->y + iv);
+ }
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPolygonPtr
+svg_alloc_polygon (int points, double *x, double *y)
+{
+/* allocating and initializing an SVG Polygon */
+ rl2PrivSvgPolygonPtr p = malloc (sizeof (rl2PrivSvgPolygon));
+ p->points = points;
+ p->x = x;
+ p->y = y;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPolygonPtr
+svg_clone_polygon (rl2PrivSvgPolygonPtr in)
+{
+/* cloning an SVG Polygon */
+ int iv;
+ rl2PrivSvgPolygonPtr p = malloc (sizeof (rl2PrivSvgPolygon));
+ p->points = in->points;
+ p->x = malloc (sizeof (double) * in->points);
+ p->y = malloc (sizeof (double) * in->points);
+ for (iv = 0; iv < in->points; iv++)
+ {
+ *(p->x + iv) = *(in->x + iv);
+ *(p->y + iv) = *(in->y + iv);
+ }
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPathMovePtr
+svg_alloc_path_move (double x, double y)
+{
+/* allocating and initializing an SVG Path MoveTo or LineTo */
+ rl2PrivSvgPathMovePtr p = malloc (sizeof (rl2PrivSvgPathMove));
+ p->x = x;
+ p->y = y;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPathMovePtr
+svg_clone_path_move (rl2PrivSvgPathMovePtr in)
+{
+/* cloning an SVG Path MoveTo or LineTo */
+ rl2PrivSvgPathMovePtr p = malloc (sizeof (rl2PrivSvgPathMove));
+ p->x = in->x;
+ p->y = in->y;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPathBezierPtr
+svg_alloc_path_bezier (double x1, double y1, double x2, double y2, double x,
+ double y)
+{
+/* allocating and initializing an SVG Bezier Curve */
+ rl2PrivSvgPathBezierPtr p = malloc (sizeof (rl2PrivSvgPathBezier));
+ p->x1 = x1;
+ p->y1 = y1;
+ p->x2 = x2;
+ p->y2 = y2;
+ p->x = x;
+ p->y = y;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPathBezierPtr
+svg_clone_path_bezier (rl2PrivSvgPathBezierPtr in)
+{
+/* cloning an SVG Bezier Curve */
+ rl2PrivSvgPathBezierPtr p = malloc (sizeof (rl2PrivSvgPathBezier));
+ p->x1 = in->x1;
+ p->y1 = in->y1;
+ p->x2 = in->x2;
+ p->y2 = in->y2;
+ p->x = in->x;
+ p->y = in->y;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPathEllipticArcPtr
+svg_alloc_path_ellipt_arc (double rx, double ry, double rotation,
+ int large_arc, int sweep, double x, double y)
+{
+/* allocating and initializing an SVG Elliptic Arc */
+ rl2PrivSvgPathEllipticArcPtr p =
+ malloc (sizeof (rl2PrivSvgPathEllipticArc));
+ p->rx = rx;
+ p->ry = ry;
+ p->rotation = rotation;
+ if (large_arc == 0)
+ p->large_arc = 0;
+ else
+ p->large_arc = 1;
+ if (sweep == 0)
+ p->sweep = 0;
+ else
+ p->sweep = 1;
+ p->x = x;
+ p->y = y;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPathEllipticArcPtr
+svg_clone_path_ellipt_arc (rl2PrivSvgPathEllipticArcPtr in)
+{
+/* cloning an SVG Elliptic Arc */
+ rl2PrivSvgPathEllipticArcPtr p =
+ malloc (sizeof (rl2PrivSvgPathEllipticArc));
+ p->rx = in->rx;
+ p->ry = in->ry;
+ p->rotation = in->rotation;
+ p->large_arc = in->large_arc;
+ p->sweep = in->sweep;
+ p->x = in->x;
+ p->y = in->y;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPathItemPtr
+svg_alloc_path_item (int type, void *data)
+{
+/* allocating and initializing an empty SVG Path item */
+ rl2PrivSvgPathItemPtr p = malloc (sizeof (rl2PrivSvgPathItem));
+ p->type = type;
+ p->data = data;
+ p->next = NULL;
+ return p;
+}
+
+RL2_PRIVATE void
+svg_add_path_item (rl2PrivSvgPathPtr path, int type, void *data)
+{
+/* add a Command to an SVG Path */
+ rl2PrivSvgPathItemPtr p = svg_alloc_path_item (type, data);
+ if (path->first == NULL)
+ path->first = p;
+ if (path->last != NULL)
+ path->last->next = p;
+ path->last = p;
+}
+
+RL2_PRIVATE rl2PrivSvgPathPtr
+svg_alloc_path (void)
+{
+/* allocating and initializing an empty SVG Path */
+ rl2PrivSvgPathPtr p = malloc (sizeof (rl2PrivSvgPath));
+ p->first = NULL;
+ p->last = NULL;
+ p->error = 0;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgPathPtr
+svg_clone_path (rl2PrivSvgPathPtr in)
+{
+/* cloning an empty SVG Path */
+ rl2PrivSvgPathMovePtr move;
+ rl2PrivSvgPathBezierPtr bezier;
+ rl2PrivSvgPathEllipticArcPtr arc;
+ rl2PrivSvgPathItemPtr pp;
+ rl2PrivSvgPathPtr p = malloc (sizeof (rl2PrivSvgPath));
+ p->first = NULL;
+ p->last = NULL;
+ pp = in->first;
+ while (pp != NULL)
+ {
+ switch (pp->type)
+ {
+ case RL2_SVG_MOVE_TO:
+ case RL2_SVG_LINE_TO:
+ move = svg_clone_path_move (pp->data);
+ svg_add_path_item (p, pp->type, move);
+ break;
+ case RL2_SVG_CURVE_3:
+ case RL2_SVG_CURVE_4:
+ bezier = svg_clone_path_bezier (pp->data);
+ svg_add_path_item (p, pp->type, bezier);
+ break;
+ case RL2_SVG_ELLIPT_ARC:
+ arc = svg_clone_path_ellipt_arc (pp->data);
+ svg_add_path_item (p, pp->type, arc);
+ break;
+ case RL2_SVG_CLOSE_PATH:
+ svg_add_path_item (p, pp->type, NULL);
+ break;
+ };
+ pp = pp->next;
+ }
+ p->error = in->error;
+ return p;
+}
+
+RL2_PRIVATE void
+svg_add_clip_url (rl2PrivSvgStylePtr style, const char *url)
+{
+/* adding an URL (ClipPath ref) to some Style */
+ int len;
+ if (style->clip_url != NULL)
+ free (style->clip_url);
+ if (url == NULL)
+ {
+ style->clip_url = NULL;
+ return;
+ }
+ len = strlen (url);
+ style->clip_url = malloc (len + 1);
+ strcpy (style->clip_url, url);
+}
+
+RL2_PRIVATE void
+svg_add_fill_gradient_url (rl2PrivSvgStylePtr style, const char *url)
+{
+/* adding an URL (Fill Gradient ref) to some Style */
+ int len;
+ if (style->fill_url != NULL)
+ free (style->fill_url);
+ if (url == NULL)
+ {
+ style->fill_url = NULL;
+ return;
+ }
+ len = strlen (url);
+ style->fill_url = malloc (len + 1);
+ strcpy (style->fill_url, url);
+}
+
+RL2_PRIVATE void
+svg_add_stroke_gradient_url (rl2PrivSvgStylePtr style, const char *url)
+{
+/* adding an URL (Stroke Gradient ref) to some Style */
+ int len;
+ if (style->stroke_url != NULL)
+ free (style->stroke_url);
+ if (url == NULL)
+ {
+ style->stroke_url = NULL;
+ return;
+ }
+ len = strlen (url);
+ style->stroke_url = malloc (len + 1);
+ strcpy (style->stroke_url, url);
+}
+
+RL2_PRIVATE rl2PrivSvgShapePtr
+svg_alloc_shape (int type, void *data, rl2PrivSvgGroupPtr parent)
+{
+/* allocating and initializing an empty SVG Shape */
+ rl2PrivSvgShapePtr p = malloc (sizeof (rl2PrivSvgShape));
+ p->id = NULL;
+ p->type = type;
+ p->data = data;
+ p->parent = parent;
+ svg_init_style (&(p->style));
+ p->first_trans = NULL;
+ p->last_trans = NULL;
+ p->is_defs = 0;
+ p->is_flow_root = 0;
+ p->next = NULL;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgShapePtr
+svg_clone_shape (rl2PrivSvgShapePtr in, rl2PrivSvgUsePtr use)
+{
+/* cloning an SVG Shape */
+ rl2PrivSvgRectPtr rect;
+ rl2PrivSvgCirclePtr circle;
+ rl2PrivSvgEllipsePtr ellipse;
+ rl2PrivSvgLinePtr line;
+ rl2PrivSvgPolylinePtr polyline;
+ rl2PrivSvgPolygonPtr polygon;
+ rl2PrivSvgPathPtr path;
+ rl2PrivSvgTransformPtr pt;
+ rl2PrivSvgTransformPtr trans;
+ rl2PrivSvgShapePtr out = malloc (sizeof (rl2PrivSvgShape));
+ out->id = NULL;
+ out->type = in->type;
+ switch (in->type)
+ {
+ case RL2_SVG_RECT:
+ rect = in->data;
+ out->data = svg_clone_rect (rect);
+ break;
+ case RL2_SVG_CIRCLE:
+ circle = in->data;
+ out->data = svg_clone_circle (circle);
+ break;
+ case RL2_SVG_ELLIPSE:
+ ellipse = in->data;
+ out->data = svg_clone_ellipse (ellipse);
+ break;
+ case RL2_SVG_LINE:
+ line = in->data;
+ out->data = svg_clone_line (line);
+ break;
+ case RL2_SVG_POLYLINE:
+ polyline = in->data;
+ out->data = svg_clone_polyline (polyline);
+ break;
+ case RL2_SVG_POLYGON:
+ polygon = in->data;
+ out->data = svg_clone_polygon (polygon);
+ break;
+ case RL2_SVG_PATH:
+ path = in->data;
+ out->data = svg_clone_path (path);
+ break;
+ }
+ if (use != NULL)
+ out->parent = use->parent;
+ else
+ out->parent = in->parent;
+ out->style.visibility = in->style.visibility;
+ out->style.opacity = in->style.opacity;
+ out->style.fill = in->style.fill;
+ out->style.no_fill = in->style.no_fill;
+ out->style.fill_rule = in->style.fill_rule;
+ out->style.fill_url = NULL;
+ out->style.fill_pointer = NULL;
+ if (in->style.fill_url != NULL)
+ svg_add_fill_gradient_url (&(out->style), in->style.fill_url);
+ out->style.fill_red = in->style.fill_red;
+ out->style.fill_green = in->style.fill_green;
+ out->style.fill_blue = in->style.fill_blue;
+ out->style.fill_opacity = in->style.fill_opacity;
+ out->style.stroke = in->style.stroke;
+ out->style.no_stroke = in->style.no_stroke;
+ out->style.stroke_width = in->style.stroke_width;
+ out->style.stroke_linecap = in->style.stroke_linecap;
+ out->style.stroke_linejoin = in->style.stroke_linejoin;
+ out->style.stroke_miterlimit = in->style.stroke_miterlimit;
+ out->style.stroke_dashitems = 0;
+ out->style.stroke_dasharray = NULL;
+ if (in->style.stroke_dashitems > 0)
+ {
+ out->style.stroke_dashitems = in->style.stroke_dashitems;
+ if (out->style.stroke_dasharray != NULL)
+ free (out->style.stroke_dasharray);
+ out->style.stroke_dasharray = NULL;
+ if (in->style.stroke_dashitems > 0)
+ {
+ int i;
+ out->style.stroke_dasharray =
+ malloc (sizeof (double) * in->style.stroke_dashitems);
+ for (i = 0; i < in->style.stroke_dashitems; i++)
+ out->style.stroke_dasharray[i] =
+ in->style.stroke_dasharray[i];
+ }
+ out->style.stroke_dashoffset = in->style.stroke_dashoffset;
+ }
+ out->style.stroke_url = NULL;
+ out->style.stroke_pointer = NULL;
+ if (in->style.stroke_url != NULL)
+ svg_add_stroke_gradient_url (&(out->style), in->style.stroke_url);
+ out->style.stroke_red = in->style.stroke_red;
+ out->style.stroke_green = in->style.stroke_green;
+ out->style.stroke_blue = in->style.stroke_blue;
+ out->style.stroke_opacity = in->style.stroke_opacity;
+ out->style.clip_url = NULL;
+ out->style.clip_pointer = NULL;
+ if (in->style.clip_url != NULL)
+ svg_add_clip_url (&(out->style), in->style.clip_url);
+ out->first_trans = NULL;
+ out->last_trans = NULL;
+ pt = in->first_trans;
+ while (pt)
+ {
+ /* clonig all transformations */
+ trans = svg_clone_transform (pt);
+ if (out->first_trans == NULL)
+ out->first_trans = trans;
+ if (out->last_trans != NULL)
+ out->last_trans->next = trans;
+ out->last_trans = trans;
+ pt = pt->next;
+ }
+ out->is_defs = 0;
+ out->is_flow_root = 0;
+ out->next = NULL;
+ if (use != NULL)
+ {
+ /* adding the Use-level defs */
+ pt = use->first_trans;
+ while (pt)
+ {
+ /* clonig all Use transformations */
+ trans = svg_clone_transform (pt);
+ if (out->first_trans == NULL)
+ out->first_trans = trans;
+ if (out->last_trans != NULL)
+ out->last_trans->next = trans;
+ out->last_trans = trans;
+ pt = pt->next;
+ }
+ if (use->x != DBL_MAX || use->y != DBL_MAX)
+ {
+ /* adding the implict Use Translate transformation */
+ rl2PrivSvgTranslatePtr translate = NULL;
+ if (use->x != DBL_MAX && use->y != DBL_MAX)
+ translate = svg_alloc_translate (use->x, use->y);
+ else if (use->x != DBL_MAX)
+ translate = svg_alloc_translate (use->x, 0.0);
+ else if (use->y != DBL_MAX)
+ translate = svg_alloc_translate (0.0, use->y);
+ trans = svg_alloc_transform (RL2_SVG_TRANSLATE, translate);
+ if (out->first_trans == NULL)
+ out->first_trans = trans;
+ if (out->last_trans != NULL)
+ out->last_trans->next = trans;
+ out->last_trans = trans;
+ }
+ /* Use-level styles */
+ if (use->style.visibility >= 0)
+ out->style.visibility = use->style.visibility;
+ out->style.opacity = use->style.opacity;
+ if (use->style.fill >= 0)
+ out->style.fill = use->style.fill;
+ if (use->style.no_fill >= 0)
+ out->style.no_fill = use->style.no_fill;
+ if (use->style.fill_rule >= 0)
+ out->style.fill_rule = use->style.fill_rule;
+ if (use->style.fill_url != NULL)
+ svg_add_fill_gradient_url (&(out->style), use->style.fill_url);
+ if (use->style.fill_red >= 0.0)
+ out->style.fill_red = use->style.fill_red;
+ if (use->style.fill_green >= 0.0)
+ out->style.fill_green = use->style.fill_green;
+ if (use->style.fill_blue >= 0.0)
+ out->style.fill_blue = use->style.fill_blue;
+ if (use->style.fill_opacity >= 0.0)
+ out->style.fill_opacity = use->style.fill_opacity;
+ if (use->style.stroke >= 0)
+ out->style.stroke = use->style.stroke;
+ if (use->style.no_stroke >= 0)
+ out->style.no_stroke = use->style.no_stroke;
+ if (use->style.stroke_width >= 0.0)
+ out->style.stroke_width = use->style.stroke_width;
+ if (use->style.stroke_linecap >= 0)
+ out->style.stroke_linecap = use->style.stroke_linecap;
+ if (use->style.stroke_linejoin >= 0)
+ out->style.stroke_linejoin = use->style.stroke_linejoin;
+ if (use->style.stroke_miterlimit >= 0.0)
+ out->style.stroke_miterlimit = use->style.stroke_miterlimit;
+ if (use->style.stroke_dashitems > 0)
+ {
+ out->style.stroke_dashitems = use->style.stroke_dashitems;
+ if (out->style.stroke_dasharray != NULL)
+ free (out->style.stroke_dasharray);
+ out->style.stroke_dasharray = NULL;
+ if (use->style.stroke_dashitems > 0)
+ {
+ int i;
+ out->style.stroke_dasharray =
+ malloc (sizeof (double) *
+ use->style.stroke_dashitems);
+ for (i = 0; i < use->style.stroke_dashitems; i++)
+ out->style.stroke_dasharray[i] =
+ use->style.stroke_dasharray[i];
+ }
+ out->style.stroke_dashoffset = use->style.stroke_dashoffset;
+ }
+ if (use->style.stroke_url != NULL)
+ svg_add_stroke_gradient_url (&(out->style),
+ use->style.stroke_url);
+ if (use->style.stroke_red >= 0.0)
+ out->style.stroke_red = use->style.stroke_red;
+ if (use->style.stroke_green >= 0.0)
+ out->style.stroke_green = use->style.stroke_green;
+ if (use->style.stroke_blue >= 0.0)
+ out->style.stroke_blue = use->style.stroke_blue;
+ if (use->style.stroke_opacity >= 0.0)
+ out->style.stroke_opacity = use->style.stroke_opacity;
+ if (use->style.clip_url != NULL)
+ svg_add_clip_url (&(out->style), use->style.clip_url);
+ }
+ return out;
+}
+
+RL2_PRIVATE void
+svg_add_shape_id (rl2PrivSvgShapePtr shape, const char *id)
+{
+/* setting the ID for some Shape */
+ int len = strlen (id);
+ if (shape->id != NULL)
+ free (shape->id);
+ shape->id = malloc (len + 1);
+ strcpy (shape->id, id);
+}
+
+RL2_PRIVATE rl2PrivSvgUsePtr
+svg_alloc_use (void *parent, const char *xlink_href, double x, double y,
+ double width, double height)
+{
+/* allocating and initializing an empty SVG Use (xlink:href) */
+ int len = strlen (xlink_href);
+ rl2PrivSvgUsePtr p = malloc (sizeof (rl2PrivSvgUse));
+ p->xlink_href = malloc (len + 1);
+ strcpy (p->xlink_href, xlink_href);
+ p->x = x;
+ p->y = y;
+ p->width = width;
+ p->height = height;
+ p->parent = parent;
+ svg_init_style (&(p->style));
+ p->first_trans = NULL;
+ p->last_trans = NULL;
+ p->next = NULL;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgUsePtr
+svg_clone_use (rl2PrivSvgUsePtr in)
+{
+/* cloning an SVG Use (xlink:href) */
+ rl2PrivSvgTransformPtr pt;
+ rl2PrivSvgTransformPtr trans;
+ int len = strlen (in->xlink_href);
+ rl2PrivSvgUsePtr out = malloc (sizeof (rl2PrivSvgUse));
+ out->xlink_href = malloc (len + 1);
+ strcpy (out->xlink_href, in->xlink_href);
+ out->x = in->x;
+ out->y = in->y;
+ out->width = in->width;
+ out->height = in->height;
+ out->parent = in->parent;
+ out->style.visibility = in->style.visibility;
+ out->style.opacity = in->style.opacity;
+ out->style.fill = in->style.fill;
+ out->style.no_fill = in->style.no_fill;
+ out->style.fill_rule = in->style.fill_rule;
+ out->style.fill_url = NULL;
+ out->style.fill_pointer = NULL;
+ if (in->style.fill_url != NULL)
+ svg_add_fill_gradient_url (&(out->style), in->style.fill_url);
+ out->style.fill_red = in->style.fill_red;
+ out->style.fill_green = in->style.fill_green;
+ out->style.fill_blue = in->style.fill_blue;
+ out->style.fill_opacity = in->style.fill_opacity;
+ out->style.stroke = in->style.stroke;
+ out->style.no_stroke = in->style.no_stroke;
+ out->style.stroke_width = in->style.stroke_width;
+ out->style.stroke_linecap = in->style.stroke_linecap;
+ out->style.stroke_linejoin = in->style.stroke_linejoin;
+ out->style.stroke_miterlimit = in->style.stroke_miterlimit;
+ out->style.stroke_dashitems = 0;
+ out->style.stroke_dasharray = NULL;
+ if (in->style.stroke_dashitems > 0)
+ {
+ out->style.stroke_dashitems = in->style.stroke_dashitems;
+ if (out->style.stroke_dasharray != NULL)
+ free (out->style.stroke_dasharray);
+ out->style.stroke_dasharray = NULL;
+ if (in->style.stroke_dashitems > 0)
+ {
+ int i;
+ out->style.stroke_dasharray =
+ malloc (sizeof (double) * in->style.stroke_dashitems);
+ for (i = 0; i < in->style.stroke_dashitems; i++)
+ out->style.stroke_dasharray[i] =
+ in->style.stroke_dasharray[i];
+ }
+ out->style.stroke_dashoffset = in->style.stroke_dashoffset;
+ }
+ out->style.stroke_url = NULL;
+ out->style.stroke_pointer = NULL;
+ if (in->style.stroke_url != NULL)
+ svg_add_stroke_gradient_url (&(out->style), in->style.stroke_url);
+ out->style.stroke_red = in->style.stroke_red;
+ out->style.stroke_green = in->style.stroke_green;
+ out->style.stroke_blue = in->style.stroke_blue;
+ out->style.stroke_opacity = in->style.stroke_opacity;
+ out->style.clip_url = NULL;
+ out->style.clip_pointer = NULL;
+ if (in->style.clip_url != NULL)
+ svg_add_clip_url (&(out->style), in->style.clip_url);
+ out->first_trans = NULL;
+ out->last_trans = NULL;
+ pt = in->first_trans;
+ while (pt)
+ {
+ /* clonig all transformations */
+ trans = svg_clone_transform (pt);
+ if (out->first_trans == NULL)
+ out->first_trans = trans;
+ if (out->last_trans != NULL)
+ out->last_trans->next = trans;
+ out->last_trans = trans;
+ pt = pt->next;
+ }
+ out->next = NULL;
+ return out;
+}
+
+RL2_PRIVATE rl2PrivSvgGroupPtr
+svg_alloc_group (void)
+{
+/* allocating and initializing an empty SVG Group <g> */
+ rl2PrivSvgGroupPtr p = malloc (sizeof (rl2PrivSvgGroup));
+ p->id = NULL;
+ svg_init_style (&(p->style));
+ p->parent = NULL;
+ p->first = NULL;
+ p->last = NULL;
+ p->first_trans = NULL;
+ p->last_trans = NULL;
+ p->is_defs = 0;
+ p->is_flow_root = 0;
+ p->next = NULL;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgGroupPtr
+svg_clone_group (rl2PrivSvgGroupPtr in, rl2PrivSvgUsePtr use)
+{
+/* cloning an SVG Group */
+ rl2PrivSvgTransformPtr pt;
+ rl2PrivSvgTransformPtr trans;
+ rl2PrivSvgItemPtr item;
+ rl2PrivSvgItemPtr itm;
+ rl2PrivSvgGroupPtr out = malloc (sizeof (rl2PrivSvgGroup));
+ out->id = NULL;
+ out->style.visibility = in->style.visibility;
+ out->style.opacity = in->style.opacity;
+ out->style.fill = in->style.fill;
+ out->style.no_fill = in->style.no_fill;
+ out->style.fill_rule = in->style.fill_rule;
+ out->style.fill_url = NULL;
+ out->style.fill_pointer = NULL;
+ if (in->style.fill_url != NULL)
+ svg_add_fill_gradient_url (&(out->style), in->style.fill_url);
+ out->style.fill_red = in->style.fill_red;
+ out->style.fill_green = in->style.fill_green;
+ out->style.fill_blue = in->style.fill_blue;
+ out->style.fill_opacity = in->style.fill_opacity;
+ out->style.stroke = in->style.stroke;
+ out->style.no_stroke = in->style.no_stroke;
+ out->style.stroke_width = in->style.stroke_width;
+ out->style.stroke_linecap = in->style.stroke_linecap;
+ out->style.stroke_linejoin = in->style.stroke_linejoin;
+ out->style.stroke_miterlimit = in->style.stroke_miterlimit;
+ out->style.stroke_dashitems = 0;
+ out->style.stroke_dasharray = NULL;
+ if (in->style.stroke_dashitems > 0)
+ {
+ out->style.stroke_dashitems = in->style.stroke_dashitems;
+ if (out->style.stroke_dasharray != NULL)
+ free (out->style.stroke_dasharray);
+ out->style.stroke_dasharray = NULL;
+ if (in->style.stroke_dashitems > 0)
+ {
+ int i;
+ out->style.stroke_dasharray =
+ malloc (sizeof (double) * in->style.stroke_dashitems);
+ for (i = 0; i < in->style.stroke_dashitems; i++)
+ out->style.stroke_dasharray[i] =
+ in->style.stroke_dasharray[i];
+ }
+ out->style.stroke_dashoffset = in->style.stroke_dashoffset;
+ }
+ out->style.stroke_url = NULL;
+ out->style.stroke_pointer = NULL;
+ if (in->style.stroke_url != NULL)
+ svg_add_stroke_gradient_url (&(out->style), in->style.stroke_url);
+ out->style.stroke_red = in->style.stroke_red;
+ out->style.stroke_green = in->style.stroke_green;
+ out->style.stroke_blue = in->style.stroke_blue;
+ out->style.stroke_opacity = in->style.stroke_opacity;
+ out->style.clip_url = NULL;
+ out->style.clip_pointer = NULL;
+ if (in->style.clip_url != NULL)
+ svg_add_clip_url (&(out->style), in->style.clip_url);
+ if (use != NULL)
+ out->parent = use->parent;
+ else
+ out->parent = in->parent;
+ out->first = NULL;
+ out->last = NULL;
+ out->is_defs = 0;
+ out->is_flow_root = 0;
+ item = in->first;
+ while (item)
+ {
+ /* looping on Group Items */
+ itm = svg_clone_item (item);
+ svg_set_group_parent (itm, out);
+ if (out->first == NULL)
+ out->first = itm;
+ if (out->last != NULL)
+ out->last->next = itm;
+ out->last = itm;
+ item = item->next;
+ }
+ out->first_trans = NULL;
+ out->last_trans = NULL;
+ out->next = NULL;
+ if (use != NULL)
+ {
+ /* adding the Use-level defs */
+ pt = use->first_trans;
+ while (pt)
+ {
+ /* clonig all Use transformations */
+ trans = svg_clone_transform (pt);
+ if (out->first_trans == NULL)
+ out->first_trans = trans;
+ if (out->last_trans != NULL)
+ out->last_trans->next = trans;
+ out->last_trans = trans;
+ pt = pt->next;
+ }
+ }
+ pt = in->first_trans;
+ while (pt)
+ {
+ /* clonig all transformations */
+ trans = svg_clone_transform (pt);
+ if (out->first_trans == NULL)
+ out->first_trans = trans;
+ if (out->last_trans != NULL)
+ out->last_trans->next = trans;
+ out->last_trans = trans;
+ pt = pt->next;
+ }
+ if (use != NULL)
+ {
+ /* adding the Use-level defs */
+ if (use->x != DBL_MAX || use->y != DBL_MAX)
+ {
+ /* adding the implict Use Translate transformation */
+ rl2PrivSvgTranslatePtr translate = NULL;
+ if (use->x != DBL_MAX && use->y != DBL_MAX)
+ translate = svg_alloc_translate (use->x, use->y);
+ else if (use->x != DBL_MAX)
+ translate = svg_alloc_translate (use->x, 0.0);
+ else if (use->y != DBL_MAX)
+ translate = svg_alloc_translate (0.0, use->y);
+ trans = svg_alloc_transform (RL2_SVG_TRANSLATE, translate);
+ if (out->first_trans == NULL)
+ out->first_trans = trans;
+ if (out->last_trans != NULL)
+ out->last_trans->next = trans;
+ out->last_trans = trans;
+ }
+ /* Use-level styles */
+ if (use->style.visibility >= 0)
+ out->style.visibility = use->style.visibility;
+ out->style.opacity = use->style.opacity;
+ if (use->style.fill >= 0)
+ out->style.fill = use->style.fill;
+ if (use->style.no_fill >= 0)
+ out->style.no_fill = use->style.no_fill;
+ if (use->style.fill_rule >= 0)
+ out->style.fill_rule = use->style.fill_rule;
+ if (use->style.fill_url != NULL)
+ svg_add_fill_gradient_url (&(out->style), use->style.fill_url);
+ if (use->style.fill_red >= 0.0)
+ out->style.fill_red = use->style.fill_red;
+ if (use->style.fill_green >= 0.0)
+ out->style.fill_green = use->style.fill_green;
+ if (use->style.fill_blue >= 0.0)
+ out->style.fill_blue = use->style.fill_blue;
+ if (use->style.fill_opacity >= 0.0)
+ out->style.fill_opacity = use->style.fill_opacity;
+ if (use->style.stroke >= 0)
+ out->style.stroke = use->style.stroke;
+ if (use->style.no_stroke >= 0)
+ out->style.no_stroke = use->style.no_stroke;
+ if (use->style.stroke_width >= 0.0)
+ out->style.stroke_width = use->style.stroke_width;
+ if (use->style.stroke_linecap >= 0)
+ out->style.stroke_linecap = use->style.stroke_linecap;
+ if (use->style.stroke_linejoin >= 0)
+ out->style.stroke_linejoin = use->style.stroke_linejoin;
+ if (use->style.stroke_miterlimit >= 0.0)
+ out->style.stroke_miterlimit = use->style.stroke_miterlimit;
+ if (in->style.stroke_dashitems > 0)
+ {
+ out->style.stroke_dashitems = use->style.stroke_dashitems;
+ if (out->style.stroke_dasharray != NULL)
+ free (out->style.stroke_dasharray);
+ out->style.stroke_dasharray = NULL;
+ if (use->style.stroke_dashitems > 0)
+ {
+ int i;
+ out->style.stroke_dasharray =
+ malloc (sizeof (double) *
+ use->style.stroke_dashitems);
+ for (i = 0; i < use->style.stroke_dashitems; i++)
+ out->style.stroke_dasharray[i] =
+ use->style.stroke_dasharray[i];
+ }
+ out->style.stroke_dashoffset = use->style.stroke_dashoffset;
+ }
+ if (use->style.stroke_url != NULL)
+ svg_add_stroke_gradient_url (&(out->style),
+ use->style.stroke_url);
+ if (use->style.stroke_red >= 0.0)
+ out->style.stroke_red = use->style.stroke_red;
+ if (use->style.stroke_green >= 0.0)
+ out->style.stroke_green = use->style.stroke_green;
+ if (use->style.stroke_blue >= 0.0)
+ out->style.stroke_blue = use->style.stroke_blue;
+ if (use->style.stroke_opacity >= 0.0)
+ out->style.stroke_opacity = use->style.stroke_opacity;
+ if (use->style.clip_url != NULL)
+ svg_add_clip_url (&(out->style), use->style.clip_url);
+ }
+ out->next = NULL;
+ return out;
+}
+
+RL2_PRIVATE rl2PrivSvgClipPtr
+svg_alloc_clip (void)
+{
+/* allocating and initializing an empty SVG ClipPath */
+ rl2PrivSvgClipPtr p = malloc (sizeof (rl2PrivSvgClip));
+ p->id = NULL;
+ p->first = NULL;
+ p->last = NULL;
+ p->next = NULL;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgClipPtr
+svg_clone_clip (rl2PrivSvgClipPtr in)
+{
+/* cloning an SVG ClipPath */
+ rl2PrivSvgItemPtr item;
+ rl2PrivSvgItemPtr itm;
+ rl2PrivSvgClipPtr out = malloc (sizeof (rl2PrivSvgClip));
+ out->id = NULL;
+ out->first = NULL;
+ out->last = NULL;
+ item = in->first;
+ while (item)
+ {
+ /* looping on Group Items */
+ itm = svg_clone_item (item);
+ if (out->first == NULL)
+ out->first = itm;
+ if (out->last != NULL)
+ out->last->next = itm;
+ out->last = itm;
+ item = item->next;
+ }
+ out->next = NULL;
+ return out;
+}
+
+RL2_PRIVATE void
+svg_add_group_id (rl2PrivSvgGroupPtr group, const char *id)
+{
+/* setting the ID for some Group */
+ int len = strlen (id);
+ if (group->id != NULL)
+ free (group->id);
+ group->id = malloc (len + 1);
+ strcpy (group->id, id);
+}
+
+RL2_PRIVATE void
+svg_add_clip_id (rl2PrivSvgClipPtr clip, const char *id)
+{
+/* setting the ID for some ClipPath */
+ int len = strlen (id);
+ if (clip->id != NULL)
+ free (clip->id);
+ clip->id = malloc (len + 1);
+ strcpy (clip->id, id);
+}
+
+RL2_PRIVATE rl2PrivSvgItemPtr
+svg_alloc_item (int type, void *pointer)
+{
+/* allocating and initializing an empty SVG item */
+ rl2PrivSvgItemPtr p = malloc (sizeof (rl2PrivSvgItem));
+ p->type = type;
+ p->pointer = pointer;
+ p->next = NULL;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgItemPtr
+svg_clone_item (rl2PrivSvgItemPtr in)
+{
+/* cloning an SVG item */
+ rl2PrivSvgGroupPtr group;
+ rl2PrivSvgShapePtr shape;
+ rl2PrivSvgUsePtr use;
+ rl2PrivSvgClipPtr clip;
+ rl2PrivSvgItemPtr p = malloc (sizeof (rl2PrivSvgItem));
+ p->type = in->type;
+ switch (in->type)
+ {
+ case RL2_SVG_ITEM_GROUP:
+ group = in->pointer;
+ p->pointer = svg_clone_group (group, NULL);
+ break;
+ case RL2_SVG_ITEM_SHAPE:
+ shape = in->pointer;
+ p->pointer = svg_clone_shape (shape, NULL);
+ break;
+ case RL2_SVG_ITEM_USE:
+ use = in->pointer;
+ p->pointer = svg_clone_use (use);
+ case RL2_SVG_ITEM_CLIP:
+ clip = in->pointer;
+ p->pointer = svg_clone_clip (clip);
+ break;
+ };
+ p->next = NULL;
+ return p;
+}
+
+RL2_PRIVATE void
+svg_set_group_parent (rl2PrivSvgItemPtr item, rl2PrivSvgGroupPtr grp)
+{
+/* cloning an SVG item */
+ rl2PrivSvgGroupPtr group;
+ rl2PrivSvgShapePtr shape;
+ rl2PrivSvgUsePtr use;
+ switch (item->type)
+ {
+ case RL2_SVG_ITEM_GROUP:
+ group = item->pointer;
+ group->parent = grp;
+ break;
+ case RL2_SVG_ITEM_SHAPE:
+ shape = item->pointer;
+ shape->parent = grp;
+ break;
+ case RL2_SVG_ITEM_USE:
+ use = item->pointer;
+ use->parent = grp;
+ break;
+ };
+}
+
+RL2_PRIVATE rl2PrivSvgGradientStopPtr
+svg_alloc_gradient_stop (double offset, double red, double green,
+ double blue, double opacity)
+{
+/* allocating and initializing an SVG GradientStop */
+ rl2PrivSvgGradientStopPtr p = malloc (sizeof (rl2PrivSvgGradientStop));
+ p->offset = offset;
+ p->red = red;
+ p->green = green;
+ p->blue = blue;
+ p->opacity = opacity;
+ p->next = NULL;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgGradientStopPtr
+svg_clone_gradient_stop (rl2PrivSvgGradientStopPtr in)
+{
+/* cloning an SVG GradientStop */
+ rl2PrivSvgGradientStopPtr out = malloc (sizeof (rl2PrivSvgGradientStop));
+ out->offset = in->offset;
+ out->red = in->red;
+ out->green = in->green;
+ out->blue = in->blue;
+ out->opacity = in->opacity;
+ out->next = NULL;
+ return out;
+}
+
+RL2_PRIVATE rl2PrivSvgGradientPtr
+svg_alloc_gradient (void)
+{
+/* allocating and initializing an empty SVG Gradient */
+ rl2PrivSvgGradientPtr p = malloc (sizeof (rl2PrivSvgGradient));
+ p->type = -1;
+ p->id = NULL;
+ p->xlink_href = NULL;
+ p->gradient_units = -1;
+ p->x1 = DBL_MAX;
+ p->y1 = DBL_MAX;
+ p->x2 = DBL_MAX;
+ p->y2 = DBL_MAX;
+ p->cx = DBL_MAX;
+ p->cy = DBL_MAX;
+ p->fx = DBL_MAX;
+ p->fy = DBL_MAX;
+ p->r = DBL_MAX;
+ p->first_trans = NULL;
+ p->last_trans = NULL;
+ p->first_stop = NULL;
+ p->last_stop = NULL;
+ p->next = NULL;
+ p->prev = NULL;
+ return p;
+}
+
+RL2_PRIVATE rl2PrivSvgGradientPtr
+svg_clone_gradient (rl2PrivSvgGradientPtr in, rl2PrivSvgGradientPtr old)
+{
+/* cloning an SVG Gradient */
+ rl2PrivSvgTransformPtr pt;
+ rl2PrivSvgTransformPtr trans;
+ rl2PrivSvgGradientStopPtr ps;
+ rl2PrivSvgGradientStopPtr stop;
+ int len;
+ rl2PrivSvgGradientPtr out = malloc (sizeof (rl2PrivSvgGradient));
+ out->type = old->type;
+ out->id = NULL;
+ out->xlink_href = NULL;
+ if (old->id != NULL)
+ {
+ len = strlen (old->id);
+ out->id = malloc (len + 1);
+ strcpy (out->id, old->id);
+ }
+ if (old->xlink_href != NULL)
+ {
+ len = strlen (old->xlink_href);
+ out->xlink_href = malloc (len + 1);
+ strcpy (out->xlink_href, old->xlink_href);
+ }
+ out->gradient_units = in->gradient_units;
+ if (old->gradient_units >= 0)
+ out->gradient_units = old->gradient_units;
+ out->x1 = in->x1;
+ if (old->x1 != DBL_MAX)
+ out->x1 = old->x1;
+ out->y1 = in->y1;
+ if (old->y1 != DBL_MAX)
+ out->y1 = old->y1;
+ out->x2 = in->x2;
+ if (old->x2 != DBL_MAX)
+ out->x2 = old->x2;
+ out->y2 = in->y2;
+ if (old->y2 != DBL_MAX)
+ out->y2 = old->y2;
+ out->cx = in->cx;
+ if (old->cx != DBL_MAX)
+ out->cx = old->cx;
+ out->cy = in->cy;
+ if (old->cy != DBL_MAX)
+ out->cy = old->cy;
+ out->fx = in->fx;
+ if (old->fx != DBL_MAX)
+ out->fx = old->fx;
+ out->fy = in->fy;
+ if (old->fy != DBL_MAX)
+ out->fy = old->fy;
+ out->r = in->r;
+ if (old->r != DBL_MAX)
+ out->r = old->r;
+ out->first_trans = NULL;
+ out->last_trans = NULL;
+ out->first_stop = NULL;
+ out->last_stop = NULL;
+ pt = in->first_trans;
+ while (pt)
+ {
+ /* clonig all inherited transformations */
+ trans = svg_clone_transform (pt);
+ if (out->first_trans == NULL)
+ out->first_trans = trans;
+ if (out->last_trans != NULL)
+ out->last_trans->next = trans;
+ out->last_trans = trans;
+ pt = pt->next;
+ }
+ pt = old->first_trans;
+ while (pt)
+ {
+ /* clonig all direct transformations */
+ trans = svg_clone_transform (pt);
+ if (out->first_trans == NULL)
+ out->first_trans = trans;
+ if (out->last_trans != NULL)
+ out->last_trans->next = trans;
+ out->last_trans = trans;
+ pt = pt->next;
+ }
+ ps = in->first_stop;
+ while (ps)
+ {
+ /* clonig all inherited Stops */
+ stop = svg_clone_gradient_stop (ps);
+ if (out->first_stop == NULL)
+ out->first_stop = stop;
+ if (out->last_stop != NULL)
+ out->last_stop->next = stop;
+ out->last_stop = stop;
+ ps = ps->next;
+ }
+ ps = old->first_stop;
+ while (ps)
+ {
+ /* clonig all inherited Stops */
+ stop = svg_clone_gradient_stop (ps);
+ if (out->first_stop == NULL)
+ out->first_stop = stop;
+ if (out->last_stop != NULL)
+ out->last_stop->next = stop;
+ out->last_stop = stop;
+ ps = ps->next;
+ }
+ out->next = NULL;
+ out->prev = NULL;
+ return out;
+}
+
+RL2_PRIVATE rl2PrivSvgDocumentPtr
+svg_alloc_document (void)
+{
+/* allocating and initializing an empty SVG Document */
+ rl2PrivSvgDocumentPtr p = malloc (sizeof (rl2PrivSvgDocument));
+ p->width = 0.0;
+ p->height = 0.0;
+ p->viewbox_x = DBL_MIN;
+ p->viewbox_y = DBL_MIN;
+ p->viewbox_width = DBL_MIN;
+ p->viewbox_height = DBL_MIN;
+ p->first = NULL;
+ p->last = NULL;
+ p->first_grad = NULL;
+ p->last_grad = NULL;
+ p->current_group = NULL;
+ p->current_shape = NULL;
+ p->current_clip = NULL;
+ p->defs_count = 0;
+ p->flow_root_count = 0;
+ return p;
+}
+
+RL2_PRIVATE void
+svg_close_group (rl2PrivSvgDocumentPtr svg_doc)
+{
+/* closing the current SVG Group */
+ rl2PrivSvgGroupPtr group = svg_doc->current_group;
+ svg_doc->current_group = group->parent;
+}
+
+RL2_PRIVATE void
+svg_insert_group (rl2PrivSvgDocumentPtr svg_doc)
+{
+/* inserting a new Group into the SVG Document */
+ rl2PrivSvgItemPtr item;
+ rl2PrivSvgGroupPtr parent;
+ rl2PrivSvgGroupPtr group = svg_alloc_group ();
+ if (svg_doc->current_group != NULL)
+ {
+ /* nested group */
+ parent = svg_doc->current_group;
+ group->parent = parent;
+ if (svg_doc->defs_count > 0)
+ group->is_defs = 1;
+ if (svg_doc->flow_root_count > 0)
+ group->is_flow_root = 1;
+ item = svg_alloc_item (RL2_SVG_ITEM_GROUP, group);
+ if (parent->first == NULL)
+ parent->first = item;
+ if (parent->last != NULL)
+ parent->last->next = item;
+ parent->last = item;
+ svg_doc->current_group = group;
+ return;
+ }
+ if (svg_doc->current_clip != NULL)
+ {
+ /* ClipPath group */
+ if (svg_doc->defs_count > 0)
+ group->is_defs = 1;
+ if (svg_doc->flow_root_count > 0)
+ group->is_flow_root = 1;
+ item = svg_alloc_item (RL2_SVG_ITEM_GROUP, group);
+ if (svg_doc->current_clip->first == NULL)
+ svg_doc->current_clip->first = item;
+ if (svg_doc->current_clip->last != NULL)
+ svg_doc->current_clip->last->next = item;
+ svg_doc->current_clip->last = item;
+ svg_doc->current_group = group;
+ return;
+ }
+/* first level Group */
+ parent = svg_doc->current_group;
+ group->parent = parent;
+ if (svg_doc->defs_count > 0)
+ group->is_defs = 1;
+ if (svg_doc->flow_root_count > 0)
+ group->is_flow_root = 1;
+ item = svg_alloc_item (RL2_SVG_ITEM_GROUP, group);
+ if (svg_doc->first == NULL)
+ svg_doc->first = item;
+ if (svg_doc->last != NULL)
+ svg_doc->last->next = item;
+ svg_doc->last = item;
+ svg_doc->current_group = group;
+}
+
+RL2_PRIVATE void
+svg_close_clip (rl2PrivSvgDocumentPtr svg_doc)
+{
+/* closing the current SVG ClipPath */
+ svg_doc->current_clip = NULL;
+}
+
+RL2_PRIVATE void
+svg_insert_clip (rl2PrivSvgDocumentPtr svg_doc)
+{
+/* inserting a new ClipPath into the SVG Document */
+ rl2PrivSvgItemPtr item;
+ rl2PrivSvgClipPtr clip = svg_alloc_clip ();
+ item = svg_alloc_item (RL2_SVG_ITEM_CLIP, clip);
+ if (svg_doc->first == NULL)
+ svg_doc->first = item;
+ if (svg_doc->last != NULL)
+ svg_doc->last->next = item;
+ svg_doc->last = item;
+ svg_doc->current_clip = clip;
+}
+
+RL2_PRIVATE rl2PrivSvgUsePtr
+svg_insert_use (rl2PrivSvgDocumentPtr svg_doc, const char *xlink_href,
+ double x, double y, double width, double height)
+{
+/* inserting a new Use (xlink:href) into the SVG Document */
+ rl2PrivSvgUsePtr use;
+ rl2PrivSvgGroupPtr group;
+ rl2PrivSvgClipPtr clip;
+ rl2PrivSvgItemPtr item;
+
+ if (svg_doc->current_group == NULL && svg_doc->current_clip == NULL)
+ {
+ /* inserting directly into the Document */
+ use = svg_alloc_use (NULL, xlink_href, x, y, width, height);
+ item = svg_alloc_item (RL2_SVG_ITEM_USE, use);
+ if (svg_doc->first == NULL)
+ svg_doc->first = item;
+ if (svg_doc->last != NULL)
+ svg_doc->last->next = item;
+ svg_doc->last = item;
+ }
+ else if (svg_doc->current_clip != NULL)
+ {
+ /* inserting into the current ClipPath */
+ clip = svg_doc->current_clip;
+ use = svg_alloc_use (clip, xlink_href, x, y, width, height);
+ item = svg_alloc_item (RL2_SVG_ITEM_USE, use);
+ if (clip->first == NULL)
+ clip->first = item;
+ if (clip->last != NULL)
+ clip->last->next = item;
+ clip->last = item;
+ }
+ else if (svg_doc->current_group != NULL)
+ {
+ /* inserting into the current Group */
+ group = svg_doc->current_group;
+ use = svg_alloc_use (group, xlink_href, x, y, width, height);
+ item = svg_alloc_item (RL2_SVG_ITEM_USE, use);
+ if (group->first == NULL)
+ group->first = item;
+ if (group->last != NULL)
+ group->last->next = item;
+ group->last = item;
+ }
+ return use;
+}
+
+RL2_PRIVATE void
+svg_insert_shape (rl2PrivSvgDocumentPtr svg_doc, int type, void *data)
+{
+/* inserting a new Shape into the SVG Document */
+ rl2PrivSvgGroupPtr group;
+ rl2PrivSvgShapePtr shape;
+ rl2PrivSvgClipPtr clip;
+ rl2PrivSvgItemPtr item;
+
+ if (svg_doc->current_group == NULL && svg_doc->current_clip == NULL)
+ {
+ /* inserting directly into the Document */
+ shape = svg_alloc_shape (type, data, NULL);
+ if (svg_doc->defs_count > 0)
+ shape->is_defs = 1;
+ if (svg_doc->flow_root_count > 0)
+ shape->is_flow_root = 1;
+ item = svg_alloc_item (RL2_SVG_ITEM_SHAPE, shape);
+ if (svg_doc->first == NULL)
+ svg_doc->first = item;
+ if (svg_doc->last != NULL)
+ svg_doc->last->next = item;
+ svg_doc->last = item;
+ }
+ else if (svg_doc->current_group != NULL)
+ {
+ /* inserting into the current Group */
+ group = svg_doc->current_group;
+ shape = svg_alloc_shape (type, data, group);
+ if (svg_doc->defs_count > 0)
+ shape->is_defs = 1;
+ if (svg_doc->flow_root_count > 0)
+ shape->is_flow_root = 1;
+ item = svg_alloc_item (RL2_SVG_ITEM_SHAPE, shape);
+ if (group->first == NULL)
+ group->first = item;
+ if (group->last != NULL)
+ group->last->next = item;
+ group->last = item;
+ }
+ else if (svg_doc->current_clip != NULL)
+ {
+ /* inserting into the current ClipPath */
+ clip = svg_doc->current_clip;
+ shape = svg_alloc_shape (type, data, NULL);
+ if (svg_doc->defs_count > 0)
+ shape->is_defs = 1;
+ if (svg_doc->flow_root_count > 0)
+ shape->is_flow_root = 1;
+ item = svg_alloc_item (RL2_SVG_ITEM_SHAPE, shape);
+ if (clip->first == NULL)
+ clip->first = item;
+ if (clip->last != NULL)
+ clip->last->next = item;
+ clip->last = item;
+ }
+ svg_doc->current_shape = shape;
+}
+
+RL2_PRIVATE void
+svg_insert_gradient_stop (rl2PrivSvgGradientPtr gradient,
+ double offset, double red, double green,
+ double blue, double opacity)
+{
+/* inserting a Stop into a Gradient */
+ rl2PrivSvgGradientStopPtr stop =
+ svg_alloc_gradient_stop (offset, red, green, blue, opacity);
+ if (gradient->first_stop == NULL)
+ gradient->first_stop = stop;
+ if (gradient->last_stop != NULL)
+ gradient->last_stop->next = stop;
+ gradient->last_stop = stop;
+}
+
+RL2_PRIVATE rl2PrivSvgGradientPtr
+svg_insert_linear_gradient (rl2PrivSvgDocumentPtr svg_doc,
+ const char *id, const char *xlink_href,
+ double x1, double y1, double x2, double y2,
+ int units)
+{
+/* inserting a new Linear Gradient into the SVG Document */
+ int len;
+ rl2PrivSvgGradientPtr gradient = svg_alloc_gradient ();
+ gradient->type = RL2_SVG_LINEAR_GRADIENT;
+ gradient->id = NULL;
+ if (id != NULL)
+ {
+ len = strlen (id);
+ gradient->id = malloc (len + 1);
+ strcpy (gradient->id, id);
+ }
+ gradient->xlink_href = NULL;
+ if (xlink_href != NULL)
+ {
+ len = strlen (xlink_href);
+ gradient->xlink_href = malloc (len + 1);
+ strcpy (gradient->xlink_href, xlink_href);
+ }
+ gradient->gradient_units = units;
+ gradient->x1 = x1;
+ gradient->y1 = y1;
+ gradient->x2 = x2;
+ gradient->y2 = y2;
+ gradient->prev = svg_doc->last_grad;
+ if (svg_doc->first_grad == NULL)
+ svg_doc->first_grad = gradient;
+ if (svg_doc->last_grad != NULL)
+ svg_doc->last_grad->next = gradient;
+ svg_doc->last_grad = gradient;
+ return gradient;
+}
+
+RL2_PRIVATE rl2PrivSvgGradientPtr
+svg_insert_radial_gradient (rl2PrivSvgDocumentPtr svg_doc,
+ const char *id, const char *xlink_href,
+ double cx, double cy, double fx, double fy,
+ double r, int units)
+{
+/* inserting a new Linear Gradient into the SVG Document */
+ int len;
+ rl2PrivSvgGradientPtr gradient = svg_alloc_gradient ();
+ gradient->type = RL2_SVG_RADIAL_GRADIENT;
+ gradient->id = NULL;
+ if (id != NULL)
+ {
+ len = strlen (id);
+ gradient->id = malloc (len + 1);
+ strcpy (gradient->id, id);
+ }
+ gradient->xlink_href = NULL;
+ if (xlink_href != NULL)
+ {
+ len = strlen (xlink_href);
+ gradient->xlink_href = malloc (len + 1);
+ strcpy (gradient->xlink_href, xlink_href);
+ }
+ gradient->gradient_units = units;
+ gradient->cx = cx;
+ gradient->cy = cy;
+ gradient->fx = fx;
+ gradient->fy = fy;
+ gradient->r = r;
+ gradient->prev = svg_doc->last_grad;
+ if (svg_doc->first_grad == NULL)
+ svg_doc->first_grad = gradient;
+ if (svg_doc->last_grad != NULL)
+ svg_doc->last_grad->next = gradient;
+ svg_doc->last_grad = gradient;
+ return gradient;
+}
diff --git a/src/rl2svgxml.c b/src/rl2svgxml.c
new file mode 100644
index 0000000..bc67c67
--- /dev/null
+++ b/src/rl2svgxml.c
@@ -0,0 +1,2676 @@
+/*
+
+ rl2svg_xml -- SVG XML parsing methods
+
+ version 0.1, 2014 June 6
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <float.h>
+
+#include <libxml/parser.h>
+
+#ifdef __ANDROID__ /* Android specific */
+#include <cairo.h>
+#else /* any other standard platform (Win, Linux, Mac) */
+#include <cairo/cairo.h>
+#endif /* end Android conditionals */
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2svg.h"
+#include "rasterlite2_private.h"
+#include "rl2svg_private.h"
+
+struct svg_dyn_point
+{
+/* a temporary struct storing a Point */
+ double x;
+ double y;
+ struct svg_dyn_point *next;
+};
+
+struct svg_dyn_points
+{
+/* a linked list of temporary Points */
+ struct svg_dyn_point *first;
+ struct svg_dyn_point *last;
+ int points;
+};
+
+static void
+svg_free_dyn_points (struct svg_dyn_points *dyn)
+{
+/* freeing the auxiliary DynPoints */
+ struct svg_dyn_point *pn;
+ struct svg_dyn_point *p = dyn->first;
+ while (p)
+ {
+ pn = p->next;
+ free (p);
+ p = pn;
+ }
+}
+
+static void
+svg_add_point (struct svg_dyn_points *dyn, double x, double y)
+{
+ struct svg_dyn_point *p = malloc (sizeof (struct svg_dyn_point));
+ p->x = x;
+ p->y = y;
+ p->next = NULL;
+ if (dyn->first == NULL)
+ dyn->first = p;
+ if (dyn->last != NULL)
+ dyn->last->next = p;
+ dyn->last = p;
+ dyn->points += 1;
+}
+
+static void
+svg_parse_points (const char *str, int *points, double **p_x, double **p_y)
+{
+/* attempting to parse a list of Coordinates */
+ char value[1024];
+ char *p_out = value;
+ const char *p_in = str;
+ double x;
+ double y;
+ char xy = 'x';
+ struct svg_dyn_points dyn;
+
+ dyn.points = 0;
+ dyn.first = NULL;
+ dyn.last = NULL;
+
+ while (1)
+ {
+ /* scanning the XML string */
+ if (*p_in == '\0')
+ {
+ /* string end */
+ *p_out = '\0';
+ if (*value != '\0')
+ {
+ if (xy == 'y')
+ {
+ y = atof (value);
+ svg_add_point (&dyn, x, y);
+ xy = 'x';
+ }
+ else
+ x = atof (value);
+ }
+ break;
+ }
+ if (*p_in == '\n' || *p_in == ' ' || *p_in == '\t' || *p_in == '\r'
+ || *p_in == ',')
+ {
+ /* delimiter */
+ *p_out = '\0';
+ if (*value != '\0')
+ {
+ if (xy == 'y')
+ {
+ y = atof (value);
+ svg_add_point (&dyn, x, y);
+ xy = 'x';
+ }
+ else
+ x = atof (value);
+ }
+ if (*p_in == ',')
+ xy = 'y';
+ p_out = value;
+ p_in++;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+
+ if (dyn.points > 0)
+ {
+ /* creating the coord arrays to be returned */
+ int iv = 0;
+ struct svg_dyn_point *p = dyn.first;
+ double *xx = malloc (sizeof (double) * dyn.points);
+ double *yy = malloc (sizeof (double) * dyn.points);
+ while (p)
+ {
+ *(xx + iv) = p->x;
+ *(yy + iv) = p->y;
+ iv++;
+ p = p->next;
+ }
+ *points = dyn.points;
+ *p_x = xx;
+ *p_y = yy;
+ }
+ else
+ {
+ /* returning an empty list of coords */
+ *points = 0;
+ *p_x = NULL;
+ *p_y = NULL;
+ }
+/* freeing the DynPoints */
+ svg_free_dyn_points (&dyn);
+}
+
+static double
+svg_parse_hex_color (char hi, char lo)
+{
+/* parsing and hex Color value */
+ double color = 0;
+ switch (hi)
+ {
+ case '1':
+ color = 16;
+ break;
+ case '2':
+ color = 16 * 2;
+ break;
+ case '3':
+ color = 16 * 3;
+ break;
+ case '4':
+ color = 16 * 4;
+ break;
+ case '5':
+ color = 16 * 5;
+ break;
+ case '6':
+ color = 16 * 6;
+ break;
+ case '7':
+ color = 16 * 7;
+ break;
+ case '8':
+ color = 16 * 8;
+ break;
+ case '9':
+ color = 16 * 9;
+ break;
+ case 'a':
+ case 'A':
+ color = 16 * 10;
+ break;
+ case 'b':
+ case 'B':
+ color = 16 * 11;
+ break;
+ case 'c':
+ case 'C':
+ color = 16 * 12;
+ break;
+ case 'd':
+ case 'D':
+ color = 16 * 13;
+ break;
+ case 'e':
+ case 'E':
+ color = 16 * 14;
+ break;
+ case 'f':
+ case 'F':
+ color = 16 * 15;
+ break;
+ };
+ switch (lo)
+ {
+ case '1':
+ color += 1;
+ break;
+ case '2':
+ color += 2;
+ break;
+ case '3':
+ color += 3;
+ break;
+ case '4':
+ color += 4;
+ break;
+ case '5':
+ color += 5;
+ break;
+ case '6':
+ color += 6;
+ break;
+ case '7':
+ color += 7;
+ break;
+ case '8':
+ color += 8;
+ break;
+ case '9':
+ color += 9;
+ break;
+ case 'a':
+ case 'A':
+ color += 10;
+ break;
+ case 'b':
+ case 'B':
+ color += 11;
+ break;
+ case 'c':
+ case 'C':
+ color += 12;
+ break;
+ case 'd':
+ case 'D':
+ color += 13;
+ break;
+ case 'e':
+ case 'E':
+ color += 14;
+ break;
+ case 'f':
+ case 'F':
+ color += 15;
+ break;
+ };
+ return color / 255.0;
+}
+
+static void
+svg_from_named_color (char *buf, const char *color)
+{
+/* translating some CSS name into an hex RGB */
+ *buf = '\0';
+ if (strcmp (color, "black") == 0)
+ strcpy (buf, "#000000");
+ else if (strcmp (color, "silver") == 0)
+ strcpy (buf, "#C0C0C0");
+ else if (strcmp (color, "gray") == 0)
+ strcpy (buf, "#808080");
+ else if (strcmp (color, "white") == 0)
+ strcpy (buf, "#FFFFFF");
+ else if (strcmp (color, "maroon") == 0)
+ strcpy (buf, "#800000");
+ else if (strcmp (color, "red") == 0)
+ strcpy (buf, "#FF0000");
+ else if (strcmp (color, "purple") == 0)
+ strcpy (buf, "#800080");
+ else if (strcmp (color, "fuchsia") == 0)
+ strcpy (buf, "#FF00FF");
+ else if (strcmp (color, "green") == 0)
+ strcpy (buf, "#008000");
+ else if (strcmp (color, "lime") == 0)
+ strcpy (buf, "#00FF00");
+ else if (strcmp (color, "olive") == 0)
+ strcpy (buf, "#808000");
+ else if (strcmp (color, "yellow") == 0)
+ strcpy (buf, "#FFFF00");
+ else if (strcmp (color, "navy") == 0)
+ strcpy (buf, "#000080");
+ else if (strcmp (color, "blue") == 0)
+ strcpy (buf, "#0000FF");
+ else if (strcmp (color, "teal") == 0)
+ strcpy (buf, "#008080");
+ else if (strcmp (color, "aqua") == 0)
+ strcpy (buf, "#00FFFF");
+}
+
+static int
+svg_consume_float (const char **ptr, double *value)
+{
+/* attempting to parse a Double value from a string */
+ char buf[1024];
+ char *p_out = buf;
+ const char *p_in = *ptr;
+ int count_e = 0;
+ int count_pt = 0;
+ if (ptr == NULL)
+ return 0;
+ if (*ptr == '\0')
+ return 0;
+
+ while (1)
+ {
+ if (*p_in == '\0')
+ {
+ *p_out = '\0';
+ *ptr = p_in;
+ break;
+ }
+ if (p_out == buf)
+ {
+ if (*p_in == '-' || *p_in == '+')
+ {
+ *p_out++ = *p_in++;
+ continue;
+ }
+ if (*p_in == ',' || *p_in == ' ' || *p_in == '\t'
+ || *p_in == '\r' || *p_in == '\n')
+ {
+ p_in++;
+ continue;
+ }
+ }
+ if (*p_in >= '0' && *p_in <= '9')
+ {
+ *p_out++ = *p_in++;
+ continue;
+ }
+ else if (*p_in == 'e' || *p_in == 'E')
+ {
+ count_e++;
+ *p_out++ = *p_in++;
+ if (*p_in == '-' || *p_in == '+')
+ *p_out++ = *p_in++;
+ continue;
+ }
+ else if (*p_in == '.')
+ {
+ count_pt++;
+ *p_out++ = *p_in++;
+ continue;
+ }
+ else
+ {
+ *p_out = '\0';
+ switch (*p_in)
+ {
+ /* SVG Path keyword - unput */
+ case 'C':
+ case 'c':
+ case 'S':
+ case 's':
+ case 'Q':
+ case 'q':
+ case 'T':
+ case 't':
+ case 'M':
+ case 'm':
+ case 'L':
+ case 'l':
+ case 'H':
+ case 'h':
+ case 'V':
+ case 'v':
+ case 'A':
+ case 'a':
+ case 'Z':
+ case 'z':
+ case '+':
+ case '-':
+ p_in--;
+ break;
+ };
+ break;
+ }
+ }
+ if (count_pt > 1 || count_e > 1)
+ return 0;
+ if (*buf != '\0')
+ {
+ *value = atof (buf);
+ *ptr = p_in;
+ return 1;
+ }
+ return 0;
+}
+
+static void
+svg_parse_path_d (rl2PrivSvgPathPtr path, const char *value)
+{
+/* parsing an SVG Path <d> */
+ char keyword = '\0';
+ int count = 0;
+ const char *p_in = value;
+ double coord;
+ double coord_array[7];
+ double first_x = DBL_MAX;
+ double first_y = DBL_MAX;
+ double last_x = DBL_MAX;
+ double last_y = DBL_MAX;
+ double bezier_reflect_x;
+ double bezier_reflect_y;
+ double x;
+ double y;
+ double x1;
+ double y1;
+ double x2;
+ double y2;
+ void *data;
+ int last_m = 0;
+
+ while (1)
+ {
+ if (*p_in == '\0')
+ break;
+ switch (*p_in)
+ {
+ case ' ':
+ case '\t':
+ case '\n':
+ case '\r':
+ break;
+ case 'Z':
+ case 'z':
+ svg_add_path_item (path, RL2_SVG_CLOSE_PATH, NULL);
+ last_x = first_x;
+ last_y = first_y;
+ keyword = '\0';
+ break;
+ case 'C':
+ case 'c':
+ case 'S':
+ case 's':
+ case 'Q':
+ case 'q':
+ case 'T':
+ case 't':
+ keyword = *p_in;
+ break;
+ case 'M':
+ case 'm':
+ case 'L':
+ case 'l':
+ case 'H':
+ case 'h':
+ case 'V':
+ case 'v':
+ case 'A':
+ case 'a':
+ bezier_reflect_x = DBL_MAX;
+ bezier_reflect_y = DBL_MAX; /* invalidating Bezier reflect point */
+ keyword = *p_in;
+ break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '.':
+ case '+':
+ case '-':
+ if (!svg_consume_float (&p_in, &coord))
+ {
+ path->error = 1;
+ return;
+ }
+ if (count < 7)
+ coord_array[count] = coord;
+ count++;
+ break;
+ default:
+ path->error = 1;
+ break;
+ };
+ if (last_m && keyword == 'M')
+ keyword = 'L';
+ if (last_m && keyword == 'm')
+ keyword = 'l';
+ switch (keyword)
+ {
+ case 'M':
+ if (count == 2)
+ {
+ /* SVG Path MoveTo - absolute */
+ data =
+ svg_alloc_path_move (coord_array[0], coord_array[1]);
+ svg_add_path_item (path, RL2_SVG_MOVE_TO, data);
+ count = 0;
+ last_x = coord_array[0];
+ last_y = coord_array[1];
+ first_x = last_x;
+ first_y = last_y;
+ last_m = 1;
+ }
+ break;
+ case 'm':
+ if (count == 2)
+ {
+ /* SVG Path MoveTo - relative */
+ if (last_x == DBL_MAX || last_y == DBL_MAX)
+ {
+ /* assuming absolute coords */
+ x = coord_array[0];
+ y = coord_array[1];
+ }
+ else
+ {
+ /* transforming relative coords into absolute */
+ x = last_x + coord_array[0];
+ y = last_y + coord_array[1];
+ }
+ data = svg_alloc_path_move (x, y);
+ svg_add_path_item (path, RL2_SVG_MOVE_TO, data);
+ count = 0;
+ last_x = x;
+ last_y = y;
+ last_m = 1;
+ first_x = last_x;
+ first_y = last_y;
+ }
+ break;
+ case 'L':
+ if (count == 2)
+ {
+ /* SVG Path LineTo - absolute */
+ data =
+ svg_alloc_path_move (coord_array[0], coord_array[1]);
+ svg_add_path_item (path, RL2_SVG_LINE_TO, data);
+ count = 0;
+ last_x = coord_array[0];
+ last_y = coord_array[1];
+ last_m = 0;
+ }
+ break;
+ case 'l':
+ if (count == 2)
+ {
+ /* SVG Path LineTo - relative */
+ if (last_x == DBL_MAX || last_y == DBL_MAX)
+ {
+ /* assuming absolute coords */
+ x = coord_array[0];
+ y = coord_array[1];
+ }
+ else
+ {
+ /* transforming relative coords into absolute */
+ x = last_x + coord_array[0];
+ y = last_y + coord_array[1];
+ }
+ data = svg_alloc_path_move (x, y);
+ svg_add_path_item (path, RL2_SVG_LINE_TO, data);
+ count = 0;
+ last_x = x;
+ last_y = y;
+ last_m = 0;
+ }
+ break;
+ case 'H':
+ if (count == 1)
+ {
+ /* SVG Path Horizontal LineTo - absolute */
+ data = svg_alloc_path_move (coord_array[0], last_y);
+ svg_add_path_item (path, RL2_SVG_LINE_TO, data);
+ count = 0;
+ last_x = coord_array[0];
+ last_m = 0;
+ }
+ break;
+ case 'h':
+ if (count == 1)
+ {
+ /* SVG Path Horizontal LineTo - relative */
+ if (last_x == DBL_MAX)
+ {
+ /* assuming absolute coords */
+ x = coord_array[0];
+ }
+ else
+ {
+ /* transforming relative coords into absolute */
+ x = last_x + coord_array[0];
+ }
+ data = svg_alloc_path_move (x, last_y);
+ svg_add_path_item (path, RL2_SVG_LINE_TO, data);
+ count = 0;
+ last_x = x;
+ last_m = 0;
+ }
+ break;
+ case 'V':
+ if (count == 1)
+ {
+ /* SVG Path Vertical LineTo - absolute */
+ data = svg_alloc_path_move (last_x, coord_array[0]);
+ svg_add_path_item (path, RL2_SVG_LINE_TO, data);
+ count = 0;
+ last_y = coord_array[0];
+ last_m = 0;
+ }
+ break;
+ case 'v':
+ if (count == 1)
+ {
+ /* SVG Path Vertical LineTo - relative */
+ if (last_y == DBL_MAX)
+ {
+ /* assuming absolute coords */
+ y = coord_array[0];
+ }
+ else
+ {
+ /* transforming relative coords into absolute */
+ y = last_y + coord_array[0];
+ }
+ data = svg_alloc_path_move (last_x, y);
+ svg_add_path_item (path, RL2_SVG_LINE_TO, data);
+ count = 0;
+ last_y = y;
+ last_m = 0;
+ }
+ break;
+ case 'C':
+ if (count == 6)
+ {
+ /* SVG Path Cubic Bezier CurveTo - absolute */
+ data =
+ svg_alloc_path_bezier (coord_array[0],
+ coord_array[1],
+ coord_array[2],
+ coord_array[3],
+ coord_array[4],
+ coord_array[5]);
+ svg_add_path_item (path, RL2_SVG_CURVE_3, data);
+ count = 0;
+ last_x = coord_array[4];
+ last_y = coord_array[5];
+ /* reflection of the second control point */
+ bezier_reflect_x =
+ coord_array[4] - (coord_array[2] - coord_array[4]);
+ bezier_reflect_y =
+ coord_array[5] - (coord_array[3] - coord_array[5]);
+ last_m = 0;
+ }
+ break;
+ case 'c':
+ if (count == 6)
+ {
+ /* SVG Path Cubic Bezier CurveTo - relative */
+ if (last_x == DBL_MAX || last_y == DBL_MAX)
+ {
+ /* assuming absolute coords */
+ x1 = coord_array[0];
+ y1 = coord_array[1];
+ x2 = coord_array[2];
+ y2 = coord_array[3];
+ x = coord_array[4];
+ y = coord_array[5];
+ }
+ else
+ {
+ /* transforming relative coords into absolute */
+ x1 = last_x + coord_array[0];
+ y1 = last_y + coord_array[1];
+ x2 = last_x + coord_array[2];
+ y2 = last_y + coord_array[3];
+ x = last_x + coord_array[4];
+ y = last_y + coord_array[5];
+ }
+ data = svg_alloc_path_bezier (x1, y1, x2, y2, x, y);
+ svg_add_path_item (path, RL2_SVG_CURVE_3, data);
+ count = 0;
+ last_x = x;
+ last_y = y;
+ /* reflection of the second control point */
+ bezier_reflect_x = x - (x2 - x);
+ bezier_reflect_y = y - (y2 - y);
+ last_m = 0;
+ }
+ break;
+ case 'S':
+ if (count == 4)
+ {
+ /* SVG Path Cubic Bezier CurveTo [short] - absolute */
+ if (bezier_reflect_x == DBL_MAX
+ || bezier_reflect_y == DBL_MAX)
+ {
+ /* assuming the current point as Bezier reflected point */
+ bezier_reflect_x = coord_array[2];
+ bezier_reflect_y = coord_array[3];
+ }
+ data =
+ svg_alloc_path_bezier (bezier_reflect_x,
+ bezier_reflect_y,
+ coord_array[0],
+ coord_array[1],
+ coord_array[2],
+ coord_array[3]);
+ svg_add_path_item (path, RL2_SVG_CURVE_3, data);
+ count = 0;
+ last_x = coord_array[2];
+ last_y = coord_array[3];
+ /* reflection of the second control point */
+ bezier_reflect_x =
+ coord_array[2] - (coord_array[0] - coord_array[2]);
+ bezier_reflect_y =
+ coord_array[3] - (coord_array[1] - coord_array[3]);
+ last_m = 0;
+ }
+ break;
+ case 's':
+ if (count == 4)
+ {
+ /* SVG Path Cubic Bezier CurveTo [short] - relative */
+ if (last_x == DBL_MAX || last_y == DBL_MAX)
+ {
+ /* assuming absolute coords */
+ x2 = coord_array[0];
+ y2 = coord_array[1];
+ x = coord_array[2];
+ y = coord_array[3];
+ }
+ else
+ {
+ /* transforming relative coords into absolute */
+ x2 = last_x + coord_array[0];
+ y2 = last_y + coord_array[1];
+ x = last_x + coord_array[2];
+ y = last_y + coord_array[3];
+ }
+ if (bezier_reflect_x == DBL_MAX
+ || bezier_reflect_y == DBL_MAX)
+ {
+ /* assuming the current point as Bezier reflected point */
+ bezier_reflect_x = last_x;
+ bezier_reflect_y = last_y;
+ }
+ data =
+ svg_alloc_path_bezier (bezier_reflect_x,
+ bezier_reflect_y, x2, y2, x,
+ y);
+ svg_add_path_item (path, RL2_SVG_CURVE_3, data);
+ count = 0;
+ last_x = x;
+ last_y = y;
+ /* reflection of the second control point */
+ bezier_reflect_x = x - (x2 - x);
+ bezier_reflect_y = y - (y2 - y);
+ last_m = 0;
+ }
+ break;
+ case 'Q':
+ if (count == 4)
+ {
+ /* SVG Path Quadratic Bezier CurveTo - absolute */
+ data =
+ svg_alloc_path_bezier (coord_array[0],
+ coord_array[1],
+ coord_array[2],
+ coord_array[3], 0.0, 0.0);
+ svg_add_path_item (path, RL2_SVG_CURVE_4, data);
+ count = 0;
+ last_x = coord_array[2];
+ last_y = coord_array[3];
+ /* reflection of the control point */
+ bezier_reflect_x =
+ coord_array[2] - (coord_array[0] - coord_array[2]);
+ bezier_reflect_y =
+ coord_array[3] - (coord_array[1] - coord_array[3]);
+ last_m = 0;
+ }
+ break;
+ case 'q':
+ if (count == 4)
+ {
+ /* SVG Path Quadratic Bezier CurveTo - relative */
+ if (last_x == DBL_MAX || last_y == DBL_MAX)
+ {
+ /* assuming absolute coords */
+ x1 = coord_array[0];
+ y1 = coord_array[1];
+ x = coord_array[2];
+ y = coord_array[3];
+ }
+ else
+ {
+ /* transforming relative coords into absolute */
+ x1 = last_x + coord_array[0];
+ y1 = last_y + coord_array[1];
+ x = last_x + coord_array[2];
+ y = last_y + coord_array[3];
+ }
+ data = svg_alloc_path_bezier (x1, y1, x, y, 0.0, 0.0);
+ svg_add_path_item (path, RL2_SVG_CURVE_4, data);
+ count = 0;
+ last_x = x;
+ last_y = y;
+ /* reflection of the control point */
+ bezier_reflect_x = x - (x1 - x);
+ bezier_reflect_y = y - (y1 - y);
+ last_m = 0;
+ }
+ break;
+ case 'T':
+ if (count == 2)
+ {
+ /* SVG Path Quadratic Bezier CurveTo [short] - absolute */
+ if (bezier_reflect_x == DBL_MAX
+ || bezier_reflect_y == DBL_MAX)
+ {
+ /* assuming the current point as Bezier reflected point */
+ bezier_reflect_x = coord_array[0];
+ bezier_reflect_y = coord_array[1];
+ }
+ data =
+ svg_alloc_path_bezier (bezier_reflect_x,
+ bezier_reflect_y,
+ coord_array[0],
+ coord_array[1], 0.0, 0.0);
+ svg_add_path_item (path, RL2_SVG_CURVE_4, data);
+ count = 0;
+ last_x = coord_array[0];
+ last_y = coord_array[1];
+ /* reflection of the control point */
+ bezier_reflect_x =
+ coord_array[0] - (bezier_reflect_x - coord_array[0]);
+ bezier_reflect_y =
+ coord_array[1] - (bezier_reflect_y - coord_array[1]);
+ last_m = 0;
+ }
+ break;
+ case 't':
+ if (count == 2)
+ {
+ /* SVG Path Quadratic Bezier CurveTo [short] - relative */
+ if (last_x == DBL_MAX || last_y == DBL_MAX)
+ {
+ /* assuming absolute coords */
+ x = coord_array[0];
+ y = coord_array[1];
+ }
+ else
+ {
+ /* transforming relative coords into absolute */
+ x = last_x + coord_array[0];
+ y = last_y + coord_array[1];
+ }
+ if (bezier_reflect_x == DBL_MAX
+ || bezier_reflect_y == DBL_MAX)
+ {
+ /* assuming the current point as Bezier reflected point */
+ bezier_reflect_x = x;
+ bezier_reflect_y = y;
+ }
+ data =
+ svg_alloc_path_bezier (bezier_reflect_x,
+ bezier_reflect_y, x, y, 0.0,
+ 0.0);
+ svg_add_path_item (path, RL2_SVG_CURVE_4, data);
+ count = 0;
+ last_x = x;
+ last_y = y;
+ /* reflection of the control point */
+ bezier_reflect_x = x - (bezier_reflect_x - x);
+ bezier_reflect_y = y - (bezier_reflect_y - y);
+ last_m = 0;
+ }
+ break;
+ case 'A':
+ if (count == 7)
+ {
+ /* SVG Path EllipticalArc - absolute */
+ data =
+ svg_alloc_path_ellipt_arc (coord_array[0],
+ coord_array[1],
+ coord_array[2],
+ coord_array[3],
+ coord_array[4],
+ coord_array[5],
+ coord_array[6]);
+ svg_add_path_item (path, RL2_SVG_ELLIPT_ARC, data);
+ count = 0;
+ last_x = coord_array[5];
+ last_y = coord_array[6];
+ last_m = 0;
+ }
+ break;
+ case 'a':
+ if (count == 7)
+ {
+ /* SVG Path EllipticalArc - relative */
+ if (last_x == DBL_MAX || last_y == DBL_MAX)
+ {
+ /* assuming absolute coords */
+ x = coord_array[5];
+ y = coord_array[6];
+ }
+ else
+ {
+ /* transforming relative coords into absolute */
+ x = last_x + coord_array[5];
+ y = last_y + coord_array[6];
+ }
+ if (coord_array[0] == 0.0 || coord_array[1] == 0.0)
+ {
+ /* ZERO radius: defaulting to a straight line */
+ data = svg_alloc_path_move (x, y);
+ svg_add_path_item (path, RL2_SVG_LINE_TO, data);
+ }
+ else
+ {
+ data =
+ svg_alloc_path_ellipt_arc (coord_array[0],
+ coord_array[1],
+ coord_array[2],
+ coord_array[3],
+ coord_array[4], x,
+ y);
+ svg_add_path_item (path, RL2_SVG_ELLIPT_ARC, data);
+ }
+ count = 0;
+ last_x = x;
+ last_y = y;
+ last_m = 0;
+ }
+ break;
+ };
+ if (path->error)
+ return;
+ if (*p_in != '\0')
+ p_in++;
+ }
+}
+
+static void
+svg_parse_display (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG Display attribute */
+ style->fill = 1;
+ if (strcmp (value, "none") == 0)
+ style->visibility = 0;
+}
+
+static void
+svg_parse_visibility (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG Visibility attribute */
+ style->fill = 1;
+ if (strcmp (value, "hidden") == 0)
+ style->visibility = 0;
+}
+
+static int
+svg_parse_fill_gradient_url (rl2PrivSvgStylePtr style, const char *color)
+{
+/* parsing an SVG FillColor attribute (URL) */
+ int len = strlen (color);
+ if (strncmp (color, "url(#", 5) == 0 && *(color + len - 1) == ')')
+ {
+ char buf[1024];
+ strcpy (buf, color + 5);
+ len = strlen (buf);
+ buf[len - 1] = '\0';
+ svg_add_fill_gradient_url (style, buf);
+ style->fill = 1;
+ return 1;
+ }
+ return 0;
+}
+
+static void
+svg_parse_fill_color (rl2PrivSvgStylePtr style, const char *color)
+{
+/* parsing an SVG FillColor attribute */
+ int len = strlen (color);
+ char buf[16];
+ const char *p_color = NULL;
+ if (strcmp (color, "none") == 0)
+ {
+ style->no_fill = 1;
+ return;
+ }
+ if (svg_parse_fill_gradient_url (style, color) == 1)
+ return;
+ style->fill = 1;
+ if (*color == '#' && len >= 7)
+ p_color = color;
+ else if (*color == '#' && len == 4)
+ {
+ buf[0] = *(color + 0);
+ buf[1] = *(color + 1);
+ buf[2] = *(color + 1);
+ buf[3] = *(color + 2);
+ buf[4] = *(color + 2);
+ buf[5] = *(color + 3);
+ buf[6] = *(color + 3);
+ p_color = buf;
+ }
+ else
+ {
+ svg_from_named_color (buf, color);
+ if (*buf != '\0')
+ p_color = buf;
+ else
+ p_color = NULL;
+ }
+ if (p_color == NULL)
+ p_color = "#000000";
+ style->fill_red = svg_parse_hex_color (*(p_color + 1), *(p_color + 2));
+ style->fill_green = svg_parse_hex_color (*(p_color + 3), *(p_color + 4));
+ style->fill_blue = svg_parse_hex_color (*(p_color + 5), *(p_color + 6));
+}
+
+static void
+svg_parse_fill_rule (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG FillRule attribute */
+ style->fill = 1;
+ if (strcmp (value, "evenodd") == 0)
+ style->stroke_linecap = CAIRO_FILL_RULE_EVEN_ODD;
+}
+
+static void
+svg_parse_fill_opacity (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG FillOpacity attribute */
+ style->fill = 1;
+ style->fill_opacity = atof (value);
+ if (style->fill_opacity <= 0.0 || style->fill_opacity >= 1.0)
+ style->fill_opacity = 1.0;
+}
+
+static int
+svg_parse_stroke_gradient_url (rl2PrivSvgStylePtr style, const char *color)
+{
+/* parsing an SVG StrokeColor attribute (URL) */
+ int len = strlen (color);
+ if (strncmp (color, "url(#", 5) == 0 && *(color + len - 1) == ')')
+ {
+ char buf[1024];
+ strcpy (buf, color + 5);
+ len = strlen (buf);
+ buf[len - 1] = '\0';
+ svg_add_stroke_gradient_url (style, buf);
+ return 1;
+ }
+ return 0;
+}
+
+static void
+svg_parse_stroke_color (rl2PrivSvgStylePtr style, const char *color)
+{
+/* parsing an SVG StrokeColor attribute */
+ int len = strlen (color);
+ char buf[16];
+ const char *p_color = NULL;
+ style->stroke = 1;
+ if (strcmp (color, "none") == 0)
+ {
+ style->no_stroke = 1;
+ return;
+ }
+ if (svg_parse_stroke_gradient_url (style, color) == 1)
+ return;
+ if (*color == '#' && len >= 7)
+ p_color = color;
+ else if (*color == '#' && len == 4)
+ {
+ buf[0] = *(color + 0);
+ buf[1] = *(color + 1);
+ buf[2] = *(color + 1);
+ buf[3] = *(color + 2);
+ buf[4] = *(color + 2);
+ buf[5] = *(color + 3);
+ buf[6] = *(color + 3);
+ p_color = buf;
+ }
+ else
+ {
+ svg_from_named_color (buf, color);
+ if (*color != '\0')
+ p_color = buf;
+ }
+ if (p_color == NULL)
+ p_color = "#000000";
+ style->stroke_red = svg_parse_hex_color (*(p_color + 1), *(p_color + 2));
+ style->stroke_green = svg_parse_hex_color (*(p_color + 3), *(p_color + 4));
+ style->stroke_blue = svg_parse_hex_color (*(p_color + 5), *(p_color + 6));
+}
+
+static void
+svg_parse_stop_color (const char *color, double *red, double *green,
+ double *blue)
+{
+/* parsing an SVG StopColor attribute */
+ int len = strlen (color);
+ char buf[16];
+ const char *p_color = NULL;
+ if (strcmp (color, "none") == 0)
+ {
+ *red = -1.0;
+ *green = -1.0;
+ *blue = -1.0;
+ return;
+ }
+ if (*color == '#' && len >= 7)
+ p_color = color;
+ else if (*color == '#' && len == 4)
+ {
+ buf[0] = *(color + 0);
+ buf[1] = *(color + 1);
+ buf[2] = *(color + 1);
+ buf[3] = *(color + 2);
+ buf[4] = *(color + 2);
+ buf[5] = *(color + 3);
+ buf[6] = *(color + 3);
+ p_color = buf;
+ }
+ else
+ {
+ svg_from_named_color (buf, color);
+ if (*buf != '\0')
+ p_color = buf;
+ }
+ if (p_color == NULL)
+ p_color = "#000000";
+ *red = svg_parse_hex_color (*(p_color + 1), *(p_color + 2));
+ *green = svg_parse_hex_color (*(p_color + 3), *(p_color + 4));
+ *blue = svg_parse_hex_color (*(p_color + 5), *(p_color + 6));
+}
+
+static void
+svg_parse_stroke_width (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG StrokeWidth attribute */
+ style->stroke = 1;
+ style->stroke_width = atof (value);
+ if (style->stroke_width <= 0.0)
+ style->stroke_width = 1.0;
+}
+
+static void
+svg_parse_stroke_linecap (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG StrokeLineCap attribute */
+ style->stroke = 1;
+ if (strcmp (value, "round") == 0)
+ style->stroke_linecap = CAIRO_LINE_CAP_ROUND;
+ if (strcmp (value, "square") == 0)
+ style->stroke_linecap = CAIRO_LINE_CAP_SQUARE;
+}
+
+static void
+svg_parse_stroke_linejoin (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG StrokeLineJoin attribute */
+ style->stroke = 1;
+ if (strcmp (value, "round") == 0)
+ style->stroke_linejoin = CAIRO_LINE_JOIN_ROUND;
+ if (strcmp (value, "bevel") == 0)
+ style->stroke_linejoin = CAIRO_LINE_JOIN_BEVEL;
+}
+
+static void
+svg_parse_stroke_miterlimit (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG MiterLimit attribute */
+ style->stroke = 1;
+ style->stroke_miterlimit = atof (value);
+ if (style->stroke_miterlimit <= 0.0)
+ style->stroke_miterlimit = 10.0;
+}
+
+static void
+svg_parse_stroke_dashoffset (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG DashOffset attribute */
+ style->stroke = 1;
+ style->stroke_dashoffset = atof (value);
+}
+
+static void
+svg_parse_stroke_dasharray (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG DashArray attribute */
+ double dash_list[1024];
+ int items = 0;
+ char token[1024];
+ char *p_out = token;
+ const char *p_in = value;
+ if (style->stroke_dasharray != NULL)
+ free (style->stroke_dasharray);
+ style->stroke_dasharray = NULL;
+ style->stroke_dashitems = 0;
+ if (strcmp (value, "none") == 0)
+ return;
+ while (1)
+ {
+ if (*p_in == ' ' || *p_in == ',' || *p_in == '\0')
+ {
+ *p_out++ = '\0';
+ if (*token != '\0')
+ dash_list[items++] = atof (token);
+ if (*p_in == '\0')
+ break;
+ p_out = token;
+ p_in++;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ if (items > 0)
+ {
+ int i;
+ if (items % 2 == 0)
+ {
+ /* even number */
+ style->stroke_dashitems = items;
+ style->stroke_dasharray = malloc (sizeof (double) * items);
+ for (i = 0; i < items; i++)
+ style->stroke_dasharray[i] = dash_list[i];
+ }
+ else
+ {
+ /* odd number: doubling */
+ int o = 0;
+ style->stroke_dashitems = items * 2;
+ style->stroke_dasharray = malloc (sizeof (double) * items * 2);
+ for (i = 0; i < items; i++)
+ style->stroke_dasharray[o++] = dash_list[i];
+ for (i = 0; i < items; i++)
+ style->stroke_dasharray[o++] = dash_list[i];
+ }
+ }
+ style->stroke = 1;
+}
+
+static void
+svg_parse_opacity (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG Opacity attribute */
+ style->opacity = atof (value);
+ if (style->opacity <= 0.0 || style->opacity >= 1.0)
+ style->opacity = 1.0;
+}
+
+static void
+svg_parse_stroke_opacity (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG StrokeOpacity attribute */
+ style->stroke = 1;
+ style->stroke_opacity = atof (value);
+ if (style->stroke_opacity <= 0.0 || style->stroke_opacity >= 1.0)
+ style->stroke_opacity = 1.0;
+}
+
+static void
+svg_parse_stop_opacity (const char *value, double *opacity)
+{
+/* parsing an SVG Stop attribute */
+ *opacity = atof (value);
+}
+
+static void
+svg_split_css_token (rl2PrivSvgStylePtr style, char *value)
+{
+/* parsing an SVG CSS Style definition - single item */
+ char *p = value;
+ char *p_value = NULL;
+ while (*p != '\0')
+ {
+ if (*p == ':')
+ {
+ *p = '\0';
+ p_value = p + 1;
+ break;
+ }
+ p++;
+ }
+ if (p_value == NULL)
+ return;
+ if (strcmp (value, "opacity") == 0)
+ svg_parse_opacity (style, p_value);
+ else if (strcmp (value, "stroke") == 0)
+ svg_parse_stroke_color (style, p_value);
+ else if (strcmp (value, "stroke-width") == 0)
+ svg_parse_stroke_width (style, p_value);
+ else if (strcmp (value, "stroke-linecap") == 0)
+ svg_parse_stroke_linecap (style, p_value);
+ else if (strcmp (value, "stroke-linejoin") == 0)
+ svg_parse_stroke_linejoin (style, p_value);
+ else if (strcmp (value, "stroke-miterlimit") == 0)
+ svg_parse_stroke_miterlimit (style, p_value);
+ else if (strcmp (value, "stroke-dasharray") == 0)
+ svg_parse_stroke_dasharray (style, p_value);
+ else if (strcmp (value, "stroke-dashoffset") == 0)
+ svg_parse_stroke_dashoffset (style, p_value);
+ else if (strcmp (value, "stroke-opacity") == 0)
+ svg_parse_stroke_opacity (style, p_value);
+ else if (strcmp (value, "fill") == 0)
+ svg_parse_fill_color (style, p_value);
+ else if (strcmp (value, "fill-rule") == 0)
+ svg_parse_fill_rule (style, p_value);
+ else if (strcmp (value, "fill-opacity") == 0)
+ svg_parse_fill_opacity (style, p_value);
+ else if (strcmp (value, "display") == 0)
+ svg_parse_display (style, p_value);
+ else if (strcmp (value, "visibility") == 0)
+ svg_parse_visibility (style, p_value);
+}
+
+static void
+svg_parse_css (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG CSS Style definition */
+ const char *p_in = value;
+ char token[128];
+ char *p_out = token;
+ while (1)
+ {
+ if (*p_in == ' ' || *p_in == '\t' || *p_in == '\r' || *p_in == '\n')
+ {
+ p_in++;
+ continue;
+ }
+ if (*p_in == '\0')
+ {
+ *p_out = '\0';
+ svg_split_css_token (style, token);
+ break;
+ }
+ if (*p_in == ';')
+ {
+ *p_out = '\0';
+ svg_split_css_token (style, token);
+ p_out = token;
+ p_in++;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+}
+
+static void
+svg_split_stop_token (char *value, double *red, double *green, double *blue,
+ double *opacity)
+{
+/* parsing an SVG Stop Style definition - single item */
+ char *p = value;
+ char *p_value = NULL;
+ while (*p != '\0')
+ {
+ if (*p == ':')
+ {
+ *p = '\0';
+ p_value = p + 1;
+ break;
+ }
+ p++;
+ }
+ if (p_value == NULL)
+ return;
+ if (strcmp (value, "stop-color") == 0)
+ svg_parse_stop_color (p_value, red, green, blue);
+ else if (strcmp (value, "stop-opacity") == 0)
+ svg_parse_stop_opacity (p_value, opacity);
+}
+
+static void
+svg_parse_stop_style (const char *value, double *red, double *green,
+ double *blue, double *opacity)
+{
+/* parsing an SVG Stop-Style */
+ const char *p_in = value;
+ char token[128];
+ char *p_out = token;
+ while (1)
+ {
+ if (*p_in == ' ' || *p_in == '\t' || *p_in == '\r' || *p_in == '\n')
+ {
+ p_in++;
+ continue;
+ }
+ if (*p_in == '\0')
+ {
+ *p_out = '\0';
+ svg_split_stop_token (token, red, green, blue, opacity);
+ break;
+ }
+ if (*p_in == ';')
+ {
+ *p_out = '\0';
+ svg_split_stop_token (token, red, green, blue, opacity);
+ p_out = token;
+ p_in++;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+}
+
+static void
+svg_parse_style (rl2PrivSvgGroupPtr group, rl2PrivSvgShapePtr shape,
+ rl2PrivSvgUsePtr use, struct _xmlAttr *attr)
+{
+/* parsing SVG Style-related definitions */
+ rl2PrivSvgStylePtr style = NULL;
+ if (group != NULL)
+ style = &(group->style);
+ else if (use != NULL)
+ style = &(use->style);
+ else
+ style = &(shape->style);
+
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "style") == 0)
+ svg_parse_css (style, value);
+ else if (strcmp (name, "stroke") == 0)
+ svg_parse_stroke_color (style, value);
+ else if (strcmp (name, "stroke-width") == 0)
+ svg_parse_stroke_width (style, value);
+ else if (strcmp (name, "stroke-linecap") == 0)
+ svg_parse_stroke_linecap (style, value);
+ else if (strcmp (name, "stroke-linejoin") == 0)
+ svg_parse_stroke_linejoin (style, value);
+ else if (strcmp (name, "stroke-miterlimit") == 0)
+ svg_parse_stroke_miterlimit (style, value);
+ else if (strcmp (name, "stroke-dasharray") == 0)
+ svg_parse_stroke_dasharray (style, value);
+ else if (strcmp (name, "stroke-dashoffset") == 0)
+ svg_parse_stroke_dashoffset (style, value);
+ else if (strcmp (name, "stroke-opacity") == 0)
+ svg_parse_stroke_opacity (style, value);
+ else if (strcmp (name, "fill") == 0)
+ svg_parse_fill_color (style, value);
+ else if (strcmp (name, "fill-rule") == 0)
+ svg_parse_fill_rule (style, value);
+ else if (strcmp (name, "fill-opacity") == 0)
+ svg_parse_fill_opacity (style, value);
+ else if (strcmp (name, "display") == 0)
+ svg_parse_display (style, value);
+ else if (strcmp (name, "visibility") == 0)
+ svg_parse_visibility (style, value);
+ }
+ }
+ attr = attr->next;
+ }
+}
+
+static void
+svg_parse_id (rl2PrivSvgGroupPtr group, rl2PrivSvgClipPtr clip,
+ rl2PrivSvgShapePtr shape, struct _xmlAttr *attr)
+{
+/* parsing SVG an eventual ID definitions */
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "id") == 0)
+ {
+ if (group != NULL)
+ svg_add_group_id (group, value);
+ if (clip != NULL)
+ svg_add_clip_id (clip, value);
+ if (shape != NULL)
+ svg_add_shape_id (shape, value);
+ }
+ }
+ }
+ attr = attr->next;
+ }
+}
+
+static void
+svg_consume_whitespace (const char **ptr)
+{
+/* consuming whitespaces and commas */
+ const char *p = *ptr;
+ while (1)
+ {
+ if (*p == ' ' || *p == ',' || *p == '\t' || *p == '\r' || *p == '\n')
+ {
+ p++;
+ continue;
+ }
+ break;
+ }
+ *ptr = p;
+}
+
+static int
+svg_find_transform_mode (const char **ptr)
+{
+ const char *p = *ptr;
+ if (strncmp (p, "matrix", 6) == 0)
+ {
+ *ptr += 6;
+ return RL2_SVG_MATRIX;
+ }
+ if (strncmp (p, "translate", 9) == 0)
+ {
+ *ptr += 9;
+ return RL2_SVG_TRANSLATE;
+ }
+ if (strncmp (p, "scale", 5) == 0)
+ {
+ *ptr += 5;
+ return RL2_SVG_SCALE;
+ }
+ if (strncmp (p, "rotate", 6) == 0)
+ {
+ *ptr += 6;
+ return RL2_SVG_ROTATE;
+ }
+ if (strncmp (p, "skewX", 5) == 0)
+ {
+ *ptr += 5;
+ return RL2_SVG_SKEW_X;
+ }
+ if (strncmp (p, "skewY", 5) == 0)
+ {
+ *ptr += 5;
+ return RL2_SVG_SKEW_Y;
+ }
+ return RL2_SVG_UNKNOWN;
+}
+
+static void *
+svg_parse_matrix (const char **ptr)
+{
+/* parsing an SVG Matrix definition */
+ const char *p = *ptr;
+ double a;
+ double b;
+ double c;
+ double d;
+ double e;
+ double f;
+ int err = 0;
+ if (!svg_consume_float (&p, &a))
+ err = 1;
+ svg_consume_whitespace (&p);
+ if (!svg_consume_float (&p, &b))
+ err = 1;
+ svg_consume_whitespace (&p);
+ if (!svg_consume_float (&p, &c))
+ err = 1;
+ svg_consume_whitespace (&p);
+ if (!svg_consume_float (&p, &d))
+ err = 1;
+ svg_consume_whitespace (&p);
+ if (!svg_consume_float (&p, &e))
+ err = 1;
+ svg_consume_whitespace (&p);
+ if (!svg_consume_float (&p, &f))
+ err = 1;
+ svg_consume_whitespace (&p);
+ if (*p == ')')
+ p++;
+ else
+ err = 1;
+ if (!err)
+ {
+ *ptr = p;
+ return svg_alloc_matrix (a, b, c, d, e, f);
+ }
+ return NULL;
+}
+
+static void *
+svg_parse_translate (const char **ptr)
+{
+/* parsing an SVG Translate definition */
+ const char *p = *ptr;
+ double tx;
+ double ty;
+ int err = 0;
+ if (!svg_consume_float (&p, &tx))
+ err = 1;
+ svg_consume_whitespace (&p);
+ if (!svg_consume_float (&p, &ty))
+ ty = 0.0;
+ svg_consume_whitespace (&p);
+ if (*p == ')')
+ p++;
+ else
+ err = 1;
+ if (!err)
+ {
+ *ptr = p;
+ return svg_alloc_translate (tx, ty);
+ }
+ return NULL;
+}
+
+static void *
+svg_parse_scale (const char **ptr)
+{
+/* parsing an SVG Scale definition */
+ const char *p = *ptr;
+ double sx;
+ double sy;
+ int err = 0;
+ if (!svg_consume_float (&p, &sx))
+ err = 1;
+ svg_consume_whitespace (&p);
+ if (!svg_consume_float (&p, &sy))
+ sy = 0.0;
+ svg_consume_whitespace (&p);
+ if (*p == ')')
+ p++;
+ else
+ err = 1;
+ if (!err)
+ {
+ *ptr = p;
+ if (sy == 0.0)
+ sy = sx;
+ return svg_alloc_scale (sx, sy);
+ }
+ return NULL;
+}
+
+static void *
+svg_parse_rotate (const char **ptr)
+{
+/* parsing an SVG Rotate definition */
+ const char *p = *ptr;
+ double angle;
+ double cx;
+ double cy;
+ int err = 0;
+ if (!svg_consume_float (&p, &angle))
+ err = 1;
+ svg_consume_whitespace (&p);
+ if (!svg_consume_float (&p, &cx))
+ cx = 0.0;
+ svg_consume_whitespace (&p);
+ if (!svg_consume_float (&p, &cy))
+ cy = 0.0;
+ svg_consume_whitespace (&p);
+ if (*p == ')')
+ p++;
+ else
+ err = 1;
+ if (!err)
+ {
+ *ptr = p;
+ return svg_alloc_rotate (angle, cx, cy);
+ }
+ return NULL;
+}
+
+static void *
+svg_parse_skew (const char **ptr)
+{
+/* parsing an SVG Skew definition */
+ const char *p = *ptr;
+ double skew = 0.0;
+ int err = 0;
+ if (!svg_consume_float (&p, &skew))
+ err = 1;
+ if (!err)
+ {
+ *ptr = p;
+ return svg_alloc_skew (skew);
+ }
+ return NULL;
+}
+
+static void
+svg_parse_transform_str (rl2PrivSvgGroupPtr group,
+ rl2PrivSvgShapePtr shape, rl2PrivSvgUsePtr use,
+ rl2PrivSvgGradientPtr gradient, const char *str)
+{
+/* parsing an SVG Transform string */
+ rl2PrivSvgTransformPtr trans;
+ const char *p_in = str;
+ int type;
+ void *data;
+
+ while (1)
+ {
+ svg_consume_whitespace (&p_in);
+ if (*p_in == '\0')
+ break;
+ type = svg_find_transform_mode (&p_in);
+ if (type == RL2_SVG_UNKNOWN)
+ break;
+ svg_consume_whitespace (&p_in);
+ if (*p_in == '\0')
+ break;
+ if (*p_in != '(')
+ break;
+ p_in++;
+ switch (type)
+ {
+ case RL2_SVG_MATRIX:
+ data = svg_parse_matrix (&p_in);
+ break;
+ case RL2_SVG_TRANSLATE:
+ data = svg_parse_translate (&p_in);
+ break;
+ case RL2_SVG_SCALE:
+ data = svg_parse_scale (&p_in);
+ break;
+ case RL2_SVG_ROTATE:
+ data = svg_parse_rotate (&p_in);
+ break;
+ case RL2_SVG_SKEW_X:
+ case RL2_SVG_SKEW_Y:
+ data = svg_parse_skew (&p_in);
+ break;
+ default:
+ data = NULL;
+ break;
+ };
+ if (data == NULL)
+ return;
+ trans = svg_alloc_transform (type, data);
+ if (group != NULL)
+ {
+ if (group->first_trans == NULL)
+ group->first_trans = trans;
+ if (group->last_trans != NULL)
+ group->last_trans->next = trans;
+ group->last_trans = trans;
+ }
+ else if (shape != NULL)
+ {
+ if (shape->first_trans == NULL)
+ shape->first_trans = trans;
+ if (shape->last_trans != NULL)
+ shape->last_trans->next = trans;
+ shape->last_trans = trans;
+ }
+ else if (use != NULL)
+ {
+ if (use->first_trans == NULL)
+ use->first_trans = trans;
+ if (use->last_trans != NULL)
+ use->last_trans->next = trans;
+ use->last_trans = trans;
+ }
+ else if (gradient != NULL)
+ {
+ if (gradient->first_trans == NULL)
+ gradient->first_trans = trans;
+ if (gradient->last_trans != NULL)
+ gradient->last_trans->next = trans;
+ gradient->last_trans = trans;
+ }
+ }
+}
+
+static void
+svg_parse_transform (rl2PrivSvgGroupPtr group, rl2PrivSvgShapePtr shape,
+ rl2PrivSvgUsePtr use,
+ rl2PrivSvgGradientPtr gradient, struct _xmlAttr *attr)
+{
+/* parsing SVG Transform-related definitions */
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (gradient == NULL)
+ {
+ if (strcmp (name, "transform") == 0)
+ svg_parse_transform_str (group, shape, use,
+ NULL, value);
+ }
+ else
+ {
+ if (strcmp (name, "gradientTransform") == 0)
+ svg_parse_transform_str (NULL, NULL, NULL,
+ gradient, value);
+ }
+ }
+ }
+ attr = attr->next;
+ }
+}
+
+static void
+svg_parse_clip_url (rl2PrivSvgStylePtr style, const char *value)
+{
+/* parsing an SVG clip-path attribute (URL) */
+ int len = strlen (value);
+ if (strncmp (value, "url(#", 5) == 0 && *(value + len - 1) == ')')
+ {
+ char buf[1024];
+ strcpy (buf, value + 5);
+ len = strlen (buf);
+ buf[len - 1] = '\0';
+ svg_add_clip_url (style, buf);
+ }
+}
+
+static void
+svg_parse_clip_path (rl2PrivSvgGroupPtr group, rl2PrivSvgShapePtr shape,
+ rl2PrivSvgUsePtr use, struct _xmlAttr *attr)
+{
+/* parsing SVG clip-path definitions */
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "clip-path") == 0)
+ {
+ if (group != NULL)
+ svg_parse_clip_url (&(group->style), value);
+ if (shape != NULL)
+ svg_parse_clip_url (&(shape->style), value);
+ if (use != NULL)
+ svg_parse_clip_url (&(use->style), value);
+ }
+ }
+ }
+ attr = attr->next;
+ }
+}
+
+static void
+svg_parse_rect (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG Rect struct */
+ rl2PrivSvgRectPtr rect;
+ struct _xmlAttr *attr;
+ double x = 0.0;
+ double y = 0.0;
+ double width = 0.0;
+ double height = 0.0;
+ double rx = -1.0;
+ double ry = -1.0;
+
+ attr = node->properties;
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "x") == 0)
+ x = atof (value);
+ if (strcmp (name, "y") == 0)
+ y = atof (value);
+ if (strcmp (name, "width") == 0)
+ width = atof (value);
+ if (strcmp (name, "height") == 0)
+ height = atof (value);
+ if (strcmp (name, "rx") == 0)
+ rx = atof (value);
+ if (strcmp (name, "ry") == 0)
+ ry = atof (value);
+ }
+ }
+ attr = attr->next;
+ }
+ if (rx > 0.0 && ry <= 0.0)
+ ry = rx;
+ if (ry > 0.0 && rx <= 0.0)
+ rx = ry;
+ rect = svg_alloc_rect (x, y, width, height, rx, ry);
+ svg_insert_shape (svg_doc, RL2_SVG_RECT, rect);
+ svg_parse_id (NULL, NULL, svg_doc->current_shape, node->properties);
+ svg_parse_style (NULL, svg_doc->current_shape, NULL, node->properties);
+ svg_parse_transform (NULL, svg_doc->current_shape, NULL, NULL,
+ node->properties);
+ svg_parse_clip_path (NULL, svg_doc->current_shape, NULL, node->properties);
+}
+
+static void
+svg_parse_circle (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG Circle struct */
+ rl2PrivSvgCirclePtr circle;
+ struct _xmlAttr *attr;
+ double cx = 0.0;
+ double cy = 0.0;
+ double r = 0.0;
+
+ attr = node->properties;
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "cx") == 0)
+ cx = atof (value);
+ if (strcmp (name, "cy") == 0)
+ cy = atof (value);
+ if (strcmp (name, "r") == 0)
+ r = atof (value);
+ }
+ }
+ attr = attr->next;
+ }
+ circle = svg_alloc_circle (cx, cy, r);
+ svg_insert_shape (svg_doc, RL2_SVG_CIRCLE, circle);
+ svg_parse_id (NULL, NULL, svg_doc->current_shape, node->properties);
+ svg_parse_style (NULL, svg_doc->current_shape, NULL, node->properties);
+ svg_parse_transform (NULL, svg_doc->current_shape, NULL, NULL,
+ node->properties);
+ svg_parse_clip_path (NULL, svg_doc->current_shape, NULL, node->properties);
+}
+
+static void
+svg_parse_ellipse (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG Ellipse struct */
+ rl2PrivSvgEllipsePtr ellipse;
+ struct _xmlAttr *attr;
+ double cx = 0.0;
+ double cy = 0.0;
+ double rx = 0.0;
+ double ry = 0.0;
+
+ attr = node->properties;
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "cx") == 0)
+ cx = atof (value);
+ if (strcmp (name, "cy") == 0)
+ cy = atof (value);
+ if (strcmp (name, "rx") == 0)
+ rx = atof (value);
+ if (strcmp (name, "ry") == 0)
+ ry = atof (value);
+ }
+ }
+ attr = attr->next;
+ }
+ ellipse = svg_alloc_ellipse (cx, cy, rx, ry);
+ svg_insert_shape (svg_doc, RL2_SVG_ELLIPSE, ellipse);
+ svg_parse_id (NULL, NULL, svg_doc->current_shape, node->properties);
+ svg_parse_style (NULL, svg_doc->current_shape, NULL, node->properties);
+ svg_parse_transform (NULL, svg_doc->current_shape, NULL, NULL,
+ node->properties);
+ svg_parse_clip_path (NULL, svg_doc->current_shape, NULL, node->properties);
+}
+
+static void
+svg_parse_line (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG Line struct */
+ rl2PrivSvgLinePtr line;
+ struct _xmlAttr *attr;
+ double x1 = 0.0;
+ double y1 = 0.0;
+ double x2 = 0.0;
+ double y2 = 0.0;
+
+ attr = node->properties;
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "x1") == 0)
+ x1 = atof (value);
+ if (strcmp (name, "y1") == 0)
+ y1 = atof (value);
+ if (strcmp (name, "x2") == 0)
+ x2 = atof (value);
+ if (strcmp (name, "y2") == 0)
+ y2 = atof (value);
+ }
+ }
+ attr = attr->next;
+ }
+ line = svg_alloc_line (x1, y1, x2, y2);
+ svg_insert_shape (svg_doc, RL2_SVG_LINE, line);
+ svg_parse_id (NULL, NULL, svg_doc->current_shape, node->properties);
+ svg_parse_style (NULL, svg_doc->current_shape, NULL, node->properties);
+ svg_parse_transform (NULL, svg_doc->current_shape, NULL, NULL,
+ node->properties);
+ svg_parse_clip_path (NULL, svg_doc->current_shape, NULL, node->properties);
+}
+
+static void
+svg_parse_polyline (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG Polyline struct */
+ rl2PrivSvgPolylinePtr poly;
+ struct _xmlAttr *attr;
+ int points = 0;
+ double *x = NULL;
+ double *y = NULL;
+
+ attr = node->properties;
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "points") == 0)
+ svg_parse_points (value, &points, &x, &y);
+ }
+ }
+ attr = attr->next;
+ }
+ poly = svg_alloc_polyline (points, x, y);
+ svg_insert_shape (svg_doc, RL2_SVG_POLYLINE, poly);
+ svg_parse_id (NULL, NULL, svg_doc->current_shape, node->properties);
+ svg_parse_style (NULL, svg_doc->current_shape, NULL, node->properties);
+ svg_parse_transform (NULL, svg_doc->current_shape, NULL, NULL,
+ node->properties);
+ svg_parse_clip_path (NULL, svg_doc->current_shape, NULL, node->properties);
+}
+
+static void
+svg_parse_polygon (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG Polygon struct */
+ rl2PrivSvgPolygonPtr poly;
+ struct _xmlAttr *attr;
+ int points = 0;
+ double *x = NULL;
+ double *y = NULL;
+
+ attr = node->properties;
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "points") == 0)
+ svg_parse_points (value, &points, &x, &y);
+ }
+ }
+ attr = attr->next;
+ }
+ poly = svg_alloc_polygon (points, x, y);
+ svg_insert_shape (svg_doc, RL2_SVG_POLYGON, poly);
+ svg_parse_id (NULL, NULL, svg_doc->current_shape, node->properties);
+ svg_parse_style (NULL, svg_doc->current_shape, NULL, node->properties);
+ svg_parse_transform (NULL, svg_doc->current_shape, NULL, NULL,
+ node->properties);
+ svg_parse_clip_path (NULL, svg_doc->current_shape, NULL, node->properties);
+}
+
+static void
+svg_parse_path (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG Path struct */
+ rl2PrivSvgPathPtr path = svg_alloc_path ();
+ struct _xmlAttr *attr;
+
+ attr = node->properties;
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "d") == 0)
+ {
+ svg_parse_path_d (path, value);
+ if (path->first == NULL || path->error)
+ {
+ /* invalid path */
+ svg_free_path (path);
+ return;
+ }
+ }
+ }
+ }
+ attr = attr->next;
+ }
+ svg_insert_shape (svg_doc, RL2_SVG_PATH, path);
+ svg_parse_id (NULL, NULL, svg_doc->current_shape, node->properties);
+ svg_parse_style (NULL, svg_doc->current_shape, NULL, node->properties);
+ svg_parse_transform (NULL, svg_doc->current_shape, NULL, NULL,
+ node->properties);
+ svg_parse_clip_path (NULL, svg_doc->current_shape, NULL, node->properties);
+}
+
+static void
+svg_parse_group (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG Group struct */
+ svg_insert_group (svg_doc);
+ svg_parse_id (svg_doc->current_group, NULL, NULL, node->properties);
+ svg_parse_style (svg_doc->current_group, NULL, NULL, node->properties);
+ svg_parse_transform (svg_doc->current_group, NULL, NULL, NULL,
+ node->properties);
+ svg_parse_clip_path (svg_doc->current_group, NULL, NULL, node->properties);
+}
+
+static void
+svg_parse_clip (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG ClipPath struct */
+ svg_insert_clip (svg_doc);
+ svg_parse_id (NULL, svg_doc->current_clip, NULL, node->properties);
+}
+
+static void
+svg_parse_use (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG Use struct */
+ const char *xlink_href = NULL;
+ double x = DBL_MAX;
+ double y = DBL_MAX;
+ double width = DBL_MAX;
+ double height = DBL_MAX;
+ rl2PrivSvgUsePtr use;
+ struct _xmlAttr *attr = node->properties;
+
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "href") == 0)
+ xlink_href = value;
+ if (strcmp (name, "x") == 0)
+ x = atof (value);
+ if (strcmp (name, "y") == 0)
+ y = atof (value);
+ if (strcmp (name, "width") == 0)
+ width = atof (value);
+ if (strcmp (name, "height") == 0)
+ height = atof (value);
+ }
+ }
+ attr = attr->next;
+ }
+ if (xlink_href == NULL)
+ return;
+
+ use = svg_insert_use (svg_doc, xlink_href, x, y, width, height);
+ svg_parse_style (NULL, NULL, use, node->properties);
+ svg_parse_transform (NULL, NULL, use, NULL, node->properties);
+ svg_parse_clip_path (NULL, NULL, use, node->properties);
+}
+
+static void
+svg_parse_gradient_stop (rl2PrivSvgGradientPtr gradient, xmlNodePtr node)
+{
+/* parsing an SVG Node - Gradient - Stop */
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "stop") == 0)
+ {
+ double offset = DBL_MAX;
+ double red = -1.0;
+ double green = -1.0;
+ double blue = -1.0;
+ double opacity = -1.0;
+ struct _xmlAttr *attr = node->properties;
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "offset") == 0)
+ {
+ int percent = 0;
+ int i;
+ for (i = 0;
+ i < (int) strlen (value);
+ i++)
+ {
+ if (value[i] == '%')
+ percent = 1;
+ }
+ offset = atof (value);
+ if (percent)
+ offset /= 100.0;
+ if (offset < 0.0)
+ offset = 0.0;
+ if (offset > 1.0)
+ offset = 1.0;
+ }
+ if (strcmp (name, "style") == 0)
+ svg_parse_stop_style (value,
+ &red,
+ &green,
+ &blue,
+ &opacity);
+ if (strcmp (name, "stop-color") == 0)
+ {
+ opacity = 1.0;
+ svg_parse_stop_color (value,
+ &red,
+ &green,
+ &blue);
+ }
+ }
+ }
+ attr = attr->next;
+ }
+ svg_insert_gradient_stop (gradient, offset, red, green,
+ blue, opacity);
+ }
+ }
+ node = node->next;
+ }
+}
+
+static void
+svg_parse_linear_gradient (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG LinearGradient struct */
+ const char *xlink_href = NULL;
+ const char *id = NULL;
+ double x1 = DBL_MAX;
+ double y1 = DBL_MAX;
+ double x2 = DBL_MAX;
+ double y2 = DBL_MAX;
+ int units = RL2_SVG_BOUNDING_BOX;
+ rl2PrivSvgGradientPtr gradient;
+ struct _xmlAttr *attr = node->properties;
+
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "href") == 0)
+ xlink_href = value;
+ if (strcmp (name, "id") == 0)
+ id = value;
+ if (strcmp (name, "x1") == 0)
+ x1 = atof (value);
+ if (strcmp (name, "y1") == 0)
+ y1 = atof (value);
+ if (strcmp (name, "x2") == 0)
+ x2 = atof (value);
+ if (strcmp (name, "y2") == 0)
+ y2 = atof (value);
+ if (strcmp (name, "gradientUnits") == 0)
+ {
+ if (strcmp (value, "userSpaceOnUse") == 0)
+ units = RL2_SVG_USER_SPACE;
+ }
+ }
+ }
+ attr = attr->next;
+ }
+ if (x1 == DBL_MAX)
+ x1 = svg_doc->viewbox_x;
+ if (y1 == DBL_MAX)
+ y1 = svg_doc->viewbox_y;
+ if (x2 == DBL_MAX)
+ x2 = svg_doc->viewbox_width;
+ if (y2 == DBL_MAX)
+ y2 = y1;
+
+ gradient =
+ svg_insert_linear_gradient (svg_doc, id, xlink_href, x1, y1, x2,
+ y2, units);
+ svg_parse_gradient_stop (gradient, node->children);
+ svg_parse_transform (NULL, NULL, NULL, gradient, node->properties);
+}
+
+static void
+svg_parse_radial_gradient (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* creating and initializing an SVG RadialGradient struct */
+ const char *xlink_href = NULL;
+ const char *id = NULL;
+ double cx = DBL_MAX;
+ double cy = DBL_MAX;
+ double fx = DBL_MAX;
+ double fy = DBL_MAX;
+ double r = DBL_MAX;
+ int units = RL2_SVG_BOUNDING_BOX;
+ rl2PrivSvgGradientPtr gradient;
+ struct _xmlAttr *attr = node->properties;
+
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ if (strcmp (name, "href") == 0)
+ xlink_href = value;
+ if (strcmp (name, "id") == 0)
+ id = value;
+ if (strcmp (name, "cx") == 0)
+ cx = atof (value);
+ if (strcmp (name, "cy") == 0)
+ cy = atof (value);
+ if (strcmp (name, "fx") == 0)
+ fx = atof (value);
+ if (strcmp (name, "fy") == 0)
+ fy = atof (value);
+ if (strcmp (name, "r") == 0)
+ r = atof (value);
+ if (strcmp (name, "gradientUnits") == 0)
+ {
+ if (strcmp (value, "userSpaceOnUse") == 0)
+ units = RL2_SVG_USER_SPACE;
+ }
+ }
+ }
+ attr = attr->next;
+ }
+ if (cx == DBL_MAX)
+ cx = svg_doc->viewbox_width / 2.0;
+ if (cy == DBL_MAX)
+ cy = svg_doc->viewbox_height / 2.0;
+ if (r == DBL_MAX)
+ r = svg_doc->viewbox_width / 2.0;
+ if (fx == DBL_MAX)
+ fx = cx;
+ if (fy == DBL_MAX)
+ fy = cy;
+
+ gradient =
+ svg_insert_radial_gradient (svg_doc, id, xlink_href, cx, cy, fx,
+ fy, r, units);
+ svg_parse_gradient_stop (gradient, node->children);
+ svg_parse_transform (NULL, NULL, NULL, gradient, node->properties);
+}
+
+static void
+svg_parse_node (rl2PrivSvgDocumentPtr svg_doc, xmlNodePtr node)
+{
+/* parsing an SVG Node */
+ while (node)
+ {
+ int is_group = 0;
+ int is_defs = 0;
+ int is_flow_root = 0;
+ int is_clip_path = 0;
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "defs") == 0)
+ {
+ svg_doc->defs_count += 1;
+ is_defs = 1;
+ }
+ if (strcmp (name, "flowRoot") == 0)
+ {
+ svg_doc->flow_root_count += 1;
+ is_flow_root = 1;
+ }
+ if (strcmp (name, "clipPath") == 0)
+ {
+ svg_parse_clip (svg_doc, node);
+ is_clip_path = 1;
+ }
+ if (strcmp (name, "g") == 0)
+ {
+ svg_parse_group (svg_doc, node);
+ is_group = 1;
+ }
+ if (strcmp (name, "rect") == 0)
+ svg_parse_rect (svg_doc, node);
+ if (strcmp (name, "circle") == 0)
+ svg_parse_circle (svg_doc, node);
+ if (strcmp (name, "ellipse") == 0)
+ svg_parse_ellipse (svg_doc, node);
+ if (strcmp (name, "line") == 0)
+ svg_parse_line (svg_doc, node);
+ if (strcmp (name, "polyline") == 0)
+ svg_parse_polyline (svg_doc, node);
+ if (strcmp (name, "polygon") == 0)
+ svg_parse_polygon (svg_doc, node);
+ if (strcmp (name, "path") == 0)
+ svg_parse_path (svg_doc, node);
+ if (strcmp (name, "use") == 0)
+ svg_parse_use (svg_doc, node);
+ if (strcmp (name, "linearGradient") == 0)
+ svg_parse_linear_gradient (svg_doc, node);
+ if (strcmp (name, "radialGradient") == 0)
+ svg_parse_radial_gradient (svg_doc, node);
+ }
+ svg_parse_node (svg_doc, node->children);
+ if (is_group)
+ svg_close_group (svg_doc);
+ if (is_defs)
+ svg_doc->defs_count -= 1;
+ if (is_flow_root)
+ svg_doc->flow_root_count -= 1;
+ if (is_clip_path)
+ svg_close_clip (svg_doc);
+ node = node->next;
+ }
+}
+
+static void
+svg_parse_viewbox (rl2PrivSvgDocumentPtr svg_doc, const char *str)
+{
+/* parsing an SVG ViewBox */
+ double value;
+ const char *p = str;
+ if (!svg_consume_float (&p, &value))
+ return;
+ svg_doc->viewbox_x = value;
+ if (!svg_consume_float (&p, &value))
+ return;
+ svg_doc->viewbox_y = value;
+ if (!svg_consume_float (&p, &value))
+ return;
+ svg_doc->viewbox_width = value;
+ if (!svg_consume_float (&p, &value))
+ return;
+ svg_doc->viewbox_height = value;
+}
+
+static void
+svg_parse_header (rl2PrivSvgDocumentPtr svg_doc, struct _xmlAttr *attr)
+{
+/* parsing the SVG header definitions */
+ while (attr)
+ {
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = NULL;
+ const char *name;
+ xmlNodePtr child = attr->children;
+ name = (const char *) (attr->name);
+ if (child)
+ value = (const char *) (child->content);
+ if (child && value)
+ {
+ int len;
+ double factor = 1.0;
+ if (strcmp (name, "width") == 0)
+ {
+ len = strlen (value);
+ if (len > 3)
+ {
+ if (strcmp (value + len - 2, "mm") == 0)
+ factor = 72.0 / 25.4;
+ else if (strcmp (value + len - 2, "cm") == 0)
+ factor = 72.0 / 2.54;
+ else if (strcmp (value + len - 2, "in") == 0)
+ factor = 72.0;
+ else if (strcmp (value + len - 2, "pc") == 0)
+ factor = 72.0 / 6.0;
+ }
+ svg_doc->width = atof (value) * factor;
+ }
+ if (strcmp (name, "height") == 0)
+ {
+ len = strlen (value);
+ if (len > 3)
+ {
+ if (strcmp (value + len - 2, "mm") == 0)
+ factor = 72.0 / 25.4;
+ else if (strcmp (value + len - 2, "cm") == 0)
+ factor = 72.0 / 2.54;
+ else if (strcmp (value + len - 2, "in") == 0)
+ factor = 72.0;
+ else if (strcmp (value + len - 2, "pc") == 0)
+ factor = 72.0 / 6.0;
+ }
+ svg_doc->height = atof (value) * factor;
+ }
+ if (strcmp (name, "viewBox") == 0)
+ svg_parse_viewbox (svg_doc, value);
+ }
+ }
+ attr = attr->next;
+ }
+}
+
+RL2_PRIVATE rl2PrivSvgDocumentPtr
+svg_parse_doc (const unsigned char *svg, int svg_len)
+{
+/* attempting to parse the SVG Document */
+ rl2PrivSvgDocumentPtr svg_doc;
+ xmlNodePtr node;
+ xmlDocPtr xml_doc =
+ xmlReadMemory ((const char *) svg, svg_len, "noname.svg", NULL, 0);
+ if (xml_doc == NULL)
+ {
+ /* parsing error; not a well-formed XML */
+ fprintf (stderr, "XML parsing error\n");
+ return NULL;
+ }
+ svg_doc = svg_alloc_document ();
+ node = xmlDocGetRootElement (xml_doc);
+ svg_parse_header (svg_doc, node->properties);
+ svg_parse_node (svg_doc, node);
+ xmlFreeDoc (xml_doc);
+ return svg_doc;
+}
diff --git a/src/rl2symbolizer.c b/src/rl2symbolizer.c
new file mode 100644
index 0000000..2ecd3b7
--- /dev/null
+++ b/src/rl2symbolizer.c
@@ -0,0 +1,2244 @@
+/*
+
+ rl2symbolizer -- private SQL helper methods
+
+ version 0.1, 2014 March 17
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+#include <limits.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+#ifdef _WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#include "config.h"
+
+#include <libxml/parser.h>
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2_private.h"
+
+#include <spatialite/gaiaaux.h>
+
+#define RL2_UNUSED() if (argc || argv) argc = argc;
+
+static void
+dummySilentError (void *ctx, const char *msg, ...)
+{
+/* shutting up XML Errors */
+ if (ctx != NULL)
+ ctx = NULL; /* suppressing stupid compiler warnings (unused args) */
+ if (msg != NULL)
+ ctx = NULL; /* suppressing stupid compiler warnings (unused args) */
+}
+
+static void
+parse_sld_se_opacity (xmlNodePtr node, rl2PrivRasterStylePtr style)
+{
+/* parsing RasterSymbolizer Opacity */
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "Opacity") == 0)
+ {
+ xmlNodePtr child = node->children;
+ while (child)
+ {
+ if (child->type == XML_TEXT_NODE
+ && child->content != NULL)
+ style->opacity =
+ atof ((const char *) child->content);
+ child = child->next;
+ }
+ }
+ }
+ node = node->next;
+ }
+}
+
+static int
+parse_sld_se_band_name (const char *name, unsigned char *band)
+{
+/* attempting to parse a band name */
+ int digit = 0;
+ int nodigit = 0;
+ int i;
+ for (i = 0; i < (int) strlen (name); i++)
+ {
+ if (*(name + i) >= '0' && *(name + i) <= '9')
+ digit++;
+ else
+ nodigit++;
+ }
+ if (digit && !nodigit)
+ {
+ /* band identified by number */
+ int x = atoi (name) - 1; /* first RL2 band has index 0 !!! */
+ if (x >= 0 && x <= 255)
+ {
+ *band = x;
+ return 1;
+ }
+ }
+ if (digit && nodigit)
+ {
+ if (strlen (name) > 9 && strncmp (name, "Band.band", 9) == 0)
+ {
+ /* band identified by a string like "Band.band1" */
+ int x = atoi (name + 9) - 1; /* first RL2 band has index 0 !!! */
+ if (x >= 0 && x <= 255)
+ {
+ *band = x;
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+static int
+parse_sld_se_channel_band (xmlNodePtr node, unsigned char *band)
+{
+/* parsing RasterSymbolizer Channel -> Band */
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "SourceChannelName") == 0)
+ {
+ xmlNodePtr child = node->children;
+ while (child)
+ {
+ if (child->type == XML_TEXT_NODE
+ && child->content != NULL)
+ {
+ const char *band_name =
+ (const char *) child->content;
+ if (parse_sld_se_band_name (band_name, band))
+ return 1;
+ else
+ return 0;
+ }
+ child = child->next;
+ }
+ }
+ }
+ node = node->next;
+ }
+ return 0;
+}
+
+static int
+parse_sld_se_gamma_value (xmlNodePtr node, double *gamma)
+{
+/* parsing RasterSymbolizer GammaValue */
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "GammaValue") == 0)
+ {
+ xmlNodePtr child = node->children;
+ while (child)
+ {
+ if (child->type == XML_TEXT_NODE
+ && child->content != NULL)
+ {
+ const char *gamma_value =
+ (const char *) child->content;
+ double gv = atof (gamma_value);
+ *gamma = gv;
+ return 1;
+ }
+ child = child->next;
+ }
+ }
+ }
+ node = node->next;
+ }
+ return 0;
+}
+
+static int
+parse_sld_se_contrast_enhancement (xmlNodePtr node, unsigned char *mode,
+ double *gamma)
+{
+/* parsing RasterSymbolizer ContrastEnhancement */
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "ContrastEnhancement") == 0)
+ {
+ xmlNodePtr child = node->children;
+ while (child)
+ {
+ if (child->type == XML_ELEMENT_NODE)
+ {
+ const char *xmode =
+ (const char *) (child->name);
+ if (strcmp (xmode, "Normalize") == 0)
+ {
+ *mode =
+ RL2_CONTRAST_ENHANCEMENT_NORMALIZE;
+ return 1;
+ }
+ if (strcmp (xmode, "Histogram") == 0)
+ {
+ *mode =
+ RL2_CONTRAST_ENHANCEMENT_HISTOGRAM;
+ return 1;
+ }
+ if (strcmp (xmode, "GammaValue") == 0)
+ {
+ if (parse_sld_se_gamma_value
+ (child, gamma))
+ {
+ *mode =
+ RL2_CONTRAST_ENHANCEMENT_GAMMA;
+ return 1;
+ }
+ return 1;
+ }
+ }
+ child = child->next;
+ }
+ return 0;
+ }
+ }
+ node = node->next;
+ }
+ return 1;
+}
+
+static int
+parse_sld_se_channels (xmlNodePtr node, rl2PrivRasterStylePtr style)
+{
+/* parsing RasterSymbolizer Channels */
+ int has_red = 0;
+ int has_green = 0;
+ int has_blue = 0;
+ int has_gray = 0;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ unsigned char gray;
+ unsigned char red_contrast = RL2_CONTRAST_ENHANCEMENT_NONE;
+ unsigned char green_contrast = RL2_CONTRAST_ENHANCEMENT_NONE;
+ unsigned char blue_contrast = RL2_CONTRAST_ENHANCEMENT_NONE;
+ unsigned char gray_contrast = RL2_CONTRAST_ENHANCEMENT_NONE;
+ double red_gamma = 1.0;
+ double green_gamma = 1.0;
+ double blue_gamma = 1.0;
+ double gray_gamma = 1.0;
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "RedChannel") == 0)
+ {
+ has_red = 1;
+ if (!parse_sld_se_channel_band (node->children, &red))
+ return 0;
+ if (!parse_sld_se_contrast_enhancement
+ (node->children, &red_contrast, &red_gamma))
+ return 0;
+ }
+ if (strcmp (name, "GreenChannel") == 0)
+ {
+ has_green = 1;
+ if (!parse_sld_se_channel_band (node->children, &green))
+ return 0;
+ if (!parse_sld_se_contrast_enhancement
+ (node->children, &green_contrast, &green_gamma))
+ return 0;
+ }
+ if (strcmp (name, "BlueChannel") == 0)
+ {
+ has_blue = 1;
+ if (!parse_sld_se_channel_band (node->children, &blue))
+ return 0;
+ if (!parse_sld_se_contrast_enhancement
+ (node->children, &blue_contrast, &blue_gamma))
+ return 0;
+ }
+ if (strcmp (name, "GrayChannel") == 0)
+ {
+ has_gray = 1;
+ if (!parse_sld_se_channel_band (node->children, &gray))
+ return 0;
+ if (!parse_sld_se_contrast_enhancement
+ (node->children, &gray_contrast, &gray_gamma))
+ return 0;
+ }
+ }
+ node = node->next;
+ }
+ if (has_red && has_green && has_blue && !has_gray)
+ {
+ /* triple band selection */
+ style->bandSelection = malloc (sizeof (rl2PrivBandSelection));
+ style->bandSelection->selectionType = RL2_BAND_SELECTION_TRIPLE;
+ style->bandSelection->redBand = red;
+ style->bandSelection->greenBand = green;
+ style->bandSelection->blueBand = blue;
+ style->bandSelection->redContrast = red_contrast;
+ style->bandSelection->redGamma = red_gamma;
+ style->bandSelection->greenContrast = green_contrast;
+ style->bandSelection->greenGamma = green_gamma;
+ style->bandSelection->blueContrast = blue_contrast;
+ style->bandSelection->blueGamma = blue_gamma;
+ return 1;
+ }
+ if (!has_red && !has_green && !has_blue && has_gray)
+ {
+ /* mono band selection */
+ if (gray_gamma < 0.0)
+ gray_gamma = 0.0;
+ if (gray_gamma > 1.0)
+ gray_gamma = 1.0;
+ style->bandSelection = malloc (sizeof (rl2PrivBandSelection));
+ style->bandSelection->selectionType = RL2_BAND_SELECTION_MONO;
+ style->bandSelection->grayBand = gray;
+ style->bandSelection->grayContrast = gray_contrast;
+ style->bandSelection->grayGamma = gray_gamma;
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+parse_hex (unsigned char hi, unsigned char lo, unsigned char *val)
+{
+/* attempting to parse an hexadecimal byte */
+ unsigned char value;
+ switch (hi)
+ {
+ case '0':
+ value = 0;
+ break;
+ case '1':
+ value = 1 * 16;
+ break;
+ case '2':
+ value = 2 * 16;
+ break;
+ case '3':
+ value = 3 * 16;
+ break;
+ case '4':
+ value = 4 * 16;
+ break;
+ case '5':
+ value = 5 * 16;
+ break;
+ case '6':
+ value = 6 * 16;
+ break;
+ case '7':
+ value = 7 * 16;
+ break;
+ case '8':
+ value = 8 * 16;
+ break;
+ case '9':
+ value = 9 * 16;
+ break;
+ case 'a':
+ case 'A':
+ value = 10 * 16;
+ break;
+ case 'b':
+ case 'B':
+ value = 11 * 16;
+ break;
+ case 'c':
+ case 'C':
+ value = 12 * 16;
+ break;
+ case 'd':
+ case 'D':
+ value = 13 * 16;
+ break;
+ case 'e':
+ case 'E':
+ value = 14 * 16;
+ break;
+ case 'f':
+ case 'F':
+ value = 15 * 16;
+ break;
+ default:
+ return 0;
+ break;
+ };
+ switch (lo)
+ {
+ case '0':
+ value += 0;
+ break;
+ case '1':
+ value += 1;
+ break;
+ case '2':
+ value += 2;
+ break;
+ case '3':
+ value += 3;
+ break;
+ case '4':
+ value += 4;
+ break;
+ case '5':
+ value += 5;
+ break;
+ case '6':
+ value += 6;
+ break;
+ case '7':
+ value += 7;
+ break;
+ case '8':
+ value += 8;
+ break;
+ case '9':
+ value += 9;
+ break;
+ case 'a':
+ case 'A':
+ value += 10;
+ break;
+ case 'b':
+ case 'B':
+ value += 11;
+ break;
+ case 'c':
+ case 'C':
+ value += 12;
+ break;
+ case 'd':
+ case 'D':
+ value += 13;
+ break;
+ case 'e':
+ case 'E':
+ value += 14;
+ break;
+ case 'f':
+ case 'F':
+ value += 15;
+ break;
+ default:
+ return 0;
+ break;
+ };
+ *val = value;
+ return 1;
+}
+
+static int
+parse_sld_se_color (const char *color, unsigned char *red, unsigned char *green,
+ unsigned char *blue)
+{
+/* attempting to parse a #RRGGBB hexadecimal color */
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ if (strlen (color) != 7)
+ return 0;
+ if (*color != '#')
+ return 0;
+ if (!parse_hex (*(color + 1), *(color + 2), &r))
+ return 0;
+ if (!parse_hex (*(color + 3), *(color + 4), &g))
+ return 0;
+ if (!parse_hex (*(color + 5), *(color + 6), &b))
+ return 0;
+ *red = r;
+ *green = g;
+ *blue = b;
+ return 1;
+}
+
+static int
+parse_sld_se_channel_selection (xmlNodePtr node, rl2PrivRasterStylePtr style)
+{
+/* parsing RasterSymbolizer ChannelSelection */
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "ChannelSelection") == 0)
+ {
+ if (parse_sld_se_channels (node->children, style))
+ return 1;
+ else
+ return 0;
+ }
+ }
+ node = node->next;
+ }
+ return 1;
+}
+
+static int
+parse_sld_se_categorize (xmlNodePtr node, rl2PrivRasterStylePtr style)
+{
+/* parsing RasterSymbolizer ColorMap Categorize */
+ struct _xmlAttr *attr;
+ xmlNodePtr child;
+ xmlNodePtr text;
+
+ attr = node->properties;
+ while (attr != NULL)
+ {
+ /* attributes */
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *name = (const char *) (attr->name);
+ if (strcmp (name, "fallbackValue") == 0)
+ {
+ xmlNode *text = attr->children;
+ if (text != NULL)
+ {
+ if (text->type == XML_TEXT_NODE)
+ {
+ const char *color =
+ (const char *) (text->content);
+ if (color != NULL)
+ {
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ if (parse_sld_se_color
+ (color, &red, &green, &blue))
+ {
+ style->categorize->dfltRed = red;
+ style->categorize->dfltGreen =
+ green;
+ style->categorize->dfltBlue =
+ blue;
+ }
+ }
+ }
+ }
+ }
+ }
+ attr = attr->next;
+ }
+
+ child = node->children;
+ while (child)
+ {
+ if (child->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (child->name);
+ if (strcmp (name, "Value") == 0)
+ {
+ text = child->children;
+ while (text)
+ {
+ if (text->type == XML_TEXT_NODE)
+ {
+ const char *color =
+ (const char *) (text->content);
+ if (color != NULL)
+ {
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ if (parse_sld_se_color
+ (color, &red, &green, &blue))
+ {
+ if (style->categorize->last ==
+ NULL)
+ {
+ style->categorize->baseRed =
+ red;
+ style->
+ categorize->baseGreen =
+ green;
+ style->
+ categorize->baseBlue =
+ blue;
+ }
+ else
+ {
+ style->categorize->
+ last->red = red;
+ style->categorize->
+ last->green = green;
+ style->categorize->
+ last->blue = blue;
+ }
+ }
+ else
+ return 0;
+ }
+ }
+ text = text->next;
+ }
+ }
+ if (strcmp (name, "Threshold") == 0)
+ {
+ text = child->children;
+ while (text)
+ {
+ if (text->type == XML_TEXT_NODE)
+ {
+ const char *value =
+ (const char *) (text->content);
+ if (value != NULL)
+ {
+ rl2PrivColorMapPointPtr pt =
+ malloc (sizeof
+ (rl2PrivColorMapPoint));
+ pt->value = atof (value);
+ pt->red = 0;
+ pt->green = 0;
+ pt->blue = 0;
+ pt->next = NULL;
+ if (style->categorize->first == NULL)
+ style->categorize->first = pt;
+ if (style->categorize->last != NULL)
+ style->categorize->last->next = pt;
+ style->categorize->last = pt;
+ }
+ }
+ text = text->next;
+ }
+ }
+ }
+ child = child->next;
+ }
+ return 1;
+}
+
+static int
+parse_sld_se_interpolation_point_data (xmlNodePtr node, double *data)
+{
+/* parsing RasterSymbolizer ColorMap InterpolationPoint Data */
+ while (node)
+ {
+ if (node->type == XML_TEXT_NODE)
+ {
+ const char *value = (const char *) (node->content);
+ if (value != NULL)
+ {
+ *data = atof (value);
+ return 1;
+ }
+ }
+ node = node->next;
+ }
+ return 0;
+}
+
+static int
+parse_sld_se_interpolation_point_value (xmlNodePtr node, unsigned char *red,
+ unsigned char *green,
+ unsigned char *blue)
+{
+/* parsing RasterSymbolizer ColorMap InterpolationPoint Value */
+ while (node)
+ {
+ if (node->type == XML_TEXT_NODE)
+ {
+ const char *color = (const char *) (node->content);
+ if (color != NULL)
+ {
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+ if (parse_sld_se_color (color, &r, &g, &b))
+ {
+ *red = r;
+ *green = g;
+ *blue = b;
+ return 1;
+ }
+ }
+ }
+ node = node->next;
+ }
+ return 0;
+}
+
+static int
+parse_sld_se_interpolation_point (xmlNodePtr node, rl2PrivRasterStylePtr style)
+{
+/* parsing RasterSymbolizer ColorMap InterpolationPoint */
+ double value;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ int has_data = 0;
+ int has_value = 0;
+
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "Data") == 0)
+ {
+ has_data = 1;
+ if (!parse_sld_se_interpolation_point_data
+ (node->children, &value))
+ return 0;
+ }
+ if (strcmp (name, "Value") == 0)
+ {
+ has_value = 1;
+ if (!parse_sld_se_interpolation_point_value
+ (node->children, &red, &green, &blue))
+ return 0;
+ }
+ }
+ node = node->next;
+ }
+
+ if (has_data && has_value)
+ {
+ rl2PrivColorMapPointPtr pt = malloc (sizeof (rl2PrivColorMapPoint));
+ pt->value = value;
+ pt->red = red;
+ pt->green = green;
+ pt->blue = blue;
+ pt->next = NULL;
+ if (style->interpolate->first == NULL)
+ style->interpolate->first = pt;
+ if (style->interpolate->last != NULL)
+ style->interpolate->last->next = pt;
+ style->interpolate->last = pt;
+ return 1;
+ }
+ return 0;
+}
+
+static int
+parse_sld_se_interpolate (xmlNodePtr node, rl2PrivRasterStylePtr style)
+{
+/* parsing RasterSymbolizer ColorMap Interpolate */
+ struct _xmlAttr *attr;
+ xmlNodePtr child;
+
+ attr = node->properties;
+ while (attr != NULL)
+ {
+ /* attributes */
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *name = (const char *) (attr->name);
+ if (strcmp (name, "fallbackValue") == 0)
+ {
+ xmlNode *text = attr->children;
+ if (text != NULL)
+ {
+ if (text->type == XML_TEXT_NODE)
+ {
+ const char *color =
+ (const char *) (text->content);
+ if (color != NULL)
+ {
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ if (parse_sld_se_color
+ (color, &red, &green, &blue))
+ {
+ style->interpolate->dfltRed = red;
+ style->interpolate->dfltGreen =
+ green;
+ style->interpolate->dfltBlue =
+ blue;
+ }
+ }
+ }
+ }
+ }
+ }
+ attr = attr->next;
+ }
+
+ child = node->children;
+ while (child)
+ {
+ if (child->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (child->name);
+ if (strcmp (name, "InterpolationPoint") == 0)
+ {
+ if (!parse_sld_se_interpolation_point
+ (child->children, style))
+ return 0;
+ }
+ }
+ child = child->next;
+ }
+ return 1;
+}
+
+static int
+parse_sld_se_color_map (xmlNodePtr node, rl2PrivRasterStylePtr style)
+{
+/* parsing RasterSymbolizer ColorMap */
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "ColorMap") == 0)
+ {
+ xmlNodePtr child = node->children;
+ while (child)
+ {
+ if (child->type == XML_ELEMENT_NODE)
+ {
+ const char *xmode =
+ (const char *) (child->name);
+ if (strcmp (xmode, "Interpolate") == 0)
+ {
+ style->interpolate =
+ malloc (sizeof
+ (rl2PrivColorMapInterpolate));
+ style->interpolate->first = NULL;
+ style->interpolate->last = NULL;
+ style->interpolate->dfltRed = 0;
+ style->interpolate->dfltGreen = 0;
+ style->interpolate->dfltBlue = 0;
+ if (parse_sld_se_interpolate
+ (child, style))
+ return 1;
+ }
+ if (strcmp (xmode, "Categorize") == 0)
+ {
+ style->categorize =
+ malloc (sizeof
+ (rl2PrivColorMapCategorize));
+ style->categorize->first = NULL;
+ style->categorize->last = NULL;
+ style->categorize->dfltRed = 0;
+ style->categorize->dfltGreen = 0;
+ style->categorize->dfltBlue = 0;
+ style->categorize->baseRed = 0;
+ style->categorize->baseGreen = 0;
+ style->categorize->baseBlue = 0;
+ if (parse_sld_se_categorize
+ (child, style))
+ return 1;
+ }
+ }
+ child = child->next;
+ }
+ return 0;
+ }
+ }
+ node = node->next;
+ }
+ return 1;
+}
+
+static void
+parse_sld_se_shaded_relief (xmlNodePtr node, rl2PrivRasterStylePtr style)
+{
+/* parsing RasterSymbolizer ShadedRelief */
+ xmlNodePtr text;
+
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "ShadedRelief") == 0)
+ {
+ xmlNodePtr child = node->children;
+ while (child)
+ {
+ if (child->type == XML_ELEMENT_NODE)
+ {
+ const char *xmode =
+ (const char *) (child->name);
+ if (strcmp (xmode, "BrightnessOnly") == 0)
+ {
+ text = child->children;
+ while (text)
+ {
+ if (text->type == XML_TEXT_NODE)
+ {
+ const char *value =
+ (const char
+ *) (text->content);
+ if (value != NULL)
+ style->brightnessOnly =
+ atoi (value);
+ }
+ text = text->next;
+ }
+ }
+ if (strcmp (xmode, "ReliefFactor") == 0)
+ {
+ text = child->children;
+ while (text)
+ {
+ if (text->type == XML_TEXT_NODE)
+ {
+ const char *value =
+ (const char
+ *) (text->content);
+ if (value != NULL)
+ style->reliefFactor =
+ atof (value);
+ }
+ text = text->next;
+ }
+ }
+ }
+ child = child->next;
+ }
+ style->shadedRelief = 1;
+ }
+ }
+ node = node->next;
+ }
+}
+
+static int
+parse_raster_symbolizer (xmlNodePtr node, rl2PrivRasterStylePtr style)
+{
+/* attempting to parse an SLD/SE RasterSymbolizer */
+ parse_sld_se_opacity (node->children, style);
+ if (!parse_sld_se_channel_selection (node->children, style))
+ return 0;
+ if (!parse_sld_se_color_map (node->children, style))
+ return 0;
+ if (!parse_sld_se_contrast_enhancement
+ (node->children, &(style->contrastEnhancement), &(style->gammaValue)))
+ return 0;
+ parse_sld_se_shaded_relief (node->children, style);
+ return 1;
+}
+
+static int
+find_raster_symbolizer (xmlNodePtr node, rl2PrivRasterStylePtr style, int *loop)
+{
+/* recursively searching an SLD/SE RasterSymbolizer */
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "RasterSymbolizer") == 0)
+ {
+ int ret = parse_raster_symbolizer (node, style);
+ *loop = 0;
+ return ret;
+ }
+ if (strcmp (name, "CoverageStyle") == 0 ||
+ strcmp (name, "Rule") == 0)
+ {
+ int ret =
+ find_raster_symbolizer (node->children, style, loop);
+ if (*loop == 0)
+ return ret;
+ }
+ }
+ node = node->next;
+ }
+ return 0;
+}
+
+RL2_PRIVATE rl2RasterStylePtr
+raster_style_from_sld_se_xml (char *name, char *title, char *abstract,
+ unsigned char *xml)
+{
+/* attempting to build a RasterStyle object from an SLD/SE XML style */
+ rl2PrivRasterStylePtr style = NULL;
+ xmlDocPtr xml_doc = NULL;
+ xmlNodePtr root;
+ int loop = 1;
+ xmlGenericErrorFunc silentError = (xmlGenericErrorFunc) dummySilentError;
+
+ style = malloc (sizeof (rl2PrivRasterStyle));
+ if (style == NULL)
+ return NULL;
+ style->name = name;
+ style->title = title;
+ style->abstract = abstract;
+ style->opacity = 1.0;
+ style->bandSelection = NULL;
+ style->categorize = NULL;
+ style->interpolate = NULL;
+ style->contrastEnhancement = RL2_CONTRAST_ENHANCEMENT_NONE;
+ style->gammaValue = 1.0;
+ style->shadedRelief = 0;
+ style->brightnessOnly = 0;
+ style->reliefFactor = 55.0;
+
+/* parsing the XML document */
+ xmlSetGenericErrorFunc (NULL, silentError);
+ xml_doc =
+ xmlReadMemory ((const char *) xml, strlen ((const char *) xml),
+ "noname.xml", NULL, 0);
+ if (xml_doc == NULL)
+ {
+ /* parsing error; not a well-formed XML */
+ goto error;
+ }
+ root = xmlDocGetRootElement (xml_doc);
+ if (root == NULL)
+ goto error;
+ if (!find_raster_symbolizer (root, style, &loop))
+ goto error;
+ xmlFreeDoc (xml_doc);
+ free (xml);
+ xml = NULL;
+
+ if (style->name == NULL)
+ goto error;
+
+ return (rl2RasterStylePtr) style;
+
+ error:
+ if (xml != NULL)
+ free (xml);
+ if (xml_doc != NULL)
+ xmlFreeDoc (xml_doc);
+ if (style != NULL)
+ rl2_destroy_raster_style ((rl2RasterStylePtr) style);
+ return NULL;
+}
+
+RL2_DECLARE void
+rl2_destroy_raster_style (rl2RasterStylePtr style)
+{
+/* destroying a RasterStyle object */
+ rl2PrivColorMapPointPtr pC;
+ rl2PrivColorMapPointPtr pCn;
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return;
+
+ if (stl->name != NULL)
+ free (stl->name);
+ if (stl->title != NULL)
+ free (stl->title);
+ if (stl->abstract != NULL)
+ free (stl->abstract);
+ if (stl->bandSelection != NULL)
+ free (stl->bandSelection);
+ if (stl->categorize != NULL)
+ {
+ pC = stl->categorize->first;
+ while (pC != NULL)
+ {
+ pCn = pC->next;
+ free (pC);
+ pC = pCn;
+ }
+ free (stl->categorize);
+ }
+ if (stl->interpolate != NULL)
+ {
+ pC = stl->interpolate->first;
+ while (pC != NULL)
+ {
+ pCn = pC->next;
+ free (pC);
+ pC = pCn;
+ }
+ free (stl->interpolate);
+ }
+ free (stl);
+}
+
+RL2_DECLARE const char *
+rl2_get_raster_style_name (rl2RasterStylePtr style)
+{
+/* return the RasterStyle Name */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return NULL;
+ return stl->name;
+}
+
+RL2_DECLARE const char *
+rl2_get_raster_style_title (rl2RasterStylePtr style)
+{
+/* return the RasterStyle Title */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return NULL;
+ return stl->title;
+}
+
+RL2_DECLARE const char *
+rl2_get_raster_style_abstract (rl2RasterStylePtr style)
+{
+/* return the RasterStyle Abstract */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return NULL;
+ return stl->abstract;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_opacity (rl2RasterStylePtr style, double *opacity)
+{
+/* return the RasterStyle Opacity */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ *opacity = stl->opacity;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_raster_style_mono_band_selected (rl2RasterStylePtr style, int *selected)
+{
+/* return if the RasterStyle has a MonoBand selection */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->shadedRelief)
+ {
+ /* Shaded Relief */
+ *selected = 1;
+ return RL2_OK;
+ }
+ if (stl->bandSelection == NULL)
+ {
+ if (stl->categorize != NULL)
+ {
+ /* Categorize Color Map */
+ *selected = 1;
+ return RL2_OK;
+ }
+ if (stl->interpolate != NULL)
+ {
+ /* Interpolate Color Map */
+ *selected = 1;
+ return RL2_OK;
+ }
+ if (stl->contrastEnhancement == RL2_CONTRAST_ENHANCEMENT_NORMALIZE ||
+ stl->contrastEnhancement == RL2_CONTRAST_ENHANCEMENT_HISTOGRAM ||
+ stl->contrastEnhancement == RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ /* Contrast Enhancement */
+ *selected = 1;
+ return RL2_OK;
+ }
+ }
+ if (stl->bandSelection == NULL)
+ *selected = 0;
+ else if (stl->bandSelection->selectionType == RL2_BAND_SELECTION_MONO)
+ *selected = 1;
+ else
+ *selected = 0;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_mono_band_selection (rl2RasterStylePtr style,
+ unsigned char *gray_band)
+{
+/* return the RasterStyle MonoBand selection */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->bandSelection == NULL)
+ {
+ if (stl->categorize != NULL)
+ {
+ /* Categorize Color Map */
+ *gray_band = 0;
+ return RL2_OK;
+ }
+ if (stl->interpolate != NULL)
+ {
+ /* Interpolate Color Map */
+ *gray_band = 0;
+ return RL2_OK;
+ }
+ /* Interpolate Color Map */
+ *gray_band = 0;
+ return RL2_OK;
+ }
+ if (stl->bandSelection == NULL)
+ return RL2_ERROR;
+ else if (stl->bandSelection->selectionType == RL2_BAND_SELECTION_MONO)
+ {
+ *gray_band = stl->bandSelection->grayBand;
+ return RL2_OK;
+ }
+ else
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_is_raster_style_triple_band_selected (rl2RasterStylePtr style,
+ int *selected)
+{
+/* return if the RasterStyle has a TripleBand selection */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->bandSelection == NULL)
+ {
+ if (stl->contrastEnhancement == RL2_CONTRAST_ENHANCEMENT_NORMALIZE ||
+ stl->contrastEnhancement == RL2_CONTRAST_ENHANCEMENT_HISTOGRAM ||
+ stl->contrastEnhancement == RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ /* Contrast Enhancement */
+ *selected = 1;
+ return RL2_OK;
+ }
+ }
+ if (stl->bandSelection == NULL)
+ *selected = 0;
+ else if (stl->bandSelection->selectionType == RL2_BAND_SELECTION_TRIPLE)
+ *selected = 1;
+ else
+ *selected = 0;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_triple_band_selection (rl2RasterStylePtr style,
+ unsigned char *red_band,
+ unsigned char *green_band,
+ unsigned char *blue_band)
+{
+/* return the RasterStyle TripleBand selection */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->bandSelection == NULL)
+ {
+ if (stl->contrastEnhancement == RL2_CONTRAST_ENHANCEMENT_NORMALIZE ||
+ stl->contrastEnhancement == RL2_CONTRAST_ENHANCEMENT_HISTOGRAM ||
+ stl->contrastEnhancement == RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ /* Contrast Enhancement */
+ *red_band = 0;
+ *green_band = 1;
+ *blue_band = 2;
+ return RL2_OK;
+ }
+ }
+ if (stl->bandSelection == NULL)
+ return RL2_ERROR;
+ else if (stl->bandSelection->selectionType == RL2_BAND_SELECTION_TRIPLE)
+ {
+ *red_band = stl->bandSelection->redBand;
+ *green_band = stl->bandSelection->greenBand;
+ *blue_band = stl->bandSelection->blueBand;
+ return RL2_OK;
+ }
+ else
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_overall_contrast_enhancement (rl2RasterStylePtr style,
+ unsigned char
+ *contrast_enhancement,
+ double *gamma_value)
+{
+/* return the RasterStyle OverallContrastEnhancement */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ *contrast_enhancement = stl->contrastEnhancement;
+ *gamma_value = stl->gammaValue;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_red_band_contrast_enhancement (rl2RasterStylePtr style,
+ unsigned char
+ *contrast_enhancement,
+ double *gamma_value)
+{
+/* return the RasterStyle RedBand ContrastEnhancement */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->bandSelection == NULL)
+ return RL2_ERROR;
+ else if (stl->bandSelection->selectionType == RL2_BAND_SELECTION_TRIPLE)
+ {
+ *contrast_enhancement = stl->bandSelection->redContrast;
+ *gamma_value = stl->bandSelection->redGamma;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_green_band_contrast_enhancement (rl2RasterStylePtr style,
+ unsigned char
+ *contrast_enhancement,
+ double *gamma_value)
+{
+/* return the RasterStyle GreenBand ContrastEnhancement */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->bandSelection == NULL)
+ return RL2_ERROR;
+ else if (stl->bandSelection->selectionType == RL2_BAND_SELECTION_TRIPLE)
+ {
+ *contrast_enhancement = stl->bandSelection->greenContrast;
+ *gamma_value = stl->bandSelection->greenGamma;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_blue_band_contrast_enhancement (rl2RasterStylePtr style,
+ unsigned char
+ *contrast_enhancement,
+ double *gamma_value)
+{
+/* return the RasterStyle BlueBand ContrastEnhancement */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->bandSelection == NULL)
+ return RL2_ERROR;
+ else if (stl->bandSelection->selectionType == RL2_BAND_SELECTION_TRIPLE)
+ {
+ *contrast_enhancement = stl->bandSelection->blueContrast;
+ *gamma_value = stl->bandSelection->blueGamma;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_gray_band_contrast_enhancement (rl2RasterStylePtr style,
+ unsigned char
+ *contrast_enhancement,
+ double *gamma_value)
+{
+/* return the RasterStyle GrayBand ContrastEnhancement */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->bandSelection == NULL)
+ return RL2_ERROR;
+ else if (stl->bandSelection->selectionType == RL2_BAND_SELECTION_MONO)
+ {
+ *contrast_enhancement = stl->bandSelection->grayContrast;
+ *gamma_value = stl->bandSelection->grayGamma;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_has_raster_style_shaded_relief (rl2RasterStylePtr style, int *shaded_relief)
+{
+/* return if the RasterStyle has ShadedRelief */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ *shaded_relief = stl->shadedRelief;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_shaded_relief (rl2RasterStylePtr style,
+ int *brightness_only, double *relief_factor)
+{
+/* return the RasterStyle ShadedRelief parameters */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->shadedRelief)
+ {
+ *brightness_only = stl->brightnessOnly;
+ *relief_factor = stl->reliefFactor;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_has_raster_style_color_map_interpolated (rl2RasterStylePtr style,
+ int *interpolated)
+{
+/* return if the RasterStyle has an Interpolated ColorMap */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->interpolate != NULL)
+ *interpolated = 1;
+ else
+ *interpolated = 0;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_has_raster_style_color_map_categorized (rl2RasterStylePtr style,
+ int *categorized)
+{
+/* return if the RasterStyle has a Categorized ColorMap */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->categorize != NULL)
+ *categorized = 1;
+ else
+ *categorized = 0;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_color_map_default (rl2RasterStylePtr style,
+ unsigned char *red,
+ unsigned char *green,
+ unsigned char *blue)
+{
+/* return the RasterStyle ColorMap Default color */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->interpolate != NULL)
+ {
+ *red = stl->interpolate->dfltRed;
+ *green = stl->interpolate->dfltGreen;
+ *blue = stl->interpolate->dfltBlue;
+ return RL2_OK;
+ }
+ if (stl->categorize != NULL)
+ {
+ *red = stl->categorize->dfltRed;
+ *green = stl->categorize->dfltGreen;
+ *blue = stl->categorize->dfltBlue;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_color_map_category_base (rl2RasterStylePtr style,
+ unsigned char *red,
+ unsigned char *green,
+ unsigned char *blue)
+{
+/* return the RasterStyle ColorMap Category base-color */
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->categorize != NULL)
+ {
+ *red = stl->categorize->baseRed;
+ *green = stl->categorize->baseGreen;
+ *blue = stl->categorize->baseBlue;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_color_map_count (rl2RasterStylePtr style, int *count)
+{
+/* return the RasterStyle ColorMap items count */
+ int cnt;
+ rl2PrivColorMapPointPtr pt;
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->categorize != NULL)
+ {
+ cnt = 0;
+ pt = stl->categorize->first;
+ while (pt != NULL)
+ {
+ cnt++;
+ pt = pt->next;
+ }
+ *count = cnt;
+ return RL2_OK;
+ }
+ if (stl->interpolate != NULL)
+ {
+ cnt = 0;
+ pt = stl->interpolate->first;
+ while (pt != NULL)
+ {
+ cnt++;
+ pt = pt->next;
+ }
+ *count = cnt;
+ return RL2_OK;
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_raster_style_color_map_entry (rl2RasterStylePtr style, int index,
+ double *value, unsigned char *red,
+ unsigned char *green, unsigned char *blue)
+{
+/* return the RasterStyle ColorMap item values */
+ int cnt;
+ rl2PrivColorMapPointPtr pt;
+ rl2PrivRasterStylePtr stl = (rl2PrivRasterStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (stl->categorize != NULL)
+ {
+ cnt = 0;
+ pt = stl->categorize->first;
+ while (pt != NULL)
+ {
+ if (index == cnt)
+ {
+ *value = pt->value;
+ *red = pt->red;
+ *green = pt->green;
+ *blue = pt->blue;
+ return RL2_OK;
+ }
+ cnt++;
+ pt = pt->next;
+ }
+ }
+ if (stl->interpolate != NULL)
+ {
+ cnt = 0;
+ pt = stl->interpolate->first;
+ while (pt != NULL)
+ {
+ if (index == cnt)
+ {
+ *value = pt->value;
+ *red = pt->red;
+ *green = pt->green;
+ *blue = pt->blue;
+ return RL2_OK;
+ }
+ cnt++;
+ pt = pt->next;
+ }
+ }
+ return RL2_ERROR;
+}
+
+static void
+parse_sld_named_style (xmlNodePtr node, char **namedStyle)
+{
+/* attempting to parse an SLD Named Style */
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "Name") == 0)
+ {
+ xmlNodePtr child = node->children;
+ while (child)
+ {
+ if (child->type == XML_TEXT_NODE
+ && child->content != NULL)
+ {
+ int len =
+ (int)
+ strlen ((const char *) (child->content));
+ *namedStyle = malloc (len + 1);
+ strcpy (*namedStyle,
+ (const char *) (child->content));
+ }
+ child = child->next;
+ }
+ }
+ }
+ node = node->next;
+ }
+}
+
+static int
+parse_sld_named_layer (xmlNodePtr node, char **namedLayer, char **namedStyle)
+{
+/* attempting to parse an SLD Named Layer */
+ int ok = 0;
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "Name") == 0)
+ {
+ xmlNodePtr child = node->children;
+ while (child)
+ {
+ if (child->type == XML_TEXT_NODE
+ && child->content != NULL)
+ {
+ int len =
+ (int)
+ strlen ((const char *) (child->content));
+ *namedLayer = malloc (len + 1);
+ strcpy (*namedLayer,
+ (const char *) (child->content));
+ ok = 1;
+ }
+ child = child->next;
+ }
+ }
+ if (strcmp (name, "NamedStyle") == 0)
+ parse_sld_named_style (node->children, namedStyle);
+ }
+ node = node->next;
+ }
+ return ok;
+}
+
+static int
+parse_sld (xmlNodePtr node, rl2PrivGroupStylePtr style)
+{
+/* attempting to parse an SLD Style */
+ int ok = 0;
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "NamedLayer") == 0)
+ {
+ char *namedLayer = NULL;
+ char *namedStyle = NULL;
+ int ret =
+ parse_sld_named_layer (node->children, &namedLayer,
+ &namedStyle);
+ if (ret)
+ {
+ rl2PrivChildStylePtr child =
+ malloc (sizeof (rl2PrivChildStyle));
+ child->namedLayer = namedLayer;
+ child->namedStyle = namedStyle;
+ child->validLayer = 0;
+ child->validStyle = 0;
+ child->next = NULL;
+ if (style->first == NULL)
+ style->first = child;
+ if (style->last != NULL)
+ style->last->next = child;
+ style->last = child;
+ ok = 1;
+ }
+ }
+ }
+ node = node->next;
+ }
+ return ok;
+}
+
+static int
+parse_group_style (xmlNodePtr node, rl2PrivGroupStylePtr style)
+{
+/* parsing an SLD Style */
+ while (node)
+ {
+ if (node->type == XML_ELEMENT_NODE)
+ {
+ const char *name = (const char *) (node->name);
+ if (strcmp (name, "StyledLayerDescriptor") == 0)
+ {
+ int ret = parse_sld (node->children, style);
+ return ret;
+ }
+ }
+ node = node->next;
+ }
+ return 0;
+}
+
+RL2_PRIVATE rl2GroupStylePtr
+group_style_from_sld_xml (char *name, char *title, char *abstract,
+ unsigned char *xml)
+{
+/* attempting to build a Layer Group Style object from an SLD XML style */
+ rl2PrivGroupStylePtr style = NULL;
+ xmlDocPtr xml_doc = NULL;
+ xmlNodePtr root;
+ xmlGenericErrorFunc silentError = (xmlGenericErrorFunc) dummySilentError;
+
+ style = malloc (sizeof (rl2PrivGroupStyle));
+ if (style == NULL)
+ return NULL;
+ style->name = name;
+ style->title = title;
+ style->abstract = abstract;
+ style->first = NULL;
+ style->last = NULL;
+ style->valid = 0;
+
+/* parsing the XML document */
+ xmlSetGenericErrorFunc (NULL, silentError);
+ xml_doc =
+ xmlReadMemory ((const char *) xml, strlen ((const char *) xml),
+ "noname.xml", NULL, 0);
+ if (xml_doc == NULL)
+ {
+ /* parsing error; not a well-formed XML */
+ goto error;
+ }
+ root = xmlDocGetRootElement (xml_doc);
+ if (root == NULL)
+ goto error;
+ if (!parse_group_style (root, style))
+ goto error;
+ xmlFreeDoc (xml_doc);
+ free (xml);
+ xml = NULL;
+
+ if (style->name == NULL)
+ goto error;
+
+ return (rl2GroupStylePtr) style;
+
+ error:
+ if (xml != NULL)
+ free (xml);
+ if (xml_doc != NULL)
+ xmlFreeDoc (xml_doc);
+ if (style != NULL)
+ rl2_destroy_group_style ((rl2GroupStylePtr) style);
+ return NULL;
+}
+
+RL2_DECLARE void
+rl2_destroy_group_style (rl2GroupStylePtr style)
+{
+/* destroying a Group Style object */
+ rl2PrivChildStylePtr child;
+ rl2PrivChildStylePtr child_n;
+ rl2PrivGroupStylePtr stl = (rl2PrivGroupStylePtr) style;
+ if (stl == NULL)
+ return;
+
+ if (stl->name != NULL)
+ free (stl->name);
+ if (stl->title != NULL)
+ free (stl->title);
+ if (stl->abstract != NULL)
+ free (stl->abstract);
+ child = stl->first;
+ while (child != NULL)
+ {
+ child_n = child->next;
+ if (child->namedLayer != NULL)
+ free (child->namedLayer);
+ if (child->namedStyle != NULL)
+ free (child->namedStyle);
+ free (child);
+ child = child_n;
+ }
+ free (stl);
+}
+
+RL2_DECLARE const char *
+rl2_get_group_style_name (rl2GroupStylePtr style)
+{
+/* return the Group Style Name */
+ rl2PrivGroupStylePtr stl = (rl2PrivGroupStylePtr) style;
+ if (stl == NULL)
+ return NULL;
+ return stl->name;
+}
+
+RL2_DECLARE const char *
+rl2_get_group_style_title (rl2GroupStylePtr style)
+{
+/* return the Group Style Title */
+ rl2PrivGroupStylePtr stl = (rl2PrivGroupStylePtr) style;
+ if (stl == NULL)
+ return NULL;
+ return stl->title;
+}
+
+RL2_DECLARE const char *
+rl2_get_group_style_abstract (rl2GroupStylePtr style)
+{
+/* return the Group Style Abstract */
+ rl2PrivGroupStylePtr stl = (rl2PrivGroupStylePtr) style;
+ if (stl == NULL)
+ return NULL;
+ return stl->abstract;
+}
+
+RL2_DECLARE int
+rl2_is_valid_group_style (rl2GroupStylePtr style, int *valid)
+{
+/* testing a Group Style for validity */
+ rl2PrivGroupStylePtr stl = (rl2PrivGroupStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ *valid = stl->valid;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_group_style_count (rl2GroupStylePtr style, int *count)
+{
+/* return the total count of Group Style Items */
+ int cnt = 0;
+ rl2PrivChildStylePtr child;
+ rl2PrivGroupStylePtr stl = (rl2PrivGroupStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ child = stl->first;
+ while (child != NULL)
+ {
+ /* counting how many Children */
+ cnt++;
+ child = child->next;
+ }
+ *count = cnt;
+ return RL2_OK;
+}
+
+RL2_DECLARE const char *
+rl2_get_group_named_layer (rl2GroupStylePtr style, int index)
+{
+/* return the Nth NamedLayer from a Group Style */
+ int cnt = 0;
+ const char *str;
+ rl2PrivChildStylePtr child;
+ rl2PrivGroupStylePtr stl = (rl2PrivGroupStylePtr) style;
+ if (stl == NULL)
+ return NULL;
+ if (index < 0)
+ return NULL;
+ child = stl->first;
+ while (child != NULL)
+ {
+ /* counting how many Children */
+ cnt++;
+ child = child->next;
+ }
+ if (index >= cnt)
+ return NULL;
+ cnt = 0;
+ child = stl->first;
+ while (child != NULL)
+ {
+ if (cnt == index)
+ {
+ str = child->namedLayer;
+ break;
+ }
+ cnt++;
+ child = child->next;
+ }
+ return str;
+}
+
+RL2_DECLARE const char *
+rl2_get_group_named_style (rl2GroupStylePtr style, int index)
+{
+/* return the Nth NamedStyle from a Group Style */
+ int cnt = 0;
+ const char *str;
+ rl2PrivChildStylePtr child;
+ rl2PrivGroupStylePtr stl = (rl2PrivGroupStylePtr) style;
+ if (stl == NULL)
+ return NULL;
+ if (index < 0)
+ return NULL;
+ child = stl->first;
+ while (child != NULL)
+ {
+ /* counting how many Children */
+ cnt++;
+ child = child->next;
+ }
+ if (index >= cnt)
+ return NULL;
+ cnt = 0;
+ child = stl->first;
+ while (child != NULL)
+ {
+ if (cnt == index)
+ {
+ str = child->namedStyle;
+ break;
+ }
+ cnt++;
+ child = child->next;
+ }
+ return str;
+}
+
+RL2_DECLARE int
+rl2_is_valid_group_named_layer (rl2GroupStylePtr style, int index, int *valid)
+{
+/* testing for validity the Nth NamedLayer from a Group Style */
+ int cnt = 0;
+ rl2PrivChildStylePtr child;
+ rl2PrivGroupStylePtr stl = (rl2PrivGroupStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (index < 0)
+ return RL2_ERROR;
+ child = stl->first;
+ while (child != NULL)
+ {
+ /* counting how many Children */
+ cnt++;
+ child = child->next;
+ }
+ if (index >= cnt)
+ return RL2_ERROR;
+ cnt = 0;
+ child = stl->first;
+ while (child != NULL)
+ {
+ if (cnt == index)
+ {
+ *valid = child->validLayer;
+ break;
+ }
+ cnt++;
+ child = child->next;
+ }
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_valid_group_named_style (rl2GroupStylePtr style, int index, int *valid)
+{
+/* testing for validity the Nth NamedStyle from a Group Style */
+ int cnt = 0;
+ rl2PrivChildStylePtr child;
+ rl2PrivGroupStylePtr stl = (rl2PrivGroupStylePtr) style;
+ if (stl == NULL)
+ return RL2_ERROR;
+ if (index < 0)
+ return RL2_ERROR;
+ child = stl->first;
+ while (child != NULL)
+ {
+ /* counting how many Children */
+ cnt++;
+ child = child->next;
+ }
+ if (index >= cnt)
+ return RL2_ERROR;
+ cnt = 0;
+ child = stl->first;
+ while (child != NULL)
+ {
+ if (cnt == index)
+ {
+ *valid = child->validStyle;
+ break;
+ }
+ cnt++;
+ child = child->next;
+ }
+ return RL2_OK;
+}
+
+static rl2PrivGroupRendererPtr
+rl2_alloc_group_renderer (int count)
+{
+/* creating a GroupRenderer object */
+ int i;
+ rl2PrivGroupRendererPtr ptr = NULL;
+ if (count <= 0)
+ return NULL;
+ ptr = malloc (sizeof (rl2PrivGroupRenderer));
+ if (ptr == NULL)
+ return NULL;
+ ptr->count = count;
+ ptr->layers = malloc (sizeof (rl2PrivGroupRendererLayer) * count);
+ if (ptr->layers == NULL)
+ {
+ free (ptr);
+ return NULL;
+ }
+ for (i = 0; i < count; i++)
+ {
+ rl2PrivGroupRendererLayerPtr lyr = ptr->layers + i;
+ lyr->layer_type = 0;
+ lyr->layer_name = NULL;
+ lyr->coverage = NULL;
+ lyr->style_name = NULL;
+ lyr->raster_symbolizer = NULL;
+ lyr->raster_stats = NULL;
+ }
+ return ptr;
+}
+
+static int
+rl2_group_renderer_set_raster (rl2PrivGroupRendererPtr group, int index,
+ const char *layer_name, rl2CoveragePtr coverage,
+ const char *style_name,
+ rl2RasterStylePtr symbolizer,
+ rl2RasterStatisticsPtr stats)
+{
+/* setting up one of the Layers within the Group */
+ int len;
+ rl2PrivGroupRendererLayerPtr lyr;
+ rl2PrivGroupRendererPtr ptr = (rl2PrivGroupRendererPtr) group;
+ if (ptr == NULL)
+ return RL2_ERROR;
+
+ if (index >= 0 && index < ptr->count)
+ ;
+ else
+ return RL2_ERROR;
+
+ lyr = ptr->layers + index;
+ lyr->layer_type = RL2_GROUP_RENDERER_RASTER_LAYER;
+ if (lyr->layer_name != NULL)
+ free (lyr->layer_name);
+ if (layer_name == NULL)
+ lyr->layer_name = NULL;
+ else
+ {
+ len = strlen (layer_name);
+ lyr->layer_name = malloc (len + 1);
+ strcpy (lyr->layer_name, layer_name);
+ }
+ if (lyr->coverage != NULL)
+ rl2_destroy_coverage (lyr->coverage);
+ lyr->coverage = (rl2CoveragePtr) coverage;
+ if (lyr->style_name != NULL)
+ free (lyr->style_name);
+ if (style_name == NULL)
+ lyr->style_name = NULL;
+ else
+ {
+ len = strlen (style_name);
+ lyr->style_name = malloc (len + 1);
+ strcpy (lyr->style_name, style_name);
+ }
+ if (lyr->raster_symbolizer != NULL)
+ rl2_destroy_raster_style ((rl2RasterStylePtr) (lyr->raster_symbolizer));
+ lyr->raster_symbolizer = (rl2PrivRasterStylePtr) symbolizer;
+ if (lyr->raster_stats != NULL)
+ rl2_destroy_raster_statistics ((rl2RasterStatisticsPtr)
+ (lyr->raster_stats));
+ lyr->raster_stats = (rl2PrivRasterStatisticsPtr) stats;
+ return RL2_OK;
+
+}
+
+static int
+rl2_is_valid_group_renderer (rl2PrivGroupRendererPtr ptr, int *valid)
+{
+/* testing a GroupRenderer for validity */
+ int i;
+ int error = 0;
+ if (ptr == NULL)
+ return RL2_ERROR;
+
+ for (i = 0; i < ptr->count; i++)
+ {
+ rl2PrivGroupRendererLayerPtr lyr = ptr->layers + i;
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) lyr->coverage;
+ if (lyr->layer_type != RL2_GROUP_RENDERER_RASTER_LAYER)
+ error = 1;
+ if (lyr->layer_name == NULL)
+ error = 1;
+ if (lyr->coverage == NULL)
+ error = 1;
+ else
+ {
+ if ((cvg->pixelType == RL2_PIXEL_DATAGRID
+ || cvg->pixelType == RL2_PIXEL_MULTIBAND)
+ && lyr->raster_symbolizer == NULL)
+ error = 1;
+ }
+ if (lyr->style_name == NULL)
+ error = 1;
+ if (lyr->raster_stats == NULL)
+ error = 1;
+ }
+ if (error)
+ *valid = 0;
+ else
+ *valid = 1;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2GroupRendererPtr
+rl2_create_group_renderer (sqlite3 * sqlite, rl2GroupStylePtr group_style)
+{
+/* creating a GroupRenderer object */
+ rl2PrivGroupRendererPtr group = NULL;
+ int valid;
+ int count;
+ int i;
+
+ if (rl2_is_valid_group_style (group_style, &valid) != RL2_OK)
+ goto error;
+ if (!valid)
+ goto error;
+ if (rl2_get_group_style_count (group_style, &count) != RL2_OK)
+ goto error;
+ group = rl2_alloc_group_renderer (count);
+ if (group == NULL)
+ goto error;
+ for (i = 0; i < count; i++)
+ {
+ /* testing individual layers/styles */
+ rl2RasterStylePtr symbolizer = NULL;
+ rl2RasterStatisticsPtr stats = NULL;
+ const char *layer_name = rl2_get_group_named_layer (group_style, i);
+ const char *layer_style = rl2_get_group_named_style (group_style, i);
+ rl2CoveragePtr coverage =
+ rl2_create_coverage_from_dbms (sqlite, layer_name);
+ rl2PrivCoveragePtr cvg = (rl2PrivCoveragePtr) coverage;
+ if (rl2_is_valid_group_named_layer (group_style, 0, &valid) == RL2_OK)
+ {
+ if (valid)
+ {
+ /* validating the style */
+ if (layer_style == NULL)
+ layer_style = "default";
+ if (strcasecmp (layer_style, "default") == 0)
+ ;
+ else
+ {
+ /* attempting to get a RasterSymbolizer style */
+ symbolizer =
+ rl2_create_raster_style_from_dbms (sqlite,
+ layer_name,
+ layer_style);
+ }
+ stats =
+ rl2_create_raster_statistics_from_dbms (sqlite,
+ layer_name);
+ }
+ if ((cvg->pixelType == RL2_PIXEL_DATAGRID
+ || cvg->pixelType == RL2_PIXEL_MULTIBAND)
+ && symbolizer == NULL)
+ {
+ /* creating a default RasterStyle */
+ rl2PrivRasterStylePtr symb =
+ malloc (sizeof (rl2PrivRasterStyle));
+ symbolizer = (rl2RasterStylePtr) symb;
+ symb->name = malloc (8);
+ strcpy (symb->name, "default");
+ symb->title = NULL;
+ symb->abstract = NULL;
+ symb->opacity = 1.0;
+ symb->contrastEnhancement = RL2_CONTRAST_ENHANCEMENT_NONE;
+ symb->bandSelection =
+ malloc (sizeof (rl2PrivBandSelection));
+ symb->bandSelection->selectionType =
+ RL2_BAND_SELECTION_MONO;
+ symb->bandSelection->grayBand = 0;
+ symb->bandSelection->grayContrast =
+ RL2_CONTRAST_ENHANCEMENT_NONE;
+ symb->categorize = NULL;
+ symb->interpolate = NULL;
+ symb->shadedRelief = 0;
+ }
+ }
+ rl2_group_renderer_set_raster (group, i, layer_name, coverage,
+ layer_style, symbolizer, stats);
+ }
+ if (rl2_is_valid_group_renderer (group, &valid) != RL2_OK)
+ goto error;
+ if (!valid)
+ goto error;
+ return (rl2GroupRendererPtr) group;
+
+ error:
+ if (group != NULL)
+ rl2_destroy_group_renderer ((rl2GroupRendererPtr) group);
+ return NULL;
+}
+
+RL2_DECLARE void
+rl2_destroy_group_renderer (rl2GroupRendererPtr group)
+{
+/* memory cleanup - destroying a GroupRenderer object */
+ int i;
+ rl2PrivGroupRendererPtr ptr = (rl2PrivGroupRendererPtr) group;
+ if (ptr == NULL)
+ return;
+ for (i = 0; i < ptr->count; i++)
+ {
+ rl2PrivGroupRendererLayerPtr lyr = ptr->layers + i;
+ if (lyr->layer_name != NULL)
+ free (lyr->layer_name);
+ if (lyr->coverage != NULL)
+ rl2_destroy_coverage (lyr->coverage);
+ if (lyr->style_name != NULL)
+ free (lyr->style_name);
+ if (lyr->raster_symbolizer != NULL)
+ rl2_destroy_raster_style ((rl2RasterStylePtr)
+ (lyr->raster_symbolizer));
+ if (lyr->raster_stats != NULL)
+ rl2_destroy_raster_statistics ((rl2RasterStatisticsPtr)
+ (lyr->raster_stats));
+ }
+ free (ptr->layers);
+ free (ptr);
+}
diff --git a/src/rl2tiff.c b/src/rl2tiff.c
new file mode 100644
index 0000000..2227a15
--- /dev/null
+++ b/src/rl2tiff.c
@@ -0,0 +1,7729 @@
+/*
+
+ rl2tiff -- TIFF / GeoTIFF related functions
+
+ version 0.1, 2013 April 5
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+#include <inttypes.h>
+
+#include "rasterlite2/sqlite.h"
+
+#include "config.h"
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2_private.h"
+#include "rasterlite2/rl2tiff.h"
+
+struct memfile
+{
+/* a struct emulating a file [memory mapped] */
+ unsigned char *buffer;
+ int malloc_block;
+ tsize_t size;
+ tsize_t eof;
+ toff_t current;
+};
+
+static void
+memory_realloc (struct memfile *mem, tsize_t req_size)
+{
+/* expanding the allocated memory */
+ unsigned char *new_buffer;
+ tsize_t new_size = mem->size;
+ while (new_size <= req_size)
+ new_size += mem->malloc_block;
+ new_buffer = realloc (mem->buffer, new_size);
+ if (!new_buffer)
+ return;
+ mem->buffer = new_buffer;
+ memset (mem->buffer + mem->size, '\0', new_size - mem->size);
+ mem->size = new_size;
+}
+
+static tsize_t
+memory_readproc (thandle_t clientdata, tdata_t data, tsize_t size)
+{
+/* emulating the read() function */
+ struct memfile *mem = clientdata;
+ tsize_t len;
+ if (mem->current >= (toff_t) mem->eof)
+ return 0;
+ len = size;
+ if ((mem->current + size) >= (toff_t) mem->eof)
+ len = (tsize_t) (mem->eof - mem->current);
+ memcpy (data, mem->buffer + mem->current, len);
+ mem->current += len;
+ return len;
+}
+
+static tsize_t
+memory_writeproc (thandle_t clientdata, tdata_t data, tsize_t size)
+{
+/* emulating the write() function */
+ struct memfile *mem = clientdata;
+ if ((mem->current + size) >= (toff_t) mem->size)
+ memory_realloc (mem, mem->current + size);
+ if ((mem->current + size) >= (toff_t) mem->size)
+ return -1;
+ memcpy (mem->buffer + mem->current, (unsigned char *) data, size);
+ mem->current += size;
+ if (mem->current > (toff_t) mem->eof)
+ mem->eof = (tsize_t) (mem->current);
+ return size;
+}
+
+static toff_t
+memory_seekproc (thandle_t clientdata, toff_t offset, int whence)
+{
+/* emulating the lseek() function */
+ struct memfile *mem = clientdata;
+ switch (whence)
+ {
+ case SEEK_CUR:
+ if ((int) (mem->current + offset) < 0)
+ return (toff_t) - 1;
+ mem->current += offset;
+ if ((toff_t) mem->eof < mem->current)
+ mem->eof = (tsize_t) (mem->current);
+ break;
+ case SEEK_END:
+ if ((int) (mem->eof + offset) < 0)
+ return (toff_t) - 1;
+ mem->current = mem->eof + offset;
+ if ((toff_t) mem->eof < mem->current)
+ mem->eof = (tsize_t) (mem->current);
+ break;
+ case SEEK_SET:
+ default:
+ if ((int) offset < 0)
+ return (toff_t) - 1;
+ mem->current = offset;
+ if ((toff_t) mem->eof < mem->current)
+ mem->eof = (tsize_t) (mem->current);
+ break;
+ };
+ return mem->current;
+}
+
+static int
+closeproc (thandle_t clientdata)
+{
+/* emulating the close() function */
+ if (clientdata)
+ return 0; /* does absolutely nothing - required in order to suppress warnings */
+ return 0;
+}
+
+static toff_t
+memory_sizeproc (thandle_t clientdata)
+{
+/* returning the pseudo-file current size */
+ struct memfile *mem = clientdata;
+ return mem->eof;
+}
+
+static int
+mapproc (thandle_t clientdata, tdata_t * data, toff_t * offset)
+{
+ if (clientdata || data || offset)
+ return 0; /* does absolutely nothing - required in order to suppress warnings */
+ return 0;
+}
+
+static void
+unmapproc (thandle_t clientdata, tdata_t data, toff_t offset)
+{
+ if (clientdata || data || offset)
+ return; /* does absolutely nothing - required in order to suppress warnings */
+ return;
+}
+
+static int
+read_from_tiff (rl2PrivTiffOriginPtr origin, unsigned short width,
+ unsigned short height, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_bands,
+ unsigned int startRow, unsigned int startCol,
+ unsigned char **pixels, int *pixels_sz, rl2PalettePtr palette);
+
+static rl2PrivTiffOriginPtr
+create_tiff_origin (const char *path, unsigned char force_sample_type,
+ unsigned char force_pixel_type,
+ unsigned char force_num_bands)
+{
+/* creating an uninitialized TIFF origin */
+ int len;
+ rl2PrivTiffOriginPtr origin;
+ if (path == NULL)
+ return NULL;
+ origin = malloc (sizeof (rl2PrivTiffOrigin));
+ if (origin == NULL)
+ return NULL;
+
+ len = strlen (path);
+ origin->path = malloc (len + 1);
+ strcpy (origin->path, path);
+ origin->tfw_path = NULL;
+ origin->isGeoTiff = 0;
+ origin->in = (TIFF *) 0;
+ origin->tileWidth = 0;
+ origin->tileHeight = 0;
+ origin->rowsPerStrip = 0;
+ origin->maxPalette = 0;
+ origin->red = NULL;
+ origin->green = NULL;
+ origin->blue = NULL;
+ origin->remapMaxPalette = 0;
+ origin->remapRed = NULL;
+ origin->remapGreen = NULL;
+ origin->remapBlue = NULL;
+ origin->isGeoReferenced = 0;
+ origin->Srid = -1;
+ origin->srsName = NULL;
+ origin->proj4text = NULL;
+ origin->forced_sample_type = force_sample_type;
+ origin->forced_pixel_type = force_pixel_type;
+ origin->forced_num_bands = force_num_bands;
+ origin->forced_conversion = RL2_CONVERT_NO;
+ return origin;
+}
+
+static int
+alloc_palette (rl2PrivTiffOriginPtr tiff, int max_palette)
+{
+/* allocating an empty Palette */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ int i;
+
+ if (origin == NULL)
+ return 0;
+ if (max_palette < 1 || max_palette > 256)
+ return 0;
+ origin->maxPalette = max_palette;
+ origin->red = malloc (max_palette);
+ if (origin->red == NULL)
+ return 0;
+ origin->green = malloc (max_palette);
+ if (origin->green == NULL)
+ {
+ free (origin->red);
+ return 0;
+ }
+ origin->blue = malloc (max_palette);
+ if (origin->blue == NULL)
+ {
+ free (origin->red);
+ free (origin->green);
+ return 0;
+ }
+ for (i = 0; i < max_palette; i++)
+ {
+ origin->red[i] = 0;
+ origin->green[i] = 0;
+ origin->blue[i] = 0;
+ }
+ return 1;
+}
+
+RL2_DECLARE void
+rl2_destroy_tiff_origin (rl2TiffOriginPtr tiff)
+{
+/* memory cleanup - destroying a TIFF origin */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return;
+ if (origin->in != (TIFF *) 0)
+ TIFFClose (origin->in);
+ if (origin->path != NULL)
+ free (origin->path);
+ if (origin->tfw_path != NULL)
+ free (origin->tfw_path);
+ if (origin->red != NULL)
+ free (origin->red);
+ if (origin->green != NULL)
+ free (origin->green);
+ if (origin->blue != NULL)
+ free (origin->blue);
+ if (origin->remapRed != NULL)
+ free (origin->remapRed);
+ if (origin->remapGreen != NULL)
+ free (origin->remapGreen);
+ if (origin->remapBlue != NULL)
+ free (origin->remapBlue);
+ if (origin->srsName != NULL)
+ free (origin->srsName);
+ if (origin->proj4text != NULL)
+ free (origin->proj4text);
+ free (origin);
+}
+
+static void
+origin_set_tfw_path (const char *path, rl2PrivTiffOriginPtr origin)
+{
+/* building the TFW path (WorldFile) */
+ char *tfw;
+ const char *x = NULL;
+ const char *p = path;
+ int len = strlen (path);
+ len -= 1;
+ while (*p != '\0')
+ {
+ if (*p == '.')
+ x = p;
+ p++;
+ }
+ if (x > path)
+ len = x - path;
+ tfw = malloc (len + 5);
+ memcpy (tfw, path, len);
+ memcpy (tfw + len, ".tfw", 4);
+ *(tfw + len + 4) = '\0';
+ origin->tfw_path = tfw;
+}
+
+static int
+is_valid_float (char *str)
+{
+/* testing for a valid worlodfile float value */
+ char *p = str;
+ int point = 0;
+ int sign = 0;
+ int digit = 0;
+ int len = strlen (str);
+ int i;
+
+ for (i = len - 1; i >= 0; i--)
+ {
+ /* suppressing any trailing blank */
+ if (str[i] == ' ' || str[i] == '\t' || str[i] == '\r')
+ str[i] = '\0';
+ else
+ break;
+ }
+
+ while (1)
+ {
+ /* skipping leading blanks */
+ if (*p != ' ' && *p != '\t')
+ break;
+ p++;
+ }
+
+/* testing for a well formatted float */
+ while (1)
+ {
+ if (*p == '\0')
+ break;
+ if (*p >= '0' && *p <= '9')
+ digit++;
+ else if (*p == '.')
+ point++;
+ else if (*p == ',')
+ {
+ *p = '.';
+ point++;
+ }
+ else if (*p == '+' || *p == '-')
+ {
+ if (digit == 0 && point == 0 && sign == 0)
+ ;
+ else
+ return 0;
+ }
+ else
+ return 0;
+ p++;
+ }
+ if (digit > 0 && sign <= 1 && point <= 1)
+ return 1;
+ return 0;
+}
+
+RL2_PRIVATE int
+parse_worldfile (FILE * in, double *px, double *py, double *pres_x,
+ double *pres_y)
+{
+/* attemtping to parse a WorldFile */
+ int line_no = 0;
+ int ok_res_x = 0;
+ int ok_res_y = 0;
+ int ok_x = 0;
+ int ok_y = 0;
+ char buf[1024];
+ char *p = buf;
+ double x;
+ double y;
+ double res_x;
+ double res_y;
+
+ if (in == NULL)
+ return 0;
+
+ while (1)
+ {
+ int c = getc (in);
+ if (c == '\n' || c == EOF)
+ {
+ *p = '\0';
+ if (line_no == 0)
+ {
+ if (is_valid_float (buf))
+ {
+ res_x = atof (buf);
+ ok_res_x = 1;
+ }
+ }
+ if (line_no == 3)
+ {
+ if (is_valid_float (buf))
+ {
+ res_y = atof (buf) * -1.0;
+ ok_res_y = 1;
+ }
+ }
+ if (line_no == 4)
+ {
+ if (is_valid_float (buf))
+ {
+ x = atof (buf);
+ ok_x = 1;
+ }
+ }
+ if (line_no == 5)
+ {
+ if (is_valid_float (buf))
+ {
+ y = atof (buf);
+ ok_y = 1;
+ }
+ }
+ if (c == EOF)
+ break;
+ p = buf;
+ line_no++;
+ continue;
+ }
+ *p++ = c;
+ }
+
+ if (ok_x && ok_y && ok_res_x && ok_res_y)
+ {
+ *px = x;
+ *py = y;
+ *pres_x = res_x;
+ *pres_y = res_y;
+ return 1;
+ }
+ return 0;
+}
+
+static void
+worldfile_tiff_origin (const char *path, rl2PrivTiffOriginPtr origin, int srid)
+{
+/* attempting to retrieve georeferencing from a TIFF+TFW origin */
+ FILE *tfw = NULL;
+ double res_x;
+ double res_y;
+ double x;
+ double y;
+
+ origin_set_tfw_path (path, origin);
+ tfw = fopen (origin->tfw_path, "r");
+ if (tfw == NULL)
+ goto error;
+ if (!parse_worldfile (tfw, &x, &y, &res_x, &res_y))
+ goto error;
+ fclose (tfw);
+ origin->Srid = srid;
+ origin->hResolution = res_x;
+ origin->vResolution = res_y;
+ origin->minX = x;
+ origin->maxY = y;
+ origin->isGeoReferenced = 1;
+ return;
+
+ error:
+ if (tfw != NULL)
+ fclose (tfw);
+ if (origin->tfw_path != NULL)
+ free (origin->tfw_path);
+ origin->tfw_path = NULL;
+}
+
+static void
+geo_tiff_origin (const char *path, rl2PrivTiffOriginPtr origin, int force_srid)
+{
+/* attempting to retrieve georeferencing from a GeoTIFF origin */
+ uint32 width = 0;
+ uint32 height = 0;
+ double cx;
+ double cy;
+ GTIFDefn definition;
+ char *pString;
+ int len;
+ TIFF *in = (TIFF *) 0;
+ GTIF *gtif = (GTIF *) 0;
+
+/* suppressing TIFF messages */
+ TIFFSetErrorHandler (NULL);
+ TIFFSetWarningHandler (NULL);
+
+/* reading from file */
+ in = XTIFFOpen (path, "r");
+ if (in == NULL)
+ goto error;
+ gtif = GTIFNew (in);
+ if (gtif == NULL)
+ goto error;
+
+ if (!GTIFGetDefn (gtif, &definition))
+ goto error;
+/* retrieving the EPSG code */
+ if (definition.PCS == 32767)
+ {
+ if (definition.GCS != 32767)
+ origin->Srid = definition.GCS;
+ }
+ else
+ origin->Srid = definition.PCS;
+ if (origin->Srid <= 0)
+ {
+ origin->Srid = force_srid;
+ if (origin->Srid <= 0)
+ goto error;
+ }
+ if (definition.PCS == 32767)
+ {
+ /* Get the GCS name if possible */
+ pString = NULL;
+ GTIFGetGCSInfo (definition.GCS, &pString, NULL, NULL, NULL);
+ if (pString != NULL)
+ {
+ len = strlen (pString);
+ origin->srsName = malloc (len + 1);
+ strcpy (origin->srsName, pString);
+ CPLFree (pString);
+ }
+ }
+ else
+ {
+ /* Get the PCS name if possible */
+ pString = NULL;
+ GTIFGetPCSInfo (definition.PCS, &pString, NULL, NULL, NULL);
+ if (pString != NULL)
+ {
+ len = strlen (pString);
+ origin->srsName = malloc (len + 1);
+ strcpy (origin->srsName, pString);
+ CPLFree (pString);
+ }
+ }
+/* retrieving the PROJ.4 params */
+ pString = GTIFGetProj4Defn (&definition);
+ if (pString != NULL)
+ {
+ len = strlen (pString);
+ origin->proj4text = malloc (len + 1);
+ strcpy (origin->proj4text, pString);
+ CPLFree (pString);
+ }
+
+/* retrieving the TIFF dimensions */
+ TIFFGetField (in, TIFFTAG_IMAGELENGTH, &height);
+ TIFFGetField (in, TIFFTAG_IMAGEWIDTH, &width);
+
+/* computing the corners coords */
+ cx = 0.0;
+ cy = 0.0;
+ GTIFImageToPCS (gtif, &cx, &cy);
+ origin->minX = cx;
+ origin->maxY = cy;
+ cx = 0.0;
+ cy = height;
+ GTIFImageToPCS (gtif, &cx, &cy);
+ origin->minY = cy;
+ cx = width;
+ cy = 0.0;
+ GTIFImageToPCS (gtif, &cx, &cy);
+ origin->maxX = cx;
+
+/* computing the pixel resolution */
+ origin->hResolution = (origin->maxX - origin->minX) / (double) width;
+ origin->vResolution = (origin->maxY - origin->minY) / (double) height;
+ origin->isGeoReferenced = 1;
+ origin->isGeoTiff = 1;
+
+ error:
+ if (in != (TIFF *) 0)
+ XTIFFClose (in);
+ if (gtif != (GTIF *) 0)
+ GTIFFree (gtif);
+}
+
+static int
+check_grayscale_palette (rl2PrivTiffOriginPtr origin)
+{
+/* checking if a Palette actually is a Grayscale Palette */
+ int i;
+ if (origin->maxPalette == 0 || origin->maxPalette > 256)
+ return 0;
+ for (i = 0; i < origin->maxPalette; i++)
+ {
+ if (origin->red[i] == origin->green[i]
+ && origin->red[i] == origin->blue[i])
+ ;
+ else
+ return 0;
+ }
+ return 1;
+}
+
+static int
+check_tiff_origin_pixel_conversion (rl2PrivTiffOriginPtr origin)
+{
+/* check if the Color-Space conversion could be accepted */
+ if (origin->forced_sample_type == RL2_SAMPLE_UNKNOWN)
+ {
+ if (origin->sampleFormat == SAMPLEFORMAT_INT)
+ {
+ if (origin->bitsPerSample == 8)
+ origin->forced_sample_type = RL2_SAMPLE_INT8;
+ if (origin->bitsPerSample == 16)
+ origin->forced_sample_type = RL2_SAMPLE_INT16;
+ if (origin->bitsPerSample == 32)
+ origin->forced_sample_type = RL2_SAMPLE_INT32;
+ }
+ else if (origin->sampleFormat == SAMPLEFORMAT_UINT)
+ {
+ if (origin->bitsPerSample == 1)
+ origin->forced_sample_type = RL2_SAMPLE_1_BIT;
+ if (origin->bitsPerSample == 2)
+ origin->forced_sample_type = RL2_SAMPLE_2_BIT;
+ if (origin->bitsPerSample == 4)
+ origin->forced_sample_type = RL2_SAMPLE_4_BIT;
+ if (origin->bitsPerSample == 8)
+ origin->forced_sample_type = RL2_SAMPLE_UINT8;
+ if (origin->bitsPerSample == 16)
+ origin->forced_sample_type = RL2_SAMPLE_UINT16;
+ if (origin->bitsPerSample == 32)
+ origin->forced_sample_type = RL2_SAMPLE_UINT32;
+ }
+ else if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP)
+ {
+ if (origin->bitsPerSample == 32)
+ origin->forced_sample_type = RL2_SAMPLE_FLOAT;
+ if (origin->bitsPerSample == 64)
+ origin->forced_sample_type = RL2_SAMPLE_DOUBLE;
+ }
+ }
+ if (origin->forced_pixel_type == RL2_PIXEL_UNKNOWN)
+ {
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->photometric == PHOTOMETRIC_RGB)
+ {
+ if (origin->samplesPerPixel == 3)
+ origin->forced_pixel_type = RL2_PIXEL_RGB;
+ else
+ origin->forced_pixel_type = RL2_PIXEL_MULTIBAND;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB
+ && origin->bitsPerSample > 1)
+ origin->forced_pixel_type = RL2_PIXEL_GRAYSCALE;
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric == PHOTOMETRIC_PALETTE
+ && origin->bitsPerSample <= 8)
+ origin->forced_pixel_type = RL2_PIXEL_PALETTE;
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric <= PHOTOMETRIC_RGB
+ && origin->bitsPerSample == 1)
+ origin->forced_pixel_type = RL2_PIXEL_MONOCHROME;
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB
+ && origin->bitsPerSample == 8)
+ origin->forced_pixel_type = RL2_PIXEL_DATAGRID;
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB
+ && origin->bitsPerSample == 16)
+ origin->forced_pixel_type = RL2_PIXEL_DATAGRID;
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB
+ && origin->bitsPerSample == 32)
+ origin->forced_pixel_type = RL2_PIXEL_DATAGRID;
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB
+ && origin->bitsPerSample == 32)
+ origin->forced_pixel_type = RL2_PIXEL_DATAGRID;
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB
+ && origin->bitsPerSample == 32)
+ origin->forced_pixel_type = RL2_PIXEL_DATAGRID;
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB
+ && origin->bitsPerSample == 64)
+ origin->forced_pixel_type = RL2_PIXEL_DATAGRID;
+ }
+ if (origin->forced_num_bands == RL2_BANDS_UNKNOWN)
+ origin->forced_num_bands = origin->samplesPerPixel;
+
+ if (origin->forced_sample_type == RL2_SAMPLE_UINT8
+ && origin->forced_pixel_type == RL2_PIXEL_RGB
+ && origin->forced_num_bands == 3)
+ {
+ /* RGB color-space */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 3
+ && origin->photometric == PHOTOMETRIC_RGB)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRAYSCALE_TO_RGB;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric == PHOTOMETRIC_PALETTE
+ && origin->bitsPerSample <= 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_PALETTE_TO_RGB;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_UINT16
+ && origin->forced_pixel_type == RL2_PIXEL_RGB
+ && origin->forced_num_bands == 3)
+ {
+ /* RGB color-space */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 3
+ && origin->photometric == PHOTOMETRIC_RGB)
+ return 1;
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_UINT8
+ && origin->forced_pixel_type == RL2_PIXEL_MULTIBAND)
+ {
+ /* MULTIBAND color-space */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == origin->forced_num_bands
+ && origin->photometric == PHOTOMETRIC_RGB)
+ return 1;
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_UINT16
+ && origin->forced_pixel_type == RL2_PIXEL_MULTIBAND)
+ {
+ /* MULTIBAND color-space */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == origin->forced_num_bands
+ && origin->photometric == PHOTOMETRIC_RGB)
+ return 1;
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_UINT8
+ && origin->forced_pixel_type == RL2_PIXEL_GRAYSCALE
+ && origin->forced_num_bands == 1)
+ {
+ /* GRAYSCALE color-space */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB
+ && origin->bitsPerSample > 1)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 3
+ && origin->photometric == PHOTOMETRIC_RGB)
+ {
+ origin->forced_conversion = RL2_CONVERT_RGB_TO_GRAYSCALE;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric == PHOTOMETRIC_PALETTE
+ && origin->bitsPerSample <= 8 && check_grayscale_palette (origin))
+ {
+ origin->forced_conversion = RL2_CONVERT_PALETTE_TO_GRAYSCALE;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_UINT16
+ && origin->forced_pixel_type == RL2_PIXEL_GRAYSCALE
+ && origin->forced_num_bands == 1)
+ {
+ /* GRAYSCALE color-space */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB
+ && origin->bitsPerSample > 1)
+ return 1;
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_UINT8
+ && origin->forced_pixel_type == RL2_PIXEL_PALETTE
+ && origin->forced_num_bands == 1)
+ {
+ /* PALETTE-256 color-space */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric == PHOTOMETRIC_PALETTE
+ && origin->bitsPerSample <= 8)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRAYSCALE_TO_PALETTE;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_4_BIT
+ && origin->forced_pixel_type == RL2_PIXEL_PALETTE
+ && origin->forced_num_bands == 1)
+ {
+ /* PALETTE-16 color-space */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric == PHOTOMETRIC_PALETTE
+ && origin->bitsPerSample <= 8)
+ return 1;
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_2_BIT
+ && origin->forced_pixel_type == RL2_PIXEL_PALETTE
+ && origin->forced_num_bands == 1)
+ {
+ /* PALETTE-4 color-space */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric == PHOTOMETRIC_PALETTE
+ && origin->bitsPerSample <= 8)
+ return 1;
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_1_BIT
+ && origin->forced_pixel_type == RL2_PIXEL_PALETTE
+ && origin->forced_num_bands == 1)
+ {
+ /* PALETTE-2 color-space */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric == PHOTOMETRIC_PALETTE
+ && origin->bitsPerSample <= 8)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric <= PHOTOMETRIC_RGB
+ && origin->bitsPerSample == 1)
+ {
+ origin->forced_conversion = RL2_CONVERT_MONOCHROME_TO_PALETTE;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_1_BIT
+ && origin->forced_pixel_type == RL2_PIXEL_MONOCHROME
+ && origin->forced_num_bands == 1)
+ {
+ /* MONOCHROME color-space */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric <= PHOTOMETRIC_RGB
+ && origin->bitsPerSample == 1)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric == PHOTOMETRIC_PALETTE
+ && origin->bitsPerSample <= 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_PALETTE_TO_MONOCHROME;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_INT8
+ && origin->forced_pixel_type == RL2_PIXEL_DATAGRID
+ && origin->forced_num_bands == 1)
+ {
+ /* INT8 datagrid */
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT8_TO_INT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT16_TO_INT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT16_TO_INT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT32_TO_INT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT32_TO_INT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_FLOAT_TO_INT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 64)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_DOUBLE_TO_INT8;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_UINT8
+ && origin->forced_pixel_type == RL2_PIXEL_DATAGRID
+ && origin->forced_num_bands == 1)
+ {
+ /* UINT8 datagrid */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT8_TO_UINT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT16_TO_UINT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT16_TO_UINT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT32_TO_UINT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT32_TO_UINT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_FLOAT_TO_UINT8;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 64)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_DOUBLE_TO_UINT8;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_INT16
+ && origin->forced_pixel_type == RL2_PIXEL_DATAGRID
+ && origin->forced_num_bands == 1)
+ {
+ /* INT16 datagrid */
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT16_TO_INT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT8_TO_INT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT8_TO_INT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT32_TO_INT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT32_TO_INT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_FLOAT_TO_INT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 64)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_DOUBLE_TO_INT16;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_UINT16
+ && origin->forced_pixel_type == RL2_PIXEL_DATAGRID
+ && origin->forced_num_bands == 1)
+ {
+ /* UINT16 datagrid */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT16_TO_UINT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT8_TO_UINT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT8_TO_UINT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT32_TO_UINT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT32_TO_UINT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_FLOAT_TO_UINT16;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 64)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_DOUBLE_TO_UINT16;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_INT32
+ && origin->forced_pixel_type == RL2_PIXEL_DATAGRID
+ && origin->forced_num_bands == 1)
+ {
+ /* INT32 datagrid */
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT32_TO_INT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT8_TO_INT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT8_TO_INT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT16_TO_INT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT16_TO_INT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_FLOAT_TO_INT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 64)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_DOUBLE_TO_INT32;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_UINT32
+ && origin->forced_pixel_type == RL2_PIXEL_DATAGRID
+ && origin->forced_num_bands == 1)
+ {
+ /* UINT32 datagrid */
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT32_TO_UINT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT8_TO_UINT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT8_TO_UINT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT16_TO_UINT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT16_TO_UINT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_FLOAT_TO_UINT32;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 64)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_DOUBLE_TO_UINT32;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_FLOAT
+ && origin->forced_pixel_type == RL2_PIXEL_DATAGRID
+ && origin->forced_num_bands == 1)
+ {
+ /* FLOAT datagrid */
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT8_TO_FLOAT;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT16_TO_FLOAT;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT32_TO_FLOAT;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT8_TO_FLOAT;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT16_TO_FLOAT;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT32_TO_FLOAT;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 64)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_DOUBLE_TO_FLOAT;
+ return 1;
+ }
+ }
+ if (origin->forced_sample_type == RL2_SAMPLE_DOUBLE
+ && origin->forced_pixel_type == RL2_PIXEL_DATAGRID
+ && origin->forced_num_bands == 1)
+ {
+ /* DOUBLE datagrid */
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 64)
+ return 1;
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT8_TO_DOUBLE;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT16_TO_DOUBLE;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_INT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_INT32_TO_DOUBLE;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 8)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT8_TO_DOUBLE;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 16)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT16_TO_DOUBLE;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_UINT32_TO_DOUBLE;
+ return 1;
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && origin->samplesPerPixel == 1 && origin->bitsPerSample == 32)
+ {
+ origin->forced_conversion = RL2_CONVERT_GRID_FLOAT_TO_DOUBLE;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static int
+init_tiff_origin (const char *path, rl2PrivTiffOriginPtr origin)
+{
+/* attempting to initialize a file-based TIFF origin */
+ uint32 value32;
+ uint16 value16;
+
+/* suppressing TIFF messages */
+ TIFFSetErrorHandler (NULL);
+ TIFFSetWarningHandler (NULL);
+
+/* reading from file */
+ origin->in = TIFFOpen (path, "r");
+ if (origin->in == NULL)
+ goto error;
+/* tiled/striped layout */
+ origin->isTiled = TIFFIsTiled (origin->in);
+
+/* retrieving TIFF dimensions */
+ TIFFGetField (origin->in, TIFFTAG_IMAGELENGTH, &value32);
+ origin->height = value32;
+ TIFFGetField (origin->in, TIFFTAG_IMAGEWIDTH, &value32);
+ origin->width = value32;
+ if (origin->isTiled)
+ {
+ TIFFGetField (origin->in, TIFFTAG_TILEWIDTH, &value32);
+ origin->tileWidth = value32;
+ TIFFGetField (origin->in, TIFFTAG_TILELENGTH, &value32);
+ origin->tileHeight = value32;
+ }
+ else
+ {
+ TIFFGetField (origin->in, TIFFTAG_ROWSPERSTRIP, &value32);
+ origin->rowsPerStrip = value32;
+ }
+
+ if (origin->isGeoReferenced && origin->isGeoTiff == 0)
+ {
+ /* completing Worldfile georeferencing */
+ origin->maxX =
+ origin->minX + (origin->hResolution * (double) (origin->width));
+ origin->minY =
+ origin->maxY - (origin->vResolution * (double) (origin->height));
+ }
+
+/* retrieving pixel configuration */
+ TIFFGetField (origin->in, TIFFTAG_BITSPERSAMPLE, &value16);
+ origin->bitsPerSample = value16;
+ if (TIFFGetField (origin->in, TIFFTAG_SAMPLESPERPIXEL, &value16) == 0)
+ {
+ /* attempting to recover badly formatted TIFFs */
+ origin->samplesPerPixel = 1;
+ }
+ else
+ origin->samplesPerPixel = value16;
+ TIFFGetField (origin->in, TIFFTAG_PHOTOMETRIC, &value16);
+ origin->photometric = value16;
+ TIFFGetField (origin->in, TIFFTAG_COMPRESSION, &value16);
+ origin->compression = value16;
+ if (TIFFGetField (origin->in, TIFFTAG_SAMPLEFORMAT, &value16) == 0)
+ origin->sampleFormat = SAMPLEFORMAT_UINT;
+ else
+ origin->sampleFormat = value16;
+ if (TIFFGetField (origin->in, TIFFTAG_PLANARCONFIG, &value16) == 0)
+ {
+ /* attempting to recover badly formatted TIFFs */
+ origin->planarConfig = PLANARCONFIG_CONTIG;
+ }
+ else
+ origin->planarConfig = value16;
+
+ if (origin->bitsPerSample == 16 && origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->planarConfig == PLANARCONFIG_SEPARATE)
+ ;
+ else if (origin->bitsPerSample == 8
+ && origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->planarConfig == PLANARCONFIG_SEPARATE)
+ ;
+ else if (origin->planarConfig != PLANARCONFIG_CONTIG)
+ goto error;
+
+ if (origin->photometric == PHOTOMETRIC_PALETTE
+ && origin->sampleFormat == SAMPLEFORMAT_UINT)
+ {
+ /* attempting to retrieve a Palette */
+ uint16 *red;
+ uint16 *green;
+ uint16 *blue;
+ int max_palette = 0;
+ int i;
+ switch (origin->bitsPerSample)
+ {
+ case 1:
+ max_palette = 2;
+ break;
+ case 2:
+ max_palette = 4;
+ break;
+ case 3:
+ max_palette = 8;
+ break;
+ case 4:
+ max_palette = 16;
+ break;
+ case 5:
+ max_palette = 32;
+ break;
+ case 6:
+ max_palette = 64;
+ break;
+ case 7:
+ max_palette = 128;
+ break;
+ case 8:
+ max_palette = 256;
+ break;
+ };
+ if (origin->forced_conversion == RL2_CONVERT_GRAYSCALE_TO_PALETTE)
+ {
+ /* forced conversion: creating a GRAYSCALE palette */
+ max_palette = 256;
+ for (i = 0; i < max_palette; i++)
+ {
+ red[i] = i;
+ green[i] = i;
+ blue[i] = i;
+ }
+ }
+ if (max_palette == 0)
+ goto error;
+ if (!alloc_palette (origin, max_palette))
+ goto error;
+ if (TIFFGetField (origin->in, TIFFTAG_COLORMAP, &red, &green, &blue)
+ == 0)
+ goto error;
+ for (i = 0; i < max_palette; i++)
+ {
+ if (red[i] < 256)
+ origin->red[i] = red[i];
+ else
+ origin->red[i] = red[i] / 256;
+ if (green[i] < 256)
+ origin->green[i] = green[i];
+ else
+ origin->green[i] = green[i] / 256;
+ if (blue[i] < 256)
+ origin->blue[i] = blue[i];
+ else
+ origin->blue[i] = blue[i] / 256;
+ }
+ if ((origin->forced_sample_type == RL2_SAMPLE_1_BIT
+ || origin->forced_sample_type == RL2_SAMPLE_2_BIT
+ || origin->forced_sample_type == RL2_SAMPLE_4_BIT)
+ && origin->forced_pixel_type == RL2_PIXEL_PALETTE)
+ {
+ int max = 0;
+ unsigned char plt[256];
+ int j;
+ unsigned char *p;
+ unsigned short x;
+ unsigned short y;
+ unsigned short row;
+ unsigned short height = 256;
+ if (origin->isTiled)
+ height = origin->tileHeight;
+ for (row = 0; row < origin->height; row += height)
+ {
+ unsigned char *pixels = NULL;
+ int pixels_sz = 0;
+ rl2PalettePtr pltx = rl2_create_palette (max_palette);
+ for (j = 0; j < max_palette; j++)
+ rl2_set_palette_color (pltx, j, origin->red[j],
+ origin->green[j],
+ origin->blue[j]);
+ if (read_from_tiff
+ (origin, origin->width, height, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_PALETTE, 1, row, 0, &pixels, &pixels_sz,
+ pltx) != RL2_OK)
+ goto error;
+ rl2_destroy_palette (pltx);
+ p = pixels;
+ for (y = 0; y < height; y++)
+ {
+ if ((y + row) >= origin->height)
+ break;
+ for (x = 0; x < origin->width; x++)
+ {
+ int ok = 0;
+ int index = *p++;
+ for (j = 0; j < max; j++)
+ {
+ if (plt[j] == index)
+ {
+ ok = 1;
+ break;
+ }
+ }
+ if (!ok)
+ plt[max++] = index;
+ }
+ }
+ free (pixels);
+ }
+ if (origin->red != NULL)
+ free (origin->red);
+ if (origin->green != NULL)
+ free (origin->green);
+ if (origin->blue != NULL)
+ free (origin->blue);
+ if (!alloc_palette (origin, max))
+ goto error;
+ for (j = 0; j < max; j++)
+ {
+ /* normalized palette */
+ if (red[plt[j]] < 256)
+ origin->red[j] = red[plt[j]];
+ else
+ origin->red[j] = red[plt[j]] / 256;
+ if (green[plt[j]] < 256)
+ origin->green[j] = green[plt[j]];
+ else
+ origin->green[j] = green[plt[j]] / 256;
+ if (blue[plt[j]] < 256)
+ origin->blue[j] = blue[plt[j]];
+ else
+ origin->blue[j] = blue[plt[j]] / 256;
+ }
+ }
+ }
+ if (!check_tiff_origin_pixel_conversion (origin))
+ goto error;
+
+ if (origin->forced_conversion == RL2_CONVERT_GRAYSCALE_TO_PALETTE)
+ {
+ /* forced conversion: creating a GRAYSCALE palette */
+ int i;
+ if (!alloc_palette (origin, 256))
+ goto error;
+ for (i = 0; i < 256; i++)
+ {
+ origin->red[i] = i;
+ origin->green[i] = i;
+ origin->blue[i] = i;
+ }
+ }
+ if (origin->forced_conversion == RL2_CONVERT_MONOCHROME_TO_PALETTE)
+ {
+ /* forced conversion: creating a BILEVEL palette */
+ if (!alloc_palette (origin, 2))
+ goto error;
+ origin->red[0] = 255;
+ origin->green[0] = 255;
+ origin->blue[0] = 255;
+ origin->red[1] = 0;
+ origin->green[1] = 0;
+ origin->blue[1] = 0;
+ }
+
+ return 1;
+ error:
+ return 0;
+}
+
+RL2_DECLARE rl2TiffOriginPtr
+rl2_create_tiff_origin (const char *path, int georef_priority, int srid,
+ unsigned char force_sample_type,
+ unsigned char force_pixel_type,
+ unsigned char force_num_bands)
+{
+/* attempting to create a file-based TIFF / GeoTIFF origin */
+ rl2PrivTiffOriginPtr origin = NULL;
+
+ if (georef_priority == RL2_TIFF_NO_GEOREF
+ || georef_priority == RL2_TIFF_GEOTIFF
+ || georef_priority == RL2_TIFF_WORLDFILE)
+ ;
+ else
+ return NULL;
+ origin =
+ create_tiff_origin (path, force_sample_type, force_pixel_type,
+ force_num_bands);
+ if (origin == NULL)
+ return NULL;
+ if (georef_priority == RL2_TIFF_GEOTIFF)
+ {
+ /* attempting first to retrieve GeoTIFF georeferencing */
+ geo_tiff_origin (path, origin, srid);
+ if (origin->isGeoReferenced == 0)
+ {
+ /* then attempting to retrieve WorldFile georeferencing */
+ worldfile_tiff_origin (path, origin, srid);
+ }
+ }
+ else if (georef_priority == RL2_TIFF_WORLDFILE)
+ {
+ /* attempting first to retrieve Worldfile georeferencing */
+ worldfile_tiff_origin (path, origin, srid);
+ if (origin->isGeoReferenced == 0)
+ {
+ /* then attempting to retrieve GeoTIFF georeferencing */
+ geo_tiff_origin (path, origin, srid);
+ }
+ }
+ if (!init_tiff_origin (path, origin))
+ goto error;
+
+ return (rl2TiffOriginPtr) origin;
+ error:
+ if (origin != NULL)
+ rl2_destroy_tiff_origin ((rl2TiffOriginPtr) origin);
+ return NULL;
+}
+
+RL2_DECLARE rl2TiffOriginPtr
+rl2_create_geotiff_origin (const char *path, int force_srid,
+ unsigned char force_sample_type,
+ unsigned char force_pixel_type,
+ unsigned char force_num_bands)
+{
+/* attempting to create a file-based GeoTIFF origin */
+ rl2PrivTiffOriginPtr origin = NULL;
+
+ origin =
+ create_tiff_origin (path, force_sample_type, force_pixel_type,
+ force_num_bands);
+ if (origin == NULL)
+ return NULL;
+
+ /* attempting to retrieve GeoTIFF georeferencing */
+ geo_tiff_origin (path, origin, force_srid);
+ if (origin->isGeoReferenced == 0)
+ goto error;
+ if (!init_tiff_origin (path, origin))
+ goto error;
+
+ return (rl2TiffOriginPtr) origin;
+ error:
+ if (origin != NULL)
+ rl2_destroy_tiff_origin ((rl2TiffOriginPtr) origin);
+ return NULL;
+}
+
+RL2_DECLARE rl2TiffOriginPtr
+rl2_create_tiff_worldfile_origin (const char *path, int srid,
+ unsigned char force_sample_type,
+ unsigned char force_pixel_type,
+ unsigned char force_num_bands)
+{
+/* attempting to create a file-based TIFF+TFW origin */
+ rl2PrivTiffOriginPtr origin = NULL;
+
+ origin =
+ create_tiff_origin (path, force_sample_type, force_pixel_type,
+ force_num_bands);
+ if (origin == NULL)
+ return NULL;
+
+/* attempting to retrieve Worldfile georeferencing */
+ worldfile_tiff_origin (path, origin, srid);
+ if (origin->isGeoReferenced == 0)
+ goto error;
+ if (!init_tiff_origin (path, origin))
+ goto error;
+
+ return (rl2TiffOriginPtr) origin;
+ error:
+ if (origin != NULL)
+ rl2_destroy_tiff_origin ((rl2TiffOriginPtr) origin);
+ return NULL;
+}
+
+RL2_DECLARE int
+rl2_set_tiff_origin_not_referenced (rl2TiffOriginPtr tiff)
+{
+/* setting up a false GeoReferncing */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+ origin->hResolution = 1.0;
+ origin->vResolution = 1.0;
+ origin->minX = 0.0;
+ origin->minY = 0.0;
+ origin->maxX = origin->width - 1;
+ origin->maxY = origin->height - 1;
+ origin->Srid = -1;
+ origin->isGeoReferenced = 1;
+ origin->isGeoTiff = 0;
+ return RL2_OK;
+}
+
+RL2_DECLARE const char *
+rl2_get_tiff_origin_path (rl2TiffOriginPtr tiff)
+{
+/* retrieving the input path from a TIFF origin */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return NULL;
+
+ return origin->path;
+}
+
+RL2_DECLARE const char *
+rl2_get_tiff_origin_worldfile_path (rl2TiffOriginPtr tiff)
+{
+/* retrieving the Worldfile path from a TIFF origin */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return NULL;
+
+ return origin->tfw_path;
+}
+
+RL2_DECLARE int
+rl2_is_geotiff_origin (rl2TiffOriginPtr tiff, int *geotiff)
+{
+/* detecting if a TIFF origin actually is a GeoTIFF */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+ *geotiff = origin->isGeoTiff;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_tiff_worldfile_origin (rl2TiffOriginPtr tiff, int *tiff_worldfile)
+{
+/* detecting if a TIFF origin actually supports a TFW */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+ *tiff_worldfile = 0;
+ if (origin->tfw_path != NULL)
+ *tiff_worldfile = 1;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_origin_size (rl2TiffOriginPtr tiff, unsigned int *width,
+ unsigned int *height)
+{
+/* retrieving Width and Height from a TIFF origin */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+
+ *width = origin->width;
+ *height = origin->height;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_origin_srid (rl2TiffOriginPtr tiff, int *srid)
+{
+/* retrieving the SRID from a TIFF origin */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+ if (origin->isGeoReferenced == 0)
+ return RL2_ERROR;
+
+ *srid = origin->Srid;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_origin_extent (rl2TiffOriginPtr tiff, double *minX, double *minY,
+ double *maxX, double *maxY)
+{
+/* retrieving the Extent from a TIFF origin */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+ if (origin->isGeoReferenced == 0)
+ return RL2_ERROR;
+
+ *minX = origin->minX;
+ *minY = origin->minY;
+ *maxX = origin->maxX;
+ *maxY = origin->maxY;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_origin_resolution (rl2TiffOriginPtr tiff, double *hResolution,
+ double *vResolution)
+{
+/* retrieving the Pixel Resolution from a TIFF origin */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+ if (origin->isGeoReferenced == 0)
+ return RL2_ERROR;
+
+ *hResolution = origin->hResolution;
+ *vResolution = origin->vResolution;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_origin_type (rl2TiffOriginPtr tiff, unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *alias_pixel_type,
+ unsigned char *num_bands)
+{
+/* retrieving the sample/pixel type from a TIFF origin */
+ int ok = 0;
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB)
+ {
+ /* could be some kind of MONOCHROME */
+ if (origin->bitsPerSample == 1)
+ {
+ *sample_type = RL2_SAMPLE_1_BIT;
+ ok = 1;
+ }
+ if (ok)
+ {
+ *pixel_type = RL2_PIXEL_MONOCHROME;
+ *alias_pixel_type = RL2_PIXEL_MONOCHROME;
+ *num_bands = 1;
+ return RL2_OK;
+ }
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric < PHOTOMETRIC_RGB)
+ {
+ /* could be some kind of GRAYSCALE */
+ if (origin->bitsPerSample == 2)
+ {
+ *sample_type = RL2_SAMPLE_2_BIT;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 4)
+ {
+ *sample_type = RL2_SAMPLE_4_BIT;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 8)
+ {
+ *sample_type = RL2_SAMPLE_UINT8;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 16)
+ {
+ *sample_type = RL2_SAMPLE_UINT16;
+ ok = 1;
+ }
+ if (ok)
+ {
+ *pixel_type = RL2_PIXEL_GRAYSCALE;
+ *alias_pixel_type = RL2_PIXEL_GRAYSCALE;
+ if (origin->bitsPerSample == 8 || origin->bitsPerSample == 16)
+ *alias_pixel_type = RL2_PIXEL_DATAGRID;
+ *num_bands = 1;
+ return RL2_OK;
+ }
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 1
+ && origin->photometric == PHOTOMETRIC_PALETTE)
+ {
+ /* could be some kind of PALETTE */
+ if (origin->bitsPerSample == 1)
+ {
+ *sample_type = RL2_SAMPLE_1_BIT;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 2)
+ {
+ *sample_type = RL2_SAMPLE_2_BIT;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 4)
+ {
+ *sample_type = RL2_SAMPLE_4_BIT;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 8)
+ {
+ *sample_type = RL2_SAMPLE_UINT8;
+ ok = 1;
+ }
+ if (ok)
+ {
+ *pixel_type = RL2_PIXEL_PALETTE;
+ *alias_pixel_type = RL2_PIXEL_PALETTE;
+ *num_bands = 1;
+ return RL2_OK;
+ }
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT
+ && origin->samplesPerPixel == 3
+ && origin->photometric == PHOTOMETRIC_RGB)
+ {
+ /* could be some kind of RGB */
+ if (origin->bitsPerSample == 8)
+ {
+ *sample_type = RL2_SAMPLE_UINT8;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 16)
+ {
+ *sample_type = RL2_SAMPLE_UINT16;
+ ok = 1;
+ }
+ if (ok)
+ {
+ *pixel_type = RL2_PIXEL_RGB;
+ *alias_pixel_type = RL2_PIXEL_RGB;
+ *num_bands = 3;
+ return RL2_OK;
+ }
+ }
+ if (origin->samplesPerPixel == 1 && origin->photometric < PHOTOMETRIC_RGB)
+ {
+ /* could be some kind of DATA-GRID */
+ if (origin->sampleFormat == SAMPLEFORMAT_INT)
+ {
+ /* Signed Integer */
+ if (origin->bitsPerSample == 8)
+ {
+ *sample_type = RL2_SAMPLE_INT8;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 16)
+ {
+ *sample_type = RL2_SAMPLE_INT16;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 32)
+ {
+ *sample_type = RL2_SAMPLE_INT32;
+ ok = 1;
+ }
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_UINT)
+ {
+ /* Unsigned Integer */
+ if (origin->bitsPerSample == 8)
+ {
+ *sample_type = RL2_SAMPLE_UINT8;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 16)
+ {
+ *sample_type = RL2_SAMPLE_UINT16;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 32)
+ {
+ *sample_type = RL2_SAMPLE_UINT32;
+ ok = 1;
+ }
+ }
+ if (origin->sampleFormat == SAMPLEFORMAT_IEEEFP)
+ {
+ /* Floating-Point */
+ if (origin->bitsPerSample == 32)
+ {
+ *sample_type = RL2_SAMPLE_FLOAT;
+ ok = 1;
+ }
+ else if (origin->bitsPerSample == 64)
+ {
+ *sample_type = RL2_SAMPLE_DOUBLE;
+ ok = 1;
+ }
+ }
+ if (ok)
+ {
+ *pixel_type = RL2_PIXEL_DATAGRID;
+ *alias_pixel_type = RL2_PIXEL_DATAGRID;
+ *num_bands = 1;
+ return RL2_OK;
+ }
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_origin_forced_type (rl2TiffOriginPtr tiff,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *num_bands)
+{
+/* retrieving the sample/pixel type (FORCED) from a TIFF origin */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+
+ *sample_type = origin->forced_sample_type;
+ *pixel_type = origin->forced_pixel_type;
+ *num_bands = origin->forced_num_bands;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_origin_compression (rl2TiffOriginPtr tiff,
+ unsigned char *compression)
+{
+/* retrieving the sample/pixel type from a TIFF origin */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+
+ switch (origin->compression)
+ {
+ case COMPRESSION_NONE:
+ *compression = RL2_COMPRESSION_NONE;
+ break;
+ case COMPRESSION_LZW:
+ *compression = RL2_COMPRESSION_LZW;
+ break;
+ case COMPRESSION_DEFLATE:
+ *compression = RL2_COMPRESSION_DEFLATE;
+ break;
+ case COMPRESSION_LZMA:
+ *compression = RL2_COMPRESSION_LZMA;
+ break;
+ case COMPRESSION_JPEG:
+ *compression = RL2_COMPRESSION_JPEG;
+ break;
+ case COMPRESSION_CCITTFAX3:
+ *compression = RL2_COMPRESSION_CCITTFAX3;
+ break;
+ case COMPRESSION_CCITTFAX4:
+ *compression = RL2_COMPRESSION_CCITTFAX4;
+ break;
+ default:
+ *compression = RL2_COMPRESSION_UNKNOWN;
+ break;
+ }
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_eval_tiff_origin_compatibility (rl2CoveragePtr cvg, rl2TiffOriginPtr tiff,
+ int force_srid)
+{
+/* testing if a Coverage and a TIFF origin are mutually compatible */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int srid;
+ double hResolution;
+ double vResolution;
+ double confidence;
+ rl2PrivCoveragePtr coverage = (rl2PrivCoveragePtr) cvg;
+
+ if (coverage == NULL || tiff == NULL)
+ return RL2_ERROR;
+ if (rl2_get_tiff_origin_forced_type
+ (tiff, &sample_type, &pixel_type, &num_bands) != RL2_OK)
+ return RL2_ERROR;
+
+/* aliasing GRAYSCALE and DATAGRID for UINT8 */
+ if (coverage->sampleType == RL2_SAMPLE_UINT8
+ && coverage->pixelType == RL2_PIXEL_DATAGRID
+ && pixel_type == RL2_PIXEL_GRAYSCALE)
+ pixel_type = RL2_PIXEL_DATAGRID;
+/* aliasing GRAYSCALE and DATAGRID for UINT16 */
+ if (coverage->sampleType == RL2_SAMPLE_UINT16
+ && coverage->pixelType == RL2_PIXEL_DATAGRID
+ && pixel_type == RL2_PIXEL_GRAYSCALE)
+ pixel_type = RL2_PIXEL_DATAGRID;
+
+ if (coverage->sampleType != sample_type)
+ return RL2_FALSE;
+ if (coverage->pixelType != pixel_type)
+ return RL2_FALSE;
+ if (coverage->nBands != num_bands)
+ return RL2_FALSE;
+
+ if (coverage->Srid == RL2_GEOREFERENCING_NONE)
+ return RL2_TRUE;
+
+/* checking for resolution compatibility */
+ if (rl2_get_tiff_origin_srid (tiff, &srid) != RL2_OK)
+ return RL2_FALSE;
+ if (coverage->Srid != srid)
+ {
+ if (force_srid > 0)
+ {
+ if (coverage->Srid != force_srid)
+ return RL2_FALSE;
+ }
+ else
+ return RL2_FALSE;
+ }
+ if (rl2_get_tiff_origin_resolution (tiff, &hResolution, &vResolution) !=
+ RL2_OK)
+ return RL2_FALSE;
+ confidence = coverage->hResolution / 100.0;
+ if (hResolution < (coverage->hResolution - confidence)
+ || hResolution > (coverage->hResolution + confidence))
+ return RL2_FALSE;
+ confidence = coverage->vResolution / 100.0;
+ if (vResolution < (coverage->vResolution - confidence)
+ || vResolution > (coverage->vResolution + confidence))
+ return RL2_FALSE;
+ return RL2_TRUE;
+}
+
+RL2_PRIVATE char
+truncate_8 (double val)
+{
+/* truncating to signed 8 bit integer */
+ if (val <= INT8_MIN)
+ return INT8_MIN;
+ if (val >= INT8_MAX)
+ return INT8_MAX;
+ return (char) val;
+}
+
+RL2_PRIVATE unsigned char
+truncate_u8 (double val)
+{
+/* truncating to unsigned 8 bit integer */
+ if (val <= 0.0)
+ return 0;
+ if (val >= UINT8_MAX)
+ return UINT8_MAX;
+ return (unsigned char) val;
+}
+
+RL2_PRIVATE short
+truncate_16 (double val)
+{
+/* truncating to signed 16 bit integer */
+ if (val <= INT16_MIN)
+ return INT16_MIN;
+ if (val >= INT16_MAX)
+ return INT16_MAX;
+ return (short) val;
+}
+
+RL2_PRIVATE unsigned short
+truncate_u16 (double val)
+{
+/* truncating to unsigned 16 bit integer */
+ if (val <= 0.0)
+ return 0;
+ if (val >= UINT16_MAX)
+ return UINT16_MAX;
+ return (unsigned short) val;
+}
+
+RL2_PRIVATE int
+truncate_32 (double val)
+{
+/* truncating to signed 32 bit integer */
+ if (val <= INT32_MIN)
+ return INT32_MIN;
+ if (val >= INT32_MAX)
+ return INT32_MAX;
+ return (int) val;
+}
+
+RL2_PRIVATE unsigned int
+truncate_u32 (double val)
+{
+/* truncating to unsigned 32 bit integer */
+ if (val <= 0.0)
+ return 0;
+ if (val >= UINT32_MAX)
+ return UINT32_MAX;
+ return (unsigned int) val;
+}
+
+static void
+copy_convert_tile (rl2PrivTiffOriginPtr origin, void *in, void *out,
+ unsigned int startRow, unsigned int startCol,
+ unsigned short width, unsigned short height, uint32 tile_y,
+ uint32 tile_x, unsigned char convert)
+{
+/* copying pixels by applying a format conversion */
+ char *p_in_8;
+ char *p_out_8;
+ unsigned char *p_in_u8;
+ unsigned char *p_out_u8;
+ short *p_in_16;
+ short *p_out_16;
+ unsigned short *p_in_u16;
+ unsigned short *p_out_u16;
+ int *p_in_32;
+ int *p_out_32;
+ unsigned int *p_in_u32;
+ unsigned int *p_out_u32;
+ float *p_in_flt;
+ float *p_out_flt;
+ double *p_in_dbl;
+ double *p_out_dbl;
+ uint32 x;
+ uint32 y;
+ unsigned int dest_x;
+ unsigned int dest_y;
+
+ for (y = 0; y < origin->tileHeight; y++)
+ {
+ dest_y = tile_y + y;
+ if (dest_y < startRow || dest_y >= (startRow + height))
+ continue;
+
+ switch (convert)
+ {
+ case RL2_CONVERT_GRID_INT8_TO_UINT8:
+ case RL2_CONVERT_GRID_INT8_TO_INT16:
+ case RL2_CONVERT_GRID_INT8_TO_UINT16:
+ case RL2_CONVERT_GRID_INT8_TO_INT32:
+ case RL2_CONVERT_GRID_INT8_TO_UINT32:
+ case RL2_CONVERT_GRID_INT8_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT8_TO_DOUBLE:
+ p_in_8 = (char *) in;
+ p_in_8 += y * origin->tileWidth;
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_INT8:
+ case RL2_CONVERT_GRID_UINT8_TO_UINT16:
+ case RL2_CONVERT_GRID_UINT8_TO_INT16:
+ case RL2_CONVERT_GRID_UINT8_TO_UINT32:
+ case RL2_CONVERT_GRID_UINT8_TO_INT32:
+ case RL2_CONVERT_GRID_UINT8_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT8_TO_DOUBLE:
+ p_in_u8 = (unsigned char *) in;
+ p_in_u8 += y * origin->tileWidth;
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_INT8:
+ case RL2_CONVERT_GRID_INT16_TO_UINT8:
+ case RL2_CONVERT_GRID_INT16_TO_UINT16:
+ case RL2_CONVERT_GRID_INT16_TO_INT32:
+ case RL2_CONVERT_GRID_INT16_TO_UINT32:
+ case RL2_CONVERT_GRID_INT16_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT16_TO_DOUBLE:
+ p_in_16 = (short *) in;
+ p_in_16 += y * origin->tileWidth;
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_INT8:
+ case RL2_CONVERT_GRID_UINT16_TO_UINT8:
+ case RL2_CONVERT_GRID_UINT16_TO_INT16:
+ case RL2_CONVERT_GRID_UINT16_TO_UINT32:
+ case RL2_CONVERT_GRID_UINT16_TO_INT32:
+ case RL2_CONVERT_GRID_UINT16_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT16_TO_DOUBLE:
+ p_in_u16 = (unsigned short *) in;
+ p_in_u16 += y * origin->tileWidth;
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_INT8:
+ case RL2_CONVERT_GRID_INT32_TO_UINT8:
+ case RL2_CONVERT_GRID_INT32_TO_INT16:
+ case RL2_CONVERT_GRID_INT32_TO_UINT16:
+ case RL2_CONVERT_GRID_INT32_TO_UINT32:
+ case RL2_CONVERT_GRID_INT32_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT32_TO_DOUBLE:
+ p_in_32 = (int *) in;
+ p_in_32 += y * origin->tileWidth;
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_INT8:
+ case RL2_CONVERT_GRID_UINT32_TO_UINT8:
+ case RL2_CONVERT_GRID_UINT32_TO_INT16:
+ case RL2_CONVERT_GRID_UINT32_TO_UINT16:
+ case RL2_CONVERT_GRID_UINT32_TO_INT32:
+ case RL2_CONVERT_GRID_UINT32_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT32_TO_DOUBLE:
+ p_in_u32 = (unsigned int *) in;
+ p_in_u32 += y * origin->tileWidth;
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_INT8:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT8:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT16:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT16:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT32:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT32:
+ case RL2_CONVERT_GRID_FLOAT_TO_DOUBLE:
+ p_in_flt = (float *) in;
+ p_in_flt += y * origin->tileWidth;
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT8:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT8:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT16:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT16:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT32:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT32:
+ case RL2_CONVERT_GRID_DOUBLE_TO_FLOAT:
+ p_in_dbl = (double *) in;
+ p_in_dbl += y * origin->tileWidth;
+ break;
+ };
+
+ for (x = 0; x < origin->tileWidth; x++)
+ {
+ dest_x = tile_x + x;
+ if (dest_x < startCol || dest_x >= (startCol + width))
+ continue;
+
+ switch (convert)
+ {
+ case RL2_CONVERT_GRID_UINT8_TO_INT8:
+ case RL2_CONVERT_GRID_INT16_TO_INT8:
+ case RL2_CONVERT_GRID_UINT16_TO_INT8:
+ case RL2_CONVERT_GRID_INT32_TO_INT8:
+ case RL2_CONVERT_GRID_UINT32_TO_INT8:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT8:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT8:
+ p_out_8 = (char *) out;
+ p_out_8 +=
+ ((dest_y - startRow) * width) + (dest_x - startCol);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_UINT8:
+ case RL2_CONVERT_GRID_INT16_TO_UINT8:
+ case RL2_CONVERT_GRID_UINT16_TO_UINT8:
+ case RL2_CONVERT_GRID_INT32_TO_UINT8:
+ case RL2_CONVERT_GRID_UINT32_TO_UINT8:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT8:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT8:
+ p_out_u8 = (unsigned char *) out;
+ p_out_u8 +=
+ ((dest_y - startRow) * width) + (dest_x - startCol);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_INT16:
+ case RL2_CONVERT_GRID_UINT8_TO_INT16:
+ case RL2_CONVERT_GRID_UINT16_TO_INT16:
+ case RL2_CONVERT_GRID_INT32_TO_INT16:
+ case RL2_CONVERT_GRID_UINT32_TO_INT16:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT16:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT16:
+ p_out_16 = (short *) out;
+ p_out_16 +=
+ ((dest_y - startRow) * width) + (dest_x - startCol);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_UINT16:
+ case RL2_CONVERT_GRID_UINT8_TO_UINT16:
+ case RL2_CONVERT_GRID_INT16_TO_UINT16:
+ case RL2_CONVERT_GRID_INT32_TO_UINT16:
+ case RL2_CONVERT_GRID_UINT32_TO_UINT16:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT16:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT16:
+ p_out_u16 = (unsigned short *) out;
+ p_out_u16 +=
+ ((dest_y - startRow) * width) + (dest_x - startCol);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_INT32:
+ case RL2_CONVERT_GRID_UINT8_TO_INT32:
+ case RL2_CONVERT_GRID_INT16_TO_INT32:
+ case RL2_CONVERT_GRID_UINT16_TO_INT32:
+ case RL2_CONVERT_GRID_UINT32_TO_INT32:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT32:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT32:
+ p_out_32 = (int *) out;
+ p_out_32 +=
+ ((dest_y - startRow) * width) + (dest_x - startCol);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_UINT32:
+ case RL2_CONVERT_GRID_UINT8_TO_UINT32:
+ case RL2_CONVERT_GRID_INT16_TO_UINT32:
+ case RL2_CONVERT_GRID_UINT16_TO_UINT32:
+ case RL2_CONVERT_GRID_INT32_TO_UINT32:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT32:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT32:
+ p_out_u32 = (unsigned int *) out;
+ p_out_u32 +=
+ ((dest_y - startRow) * width) + (dest_x - startCol);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT8_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT16_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT16_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT32_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT32_TO_FLOAT:
+ case RL2_CONVERT_GRID_DOUBLE_TO_FLOAT:
+ p_out_flt = (float *) out;
+ p_out_flt +=
+ ((dest_y - startRow) * width) + (dest_x - startCol);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_DOUBLE:
+ case RL2_CONVERT_GRID_UINT8_TO_DOUBLE:
+ case RL2_CONVERT_GRID_INT16_TO_DOUBLE:
+ case RL2_CONVERT_GRID_UINT16_TO_DOUBLE:
+ case RL2_CONVERT_GRID_INT32_TO_DOUBLE:
+ case RL2_CONVERT_GRID_UINT32_TO_DOUBLE:
+ case RL2_CONVERT_GRID_FLOAT_TO_DOUBLE:
+ p_out_dbl = (double *) out;
+ p_out_dbl +=
+ ((dest_y - startRow) * width) + (dest_x - startCol);
+ break;
+ };
+
+ switch (convert)
+ {
+ case RL2_CONVERT_GRID_INT8_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_8++);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_INT16:
+ *p_out_16++ = *p_in_8++;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_8++);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_INT32:
+ *p_out_32++ = *p_in_8++;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_UINT32:
+ *p_out_u32++ = truncate_u32 (*p_in_8++);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_FLOAT:
+ *p_out_flt++ = *p_in_8++;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_8++;
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_u8++);
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_u8++);
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_UINT16:
+ *p_out_u16++ = *p_in_u8++;
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_UINT32:
+ *p_out_u32++ = *p_in_u8++;
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_INT32:
+ *p_out_32++ = truncate_32 (*p_in_u8++);
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_FLOAT:
+ *p_out_flt++ = *p_in_u8++;
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_u8++;
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_16++);
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_16++);
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_16++);
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_INT32:
+ *p_out_32++ = *p_in_16++;
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_UINT32:
+ *p_out_u32++ = truncate_u32 (*p_in_16++);
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_FLOAT:
+ *p_out_flt++ = *p_in_16++;
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_16++;
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_u16++);
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_u16++);
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_u16++);
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_UINT32:
+ *p_out_u32++ = *p_in_u16++;
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_INT32:
+ *p_out_32++ = truncate_32 (*p_in_u16++);
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_FLOAT:
+ *p_out_flt++ = *p_in_u16++;
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_u16++;
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_32++);
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_32++);
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_32++);
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_32++);
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_UINT32:
+ *p_out_u32++ = truncate_u32 (*p_in_32++);
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_FLOAT:
+ *p_out_flt++ = *p_in_32++;
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_32++;
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_u32++);
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_u32++);
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_u32++);
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_u32++);
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_INT32:
+ *p_out_32++ = truncate_32 (*p_in_u32++);
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_FLOAT:
+ *p_out_flt++ = *p_in_u32++;
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_u32++;
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_INT32:
+ *p_out_32++ = truncate_32 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT32:
+ *p_out_u32++ = truncate_u32 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_flt++;
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT32:
+ *p_out_32++ = truncate_32 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT32:
+ *p_out_u32++ = truncate_u32 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_FLOAT:
+ *p_out_flt++ = *p_in_dbl++;
+ break;
+ };
+ }
+ }
+}
+
+static int
+read_raw_tiles (rl2PrivTiffOriginPtr origin, unsigned short width,
+ unsigned short height, unsigned char sample_type,
+ unsigned char num_bands, unsigned int startRow,
+ unsigned int startCol, unsigned char *pixels)
+{
+/* reading TIFF raw tiles */
+ uint32 tile_x;
+ uint32 tile_y;
+ uint32 x;
+ uint32 y;
+ uint32 *tiff_tile = NULL;
+ char *p_in_8;
+ char *p_out_8;
+ unsigned char *p_in_u8;
+ unsigned char *p_out_u8;
+ short *p_in_16;
+ short *p_out_16;
+ unsigned short *p_in_u16;
+ unsigned short *p_out_u16;
+ int *p_in_32;
+ int *p_out_32;
+ unsigned int *p_in_u32;
+ unsigned int *p_out_u32;
+ float *p_in_flt;
+ float *p_out_flt;
+ double *p_in_dbl;
+ double *p_out_dbl;
+ unsigned int dest_x;
+ unsigned int dest_y;
+ int skip;
+ unsigned char bnd;
+ unsigned char convert = origin->forced_conversion;
+
+ tiff_tile = malloc (TIFFTileSize (origin->in));
+ if (tiff_tile == NULL)
+ goto error;
+
+ for (tile_y = 0; tile_y < origin->height; tile_y += origin->tileHeight)
+ {
+ /* scanning tiles by row */
+ unsigned int tiff_min_y = tile_y;
+ unsigned int tiff_max_y = tile_y + origin->tileHeight - 1;
+ skip = 0;
+ if (tiff_min_y > (startRow + height))
+ skip = 1;
+ if (tiff_max_y < startRow)
+ skip = 1;
+ if (skip)
+ {
+ /* skipping any not required tile */
+ continue;
+ }
+ for (tile_x = 0; tile_x < origin->width; tile_x += origin->tileWidth)
+ {
+ /* reading a TIFF tile */
+ unsigned int tiff_min_x = tile_x;
+ unsigned int tiff_max_x = tile_x + origin->tileWidth - 1;
+ skip = 0;
+ if (tiff_min_x > (startCol + width))
+ skip = 1;
+ if (tiff_max_x < startCol)
+ skip = 1;
+ if (skip)
+ {
+ /* skipping any not required tile */
+ continue;
+ }
+ if (TIFFReadTile (origin->in, tiff_tile, tile_x, tile_y, 0, 0) <
+ 0)
+ goto error;
+ if (convert != RL2_CONVERT_NO)
+ {
+ /* applying some format conversion */
+ copy_convert_tile (origin, tiff_tile, pixels, startRow,
+ startCol, width, height, tile_y,
+ tile_x, convert);
+ continue;
+ }
+ for (y = 0; y < origin->tileHeight; y++)
+ {
+ dest_y = tile_y + y;
+ if (dest_y < startRow || dest_y >= (startRow + height))
+ continue;
+ for (x = 0; x < origin->tileWidth; x++)
+ {
+ dest_x = tile_x + x;
+ if (dest_x < startCol
+ || dest_x >= (startCol + width))
+ continue;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ p_in_8 = (char *) tiff_tile;
+ p_in_8 += y * origin->tileWidth;
+ p_in_8 += x;
+ p_out_8 = (char *) pixels;
+ p_out_8 +=
+ ((dest_y - startRow) * width) + (dest_x -
+ startCol);
+ break;
+ case RL2_SAMPLE_UINT8:
+ p_in_u8 = (unsigned char *) tiff_tile;
+ p_in_u8 += y * origin->tileWidth * num_bands;
+ p_in_u8 += x * num_bands;
+ p_out_u8 = (unsigned char *) pixels;
+ p_out_u8 +=
+ ((dest_y -
+ startRow) * width * num_bands) +
+ ((dest_x - startCol) * num_bands);
+ break;
+ case RL2_SAMPLE_INT16:
+ p_in_16 = (short *) tiff_tile;
+ p_in_16 += y * origin->tileWidth;
+ p_in_16 += x;
+ p_out_16 = (short *) pixels;
+ p_out_16 +=
+ ((dest_y - startRow) * width) + (dest_x -
+ startCol);
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_in_u16 = (unsigned short *) tiff_tile;
+ p_in_u16 += y * origin->tileWidth * num_bands;
+ p_in_u16 += x * num_bands;
+ p_out_u16 = (unsigned short *) pixels;
+ p_out_u16 +=
+ ((dest_y -
+ startRow) * width * num_bands) +
+ ((dest_x - startCol) * num_bands);
+ break;
+ case RL2_SAMPLE_INT32:
+ p_in_32 = (int *) tiff_tile;
+ p_in_32 += y * origin->tileWidth;
+ p_in_32 += x;
+ p_out_32 = (int *) pixels;
+ p_out_32 +=
+ ((dest_y - startRow) * width) + (dest_x -
+ startCol);
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_in_u32 = (unsigned int *) tiff_tile;
+ p_in_u32 += y * origin->tileWidth;
+ p_in_u32 += x;
+ p_out_u32 = (unsigned int *) pixels;
+ p_out_u32 +=
+ ((dest_y - startRow) * width) + (dest_x -
+ startCol);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_in_flt = (float *) tiff_tile;
+ p_in_flt += y * origin->tileWidth;
+ p_in_flt += x;
+ p_out_flt = (float *) pixels;
+ p_out_flt +=
+ ((dest_y - startRow) * width) + (dest_x -
+ startCol);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_in_dbl = (double *) tiff_tile;
+ p_in_dbl += y * origin->tileWidth;
+ p_in_dbl += x;
+ p_out_dbl = (double *) pixels;
+ p_out_dbl +=
+ ((dest_y - startRow) * width) + (dest_x -
+ startCol);
+ break;
+ };
+ for (bnd = 0; bnd < num_bands; bnd++)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ *p_out_8 = *p_in_8++;
+ break;
+ case RL2_SAMPLE_UINT8:
+ *p_out_u8 = *p_in_u8++;
+ break;
+ case RL2_SAMPLE_INT16:
+ *p_out_16 = *p_in_16++;
+ break;
+ case RL2_SAMPLE_UINT16:
+ *p_out_u16 = *p_in_u16++;
+ break;
+ case RL2_SAMPLE_INT32:
+ *p_out_32 = *p_in_32++;
+ break;
+ case RL2_SAMPLE_UINT32:
+ *p_out_u32 = *p_in_u32++;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ *p_out_flt = *p_in_flt++;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ *p_out_dbl = *p_in_dbl++;
+ break;
+ };
+ }
+ }
+ }
+ }
+ }
+
+ free (tiff_tile);
+ return RL2_OK;
+ error:
+ if (tiff_tile != NULL)
+ free (tiff_tile);
+ return RL2_ERROR;
+}
+
+static void
+copy_convert_scanline (rl2PrivTiffOriginPtr origin, void *in, void *out,
+ unsigned int lineNo, unsigned int startCol,
+ unsigned int width, unsigned char convert)
+{
+/* copying pixels by applying a format conversion */
+ char *p_in_8;
+ char *p_out_8;
+ unsigned char *p_in_u8;
+ unsigned char *p_out_u8;
+ short *p_in_16;
+ short *p_out_16;
+ unsigned short *p_in_u16;
+ unsigned short *p_out_u16;
+ int *p_in_32;
+ int *p_out_32;
+ unsigned int *p_in_u32;
+ unsigned int *p_out_u32;
+ float *p_in_flt;
+ float *p_out_flt;
+ double *p_in_dbl;
+ double *p_out_dbl;
+ uint32 x;
+
+ switch (convert)
+ {
+ case RL2_CONVERT_GRID_INT8_TO_UINT8:
+ case RL2_CONVERT_GRID_INT8_TO_INT16:
+ case RL2_CONVERT_GRID_INT8_TO_UINT16:
+ case RL2_CONVERT_GRID_INT8_TO_INT32:
+ case RL2_CONVERT_GRID_INT8_TO_UINT32:
+ case RL2_CONVERT_GRID_INT8_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT8_TO_DOUBLE:
+ p_in_8 = (char *) in;
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_INT8:
+ case RL2_CONVERT_GRID_UINT8_TO_UINT16:
+ case RL2_CONVERT_GRID_UINT8_TO_INT16:
+ case RL2_CONVERT_GRID_UINT8_TO_UINT32:
+ case RL2_CONVERT_GRID_UINT8_TO_INT32:
+ case RL2_CONVERT_GRID_UINT8_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT8_TO_DOUBLE:
+ p_in_u8 = (unsigned char *) in;
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_INT8:
+ case RL2_CONVERT_GRID_INT16_TO_UINT8:
+ case RL2_CONVERT_GRID_INT16_TO_UINT16:
+ case RL2_CONVERT_GRID_INT16_TO_INT32:
+ case RL2_CONVERT_GRID_INT16_TO_UINT32:
+ case RL2_CONVERT_GRID_INT16_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT16_TO_DOUBLE:
+ p_in_16 = (short *) in;
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_INT8:
+ case RL2_CONVERT_GRID_UINT16_TO_UINT8:
+ case RL2_CONVERT_GRID_UINT16_TO_INT16:
+ case RL2_CONVERT_GRID_UINT16_TO_UINT32:
+ case RL2_CONVERT_GRID_UINT16_TO_INT32:
+ case RL2_CONVERT_GRID_UINT16_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT16_TO_DOUBLE:
+ p_in_u16 = (unsigned short *) in;
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_INT8:
+ case RL2_CONVERT_GRID_INT32_TO_UINT8:
+ case RL2_CONVERT_GRID_INT32_TO_INT16:
+ case RL2_CONVERT_GRID_INT32_TO_UINT16:
+ case RL2_CONVERT_GRID_INT32_TO_UINT32:
+ case RL2_CONVERT_GRID_INT32_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT32_TO_DOUBLE:
+ p_in_32 = (int *) in;
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_INT8:
+ case RL2_CONVERT_GRID_UINT32_TO_UINT8:
+ case RL2_CONVERT_GRID_UINT32_TO_INT16:
+ case RL2_CONVERT_GRID_UINT32_TO_UINT16:
+ case RL2_CONVERT_GRID_UINT32_TO_INT32:
+ case RL2_CONVERT_GRID_UINT32_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT32_TO_DOUBLE:
+ p_in_u32 = (unsigned int *) in;
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_INT8:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT8:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT16:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT16:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT32:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT32:
+ case RL2_CONVERT_GRID_FLOAT_TO_DOUBLE:
+ p_in_flt = (float *) in;
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT8:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT8:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT16:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT16:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT32:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT32:
+ case RL2_CONVERT_GRID_DOUBLE_TO_FLOAT:
+ p_in_dbl = (double *) in;
+ break;
+ };
+
+ switch (convert)
+ {
+ case RL2_CONVERT_GRID_UINT8_TO_INT8:
+ case RL2_CONVERT_GRID_INT16_TO_INT8:
+ case RL2_CONVERT_GRID_UINT16_TO_INT8:
+ case RL2_CONVERT_GRID_INT32_TO_INT8:
+ case RL2_CONVERT_GRID_UINT32_TO_INT8:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT8:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT8:
+ p_out_8 = (char *) out;
+ p_out_8 += lineNo * width;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_UINT8:
+ case RL2_CONVERT_GRID_INT16_TO_UINT8:
+ case RL2_CONVERT_GRID_UINT16_TO_UINT8:
+ case RL2_CONVERT_GRID_INT32_TO_UINT8:
+ case RL2_CONVERT_GRID_UINT32_TO_UINT8:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT8:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT8:
+ p_out_u8 = (unsigned char *) out;
+ p_out_u8 += lineNo * width;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_INT16:
+ case RL2_CONVERT_GRID_UINT8_TO_INT16:
+ case RL2_CONVERT_GRID_UINT16_TO_INT16:
+ case RL2_CONVERT_GRID_INT32_TO_INT16:
+ case RL2_CONVERT_GRID_UINT32_TO_INT16:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT16:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT16:
+ p_out_16 = (short *) out;
+ p_out_16 += lineNo * width;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_UINT16:
+ case RL2_CONVERT_GRID_UINT8_TO_UINT16:
+ case RL2_CONVERT_GRID_INT16_TO_UINT16:
+ case RL2_CONVERT_GRID_INT32_TO_UINT16:
+ case RL2_CONVERT_GRID_UINT32_TO_UINT16:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT16:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT16:
+ p_out_u16 = (unsigned short *) out;
+ p_out_u16 += lineNo * width;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_INT32:
+ case RL2_CONVERT_GRID_UINT8_TO_INT32:
+ case RL2_CONVERT_GRID_INT16_TO_INT32:
+ case RL2_CONVERT_GRID_UINT16_TO_INT32:
+ case RL2_CONVERT_GRID_UINT32_TO_INT32:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT32:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT32:
+ p_out_32 = (int *) out;
+ p_out_32 += lineNo * width;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_UINT32:
+ case RL2_CONVERT_GRID_UINT8_TO_UINT32:
+ case RL2_CONVERT_GRID_INT16_TO_UINT32:
+ case RL2_CONVERT_GRID_UINT16_TO_UINT32:
+ case RL2_CONVERT_GRID_INT32_TO_UINT32:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT32:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT32:
+ p_out_u32 = (unsigned int *) out;
+ p_out_u32 += lineNo * width;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT8_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT16_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT16_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT32_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT32_TO_FLOAT:
+ case RL2_CONVERT_GRID_DOUBLE_TO_FLOAT:
+ p_out_flt = (float *) out;
+ p_out_flt += lineNo * width;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_DOUBLE:
+ case RL2_CONVERT_GRID_UINT8_TO_DOUBLE:
+ case RL2_CONVERT_GRID_INT16_TO_DOUBLE:
+ case RL2_CONVERT_GRID_UINT16_TO_DOUBLE:
+ case RL2_CONVERT_GRID_INT32_TO_DOUBLE:
+ case RL2_CONVERT_GRID_UINT32_TO_DOUBLE:
+ case RL2_CONVERT_GRID_FLOAT_TO_DOUBLE:
+ p_out_dbl = (double *) out;
+ p_out_dbl += lineNo * width;
+ break;
+ };
+
+ for (x = 0; x < origin->width; x++)
+ {
+ if (x >= (startCol + width))
+ break;
+ if (x < startCol)
+ {
+ switch (convert)
+ {
+ case RL2_CONVERT_GRID_INT8_TO_UINT8:
+ case RL2_CONVERT_GRID_INT8_TO_INT16:
+ case RL2_CONVERT_GRID_INT8_TO_UINT16:
+ case RL2_CONVERT_GRID_INT8_TO_INT32:
+ case RL2_CONVERT_GRID_INT8_TO_UINT32:
+ case RL2_CONVERT_GRID_INT8_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT8_TO_DOUBLE:
+ p_in_8++;
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_INT8:
+ case RL2_CONVERT_GRID_UINT8_TO_INT16:
+ case RL2_CONVERT_GRID_UINT8_TO_UINT16:
+ case RL2_CONVERT_GRID_UINT8_TO_INT32:
+ case RL2_CONVERT_GRID_UINT8_TO_UINT32:
+ case RL2_CONVERT_GRID_UINT8_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT8_TO_DOUBLE:
+ p_in_u8++;
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_INT8:
+ case RL2_CONVERT_GRID_INT16_TO_UINT8:
+ case RL2_CONVERT_GRID_INT16_TO_UINT16:
+ case RL2_CONVERT_GRID_INT16_TO_INT32:
+ case RL2_CONVERT_GRID_INT16_TO_UINT32:
+ case RL2_CONVERT_GRID_INT16_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT16_TO_DOUBLE:
+ p_in_16++;
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_INT8:
+ case RL2_CONVERT_GRID_UINT16_TO_UINT8:
+ case RL2_CONVERT_GRID_UINT16_TO_INT16:
+ case RL2_CONVERT_GRID_UINT16_TO_INT32:
+ case RL2_CONVERT_GRID_UINT16_TO_UINT32:
+ case RL2_CONVERT_GRID_UINT16_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT16_TO_DOUBLE:
+ p_in_u16++;
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_INT8:
+ case RL2_CONVERT_GRID_INT32_TO_UINT8:
+ case RL2_CONVERT_GRID_INT32_TO_INT16:
+ case RL2_CONVERT_GRID_INT32_TO_UINT16:
+ case RL2_CONVERT_GRID_INT32_TO_UINT32:
+ case RL2_CONVERT_GRID_INT32_TO_FLOAT:
+ case RL2_CONVERT_GRID_INT32_TO_DOUBLE:
+ p_in_32++;
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_INT8:
+ case RL2_CONVERT_GRID_UINT32_TO_UINT8:
+ case RL2_CONVERT_GRID_UINT32_TO_INT16:
+ case RL2_CONVERT_GRID_UINT32_TO_UINT16:
+ case RL2_CONVERT_GRID_UINT32_TO_INT32:
+ case RL2_CONVERT_GRID_UINT32_TO_FLOAT:
+ case RL2_CONVERT_GRID_UINT32_TO_DOUBLE:
+ p_in_u32++;
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_INT8:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT8:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT16:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT16:
+ case RL2_CONVERT_GRID_FLOAT_TO_INT32:
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT32:
+ case RL2_CONVERT_GRID_FLOAT_TO_DOUBLE:
+ p_in_flt++;
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT8:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT8:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT16:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT16:
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT32:
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT32:
+ case RL2_CONVERT_GRID_DOUBLE_TO_FLOAT:
+ p_in_dbl++;
+ break;
+ };
+ continue;
+ }
+
+ switch (convert)
+ {
+ case RL2_CONVERT_GRID_INT8_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_8++);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_INT16:
+ *p_out_16++ = *p_in_8++;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_8++);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_INT32:
+ *p_out_32++ = *p_in_8++;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_UINT32:
+ *p_out_u32++ = truncate_u32 (*p_in_8++);
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_FLOAT:
+ *p_out_flt++ = *p_in_8++;
+ break;
+ case RL2_CONVERT_GRID_INT8_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_8++;
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_u8++);
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_u8++);
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_UINT16:
+ *p_out_u16++ = *p_in_u8++;
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_UINT32:
+ *p_out_u32++ = *p_in_u8++;
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_INT32:
+ *p_out_32++ = truncate_32 (*p_in_u8++);
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_FLOAT:
+ *p_out_flt++ = *p_in_u8++;
+ break;
+ case RL2_CONVERT_GRID_UINT8_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_u8++;
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_16++);
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_16++);
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_16++);
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_INT32:
+ *p_out_32++ = *p_in_16++;
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_UINT32:
+ *p_out_u32++ = truncate_u32 (*p_in_16++);
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_FLOAT:
+ *p_out_flt++ = *p_in_16++;
+ break;
+ case RL2_CONVERT_GRID_INT16_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_16++;
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_u16++);
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_u16++);
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_u16++);
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_UINT32:
+ *p_out_u32++ = *p_in_u16++;
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_INT32:
+ *p_out_32++ = truncate_32 (*p_in_u16++);
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_FLOAT:
+ *p_out_flt++ = *p_in_u16++;
+ break;
+ case RL2_CONVERT_GRID_UINT16_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_u16++;
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_32++);
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_32++);
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_32++);
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_32++);
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_UINT32:
+ *p_out_u32++ = truncate_u32 (*p_in_32++);
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_FLOAT:
+ *p_out_flt++ = *p_in_32++;
+ break;
+ case RL2_CONVERT_GRID_INT32_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_32++;
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_u32++);
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_u32++);
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_u32++);
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_u32++);
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_INT32:
+ *p_out_32++ = truncate_32 (*p_in_u32++);
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_FLOAT:
+ *p_out_flt++ = *p_in_u32++;
+ break;
+ case RL2_CONVERT_GRID_UINT32_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_u32++;
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_INT32:
+ *p_out_32++ = truncate_32 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_UINT32:
+ *p_out_u32++ = truncate_u32 (*p_in_flt++);
+ break;
+ case RL2_CONVERT_GRID_FLOAT_TO_DOUBLE:
+ *p_out_dbl++ = *p_in_flt++;
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT8:
+ *p_out_8++ = truncate_8 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT8:
+ *p_out_u8++ = truncate_u8 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT16:
+ *p_out_16++ = truncate_16 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT16:
+ *p_out_u16++ = truncate_u16 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_INT32:
+ *p_out_32++ = truncate_32 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_UINT32:
+ *p_out_u32++ = truncate_u32 (*p_in_dbl++);
+ break;
+ case RL2_CONVERT_GRID_DOUBLE_TO_FLOAT:
+ *p_out_flt++ = *p_in_dbl++;
+ break;
+ };
+ }
+}
+
+static int
+read_raw_scanlines (rl2PrivTiffOriginPtr origin, unsigned short width,
+ unsigned short height, unsigned char sample_type,
+ unsigned char num_bands, unsigned int startRow,
+ unsigned int startCol, unsigned char *pixels)
+{
+/* reading TIFF raw strips */
+ uint32 line_no;
+ uint32 x;
+ uint32 y;
+ uint32 *tiff_scanline = NULL;
+ char *p_in_8;
+ char *p_out_8;
+ unsigned char *p_in_u8;
+ unsigned char *p_out_u8;
+ short *p_in_16;
+ short *p_out_16;
+ unsigned short *p_in_u16;
+ unsigned short *p_out_u16;
+ int *p_in_32;
+ int *p_out_32;
+ unsigned int *p_in_u32;
+ unsigned int *p_out_u32;
+ float *p_in_flt;
+ float *p_out_flt;
+ double *p_in_dbl;
+ double *p_out_dbl;
+ unsigned char bnd;
+ unsigned char convert = origin->forced_conversion;
+ TIFF *in = (TIFF *) 0;
+
+ tiff_scanline = malloc (TIFFScanlineSize (origin->in));
+ if (tiff_scanline == NULL)
+ goto error;
+
+/*
+/ random access doesn't work on compressed scanlines
+/ so we'll open an auxiliary TIFF handle, thus ensuring
+/ an always clean reading context
+*/
+ in = TIFFOpen (origin->path, "r");
+ if (in == NULL)
+ goto error;
+
+ for (y = 0; y < startRow; y++)
+ {
+ /* skipping trailing scanlines */
+ if (TIFFReadScanline (in, tiff_scanline, y, 0) < 0)
+ goto error;
+ }
+
+ for (y = 0; y < height; y++)
+ {
+ /* scanning scanlines by row */
+ line_no = y + startRow;
+ if (line_no >= origin->height)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ p_out_8 = (char *) pixels;
+ for (x = 0; x < width; x++)
+ *p_out_8++ = 0;
+ break;
+ case RL2_SAMPLE_UINT8:
+ p_out_u8 = (unsigned char *) pixels;
+ for (x = 0; x < width * num_bands; x++)
+ *p_out_u8++ = 0;
+ break;
+ case RL2_SAMPLE_INT16:
+ p_out_16 = (short *) pixels;
+ for (x = 0; x < width; x++)
+ *p_out_16++ = 0;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_out_u16 = (unsigned short *) pixels;
+ for (x = 0; x < width * num_bands; x++)
+ *p_out_u16++ = 0;
+ break;
+ case RL2_SAMPLE_INT32:
+ p_out_32 = (int *) pixels;
+ for (x = 0; x < width; x++)
+ *p_out_32++ = 0;
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_out_u32 = (unsigned int *) pixels;
+ for (x = 0; x < width; x++)
+ *p_out_u32++ = 0;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_out_flt = (float *) pixels;
+ for (x = 0; x < width; x++)
+ *p_out_flt++ = 0;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_out_dbl = (double *) pixels;
+ for (x = 0; x < width; x++)
+ *p_out_dbl++ = 0;
+ break;
+ default:
+ goto error;
+ };
+ continue;
+ }
+ if (TIFFReadScanline (in, tiff_scanline, line_no, 0) < 0)
+ goto error;
+ if (convert != RL2_CONVERT_NO)
+ {
+ /* applying some format conversion */
+ copy_convert_scanline (origin, tiff_scanline, pixels, y,
+ startCol, width, convert);
+ continue;
+ }
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ p_in_8 = (char *) tiff_scanline;
+ p_out_8 = (char *) pixels;
+ p_out_8 += y * width;
+ break;
+ case RL2_SAMPLE_UINT8:
+ p_in_u8 = (unsigned char *) tiff_scanline;
+ p_out_u8 = (unsigned char *) pixels;
+ p_out_u8 += y * width * num_bands;
+ break;
+ case RL2_SAMPLE_INT16:
+ p_in_16 = (short *) tiff_scanline;
+ p_out_16 = (short *) pixels;
+ p_out_16 += y * width;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_in_u16 = (unsigned short *) tiff_scanline;
+ p_out_u16 = (unsigned short *) pixels;
+ p_out_u16 += y * width * num_bands;
+ break;
+ case RL2_SAMPLE_INT32:
+ p_in_32 = (int *) tiff_scanline;
+ p_out_32 = (int *) pixels;
+ p_out_32 += y * width;
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_in_u32 = (unsigned int *) tiff_scanline;
+ p_out_u32 = (unsigned int *) pixels;
+ p_out_u32 += y * width;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_in_flt = (float *) tiff_scanline;
+ p_out_flt = (float *) pixels;
+ p_out_flt += y * width;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_in_dbl = (double *) tiff_scanline;
+ p_out_dbl = (double *) pixels;
+ p_out_dbl += y * width;
+ break;
+ default:
+ goto error;
+ };
+ for (x = 0; x < origin->width; x++)
+ {
+ if (x >= (startCol + width))
+ break;
+ if (x < startCol)
+ {
+ for (bnd = 0; bnd < num_bands; bnd++)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ p_in_8++;
+ break;
+ case RL2_SAMPLE_UINT8:
+ p_in_u8++;
+ break;
+ case RL2_SAMPLE_INT16:
+ p_in_16++;
+ break;
+ case RL2_SAMPLE_UINT16:
+ p_in_u16++;
+ break;
+ case RL2_SAMPLE_INT32:
+ p_in_32++;
+ break;
+ case RL2_SAMPLE_UINT32:
+ p_in_u32++;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ p_in_flt++;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ p_in_dbl++;
+ break;
+ };
+ }
+ continue;
+ }
+ for (bnd = 0; bnd < num_bands; bnd++)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ *p_out_8++ = *p_in_8++;
+ break;
+ case RL2_SAMPLE_UINT8:
+ *p_out_u8++ = *p_in_u8++;
+ break;
+ case RL2_SAMPLE_INT16:
+ *p_out_16++ = *p_in_16++;
+ break;
+ case RL2_SAMPLE_UINT16:
+ *p_out_u16++ = *p_in_u16++;
+ break;
+ case RL2_SAMPLE_INT32:
+ *p_out_32++ = *p_in_32++;
+ break;
+ case RL2_SAMPLE_UINT32:
+ *p_out_u32++ = *p_in_u32++;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ *p_out_flt++ = *p_in_flt++;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ *p_out_dbl++ = *p_in_dbl++;
+ break;
+ };
+ }
+ }
+ }
+
+ free (tiff_scanline);
+ TIFFClose (in);
+ return RL2_OK;
+ error:
+ if (tiff_scanline != NULL)
+ free (tiff_scanline);
+ if (in != (TIFF *) 0)
+ TIFFClose (in);
+ return RL2_ERROR;
+}
+
+static int
+read_raw_separate_tiles (rl2PrivTiffOriginPtr origin, unsigned short width,
+ unsigned short height, unsigned char sample_type,
+ unsigned char num_bands, unsigned int startRow,
+ unsigned int startCol, void *pixels)
+{
+/* reading TIFF raw tiles - separate planes */
+ uint32 tile_x;
+ uint32 tile_y;
+ uint32 x;
+ uint32 y;
+ uint32 *tiff_tile = NULL;
+ unsigned char *p_in_u8;
+ unsigned char *p_out_u8;
+ unsigned short *p_in_u16;
+ unsigned short *p_out_u16;
+ unsigned int dest_x;
+ unsigned int dest_y;
+ int skip;
+ unsigned char band;
+
+ if (sample_type != RL2_SAMPLE_UINT16 && sample_type != RL2_SAMPLE_UINT8)
+ goto error;
+
+ tiff_tile = malloc (TIFFTileSize (origin->in));
+ if (tiff_tile == NULL)
+ goto error;
+
+ for (tile_y = 0; tile_y < origin->height; tile_y += origin->tileHeight)
+ {
+ /* scanning tiles by row */
+ unsigned int tiff_min_y = tile_y;
+ unsigned int tiff_max_y = tile_y + origin->tileHeight - 1;
+ skip = 0;
+ if (tiff_min_y > (startRow + height))
+ skip = 1;
+ if (tiff_max_y < startRow)
+ skip = 1;
+ if (skip)
+ {
+ /* skipping any not required tile */
+ continue;
+ }
+ for (tile_x = 0; tile_x < origin->width; tile_x += origin->tileWidth)
+ {
+ /* reading a TIFF tile */
+ unsigned int tiff_min_x = tile_x;
+ unsigned int tiff_max_x = tile_x + origin->tileWidth - 1;
+ skip = 0;
+ if (tiff_min_x > (startCol + width))
+ skip = 1;
+ if (tiff_max_x < startCol)
+ skip = 1;
+ if (skip)
+ {
+ /* skipping any not required tile */
+ continue;
+ }
+ for (band = 0; band < num_bands; band++)
+ {
+ /* one component for each separate plane */
+ if (TIFFReadTile
+ (origin->in, tiff_tile, tile_x, tile_y, 0, band) < 0)
+ goto error;
+ for (y = 0; y < origin->tileHeight; y++)
+ {
+ dest_y = tile_y + y;
+ if (dest_y < startRow
+ || dest_y >= (startRow + height))
+ continue;
+ for (x = 0; x < origin->tileWidth; x++)
+ {
+ dest_x = tile_x + x;
+ if (dest_x < startCol
+ || dest_x >= (startCol + width))
+ continue;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ {
+ p_in_u16 = (unsigned short *) tiff_tile;
+ p_in_u16 += y * origin->tileWidth;
+ p_in_u16 += x;
+ p_out_u16 = (unsigned short *) pixels;
+ p_out_u16 +=
+ ((dest_y -
+ startRow) * width * num_bands) +
+ ((dest_x - startCol) * num_bands) +
+ band;
+ *p_out_u16 = *p_in_u16;
+ }
+ if (sample_type == RL2_SAMPLE_UINT8)
+ {
+ p_in_u8 = (unsigned char *) tiff_tile;
+ p_in_u8 += y * origin->tileWidth;
+ p_in_u8 += x;
+ p_out_u8 = (unsigned char *) pixels;
+ p_out_u8 +=
+ ((dest_y -
+ startRow) * width * num_bands) +
+ ((dest_x - startCol) * num_bands) +
+ band;
+ *p_out_u8 = *p_in_u8;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ free (tiff_tile);
+ return RL2_OK;
+ error:
+ if (tiff_tile != NULL)
+ free (tiff_tile);
+ return RL2_ERROR;
+}
+
+static int
+read_raw_separate_scanlines (rl2PrivTiffOriginPtr origin, unsigned short width,
+ unsigned short height, unsigned char sample_type,
+ unsigned char num_bands, unsigned int startRow,
+ unsigned int startCol, void *pixels)
+{
+/* reading TIFF raw strips - separate planes */
+ uint32 line_no;
+ uint32 x;
+ uint32 y;
+ uint32 *tiff_scanline = NULL;
+ unsigned char *p_in_u8;
+ unsigned char *p_out_u8;
+ unsigned char *p_out_u8_base;
+ unsigned short *p_in_u16;
+ unsigned short *p_out_u16;
+ unsigned short *p_out_u16_base;
+ unsigned char band;
+ TIFF *in = (TIFF *) 0;
+
+ if (sample_type != RL2_SAMPLE_UINT8 && sample_type != RL2_SAMPLE_UINT16)
+ goto error;
+
+ tiff_scanline = malloc (TIFFScanlineSize (origin->in));
+ if (tiff_scanline == NULL)
+ goto error;
+
+ for (band = 0; band < num_bands; band++)
+ {
+ /* one component for each separate plane */
+
+/*
+/ random access doesn't work on compressed scanlines
+/ so we'll open an auxiliary TIFF handle, thus ensuring
+/ an always clean reading context
+*/
+ in = TIFFOpen (origin->path, "r");
+ if (in == NULL)
+ goto error;
+
+ for (y = 0; y < startRow; y++)
+ {
+ /* skipping trailing scanlines */
+ if (TIFFReadScanline (in, tiff_scanline, y, band) < 0)
+ goto error;
+ }
+ for (y = 0; y < height; y++)
+ {
+ /* scanning scanlines by row */
+ line_no = y + startRow;
+ if (line_no >= origin->height)
+ continue;
+ if (TIFFReadScanline (in, tiff_scanline, line_no, band) < 0)
+ goto error;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ {
+ p_in_u16 = (unsigned short *) tiff_scanline;
+ p_in_u16 += startCol;
+ p_out_u16_base = (unsigned short *) pixels;
+ p_out_u16_base += y * width * num_bands;
+ }
+ else
+ {
+ p_in_u8 = (unsigned char *) tiff_scanline;
+ p_in_u8 += startCol;
+ p_out_u8_base = (unsigned char *) pixels;
+ p_out_u8_base += y * width * num_bands;
+ }
+ for (x = startCol; x < origin->width; x++)
+ {
+ if (x >= (startCol + width))
+ break;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ p_out_u16 =
+ p_out_u16_base + ((x - startCol) * num_bands) +
+ band;
+ else
+ p_out_u8 =
+ p_out_u8_base + ((x - startCol) * num_bands) +
+ band;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ *p_out_u16 = *p_in_u16++;
+ else
+ *p_out_u8 = *p_in_u8++;
+ }
+ }
+ TIFFClose (in);
+ in = (TIFF *) 0;
+ }
+
+ free (tiff_scanline);
+ return RL2_OK;
+ error:
+ if (tiff_scanline != NULL)
+ free (tiff_scanline);
+ if (in != (TIFF *) 0)
+ TIFFClose (in);
+ return RL2_ERROR;
+}
+
+static int
+read_RGBA_tiles (rl2PrivTiffOriginPtr origin, unsigned short width,
+ unsigned short height, unsigned char pixel_type,
+ unsigned char num_bands, unsigned int startRow,
+ unsigned int startCol, unsigned char *pixels,
+ rl2PalettePtr palette)
+{
+/* reading TIFF RGBA tiles */
+ uint32 tile_x;
+ uint32 tile_y;
+ uint32 x;
+ uint32 y;
+ uint32 pix;
+ uint32 *tiff_tile = NULL;
+ uint32 *p_in;
+ unsigned char *p_out;
+ unsigned int dest_x;
+ unsigned int dest_y;
+ int skip;
+ unsigned char index;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+
+ tiff_tile =
+ malloc (sizeof (uint32) * origin->tileWidth * origin->tileHeight);
+ if (tiff_tile == NULL)
+ goto error;
+
+ for (tile_y = 0; tile_y < origin->height; tile_y += origin->tileHeight)
+ {
+ /* scanning tiles by row */
+ unsigned int tiff_min_y = tile_y;
+ unsigned int tiff_max_y = tile_y + origin->tileHeight - 1;
+ skip = 0;
+ if (tiff_min_y > (startRow + height))
+ skip = 1;
+ if (tiff_max_y < startRow)
+ skip = 1;
+ if (skip)
+ {
+ /* skipping any not required tile */
+ continue;
+ }
+ for (tile_x = 0; tile_x < origin->width; tile_x += origin->tileWidth)
+ {
+ /* reading a TIFF tile */
+ unsigned int tiff_min_x = tile_x;
+ unsigned int tiff_max_x = tile_x + origin->tileWidth - 1;
+ skip = 0;
+ if (tiff_min_x > (startCol + width))
+ skip = 1;
+ if (tiff_max_x < startCol)
+ skip = 1;
+ if (skip)
+ {
+ /* skipping any not required tile */
+ continue;
+ }
+ if (!TIFFReadRGBATile (origin->in, tile_x, tile_y, tiff_tile))
+ goto error;
+ for (y = 0; y < origin->tileHeight; y++)
+ {
+ dest_y = tile_y + (origin->tileHeight - y) - 1;
+ if (dest_y < startRow || dest_y >= (startRow + height))
+ continue;
+ p_in = tiff_tile + (origin->tileWidth * y);
+ for (x = 0; x < origin->tileWidth; x++)
+ {
+ dest_x = tile_x + x;
+ if (dest_x < startCol
+ || dest_x >= (startCol + width))
+ {
+ p_in++;
+ continue;
+ }
+ p_out =
+ pixels +
+ ((dest_y - startRow) * width * num_bands) +
+ ((dest_x - startCol) * num_bands);
+ pix = *p_in++;
+ red = TIFFGetR (pix);
+ green = TIFFGetG (pix);
+ blue = TIFFGetB (pix);
+ if (origin->forced_conversion ==
+ RL2_CONVERT_RGB_TO_GRAYSCALE)
+ {
+ /* forced conversion: RGB -> GRAYSCALE */
+ double gray =
+ ((double) red * 0.2126) +
+ ((double) green * 0.7152) +
+ ((double) blue * 0.0722);
+ *p_out++ = (unsigned char) gray;
+ }
+ else if (origin->forced_conversion ==
+ RL2_CONVERT_GRAYSCALE_TO_RGB
+ || origin->forced_conversion ==
+ RL2_CONVERT_PALETTE_TO_RGB)
+ {
+ /* forced conversion: GRAYSCALE or PALETTE -> RGB */
+ *p_out++ = red;
+ *p_out++ = green;
+ *p_out++ = blue;
+ }
+ else if (origin->forced_conversion ==
+ RL2_CONVERT_GRAYSCALE_TO_PALETTE)
+ {
+ /* forced conversion: GRAYSCALE -> PALETTE */
+ *p_out++ = red;
+ }
+ else if (origin->forced_conversion ==
+ RL2_CONVERT_PALETTE_TO_GRAYSCALE)
+ {
+ /* forced conversion: PALETTE -> GRAYSCALE */
+ *p_out++ = red;
+ }
+ else if (origin->forced_conversion ==
+ RL2_CONVERT_PALETTE_TO_MONOCHROME)
+ {
+ /* forced conversion: PALETTE -> MONOCHROME */
+ if (red == 255 && green == 255 && blue == 255)
+ *p_out++ = 0;
+ else
+ *p_out++ = 1;
+ }
+ else if (origin->forced_conversion ==
+ RL2_CONVERT_MONOCHROME_TO_PALETTE)
+ {
+ /* forced conversion: MONOCHROME -> PALETTE */
+ if (red == 0)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ }
+ else if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ /* PALETTE image */
+ if (rl2_get_palette_index
+ (palette, &index, red, green,
+ blue) != RL2_OK)
+ index = 0;
+ *p_out++ = index;
+ }
+ else if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ /* MONOCHROME image */
+ if (red == 0)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ }
+ else if (pixel_type == RL2_PIXEL_GRAYSCALE)
+ {
+ /* GRAYSCALE image */
+ *p_out++ = red;
+ }
+ else
+ {
+ /* should be an RGB image */
+ *p_out++ = red;
+ *p_out++ = green;
+ *p_out++ = blue;
+ }
+ }
+ }
+ }
+ }
+
+ free (tiff_tile);
+ return RL2_OK;
+ error:
+ if (tiff_tile != NULL)
+ free (tiff_tile);
+ return RL2_ERROR;
+}
+
+static int
+read_RGBA_strips (rl2PrivTiffOriginPtr origin, unsigned short width,
+ unsigned short height, unsigned char pixel_type,
+ unsigned char num_bands, unsigned int startRow,
+ unsigned int startCol, unsigned char *pixels,
+ rl2PalettePtr palette)
+{
+/* reading TIFF RGBA strips */
+ uint32 strip;
+ uint32 x;
+ uint32 y;
+ uint32 pix;
+ uint32 *tiff_strip = NULL;
+ uint32 *p_in;
+ unsigned char *p_out;
+ unsigned int dest_x;
+ unsigned int dest_y;
+ int skip;
+ unsigned char index;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+
+ tiff_strip =
+ malloc (sizeof (uint32) * origin->width * origin->rowsPerStrip);
+ if (tiff_strip == NULL)
+ goto error;
+
+ for (strip = 0; strip < origin->height; strip += origin->rowsPerStrip)
+ {
+ /* scanning strips by row */
+ unsigned int tiff_min_y = strip;
+ unsigned int tiff_max_y = strip + origin->rowsPerStrip - 1;
+ skip = 0;
+ if (tiff_min_y > (startRow + height))
+ skip = 1;
+ if (tiff_max_y < startRow)
+ skip = 1;
+ if (skip)
+ {
+ /* skipping any not required strip */
+ continue;
+ }
+ if (!TIFFReadRGBAStrip (origin->in, strip, tiff_strip))
+ goto error;
+ for (y = 0; y < origin->rowsPerStrip; y++)
+ {
+ dest_y = strip + (origin->rowsPerStrip - y) - 1;
+ if (dest_y < startRow || dest_y >= (startRow + height))
+ continue;
+ p_in = tiff_strip + (origin->width * y);
+ for (x = 0; x < origin->width; x++)
+ {
+ dest_x = x;
+ if (dest_x < startCol || dest_x >= (startCol + width))
+ {
+ p_in++;
+ continue;
+ }
+ p_out =
+ pixels + ((dest_y - startRow) * width * num_bands) +
+ ((dest_x - startCol) * num_bands);
+ pix = *p_in++;
+ red = TIFFGetR (pix);
+ green = TIFFGetG (pix);
+ blue = TIFFGetB (pix);
+ if (origin->forced_conversion ==
+ RL2_CONVERT_RGB_TO_GRAYSCALE)
+ {
+ /* forced conversion: RGB -> GRAYSCALE */
+ double gray =
+ ((double) red * 0.2126) +
+ ((double) green * 0.7152) +
+ ((double) blue * 0.0722);
+ *p_out++ = (unsigned char) gray;
+ }
+ else if (origin->forced_conversion ==
+ RL2_CONVERT_GRAYSCALE_TO_RGB
+ || origin->forced_conversion ==
+ RL2_CONVERT_PALETTE_TO_RGB)
+ {
+ /* forced conversion: GRAYSCALE or PALETTE -> RGB */
+ *p_out++ = red;
+ *p_out++ = green;
+ *p_out++ = blue;
+ }
+ else if (origin->forced_conversion ==
+ RL2_CONVERT_GRAYSCALE_TO_PALETTE)
+ {
+ /* forced conversion: GRAYSCALE -> PALETTE */
+ *p_out++ = red;
+ }
+ else if (origin->forced_conversion ==
+ RL2_CONVERT_PALETTE_TO_GRAYSCALE)
+ {
+ /* forced conversion: PALETTE -> GRAYSCALE */
+ *p_out++ = red;
+ }
+ else if (origin->forced_conversion ==
+ RL2_CONVERT_PALETTE_TO_MONOCHROME)
+ {
+ /* forced conversion: PALETTE -> MONOCHROME */
+ if (red == 255 && green == 255 && blue == 255)
+ *p_out++ = 0;
+ else
+ *p_out++ = 1;
+ }
+ else if (origin->forced_conversion ==
+ RL2_CONVERT_MONOCHROME_TO_PALETTE)
+ {
+ /* forced conversion: MONOCHROME -> PALETTE */
+ if (red == 0)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ }
+ else if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ /* PALETTE image */
+ if (rl2_get_palette_index
+ (palette, &index, red, green, blue) != RL2_OK)
+ index = 0;
+ *p_out++ = index;
+ }
+ else if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ /* MONOCHROME image */
+ if (red == 0)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ }
+ else if (pixel_type == RL2_PIXEL_GRAYSCALE)
+ {
+ /* GRAYSCALE image */
+ *p_out++ = red;
+ }
+ else
+ {
+ /* should be an RGB image */
+ *p_out++ = red;
+ *p_out++ = green;
+ *p_out++ = blue;
+ }
+ }
+ }
+ }
+
+ free (tiff_strip);
+ return RL2_OK;
+ error:
+ if (tiff_strip != NULL)
+ free (tiff_strip);
+ return RL2_ERROR;
+}
+
+static int
+read_from_tiff (rl2PrivTiffOriginPtr origin, unsigned short width,
+ unsigned short height, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_bands,
+ unsigned int startRow, unsigned int startCol,
+ unsigned char **pixels, int *pixels_sz, rl2PalettePtr palette)
+{
+/* creating a tile from the Tiff origin */
+ int ret;
+ unsigned char *bufPixels = NULL;
+ int bufPixelsSz = 0;
+ int pix_sz = 1;
+
+/* allocating the pixels buffer */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ pix_sz = 2;
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ pix_sz = 4;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ pix_sz = 8;
+ break;
+ };
+ bufPixelsSz = width * height * pix_sz * num_bands;
+ bufPixels = malloc (bufPixelsSz);
+ if (bufPixels == NULL)
+ goto error;
+ if ((startRow + height) > origin->height
+ || (startCol + width) > origin->width)
+ rl2_prime_void_tile (bufPixels, width, height, sample_type, num_bands,
+ NULL);
+
+ if (origin->planarConfig == PLANARCONFIG_SEPARATE)
+ {
+ /* separate planes configuration */
+ if ((origin->bitsPerSample == 16 || origin->bitsPerSample == 8)
+ && origin->sampleFormat == SAMPLEFORMAT_UINT)
+ {
+ /* using raw TIFF methods - separate planes */
+ if (origin->isTiled)
+ ret =
+ read_raw_separate_tiles (origin, width, height,
+ sample_type, num_bands,
+ startRow, startCol,
+ (void *) bufPixels);
+ else
+ ret =
+ read_raw_separate_scanlines (origin, width, height,
+ sample_type, num_bands,
+ startRow, startCol,
+ (void *) bufPixels);
+ if (ret != RL2_OK)
+ goto error;
+ }
+ else
+ goto error;
+ }
+ else
+ {
+ /* contiguous planar configuration */
+ if (origin->bitsPerSample <= 8
+ && origin->sampleFormat == SAMPLEFORMAT_UINT
+ && (origin->samplesPerPixel == 1 || origin->samplesPerPixel == 3)
+ && (pixel_type == RL2_PIXEL_MONOCHROME
+ || pixel_type == RL2_PIXEL_PALETTE
+ || pixel_type == RL2_PIXEL_GRAYSCALE
+ || pixel_type == RL2_PIXEL_RGB))
+ {
+ /* using the TIFF RGBA methods */
+ if (origin->isTiled)
+ ret =
+ read_RGBA_tiles (origin, width, height, pixel_type,
+ num_bands, startRow, startCol,
+ bufPixels, palette);
+ else
+ ret =
+ read_RGBA_strips (origin, width, height, pixel_type,
+ num_bands, startRow, startCol,
+ bufPixels, palette);
+ if (ret != RL2_OK)
+ goto error;
+ }
+ else
+ {
+ /* using raw TIFF methods */
+ if (origin->isTiled)
+ ret =
+ read_raw_tiles (origin, width, height, sample_type,
+ num_bands, startRow, startCol,
+ bufPixels);
+ else
+ ret =
+ read_raw_scanlines (origin, width, height, sample_type,
+ num_bands, startRow, startCol,
+ bufPixels);
+ if (ret != RL2_OK)
+ goto error;
+ }
+ }
+
+ *pixels = bufPixels;
+ *pixels_sz = bufPixelsSz;
+ return RL2_OK;
+ error:
+ if (bufPixels != NULL)
+ free (bufPixels);
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_is_tiled_tiff_origin (rl2TiffOriginPtr tiff, int *is_tiled)
+{
+/* testing if the TIFF Origin is tiled or not */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+ *is_tiled = origin->isTiled;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_origin_tile_size (rl2TiffOriginPtr tiff,
+ unsigned int *tile_width,
+ unsigned int *tile_height)
+{
+/* attempting to return the Tile dimensions */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+ if (origin->isTiled == 0)
+ return RL2_ERROR;
+ *tile_width = origin->tileWidth;
+ *tile_height = origin->tileHeight;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_origin_strip_size (rl2TiffOriginPtr tiff, unsigned int *strip_size)
+{
+/* attempting to return the Strip dimension */
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ if (origin == NULL)
+ return RL2_ERROR;
+ if (origin->isTiled != 0)
+ return RL2_ERROR;
+ *strip_size = origin->rowsPerStrip;
+ return RL2_OK;
+}
+
+static void
+build_remap (rl2PrivTiffOriginPtr origin)
+{
+/* building a remapped palette identical to the natural one */
+ int j;
+ if (origin->remapRed != NULL)
+ free (origin->remapRed);
+ if (origin->remapGreen != NULL)
+ free (origin->remapGreen);
+ if (origin->remapBlue != NULL)
+ free (origin->remapBlue);
+ origin->remapMaxPalette = origin->maxPalette;
+ origin->remapRed = malloc (origin->remapMaxPalette);
+ origin->remapGreen = malloc (origin->remapMaxPalette);
+ origin->remapBlue = malloc (origin->remapMaxPalette);
+ for (j = 0; j < origin->maxPalette; j++)
+ {
+ origin->remapRed[j] = origin->red[j];
+ origin->remapGreen[j] = origin->green[j];
+ origin->remapBlue[j] = origin->blue[j];
+ }
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_get_tile_from_tiff_origin (rl2CoveragePtr cvg, rl2TiffOriginPtr tiff,
+ unsigned int startRow, unsigned int startCol,
+ int force_srid)
+{
+/* attempting to create a Coverage-tile from a Tiff origin */
+ unsigned int x;
+ rl2PrivCoveragePtr coverage = (rl2PrivCoveragePtr) cvg;
+ rl2PrivTiffOriginPtr origin = (rl2PrivTiffOriginPtr) tiff;
+ rl2RasterPtr raster = NULL;
+ rl2PalettePtr palette = NULL;
+ unsigned char *pixels = NULL;
+ int pixels_sz = 0;
+ unsigned char *mask = NULL;
+ int mask_size = 0;
+ unsigned int unused_width = 0;
+ unsigned int unused_height = 0;
+
+ if (coverage == NULL || tiff == NULL)
+ return NULL;
+ if (rl2_eval_tiff_origin_compatibility (cvg, tiff, force_srid) != RL2_TRUE)
+ return NULL;
+
+/* testing for tile's boundary validity */
+ if (startCol > origin->width)
+ return NULL;
+ if (startRow > origin->height)
+ return NULL;
+ x = startCol / coverage->tileWidth;
+ if ((x * coverage->tileWidth) != startCol)
+ return NULL;
+ x = startRow / coverage->tileHeight;
+ if ((x * coverage->tileHeight) != startRow)
+ return NULL;
+
+ if ((origin->photometric == PHOTOMETRIC_RGB
+ && origin->forced_pixel_type == RL2_PIXEL_PALETTE)
+ || origin->forced_conversion == RL2_CONVERT_GRAYSCALE_TO_PALETTE)
+ {
+ /* creating a remapped Palette */
+ if (origin->remapMaxPalette == 0 && origin->maxPalette > 0
+ && origin->maxPalette <= 256)
+ build_remap (origin);
+ palette = rl2_create_palette (origin->remapMaxPalette);
+ for (x = 0; x < origin->remapMaxPalette; x++)
+ {
+ rl2_set_palette_color (palette, x, origin->remapRed[x],
+ origin->remapGreen[x],
+ origin->remapBlue[x]);
+ }
+ }
+ else if ((origin->photometric < PHOTOMETRIC_RGB
+ && origin->forced_pixel_type == RL2_PIXEL_PALETTE)
+ || origin->forced_conversion == RL2_CONVERT_MONOCHROME_TO_PALETTE)
+ {
+ /* creating a remapped Palette */
+ if (origin->remapMaxPalette == 0 && origin->maxPalette > 0
+ && origin->maxPalette <= 2)
+ build_remap (origin);
+ palette = rl2_create_palette (origin->remapMaxPalette);
+ for (x = 0; x < origin->remapMaxPalette; x++)
+ {
+ rl2_set_palette_color (palette, x, origin->remapRed[x],
+ origin->remapGreen[x],
+ origin->remapBlue[x]);
+ }
+ }
+ if (origin->photometric == PHOTOMETRIC_PALETTE)
+ {
+ /* creating an ordinary Palette */
+ if (origin->remapMaxPalette > 0)
+ {
+ palette = rl2_create_palette (origin->remapMaxPalette);
+ for (x = 0; x < origin->maxPalette; x++)
+ {
+ rl2_set_palette_color (palette, x,
+ origin->remapRed[x],
+ origin->remapGreen[x],
+ origin->remapBlue[x]);
+ }
+ }
+ else
+ {
+ if (origin->maxPalette > 0)
+ {
+ palette = rl2_create_palette (origin->maxPalette);
+ for (x = 0; x < origin->maxPalette; x++)
+ {
+ rl2_set_palette_color (palette, x, origin->red[x],
+ origin->green[x],
+ origin->blue[x]);
+ }
+ }
+ }
+ }
+
+/* attempting to create the tile */
+ if (read_from_tiff
+ (origin, coverage->tileWidth, coverage->tileHeight,
+ coverage->sampleType, coverage->pixelType, coverage->nBands, startRow,
+ startCol, &pixels, &pixels_sz, palette) != RL2_OK)
+ goto error;
+ if (startCol + coverage->tileWidth > origin->width)
+ unused_width = (startCol + coverage->tileWidth) - origin->width;
+ if (startRow + coverage->tileHeight > origin->height)
+ unused_height = (startRow + coverage->tileHeight) - origin->height;
+ if (unused_width || unused_height)
+ {
+ /*
+ * creating a Transparency Mask so to shadow any
+ * unused portion of the current tile
+ */
+ unsigned int shadow_x = coverage->tileWidth - unused_width;
+ unsigned int shadow_y = coverage->tileHeight - unused_height;
+ unsigned int row;
+ mask_size = coverage->tileWidth * coverage->tileHeight;
+ mask = malloc (mask_size);
+ if (mask == NULL)
+ goto error;
+ /* full Transparent mask */
+ memset (mask, 0, coverage->tileWidth * coverage->tileHeight);
+ for (row = 0; row < coverage->tileHeight; row++)
+ {
+ unsigned char *p = mask + (row * coverage->tileWidth);
+ if (row < shadow_y)
+ {
+ /* setting opaque pixels */
+ memset (p, 1, shadow_x);
+ }
+ }
+ }
+
+ if (origin->forced_conversion == RL2_CONVERT_PALETTE_TO_MONOCHROME ||
+ origin->forced_conversion == RL2_CONVERT_PALETTE_TO_GRAYSCALE ||
+ origin->forced_conversion == RL2_CONVERT_PALETTE_TO_RGB)
+ {
+ rl2_destroy_palette (palette);
+ palette = NULL;
+ }
+ raster =
+ rl2_create_raster (coverage->tileWidth, coverage->tileHeight,
+ coverage->sampleType, coverage->pixelType,
+ coverage->nBands, pixels, pixels_sz, palette, mask,
+ mask_size, NULL);
+ if (raster == NULL)
+ goto error;
+ return raster;
+ error:
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ if (pixels != NULL)
+ free (pixels);
+ if (mask != NULL)
+ free (mask);
+ return NULL;
+}
+
+static rl2PrivTiffDestinationPtr
+create_tiff_destination (const char *path, int is_geo_tiff)
+{
+/* creating an uninitialized TIFF destination */
+ int len;
+ rl2PrivTiffDestinationPtr destination;
+ if (path == NULL)
+ return NULL;
+ destination = malloc (sizeof (rl2PrivTiffDestination));
+ if (destination == NULL)
+ return NULL;
+
+ len = strlen (path);
+ destination->path = malloc (len + 1);
+ strcpy (destination->path, path);
+ destination->isGeoTiff = is_geo_tiff;
+ destination->out = (TIFF *) 0;
+ destination->gtif = (GTIF *) 0;
+ destination->tiffBuffer = NULL;
+ destination->tileWidth = 256;
+ destination->tileHeight = 256;
+ destination->maxPalette = 0;
+ destination->red = NULL;
+ destination->green = NULL;
+ destination->blue = NULL;
+ destination->isGeoReferenced = 0;
+ destination->Srid = -1;
+ destination->srsName = NULL;
+ destination->proj4text = NULL;
+ return destination;
+}
+
+RL2_DECLARE void
+rl2_destroy_tiff_destination (rl2TiffDestinationPtr tiff)
+{
+/* memory cleanup - destroying a TIFF destination */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return;
+ if (destination->isGeoTiff)
+ {
+ /* it's a GeoTiff */
+ if (destination->gtif != (GTIF *) 0)
+ GTIFFree (destination->gtif);
+ if (destination->out != (TIFF *) 0)
+ XTIFFClose (destination->out);
+ }
+ else
+ {
+ /* it's a plain ordinary Tiff */
+ if (destination->out != (TIFF *) 0)
+ TIFFClose (destination->out);
+ }
+ if (destination->path != NULL)
+ free (destination->path);
+ if (destination->tfw_path != NULL)
+ free (destination->tfw_path);
+ if (destination->tiffBuffer != NULL)
+ free (destination->tiffBuffer);
+ if (destination->red != NULL)
+ free (destination->red);
+ if (destination->green != NULL)
+ free (destination->green);
+ if (destination->blue != NULL)
+ free (destination->blue);
+ if (destination->srsName != NULL)
+ free (destination->srsName);
+ if (destination->proj4text != NULL)
+ free (destination->proj4text);
+ free (destination);
+}
+
+static int
+check_color_model (unsigned char sample_type, unsigned char pixel_type,
+ unsigned char num_bands, rl2PalettePtr plt,
+ unsigned char compression)
+{
+/* checking TIFF arguments for self consistency */
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ if (sample_type != RL2_SAMPLE_1_BIT || num_bands != 1)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_CCITTFAX3:
+ case RL2_COMPRESSION_CCITTFAX4:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return 0;
+ };
+ if (num_bands != 1)
+ return 0;
+ if (plt == NULL)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ case RL2_COMPRESSION_LZW:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return 0;
+ };
+ if (num_bands != 1)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ case RL2_COMPRESSION_LZW:
+ case RL2_COMPRESSION_JPEG:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ case RL2_PIXEL_RGB:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_UINT16:
+ break;
+ default:
+ return 0;
+ };
+ if (num_bands != 3)
+ return 0;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ {
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ case RL2_COMPRESSION_LZW:
+ break;
+ default:
+ return 0;
+ };
+ }
+ else
+ {
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ case RL2_COMPRESSION_LZW:
+ case RL2_COMPRESSION_JPEG:
+ break;
+ default:
+ return 0;
+ };
+ }
+ break;
+ case RL2_PIXEL_DATAGRID:
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ case RL2_SAMPLE_FLOAT:
+ case RL2_SAMPLE_DOUBLE:
+ break;
+ default:
+ return 0;
+ };
+ if (num_bands != 1)
+ return 0;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ case RL2_COMPRESSION_DEFLATE:
+ case RL2_COMPRESSION_LZMA:
+ case RL2_COMPRESSION_LZW:
+ break;
+ default:
+ return 0;
+ };
+ break;
+ };
+ return 1;
+}
+
+static int
+set_tiff_destination (rl2PrivTiffDestinationPtr destination,
+ unsigned short width, unsigned short height,
+ unsigned char sample_type, unsigned char pixel_type,
+ unsigned char num_bands, rl2PalettePtr plt,
+ unsigned char tiff_compression)
+{
+/* setting up the TIFF headers */
+ int i;
+ uint16 r_plt[256];
+ uint16 g_plt[256];
+ uint16 b_plt[256];
+ tsize_t buf_size;
+ void *tiff_buffer = NULL;
+
+ TIFFSetField (destination->out, TIFFTAG_SUBFILETYPE, 0);
+ TIFFSetField (destination->out, TIFFTAG_IMAGEWIDTH, width);
+ TIFFSetField (destination->out, TIFFTAG_IMAGELENGTH, height);
+ TIFFSetField (destination->out, TIFFTAG_XRESOLUTION, 300.0);
+ TIFFSetField (destination->out, TIFFTAG_YRESOLUTION, 300.0);
+ TIFFSetField (destination->out, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
+ if (pixel_type == RL2_PIXEL_MULTIBAND)
+ TIFFSetField (destination->out, TIFFTAG_PLANARCONFIG,
+ PLANARCONFIG_SEPARATE);
+ else if (pixel_type == RL2_PIXEL_RGB && sample_type == RL2_SAMPLE_UINT16)
+ TIFFSetField (destination->out, TIFFTAG_PLANARCONFIG,
+ PLANARCONFIG_SEPARATE);
+ else
+ TIFFSetField (destination->out, TIFFTAG_PLANARCONFIG,
+ PLANARCONFIG_CONTIG);
+ TIFFSetField (destination->out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ /* MONOCHROME */
+ destination->sampleFormat = SAMPLEFORMAT_UINT;
+ destination->bitsPerSample = 1;
+ destination->samplesPerPixel = 1;
+ destination->photometric = PHOTOMETRIC_MINISWHITE;
+ TIFFSetField (destination->out, TIFFTAG_SAMPLEFORMAT,
+ SAMPLEFORMAT_UINT);
+ TIFFSetField (destination->out, TIFFTAG_SAMPLESPERPIXEL, 1);
+ TIFFSetField (destination->out, TIFFTAG_BITSPERSAMPLE, 1);
+ TIFFSetField (destination->out, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
+ TIFFSetField (destination->out, TIFFTAG_PHOTOMETRIC,
+ PHOTOMETRIC_MINISWHITE);
+ if (tiff_compression == RL2_COMPRESSION_CCITTFAX3)
+ {
+ destination->compression = COMPRESSION_CCITTFAX3;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_CCITTFAX3);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_CCITTFAX4)
+ {
+ destination->compression = COMPRESSION_CCITTFAX4;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_CCITTFAX4);
+ }
+ else
+ {
+ destination->compression = COMPRESSION_NONE;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_NONE);
+ }
+ goto header_done;
+ }
+ else if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ /* PALETTE */
+ unsigned short max_palette;
+ unsigned char *red;
+ unsigned char *green;
+ unsigned char *blue;
+ if (rl2_get_palette_colors
+ (plt, &max_palette, &red, &green, &blue) == RL2_ERROR)
+ {
+ fprintf (stderr, "RL2-TIFF writer: invalid Palette\n");
+ goto error;
+ }
+ for (i = 0; i < 256; i++)
+ {
+ r_plt[i] = 0;
+ g_plt[i] = 0;
+ b_plt[i] = 0;
+ }
+ for (i = 0; i < max_palette; i++)
+ {
+ r_plt[i] = red[i] * 256;
+ g_plt[i] = green[i] * 256;
+ b_plt[i] = blue[i] * 256;
+ }
+ rl2_free (red);
+ rl2_free (green);
+ rl2_free (blue);
+ destination->sampleFormat = SAMPLEFORMAT_UINT;
+ destination->bitsPerSample = 8;
+ destination->samplesPerPixel = 1;
+ destination->photometric = PHOTOMETRIC_PALETTE;
+ TIFFSetField (destination->out, TIFFTAG_SAMPLEFORMAT,
+ SAMPLEFORMAT_UINT);
+ TIFFSetField (destination->out, TIFFTAG_SAMPLESPERPIXEL, 1);
+ TIFFSetField (destination->out, TIFFTAG_BITSPERSAMPLE, 8);
+ TIFFSetField (destination->out, TIFFTAG_PHOTOMETRIC,
+ PHOTOMETRIC_PALETTE);
+ TIFFSetField (destination->out, TIFFTAG_COLORMAP, r_plt, g_plt,
+ b_plt);
+ if (tiff_compression == RL2_COMPRESSION_LZW)
+ {
+ destination->compression = COMPRESSION_LZW;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_LZW);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_DEFLATE)
+ {
+ destination->compression = COMPRESSION_DEFLATE;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_DEFLATE);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_LZMA)
+ {
+ destination->compression = COMPRESSION_LZMA;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_LZMA);
+ }
+ else
+ {
+ destination->compression = COMPRESSION_NONE;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_NONE);
+ }
+ goto header_done;
+ }
+ else if (pixel_type == RL2_PIXEL_GRAYSCALE)
+ {
+ /* GRAYSCALE */
+ destination->sampleFormat = SAMPLEFORMAT_UINT;
+ destination->bitsPerSample = 8;
+ destination->samplesPerPixel = 1;
+ destination->photometric = PHOTOMETRIC_MINISBLACK;
+ TIFFSetField (destination->out, TIFFTAG_SAMPLEFORMAT,
+ SAMPLEFORMAT_UINT);
+ TIFFSetField (destination->out, TIFFTAG_SAMPLESPERPIXEL, 1);
+ TIFFSetField (destination->out, TIFFTAG_BITSPERSAMPLE, 8);
+ TIFFSetField (destination->out, TIFFTAG_PHOTOMETRIC,
+ PHOTOMETRIC_MINISBLACK);
+ if (tiff_compression == RL2_COMPRESSION_LZW)
+ {
+ destination->compression = COMPRESSION_LZW;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_LZW);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_DEFLATE)
+ {
+ destination->compression = COMPRESSION_DEFLATE;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_DEFLATE);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_LZMA)
+ {
+ destination->compression = COMPRESSION_LZMA;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_LZMA);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_JPEG)
+ {
+ destination->compression = COMPRESSION_JPEG;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_JPEG);
+ }
+ else
+ {
+ destination->compression = COMPRESSION_NONE;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_NONE);
+ }
+ goto header_done;
+ }
+ else if (pixel_type == RL2_PIXEL_RGB)
+ {
+ /* RGB */
+ destination->sampleFormat = SAMPLEFORMAT_UINT;
+ if (sample_type == RL2_SAMPLE_UINT16)
+ destination->bitsPerSample = 16;
+ else
+ destination->bitsPerSample = 8;
+ destination->samplesPerPixel = 3;
+ destination->photometric = PHOTOMETRIC_RGB;
+ TIFFSetField (destination->out, TIFFTAG_SAMPLEFORMAT,
+ SAMPLEFORMAT_UINT);
+ TIFFSetField (destination->out, TIFFTAG_SAMPLESPERPIXEL, 3);
+ TIFFSetField (destination->out, TIFFTAG_BITSPERSAMPLE,
+ destination->bitsPerSample);
+ TIFFSetField (destination->out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
+ if (tiff_compression == RL2_COMPRESSION_LZW)
+ {
+ destination->compression = COMPRESSION_LZW;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_LZW);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_DEFLATE)
+ {
+ destination->compression = COMPRESSION_DEFLATE;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_DEFLATE);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_LZMA)
+ {
+ destination->compression = COMPRESSION_LZMA;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_LZMA);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_JPEG)
+ {
+ destination->compression = COMPRESSION_JPEG;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_JPEG);
+ }
+ else
+ {
+ destination->compression = COMPRESSION_NONE;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_NONE);
+ }
+ goto header_done;
+ }
+ else if (pixel_type == RL2_PIXEL_DATAGRID)
+ {
+ /* GRID data */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_INT32:
+ destination->sampleFormat = SAMPLEFORMAT_INT;
+ TIFFSetField (destination->out, TIFFTAG_SAMPLEFORMAT,
+ SAMPLEFORMAT_INT);
+ break;
+ case RL2_SAMPLE_UINT8:
+ case RL2_SAMPLE_UINT16:
+ case RL2_SAMPLE_UINT32:
+ destination->sampleFormat = SAMPLEFORMAT_UINT;
+ TIFFSetField (destination->out, TIFFTAG_SAMPLEFORMAT,
+ SAMPLEFORMAT_UINT);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ case RL2_SAMPLE_DOUBLE:
+ destination->sampleFormat = SAMPLEFORMAT_IEEEFP;
+ TIFFSetField (destination->out, TIFFTAG_SAMPLEFORMAT,
+ SAMPLEFORMAT_IEEEFP);
+ break;
+ };
+ destination->samplesPerPixel = 1;
+ TIFFSetField (destination->out, TIFFTAG_SAMPLESPERPIXEL, 1);
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ case RL2_SAMPLE_UINT8:
+ destination->bitsPerSample = 8;
+ TIFFSetField (destination->out, TIFFTAG_BITSPERSAMPLE, 8);
+ break;
+ case RL2_SAMPLE_INT16:
+ case RL2_SAMPLE_UINT16:
+ destination->bitsPerSample = 16;
+ TIFFSetField (destination->out, TIFFTAG_BITSPERSAMPLE, 16);
+ break;
+ case RL2_SAMPLE_INT32:
+ case RL2_SAMPLE_UINT32:
+ destination->bitsPerSample = 32;
+ TIFFSetField (destination->out, TIFFTAG_BITSPERSAMPLE, 32);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ destination->bitsPerSample = 32;
+ TIFFSetField (destination->out, TIFFTAG_BITSPERSAMPLE, 32);
+ break;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ destination->bitsPerSample = 64;
+ TIFFSetField (destination->out, TIFFTAG_BITSPERSAMPLE, 64);
+ break;
+ }
+ destination->photometric = PHOTOMETRIC_MINISBLACK;
+ TIFFSetField (destination->out, TIFFTAG_PHOTOMETRIC,
+ PHOTOMETRIC_MINISBLACK);
+ if (tiff_compression == RL2_COMPRESSION_LZW)
+ {
+ destination->compression = COMPRESSION_LZW;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_LZW);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_DEFLATE)
+ {
+ destination->compression = COMPRESSION_DEFLATE;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_DEFLATE);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_LZMA)
+ {
+ destination->compression = COMPRESSION_LZMA;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_LZMA);
+ }
+ else
+ {
+ destination->compression = COMPRESSION_NONE;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_NONE);
+ }
+ }
+ else if (pixel_type == RL2_PIXEL_MULTIBAND)
+ {
+ /* MULTIBAND */
+ destination->sampleFormat = SAMPLEFORMAT_UINT;
+ if (sample_type == RL2_SAMPLE_UINT8)
+ destination->bitsPerSample = 8;
+ else if (sample_type == RL2_SAMPLE_UINT16)
+ destination->bitsPerSample = 16;
+ else
+ goto error;
+ destination->samplesPerPixel = num_bands;
+ if (num_bands == 2)
+ destination->photometric = PHOTOMETRIC_MINISBLACK;
+ else
+ destination->photometric = PHOTOMETRIC_RGB;
+ TIFFSetField (destination->out, TIFFTAG_SAMPLEFORMAT,
+ SAMPLEFORMAT_UINT);
+ TIFFSetField (destination->out, TIFFTAG_SAMPLESPERPIXEL,
+ destination->samplesPerPixel);
+ if (num_bands == 2)
+ {
+ uint16 extra[1];
+ extra[0] = EXTRASAMPLE_UNSPECIFIED;
+ TIFFSetField (destination->out, TIFFTAG_EXTRASAMPLES, 1,
+ &extra);
+ }
+ if (num_bands > 3)
+ {
+ int n_extra = num_bands - 3;
+ int i_extra;
+ uint16 extra[256];
+ for (i_extra = 0; i_extra < n_extra; i_extra++)
+ extra[i_extra] = EXTRASAMPLE_UNSPECIFIED;
+ TIFFSetField (destination->out, TIFFTAG_EXTRASAMPLES, n_extra,
+ &extra);
+ }
+ TIFFSetField (destination->out, TIFFTAG_BITSPERSAMPLE,
+ destination->bitsPerSample);
+ TIFFSetField (destination->out, TIFFTAG_PHOTOMETRIC,
+ destination->photometric);
+ if (tiff_compression == RL2_COMPRESSION_LZW)
+ {
+ destination->compression = COMPRESSION_LZW;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_LZW);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_DEFLATE)
+ {
+ destination->compression = COMPRESSION_DEFLATE;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_DEFLATE);
+ }
+ else if (tiff_compression == RL2_COMPRESSION_LZMA)
+ {
+ destination->compression = COMPRESSION_LZMA;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_LZMA);
+ }
+ else
+ {
+ destination->compression = COMPRESSION_NONE;
+ TIFFSetField (destination->out, TIFFTAG_COMPRESSION,
+ COMPRESSION_NONE);
+ }
+ goto header_done;
+ }
+ else
+ goto error;
+
+ header_done:
+ TIFFSetField (destination->out, TIFFTAG_SOFTWARE, "RasterLite-2");
+ if (destination->isTiled)
+ {
+ TIFFSetField (destination->out, TIFFTAG_TILEWIDTH,
+ destination->tileWidth);
+ TIFFSetField (destination->out, TIFFTAG_TILELENGTH,
+ destination->tileHeight);
+ }
+ else
+ {
+ if (tiff_compression == RL2_COMPRESSION_JPEG)
+ TIFFSetField (destination->out, TIFFTAG_ROWSPERSTRIP, 8);
+ else
+ TIFFSetField (destination->out, TIFFTAG_ROWSPERSTRIP, 1);
+ }
+
+/* allocating the TIFF write buffer */
+ if (destination->isTiled)
+ buf_size = TIFFTileSize (destination->out);
+ else
+ buf_size = TIFFScanlineSize (destination->out);
+ tiff_buffer = malloc (buf_size);
+ if (!tiff_buffer)
+ goto error;
+ destination->tiffBuffer = tiff_buffer;
+
+/* NULL georeferencing */
+ destination->Srid = -1;
+ destination->hResolution = DBL_MAX;
+ destination->vResolution = DBL_MAX;
+ destination->srsName = NULL;
+ destination->proj4text = NULL;
+ destination->minX = DBL_MAX;
+ destination->minY = DBL_MAX;
+ destination->maxX = DBL_MAX;
+ destination->maxY = DBL_MAX;
+ destination->tfw_path = NULL;
+
+ return 1;
+ error:
+ return 0;
+}
+
+RL2_DECLARE rl2TiffDestinationPtr
+rl2_create_tiff_destination (const char *path, unsigned int width,
+ unsigned int height, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_bands,
+ rl2PalettePtr plt, unsigned char tiff_compression,
+ int tiled, unsigned int tile_size)
+{
+/* attempting to create a file-based TIFF destination (no georeferencing) */
+ rl2PrivTiffDestinationPtr destination = NULL;
+ if (!check_color_model
+ (sample_type, pixel_type, num_bands, plt, tiff_compression))
+ {
+ fprintf (stderr, "RL2-TIFF writer: unsupported pixel format\n");
+ return NULL;
+ }
+
+ destination = create_tiff_destination (path, 0);
+ if (destination == NULL)
+ return NULL;
+
+ destination->width = width;
+ destination->height = height;
+ if (tiled)
+ {
+ destination->isTiled = 1;
+ destination->tileWidth = tile_size;
+ destination->tileHeight = tile_size;
+ }
+ else
+ {
+ destination->isTiled = 0;
+ destination->rowsPerStrip = 1;
+ }
+
+/* suppressing TIFF messages */
+ TIFFSetErrorHandler (NULL);
+ TIFFSetWarningHandler (NULL);
+
+/* creating a TIFF file */
+ destination->out = TIFFOpen (destination->path, "w");
+ if (destination->out == NULL)
+ goto error;
+
+ if (!set_tiff_destination
+ (destination, width, height, sample_type, pixel_type, num_bands, plt,
+ tiff_compression))
+ goto error;
+
+ return (rl2TiffDestinationPtr) destination;
+ error:
+ if (destination != NULL)
+ rl2_destroy_tiff_destination ((rl2TiffDestinationPtr) destination);
+ return NULL;
+}
+
+static int
+is_projected_srs (const char *proj4text)
+{
+/* checks if this one is a PCS SRS */
+ if (proj4text == NULL)
+ return 0;
+ if (strstr (proj4text, "+proj=longlat ") != NULL)
+ return 0;
+ return 1;
+}
+
+static void
+fetch_crs_params (sqlite3 * handle, int srid, char **srs_name, char **proj4text)
+{
+ int ret;
+ char **results;
+ int rows;
+ int columns;
+ int i;
+ char *sql = sqlite3_mprintf ("SELECT ref_sys_name, proj4text "
+ "FROM spatial_ref_sys WHERE srid = %d\n",
+ srid);
+ *srs_name = NULL;
+ *proj4text = NULL;
+ ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return;
+ for (i = 1; i <= rows; i++)
+ {
+ int len;
+ const char *name = results[(i * columns) + 0];
+ const char *proj4 = results[(i * columns) + 1];
+ if (name != NULL)
+ {
+ len = strlen (name);
+ *srs_name = malloc (len + 1);
+ strcpy (*srs_name, name);
+ }
+ if (proj4 != NULL)
+ {
+ len = strlen (proj4);
+ *proj4text = malloc (len + 1);
+ strcpy (*proj4text, proj4);
+ }
+ }
+ sqlite3_free_table (results);
+}
+
+static void
+destination_set_tfw_path (const char *path,
+ rl2PrivTiffDestinationPtr destination)
+{
+/* building the TFW path (WorldFile) */
+ char *tfw;
+ const char *x = NULL;
+ const char *p = path;
+ int len = strlen (path);
+ len -= 1;
+ while (*p != '\0')
+ {
+ if (*p == '.')
+ x = p;
+ p++;
+ }
+ if (x > path)
+ len = x - path;
+ tfw = malloc (len + 5);
+ memcpy (tfw, path, len);
+ memcpy (tfw + len, ".tfw", 4);
+ *(tfw + len + 4) = '\0';
+ destination->tfw_path = tfw;
+}
+
+RL2_DECLARE rl2TiffDestinationPtr
+rl2_create_geotiff_destination (const char *path, sqlite3 * handle,
+ unsigned int width, unsigned int height,
+ unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_bands, rl2PalettePtr plt,
+ unsigned char tiff_compression, int tiled,
+ unsigned int tile_size, int srid, double minX,
+ double minY, double maxX, double maxY,
+ double hResolution, double vResolution,
+ int with_worldfile)
+{
+/* attempting to create a file-based GeoTIFF destination */
+ rl2PrivTiffDestinationPtr destination = NULL;
+ double tiepoint[6];
+ double pixsize[3];
+ char *srs_name = NULL;
+ char *proj4text = NULL;
+ if (!check_color_model
+ (sample_type, pixel_type, num_bands, plt, tiff_compression))
+ {
+ fprintf (stderr, "RL2-GeoTIFF writer: unsupported pixel format\n");
+ return NULL;
+ }
+ if (handle == NULL)
+ return NULL;
+
+ destination = create_tiff_destination (path, 1);
+ if (destination == NULL)
+ return NULL;
+
+ destination->width = width;
+ destination->height = height;
+ if (tiled)
+ {
+ destination->isTiled = 1;
+ destination->tileWidth = tile_size;
+ destination->tileHeight = tile_size;
+ }
+ else
+ {
+ destination->isTiled = 0;
+ destination->rowsPerStrip = 1;
+ }
+
+/* suppressing TIFF messages */
+ TIFFSetErrorHandler (NULL);
+ TIFFSetWarningHandler (NULL);
+
+/* creating a GeoTIFF file */
+ destination->out = XTIFFOpen (destination->path, "w");
+ if (destination->out == NULL)
+ goto error;
+ destination->gtif = GTIFNew (destination->out);
+ if (destination->gtif == NULL)
+ goto error;
+
+ if (!set_tiff_destination
+ (destination, width, height, sample_type, pixel_type, num_bands, plt,
+ tiff_compression))
+ goto error;
+
+/* attempting to retrieve the CRS params */
+ fetch_crs_params (handle, srid, &srs_name, &proj4text);
+ if (srs_name == NULL || proj4text == NULL)
+ goto error;
+
+/* setting georeferencing infos */
+ destination->Srid = srid;
+ destination->hResolution = hResolution;
+ destination->vResolution = vResolution;
+ destination->srsName = srs_name;
+ destination->proj4text = proj4text;
+ destination->minX = minX;
+ destination->minY = minY;
+ destination->maxX = maxX;
+ destination->maxY = maxY;
+ destination->tfw_path = NULL;
+ if (with_worldfile)
+ destination_set_tfw_path (path, destination);
+
+/* setting up the GeoTIFF Tags */
+ pixsize[0] = hResolution;
+ pixsize[1] = vResolution;
+ pixsize[2] = 0.0;
+ TIFFSetField (destination->out, GTIFF_PIXELSCALE, 3, pixsize);
+ tiepoint[0] = 0.0;
+ tiepoint[1] = 0.0;
+ tiepoint[2] = 0.0;
+ tiepoint[3] = minX;
+ tiepoint[4] = maxY;
+ tiepoint[5] = 0.0;
+ TIFFSetField (destination->out, GTIFF_TIEPOINTS, 6, tiepoint);
+ if (srs_name != NULL)
+ TIFFSetField (destination->out, GTIFF_ASCIIPARAMS, srs_name);
+ if (proj4text != NULL)
+ GTIFSetFromProj4 (destination->gtif, proj4text);
+ if (srs_name != NULL)
+ GTIFKeySet (destination->gtif, GTCitationGeoKey, TYPE_ASCII, 0,
+ srs_name);
+ if (is_projected_srs (proj4text))
+ GTIFKeySet (destination->gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1,
+ srid);
+ GTIFWriteKeys (destination->gtif);
+ destination->isGeoReferenced = 1;
+
+ return (rl2TiffDestinationPtr) destination;
+ error:
+ if (destination != NULL)
+ rl2_destroy_tiff_destination ((rl2TiffDestinationPtr) destination);
+ if (srs_name != NULL)
+ free (srs_name);
+ if (proj4text != NULL)
+ free (proj4text);
+ return NULL;
+}
+
+RL2_DECLARE rl2TiffDestinationPtr
+rl2_create_tiff_worldfile_destination (const char *path, unsigned int width,
+ unsigned int height,
+ unsigned char sample_type,
+ unsigned char pixel_type,
+ unsigned char num_bands,
+ rl2PalettePtr plt,
+ unsigned char tiff_compression,
+ int tiled, unsigned int tile_size,
+ int srid, double minX, double minY,
+ double maxX, double maxY,
+ double hResolution, double vResolution)
+{
+/* attempting to create a file-based TIFF destination (with worldfile) */
+ rl2TiffDestinationPtr destination =
+ rl2_create_tiff_destination (path, width, height, sample_type,
+ pixel_type, num_bands,
+ plt, tiff_compression, tiled, tile_size);
+ rl2PrivTiffDestinationPtr tiff = (rl2PrivTiffDestinationPtr) destination;
+ if (tiff == NULL)
+ return NULL;
+/* setting georeferencing infos */
+ tiff->Srid = srid;
+ tiff->hResolution = hResolution;
+ tiff->vResolution = vResolution;
+ tiff->srsName = NULL;
+ tiff->proj4text = NULL;
+ tiff->minX = minX;
+ tiff->minY = minY;
+ tiff->maxX = maxX;
+ tiff->maxY = maxY;
+ tiff->tfw_path = NULL;
+ destination_set_tfw_path (path, tiff);
+ tiff->isGeoReferenced = 1;
+ return destination;
+}
+
+RL2_DECLARE const char *
+rl2_get_tiff_destination_path (rl2TiffDestinationPtr tiff)
+{
+/* retrieving the output path from a TIFF destination */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return NULL;
+
+ return destination->path;
+}
+
+RL2_DECLARE const char *
+rl2_get_tiff_destination_worldfile_path (rl2TiffDestinationPtr tiff)
+{
+/* retrieving the Worldfile path from a TIFF destination */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return NULL;
+
+ return destination->tfw_path;
+}
+
+RL2_DECLARE int
+rl2_is_geotiff_destination (rl2TiffDestinationPtr tiff, int *geotiff)
+{
+/* detecting if a TIFF destination actually is a GeoTIFF */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+ *geotiff = destination->isGeoTiff;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_tiff_worldfile_destination (rl2TiffDestinationPtr tiff,
+ int *tiff_worldfile)
+{
+/* detecting if a TIFF destination actually supports a TFW */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+ *tiff_worldfile = 0;
+ if (destination->tfw_path != NULL)
+ *tiff_worldfile = 1;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_destination_size (rl2TiffDestinationPtr tiff,
+ unsigned int *width, unsigned int *height)
+{
+/* retrieving Width and Height from a TIFF destination */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+
+ *width = destination->width;
+ *height = destination->height;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_destination_srid (rl2TiffDestinationPtr tiff, int *srid)
+{
+/* retrieving the SRID from a TIFF destination */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+ if (destination->isGeoReferenced == 0)
+ return RL2_ERROR;
+
+ *srid = destination->Srid;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_destination_extent (rl2TiffDestinationPtr tiff, double *minX,
+ double *minY, double *maxX, double *maxY)
+{
+/* retrieving the Extent from a TIFF destination */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+ if (destination->isGeoReferenced == 0)
+ return RL2_ERROR;
+
+ *minX = destination->minX;
+ *minY = destination->minY;
+ *maxX = destination->maxX;
+ *maxY = destination->maxY;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_destination_resolution (rl2TiffDestinationPtr tiff,
+ double *hResolution, double *vResolution)
+{
+/* retrieving the Pixel Resolution from a TIFF destination */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+ if (destination->isGeoReferenced == 0)
+ return RL2_ERROR;
+
+ *hResolution = destination->hResolution;
+ *vResolution = destination->vResolution;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_destination_type (rl2TiffDestinationPtr tiff,
+ unsigned char *sample_type,
+ unsigned char *pixel_type,
+ unsigned char *alias_pixel_type,
+ unsigned char *num_bands)
+{
+/* retrieving the sample/pixel type from a TIFF destination */
+ int ok = 0;
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+
+ if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < PHOTOMETRIC_RGB)
+ {
+ /* could be some kind of MONOCHROME */
+ if (destination->bitsPerSample == 1)
+ {
+ *sample_type = RL2_SAMPLE_1_BIT;
+ ok = 1;
+ }
+ if (ok)
+ {
+ *pixel_type = RL2_PIXEL_MONOCHROME;
+ *alias_pixel_type = RL2_PIXEL_MONOCHROME;
+ *num_bands = 1;
+ return RL2_OK;
+ }
+ }
+ if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < PHOTOMETRIC_RGB)
+ {
+ /* could be some kind of GRAYSCALE */
+ if (destination->bitsPerSample == 2)
+ {
+ *sample_type = RL2_SAMPLE_2_BIT;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 4)
+ {
+ *sample_type = RL2_SAMPLE_4_BIT;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 8)
+ {
+ *sample_type = RL2_SAMPLE_UINT8;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 16)
+ {
+ *sample_type = RL2_SAMPLE_UINT16;
+ ok = 1;
+ }
+ if (ok)
+ {
+ *pixel_type = RL2_PIXEL_GRAYSCALE;
+ *alias_pixel_type = RL2_PIXEL_GRAYSCALE;
+ if (destination->bitsPerSample == 8
+ || destination->bitsPerSample == 16)
+ *alias_pixel_type = RL2_PIXEL_DATAGRID;
+ *num_bands = 1;
+ return RL2_OK;
+ }
+ }
+ if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric == PHOTOMETRIC_PALETTE)
+ {
+ /* could be some kind of PALETTE */
+ if (destination->bitsPerSample == 1)
+ {
+ *sample_type = RL2_SAMPLE_1_BIT;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 2)
+ {
+ *sample_type = RL2_SAMPLE_2_BIT;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 4)
+ {
+ *sample_type = RL2_SAMPLE_4_BIT;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 8)
+ {
+ *sample_type = RL2_SAMPLE_UINT8;
+ ok = 1;
+ }
+ if (ok)
+ {
+ *pixel_type = RL2_PIXEL_PALETTE;
+ *alias_pixel_type = RL2_PIXEL_PALETTE;
+ *num_bands = 1;
+ return RL2_OK;
+ }
+ }
+ if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 3
+ && destination->photometric == PHOTOMETRIC_RGB)
+ {
+ /* could be some kind of RGB */
+ if (destination->bitsPerSample == 8)
+ {
+ *sample_type = RL2_SAMPLE_UINT8;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 16)
+ {
+ *sample_type = RL2_SAMPLE_UINT16;
+ ok = 1;
+ }
+ if (ok)
+ {
+ *pixel_type = RL2_PIXEL_RGB;
+ *alias_pixel_type = RL2_PIXEL_RGB;
+ *num_bands = 3;
+ return RL2_OK;
+ }
+ }
+ if (destination->samplesPerPixel == 1
+ && destination->photometric < PHOTOMETRIC_RGB)
+ {
+ /* could be some kind of DATA-GRID */
+ if (destination->sampleFormat == SAMPLEFORMAT_INT)
+ {
+ /* Signed Integer */
+ if (destination->bitsPerSample == 8)
+ {
+ *sample_type = RL2_SAMPLE_INT8;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 16)
+ {
+ *sample_type = RL2_SAMPLE_INT16;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 32)
+ {
+ *sample_type = RL2_SAMPLE_INT32;
+ ok = 1;
+ }
+ }
+ if (destination->sampleFormat == SAMPLEFORMAT_UINT)
+ {
+ /* Unsigned Integer */
+ if (destination->bitsPerSample == 8)
+ {
+ *sample_type = RL2_SAMPLE_UINT8;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 16)
+ {
+ *sample_type = RL2_SAMPLE_UINT16;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 32)
+ {
+ *sample_type = RL2_SAMPLE_UINT32;
+ ok = 1;
+ }
+ }
+ if (destination->sampleFormat == SAMPLEFORMAT_IEEEFP)
+ {
+ /* Floating-Point */
+ if (destination->bitsPerSample == 32)
+ {
+ *sample_type = RL2_SAMPLE_FLOAT;
+ ok = 1;
+ }
+ else if (destination->bitsPerSample == 64)
+ {
+ *sample_type = RL2_SAMPLE_DOUBLE;
+ ok = 1;
+ }
+ }
+ if (ok)
+ {
+ *pixel_type = RL2_PIXEL_DATAGRID;
+ *alias_pixel_type = RL2_PIXEL_DATAGRID;
+ *num_bands = 1;
+ return RL2_OK;
+ }
+ }
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_destination_compression (rl2TiffDestinationPtr tiff,
+ unsigned char *compression)
+{
+/* retrieving the sample/pixel type from a TIFF destination */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+
+ switch (destination->compression)
+ {
+ case COMPRESSION_NONE:
+ *compression = RL2_COMPRESSION_NONE;
+ break;
+ case COMPRESSION_LZW:
+ *compression = RL2_COMPRESSION_LZW;
+ break;
+ case COMPRESSION_DEFLATE:
+ *compression = RL2_COMPRESSION_DEFLATE;
+ break;
+ case COMPRESSION_LZMA:
+ *compression = RL2_COMPRESSION_LZMA;
+ break;
+ case COMPRESSION_JPEG:
+ *compression = RL2_COMPRESSION_JPEG;
+ break;
+ case COMPRESSION_CCITTFAX3:
+ *compression = RL2_COMPRESSION_CCITTFAX3;
+ break;
+ case COMPRESSION_CCITTFAX4:
+ *compression = RL2_COMPRESSION_CCITTFAX4;
+ break;
+ default:
+ *compression = RL2_COMPRESSION_UNKNOWN;
+ break;
+ }
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_is_tiled_tiff_destination (rl2TiffDestinationPtr tiff, int *is_tiled)
+{
+/* testing if the TIFF Destination is tiled or not */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+ *is_tiled = destination->isTiled;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_destination_tile_size (rl2TiffDestinationPtr tiff,
+ unsigned int *tile_width,
+ unsigned int *tile_height)
+{
+/* attempting to return the Tile dimensions */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+ if (destination->isTiled == 0)
+ return RL2_ERROR;
+ *tile_width = destination->tileWidth;
+ *tile_height = destination->tileHeight;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_get_tiff_destination_strip_size (rl2TiffDestinationPtr tiff,
+ unsigned int *strip_size)
+{
+/* attempting to return the Strip dimension */
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+ if (destination->isTiled != 0)
+ return RL2_ERROR;
+ *strip_size = destination->rowsPerStrip;
+ return RL2_OK;
+}
+
+static int
+tiff_write_strip_rgb (rl2PrivTiffDestinationPtr tiff, rl2PrivRasterPtr raster,
+ unsigned int row)
+{
+/* writing a TIFF RGB scanline */
+ unsigned int x;
+ unsigned char *p_in = raster->rasterBuffer;
+ unsigned char *p_out = tiff->tiffBuffer;
+
+ for (x = 0; x < raster->width; x++)
+ {
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ if (raster->nBands == 4)
+ p_in++;
+ }
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_strip_gray (rl2PrivTiffDestinationPtr tiff, rl2PrivRasterPtr raster,
+ unsigned int row)
+{
+/* writing a TIFF Grayscale scanline */
+ unsigned int x;
+ unsigned char *p_in = raster->rasterBuffer;
+ unsigned char *p_out = tiff->tiffBuffer;
+
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_strip_palette (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row)
+{
+/* writing a TIFF Palette scanline */
+ unsigned int x;
+ unsigned char *p_in = raster->rasterBuffer;
+ unsigned char *p_out = tiff->tiffBuffer;
+
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_strip_monochrome (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row)
+{
+/* writing a TIFF Monochrome */
+ unsigned int x;
+ unsigned char byte;
+ unsigned char pixel;
+ int pos;
+ unsigned char *p_in = raster->rasterBuffer;
+ unsigned char *p_out = tiff->tiffBuffer;
+
+/* priming a White scanline */
+ for (x = 0; x < TIFFScanlineSize (tiff->out); x++)
+ *p_out++ = 0x00;
+
+/* inserting pixels */
+ pos = 0;
+ byte = 0x00;
+ p_out = tiff->tiffBuffer;
+ for (x = 0; x < raster->width; x++)
+ {
+ pixel = *p_in++;
+ if (pixel == 1)
+ {
+ /* handling a black pixel */
+ switch (pos)
+ {
+ case 0:
+ byte |= 0x80;
+ break;
+ case 1:
+ byte |= 0x40;
+ break;
+ case 2:
+ byte |= 0x20;
+ break;
+ case 3:
+ byte |= 0x10;
+ break;
+ case 4:
+ byte |= 0x08;
+ break;
+ case 5:
+ byte |= 0x04;
+ break;
+ case 6:
+ byte |= 0x02;
+ break;
+ case 7:
+ byte |= 0x01;
+ break;
+ };
+ }
+ pos++;
+ if (pos > 7)
+ {
+ /* exporting an octet */
+ *p_out++ = byte;
+ byte = 0x00;
+ pos = 0;
+ }
+ }
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_strip_int8 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row)
+{
+/* writing a TIFF Grid Int8 scanline */
+ unsigned int x;
+ char *p_in = (char *) (raster->rasterBuffer);
+ char *p_out = (char *) (tiff->tiffBuffer);
+
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_strip_uint8 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row)
+{
+/* writing a TIFF Grid UInt8 scanline */
+ unsigned int x;
+ unsigned char *p_in = raster->rasterBuffer;
+ unsigned char *p_out = tiff->tiffBuffer;
+
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_strip_int16 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row)
+{
+/* writing a TIFF Grid Int16 scanline */
+ unsigned int x;
+ short *p_in = (short *) (raster->rasterBuffer);
+ short *p_out = (short *) (tiff->tiffBuffer);
+
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_strip_uint16 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row)
+{
+/* writing a TIFF Grid UInt16 scanline */
+ unsigned int x;
+ unsigned short *p_in = (unsigned short *) (raster->rasterBuffer);
+ unsigned short *p_out = (unsigned short *) (tiff->tiffBuffer);
+
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_strip_int32 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row)
+{
+/* writing a TIFF Grid Int32 scanline */
+ unsigned int x;
+ int *p_in = (int *) (raster->rasterBuffer);
+ int *p_out = (int *) (tiff->tiffBuffer);
+
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_strip_uint32 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row)
+{
+/* writing a TIFF Grid UInt32 scanline */
+ unsigned int x;
+ unsigned int *p_in = (unsigned int *) (raster->rasterBuffer);
+ unsigned int *p_out = (unsigned int *) (tiff->tiffBuffer);
+
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_strip_float (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row)
+{
+/* writing a TIFF Grid Float scanline */
+ unsigned int x;
+ float *p_in = (float *) (raster->rasterBuffer);
+ float *p_out = (float *) (tiff->tiffBuffer);
+
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_strip_double (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row)
+{
+/* writing a TIFF Grid Double scanline */
+ unsigned int x;
+ double *p_in = (double *) (raster->rasterBuffer);
+ double *p_out = (double *) (tiff->tiffBuffer);
+
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ if (TIFFWriteScanline (tiff->out, tiff->tiffBuffer, row, 0) < 0)
+ return 0;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_write_tiff_scanline (rl2TiffDestinationPtr tiff, rl2RasterPtr raster,
+ unsigned int row)
+{
+/* writing a TIFF scanline */
+ int ret = 0;
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) raster;
+ if (tiff == NULL)
+ return RL2_ERROR;
+ if (rst == NULL)
+ return RL2_ERROR;
+
+ if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 3 && destination->photometric == 2
+ && destination->bitsPerSample == 8
+ && rst->sampleType == RL2_SAMPLE_UINT8
+ && rst->pixelType == RL2_PIXEL_RGB && (rst->nBands == 3
+ || rst->nBands == 4)
+ && destination->width == rst->width)
+ ret = tiff_write_strip_rgb (destination, rst, row);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 8
+ && rst->sampleType == RL2_SAMPLE_UINT8
+ && rst->pixelType == RL2_PIXEL_GRAYSCALE && rst->nBands == 1
+ && destination->width == rst->width)
+ ret = tiff_write_strip_gray (destination, rst, row);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric == 3
+ && destination->bitsPerSample == 8
+ && rst->sampleType == RL2_SAMPLE_UINT8
+ && rst->pixelType == RL2_PIXEL_PALETTE && rst->nBands == 1
+ && destination->width == rst->width)
+ ret = tiff_write_strip_palette (destination, rst, row);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 1
+ && rst->sampleType == RL2_SAMPLE_1_BIT
+ && rst->pixelType == RL2_PIXEL_MONOCHROME && rst->nBands == 1
+ && destination->width == rst->width)
+ ret = tiff_write_strip_monochrome (destination, rst, row);
+ else if (destination->sampleFormat == SAMPLEFORMAT_INT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 8
+ && rst->sampleType == RL2_SAMPLE_INT8
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->width == rst->width)
+ ret = tiff_write_strip_int8 (destination, rst, row);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 8
+ && rst->sampleType == RL2_SAMPLE_UINT8
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->width == rst->width)
+ ret = tiff_write_strip_uint8 (destination, rst, row);
+ else if (destination->sampleFormat == SAMPLEFORMAT_INT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 16
+ && rst->sampleType == RL2_SAMPLE_INT16
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->width == rst->width)
+ ret = tiff_write_strip_int16 (destination, rst, row);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 16
+ && rst->sampleType == RL2_SAMPLE_UINT16
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->width == rst->width)
+ ret = tiff_write_strip_uint16 (destination, rst, row);
+ else if (destination->sampleFormat == SAMPLEFORMAT_INT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 32
+ && rst->sampleType == RL2_SAMPLE_INT32
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->width == rst->width)
+ ret = tiff_write_strip_int32 (destination, rst, row);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 32
+ && rst->sampleType == RL2_SAMPLE_UINT32
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->width == rst->width)
+ ret = tiff_write_strip_uint32 (destination, rst, row);
+ else if (destination->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 32
+ && rst->sampleType == RL2_SAMPLE_FLOAT
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->width == rst->width)
+ ret = tiff_write_strip_float (destination, rst, row);
+ else if (destination->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 64
+ && rst->sampleType == RL2_SAMPLE_DOUBLE
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->width == rst->width)
+ ret = tiff_write_strip_double (destination, rst, row);
+
+ if (ret)
+ return RL2_OK;
+ return RL2_ERROR;
+}
+
+static int
+tiff_write_tile_multiband8 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF MULTIBAND UINT8 tile - separate planes */
+ unsigned int y;
+ unsigned int x;
+ int band;
+
+ for (band = 0; band < raster->nBands; band++)
+ {
+ /* handling separate planes - one for each band */
+ unsigned char *p_in = raster->rasterBuffer;
+ unsigned char *p_out = tiff->tiffBuffer;
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ {
+ *p_out++ = *(p_in + band);
+ p_in += raster->nBands;
+ }
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, band) <
+ 0)
+ return 0;
+ }
+ return 1;
+}
+
+static int
+tiff_write_tile_multiband16 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF MULTIBAND UINT16 tile - separate planes */
+ unsigned int y;
+ unsigned int x;
+ int band;
+
+ for (band = 0; band < raster->nBands; band++)
+ {
+ /* handling separate planes - one for each band */
+ unsigned short *p_in = (unsigned short *) (raster->rasterBuffer);
+ unsigned short *p_out = (unsigned short *) (tiff->tiffBuffer);
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ {
+ *p_out++ = *(p_in + band);
+ p_in += raster->nBands;
+ }
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, band) <
+ 0)
+ return 0;
+ }
+ return 1;
+}
+
+static int
+tiff_write_tile_rgb_u8 (rl2PrivTiffDestinationPtr tiff, rl2PrivRasterPtr raster,
+ unsigned int row, unsigned int col)
+{
+/* writing a TIFF RGB tile - UINT8 */
+ unsigned int y;
+ unsigned int x;
+ unsigned char *p_in = raster->rasterBuffer;
+ unsigned char *p_out = tiff->tiffBuffer;
+
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ {
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ if (raster->nBands == 4)
+ p_in++;
+ }
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_tile_gray (rl2PrivTiffDestinationPtr tiff, rl2PrivRasterPtr raster,
+ unsigned int row, unsigned int col)
+{
+/* writing a TIFF Grayscale tile */
+ unsigned int y;
+ unsigned int x;
+ unsigned char *p_in = raster->rasterBuffer;
+ unsigned char *p_msk = raster->maskBuffer;
+ unsigned char *p_out = tiff->tiffBuffer;
+
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ {
+ if (p_msk == NULL)
+ {
+ /* there is no Transparency Mask - all opaque pixels */
+ *p_out++ = *p_in++;
+ }
+ else
+ {
+ if (*p_msk++ == 0)
+ {
+ /* transparent pixel */
+ p_out++;
+ }
+ else
+ *p_out++ = *p_in++;
+ }
+ }
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_tile_palette (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF Palette tile */
+ unsigned int y;
+ unsigned int x;
+ unsigned char *p_in = raster->rasterBuffer;
+ unsigned char *p_out = tiff->tiffBuffer;
+
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_tile_monochrome (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF Monochrome tile */
+ unsigned int y;
+ unsigned int x;
+ unsigned char byte;
+ unsigned char pixel;
+ int pos;
+ unsigned char *p_in = raster->rasterBuffer;
+ unsigned char *p_out = tiff->tiffBuffer;
+
+ /* priming a White tile */
+ for (x = 0; x < TIFFTileSize (tiff->out); x++)
+ *p_out++ = 0x00;
+ p_out = tiff->tiffBuffer;
+ for (y = 0; y < raster->height; y++)
+ {
+ /* inserting pixels */
+ pos = 0;
+ byte = 0x00;
+ for (x = 0; x < raster->width; x++)
+ {
+ pixel = *p_in++;
+ if (pixel == 1)
+ {
+ /* handling a black pixel */
+ switch (pos)
+ {
+ case 0:
+ byte |= 0x80;
+ break;
+ case 1:
+ byte |= 0x40;
+ break;
+ case 2:
+ byte |= 0x20;
+ break;
+ case 3:
+ byte |= 0x10;
+ break;
+ case 4:
+ byte |= 0x08;
+ break;
+ case 5:
+ byte |= 0x04;
+ break;
+ case 6:
+ byte |= 0x02;
+ break;
+ case 7:
+ byte |= 0x01;
+ break;
+ };
+ }
+ pos++;
+ if (pos > 7)
+ {
+ /* exporting an octet */
+ *p_out++ = byte;
+ byte = 0x00;
+ pos = 0;
+ }
+ }
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_tile_int8 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF Grid Int8 tile */
+ unsigned int y;
+ unsigned int x;
+ char *p_in = (char *) (raster->rasterBuffer);
+ char *p_out = (char *) (tiff->tiffBuffer);
+
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_tile_uint8 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF Grid UInt8 tile */
+ unsigned int y;
+ unsigned int x;
+ unsigned char *p_in = raster->rasterBuffer;
+ unsigned char *p_out = tiff->tiffBuffer;
+
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_tile_int16 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF Grid Int16 tile */
+ unsigned int y;
+ unsigned int x;
+ short *p_in = (short *) (raster->rasterBuffer);
+ short *p_out = (short *) (tiff->tiffBuffer);
+
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_tile_uint16 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF Grid UInt16 tile */
+ unsigned int y;
+ unsigned int x;
+ unsigned short *p_in = (unsigned short *) (raster->rasterBuffer);
+ unsigned short *p_out = (unsigned short *) (tiff->tiffBuffer);
+
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_tile_int32 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF Grid Int32 tile */
+ unsigned int y;
+ unsigned int x;
+ int *p_in = (int *) (raster->rasterBuffer);
+ int *p_out = (int *) (tiff->tiffBuffer);
+
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_tile_uint32 (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF Grid UInt32 tile */
+ unsigned int y;
+ unsigned int x;
+ unsigned int *p_in = (unsigned int *) (raster->rasterBuffer);
+ unsigned int *p_out = (unsigned int *) (tiff->tiffBuffer);
+
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_tile_float (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF Grid Float tile */
+ unsigned int y;
+ unsigned int x;
+ float *p_in = (float *) (raster->rasterBuffer);
+ float *p_out = (float *) (tiff->tiffBuffer);
+
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+static int
+tiff_write_tile_double (rl2PrivTiffDestinationPtr tiff,
+ rl2PrivRasterPtr raster, unsigned int row,
+ unsigned int col)
+{
+/* writing a TIFF Grid Double tile */
+ unsigned int y;
+ unsigned int x;
+ double *p_in = (double *) (raster->rasterBuffer);
+ double *p_out = (double *) (tiff->tiffBuffer);
+
+ for (y = 0; y < raster->height; y++)
+ {
+ for (x = 0; x < raster->width; x++)
+ *p_out++ = *p_in++;
+ }
+ if (TIFFWriteTile (tiff->out, tiff->tiffBuffer, col, row, 0, 0) < 0)
+ return 0;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_write_tiff_tile (rl2TiffDestinationPtr tiff, rl2RasterPtr raster,
+ unsigned int startRow, unsigned int startCol)
+{
+/* writing a TIFF tile */
+ int ret = 0;
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) raster;
+ if (tiff == NULL)
+ return RL2_ERROR;
+ if (rst == NULL)
+ return RL2_ERROR;
+
+ if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 3 && destination->photometric == 2
+ && destination->bitsPerSample == 8
+ && rst->sampleType == RL2_SAMPLE_UINT8
+ && rst->pixelType == RL2_PIXEL_RGB && (rst->nBands == 3
+ || rst->nBands == 4)
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_rgb_u8 (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 3
+ && destination->photometric == 2
+ && destination->bitsPerSample == 16
+ && rst->sampleType == RL2_SAMPLE_UINT16
+ && rst->pixelType == RL2_PIXEL_RGB && rst->nBands == 3
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret =
+ tiff_write_tile_multiband16 (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel >= 2
+ && destination->bitsPerSample == 8
+ && rst->sampleType == RL2_SAMPLE_UINT8
+ && rst->pixelType == RL2_PIXEL_MULTIBAND
+ && rst->nBands == destination->samplesPerPixel
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_multiband8 (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel >= 2
+ && destination->bitsPerSample == 16
+ && rst->sampleType == RL2_SAMPLE_UINT16
+ && rst->pixelType == RL2_PIXEL_MULTIBAND
+ && rst->nBands == destination->samplesPerPixel
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret =
+ tiff_write_tile_multiband16 (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2 && destination->bitsPerSample == 8
+ && rst->sampleType == RL2_SAMPLE_UINT8
+ && rst->pixelType == RL2_PIXEL_GRAYSCALE && rst->nBands == 1
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_gray (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric == 3
+ && destination->bitsPerSample == 8
+ && (rst->sampleType == RL2_SAMPLE_UINT8
+ || rst->sampleType == RL2_SAMPLE_1_BIT
+ || rst->sampleType == RL2_SAMPLE_2_BIT
+ || rst->sampleType == RL2_SAMPLE_4_BIT)
+ && rst->pixelType == RL2_PIXEL_PALETTE && rst->nBands == 1
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_palette (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 1
+ && rst->sampleType == RL2_SAMPLE_1_BIT
+ && rst->pixelType == RL2_PIXEL_MONOCHROME && rst->nBands == 1
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_monochrome (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_INT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 8
+ && rst->sampleType == RL2_SAMPLE_INT8
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_int8 (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 8
+ && rst->sampleType == RL2_SAMPLE_UINT8
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_uint8 (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_INT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 16
+ && rst->sampleType == RL2_SAMPLE_INT16
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_int16 (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 16
+ && rst->sampleType == RL2_SAMPLE_UINT16
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_uint16 (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_INT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 32
+ && rst->sampleType == RL2_SAMPLE_INT32
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_int32 (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_UINT
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 32
+ && rst->sampleType == RL2_SAMPLE_UINT32
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_uint32 (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 32
+ && rst->sampleType == RL2_SAMPLE_FLOAT
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_float (destination, rst, startRow, startCol);
+ else if (destination->sampleFormat == SAMPLEFORMAT_IEEEFP
+ && destination->samplesPerPixel == 1
+ && destination->photometric < 2
+ && destination->bitsPerSample == 64
+ && rst->sampleType == RL2_SAMPLE_DOUBLE
+ && rst->pixelType == RL2_PIXEL_DATAGRID && rst->nBands == 1
+ && destination->tileWidth == rst->width
+ && destination->tileHeight == rst->height)
+ ret = tiff_write_tile_double (destination, rst, startRow, startCol);
+
+ if (ret)
+ return RL2_OK;
+ return RL2_ERROR;
+}
+
+RL2_DECLARE int
+rl2_write_tiff_worldfile (rl2TiffDestinationPtr tiff)
+{
+/* writing a Worldfile supporting a TIFF destination */
+ FILE *tfw;
+ rl2PrivTiffDestinationPtr destination = (rl2PrivTiffDestinationPtr) tiff;
+ if (destination == NULL)
+ return RL2_ERROR;
+ if (destination->tfw_path == NULL)
+ return RL2_ERROR;
+
+ tfw = fopen (destination->tfw_path, "w");
+ if (tfw == NULL)
+ {
+ fprintf (stderr, "RL2-TIFF writer: unable to open Worldfile \"%s\"\n",
+ destination->tfw_path);
+ return RL2_ERROR;
+ }
+ fprintf (tfw, " %1.16f\n", destination->hResolution);
+ fprintf (tfw, " 0.0\n");
+ fprintf (tfw, " 0.0\n");
+ fprintf (tfw, " -%1.16f\n", destination->vResolution);
+ fprintf (tfw, " %1.16f\n", destination->minX);
+ fprintf (tfw, " %1.16f\n", destination->maxY);
+ fclose (tfw);
+ return RL2_OK;
+}
+
+static int
+compress_fax4 (const unsigned char *buffer,
+ unsigned short width,
+ unsigned short height, unsigned char **blob, int *blob_size)
+{
+/* compressing a TIFF FAX4 block - actual work */
+ struct memfile clientdata;
+ TIFF *out = (TIFF *) 0;
+ tsize_t buf_size;
+ void *tiff_buffer = NULL;
+ int y;
+ int x;
+ unsigned char byte;
+ unsigned char pixel;
+ int pos;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+
+/* suppressing TIFF warnings */
+ TIFFSetWarningHandler (NULL);
+
+/* writing into memory */
+ clientdata.buffer = NULL;
+ clientdata.malloc_block = 1024;
+ clientdata.size = 0;
+ clientdata.eof = 0;
+ clientdata.current = 0;
+ out = TIFFClientOpen ("tiff", "w", &clientdata, memory_readproc,
+ memory_writeproc, memory_seekproc, closeproc,
+ memory_sizeproc, mapproc, unmapproc);
+ if (out == NULL)
+ return 0;
+
+/* setting up the TIFF headers */
+ TIFFSetField (out, TIFFTAG_SUBFILETYPE, 0);
+ TIFFSetField (out, TIFFTAG_IMAGEWIDTH, width);
+ TIFFSetField (out, TIFFTAG_IMAGELENGTH, height);
+ TIFFSetField (out, TIFFTAG_XRESOLUTION, 300.0);
+ TIFFSetField (out, TIFFTAG_YRESOLUTION, 300.0);
+ TIFFSetField (out, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
+ TIFFSetField (out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+ TIFFSetField (out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
+ TIFFSetField (out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
+ TIFFSetField (out, TIFFTAG_SAMPLESPERPIXEL, 1);
+ TIFFSetField (out, TIFFTAG_BITSPERSAMPLE, 1);
+ TIFFSetField (out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);
+ TIFFSetField (out, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX4);
+ TIFFSetField (out, TIFFTAG_TILEWIDTH, width);
+ TIFFSetField (out, TIFFTAG_TILELENGTH, height);
+
+/* allocating the TIFF write buffer */
+ buf_size = TIFFTileSize (out);
+ tiff_buffer = malloc (buf_size);
+ if (tiff_buffer == NULL)
+ goto error;
+
+/* writing a TIFF Monochrome tile */
+ p_in = buffer;
+ p_out = tiff_buffer;
+
+ /* priming a White tile */
+ for (x = 0; x < buf_size; x++)
+ *p_out++ = 0x00;
+ p_out = tiff_buffer;
+ for (y = 0; y < height; y++)
+ {
+ /* inserting pixels */
+ pos = 0;
+ byte = 0x00;
+ for (x = 0; x < width; x++)
+ {
+ pixel = *p_in++;
+ if (pixel == 1)
+ {
+ /* handling a black pixel */
+ switch (pos)
+ {
+ case 0:
+ byte |= 0x80;
+ break;
+ case 1:
+ byte |= 0x40;
+ break;
+ case 2:
+ byte |= 0x20;
+ break;
+ case 3:
+ byte |= 0x10;
+ break;
+ case 4:
+ byte |= 0x08;
+ break;
+ case 5:
+ byte |= 0x04;
+ break;
+ case 6:
+ byte |= 0x02;
+ break;
+ case 7:
+ byte |= 0x01;
+ break;
+ };
+ }
+ pos++;
+ if (pos > 7)
+ {
+ /* exporting an octet */
+ *p_out++ = byte;
+ byte = 0x00;
+ pos = 0;
+ }
+ }
+ }
+ if (TIFFWriteTile (out, tiff_buffer, 0, 0, 0, 0) < 0)
+ goto error;
+
+ TIFFClose (out);
+ free (tiff_buffer);
+ *blob = clientdata.buffer;
+ *blob_size = clientdata.eof;
+ return 1;
+
+ error:
+ TIFFClose (out);
+ if (tiff_buffer != NULL)
+ free (tiff_buffer);
+ if (clientdata.buffer != NULL)
+ free (clientdata.buffer);
+ return 0;
+}
+
+RL2_DECLARE int
+rl2_raster_to_tiff_mono4 (rl2RasterPtr rst, unsigned char **tiff,
+ int *tiff_size)
+{
+/* creating a TIFF FAX4 block from a raster */
+ rl2PrivRasterPtr raster = (rl2PrivRasterPtr) rst;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_samples;
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (rl2_get_raster_type (rst, &sample_type, &pixel_type, &num_samples) !=
+ RL2_OK)
+ return RL2_ERROR;
+ if (sample_type == RL2_SAMPLE_1_BIT && pixel_type == RL2_PIXEL_MONOCHROME
+ && num_samples == 1)
+ ;
+ else
+ return RL2_ERROR;
+
+ if (!compress_fax4 (raster->rasterBuffer, raster->width,
+ raster->height, tiff, tiff_size))
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+RL2_PRIVATE int
+rl2_decode_tiff_mono4 (const unsigned char *tiff, int tiff_sz,
+ unsigned int *xwidth, unsigned int *xheight,
+ unsigned char **pixels, int *pixels_sz)
+{
+/* attempting to decode a TIFF FAX4 block */
+ struct memfile clientdata;
+ TIFF *in = (TIFF *) 0;
+ int is_tiled;
+ uint32 width = 0;
+ uint32 height = 0;
+ uint32 tile_width;
+ uint32 tile_height;
+ uint16 bits_per_sample;
+ uint16 samples_per_pixel;
+ uint16 photometric;
+ uint16 compression;
+ uint16 sample_format;
+ uint16 planar_config;
+ tsize_t buf_size;
+ void *tiff_buffer = NULL;
+ unsigned int x;
+ unsigned char pixel;
+ unsigned char *buffer;
+ int buf_sz;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+
+/* suppressing TIFF warnings */
+ TIFFSetWarningHandler (NULL);
+
+/* reading from memory */
+ clientdata.buffer = (unsigned char *) tiff;
+ clientdata.malloc_block = 1024;
+ clientdata.size = tiff_sz;
+ clientdata.eof = tiff_sz;
+ clientdata.current = 0;
+ in = TIFFClientOpen ("tiff", "r", &clientdata, memory_readproc,
+ memory_writeproc, memory_seekproc, closeproc,
+ memory_sizeproc, mapproc, unmapproc);
+ if (in == NULL)
+ return RL2_ERROR;
+
+/* retrieving the TIFF dimensions */
+ is_tiled = TIFFIsTiled (in);
+ if (!is_tiled)
+ goto error;
+ TIFFGetField (in, TIFFTAG_IMAGELENGTH, &height);
+ TIFFGetField (in, TIFFTAG_IMAGEWIDTH, &width);
+ TIFFGetField (in, TIFFTAG_TILEWIDTH, &tile_width);
+ TIFFGetField (in, TIFFTAG_TILELENGTH, &tile_height);
+ if (tile_width != width)
+ goto error;
+ if (tile_height != height)
+ goto error;
+ TIFFGetField (in, TIFFTAG_BITSPERSAMPLE, &bits_per_sample);
+ if (bits_per_sample != 1)
+ goto error;
+ TIFFGetField (in, TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel);
+ if (samples_per_pixel != 1)
+ goto error;
+ TIFFGetField (in, TIFFTAG_SAMPLEFORMAT, &sample_format);
+ if (sample_format != SAMPLEFORMAT_UINT)
+ goto error;
+ TIFFGetField (in, TIFFTAG_PLANARCONFIG, &planar_config);
+ if (planar_config != PLANARCONFIG_CONTIG)
+ goto error;
+ TIFFGetField (in, TIFFTAG_PHOTOMETRIC, &photometric);
+ if (photometric != PHOTOMETRIC_MINISWHITE)
+ goto error;
+ TIFFGetField (in, TIFFTAG_COMPRESSION, &compression);
+ if (compression != COMPRESSION_CCITTFAX4)
+ goto error;
+
+/* allocating the tile buffer */
+ buf_size = TIFFTileSize (in);
+ tiff_buffer = malloc (buf_size);
+ if (tiff_buffer == NULL)
+ goto error;
+
+/* reading and decoding as a single tile */
+ if (!TIFFReadTile (in, tiff_buffer, 0, 0, 0, 0))
+ goto error;
+
+/* allocating the output buffer */
+ buf_sz = width * height;
+ buffer = malloc (buf_sz);
+ if (buffer == NULL)
+ goto error;
+
+ p_in = tiff_buffer;
+ p_out = buffer;
+ for (x = 0; x < buf_size; x++)
+ {
+ pixel = *p_in++;
+ if ((pixel & 0x80) == 0x80)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ if ((pixel & 0x40) == 0x40)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ if ((pixel & 0x20) == 0x20)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ if ((pixel & 0x10) == 0x10)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ if ((pixel & 0x08) == 0x08)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ if ((pixel & 0x04) == 0x04)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ if ((pixel & 0x02) == 0x02)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ if ((pixel & 0x01) == 0x01)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ }
+
+ TIFFClose (in);
+ if (tiff_buffer != NULL)
+ free (tiff_buffer);
+ *xwidth = width;
+ *xheight = height;
+ *pixels = buffer;
+ *pixels_sz = buf_sz;
+ return RL2_OK;
+
+ error:
+ TIFFClose (in);
+ if (tiff_buffer != NULL)
+ free (tiff_buffer);
+ return RL2_ERROR;
+}
+
+static int
+rgb_tiff_common (TIFF * out, const unsigned char *buffer, unsigned short width,
+ unsigned short height)
+{
+/* common implementation of RGB TIFF export */
+ tsize_t buf_size;
+ void *tiff_buffer = NULL;
+ int y;
+ int x;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+
+/* setting up the TIFF headers */
+ TIFFSetField (out, TIFFTAG_SUBFILETYPE, 0);
+ TIFFSetField (out, TIFFTAG_IMAGEWIDTH, width);
+ TIFFSetField (out, TIFFTAG_IMAGELENGTH, height);
+ TIFFSetField (out, TIFFTAG_XRESOLUTION, 300.0);
+ TIFFSetField (out, TIFFTAG_YRESOLUTION, 300.0);
+ TIFFSetField (out, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
+ TIFFSetField (out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+ TIFFSetField (out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
+ TIFFSetField (out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
+ TIFFSetField (out, TIFFTAG_SAMPLESPERPIXEL, 3);
+ TIFFSetField (out, TIFFTAG_BITSPERSAMPLE, 8);
+ TIFFSetField (out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
+ TIFFSetField (out, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
+ TIFFSetField (out, TIFFTAG_ROWSPERSTRIP, 1);
+
+/* allocating the TIFF write buffer */
+ buf_size = TIFFScanlineSize (out);
+ tiff_buffer = malloc (buf_size);
+ if (tiff_buffer == NULL)
+ goto error;
+
+/* writing TIFF RGB scanlines */
+ p_in = buffer;
+
+ for (y = 0; y < height; y++)
+ {
+ /* inserting pixels */
+ p_out = tiff_buffer;
+ for (x = 0; x < width; x++)
+ {
+ *p_out++ = *p_in++; /* red */
+ *p_out++ = *p_in++; /* green */
+ *p_out++ = *p_in++; /* blue */
+ }
+ if (TIFFWriteScanline (out, tiff_buffer, y, 0) < 0)
+ goto error;
+ }
+
+ free (tiff_buffer);
+ return 1;
+ error:
+ if (tiff_buffer != NULL)
+ free (tiff_buffer);
+ return 0;
+}
+
+static int
+output_rgb_tiff (const unsigned char *buffer,
+ unsigned short width,
+ unsigned short height, unsigned char **blob, int *blob_size)
+{
+/* generating an RGB TIFF - actual work */
+ struct memfile clientdata;
+ TIFF *out = (TIFF *) 0;
+
+/* suppressing TIFF warnings */
+ TIFFSetWarningHandler (NULL);
+
+/* writing into memory */
+ clientdata.buffer = NULL;
+ clientdata.malloc_block = 1024;
+ clientdata.size = 0;
+ clientdata.eof = 0;
+ clientdata.current = 0;
+ out = TIFFClientOpen ("tiff", "w", &clientdata, memory_readproc,
+ memory_writeproc, memory_seekproc, closeproc,
+ memory_sizeproc, mapproc, unmapproc);
+ if (out == NULL)
+ return 0;
+
+ if (!rgb_tiff_common (out, buffer, width, height))
+ goto error;
+
+ TIFFClose (out);
+ *blob = clientdata.buffer;
+ *blob_size = clientdata.eof;
+ return 1;
+
+ error:
+ TIFFClose (out);
+ if (clientdata.buffer != NULL)
+ free (clientdata.buffer);
+ return 0;
+}
+
+static int
+output_rgb_geotiff (const unsigned char *buffer,
+ unsigned short width,
+ unsigned short height, sqlite3 * handle, double minx,
+ double miny, double maxx, double maxy, int srid,
+ unsigned char **blob, int *blob_size)
+{
+/* generating an RGB TIFF - actual work */
+ struct memfile clientdata;
+ double tiepoint[6];
+ double pixsize[3];
+ double hResolution = (maxx - minx) / (double) width;
+ double vResolution = (maxy - miny) / (double) height;
+ char *srs_name = NULL;
+ char *proj4text = NULL;
+ GTIF *gtif = (GTIF *) 0;
+ TIFF *out = (TIFF *) 0;
+
+/* suppressing TIFF warnings */
+ TIFFSetWarningHandler (NULL);
+
+/* writing into memory */
+ clientdata.buffer = NULL;
+ clientdata.malloc_block = 1024;
+ clientdata.size = 0;
+ clientdata.eof = 0;
+ clientdata.current = 0;
+
+ out = XTIFFClientOpen ("tiff", "w", &clientdata, memory_readproc,
+ memory_writeproc, memory_seekproc, closeproc,
+ memory_sizeproc, mapproc, unmapproc);
+ if (out == NULL)
+ goto error;
+ gtif = GTIFNew (out);
+ if (gtif == NULL)
+ goto error;
+
+/* attempting to retrieve the CRS params */
+ fetch_crs_params (handle, srid, &srs_name, &proj4text);
+ if (srs_name == NULL || proj4text == NULL)
+ goto error;
+
+/* setting up the GeoTIFF Tags */
+ pixsize[0] = hResolution;
+ pixsize[1] = vResolution;
+ pixsize[2] = 0.0;
+ TIFFSetField (out, GTIFF_PIXELSCALE, 3, pixsize);
+ tiepoint[0] = 0.0;
+ tiepoint[1] = 0.0;
+ tiepoint[2] = 0.0;
+ tiepoint[3] = minx;
+ tiepoint[4] = maxy;
+ tiepoint[5] = 0.0;
+ TIFFSetField (out, GTIFF_TIEPOINTS, 6, tiepoint);
+ if (srs_name != NULL)
+ TIFFSetField (out, GTIFF_ASCIIPARAMS, srs_name);
+ if (proj4text != NULL)
+ GTIFSetFromProj4 (gtif, proj4text);
+ if (srs_name != NULL)
+ GTIFKeySet (gtif, GTCitationGeoKey, TYPE_ASCII, 0, srs_name);
+ if (is_projected_srs (proj4text))
+ GTIFKeySet (gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1, srid);
+ GTIFWriteKeys (gtif);
+
+ if (!rgb_tiff_common (out, buffer, width, height))
+ goto error;
+
+ GTIFFree (gtif);
+ XTIFFClose (out);
+ *blob = clientdata.buffer;
+ *blob_size = clientdata.eof;
+ if (srs_name != NULL)
+ free (srs_name);
+ if (proj4text != NULL)
+ free (proj4text);
+ return 1;
+
+ error:
+ if (gtif != (GTIF *) 0)
+ GTIFFree (gtif);
+ if (out != (TIFF *) 0)
+ XTIFFClose (out);
+ if (srs_name != NULL)
+ free (srs_name);
+ if (proj4text != NULL)
+ free (proj4text);
+ if (clientdata.buffer != NULL)
+ free (clientdata.buffer);
+ return 0;
+}
+
+static int
+palette_tiff_common (TIFF * out, const unsigned char *buffer,
+ unsigned short width, unsigned short height,
+ unsigned char *red, unsigned char *green,
+ unsigned char *blue, int max_palette)
+{
+/* common implementation of Palette TIFF export */
+ tsize_t buf_size;
+ void *tiff_buffer = NULL;
+ int y;
+ int x;
+ int i;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+ uint16 r_plt[256];
+ uint16 g_plt[256];
+ uint16 b_plt[256];
+
+/* preparing the TIFF palette */
+ for (i = 0; i < 256; i++)
+ {
+ r_plt[i] = 0;
+ g_plt[i] = 0;
+ b_plt[i] = 0;
+ }
+ for (i = 0; i < max_palette; i++)
+ {
+ r_plt[i] = *(red + i) * 256;
+ g_plt[i] = *(green + i) * 256;
+ b_plt[i] = *(blue + i) * 256;
+ }
+
+/* setting up the TIFF headers */
+ TIFFSetField (out, TIFFTAG_SUBFILETYPE, 0);
+ TIFFSetField (out, TIFFTAG_IMAGEWIDTH, width);
+ TIFFSetField (out, TIFFTAG_IMAGELENGTH, height);
+ TIFFSetField (out, TIFFTAG_XRESOLUTION, 300.0);
+ TIFFSetField (out, TIFFTAG_YRESOLUTION, 300.0);
+ TIFFSetField (out, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
+ TIFFSetField (out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+ TIFFSetField (out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
+ TIFFSetField (out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
+ TIFFSetField (out, TIFFTAG_SAMPLESPERPIXEL, 1);
+ TIFFSetField (out, TIFFTAG_BITSPERSAMPLE, 8);
+ TIFFSetField (out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE);
+ TIFFSetField (out, TIFFTAG_COLORMAP, r_plt, g_plt, b_plt);
+ TIFFSetField (out, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
+ TIFFSetField (out, TIFFTAG_ROWSPERSTRIP, 1);
+
+/* allocating the TIFF write buffer */
+ buf_size = TIFFScanlineSize (out);
+ tiff_buffer = malloc (buf_size);
+ if (tiff_buffer == NULL)
+ goto error;
+
+/* writing TIFF RGB scanlines */
+ p_in = buffer;
+
+ for (y = 0; y < height; y++)
+ {
+ /* inserting pixels */
+ p_out = tiff_buffer;
+ for (x = 0; x < width; x++)
+ {
+ unsigned char r = *p_in++;
+ unsigned char g = *p_in++;
+ unsigned char b = *p_in++;
+ unsigned char index = 0;
+ for (i = 0; i < max_palette; i++)
+ {
+ if (*(red + i) == r && *(green + i) == g
+ && *(blue + i) == b)
+ {
+ index = i;
+ break;
+ }
+ }
+ *p_out++ = index;
+ }
+ if (TIFFWriteScanline (out, tiff_buffer, y, 0) < 0)
+ goto error;
+ }
+
+ free (tiff_buffer);
+ return 1;
+ error:
+ if (tiff_buffer != NULL)
+ free (tiff_buffer);
+ return 0;
+}
+
+static int
+output_palette_tiff (const unsigned char *buffer,
+ unsigned short width,
+ unsigned short height, unsigned char *red,
+ unsigned char *green, unsigned char *blue, int max_palette,
+ unsigned char **blob, int *blob_size)
+{
+/* generating a PALETTE TIFF - actual work */
+ struct memfile clientdata;
+ TIFF *out = (TIFF *) 0;
+
+/* suppressing TIFF warnings */
+ TIFFSetWarningHandler (NULL);
+
+/* writing into memory */
+ clientdata.buffer = NULL;
+ clientdata.malloc_block = 1024;
+ clientdata.size = 0;
+ clientdata.eof = 0;
+ clientdata.current = 0;
+ out = TIFFClientOpen ("tiff", "w", &clientdata, memory_readproc,
+ memory_writeproc, memory_seekproc, closeproc,
+ memory_sizeproc, mapproc, unmapproc);
+ if (out == NULL)
+ return 0;
+
+ if (!palette_tiff_common
+ (out, buffer, width, height, red, green, blue, max_palette))
+ goto error;
+
+ TIFFClose (out);
+ *blob = clientdata.buffer;
+ *blob_size = clientdata.eof;
+ return 1;
+
+ error:
+ TIFFClose (out);
+ if (clientdata.buffer != NULL)
+ free (clientdata.buffer);
+ return 0;
+}
+
+static int
+output_palette_geotiff (const unsigned char *buffer,
+ unsigned short width,
+ unsigned short height, sqlite3 * handle, double minx,
+ double miny, double maxx, double maxy, int srid,
+ unsigned char *red, unsigned char *green,
+ unsigned char *blue, int max_palette,
+ unsigned char **blob, int *blob_size)
+{
+/* generating a PALETTE GeoTIFF - actual work */
+ struct memfile clientdata;
+ double tiepoint[6];
+ double pixsize[3];
+ double hResolution = (maxx - minx) / (double) width;
+ double vResolution = (maxy - miny) / (double) height;
+ char *srs_name = NULL;
+ char *proj4text = NULL;
+ GTIF *gtif = (GTIF *) 0;
+ TIFF *out = (TIFF *) 0;
+
+/* suppressing TIFF warnings */
+ TIFFSetWarningHandler (NULL);
+
+/* writing into memory */
+ clientdata.buffer = NULL;
+ clientdata.malloc_block = 1024;
+ clientdata.size = 0;
+ clientdata.eof = 0;
+ clientdata.current = 0;
+
+ out = XTIFFClientOpen ("tiff", "w", &clientdata, memory_readproc,
+ memory_writeproc, memory_seekproc, closeproc,
+ memory_sizeproc, mapproc, unmapproc);
+ if (out == NULL)
+ goto error;
+ gtif = GTIFNew (out);
+ if (gtif == NULL)
+ goto error;
+
+/* attempting to retrieve the CRS params */
+ fetch_crs_params (handle, srid, &srs_name, &proj4text);
+ if (srs_name == NULL || proj4text == NULL)
+ goto error;
+
+/* setting up the GeoTIFF Tags */
+ pixsize[0] = hResolution;
+ pixsize[1] = vResolution;
+ pixsize[2] = 0.0;
+ TIFFSetField (out, GTIFF_PIXELSCALE, 3, pixsize);
+ tiepoint[0] = 0.0;
+ tiepoint[1] = 0.0;
+ tiepoint[2] = 0.0;
+ tiepoint[3] = minx;
+ tiepoint[4] = maxy;
+ tiepoint[5] = 0.0;
+ TIFFSetField (out, GTIFF_TIEPOINTS, 6, tiepoint);
+ if (srs_name != NULL)
+ TIFFSetField (out, GTIFF_ASCIIPARAMS, srs_name);
+ if (proj4text != NULL)
+ GTIFSetFromProj4 (gtif, proj4text);
+ if (srs_name != NULL)
+ GTIFKeySet (gtif, GTCitationGeoKey, TYPE_ASCII, 0, srs_name);
+ if (is_projected_srs (proj4text))
+ GTIFKeySet (gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1, srid);
+ GTIFWriteKeys (gtif);
+
+ if (!palette_tiff_common
+ (out, buffer, width, height, red, green, blue, max_palette))
+ goto error;
+
+ GTIFFree (gtif);
+ XTIFFClose (out);
+ *blob = clientdata.buffer;
+ *blob_size = clientdata.eof;
+ if (srs_name != NULL)
+ free (srs_name);
+ if (proj4text != NULL)
+ free (proj4text);
+ return 1;
+
+ error:
+ if (gtif != (GTIF *) 0)
+ GTIFFree (gtif);
+ if (out != (TIFF *) 0)
+ XTIFFClose (out);
+ if (srs_name != NULL)
+ free (srs_name);
+ if (proj4text != NULL)
+ free (proj4text);
+ if (clientdata.buffer != NULL)
+ free (clientdata.buffer);
+ return 0;
+}
+
+static int
+test_palette_tiff (unsigned short width, unsigned short height,
+ const unsigned char *rgb, unsigned char *red,
+ unsigned char *green, unsigned char *blue, int *max_palette)
+{
+/* testing for an eventual Palette */
+ int next_palette = 0;
+ int extra_palette = 0;
+ int c;
+ int y;
+ int x;
+ const unsigned char *p_in;
+
+ p_in = rgb;
+ for (y = 0; y < height; y++)
+ {
+ /* inserting pixels */
+ for (x = 0; x < width; x++)
+ {
+ unsigned char r = *p_in++;
+ unsigned char g = *p_in++;
+ unsigned char b = *p_in++;
+ int match = 0;
+ for (c = 0; c < next_palette; c++)
+ {
+ if (*(red + c) == r && *(green + c) == g
+ && *(blue + c) == b)
+ {
+ /* color already defined into the palette */
+ match = 1;
+ break;
+ }
+ }
+ if (!match)
+ {
+ /* attempting to insert a color into the palette */
+ if (next_palette < 256)
+ {
+ *(red + next_palette) = r;
+ *(green + next_palette) = g;
+ *(blue + next_palette) = b;
+ next_palette++;
+ }
+ else
+ {
+ extra_palette++;
+ goto palette_invalid;
+ }
+ }
+ }
+ }
+ palette_invalid:
+ if (extra_palette)
+ return 0;
+ *max_palette = next_palette;
+ return 1;
+}
+
+RL2_DECLARE int
+rl2_rgb_to_tiff (unsigned int width, unsigned int height,
+ const unsigned char *rgb, unsigned char **tiff, int *tiff_size)
+{
+/* creating a TIFF in-memory image from an RGB buffer */
+ unsigned char red[256];
+ unsigned char green[256];
+ unsigned char blue[256];
+ int max_palette = 0;
+ if (rgb == NULL)
+ return RL2_ERROR;
+
+ if (test_palette_tiff (width, height, rgb, red, green, blue, &max_palette))
+ {
+ if (!output_palette_tiff
+ (rgb, width, height, red, green, blue, max_palette, tiff,
+ tiff_size))
+ return RL2_ERROR;
+ }
+ else
+ {
+ if (!output_rgb_tiff (rgb, width, height, tiff, tiff_size))
+ return RL2_ERROR;
+ }
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_rgb_to_geotiff (unsigned int width, unsigned int height,
+ sqlite3 * handle, double minx, double miny, double maxx,
+ double maxy, int srid, const unsigned char *rgb,
+ unsigned char **tiff, int *tiff_size)
+{
+/* creating a GeoTIFF in-memory image from an RGB buffer */
+ unsigned char red[256];
+ unsigned char green[256];
+ unsigned char blue[256];
+ int max_palette = 0;
+ if (rgb == NULL)
+ return RL2_ERROR;
+
+ if (test_palette_tiff (width, height, rgb, red, green, blue, &max_palette))
+ {
+ if (!output_palette_geotiff
+ (rgb, width, height, handle, minx, miny, maxx, maxy, srid, red,
+ green, blue, max_palette, tiff, tiff_size))
+ return RL2_ERROR;
+ }
+ else
+ {
+ if (!output_rgb_geotiff
+ (rgb, width, height, handle, minx, miny, maxx, maxy, srid, tiff,
+ tiff_size))
+ return RL2_ERROR;
+ }
+ return RL2_OK;
+}
+
+static int
+gray_tiff_common (TIFF * out, const unsigned char *buffer, unsigned short width,
+ unsigned short height)
+{
+/* common implementation of Grayscale TIFF export */
+ tsize_t buf_size;
+ void *tiff_buffer = NULL;
+ int y;
+ int x;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+
+/* setting up the TIFF headers */
+ TIFFSetField (out, TIFFTAG_SUBFILETYPE, 0);
+ TIFFSetField (out, TIFFTAG_IMAGEWIDTH, width);
+ TIFFSetField (out, TIFFTAG_IMAGELENGTH, height);
+ TIFFSetField (out, TIFFTAG_XRESOLUTION, 300.0);
+ TIFFSetField (out, TIFFTAG_YRESOLUTION, 300.0);
+ TIFFSetField (out, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
+ TIFFSetField (out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+ TIFFSetField (out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
+ TIFFSetField (out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);
+ TIFFSetField (out, TIFFTAG_SAMPLESPERPIXEL, 1);
+ TIFFSetField (out, TIFFTAG_BITSPERSAMPLE, 8);
+ TIFFSetField (out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
+ TIFFSetField (out, TIFFTAG_COMPRESSION, COMPRESSION_NONE);
+ TIFFSetField (out, TIFFTAG_ROWSPERSTRIP, 1);
+
+/* allocating the TIFF write buffer */
+ buf_size = TIFFScanlineSize (out);
+ tiff_buffer = malloc (buf_size);
+ if (tiff_buffer == NULL)
+ goto error;
+
+/* writing TIFF RGB scanlines */
+ p_in = buffer;
+
+ for (y = 0; y < height; y++)
+ {
+ /* inserting pixels */
+ p_out = tiff_buffer;
+ for (x = 0; x < width; x++)
+ *p_out++ = *p_in++; /* gray */
+ if (TIFFWriteScanline (out, tiff_buffer, y, 0) < 0)
+ goto error;
+ }
+
+ free (tiff_buffer);
+ return 1;
+ error:
+ if (tiff_buffer != NULL)
+ free (tiff_buffer);
+ return 0;
+}
+
+static int
+output_gray_tiff (const unsigned char *buffer,
+ unsigned short width,
+ unsigned short height, unsigned char **blob, int *blob_size)
+{
+/* generating a Grayscale TIFF - actual work */
+ struct memfile clientdata;
+ TIFF *out = (TIFF *) 0;
+
+/* suppressing TIFF warnings */
+ TIFFSetWarningHandler (NULL);
+
+/* writing into memory */
+ clientdata.buffer = NULL;
+ clientdata.malloc_block = 1024;
+ clientdata.size = 0;
+ clientdata.eof = 0;
+ clientdata.current = 0;
+ out = TIFFClientOpen ("tiff", "w", &clientdata, memory_readproc,
+ memory_writeproc, memory_seekproc, closeproc,
+ memory_sizeproc, mapproc, unmapproc);
+ if (out == NULL)
+ return 0;
+
+ if (!gray_tiff_common (out, buffer, width, height))
+ goto error;
+
+ TIFFClose (out);
+ *blob = clientdata.buffer;
+ *blob_size = clientdata.eof;
+ return 1;
+
+ error:
+ TIFFClose (out);
+ if (clientdata.buffer != NULL)
+ free (clientdata.buffer);
+ return 0;
+}
+
+static int
+output_gray_geotiff (const unsigned char *buffer,
+ unsigned short width,
+ unsigned short height, sqlite3 * handle, double minx,
+ double miny, double maxx, double maxy, int srid,
+ unsigned char **blob, int *blob_size)
+{
+/* generating a Grayscale GeoTIFF - actual work */
+ struct memfile clientdata;
+ double tiepoint[6];
+ double pixsize[3];
+ double hResolution = (maxx - minx) / (double) width;
+ double vResolution = (maxy - miny) / (double) height;
+ char *srs_name = NULL;
+ char *proj4text = NULL;
+ GTIF *gtif = (GTIF *) 0;
+ TIFF *out = (TIFF *) 0;
+
+/* suppressing TIFF warnings */
+ TIFFSetWarningHandler (NULL);
+
+/* writing into memory */
+ clientdata.buffer = NULL;
+ clientdata.malloc_block = 1024;
+ clientdata.size = 0;
+ clientdata.eof = 0;
+ clientdata.current = 0;
+
+ out = XTIFFClientOpen ("tiff", "w", &clientdata, memory_readproc,
+ memory_writeproc, memory_seekproc, closeproc,
+ memory_sizeproc, mapproc, unmapproc);
+ if (out == NULL)
+ goto error;
+ gtif = GTIFNew (out);
+ if (gtif == NULL)
+ goto error;
+
+/* attempting to retrieve the CRS params */
+ fetch_crs_params (handle, srid, &srs_name, &proj4text);
+ if (srs_name == NULL || proj4text == NULL)
+ goto error;
+
+/* setting up the GeoTIFF Tags */
+ pixsize[0] = hResolution;
+ pixsize[1] = vResolution;
+ pixsize[2] = 0.0;
+ TIFFSetField (out, GTIFF_PIXELSCALE, 3, pixsize);
+ tiepoint[0] = 0.0;
+ tiepoint[1] = 0.0;
+ tiepoint[2] = 0.0;
+ tiepoint[3] = minx;
+ tiepoint[4] = maxy;
+ tiepoint[5] = 0.0;
+ TIFFSetField (out, GTIFF_TIEPOINTS, 6, tiepoint);
+ if (srs_name != NULL)
+ TIFFSetField (out, GTIFF_ASCIIPARAMS, srs_name);
+ if (proj4text != NULL)
+ GTIFSetFromProj4 (gtif, proj4text);
+ if (srs_name != NULL)
+ GTIFKeySet (gtif, GTCitationGeoKey, TYPE_ASCII, 0, srs_name);
+ if (is_projected_srs (proj4text))
+ GTIFKeySet (gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1, srid);
+ GTIFWriteKeys (gtif);
+
+ if (!gray_tiff_common (out, buffer, width, height))
+ goto error;
+
+ GTIFFree (gtif);
+ XTIFFClose (out);
+ *blob = clientdata.buffer;
+ *blob_size = clientdata.eof;
+ if (srs_name != NULL)
+ free (srs_name);
+ if (proj4text != NULL)
+ free (proj4text);
+ return 1;
+
+ error:
+ if (gtif != (GTIF *) 0)
+ GTIFFree (gtif);
+ if (out != (TIFF *) 0)
+ XTIFFClose (out);
+ if (srs_name != NULL)
+ free (srs_name);
+ if (proj4text != NULL)
+ free (proj4text);
+ if (clientdata.buffer != NULL)
+ free (clientdata.buffer);
+ return 0;
+}
+
+RL2_DECLARE int
+rl2_gray_to_tiff (unsigned int width, unsigned int height,
+ const unsigned char *gray, unsigned char **tiff,
+ int *tiff_size)
+{
+/* creating a TIFF in-memory image from a Grayscale buffer */
+ if (gray == NULL)
+ return RL2_ERROR;
+
+ if (!output_gray_tiff (gray, width, height, tiff, tiff_size))
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_gray_to_geotiff (unsigned int width, unsigned int height,
+ sqlite3 * handle, double minx, double miny, double maxx,
+ double maxy, int srid, const unsigned char *gray,
+ unsigned char **tiff, int *tiff_size)
+{
+/* creating a GeoTIFF in-memory image from a Grayscale buffer */
+ if (gray == NULL)
+ return RL2_ERROR;
+
+ if (!output_gray_geotiff
+ (gray, width, height, handle, minx, miny, maxx, maxy, srid, tiff,
+ tiff_size))
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_raster_from_tiff (const unsigned char *blob, int blob_size)
+{
+/* attempting to create a raster from a TIFF image */
+ rl2RasterPtr rst = NULL;
+ struct memfile clientdata;
+ uint32 width = 0;
+ uint32 height = 0;
+ TIFF *in = (TIFF *) 0;
+ unsigned int x;
+ unsigned int y;
+ unsigned int row;
+ uint32 *rgba;
+ unsigned char *rgb;
+ unsigned char *mask;
+ int rgb_size;
+ int mask_size;
+ uint32 *p_in;
+ unsigned char *p_rgb;
+ unsigned char *p_mask;
+ int valid_mask = 0;
+
+/* suppressing TIFF warnings */
+ TIFFSetWarningHandler (NULL);
+
+/* reading from memory */
+ clientdata.buffer = (unsigned char *) blob;
+ clientdata.malloc_block = 1024;
+ clientdata.size = blob_size;
+ clientdata.eof = blob_size;
+ clientdata.current = 0;
+ in = TIFFClientOpen ("tiff", "r", &clientdata, memory_readproc,
+ memory_writeproc, memory_seekproc, closeproc,
+ memory_sizeproc, mapproc, unmapproc);
+ if (in == NULL)
+ return NULL;
+
+/* retrieving the TIFF dimensions */
+ TIFFGetField (in, TIFFTAG_IMAGELENGTH, &height);
+ TIFFGetField (in, TIFFTAG_IMAGEWIDTH, &width);
+
+/* allocating the RGBA buffer */
+ rgba = malloc (sizeof (uint32) * width * height);
+ if (rgba == NULL)
+ goto error;
+
+/* attempting to decode the TIFF */
+ if (!TIFFReadRGBAImage (in, width, height, rgba, 1))
+ goto error;
+ TIFFClose (in);
+
+/* rearranging the RGBA buffer */
+ rgb_size = width * height * 3;
+ mask_size = width * height;
+ rgb = malloc (rgb_size);
+ mask = malloc (mask_size);
+ if (rgb == NULL || mask == NULL)
+ goto error;
+ p_in = rgba;
+ row = height - 1;
+ for (y = 0; y < height; y++)
+ {
+ /* the TIFF RGBA buffer is bottom-up !!! */
+ p_rgb = rgb + (row * width * 3);
+ p_mask = mask + (row * width);
+ for (x = 0; x < width; x++)
+ {
+ /* copying pixels */
+ *p_rgb++ = TIFFGetR (*p_in);
+ *p_rgb++ = TIFFGetG (*p_in);
+ *p_rgb++ = TIFFGetB (*p_in);
+ if (TIFFGetA (*p_in) < 128)
+ {
+ *p_mask++ = 0;
+ valid_mask = 1;
+ }
+ else
+ *p_mask++ = 1;
+ p_in++;
+ }
+ row--;
+ }
+ if (!valid_mask)
+ {
+ free (mask);
+ mask = NULL;
+ mask_size = 0;
+ }
+ free (rgba);
+ rgba = NULL;
+
+/* creating the raster */
+ rst =
+ rl2_create_raster (width, height, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ rgb, rgb_size, NULL, mask, mask_size, NULL);
+ if (rst == NULL)
+ goto error;
+ return rst;
+
+ error:
+ if (in != (TIFF *) 0)
+ TIFFClose (in);
+ if (rgba != NULL)
+ free (rgba);
+ if (rgb != NULL)
+ free (rgb);
+ if (mask != NULL)
+ free (mask);
+ return NULL;
+}
diff --git a/src/rl2version.c b/src/rl2version.c
new file mode 100644
index 0000000..fec21a6
--- /dev/null
+++ b/src/rl2version.c
@@ -0,0 +1,66 @@
+/*
+ rl2version.c -- version info
+
+ version 0.1, 2013 December 22
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+
+const char rl2version[] = VERSION;
+const char rl2targetcpu[] = TARGET_CPU;
+
+RL2_DECLARE const char *
+rl2_version (void)
+{
+ return rl2version;
+}
+
+RL2_DECLARE const char *
+rl2_target_cpu (void)
+{
+ return rl2targetcpu;
+}
diff --git a/src/rl2webp.c b/src/rl2webp.c
new file mode 100644
index 0000000..f7e47b0
--- /dev/null
+++ b/src/rl2webp.c
@@ -0,0 +1,559 @@
+/*
+
+ rl2webp -- WebP related functions
+
+ version 0.1, 2013 April 5
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2008-2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <webp/decode.h>
+#include <webp/encode.h>
+
+#include "config.h"
+
+#ifdef LOADABLE_EXTENSION
+#include "rasterlite2/sqlite.h"
+#endif
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2_private.h"
+
+static int
+check_webp_compatibility (unsigned char sample_type, unsigned char pixel_type,
+ unsigned char num_samples)
+{
+/* checks for WebP compatibility */
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_PALETTE:
+ case RL2_PIXEL_GRAYSCALE:
+ case RL2_PIXEL_RGB:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (pixel_type == RL2_PIXEL_MONOCHROME)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 1)
+ return RL2_ERROR;
+ }
+ if (pixel_type == RL2_PIXEL_PALETTE)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 1)
+ return RL2_ERROR;
+ }
+ if (pixel_type == RL2_PIXEL_GRAYSCALE)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ case RL2_SAMPLE_2_BIT:
+ case RL2_SAMPLE_4_BIT:
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 1)
+ return RL2_ERROR;
+ }
+ if (pixel_type == RL2_PIXEL_RGB)
+ {
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_UINT8:
+ break;
+ default:
+ return RL2_ERROR;
+ };
+ if (num_samples != 3)
+ return RL2_ERROR;
+ }
+ return RL2_OK;
+}
+
+static int
+compress_lossy_alpha_webp (rl2PrivRasterPtr rst, unsigned char **webp,
+ int *webp_size, int quality)
+{
+/* compressing a WebP (lossy) image (with ALPHA channel) */
+ int size;
+ unsigned char *output;
+ int rgba_size;
+ unsigned char *rgba;
+
+ *webp = NULL;
+ *webp_size = 0;
+ if (rl2_raster_data_to_RGBA ((rl2RasterPtr) rst, &rgba, &rgba_size) ==
+ RL2_ERROR)
+ return RL2_ERROR;
+ if (quality > 100)
+ quality = 100;
+ if (quality < 0)
+ quality = 75;
+ size =
+ WebPEncodeRGBA (rgba, rst->width, rst->height, rst->width * 4, quality,
+ &output);
+ free (rgba);
+ if (size == 0)
+ return RL2_ERROR;
+ *webp = output;
+ *webp_size = size;
+ return RL2_OK;
+}
+
+static int
+compress_lossy_webp (rl2RasterPtr ptr, unsigned char **webp, int *webp_size,
+ int quality)
+{
+/* compressing a WebP (lossy) image */
+ int size;
+ unsigned char *output;
+ int rgb_size;
+ unsigned char *rgb;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst->maskBuffer != NULL || rst->noData != NULL)
+ return compress_lossy_alpha_webp (rst, webp, webp_size, quality);
+
+/* no ALPHA channel */
+ *webp = NULL;
+ *webp_size = 0;
+ if (rl2_raster_data_to_RGB (ptr, &rgb, &rgb_size) == RL2_ERROR)
+ return RL2_ERROR;
+ if (quality > 100)
+ quality = 100;
+ if (quality < 0)
+ quality = 75;
+ size =
+ WebPEncodeRGB (rgb, rst->width, rst->height, rst->width * 3, quality,
+ &output);
+ free (rgb);
+ if (size == 0)
+ return RL2_ERROR;
+ *webp = output;
+ *webp_size = size;
+ return RL2_OK;
+}
+
+static int
+compress_lossless_alpha_webp (rl2PrivRasterPtr rst, unsigned char **webp,
+ int *webp_size)
+{
+/* compressing a WebP (lossless) image (with ALPHA channel) */
+ int size;
+ unsigned char *output;
+ int rgba_size;
+ unsigned char *rgba;
+
+ *webp = NULL;
+ *webp_size = 0;
+ if (rl2_raster_data_to_RGBA ((rl2RasterPtr) rst, &rgba, &rgba_size) ==
+ RL2_ERROR)
+ return RL2_ERROR;
+ size =
+ WebPEncodeLosslessRGBA (rgba, rst->width, rst->height, rst->width * 4,
+ &output);
+ free (rgba);
+ if (size == 0)
+ return RL2_ERROR;
+ *webp = output;
+ *webp_size = size;
+ return RL2_OK;
+}
+
+static int
+compress_lossless_webp (rl2RasterPtr ptr, unsigned char **webp, int *webp_size)
+{
+/* compressing a WebP (lossless) image */
+ int size;
+ unsigned char *output;
+ int rgb_size;
+ unsigned char *rgb;
+ rl2PrivRasterPtr rst = (rl2PrivRasterPtr) ptr;
+ if (rst->maskBuffer != NULL || rst->noData != NULL)
+ return compress_lossless_alpha_webp (rst, webp, webp_size);
+
+/* no ALPHA channel */
+ *webp = NULL;
+ *webp_size = 0;
+ if (rl2_raster_data_to_RGB (ptr, &rgb, &rgb_size) == RL2_ERROR)
+ return RL2_ERROR;
+ size =
+ WebPEncodeLosslessRGB (rgb, rst->width, rst->height, rst->width * 3,
+ &output);
+ free (rgb);
+ if (size == 0)
+ return RL2_ERROR;
+ *webp = output;
+ *webp_size = size;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_section_to_lossy_webp (rl2SectionPtr scn, const char *path, int quality)
+{
+/* attempting to save a raster section into a WebP (lossy) file */
+ int blob_size;
+ unsigned char *blob;
+ rl2RasterPtr rst;
+ int ret;
+
+ if (scn == NULL)
+ return RL2_ERROR;
+ rst = rl2_get_section_raster (scn);
+ if (rst == NULL)
+ return RL2_ERROR;
+/* attempting to export as a WebP image */
+ if (rl2_raster_to_lossy_webp (rst, &blob, &blob_size, quality) != RL2_OK)
+ return RL2_ERROR;
+ ret = rl2_blob_to_file (path, blob, blob_size);
+ free (blob);
+ if (ret != RL2_OK)
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_to_lossy_webp (rl2RasterPtr rst, unsigned char **webp,
+ int *webp_size, int quality)
+{
+/* creating a WebP image (lossy) from a raster */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_samples;
+ unsigned char *blob;
+ int blob_size;
+
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (rl2_get_raster_type (rst, &sample_type, &pixel_type, &num_samples) !=
+ RL2_OK)
+ return RL2_ERROR;
+ if (check_webp_compatibility (sample_type, pixel_type, num_samples) !=
+ RL2_OK)
+ return RL2_ERROR;
+ if (compress_lossy_webp (rst, &blob, &blob_size, quality) != RL2_OK)
+ return RL2_ERROR;
+ *webp = blob;
+ *webp_size = blob_size;
+ return RL2_OK;
+}
+
+
+RL2_DECLARE int
+rl2_section_to_lossless_webp (rl2SectionPtr scn, const char *path)
+{
+/* attempting to save a raster section into a WebP (lossless) file */
+ int blob_size;
+ unsigned char *blob;
+ rl2RasterPtr rst;
+ int ret;
+
+ if (scn == NULL)
+ return RL2_ERROR;
+ rst = rl2_get_section_raster (scn);
+ if (rst == NULL)
+ return RL2_ERROR;
+/* attempting to export as a WebP image */
+ if (rl2_raster_to_lossless_webp (rst, &blob, &blob_size) != RL2_OK)
+ return RL2_ERROR;
+ ret = rl2_blob_to_file (path, blob, blob_size);
+ free (blob);
+ if (ret != RL2_OK)
+ return RL2_ERROR;
+ return RL2_OK;
+}
+
+RL2_DECLARE int
+rl2_raster_to_lossless_webp (rl2RasterPtr rst, unsigned char **webp,
+ int *webp_size)
+{
+/* creating a WebP image (lossless) from a raster */
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_samples;
+ unsigned char *blob;
+ int blob_size;
+
+ if (rst == NULL)
+ return RL2_ERROR;
+ if (rl2_get_raster_type (rst, &sample_type, &pixel_type, &num_samples) !=
+ RL2_OK)
+ return RL2_ERROR;
+ if (check_webp_compatibility (sample_type, pixel_type, num_samples) !=
+ RL2_OK)
+ return RL2_ERROR;
+ if (compress_lossless_webp (rst, &blob, &blob_size) != RL2_OK)
+ return RL2_ERROR;
+ *webp = blob;
+ *webp_size = blob_size;
+ return RL2_OK;
+}
+
+RL2_DECLARE rl2SectionPtr
+rl2_section_from_webp (const char *path)
+{
+/* attempting to create a raster section from a WebP file */
+ int blob_size;
+ unsigned char *blob;
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+
+/* attempting to create a raster */
+ if (rl2_blob_from_file (path, &blob, &blob_size) != RL2_OK)
+ return NULL;
+ rst = rl2_raster_from_webp (blob, blob_size);
+ free (blob);
+ if (rst == NULL)
+ return NULL;
+
+/* creating the raster section */
+ scn =
+ rl2_create_section (path, RL2_COMPRESSION_LOSSY_WEBP,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ return scn;
+}
+
+RL2_DECLARE rl2RasterPtr
+rl2_raster_from_webp (const unsigned char *webp, int webp_size)
+{
+/* attempting to create a raster from a WebP image */
+ rl2RasterPtr rst = NULL;
+ unsigned char *buf;
+ int buf_size;
+ unsigned char *mask;
+ int mask_size;
+ unsigned int width;
+ unsigned int height;
+
+ if (rl2_decode_webp_scaled
+ (1, webp, webp_size, &width, &height, RL2_PIXEL_RGB, &buf, &buf_size,
+ &mask, &mask_size) != RL2_OK)
+ return NULL;
+
+/* creating the raster */
+ rst =
+ rl2_create_raster (width, height, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ buf, buf_size, NULL, mask, mask_size, NULL);
+ if (rst == NULL)
+ {
+ free (buf);
+ if (mask != NULL)
+ free (mask);
+ }
+ return rst;
+}
+
+RL2_PRIVATE int
+rl2_decode_webp_scaled (int scale, const unsigned char *webp, int webp_size,
+ unsigned int *xwidth, unsigned int *xheight,
+ unsigned char pixel_type, unsigned char **pixels,
+ int *pixels_size, unsigned char **xmask,
+ int *xmask_size)
+{
+/* attempting to create a raster from a WebP image - supporting rescaled size */
+ unsigned char *buf = NULL;
+ int buf_size = 0;
+ unsigned char *mask = NULL;
+ int mask_size = 0;
+ unsigned char *p_in;
+ unsigned char *p_out;
+ unsigned char *p_mask;
+ unsigned int width;
+ unsigned int height;
+ unsigned int row;
+ unsigned int col;
+ WebPBitstreamFeatures features;
+ WebPDecoderConfig config;
+
+ if (scale == 1 || scale == 2 || scale == 4 || scale == 8)
+ ;
+ else
+ return RL2_ERROR;
+
+ if (WebPGetFeatures (webp, webp_size, &features) != VP8_STATUS_OK)
+ return RL2_ERROR;
+
+/* decoder options */
+ WebPInitDecoderConfig (&config);
+ if (scale == 1)
+ {
+ config.options.no_fancy_upsampling = 1;
+ config.options.use_scaling = 0;
+ width = features.width;
+ height = features.height;
+ }
+ else
+ {
+ config.options.no_fancy_upsampling = 1;
+ config.options.use_scaling = 1;
+ width = features.width / scale;
+ height = features.height / scale;
+ config.options.scaled_width = width;
+ config.options.scaled_height = height;
+ }
+ if (features.has_alpha)
+ {
+ config.output.colorspace = MODE_RGBA;
+ buf_size = width * height * 4;
+ buf = malloc (buf_size);
+ if (buf == NULL)
+ goto error;
+ config.output.u.RGBA.rgba = (uint8_t *) buf;
+ config.output.u.RGBA.stride = width * 4;
+ config.output.u.RGBA.size = buf_size;
+ config.output.is_external_memory = 1;
+ }
+ else
+ {
+ config.output.colorspace = MODE_RGB;
+ buf_size = width * height * 3;
+ buf = malloc (buf_size);
+ if (buf == NULL)
+ goto error;
+ config.output.u.RGBA.rgba = (uint8_t *) buf;
+ config.output.u.RGBA.stride = width * 3;
+ config.output.u.RGBA.size = buf_size;
+ config.output.is_external_memory = 1;
+ }
+
+ if (features.has_alpha)
+ {
+ if (WebPDecode (webp, webp_size, &config) != VP8_STATUS_OK)
+ goto error;
+ buf_size = width * height * 3;
+ mask_size = width * height;
+ mask = malloc (mask_size);
+ if (mask == NULL)
+ goto error;
+ p_mask = mask;
+ p_in = buf;
+ p_out = buf;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ if (*p_in++ < 128)
+ *p_mask++ = 0;
+ else
+ *p_mask++ = 1;
+ }
+ }
+ }
+ else
+ {
+ if (WebPDecode (webp, webp_size, &config) != VP8_STATUS_OK)
+ goto error;
+ mask = NULL;
+ mask_size = 0;
+ }
+
+ if (pixel_type == RL2_PIXEL_GRAYSCALE)
+ {
+ /* returning a GRAYSCALE pixel buffer */
+ unsigned char *gray = NULL;
+ int gray_size = width * height;
+ gray = malloc (gray_size);
+ if (gray == NULL)
+ goto error;
+ p_in = buf;
+ p_out = gray;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ *p_out++ = *p_in;
+ p_in += 3;
+ }
+ }
+ free (buf);
+ buf = gray;
+ buf_size = gray_size;
+ }
+
+ *xwidth = width;
+ *xheight = height;
+ *pixels = buf;
+ *pixels_size = buf_size;
+ *xmask = mask;
+ *xmask_size = mask_size;
+ return RL2_OK;
+
+ error:
+ if (buf != NULL)
+ free (buf);
+ if (mask != NULL)
+ free (mask);
+ return RL2_ERROR;
+}
diff --git a/src/rl2wms.c b/src/rl2wms.c
new file mode 100644
index 0000000..5d160fc
--- /dev/null
+++ b/src/rl2wms.c
@@ -0,0 +1,7560 @@
+/*
+
+ rl2wms -- WMS related functions
+
+ version 0.1, 2013 July 28
+
+ Author: Sandro Furieri a.furieri at lqt.it
+
+ -----------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the RasterLite2 library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#include <stdlib.h>
+#include <stdio.h>
+#include <float.h>
+#include <math.h>
+#include <string.h>
+#include <time.h>
+
+#include <curl/curl.h>
+#include <libxml/parser.h>
+
+#include "rasterlite2/sqlite.h"
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2wms.h"
+
+#define WMS_FORMAT_UNKNOWN 0
+#define WMS_FORMAT_GIF 1
+#define WMS_FORMAT_PNG 2
+#define WMS_FORMAT_PNG8 3
+#define WMS_FORMAT_PNG24 4
+#define WMS_FORMAT_PNG32 5
+#define WMS_FORMAT_JPEG 6
+#define WMS_FORMAT_TIFF 7
+
+typedef struct wmsMemBufferStruct
+{
+/* a struct handling a dynamically growing output buffer */
+ unsigned char *Buffer;
+ size_t WriteOffset;
+ size_t BufferSize;
+ int Error;
+} wmsMemBuffer;
+typedef wmsMemBuffer *wmsMemBufferPtr;
+
+typedef struct wmsCachedCapabilitiesStruct
+{
+/* a WMS Cached GetCapabilities response */
+ char *Url;
+ unsigned char *Response;
+ struct wmsCachedCapabilitiesStruct *Next;
+} wmsCachedCapabilities;
+typedef wmsCachedCapabilities *wmsCachedCapabilitiesPtr;
+
+typedef struct wmsCachedItemStruct
+{
+/* a WMS Cached Item */
+ char *Url;
+ time_t Time;
+ int Size;
+ unsigned char *Item;
+ int ImageFormat;
+ struct wmsCachedItemStruct *Prev;
+ struct wmsCachedItemStruct *Next;
+} wmsCachedItem;
+typedef wmsCachedItem *wmsCachedItemPtr;
+
+typedef struct wmsCacheStruct
+{
+/* a struct implementing a WMS image cache */
+ int MaxSize;
+ int CurrentSize;
+ wmsCachedCapabilitiesPtr FirstCapab;
+ wmsCachedCapabilitiesPtr LastCapab;
+ wmsCachedItemPtr First;
+ wmsCachedItemPtr Last;
+ int NumCachedItems;
+ wmsCachedItemPtr *SortedByUrl;
+ wmsCachedItemPtr *SortedByTime;
+ int HitCount;
+ int MissCount;
+ int FlushedCount;
+ double TotalDownload;
+} wmsCache;
+typedef wmsCache *wmsCachePtr;
+
+typedef struct wmsFormatStruct
+{
+/* a struct wrapping a WMS Format */
+ int FormatCode;
+ char *Format;
+ struct wmsFormatStruct *next;
+} wmsFormat;
+typedef wmsFormat *wmsFormatPtr;
+
+typedef struct wmsCrsStruct
+{
+/* a struct wrapping a WMS CRS */
+ char *Crs;
+ struct wmsCrsStruct *next;
+} wmsCrs;
+typedef wmsCrs *wmsCrsPtr;
+
+typedef struct wmsBBoxStruct
+{
+/* a struct wrapping a WMS Bounding Box */
+ char *Crs;
+ double MinX;
+ double MaxX;
+ double MinY;
+ double MaxY;
+ struct wmsBBoxStruct *next;
+} wmsBBox;
+typedef wmsBBox *wmsBBoxPtr;
+
+typedef struct wmsStyleStruct
+{
+/* a struct wrapping a WMS Style */
+ char *Name;
+ char *Title;
+ char *Abstract;
+ struct wmsStyleStruct *next;
+} wmsStyle;
+typedef wmsStyle *wmsStylePtr;
+
+typedef struct wmsUrlArgumentStruct
+{
+/* struct wrapping a WMS URL argument */
+ char *argName;
+ char *argValue;
+ struct wmsUrlArgumentStruct *next;
+} wmsUrlArgument;
+typedef wmsUrlArgument *wmsUrlArgumentPtr;
+
+typedef struct wmsTilePatternStruct
+{
+/* struct wrapping a WMS TilePattern */
+ char *Pattern;
+ char *Format;
+ char *SRS;
+ char *Style;
+ int TileWidth;
+ int TileHeight;
+ double TileBaseX;
+ double TileBaseY;
+ double TileExtentX;
+ double TileExtentY;
+ wmsUrlArgumentPtr first;
+ wmsUrlArgumentPtr last;
+ struct wmsTilePatternStruct *next;
+} wmsTilePattern;
+typedef wmsTilePattern *wmsTilePatternPtr;
+
+typedef struct wmsTiledLayerStruct
+{
+/* a struct wrapping a WMS Tiled Layer */
+ char *Name;
+ char *Title;
+ char *Abstract;
+ double MinLat;
+ double MaxLat;
+ double MinLong;
+ double MaxLong;
+ char *Pad;
+ char *Bands;
+ char *DataType;
+ wmsTilePatternPtr firstPattern;
+ wmsTilePatternPtr lastPattern;
+ struct wmsTiledLayerStruct *firstChild;
+ struct wmsTiledLayerStruct *lastChild;
+ struct wmsTiledLayerStruct *next;
+} wmsTiledLayer;
+typedef wmsTiledLayer *wmsTiledLayerPtr;
+
+typedef struct wmsLayerStruct
+{
+/* a struct wrapping a WMS Layer */
+ int Queryable;
+ int Opaque;
+ char *Name;
+ char *Title;
+ char *Abstract;
+ double MinScaleDenominator;
+ double MaxScaleDenominator;
+ double MinLat;
+ double MaxLat;
+ double MinLong;
+ double MaxLong;
+ wmsBBoxPtr firstBBox;
+ wmsBBoxPtr lastBBox;
+ wmsCrsPtr firstCrs;
+ wmsCrsPtr lastCrs;
+ wmsStylePtr firstStyle;
+ wmsStylePtr lastStyle;
+ struct wmsLayerStruct *Parent;
+ struct wmsLayerStruct *firstLayer;
+ struct wmsLayerStruct *lastLayer;
+ struct wmsLayerStruct *next;
+} wmsLayer;
+typedef wmsLayer *wmsLayerPtr;
+
+typedef struct wmsCapabilitiesStruct
+{
+/* a struct wrapping a WMS Capabilities answer */
+ char *Version;
+ char *Name;
+ char *Title;
+ char *Abstract;
+ char *GetMapURLGet;
+ char *GetMapURLPost;
+ char *GetFeatureInfoURLGet;
+ char *GetFeatureInfoURLPost;
+ char *GetTileServiceURLGet;
+ char *GetTileServiceURLPost;
+ char *GmlMimeType;
+ char *XmlMimeType;
+ char *ContactPerson;
+ char *ContactOrganization;
+ char *ContactPosition;
+ char *PostalAddress;
+ char *City;
+ char *StateProvince;
+ char *PostCode;
+ char *Country;
+ char *VoiceTelephone;
+ char *FaxTelephone;
+ char *EMailAddress;
+ char *Fees;
+ char *AccessConstraints;
+ int LayerLimit;
+ int MaxWidth;
+ int MaxHeight;
+ wmsFormatPtr firstFormat;
+ wmsFormatPtr lastFormat;
+ wmsLayerPtr firstLayer;
+ wmsLayerPtr lastLayer;
+ char *TileServiceName;
+ char *TileServiceTitle;
+ char *TileServiceAbstract;
+ wmsTiledLayerPtr firstTiled;
+ wmsTiledLayerPtr lastTiled;
+} wmsCapabilities;
+typedef wmsCapabilities *wmsCapabilitiesPtr;
+
+typedef struct wmsFeatureAttributeStruct
+{
+/* a struct wrapping a GML FeatureAtrribute */
+ char *name;
+ char *value;
+ gaiaGeomCollPtr geometry;
+ struct wmsFeatureAttributeStruct *next;
+} wmsFeatureAttribute;
+typedef wmsFeatureAttribute *wmsFeatureAttributePtr;
+
+typedef struct wmsFeatureMemberStruct
+{
+/* a struct wrapping a GML FeatureMember */
+ char *layer_name;
+ wmsFeatureAttributePtr first;
+ wmsFeatureAttributePtr last;
+ struct wmsFeatureMemberStruct *next;
+} wmsFeatureMember;
+typedef wmsFeatureMember *wmsFeatureMemberPtr;
+
+typedef struct wmsFeatureCollectionStruct
+{
+/* a struct wrapping a WMS FeatureInfo answer */
+ wmsFeatureMemberPtr first;
+ wmsFeatureMemberPtr last;
+} wmsFeatureCollection;
+typedef wmsFeatureCollection *wmsFeatureCollectionPtr;
+
+typedef struct wmsSinglePartResponseStruct
+{
+/* a struct wrapping a single part body response */
+ char *body;
+ struct wmsSinglePartResponseStruct *next;
+} wmsSinglePartResponse;
+typedef wmsSinglePartResponse *wmsSinglePartResponsePtr;
+
+typedef struct wmsMultipartCollectionStruct
+{
+/* a struct wrapping a Multipart HTTP response */
+ wmsSinglePartResponse *first;
+ wmsSinglePartResponse *last;
+} wmsMultipartCollection;
+typedef wmsMultipartCollection *wmsMultipartCollectionPtr;
+
+static wmsCachedItemPtr
+wmsAllocCachedItem (const char *url, const unsigned char *item, int size,
+ const char *image_format)
+{
+/* creating a WMS Cached Item */
+ int len;
+ time_t xtime;
+ wmsCachedItemPtr ptr = malloc (sizeof (wmsCachedItem));
+ len = strlen (url);
+ ptr->Url = malloc (len + 1);
+ strcpy (ptr->Url, url);
+ time (&xtime);
+ ptr->Time = xtime;
+ ptr->Size = size;
+ ptr->Item = malloc (size);
+ memcpy (ptr->Item, item, size);
+ ptr->ImageFormat = WMS_FORMAT_UNKNOWN;
+ if (strcmp (image_format, "image/gif") == 0)
+ ptr->ImageFormat = WMS_FORMAT_GIF;
+ if (strcmp (image_format, "image/png") == 0)
+ ptr->ImageFormat = WMS_FORMAT_PNG;
+ if (strcmp (image_format, "image/jpeg") == 0)
+ ptr->ImageFormat = WMS_FORMAT_JPEG;
+ if (strcmp (image_format, "image/tiff") == 0)
+ ptr->ImageFormat = WMS_FORMAT_TIFF;
+ ptr->Prev = NULL;
+ ptr->Next = NULL;
+ return ptr;
+}
+
+static void
+wmsFreeCachedItem (wmsCachedItemPtr ptr)
+{
+/* memory cleanup - destroying a WMS Cached Item */
+ if (ptr == NULL)
+ return;
+ if (ptr->Url != NULL)
+ free (ptr->Url);
+ if (ptr->Item != NULL)
+ free (ptr->Item);
+ free (ptr);
+}
+
+static wmsCachedCapabilitiesPtr
+wmsAllocCachedCapabilities (const char *url, const unsigned char *response,
+ int size)
+{
+/* creating a WMS Cached GetCapabilities response */
+ wmsCachedCapabilitiesPtr ptr = malloc (sizeof (wmsCachedCapabilities));
+ int len = strlen (url);
+ ptr->Url = malloc (len + 1);
+ strcpy (ptr->Url, url);
+ ptr->Response = malloc (size + 1);
+ memcpy (ptr->Response, response, size);
+ *(ptr->Response + size) = '\0';
+ ptr->Next = NULL;
+ return ptr;
+}
+
+static void
+wmsFreeCachedCapabilities (wmsCachedCapabilitiesPtr ptr)
+{
+/* memory cleanup - destroying a WMS Cached GetCapabilities Response */
+ if (ptr == NULL)
+ return;
+ if (ptr->Url != NULL)
+ free (ptr->Url);
+ if (ptr->Response != NULL)
+ free (ptr->Response);
+ free (ptr);
+}
+
+static wmsCachePtr
+wmsAllocCache (void)
+{
+/* creating a WMS Cache */
+ wmsCachePtr cache = malloc (sizeof (wmsCache));
+ cache->MaxSize = 64 * 1024 * 1024;
+ cache->CurrentSize = 0;
+ cache->FirstCapab = NULL;
+ cache->LastCapab = NULL;
+ cache->First = NULL;
+ cache->Last = NULL;
+ cache->NumCachedItems = 0;
+ cache->SortedByUrl = NULL;
+ cache->SortedByTime = NULL;
+ cache->HitCount = 0;
+ cache->MissCount = 0;
+ cache->FlushedCount = 0;
+ cache->TotalDownload = 0 - 0;
+ return cache;
+}
+
+static void
+wmsCacheReset (wmsCachePtr cache)
+{
+/* memory cleanup: flushing/resetting a WMS-Cache object */
+ wmsCachedItemPtr pI;
+ wmsCachedItemPtr pIn;
+ wmsCachedCapabilitiesPtr pC;
+ wmsCachedCapabilitiesPtr pCn;
+ if (cache == NULL)
+ return;
+
+ pC = cache->FirstCapab;
+ while (pC != NULL)
+ {
+ pCn = pC->Next;
+ wmsFreeCachedCapabilities (pC);
+ pC = pCn;
+ }
+ pI = cache->First;
+ while (pI != NULL)
+ {
+ pIn = pI->Next;
+ wmsFreeCachedItem (pI);
+ pI = pIn;
+ }
+ if (cache->SortedByUrl != NULL)
+ free (cache->SortedByUrl);
+ if (cache->SortedByTime != NULL)
+ free (cache->SortedByTime);
+ cache->CurrentSize = 0;
+ cache->First = NULL;
+ cache->Last = NULL;
+ cache->FirstCapab = NULL;
+ cache->LastCapab = NULL;
+ cache->NumCachedItems = 0;
+ cache->HitCount = 0;
+ cache->MissCount = 0;
+ cache->FlushedCount = 0;
+ cache->TotalDownload = 0.0;
+ cache->SortedByUrl = NULL;
+ cache->SortedByTime = NULL;
+}
+
+static void
+wmsFreeCache (wmsCachePtr cache)
+{
+/* memory cleanup: freeing a WMS-Cache object */
+ if (cache == NULL)
+ return;
+
+ wmsCacheReset (cache);
+ free (cache);
+}
+
+static int
+compare_time (const void *p1, const void *p2)
+{
+/* comparison function for QSort [Time] */
+ wmsCachedItemPtr pI1 = *((wmsCachedItemPtr *) p1);
+ wmsCachedItemPtr pI2 = *((wmsCachedItemPtr *) p2);
+ if (pI1->Time == pI2->Time)
+ return 0;
+ if (pI1->Time > pI2->Time)
+ return 1;
+ return -1;
+}
+
+static void
+wmsCacheUpdateTime (wmsCachePtr cache)
+{
+/* updating the SortedByTime array */
+ wmsCachedItemPtr pI;
+ int pos = 0;
+ if (cache == NULL)
+ return;
+ if (cache->SortedByTime != NULL)
+ free (cache->SortedByTime);
+ cache->SortedByTime = NULL;
+ if (cache->NumCachedItems <= 0)
+ return;
+ cache->SortedByTime =
+ malloc (sizeof (wmsCachedItemPtr) * cache->NumCachedItems);
+ pI = cache->First;
+ while (pI != NULL)
+ {
+ /* populating the array */
+ *(cache->SortedByTime + pos) = pI;
+ pos++;
+ pI = pI->Next;
+ }
+ qsort (cache->SortedByTime, cache->NumCachedItems,
+ sizeof (wmsCachedItemPtr), compare_time);
+}
+
+static int
+compare_url (const void *p1, const void *p2)
+{
+/* comparison function for QSort [Time] */
+ wmsCachedItemPtr pI1 = *((wmsCachedItemPtr *) p1);
+ wmsCachedItemPtr pI2 = *((wmsCachedItemPtr *) p2);
+ return strcmp (pI1->Url, pI2->Url);
+}
+
+static void
+wmsCacheUpdate (wmsCachePtr cache)
+{
+/* updating the SortedByUrl array */
+ wmsCachedItemPtr pI;
+ int pos = 0;
+ if (cache == NULL)
+ return;
+ if (cache->SortedByUrl != NULL)
+ free (cache->SortedByUrl);
+ cache->SortedByUrl = NULL;
+ if (cache->NumCachedItems <= 0)
+ return;
+ cache->SortedByUrl =
+ malloc (sizeof (wmsCachedItemPtr) * cache->NumCachedItems);
+ pI = cache->First;
+ while (pI != NULL)
+ {
+ /* populating the array */
+ *(cache->SortedByUrl + pos) = pI;
+ pos++;
+ pI = pI->Next;
+ }
+ qsort (cache->SortedByUrl, cache->NumCachedItems, sizeof (wmsCachedItemPtr),
+ compare_url);
+}
+
+static void
+wmsCacheSqueeze (wmsCachePtr cache, int limit)
+{
+/* squeezing the WMS Cache */
+ int i;
+ int max;
+ if (cache == NULL)
+ return;
+ if (cache->CurrentSize < limit)
+ return;
+ wmsCacheUpdateTime (cache);
+ max = cache->NumCachedItems;
+ for (i = 0; i < max; i++)
+ {
+ wmsCachedItemPtr pI = *(cache->SortedByTime + i);
+ if (pI->Prev != NULL)
+ pI->Prev->Next = pI->Next;
+ if (pI->Next != NULL)
+ pI->Next->Prev = pI->Prev;
+ if (cache->First == pI)
+ cache->First = pI->Next;
+ if (cache->Last == pI)
+ cache->Last = pI->Prev;
+ wmsFreeCachedItem (pI);
+ cache->NumCachedItems -= 1;
+ cache->CurrentSize -= pI->Size;
+ cache->FlushedCount += 1;
+ if (cache->CurrentSize < limit)
+ break;
+ }
+ if (cache->SortedByTime != NULL)
+ free (cache->SortedByTime);
+ cache->SortedByTime = NULL;
+}
+
+static void
+wmsAddCachedCapabilities (wmsCachePtr cache, const char *url,
+ const unsigned char *response, int size)
+{
+/* adding a new WMS Cached GetCapabilitiesItem */
+ wmsCachedCapabilitiesPtr ptr;
+ if (cache == NULL)
+ return;
+ ptr = wmsAllocCachedCapabilities (url, response, size);
+ if (cache->FirstCapab == NULL)
+ cache->FirstCapab = ptr;
+ if (cache->LastCapab != NULL)
+ cache->LastCapab->Next = ptr;
+ cache->LastCapab = ptr;
+ cache->TotalDownload += (double) size;
+}
+
+
+static void
+wmsAddCachedItem (wmsCachePtr cache, const char *url, const unsigned char *item,
+ int size, const char *image_format)
+{
+/* adding a new WMS Cached Item */
+ wmsCachedItemPtr ptr;
+ if (cache == NULL)
+ return;
+ if (cache->CurrentSize + size > cache->MaxSize)
+ wmsCacheSqueeze (cache, cache->MaxSize - size);
+ ptr = wmsAllocCachedItem (url, item, size, image_format);
+ ptr->Prev = cache->Last;
+ if (cache->First == NULL)
+ cache->First = ptr;
+ if (cache->Last != NULL)
+ cache->Last->Next = ptr;
+ cache->Last = ptr;
+ cache->NumCachedItems += 1;
+ cache->CurrentSize += size;
+ cache->TotalDownload += (double) size;
+ wmsCacheUpdate (cache);
+}
+
+static wmsCachedCapabilitiesPtr
+getWmsCachedCapabilities (wmsCachePtr cache, const char *url)
+{
+/* attempting to retrieve a cached GetCapabilities Response by URL */
+ wmsCachedCapabilitiesPtr capab;
+ if (cache == NULL)
+ return NULL;
+ capab = cache->FirstCapab;
+ while (capab != NULL)
+ {
+ if (strcmp (capab->Url, url) == 0)
+ return capab;
+ capab = capab->Next;
+ }
+ return NULL;
+}
+
+static wmsCachedItemPtr
+getWmsCachedItem (wmsCachePtr cache, const char *url)
+{
+/* attempting to retrieve a cached item by URL */
+ wmsCachedItem item;
+ wmsCachedItemPtr p_item = &item;
+ wmsCachedItemPtr found;
+ void *x;
+ item.Url = (char *) url;
+ if (cache == NULL)
+ return NULL;
+ if (cache->NumCachedItems <= 0)
+ return NULL;
+ if (cache->SortedByUrl == NULL)
+ return NULL;
+ x = bsearch (&p_item, cache->SortedByUrl, cache->NumCachedItems,
+ sizeof (wmsCachedItemPtr), compare_url);
+ if (x == NULL)
+ {
+ cache->MissCount += 1;
+ return NULL;
+ }
+ found = *((wmsCachedItemPtr *) x);
+ cache->HitCount += 1;
+ return found;
+}
+
+RL2_DECLARE rl2WmsCachePtr
+create_wms_cache (void)
+{
+/* creating a WMS Cache */
+ wmsCachePtr cache = wmsAllocCache ();
+ return (rl2WmsCachePtr) cache;
+}
+
+RL2_DECLARE void
+destroy_wms_cache (rl2WmsCachePtr handle)
+{
+/* memory cleanup: freeing a WMS-Cache object */
+ wmsCachePtr ptr = (wmsCachePtr) handle;
+ if (ptr == NULL)
+ return;
+ wmsFreeCache (ptr);
+}
+
+RL2_DECLARE void
+reset_wms_cache (rl2WmsCachePtr handle)
+{
+/* memory cleanup: flushing/resetting a WMS-Cache object */
+ wmsCachePtr ptr = (wmsCachePtr) handle;
+ if (ptr == NULL)
+ return;
+ wmsCacheReset (ptr);
+}
+
+RL2_DECLARE int
+get_wms_cache_max_size (rl2WmsCachePtr handle)
+{
+/* returns the MAX-SIZE from a WMS-Cache object */
+ wmsCachePtr ptr = (wmsCachePtr) handle;
+ if (ptr == NULL)
+ return -1;
+ return ptr->MaxSize;
+}
+
+RL2_DECLARE void
+set_wms_cache_max_size (rl2WmsCachePtr handle, int size)
+{
+/* changes the MAX-SIZE for a WMS-Cache object */
+ int min = 4 * 1024 * 1024;
+ int max = 256 * 1024 * 1024;
+ wmsCachePtr ptr = (wmsCachePtr) handle;
+ if (ptr == NULL)
+ return;
+ ptr->MaxSize = size;
+ if (ptr->MaxSize < min)
+ ptr->MaxSize = min;
+ if (ptr->MaxSize > max)
+ ptr->MaxSize = max;
+ if (ptr->CurrentSize > ptr->MaxSize)
+ {
+ wmsCacheSqueeze (ptr, ptr->MaxSize);
+ wmsCacheUpdate (ptr);
+ }
+}
+
+RL2_DECLARE int
+get_wms_cache_items_count (rl2WmsCachePtr handle)
+{
+/* returns the CURRENT-SIZE from a WMS-Cache object */
+ wmsCachePtr ptr = (wmsCachePtr) handle;
+ if (ptr == NULL)
+ return -1;
+ return ptr->NumCachedItems;
+}
+
+RL2_DECLARE int
+get_wms_cache_current_size (rl2WmsCachePtr handle)
+{
+/* returns the CURRENT-SIZE from a WMS-Cache object */
+ wmsCachePtr ptr = (wmsCachePtr) handle;
+ if (ptr == NULL)
+ return -1;
+ return ptr->CurrentSize;
+}
+
+RL2_DECLARE int
+get_wms_cache_hit_count (rl2WmsCachePtr handle)
+{
+/* returns the HIT-COUNT from a WMS-Cache object */
+ wmsCachePtr ptr = (wmsCachePtr) handle;
+ if (ptr == NULL)
+ return -1;
+ return ptr->HitCount;
+}
+
+RL2_DECLARE int
+get_wms_cache_miss_count (rl2WmsCachePtr handle)
+{
+/* returns the MISS-COUNT from a WMS-Cache object */
+ wmsCachePtr ptr = (wmsCachePtr) handle;
+ if (ptr == NULL)
+ return -1;
+ return ptr->MissCount;
+}
+
+RL2_DECLARE int
+get_wms_cache_flushed_count (rl2WmsCachePtr handle)
+{
+/* returns the FLUSHED-COUNT from a WMS-Cache object */
+ wmsCachePtr ptr = (wmsCachePtr) handle;
+ if (ptr == NULL)
+ return -1;
+ return ptr->FlushedCount;
+}
+
+RL2_DECLARE double
+get_wms_total_download_size (rl2WmsCachePtr handle)
+{
+/* returns the TOTAL-DOWNLOAD size from a WMS-Cache object */
+ wmsCachePtr ptr = (wmsCachePtr) handle;
+ if (ptr == NULL)
+ return -1;
+ return ptr->TotalDownload;
+}
+
+static wmsFormatPtr
+wmsAllocFormat (const char *format)
+{
+/* allocating an empty WMS Format object */
+ int len;
+ wmsFormatPtr fmt = malloc (sizeof (wmsFormat));
+ fmt->FormatCode = WMS_FORMAT_UNKNOWN;
+ if (strcmp (format, "image/jpeg") == 0)
+ fmt->FormatCode = WMS_FORMAT_JPEG;
+ if (strcmp (format, "image/tiff") == 0)
+ fmt->FormatCode = WMS_FORMAT_TIFF;
+ if (strcmp (format, "image/gif") == 0)
+ fmt->FormatCode = WMS_FORMAT_GIF;
+ if (strcmp (format, "image/png") == 0)
+ fmt->FormatCode = WMS_FORMAT_PNG;
+ if (strcmp (format, "image/png8") == 0)
+ fmt->FormatCode = WMS_FORMAT_PNG8;
+ if (strcmp (format, "image/png; mode=8bit") == 0)
+ fmt->FormatCode = WMS_FORMAT_PNG8;
+ if (strcmp (format, "image/png24") == 0)
+ fmt->FormatCode = WMS_FORMAT_PNG24;
+ if (strcmp (format, "image/png; mode=24bit") == 0)
+ fmt->FormatCode = WMS_FORMAT_PNG24;
+ if (strcmp (format, "image/png32") == 0)
+ fmt->FormatCode = WMS_FORMAT_PNG32;
+ if (strcmp (format, "image/png; mode=32bit") == 0)
+ fmt->FormatCode = WMS_FORMAT_PNG32;
+ len = strlen (format);
+ fmt->Format = malloc (len + 1);
+ strcpy (fmt->Format, format);
+ fmt->next = NULL;
+ return fmt;
+}
+
+static void
+wmsFreeFormat (wmsFormatPtr fmt)
+{
+/* memory cleanup - destroying a WMS Format object */
+ if (fmt == NULL)
+ return;
+ if (fmt->Format != NULL)
+ free (fmt->Format);
+ free (fmt);
+}
+
+static wmsCrsPtr
+wmsAllocCrs (const char *crs_str)
+{
+/* allocating a WMS CRS object */
+ int len;
+ wmsCrsPtr crs = malloc (sizeof (wmsCrs));
+ crs->Crs = NULL;
+ if (crs != NULL)
+ {
+ len = strlen (crs_str);
+ crs->Crs = malloc (len + 1);
+ strcpy (crs->Crs, crs_str);
+ }
+ crs->next = NULL;
+ return crs;
+}
+
+static void
+wmsFreeCrs (wmsCrsPtr crs)
+{
+/* memory cleanup - destroying a WMS CRS object */
+ if (crs == NULL)
+ return;
+ if (crs->Crs != NULL)
+ free (crs->Crs);
+ free (crs);
+}
+
+static wmsBBoxPtr
+wmsAllocBBox (const char *crs_str, double minx, double maxx, double miny,
+ double maxy)
+{
+/* allocating a WMS Bounding Box object */
+ int len;
+ wmsBBoxPtr bbox = malloc (sizeof (wmsBBox));
+ bbox->Crs = NULL;
+ if (bbox != NULL)
+ {
+ len = strlen (crs_str);
+ bbox->Crs = malloc (len + 1);
+ strcpy (bbox->Crs, crs_str);
+ }
+ bbox->MinX = minx;
+ bbox->MaxX = maxx;
+ bbox->MinY = miny;
+ bbox->MaxY = maxy;
+ bbox->next = NULL;
+ return bbox;
+}
+
+static void
+wmsFreeBBox (wmsBBoxPtr bbox)
+{
+/* memory cleanup - destroying a WMS BBOX object */
+ if (bbox == NULL)
+ return;
+ if (bbox->Crs != NULL)
+ free (bbox->Crs);
+ free (bbox);
+}
+
+static wmsStylePtr
+wmsAllocStyle (const char *name, const char *title, const char *abstract)
+{
+/* allocating a WMS Style object */
+ int len;
+ wmsStylePtr stl = malloc (sizeof (wmsStyle));
+ stl->Name = NULL;
+ stl->Title = NULL;
+ stl->Abstract = NULL;
+ if (name != NULL)
+ {
+ len = strlen (name);
+ stl->Name = malloc (len + 1);
+ strcpy (stl->Name, name);
+ }
+ if (title != NULL)
+ {
+ len = strlen (title);
+ stl->Title = malloc (len + 1);
+ strcpy (stl->Title, title);
+ }
+ if (abstract != NULL)
+ {
+ len = strlen (abstract);
+ stl->Abstract = malloc (len + 1);
+ strcpy (stl->Abstract, abstract);
+ }
+ stl->next = NULL;
+ return stl;
+}
+
+static void
+wmsFreeStyle (wmsStylePtr stl)
+{
+/* memory cleanup - destroying a WMS Style object */
+ if (stl == NULL)
+ return;
+ if (stl->Name != NULL)
+ free (stl->Name);
+ if (stl->Title != NULL)
+ free (stl->Title);
+ if (stl->Abstract != NULL)
+ free (stl->Abstract);
+ free (stl);
+}
+
+static wmsLayerPtr
+wmsAllocLayer (const char *name, const char *title, const char *abstract,
+ wmsLayerPtr parent)
+{
+/* allocating a WMS Layer object */
+ int len;
+ wmsLayerPtr lyr = malloc (sizeof (wmsLayer));
+ lyr->Queryable = -1;
+ lyr->Opaque = -1;
+ lyr->Name = NULL;
+ lyr->Title = NULL;
+ lyr->Abstract = NULL;
+ if (name != NULL)
+ {
+ len = strlen (name);
+ lyr->Name = malloc (len + 1);
+ strcpy (lyr->Name, name);
+ }
+ if (title != NULL)
+ {
+ len = strlen (title);
+ lyr->Title = malloc (len + 1);
+ strcpy (lyr->Title, title);
+ }
+ if (abstract != NULL)
+ {
+ len = strlen (abstract);
+ lyr->Abstract = malloc (len + 1);
+ strcpy (lyr->Abstract, abstract);
+ }
+ lyr->Parent = parent;
+ lyr->MinScaleDenominator = DBL_MAX;
+ lyr->MaxScaleDenominator = DBL_MAX;
+ lyr->MinLat = DBL_MAX;
+ lyr->MaxLat = DBL_MAX;
+ lyr->MinLong = DBL_MAX;
+ lyr->MaxLong = DBL_MAX;
+ lyr->firstBBox = NULL;
+ lyr->lastBBox = NULL;
+ lyr->firstCrs = NULL;
+ lyr->lastCrs = NULL;
+ lyr->firstStyle = NULL;
+ lyr->lastStyle = NULL;
+ lyr->firstLayer = NULL;
+ lyr->lastLayer = NULL;
+ lyr->next = NULL;
+ return lyr;
+}
+
+static void
+wmsFreeLayer (wmsLayerPtr lyr)
+{
+/* memory cleanup - destroying a WMS Layer object */
+ wmsCrsPtr pc;
+ wmsCrsPtr pcn;
+ wmsBBoxPtr pbb;
+ wmsBBoxPtr pbbn;
+ wmsStylePtr ps;
+ wmsStylePtr psn;
+ wmsLayerPtr pl;
+ wmsLayerPtr pln;
+ if (lyr == NULL)
+ return;
+ if (lyr->Name != NULL)
+ free (lyr->Name);
+ if (lyr->Title != NULL)
+ free (lyr->Title);
+ if (lyr->Abstract != NULL)
+ free (lyr->Abstract);
+ pc = lyr->firstCrs;
+ while (pc != NULL)
+ {
+ pcn = pc->next;
+ wmsFreeCrs (pc);
+ pc = pcn;
+ }
+ pbb = lyr->firstBBox;
+ while (pbb != NULL)
+ {
+ pbbn = pbb->next;
+ wmsFreeBBox (pbb);
+ pbb = pbbn;
+ }
+ ps = lyr->firstStyle;
+ while (ps != NULL)
+ {
+ psn = ps->next;
+ wmsFreeStyle (ps);
+ ps = psn;
+ }
+ pl = lyr->firstLayer;
+ while (pl != NULL)
+ {
+ pln = pl->next;
+ wmsFreeLayer (pl);
+ pl = pln;
+ }
+ free (lyr);
+}
+
+static wmsUrlArgumentPtr
+wmsAllocUrlArgument (char *arg_name, char *arg_value)
+{
+/* allocating a WMS URL Argument object */
+ wmsUrlArgumentPtr arg = malloc (sizeof (wmsUrlArgument));
+ arg->argName = arg_name;
+ arg->argValue = arg_value;
+ arg->next = NULL;
+ return arg;
+}
+
+static void
+wmsFreeUrlArgument (wmsUrlArgumentPtr arg)
+{
+/* memory cleanup - destroying a WMS URL Argument object */
+ if (arg == NULL)
+ return;
+ if (arg->argName != NULL)
+ free (arg->argName);
+ if (arg->argValue != NULL)
+ free (arg->argValue);
+ free (arg);
+}
+
+static void
+add_url_argument (wmsTilePatternPtr ptr, const char *pattern)
+{
+/* adding an URL argument */
+ char *name = NULL;
+ char *value = NULL;
+ const char *p = pattern;
+ const char *p_eq = pattern;
+ wmsUrlArgumentPtr arg;
+ int len;
+
+/* splitting arg Name and Value */
+ while (1)
+ {
+ if (*p == '=')
+ p_eq = p;
+ if (*p == '\0')
+ break;
+ p++;
+ }
+
+ len = p_eq - pattern;
+ if (len > 0)
+ {
+ /* arg Name */
+ name = malloc (len + 1);
+ memcpy (name, pattern, len);
+ *(name + len) = '\0';
+ }
+ len = strlen (p_eq + 1);
+ if (len > 0)
+ {
+ /* arg Value */
+ value = malloc (len + 1);
+ strcpy (value, p_eq + 1);
+ }
+
+ arg = wmsAllocUrlArgument (name, value);
+ if (ptr->first == NULL)
+ ptr->first = arg;
+ if (ptr->last != NULL)
+ ptr->last->next = arg;
+ ptr->last = arg;
+}
+
+static void
+parse_pattern_bbox (const char *value, double *minx, double *miny, double *maxx,
+ double *maxy)
+{
+/* parsing a BBOX arg [minx,miny,maxx,maxy] */
+ int step = 0;
+ const char *p_start = value;
+ const char *p_end = value;
+ *minx = DBL_MAX;
+ *miny = DBL_MAX;
+ *maxx = DBL_MAX;
+ *maxy = DBL_MAX;
+
+ while (1)
+ {
+ if (*p_end == ',' || *p_end == '\0')
+ {
+ int len = p_end - p_start;
+ char *str = malloc (len + 1);
+ memcpy (str, p_start, len);
+ *(str + len) = '\0';
+ if (step == 0)
+ *minx = atof (str);
+ if (step == 1)
+ *miny = atof (str);
+ if (step == 2)
+ *maxx = atof (str);
+ if (step == 3)
+ *maxy = atof (str);
+ step++;
+ free (str);
+ p_start = p_end + 1;
+ }
+ if (*p_end == '\0')
+ break;
+ p_end++;
+ }
+}
+
+static void
+parse_url_arguments (wmsTilePatternPtr ptr, const char *pattern)
+{
+/* parsing URL arguments */
+ const char *p_start = pattern;
+ const char *p_end = pattern;
+ while (1)
+ {
+ if (*p_end == '&' || *p_end == '\0')
+ {
+ int len = p_end - p_start;
+ char *arg = malloc (len + 1);
+ memcpy (arg, p_start, len);
+ *(arg + len) = '\0';
+ add_url_argument (ptr, arg);
+ free (arg);
+ p_start = p_end + 1;
+ }
+ if (*p_end == '\0')
+ break;
+ p_end++;
+ }
+}
+
+static wmsTilePatternPtr
+wmsAllocTilePattern (char *pattern)
+{
+/* allocating a WMS TilePattern object */
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ wmsUrlArgumentPtr pa;
+ wmsTilePatternPtr ptr = malloc (sizeof (wmsTilePattern));
+ ptr->Pattern = pattern;
+ ptr->Format = NULL;
+ ptr->SRS = NULL;
+ ptr->Style = NULL;
+ ptr->TileWidth = 0;
+ ptr->TileHeight = 0;
+ ptr->TileBaseX = DBL_MAX;
+ ptr->TileBaseY = DBL_MAX;
+ ptr->TileExtentX = DBL_MAX;
+ ptr->TileExtentY = DBL_MAX;
+ ptr->first = NULL;
+ ptr->last = NULL;
+ parse_url_arguments (ptr, pattern);
+ ptr->next = NULL;
+/* setting explicit values */
+ pa = ptr->first;
+ while (pa != NULL)
+ {
+ if (strcasecmp (pa->argName, "format") == 0)
+ ptr->Format = pa->argValue;
+ if (strcasecmp (pa->argName, "srs") == 0)
+ ptr->SRS = pa->argValue;
+ if (strcasecmp (pa->argName, "styles") == 0)
+ ptr->Style = pa->argValue;
+ if (strcasecmp (pa->argName, "width") == 0)
+ ptr->TileWidth = atoi (pa->argValue);
+ if (strcasecmp (pa->argName, "width") == 0)
+ ptr->TileHeight = atoi (pa->argValue);
+ if (strcasecmp (pa->argName, "bbox") == 0)
+ {
+ parse_pattern_bbox (pa->argValue, &minx, &miny, &maxx, &maxy);
+ ptr->TileBaseX = minx; /* leftmost coord */
+ ptr->TileBaseY = maxy; /* topmost coord */
+ ptr->TileExtentX = maxx - minx;
+ ptr->TileExtentY = maxy - miny;
+ }
+ pa = pa->next;
+ }
+ return ptr;
+}
+
+static void
+wmsFreeTilePattern (wmsTilePatternPtr pattern)
+{
+/* memory cleanup - destroying a WMS TilePattern object */
+ wmsUrlArgumentPtr pa;
+ wmsUrlArgumentPtr pan;
+ if (pattern == NULL)
+ return;
+ if (pattern->Pattern != NULL)
+ free (pattern->Pattern);
+ pa = pattern->first;
+ while (pa != NULL)
+ {
+ pan = pa->next;
+ wmsFreeUrlArgument (pa);
+ pa = pan;
+ }
+ free (pattern);
+}
+
+static wmsTiledLayerPtr
+wmsAllocTiledLayer (const char *name, const char *title, const char *abstract)
+{
+/* allocating a WMS TiledLayer object */
+ int len;
+ wmsTiledLayerPtr lyr = malloc (sizeof (wmsTiledLayer));
+ lyr->Name = NULL;
+ lyr->Title = NULL;
+ lyr->Abstract = NULL;
+ if (name != NULL)
+ {
+ len = strlen (name);
+ lyr->Name = malloc (len + 1);
+ strcpy (lyr->Name, name);
+ }
+ if (title != NULL)
+ {
+ len = strlen (title);
+ lyr->Title = malloc (len + 1);
+ strcpy (lyr->Title, title);
+ }
+ if (abstract != NULL)
+ {
+ len = strlen (abstract);
+ lyr->Abstract = malloc (len + 1);
+ strcpy (lyr->Abstract, abstract);
+ }
+ lyr->MinLat = DBL_MAX;
+ lyr->MaxLat = DBL_MAX;
+ lyr->MinLong = DBL_MAX;
+ lyr->MaxLong = DBL_MAX;
+ lyr->Pad = NULL;
+ lyr->Bands = NULL;
+ lyr->DataType = NULL;
+ lyr->firstPattern = NULL;
+ lyr->lastPattern = NULL;
+ lyr->firstChild = NULL;
+ lyr->lastChild = NULL;
+ lyr->next = NULL;
+ return lyr;
+}
+
+static void
+wmsFreeTiledLayer (wmsTiledLayerPtr lyr)
+{
+/* memory cleanup - destroying a WMS TiledLayer object */
+ wmsTilePatternPtr pp;
+ wmsTilePatternPtr ppn;
+ wmsTiledLayerPtr pt;
+ wmsTiledLayerPtr ptn;
+ if (lyr == NULL)
+ return;
+ if (lyr->Name != NULL)
+ free (lyr->Name);
+ if (lyr->Title != NULL)
+ free (lyr->Title);
+ if (lyr->Abstract != NULL)
+ free (lyr->Abstract);
+ if (lyr->Pad != NULL)
+ free (lyr->Pad);
+ if (lyr->Bands != NULL)
+ free (lyr->Bands);
+ if (lyr->DataType != NULL)
+ free (lyr->DataType);
+ pp = lyr->firstPattern;
+ while (pp != NULL)
+ {
+ ppn = pp->next;
+ wmsFreeTilePattern (pp);
+ pp = ppn;
+ }
+ pt = lyr->firstChild;
+ while (pt != NULL)
+ {
+ ptn = pt->next;
+ wmsFreeTiledLayer (pt);
+ pt = ptn;
+ }
+ free (lyr);
+}
+
+static wmsCapabilitiesPtr
+wmsAllocCapabilities ()
+{
+/* allocating an empty WMS GetCapabilities object */
+ wmsCapabilitiesPtr cap = malloc (sizeof (wmsCapabilities));
+ cap->Version = NULL;
+ cap->Name = NULL;
+ cap->Title = NULL;
+ cap->Abstract = NULL;
+ cap->GetMapURLGet = NULL;
+ cap->GetMapURLPost = NULL;
+ cap->GetFeatureInfoURLGet = NULL;
+ cap->GetFeatureInfoURLPost = NULL;
+ cap->GetTileServiceURLGet = NULL;
+ cap->GetTileServiceURLPost = NULL;
+ cap->GmlMimeType = NULL;
+ cap->XmlMimeType = NULL;
+ cap->ContactPerson = NULL;
+ cap->ContactOrganization = NULL;
+ cap->ContactPosition = NULL;
+ cap->PostalAddress = NULL;
+ cap->City = NULL;
+ cap->StateProvince = NULL;
+ cap->PostCode = NULL;
+ cap->Country = NULL;
+ cap->VoiceTelephone = NULL;
+ cap->FaxTelephone = NULL;
+ cap->EMailAddress = NULL;
+ cap->Fees = NULL;
+ cap->AccessConstraints = NULL;
+ cap->LayerLimit = -1;
+ cap->MaxWidth = -1;
+ cap->MaxHeight = -1;
+ cap->firstFormat = NULL;
+ cap->lastFormat = NULL;
+ cap->firstLayer = NULL;
+ cap->lastLayer = NULL;
+ cap->TileServiceName = NULL;
+ cap->TileServiceTitle = NULL;
+ cap->TileServiceAbstract = NULL;
+ cap->firstTiled = NULL;
+ cap->lastTiled = NULL;
+ return cap;
+}
+
+static void
+wmsFreeCapabilities (wmsCapabilitiesPtr cap)
+{
+/* memory cleanup - freeing a WMS Capabilities object */
+ wmsFormatPtr pf;
+ wmsFormatPtr pfn;
+ wmsLayerPtr pl;
+ wmsLayerPtr pln;
+ wmsTiledLayerPtr pt;
+ wmsTiledLayerPtr ptn;
+ if (cap == NULL)
+ return;
+ if (cap->Version)
+ free (cap->Version);
+ if (cap->Name)
+ free (cap->Name);
+ if (cap->Title)
+ free (cap->Title);
+ if (cap->Abstract)
+ free (cap->Abstract);
+ if (cap->GetMapURLGet)
+ free (cap->GetMapURLGet);
+ if (cap->GetMapURLPost)
+ free (cap->GetMapURLPost);
+ if (cap->GetFeatureInfoURLGet)
+ free (cap->GetFeatureInfoURLGet);
+ if (cap->GetFeatureInfoURLPost)
+ free (cap->GetFeatureInfoURLPost);
+ if (cap->GetTileServiceURLGet)
+ free (cap->GetTileServiceURLGet);
+ if (cap->GetTileServiceURLPost)
+ free (cap->GetTileServiceURLPost);
+ if (cap->GmlMimeType)
+ free (cap->GmlMimeType);
+ if (cap->XmlMimeType)
+ free (cap->XmlMimeType);
+ if (cap->ContactPerson)
+ free (cap->ContactPerson);
+ if (cap->ContactOrganization)
+ free (cap->ContactOrganization);
+ if (cap->ContactPosition)
+ free (cap->ContactPosition);
+ if (cap->PostalAddress)
+ free (cap->PostalAddress);
+ if (cap->City)
+ free (cap->City);
+ if (cap->StateProvince)
+ free (cap->StateProvince);
+ if (cap->PostCode)
+ free (cap->PostCode);
+ if (cap->Country)
+ free (cap->Country);
+ if (cap->VoiceTelephone)
+ free (cap->VoiceTelephone);
+ if (cap->FaxTelephone)
+ free (cap->FaxTelephone);
+ if (cap->EMailAddress)
+ free (cap->EMailAddress);
+ if (cap->Fees)
+ free (cap->Fees);
+ if (cap->AccessConstraints)
+ free (cap->AccessConstraints);
+ if (cap->TileServiceName)
+ free (cap->TileServiceName);
+ if (cap->TileServiceTitle)
+ free (cap->TileServiceTitle);
+ if (cap->TileServiceAbstract)
+ free (cap->TileServiceAbstract);
+ pf = cap->firstFormat;
+ while (pf != NULL)
+ {
+ pfn = pf->next;
+ wmsFreeFormat (pf);
+ pf = pfn;
+ }
+ pl = cap->firstLayer;
+ while (pl != NULL)
+ {
+ pln = pl->next;
+ wmsFreeLayer (pl);
+ pl = pln;
+ }
+ pt = cap->firstTiled;
+ while (pt != NULL)
+ {
+ ptn = pt->next;
+ wmsFreeTiledLayer (pt);
+ pt = ptn;
+ }
+ free (cap);
+}
+
+static wmsFeatureAttributePtr
+wmsAllocFeatureAttribute (const char *name, char *value)
+{
+/* allocating and initializing a GML Feature Attribute object */
+ int len;
+ wmsFeatureAttributePtr attr = malloc (sizeof (wmsFeatureAttribute));
+ len = strlen (name);
+ attr->name = malloc (len + 1);
+ strcpy (attr->name, name);
+ attr->value = value;
+ attr->geometry = NULL;
+ attr->next = NULL;
+ return attr;
+}
+
+static void
+wmsFreeFeatureAttribute (wmsFeatureAttributePtr attr)
+{
+/* memory cleanup - freeing a GML Feature Attribute object */
+ if (attr == NULL)
+ return;
+ if (attr->name != NULL)
+ free (attr->name);
+ if (attr->value != NULL)
+ free (attr->value);
+ if (attr->geometry != NULL)
+ gaiaFreeGeomColl (attr->geometry);
+ free (attr);
+}
+
+static wmsFeatureMemberPtr
+wmsAllocFeatureMember (const char *name)
+{
+/* allocating an empty GML Feature Member object */
+ int len;
+ wmsFeatureMemberPtr member = malloc (sizeof (wmsFeatureMember));
+ len = strlen (name);
+ member->layer_name = malloc (len + 1);
+ strcpy (member->layer_name, name);
+ member->first = NULL;
+ member->last = NULL;
+ member->next = NULL;
+ return member;
+}
+
+static void
+wmsFreeFeatureMember (wmsFeatureMemberPtr member)
+{
+/* memory cleanup - freeing a GML Feature Member object */
+ wmsFeatureAttributePtr pa;
+ wmsFeatureAttributePtr pan;
+ if (member == NULL)
+ return;
+ if (member->layer_name != NULL)
+ free (member->layer_name);
+ pa = member->first;
+ while (pa != NULL)
+ {
+ pan = pa->next;
+ wmsFreeFeatureAttribute (pa);
+ pa = pan;
+ }
+ free (member);
+}
+
+static void
+wmsAddFeatureMemberAttribute (wmsFeatureMemberPtr member, const char *name,
+ char *value)
+{
+/* adding an attribute+value to some GML Feature Member */
+ wmsFeatureAttributePtr attr;
+ if (member == NULL)
+ return;
+ attr = wmsAllocFeatureAttribute (name, value);
+ if (member->first == NULL)
+ member->first = attr;
+ if (member->last != NULL)
+ member->last->next = attr;
+ member->last = attr;
+}
+
+static wmsFeatureCollectionPtr
+wmsAllocFeatureCollection ()
+{
+/* allocating an empty GML Feature Collection object */
+ wmsFeatureCollectionPtr coll = malloc (sizeof (wmsFeatureCollection));
+ coll->first = NULL;
+ coll->last = NULL;
+ return coll;
+}
+
+static void
+wmsFreeFeatureCollection (wmsFeatureCollectionPtr coll)
+{
+/* memory cleanup - freeing a GML Feature Collection object */
+ wmsFeatureMemberPtr pm;
+ wmsFeatureMemberPtr pmn;
+ if (coll == NULL)
+ return;
+ pm = coll->first;
+ while (pm != NULL)
+ {
+ pmn = pm->next;
+ wmsFreeFeatureMember (pm);
+ pm = pmn;
+ }
+ free (coll);
+}
+
+static wmsSinglePartResponsePtr
+wmsAllocSinglePartResponse (char *body)
+{
+/* allocating and initializing a SinglePart Response */
+ wmsSinglePartResponsePtr single = malloc (sizeof (wmsSinglePartResponse));
+ single->body = body;
+ single->next = NULL;
+ return single;
+}
+
+static void
+wmsFreeSinglePartResponse (wmsSinglePartResponsePtr single)
+{
+/* memory cleanup - freeing a HTTP SinglePart Response object */
+ if (single == NULL)
+ return;
+ if (single->body != NULL)
+ free (single->body);
+ free (single);
+}
+
+static wmsMultipartCollectionPtr
+wmsAllocMultipartCollection ()
+{
+/* allocating an empty HTTP Multipart response object */
+ wmsMultipartCollectionPtr coll = malloc (sizeof (wmsMultipartCollection));
+ coll->first = NULL;
+ coll->last = NULL;
+ return coll;
+}
+
+static void
+wmsFreeMultipartCollection (wmsMultipartCollectionPtr coll)
+{
+/* memory cleanup - freeing a HTTP Multipart Collection object */
+ wmsSinglePartResponsePtr ps;
+ wmsSinglePartResponsePtr psn;
+ if (coll == NULL)
+ return;
+ ps = coll->first;
+ while (ps != NULL)
+ {
+ psn = ps->next;
+ wmsFreeSinglePartResponse (ps);
+ ps = psn;
+ }
+ free (coll);
+}
+
+static void
+wmsAddPartToMultipart (wmsMultipartCollectionPtr coll, char *body)
+{
+/* adding a SinglePart Response to the Collection */
+ wmsSinglePartResponsePtr single = wmsAllocSinglePartResponse (body);
+ if (coll->first == NULL)
+ coll->first = single;
+ if (coll->last != NULL)
+ coll->last->next = single;
+ coll->last = single;
+}
+
+static void
+wmsMemBufferInitialize (wmsMemBufferPtr buf)
+{
+/* initializing a dynamically growing output buffer */
+ buf->Buffer = NULL;
+ buf->WriteOffset = 0;
+ buf->BufferSize = 0;
+ buf->Error = 0;
+}
+
+static void
+wmsMemBufferReset (wmsMemBufferPtr buf)
+{
+/* cleaning a dynamically growing output buffer */
+ if (buf->Buffer)
+ free (buf->Buffer);
+ buf->Buffer = NULL;
+ buf->WriteOffset = 0;
+ buf->BufferSize = 0;
+ buf->Error = 0;
+}
+
+static void
+wmsMemBufferAppend (wmsMemBufferPtr buf, const unsigned char *payload,
+ size_t size)
+{
+/* appending into the buffer */
+ size_t free_size = buf->BufferSize - buf->WriteOffset;
+ if (size > free_size)
+ {
+ /* we must allocate a bigger buffer */
+ size_t new_size;
+ unsigned char *new_buf;
+ if (buf->BufferSize == 0)
+ new_size = size + 1024;
+ else if (buf->BufferSize <= 4196)
+ new_size = buf->BufferSize + size + 4196;
+ else if (buf->BufferSize <= 65536)
+ new_size = buf->BufferSize + size + 65536;
+ else
+ new_size = buf->BufferSize + size + (1024 * 1024);
+ new_buf = malloc (new_size);
+ if (!new_buf)
+ {
+ buf->Error = 1;
+ return;
+ }
+ if (buf->Buffer)
+ {
+ memcpy (new_buf, buf->Buffer, buf->WriteOffset);
+ free (buf->Buffer);
+ }
+ buf->Buffer = new_buf;
+ buf->BufferSize = new_size;
+ }
+ memcpy (buf->Buffer + buf->WriteOffset, payload, size);
+ buf->WriteOffset += size;
+}
+
+static wmsMultipartCollectionPtr
+parse_multipart_body (wmsMemBufferPtr buf, const char *multipart_boundary)
+{
+/* attempting to split a Multipart Response in its single parts */
+ const char *p_in;
+ char *marker = sqlite3_mprintf ("--%s\r\n", multipart_boundary);
+ char *marker_end = sqlite3_mprintf ("--%s--\r\n", multipart_boundary);
+ wmsMultipartCollectionPtr coll = wmsAllocMultipartCollection ();
+/* ensuring a NULL terminated string */
+ if (buf->BufferSize > buf->WriteOffset)
+ *(buf->Buffer + buf->WriteOffset) = '\0';
+ else
+ wmsMemBufferAppend (buf, (const unsigned char *) " ", 2);
+ p_in = (const char *) buf->Buffer;
+ while (p_in != NULL)
+ {
+ int len;
+ const char *start_body;
+ const char *stop;
+ const char *start = strstr (p_in, marker);
+ if (start == NULL)
+ break;
+ start_body = strstr (start, "\r\n\r\n");
+ if (start_body == NULL)
+ break;
+ start_body += 4;
+ stop = strstr (start_body, marker);
+ if (stop != NULL)
+ p_in = stop;
+ else
+ {
+ stop = strstr (start_body, marker_end);
+ if (stop == NULL)
+ break;
+ p_in = NULL;
+ }
+ stop -= 1;
+ len = stop - start_body + 1;
+ if (len > 0)
+ {
+ char *body;
+ body = malloc (len + 1);
+ memcpy (body, start_body, len);
+ *(body + len) = '\0';
+ wmsAddPartToMultipart (coll, body);
+ }
+ }
+ sqlite3_free (marker);
+ sqlite3_free (marker_end);
+ if (coll->first == NULL)
+ {
+ wmsFreeMultipartCollection (coll);
+ return NULL;
+ }
+ return coll;
+}
+
+static size_t
+store_data (char *ptr, size_t size, size_t nmemb, void *userdata)
+{
+/* updating the dynamic buffer */
+ size_t total = size * nmemb;
+ wmsMemBufferAppend (userdata, (unsigned char *) ptr, total);
+ return total;
+}
+
+static char *
+parse_http_format (wmsMemBufferPtr buf)
+{
+/* parsing the Content-Type from the HTTP header */
+ int i;
+ unsigned char *p_in = NULL;
+ unsigned char *base;
+ int size = 0;
+ char *tmp;
+
+ if (buf->Buffer == NULL)
+ return NULL;
+ for (i = 0; i < (int) (buf->WriteOffset) - 15; i++)
+ {
+ if (memcmp (buf->Buffer + i, "Content-Type: ", 14) == 0)
+ {
+ p_in = buf->Buffer + i + 14;
+ break;
+ }
+ }
+ if (p_in == NULL)
+ return NULL;
+
+/* attempting to retrieve the Content-Type */
+ base = p_in;
+ while ((size_t) (p_in - buf->Buffer) < buf->WriteOffset)
+ {
+ if (*p_in == '\r')
+ break;
+ size++;
+ p_in++;
+ }
+ if (size <= 0)
+ return NULL;
+ tmp = malloc (size + 1);
+ memcpy (tmp, base, size);
+ *(tmp + size) = '\0';
+ return tmp;
+}
+
+static char *
+parse_http_redirect (wmsMemBufferPtr buf)
+{
+/* parsing a redirect location from the HTTP header */
+ int i;
+ unsigned char *p_in = NULL;
+ unsigned char *base;
+ int size = 0;
+ char *tmp;
+
+ if (buf->Buffer == NULL)
+ return NULL;
+ for (i = 0; i < (int) (buf->WriteOffset) - 11; i++)
+ {
+ if (memcmp (buf->Buffer + i, "Location: ", 10) == 0)
+ {
+ p_in = buf->Buffer + i + 10;
+ break;
+ }
+ }
+ if (p_in == NULL)
+ return NULL;
+
+/* attempting to retrieve the new HTTP location */
+ base = p_in;
+ while ((size_t) (p_in - buf->Buffer) < buf->WriteOffset)
+ {
+ if (*p_in == '\r')
+ break;
+ size++;
+ p_in++;
+ }
+ if (size <= 0)
+ return NULL;
+ tmp = malloc (size + 1);
+ memcpy (tmp, base, size);
+ *(tmp + size) = '\0';
+ return tmp;
+}
+
+static void
+check_http_header (wmsMemBufferPtr buf, int *http_status, char **http_code)
+{
+/* checking the HTTP header */
+ unsigned char *p_in;
+ unsigned char *base_status;
+ unsigned char *base_code;
+ int size_status = 0;
+ int size_code = 0;
+ char *tmp;
+
+ *http_status = -1;
+ *http_code = NULL;
+ if (buf->Buffer == NULL)
+ return;
+ if (buf->WriteOffset < 10)
+ return;
+ if (memcmp (buf->Buffer, "HTTP/1.1 ", 9) != 0
+ && memcmp (buf->Buffer, "HTTP/1.0 ", 9) != 0)
+ return;
+
+/* attempting to retrieve the HTTP status */
+ p_in = buf->Buffer + 9;
+ base_status = p_in;
+ while ((size_t) (p_in - buf->Buffer) < buf->WriteOffset)
+ {
+ if (*p_in == ' ')
+ break;
+ size_status++;
+ p_in++;
+ }
+ if (size_status <= 0)
+ return;
+ tmp = malloc (size_status + 1);
+ memcpy (tmp, base_status, size_status);
+ *(tmp + size_status) = '\0';
+ *http_status = atoi (tmp);
+ free (tmp);
+
+/* attempting to retrieve the HTTP code */
+ p_in = buf->Buffer + 10 + size_status;
+ base_code = p_in;
+ while ((size_t) (p_in - buf->Buffer) < buf->WriteOffset)
+ {
+ if (*p_in == '\r')
+ break;
+ size_code++;
+ p_in++;
+ }
+ if (size_code <= 0)
+ return;
+ tmp = malloc (size_code + 1);
+ memcpy (tmp, base_code, size_code);
+ *(tmp + size_code) = '\0';
+ *http_code = tmp;
+}
+
+static char *
+check_http_multipart_response (wmsMemBufferPtr buf)
+{
+/* testing for a Content-Type: multipart returning an eventual Boundary delimiter */
+ int i;
+ unsigned char *p_in = NULL;
+ unsigned char *base;
+ int size = 0;
+ char *mime;
+ const char *boundary;
+ char *tmp;
+
+ if (buf->Buffer == NULL)
+ return NULL;
+ for (i = 0; i < (int) (buf->WriteOffset) - 15; i++)
+ {
+ if (memcmp (buf->Buffer + i, "Content-Type: ", 14) == 0)
+ {
+ p_in = buf->Buffer + i + 14;
+ break;
+ }
+ }
+ if (p_in == NULL)
+ return NULL;
+
+/* attempting to retrieve the Content-Type */
+ base = p_in;
+ while ((size_t) (p_in - buf->Buffer) < buf->WriteOffset)
+ {
+ if (*p_in == '\r')
+ break;
+ size++;
+ p_in++;
+ }
+ if (size <= 0)
+ return NULL;
+ mime = malloc (size + 1);
+ memcpy (mime, base, size);
+ *(mime + size) = '\0';
+ if (strncmp (mime, "multipart/", 10) != 0)
+ goto not_found;
+ boundary = strstr (mime, "boundary=");
+ if (boundary == NULL)
+ goto not_found;
+/* attempting to retrieve the Boundary */
+ size = strlen (boundary + 9);
+ if (size <= 0)
+ goto not_found;
+ tmp = malloc (size + 1);
+ strcpy (tmp, boundary + 9);
+ free (mime);
+ return tmp;
+ not_found:
+ free (mime);
+ return NULL;
+}
+
+static int
+start_cdata (const char *p_in, int i, int max)
+{
+/* testing for "<!CDATA[" - CDATA start marker */
+ if (i + 9 >= max)
+ return 0;
+ if (*(p_in + i) == '<' && *(p_in + i + 1) == '!' && *(p_in + i + 2) == '['
+ && *(p_in + i + 3) == 'C' && *(p_in + i + 4) == 'D'
+ && *(p_in + i + 5) == 'A' && *(p_in + i + 6) == 'T'
+ && *(p_in + i + 7) == 'A' && *(p_in + i + 8) == '[')
+ return 1;
+ return 0;
+}
+
+static int
+end_cdata (const char *p_in, int i)
+{
+/* testing for "]]>" - CDATA end marker */
+ if (i < 2)
+ return 0;
+ if (*(p_in + i - 2) == ']' && *(p_in + i - 1) == ']' && *(p_in + i) == '>')
+ return 1;
+ return 0;
+}
+
+static char *
+clean_xml (wmsMemBuffer * in)
+{
+/* cleaning the XML payload by removing useless whitespaces */
+ wmsMemBuffer outbuf;
+ char *out;
+ const char *p_in;
+ int i;
+ int j;
+ int cdata = 0;
+ int ignore = 0;
+ if (in->WriteOffset <= 0)
+ return NULL;
+ wmsMemBufferInitialize (&outbuf);
+
+ p_in = (const char *) (in->Buffer);
+ for (i = 0; i < (int) (in->WriteOffset); i++)
+ {
+ if (*(p_in + i) == '<')
+ {
+ if (!cdata)
+ {
+ if (start_cdata (p_in, i, in->WriteOffset))
+ {
+ i += 8;
+ cdata = 1;
+ continue;
+ }
+ for (j = outbuf.WriteOffset - 1; j > 0; j--)
+ {
+ /* consuming trailing whitespaces */
+ if (*(outbuf.Buffer + j) == ' '
+ || *(outbuf.Buffer + j) == '\t'
+ || *(outbuf.Buffer + j) == '\r'
+ || *(outbuf.Buffer + j) == '\n')
+ {
+ outbuf.WriteOffset -= 1;
+ continue;
+ }
+ break;
+ }
+ ignore = 0;
+ }
+ }
+ if (ignore)
+ {
+ if (*(p_in + i) == ' ' || *(p_in + i) == '\t'
+ || *(p_in + i) == '\r' || *(p_in + i) == '\n')
+ continue;
+ else
+ ignore = 0;
+ }
+ if (*(p_in + i) == '>' && cdata && end_cdata (p_in, i))
+ {
+ cdata = 0;
+ outbuf.WriteOffset -= 2;
+ continue;
+ }
+ if (cdata)
+ {
+ /* masking XML special characters */
+ if (*(p_in + i) == '<')
+ wmsMemBufferAppend (&outbuf, (const unsigned char *) "<",
+ 4);
+ else if (*(p_in + i) == '>')
+ wmsMemBufferAppend (&outbuf, (const unsigned char *) ">",
+ 4);
+ else if (*(p_in + i) == '&')
+ wmsMemBufferAppend (&outbuf,
+ (const unsigned char *) "&", 5);
+ else if (*(p_in + i) == '>')
+ wmsMemBufferAppend (&outbuf,
+ (const unsigned char *) """, 6);
+ else
+ wmsMemBufferAppend (&outbuf,
+ (const unsigned char *) (p_in + i), 1);
+ }
+ else
+ wmsMemBufferAppend (&outbuf, (const unsigned char *) (p_in + i),
+ 1);
+ if (*(p_in + i) == '>')
+ {
+ if (!cdata)
+ ignore = 1;
+ }
+ }
+ out = malloc (outbuf.WriteOffset + 1);
+ memcpy (out, outbuf.Buffer, outbuf.WriteOffset);
+ *(out + outbuf.WriteOffset) = '\0';
+ wmsMemBufferReset (&outbuf);
+ return out;
+}
+
+static char *
+clean_xml_str (const char *p_in)
+{
+/* cleaning the XML payload by removing useless whitespaces */
+ wmsMemBuffer outbuf;
+ char *out;
+ int i;
+ int j;
+ int cdata = 0;
+ int ignore = 0;
+ int len = strlen (p_in);
+ if (len <= 0)
+ return NULL;
+ wmsMemBufferInitialize (&outbuf);
+
+ for (i = 0; i < len; i++)
+ {
+ if (*(p_in + i) == '<')
+ {
+ if (!cdata)
+ {
+ if (start_cdata (p_in, i, len))
+ {
+ i += 8;
+ cdata = 1;
+ continue;
+ }
+ for (j = outbuf.WriteOffset - 1; j > 0; j--)
+ {
+ /* consuming trailing whitespaces */
+ if (*(outbuf.Buffer + j) == ' '
+ || *(outbuf.Buffer + j) == '\t'
+ || *(outbuf.Buffer + j) == '\r'
+ || *(outbuf.Buffer + j) == '\n')
+ {
+ outbuf.WriteOffset -= 1;
+ continue;
+ }
+ break;
+ }
+ ignore = 0;
+ }
+ }
+ if (ignore)
+ {
+ if (*(p_in + i) == ' ' || *(p_in + i) == '\t'
+ || *(p_in + i) == '\r' || *(p_in + i) == '\n')
+ continue;
+ else
+ ignore = 0;
+ }
+ if (*(p_in + i) == '>' && cdata && end_cdata (p_in, i))
+ {
+ cdata = 0;
+ outbuf.WriteOffset -= 2;
+ continue;
+ }
+ if (cdata)
+ {
+ /* masking XML special characters */
+ if (*(p_in + i) == '<')
+ wmsMemBufferAppend (&outbuf, (const unsigned char *) "<",
+ 4);
+ else if (*(p_in + i) == '>')
+ wmsMemBufferAppend (&outbuf, (const unsigned char *) ">",
+ 4);
+ else if (*(p_in + i) == '&')
+ wmsMemBufferAppend (&outbuf,
+ (const unsigned char *) "&", 5);
+ else if (*(p_in + i) == '>')
+ wmsMemBufferAppend (&outbuf,
+ (const unsigned char *) """, 6);
+ else
+ wmsMemBufferAppend (&outbuf,
+ (const unsigned char *) (p_in + i), 1);
+ }
+ else
+ wmsMemBufferAppend (&outbuf, (const unsigned char *) (p_in + i),
+ 1);
+ if (*(p_in + i) == '>')
+ {
+ if (!cdata)
+ ignore = 1;
+ }
+ }
+ out = malloc (outbuf.WriteOffset + 1);
+ memcpy (out, outbuf.Buffer, outbuf.WriteOffset);
+ *(out + outbuf.WriteOffset) = '\0';
+ wmsMemBufferReset (&outbuf);
+ return out;
+}
+
+static void
+wmsParsingError (void *ctx, const char *msg, ...)
+{
+/* appending to the current Parsing Error buffer */
+ wmsMemBufferPtr buf = (wmsMemBufferPtr) ctx;
+ char out[65536];
+ va_list args;
+
+ if (ctx != NULL)
+ ctx = NULL; /* suppressing stupid compiler warnings (unused args) */
+
+ va_start (args, msg);
+ vsnprintf (out, 65536, msg, args);
+ wmsMemBufferAppend (buf, (unsigned char *) out, strlen (out));
+ va_end (args);
+}
+
+static void
+parse_wms_EX_geoBBox (xmlNodePtr node, wmsLayerPtr lyr)
+{
+/* parsing a WMS Layer/EX_GeographicBoundingBox */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "southBoundLatitude") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ lyr->MinLat =
+ atof ((const char *) (child_node->content));
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "northBoundLatitude") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ lyr->MaxLat =
+ atof ((const char *) (child_node->content));
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "westBoundLongitude") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ lyr->MinLong =
+ atof ((const char *) (child_node->content));
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "eastBoundLongitude") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ lyr->MaxLong =
+ atof ((const char *) (child_node->content));
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_geoBBox (struct _xmlAttr *properties, wmsLayerPtr lyr)
+{
+/* parsing a WMS Layer/LatLonBoundingBox */
+ struct _xmlAttr *attr = properties;
+
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ xmlNodePtr text;
+ if (strcmp ((const char *) (attr->name), "miny") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->MinLat = atof ((const char *) (text->content));
+ }
+ if (strcmp ((const char *) (attr->name), "maxy") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->MaxLat = atof ((const char *) (text->content));
+ }
+ if (strcmp ((const char *) (attr->name), "minx") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->MinLong = atof ((const char *) (text->content));
+ }
+ if (strcmp ((const char *) (attr->name), "maxx") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->MaxLong = atof ((const char *) (text->content));
+ }
+ }
+ attr = attr->next;
+ }
+}
+
+static void
+parse_wms_BBox (struct _xmlAttr *properties, wmsLayerPtr lyr)
+{
+/* parsing a WMS Layer/BoundingBox */
+ struct _xmlAttr *attr = properties;
+ const char *crs = NULL;
+ double minx = DBL_MAX;
+ double maxx = DBL_MAX;
+ double miny = DBL_MAX;
+ double maxy = DBL_MAX;
+ wmsBBoxPtr bbox;
+
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ xmlNodePtr text;
+ if (strcmp ((const char *) (attr->name), "CRS") == 0
+ || strcmp ((const char *) (attr->name), "SRS") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ crs = (const char *) (text->content);
+ }
+ if (strcmp ((const char *) (attr->name), "miny") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ miny = atof ((const char *) (text->content));
+ }
+ if (strcmp ((const char *) (attr->name), "maxy") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ maxy = atof ((const char *) (text->content));
+ }
+ if (strcmp ((const char *) (attr->name), "minx") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ minx = atof ((const char *) (text->content));
+ }
+ if (strcmp ((const char *) (attr->name), "maxx") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ maxx = atof ((const char *) (text->content));
+ }
+ }
+ attr = attr->next;
+ }
+ bbox = wmsAllocBBox (crs, minx, maxx, miny, maxy);
+ if (lyr->firstBBox == NULL)
+ lyr->firstBBox = bbox;
+ if (lyr->lastBBox != NULL)
+ lyr->lastBBox->next = bbox;
+ lyr->lastBBox = bbox;
+}
+
+static void
+parse_wms_style (xmlNodePtr node, wmsLayerPtr lyr)
+{
+/* parsing a WMS Style definition */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+ const char *name = NULL;
+ const char *title = NULL;
+ const char *abstract = NULL;
+ wmsStylePtr stl;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Name") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ name = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Title") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ title = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Abstract") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ abstract = (const char *) (child_node->content);
+ }
+ }
+ }
+ }
+
+ stl = wmsAllocStyle (name, title, abstract);
+ if (lyr->firstStyle == NULL)
+ lyr->firstStyle = stl;
+ if (lyr->lastStyle != NULL)
+ lyr->lastStyle->next = stl;
+ lyr->lastStyle = stl;
+}
+
+static void
+parse_wms_layer_in_layer (xmlNodePtr node, struct _xmlAttr *properties,
+ wmsLayerPtr group, int level)
+{
+/* recursively parsing a WMS Layer definition (2nd level) */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+ const char *name = NULL;
+ const char *title = NULL;
+ const char *abstract = NULL;
+ wmsLayerPtr lyr;
+ struct _xmlAttr *attr;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Name") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ name = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Title") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ title = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Abstract") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ abstract = (const char *) (child_node->content);
+ }
+ }
+ }
+ }
+ lyr = wmsAllocLayer (name, title, abstract, group);
+ if (group->firstLayer == NULL)
+ group->firstLayer = lyr;
+ if (group->lastLayer != NULL)
+ group->lastLayer->next = lyr;
+ group->lastLayer = lyr;
+
+ attr = properties;
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ xmlNodePtr text;
+ if (strcmp ((const char *) (attr->name), "queryable") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->Queryable =
+ atoi ((const char *) (text->content));
+ }
+ if (strcmp ((const char *) (attr->name), "opaque") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->Opaque = atoi ((const char *) (text->content));
+ }
+ }
+ attr = attr->next;
+ }
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "CRS") == 0
+ || strcmp ((const char *) (cur_node->name), "SRS") == 0)
+ {
+ xmlNodePtr child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ wmsCrsPtr crs;
+ const char *crs_string =
+ (const char *) (child_node->content);
+ crs = wmsAllocCrs (crs_string);
+ if (lyr->firstCrs == NULL)
+ lyr->firstCrs = crs;
+ if (lyr->lastCrs != NULL)
+ lyr->lastCrs->next = crs;
+ lyr->lastCrs = crs;
+ }
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "EX_GeographicBoundingBox") == 0)
+ parse_wms_EX_geoBBox (cur_node->children, lyr);
+ if (strcmp
+ ((const char *) (cur_node->name), "LatLonBoundingBox") == 0)
+ parse_wms_geoBBox (cur_node->properties, lyr);
+ if (strcmp ((const char *) (cur_node->name), "BoundingBox") ==
+ 0)
+ parse_wms_BBox (cur_node->properties, lyr);
+ if (strcmp ((const char *) (cur_node->name), "Style") == 0)
+ parse_wms_style (cur_node->children, lyr);
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "MinScaleDenominator") == 0)
+ {
+ xmlNodePtr child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ const char *str =
+ (const char *) (child_node->content);
+ lyr->MinScaleDenominator = atof (str);
+ }
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "MaxScaleDenominator") == 0)
+ {
+ xmlNodePtr child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ const char *str =
+ (const char *) (child_node->content);
+ lyr->MaxScaleDenominator = atof (str);
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Layer") == 0)
+ parse_wms_layer_in_layer (cur_node->children,
+ cur_node->properties, lyr,
+ level + 1);
+ }
+ }
+}
+
+static void
+parse_wms_layer (xmlNodePtr node, struct _xmlAttr *properties,
+ wmsCapabilitiesPtr cap)
+{
+/* parsing a WMS Layer definition */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+ const char *name = NULL;
+ const char *title = NULL;
+ const char *abstract = NULL;
+ wmsLayerPtr lyr;
+ struct _xmlAttr *attr;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Name") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ name = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Title") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ title = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Abstract") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ abstract = (const char *) (child_node->content);
+ }
+ }
+ }
+ }
+ lyr = wmsAllocLayer (name, title, abstract, NULL);
+ if (cap->firstLayer == NULL)
+ cap->firstLayer = lyr;
+ if (cap->lastLayer != NULL)
+ cap->lastLayer->next = lyr;
+ cap->lastLayer = lyr;
+
+ attr = properties;
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ xmlNodePtr text;
+ if (strcmp ((const char *) (attr->name), "queryable") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->Queryable =
+ atoi ((const char *) (text->content));
+ }
+ if (strcmp ((const char *) (attr->name), "opaque") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->Opaque = atoi ((const char *) (text->content));
+ }
+ }
+ attr = attr->next;
+ }
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "CRS") == 0
+ || strcmp ((const char *) (cur_node->name), "SRS") == 0)
+ {
+ xmlNodePtr child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ wmsCrsPtr crs;
+ const char *crs_string =
+ (const char *) (child_node->content);
+ crs = wmsAllocCrs (crs_string);
+ if (lyr->firstCrs == NULL)
+ lyr->firstCrs = crs;
+ if (lyr->lastCrs != NULL)
+ lyr->lastCrs->next = crs;
+ lyr->lastCrs = crs;
+ }
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "EX_GeographicBoundingBox") == 0)
+ parse_wms_EX_geoBBox (cur_node->children, lyr);
+ if (strcmp
+ ((const char *) (cur_node->name), "LatLonBoundingBox") == 0)
+ parse_wms_geoBBox (cur_node->properties, lyr);
+ if (strcmp ((const char *) (cur_node->name), "BoundingBox") ==
+ 0)
+ parse_wms_BBox (cur_node->properties, lyr);
+ if (strcmp ((const char *) (cur_node->name), "Style") == 0)
+ parse_wms_style (cur_node->children, lyr);
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "MinScaleDenominator") == 0)
+ {
+ xmlNodePtr child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ const char *str =
+ (const char *) (child_node->content);
+ lyr->MinScaleDenominator = atof (str);
+ }
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "MaxScaleDenominator") == 0)
+ {
+ xmlNodePtr child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ const char *str =
+ (const char *) (child_node->content);
+ lyr->MaxScaleDenominator = atof (str);
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Layer") == 0)
+ parse_wms_layer_in_layer (cur_node->children,
+ cur_node->properties, lyr, 0);
+ }
+ }
+}
+
+static void
+parse_wms_contact_person (xmlNodePtr node, const char **contact_person,
+ const char **contact_organization)
+{
+/* parsing a WMS ContactPersonPrimary definition */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "ContactOrganization") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ *contact_organization =
+ (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "ContactPerson") ==
+ 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ *contact_person =
+ (const char *) (child_node->content);
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_contact_address (xmlNodePtr node, const char **postal_address,
+ const char **city, const char **state_province,
+ const char **post_code, const char **country)
+{
+/* parsing a WMS ContactAddress definition */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Address") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ *postal_address =
+ (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "City") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ *city = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "StateOrProvince")
+ == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ *state_province =
+ (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "PostCode") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ *post_code =
+ (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Country") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ *country = (const char *) (child_node->content);
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_contact_information (xmlNodePtr node, const char **contact_person,
+ const char **contact_organization,
+ const char **contact_position,
+ const char **postal_address, const char **city,
+ const char **state_province,
+ const char **post_code, const char **country,
+ const char **voice_telephone,
+ const char **fax_telephone,
+ const char **email_address)
+{
+/* parsing a WMS ContactInformation definition */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "ContactPosition")
+ == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ *contact_position =
+ (const char *) (child_node->content);
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "ContactPersonPrimary") == 0)
+ parse_wms_contact_person (cur_node->children,
+ contact_person,
+ contact_organization);
+ if (strcmp ((const char *) (cur_node->name), "ContactAddress")
+ == 0)
+ parse_wms_contact_address (cur_node->children,
+ postal_address, city,
+ state_province, post_code,
+ country);
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "ContactVoiceTelephone") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ *voice_telephone =
+ (const char *) (child_node->content);
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "ContactFacsimileTelephone") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ *fax_telephone =
+ (const char *) (child_node->content);
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "ContactElectronicMailAddress") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ *email_address =
+ (const char *) (child_node->content);
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_service (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* parsing a WMS Service definition */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+ const char *name = NULL;
+ const char *title = NULL;
+ const char *abstract = NULL;
+ const char *contact_person = NULL;
+ const char *contact_organization = NULL;
+ const char *contact_position = NULL;
+ const char *postal_address = NULL;
+ const char *city = NULL;
+ const char *state_province = NULL;
+ const char *post_code = NULL;
+ const char *country = NULL;
+ const char *voice_telephone = NULL;
+ const char *fax_telephone = NULL;
+ const char *email_address = NULL;
+ const char *fees = NULL;
+ const char *access_constraints = NULL;
+ int layer_limit = -1;
+ int maxWidth = -1;
+ int maxHeight = -1;
+ int len;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Name") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ name = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Title") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ title = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Abstract") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ abstract = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name),
+ "ContactInformation") == 0)
+ parse_wms_contact_information (cur_node->children,
+ &contact_person,
+ &contact_organization,
+ &contact_position,
+ &postal_address, &city,
+ &state_province, &post_code,
+ &country, &voice_telephone,
+ &fax_telephone,
+ &email_address);
+ if (strcmp ((const char *) (cur_node->name), "Fees") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ fees = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp
+ ((const char *) (cur_node->name), "AccessConstraints") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ access_constraints =
+ (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "LayerLimit") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ layer_limit =
+ atoi ((const char *) (child_node->content));
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "MaxWidth") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ maxWidth =
+ atoi ((const char *) (child_node->content));
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "MaxHeight") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ maxHeight =
+ atoi ((const char *) (child_node->content));
+ }
+ }
+ }
+ }
+
+ if (cap->Name != NULL)
+ {
+ free (cap->Name);
+ cap->Name = NULL;
+ }
+ if (name != NULL)
+ {
+ len = strlen (name);
+ cap->Name = malloc (len + 1);
+ strcpy (cap->Name, name);
+ }
+ if (cap->Title != NULL)
+ {
+ free (cap->Title);
+ cap->Title = NULL;
+ }
+ if (title != NULL)
+ {
+ len = strlen (title);
+ cap->Title = malloc (len + 1);
+ strcpy (cap->Title, title);
+ }
+ if (cap->Abstract != NULL)
+ {
+ free (cap->Abstract);
+ cap->Abstract = NULL;
+ }
+ if (abstract != NULL)
+ {
+ len = strlen (abstract);
+ cap->Abstract = malloc (len + 1);
+ strcpy (cap->Abstract, abstract);
+ }
+ if (contact_person != NULL)
+ {
+ len = strlen (contact_person);
+ cap->ContactPerson = malloc (len + 1);
+ strcpy (cap->ContactPerson, contact_person);
+ }
+ if (contact_organization != NULL)
+ {
+ len = strlen (contact_organization);
+ cap->ContactOrganization = malloc (len + 1);
+ strcpy (cap->ContactOrganization, contact_organization);
+ }
+ if (contact_position != NULL)
+ {
+ len = strlen (contact_position);
+ cap->ContactPosition = malloc (len + 1);
+ strcpy (cap->ContactPosition, contact_position);
+ }
+ if (postal_address != NULL)
+ {
+ len = strlen (postal_address);
+ cap->PostalAddress = malloc (len + 1);
+ strcpy (cap->PostalAddress, postal_address);
+ }
+ if (city != NULL)
+ {
+ len = strlen (city);
+ cap->City = malloc (len + 1);
+ strcpy (cap->City, city);
+ }
+ if (state_province != NULL)
+ {
+ len = strlen (state_province);
+ cap->StateProvince = malloc (len + 1);
+ strcpy (cap->StateProvince, state_province);
+ }
+ if (post_code != NULL)
+ {
+ len = strlen (post_code);
+ cap->PostCode = malloc (len + 1);
+ strcpy (cap->PostCode, post_code);
+ }
+ if (country != NULL)
+ {
+ len = strlen (country);
+ cap->Country = malloc (len + 1);
+ strcpy (cap->Country, country);
+ }
+ if (voice_telephone != NULL)
+ {
+ len = strlen (voice_telephone);
+ cap->VoiceTelephone = malloc (len + 1);
+ strcpy (cap->VoiceTelephone, voice_telephone);
+ }
+ if (fax_telephone != NULL)
+ {
+ len = strlen (fax_telephone);
+ cap->FaxTelephone = malloc (len + 1);
+ strcpy (cap->FaxTelephone, fax_telephone);
+ }
+ if (email_address != NULL)
+ {
+ len = strlen (email_address);
+ cap->EMailAddress = malloc (len + 1);
+ strcpy (cap->EMailAddress, email_address);
+ }
+ if (fees != NULL)
+ {
+ len = strlen (fees);
+ cap->Fees = malloc (len + 1);
+ strcpy (cap->Fees, fees);
+ }
+ if (access_constraints != NULL)
+ {
+ len = strlen (access_constraints);
+ cap->AccessConstraints = malloc (len + 1);
+ strcpy (cap->AccessConstraints, access_constraints);
+ }
+ if (layer_limit > 0)
+ cap->LayerLimit = layer_limit;
+ if (maxWidth > 0)
+ cap->MaxWidth = maxWidth;
+ if (maxHeight > 0)
+ cap->MaxHeight = maxHeight;
+}
+
+static void
+parse_wms_GetMap_HTTP_Get (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetMap/DCPType/HTTP/Get node */
+ xmlNodePtr cur_node = NULL;
+ int len;
+ const char *p;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "OnlineResource")
+ == 0)
+ {
+ struct _xmlAttr *attr = cur_node->properties;
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ if (strcmp
+ ((const char *) (attr->name),
+ "href") == 0)
+ {
+ xmlNodePtr text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ {
+ if (cap->GetMapURLGet != NULL)
+ {
+ free (cap->GetMapURLGet);
+ cap->GetMapURLGet = NULL;
+ }
+ p = (const char
+ *) (text->content);
+ len = strlen (p);
+ cap->GetMapURLGet =
+ malloc (len + 1);
+ strcpy (cap->GetMapURLGet, p);
+ }
+ }
+ }
+ attr = attr->next;
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_GetMap_HTTP_Post (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetMap/DCPType/HTTP/Post node */
+ xmlNodePtr cur_node = NULL;
+ int len;
+ const char *p;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "OnlineResource")
+ == 0)
+ {
+ struct _xmlAttr *attr = cur_node->properties;
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ if (strcmp
+ ((const char *) (attr->name),
+ "href") == 0)
+ {
+ xmlNodePtr text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ {
+ if (cap->GetMapURLPost != NULL)
+ {
+ free (cap->GetMapURLPost);
+ cap->GetMapURLPost = NULL;
+ }
+ p = (const char
+ *) (text->content);
+ len = strlen (p);
+ cap->GetMapURLPost =
+ malloc (len + 1);
+ strcpy (cap->GetMapURLPost, p);
+ }
+ }
+ }
+ attr = attr->next;
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_GetTileService_HTTP_Get (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetTileService/DCPType/HTTP/Get node */
+ xmlNodePtr cur_node = NULL;
+ int len;
+ const char *p;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "OnlineResource")
+ == 0)
+ {
+ struct _xmlAttr *attr = cur_node->properties;
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ if (strcmp
+ ((const char *) (attr->name),
+ "href") == 0)
+ {
+ xmlNodePtr text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ {
+ if (cap->GetTileServiceURLGet !=
+ NULL)
+ {
+ free (cap->
+ GetTileServiceURLGet);
+ cap->GetMapURLGet = NULL;
+ }
+ p = (const char
+ *) (text->content);
+ len = strlen (p);
+ cap->GetTileServiceURLGet =
+ malloc (len + 1);
+ strcpy (cap->GetTileServiceURLGet,
+ p);
+ }
+ }
+ }
+ attr = attr->next;
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_GetTileService_HTTP_Post (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetTileService/DCPType/HTTP/Post node */
+ xmlNodePtr cur_node = NULL;
+ int len;
+ const char *p;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "OnlineResource")
+ == 0)
+ {
+ struct _xmlAttr *attr = cur_node->properties;
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ if (strcmp
+ ((const char *) (attr->name),
+ "href") == 0)
+ {
+ xmlNodePtr text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ {
+ if (cap->GetTileServiceURLPost !=
+ NULL)
+ {
+ free (cap->
+ GetTileServiceURLPost);
+ cap->GetTileServiceURLPost =
+ NULL;
+ }
+ p = (const char
+ *) (text->content);
+ len = strlen (p);
+ cap->GetTileServiceURLPost =
+ malloc (len + 1);
+ strcpy
+ (cap->GetTileServiceURLPost,
+ p);
+ }
+ }
+ }
+ attr = attr->next;
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_GetInfo_HTTP_Get (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetFeatureInfo/DCPType/HTTP/Get node */
+ xmlNodePtr cur_node = NULL;
+ int len;
+ const char *p;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "OnlineResource")
+ == 0)
+ {
+ struct _xmlAttr *attr = cur_node->properties;
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ if (strcmp
+ ((const char *) (attr->name),
+ "href") == 0)
+ {
+ xmlNodePtr text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ {
+ if (cap->GetFeatureInfoURLGet !=
+ NULL)
+ {
+ free (cap->GetFeatureInfoURLGet);
+ cap->GetFeatureInfoURLGet =
+ NULL;
+ }
+ p = (const char
+ *) (text->content);
+ len = strlen (p);
+ cap->GetFeatureInfoURLGet =
+ malloc (len + 1);
+ strcpy (cap->GetFeatureInfoURLGet,
+ p);
+ }
+ }
+ }
+ attr = attr->next;
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_GetInfo_HTTP_Post (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetFeatureInfo/DCPType/HTTP/Post node */
+ xmlNodePtr cur_node = NULL;
+ int len;
+ const char *p;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "OnlineResource")
+ == 0)
+ {
+ struct _xmlAttr *attr = cur_node->properties;
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ if (strcmp
+ ((const char *) (attr->name),
+ "href") == 0)
+ {
+ xmlNodePtr text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ {
+ if (cap->GetFeatureInfoURLPost !=
+ NULL)
+ {
+ free (cap->GetFeatureInfoURLPost);
+ cap->GetFeatureInfoURLPost =
+ NULL;
+ }
+ p = (const char
+ *) (text->content);
+ len = strlen (p);
+ cap->GetFeatureInfoURLPost =
+ malloc (len + 1);
+ strcpy
+ (cap->GetFeatureInfoURLPost,
+ p);
+ }
+ }
+ }
+ attr = attr->next;
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_GetMap_HTTP (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetMap/DCPType node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Get") == 0)
+ parse_wms_GetMap_HTTP_Get (cur_node->children, cap);
+ if (strcmp ((const char *) (cur_node->name), "Post") == 0)
+ parse_wms_GetMap_HTTP_Post (cur_node->children, cap);
+ }
+ }
+}
+
+static void
+parse_wms_GetTileService_HTTP (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetTileService/DCPType node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Get") == 0)
+ parse_wms_GetTileService_HTTP_Get (cur_node->children, cap);
+ if (strcmp ((const char *) (cur_node->name), "Post") == 0)
+ parse_wms_GetTileService_HTTP_Post (cur_node->children,
+ cap);
+ }
+ }
+}
+
+static void
+parse_wms_GetInfo_HTTP (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetFeatureInfo/DCPType node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Get") == 0)
+ parse_wms_GetInfo_HTTP_Get (cur_node->children, cap);
+ if (strcmp ((const char *) (cur_node->name), "Post") == 0)
+ parse_wms_GetInfo_HTTP_Post (cur_node->children, cap);
+ }
+ }
+}
+
+static void
+parse_wms_GetMap_DCPType (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetMap/DCPType node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "HTTP") == 0)
+ parse_wms_GetMap_HTTP (cur_node->children, cap);
+ }
+ }
+}
+
+static void
+parse_wms_GetInfo_DCPType (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetFeatureInfo/DCPType node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "HTTP") == 0)
+ parse_wms_GetInfo_HTTP (cur_node->children, cap);
+ }
+ }
+}
+
+static void
+parse_wms_GetTileService_DCPType (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetTileService/DCPType node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "HTTP") == 0)
+ parse_wms_GetTileService_HTTP (cur_node->children, cap);
+ }
+ }
+}
+
+static void
+parse_wms_getMap (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetMap node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Format") == 0)
+ {
+ xmlNodePtr child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ wmsFormatPtr fmt;
+ const char *format =
+ (const char *) (child_node->content);
+ fmt = wmsAllocFormat (format);
+ if (cap->firstFormat == NULL)
+ cap->firstFormat = fmt;
+ if (cap->lastFormat != NULL)
+ cap->lastFormat->next = fmt;
+ cap->lastFormat = fmt;
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "DCPType") == 0)
+ parse_wms_GetMap_DCPType (cur_node->children, cap);
+ }
+ }
+}
+
+static void
+parse_wms_getInfo (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetFeatureInfo node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Format") == 0)
+ {
+ xmlNodePtr child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ if (cap->GmlMimeType == NULL)
+ {
+ int ok = 0;
+ const char *format =
+ (const char
+ *) (child_node->content);
+ if (strcmp (format, "text/gml") == 0)
+ ok = 1;
+ if (strcmp
+ (format,
+ "application/vnd.ogc.gml") == 0)
+ ok = 1;
+ if (strcmp
+ (format,
+ "application/vnd.ogc.gml/3.1.1") ==
+ 0)
+ ok = 1;
+ if (ok)
+ {
+ int len = strlen (format);
+ cap->GmlMimeType =
+ malloc (len + 1);
+ strcpy (cap->GmlMimeType, format);
+ }
+ }
+ if (cap->XmlMimeType == NULL)
+ {
+ int ok = 0;
+ const char *format =
+ (const char
+ *) (child_node->content);
+ if (strcmp (format, "text/xml") == 0)
+ ok = 1;
+ if (ok)
+ {
+ int len = strlen (format);
+ cap->XmlMimeType =
+ malloc (len + 1);
+ strcpy (cap->XmlMimeType, format);
+ }
+ }
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "DCPType") == 0)
+ parse_wms_GetInfo_DCPType (cur_node->children, cap);
+ }
+ }
+}
+
+static void
+parse_wms_getTileService (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request/GetTileService node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (strcmp ((const char *) (cur_node->name), "DCPType") == 0)
+ parse_wms_GetTileService_DCPType (cur_node->children, cap);
+ }
+}
+
+static void
+parse_wms_request (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability/Request node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "GetMap") == 0)
+ parse_wms_getMap (cur_node->children, cap);
+ if (strcmp ((const char *) (cur_node->name), "GetTileService")
+ == 0)
+ parse_wms_getTileService (cur_node->children, cap);
+ if (strcmp ((const char *) (cur_node->name), "GetFeatureInfo")
+ == 0)
+ parse_wms_getInfo (cur_node->children, cap);
+ }
+ }
+}
+
+static void
+parse_wms_capability (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities/Capability node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Request") == 0)
+ parse_wms_request (cur_node->children, cap);
+ if (strcmp ((const char *) (cur_node->name), "Layer") == 0)
+ parse_wms_layer (cur_node->children, cur_node->properties,
+ cap);
+ }
+ }
+}
+
+static void
+parse_capabilities (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetCapabilities payload */
+ xmlNodePtr cur_node = NULL;
+
+ if (node)
+ cur_node = node->children;
+ else
+ return;
+
+ for (; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Service") == 0)
+ parse_wms_service (cur_node->children, cap);
+ if (strcmp ((const char *) (cur_node->name), "Capability") == 0)
+ parse_wms_capability (cur_node->children, cap);
+ }
+ }
+}
+
+static void
+parse_version (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* attempting to extract the Version String */
+ const char *version = NULL;
+ struct _xmlAttr *attr = node->properties;
+
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ xmlNodePtr text;
+ if (strcmp ((const char *) (attr->name), "version") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ version = (const char *) (text->content);
+ }
+ }
+ attr = attr->next;
+ }
+ if (version != NULL)
+ {
+ int len = strlen (version);
+ if (cap->Version != NULL)
+ free (cap->Version);
+ cap->Version = malloc (len + 1);
+ strcpy (cap->Version, version);
+ }
+}
+
+static wmsCapabilitiesPtr
+parse_wms_capabilities (const char *buf)
+{
+/* attempting to parse a WMS GetCapabilities answer */
+ xmlDocPtr xml_doc;
+ xmlNodePtr root;
+ wmsMemBuffer xmlErr;
+ wmsCapabilitiesPtr cap = NULL;
+
+/* testing if the XMLDocument is well-formed */
+ wmsMemBufferInitialize (&xmlErr);
+ xmlSetGenericErrorFunc (&xmlErr, wmsParsingError);
+ xml_doc = xmlReadMemory (buf, strlen (buf), "GetCapabilities.xml", NULL, 0);
+ if (xml_doc == NULL)
+ {
+ /* parsing error; not a well-formed XML */
+ char *err = NULL;
+ const char *p_err = "error unknown";
+ if (xmlErr.Buffer != NULL)
+ {
+ err = malloc (xmlErr.WriteOffset + 1);
+ memcpy (err, xmlErr.Buffer, xmlErr.WriteOffset);
+ *(err + xmlErr.WriteOffset) = '\0';
+ p_err = err;
+ }
+ fprintf (stderr, "XML parsing error: %s\n", p_err);
+ if (err)
+ free (err);
+ wmsMemBufferReset (&xmlErr);
+ xmlSetGenericErrorFunc ((void *) stderr, NULL);
+ return NULL;
+ }
+ if (xmlErr.Buffer != NULL)
+ {
+ /* reporting some XML warning */
+ char *err = malloc (xmlErr.WriteOffset + 1);
+ memcpy (err, xmlErr.Buffer, xmlErr.WriteOffset);
+ *(err + xmlErr.WriteOffset) = '\0';
+ fprintf (stderr, "XML parsing warning: %s\n", err);
+ free (err);
+ }
+ wmsMemBufferReset (&xmlErr);
+
+/* parsing XML nodes */
+ cap = wmsAllocCapabilities ();
+ root = xmlDocGetRootElement (xml_doc);
+ parse_version (root, cap);
+ parse_capabilities (root, cap);
+ xmlFreeDoc (xml_doc);
+
+ return cap;
+}
+
+static void
+parse_wms_tiled_geoBBox (struct _xmlAttr *properties, wmsTiledLayerPtr lyr)
+{
+/* parsing a WMS TiledLayer/LatLonBoundingBox */
+ struct _xmlAttr *attr = properties;
+
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ xmlNodePtr text;
+ if (strcmp ((const char *) (attr->name), "miny") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->MinLat = atof ((const char *) (text->content));
+ }
+ if (strcmp ((const char *) (attr->name), "maxy") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->MaxLat = atof ((const char *) (text->content));
+ }
+ if (strcmp ((const char *) (attr->name), "minx") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->MinLong = atof ((const char *) (text->content));
+ }
+ if (strcmp ((const char *) (attr->name), "maxx") == 0)
+ {
+ text = attr->children;
+ if (text->type == XML_TEXT_NODE)
+ lyr->MaxLong = atof ((const char *) (text->content));
+ }
+ }
+ attr = attr->next;
+ }
+}
+
+static char *
+normalize_pattern (const char *pattern)
+{
+/* normalizing a tile pattern */
+ char *out;
+ int len;
+ const char *p_end = pattern;
+ while (1)
+ {
+ if (*p_end == ' ' || *p_end == '\0' || *p_end == '\t'
+ || *p_end == '\r' || *p_end == '\n')
+ break;
+ p_end++;
+ }
+ len = p_end - pattern;
+ if (len <= 0)
+ return NULL;
+ out = malloc (len + 1);
+ memcpy (out, pattern, len);
+ *(out + len) = '\0';
+ return out;
+}
+
+static void
+parse_wms_tiled_group_child (xmlNodePtr node, wmsTiledLayerPtr parent)
+{
+/* parsing a WMS Tiled Layer (child) definition */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+ const char *name = NULL;
+ const char *title = NULL;
+ const char *abstract = NULL;
+ wmsTiledLayerPtr lyr;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Name") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ name = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Title") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ title = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Abstract") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ abstract = (const char *) (child_node->content);
+ }
+ }
+ }
+ }
+ lyr = wmsAllocTiledLayer (name, title, abstract);
+ if (parent->firstChild == NULL)
+ parent->firstChild = lyr;
+ if (parent->lastChild != NULL)
+ parent->lastChild->next = lyr;
+ parent->lastChild = lyr;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ int len;
+ if (strcmp
+ ((const char *) (cur_node->name), "LatLonBoundingBox") == 0)
+ parse_wms_tiled_geoBBox (cur_node->properties, lyr);
+ if (strcmp ((const char *) (cur_node->name), "Pad") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ if (lyr->Pad != NULL)
+ free (lyr->Pad);
+ lyr->Pad = NULL;
+ len =
+ strlen ((const char
+ *) (child_node->content));
+ lyr->Pad = malloc (len + 1);
+ strcpy (lyr->Pad,
+ (const char *) (child_node->content));
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Bands") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ if (lyr->Bands != NULL)
+ free (lyr->Bands);
+ lyr->Bands = NULL;
+ len =
+ strlen ((const char
+ *) (child_node->content));
+ lyr->Bands = malloc (len + 1);
+ strcpy (lyr->Bands,
+ (const char *) (child_node->content));
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "DataType") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ if (lyr->DataType != NULL)
+ free (lyr->DataType);
+ lyr->DataType = NULL;
+ len =
+ strlen ((const char
+ *) (child_node->content));
+ lyr->DataType = malloc (len + 1);
+ strcpy (lyr->DataType,
+ (const char *) (child_node->content));
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "TilePattern") ==
+ 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ const char *pattern =
+ (const char *) (child_node->content);
+ char *norm_pattern =
+ normalize_pattern (pattern);
+ if (norm_pattern != NULL)
+ {
+ wmsTilePatternPtr pattern =
+ wmsAllocTilePattern (norm_pattern);
+ if (lyr->firstPattern == NULL)
+ lyr->firstPattern = pattern;
+ if (lyr->lastPattern != NULL)
+ lyr->lastPattern->next = pattern;
+ lyr->lastPattern = pattern;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_tiled_groups_child (xmlNodePtr node, wmsTiledLayerPtr parent)
+{
+/* parsing a WMS Tiled (Group) Layer definition */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+ const char *name = NULL;
+ const char *title = NULL;
+ const char *abstract = NULL;
+ wmsTiledLayerPtr lyr;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Name") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ name = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Title") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ title = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Abstract") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ abstract = (const char *) (child_node->content);
+ }
+ }
+ }
+ }
+ lyr = wmsAllocTiledLayer (name, title, abstract);
+ if (parent->firstChild == NULL)
+ parent->firstChild = lyr;
+ if (parent->lastChild != NULL)
+ parent->lastChild->next = lyr;
+ parent->lastChild = lyr;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "TiledGroup") == 0)
+ parse_wms_tiled_group_child (cur_node->children, lyr);
+ if (strcmp ((const char *) (cur_node->name), "TiledGroups") ==
+ 0)
+ parse_wms_tiled_groups_child (cur_node->children, lyr);
+ }
+ }
+}
+
+static void
+parse_wms_tiled_group (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* parsing a WMS Tiled Layer definition */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+ const char *name = NULL;
+ const char *title = NULL;
+ const char *abstract = NULL;
+ wmsTiledLayerPtr lyr;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Name") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ name = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Title") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ title = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Abstract") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ abstract = (const char *) (child_node->content);
+ }
+ }
+ }
+ }
+ lyr = wmsAllocTiledLayer (name, title, abstract);
+ if (cap->firstTiled == NULL)
+ cap->firstTiled = lyr;
+ if (cap->lastTiled != NULL)
+ cap->lastTiled->next = lyr;
+ cap->lastTiled = lyr;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ int len;
+ if (strcmp
+ ((const char *) (cur_node->name), "LatLonBoundingBox") == 0)
+ parse_wms_tiled_geoBBox (cur_node->properties, lyr);
+ if (strcmp ((const char *) (cur_node->name), "Pad") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ if (lyr->Pad != NULL)
+ free (lyr->Pad);
+ lyr->Pad = NULL;
+ len =
+ strlen ((const char
+ *) (child_node->content));
+ lyr->Pad = malloc (len + 1);
+ strcpy (lyr->Pad,
+ (const char *) (child_node->content));
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Bands") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ if (lyr->Bands != NULL)
+ free (lyr->Bands);
+ lyr->Bands = NULL;
+ len =
+ strlen ((const char
+ *) (child_node->content));
+ lyr->Bands = malloc (len + 1);
+ strcpy (lyr->Bands,
+ (const char *) (child_node->content));
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "DataType") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ if (lyr->DataType != NULL)
+ free (lyr->DataType);
+ lyr->DataType = NULL;
+ len =
+ strlen ((const char
+ *) (child_node->content));
+ lyr->DataType = malloc (len + 1);
+ strcpy (lyr->DataType,
+ (const char *) (child_node->content));
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "TilePattern") ==
+ 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ {
+ const char *pattern =
+ (const char *) (child_node->content);
+ char *norm_pattern =
+ normalize_pattern (pattern);
+ if (norm_pattern != NULL)
+ {
+ wmsTilePatternPtr pattern =
+ wmsAllocTilePattern (norm_pattern);
+ if (lyr->firstPattern == NULL)
+ lyr->firstPattern = pattern;
+ if (lyr->lastPattern != NULL)
+ lyr->lastPattern->next = pattern;
+ lyr->lastPattern = pattern;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_wms_tiled_groups (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* parsing a WMS Tiled (Group) Layer definition */
+ xmlNodePtr cur_node = NULL;
+ xmlNodePtr child_node = NULL;
+ const char *name = NULL;
+ const char *title = NULL;
+ const char *abstract = NULL;
+ wmsTiledLayerPtr lyr;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Name") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ name = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Title") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ title = (const char *) (child_node->content);
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Abstract") == 0)
+ {
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ abstract = (const char *) (child_node->content);
+ }
+ }
+ }
+ }
+ lyr = wmsAllocTiledLayer (name, title, abstract);
+ if (cap->firstTiled == NULL)
+ cap->firstTiled = lyr;
+ if (cap->lastTiled != NULL)
+ cap->lastTiled->next = lyr;
+ cap->lastTiled = lyr;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "TiledGroup") == 0)
+ parse_wms_tiled_group_child (cur_node->children, lyr);
+ if (strcmp ((const char *) (cur_node->name), "TiledGroups") ==
+ 0)
+ parse_wms_tiled_groups_child (cur_node->children, lyr);
+ }
+ }
+}
+
+static void
+parse_tile_service_info (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetTileService/Service payload */
+ xmlNodePtr cur_node = NULL;
+
+ if (node)
+ cur_node = node->children;
+ else
+ return;
+
+ for (; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ int len;
+ xmlNodePtr child_node;
+ const char *value;
+ if (strcmp ((const char *) (cur_node->name), "Name") == 0)
+ {
+ if (cap->TileServiceName != NULL)
+ free (cap->TileServiceName);
+ cap->TileServiceName = NULL;
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ value = (const char *) (child_node->content);
+ if (value != NULL)
+ {
+ len = strlen (value);
+ cap->TileServiceName = malloc (len + 1);
+ strcpy (cap->TileServiceName, value);
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Title") == 0)
+ {
+ if (cap->TileServiceTitle != NULL)
+ free (cap->TileServiceTitle);
+ cap->TileServiceTitle = NULL;
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ value = (const char *) (child_node->content);
+ if (value != NULL)
+ {
+ len = strlen (value);
+ cap->TileServiceTitle = malloc (len + 1);
+ strcpy (cap->TileServiceTitle, value);
+ }
+ }
+ }
+ if (strcmp ((const char *) (cur_node->name), "Abstract") == 0)
+ {
+ if (cap->TileServiceAbstract != NULL)
+ free (cap->TileServiceAbstract);
+ cap->TileServiceAbstract = NULL;
+ child_node = cur_node->children;
+ if (child_node != NULL)
+ {
+ if (child_node->type == XML_TEXT_NODE)
+ value = (const char *) (child_node->content);
+ if (value != NULL)
+ {
+ len = strlen (value);
+ cap->TileServiceAbstract = malloc (len + 1);
+ strcpy (cap->TileServiceAbstract, value);
+ }
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_tiled_patterns (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetTileService/TiledPatterns payload */
+ xmlNodePtr cur_node = NULL;
+
+ if (node)
+ cur_node = node->children;
+ else
+ return;
+
+ for (; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "TiledGroup") == 0)
+ parse_wms_tiled_group (cur_node->children, cap);
+ if (strcmp ((const char *) (cur_node->name), "TiledGroups") ==
+ 0)
+ parse_wms_tiled_groups (cur_node->children, cap);
+ }
+ }
+}
+
+static void
+parse_tile_service (xmlNodePtr node, wmsCapabilitiesPtr cap)
+{
+/* recursively parsing the GetTileService payload */
+ xmlNodePtr cur_node = NULL;
+
+ if (node)
+ cur_node = node->children;
+ else
+ return;
+
+ for (; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Service") == 0)
+ parse_tile_service_info (cur_node, cap);
+ if (strcmp ((const char *) (cur_node->name), "TiledPatterns") ==
+ 0)
+ parse_tiled_patterns (cur_node, cap);
+ }
+ }
+}
+
+static void
+parse_wms_get_tile_service (wmsCapabilitiesPtr capabilities, const char *buf)
+{
+/* attempting to parse a WMS GetTileService answer */
+ xmlDocPtr xml_doc;
+ xmlNodePtr root;
+ wmsMemBuffer xmlErr;
+
+/* testing if the XMLDocument is well-formed */
+ wmsMemBufferInitialize (&xmlErr);
+ xmlSetGenericErrorFunc (&xmlErr, wmsParsingError);
+ xml_doc = xmlReadMemory (buf, strlen (buf), "GetTileService.xml", NULL, 0);
+ if (xml_doc == NULL)
+ {
+ /* parsing error; not a well-formed XML */
+ char *err = NULL;
+ const char *p_err = "error unknown";
+ if (xmlErr.Buffer != NULL)
+ {
+ err = malloc (xmlErr.WriteOffset + 1);
+ memcpy (err, xmlErr.Buffer, xmlErr.WriteOffset);
+ *(err + xmlErr.WriteOffset) = '\0';
+ p_err = err;
+ }
+ fprintf (stderr, "XML parsing error: %s\n", p_err);
+ if (err)
+ free (err);
+ wmsMemBufferReset (&xmlErr);
+ xmlSetGenericErrorFunc ((void *) stderr, NULL);
+ return;
+ }
+ if (xmlErr.Buffer != NULL)
+ {
+ /* reporting some XML warning */
+ char *err = malloc (xmlErr.WriteOffset + 1);
+ memcpy (err, xmlErr.Buffer, xmlErr.WriteOffset);
+ *(err + xmlErr.WriteOffset) = '\0';
+ fprintf (stderr, "XML parsing warning: %s\n", err);
+ free (err);
+ }
+ wmsMemBufferReset (&xmlErr);
+
+/* parsing XML nodes */
+ root = xmlDocGetRootElement (xml_doc);
+ parse_tile_service (root, capabilities);
+ xmlFreeDoc (xml_doc);
+}
+
+static void
+parse_wms_gml_geom (wmsMemBufferPtr gmlBuf, xmlNodePtr node)
+{
+/* recursively reassembling the GML Geometry */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ /* found some internal GML Geometry Tag */
+ struct _xmlAttr *attr;
+ char *tag_name;
+ if (cur_node->ns == NULL)
+ tag_name = sqlite3_mprintf ("<%s", cur_node->name);
+ else
+ tag_name =
+ sqlite3_mprintf ("<%s:%s", cur_node->ns->prefix,
+ cur_node->name);
+ wmsMemBufferAppend (gmlBuf, (unsigned char *) tag_name,
+ strlen (tag_name));
+ sqlite3_free (tag_name);
+ attr = cur_node->properties;
+ while (attr != NULL)
+ {
+ /* eventual node attributes */
+ if (attr->type == XML_ATTRIBUTE_NODE)
+ {
+ const char *value = "";
+ xmlNodePtr text = attr->children;
+ if (text != NULL)
+ {
+ if (text->type == XML_TEXT_NODE)
+ value = (const char *) (text->content);
+ }
+ if (attr->ns == NULL)
+ tag_name =
+ sqlite3_mprintf (" %s=\"%s\"", attr->name,
+ value);
+ else
+ tag_name =
+ sqlite3_mprintf (" %s:%s=\"%s\"",
+ attr->ns->prefix,
+ attr->name, value);
+ wmsMemBufferAppend (gmlBuf,
+ (unsigned char *) tag_name,
+ strlen (tag_name));
+ sqlite3_free (tag_name);
+ }
+ attr = attr->next;
+ }
+ wmsMemBufferAppend (gmlBuf, (unsigned char *) ">", 1);
+ parse_wms_gml_geom (gmlBuf, cur_node->children);
+ if (cur_node->ns == NULL)
+ tag_name = sqlite3_mprintf ("</%s>", cur_node->name);
+ else
+ tag_name =
+ sqlite3_mprintf ("</%s:%s>", cur_node->ns->prefix,
+ cur_node->name);
+ wmsMemBufferAppend (gmlBuf, (unsigned char *) tag_name,
+ strlen (tag_name));
+ sqlite3_free (tag_name);
+ }
+ if (cur_node->type == XML_TEXT_NODE)
+ {
+ /* found a Text item */
+ wmsMemBufferAppend (gmlBuf,
+ (unsigned char *) (cur_node->content),
+ strlen ((const char
+ *) (cur_node->content)));
+ }
+ }
+}
+
+static void
+parse_wms_feature_attribute (xmlNodePtr node, wmsFeatureMemberPtr member)
+{
+/* parsing the GetFeatureInfo/featureAttribute node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ xmlNodePtr text = cur_node->children;
+ if (text == NULL)
+ continue;
+ if (text->type == XML_TEXT_NODE)
+ {
+ /* found an attribute */
+ {
+ char *value = NULL;
+ if (text->content != NULL)
+ {
+ int len =
+ strlen ((const char *) (text->content));
+ value = malloc (len + 1);
+ strcpy (value, (const char *) (text->content));
+ }
+ wmsAddFeatureMemberAttribute (member,
+ (const char
+ *) (cur_node->name),
+ value);
+ }
+ }
+ if (text->type == XML_ELEMENT_NODE)
+ {
+ /* probably found the GML Geometry - attempting to reassemble */
+ char *gml = NULL;
+ wmsMemBuffer gmlBuf;
+ wmsMemBufferInitialize (&gmlBuf);
+ parse_wms_gml_geom (&gmlBuf, text);
+ if (gmlBuf.WriteOffset > 0)
+ {
+ gml = malloc (gmlBuf.WriteOffset + 1);
+ memcpy (gml, gmlBuf.Buffer, gmlBuf.WriteOffset);
+ *(gml + gmlBuf.WriteOffset) = '\0';
+ }
+ wmsMemBufferReset (&gmlBuf);
+ wmsAddFeatureMemberAttribute (member,
+ (const char
+ *) (cur_node->name), gml);
+ }
+ }
+ }
+}
+
+
+static void
+parse_wms_feature_member (xmlNodePtr node, wmsFeatureCollectionPtr coll)
+{
+/* parsing the GetFeatureInfo/featureMember node */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+
+ wmsFeatureMemberPtr member =
+ wmsAllocFeatureMember ((const char *) (cur_node->name));
+ parse_wms_feature_attribute (cur_node->children, member);
+ if (member->first == NULL)
+ {
+ /* empty feature */
+ wmsFreeFeatureMember (member);
+ }
+ /* appending the feature to the collection */
+ if (coll->first == NULL)
+ coll->first = member;
+ if (coll->last != NULL)
+ coll->last->next = member;
+ coll->last = member;
+ }
+ }
+}
+
+static void
+parse_ms_layer (xmlNodePtr node, wmsFeatureCollectionPtr coll,
+ const char *feature_name)
+{
+/* recursively parsing msGMLOutput features from a layer */
+ xmlNodePtr cur_node = NULL;
+
+ for (cur_node = node; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), feature_name) == 0)
+ parse_wms_feature_member (cur_node, coll);
+ else
+ parse_ms_layer (cur_node->children, coll, feature_name);
+ }
+ }
+}
+
+static char *
+make_feature_name (const char *layer_name)
+{
+/* building the expected feature name */
+ char *name;
+ int len = strlen (layer_name);
+ if (len <= 6)
+ return NULL;
+ if (strcmp (layer_name + len - 6, "_layer") != 0)
+ return NULL;
+ name = malloc (len - 6 + 9);
+ strncpy (name, layer_name, len - 6);
+ name[len - 6] = '\0';
+ strcat (name, "_feature");
+ return name;
+}
+
+static void
+parse_ms_gml_output (xmlNodePtr node, wmsFeatureCollectionPtr coll)
+{
+/* parsing the msGMLOutput payload */
+ xmlNodePtr cur_node = NULL;
+ char *feature_name = NULL;
+ if (strcmp ((const char *) (node->name), "msGMLOutput") != 0)
+ return;
+
+ if (node)
+ cur_node = node->children;
+ else
+ return;
+
+ for (; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (feature_name == NULL)
+ feature_name =
+ make_feature_name ((const char *) (cur_node->name));
+ if (feature_name == NULL)
+ continue;
+ parse_ms_layer (cur_node->children, coll, feature_name);
+ }
+ }
+ if (feature_name != NULL)
+ free (feature_name);
+}
+
+static void
+parse_esri_xml_field (struct _xmlAttr *properties, wmsFeatureMemberPtr member)
+{
+/* parsing an ESRI <Fields> based on XML attributes */
+ struct _xmlAttr *attr = properties;
+
+ while (attr != NULL)
+ {
+ if (attr->name != NULL)
+ {
+ char *value = NULL;
+ xmlNodePtr text = attr->children;
+ if (text != NULL)
+ {
+ if (text->type == XML_TEXT_NODE)
+ {
+ if (text->content != NULL)
+ {
+ int len =
+ strlen ((const char *) (text->content));
+ value = malloc (len + 1);
+ strcpy (value,
+ (const char *) (text->content));
+ }
+ }
+ }
+ else
+ {
+ value = malloc (1);
+ *value = '\0';
+ }
+ wmsAddFeatureMemberAttribute (member,
+ (const char *) (attr->name),
+ value);
+ }
+ attr = attr->next;
+ }
+}
+
+static void
+parse_esri_xml_output (xmlNodePtr node, wmsFeatureCollectionPtr coll)
+{
+/* parsing the ESRI-like XML payload */
+ xmlNodePtr cur_node = NULL;
+ if (strcmp ((const char *) (node->name), "FeatureInfoResponse") != 0)
+ return;
+
+ if (node)
+ cur_node = node->children;
+ else
+ return;
+
+ for (; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "Fields") != 0)
+ {
+ struct _xmlAttr *attr = cur_node->properties;
+ if (attr != NULL)
+ {
+ wmsFeatureMemberPtr member =
+ wmsAllocFeatureMember ((const char
+ *) (cur_node->name));
+ parse_esri_xml_field (attr, member);
+ /* appending the feature to the collection */
+ if (coll->first == NULL)
+ coll->first = member;
+ if (coll->last != NULL)
+ coll->last->next = member;
+ coll->last = member;
+ }
+ }
+ }
+ }
+}
+
+static void
+parse_feature_collection (xmlNodePtr node, wmsFeatureCollectionPtr coll)
+{
+/* parsing the GetFeatureInfo payload */
+ xmlNodePtr cur_node = NULL;
+ if (strcmp ((const char *) (node->name), "FeatureInfoResponse") == 0)
+ {
+ parse_esri_xml_output (node, coll);
+ return;
+ }
+ if (strcmp ((const char *) (node->name), "msGMLOutput") == 0)
+ {
+ parse_ms_gml_output (node, coll);
+ return;
+ }
+ if (strcmp ((const char *) (node->name), "FeatureCollection") != 0)
+ return;
+
+ if (node)
+ cur_node = node->children;
+ else
+ return;
+
+ for (; cur_node; cur_node = cur_node->next)
+ {
+ if (cur_node->type == XML_ELEMENT_NODE)
+ {
+ if (strcmp ((const char *) (cur_node->name), "featureMember") ==
+ 0)
+ parse_wms_feature_member (cur_node->children, coll);
+ }
+ }
+}
+
+static wmsFeatureCollectionPtr
+parse_wms_feature_collection (const char *buf)
+{
+/* attempting to parse a WMS GetFeatureInfo answer */
+ xmlDocPtr xml_doc;
+ xmlNodePtr root;
+ wmsMemBuffer xmlErr;
+ wmsFeatureCollectionPtr coll = NULL;
+
+/* testing if the XMLDocument is well-formed */
+ wmsMemBufferInitialize (&xmlErr);
+ xmlSetGenericErrorFunc (&xmlErr, wmsParsingError);
+ xml_doc = xmlReadMemory (buf, strlen (buf), "GetFeatureInfo.xml", NULL, 0);
+ if (xml_doc == NULL)
+ {
+ /* parsing error; not a well-formed XML */
+ char *err = NULL;
+ const char *p_err = "error unknown";
+ if (xmlErr.Buffer != NULL)
+ {
+ err = malloc (xmlErr.WriteOffset + 1);
+ memcpy (err, xmlErr.Buffer, xmlErr.WriteOffset);
+ *(err + xmlErr.WriteOffset) = '\0';
+ p_err = err;
+ }
+ fprintf (stderr, "XML parsing error: %s\n", p_err);
+ if (err)
+ free (err);
+ wmsMemBufferReset (&xmlErr);
+ xmlSetGenericErrorFunc ((void *) stderr, NULL);
+ return NULL;
+ }
+ if (xmlErr.Buffer != NULL)
+ {
+ /* reporting some XML warning */
+ char *err = malloc (xmlErr.WriteOffset + 1);
+ memcpy (err, xmlErr.Buffer, xmlErr.WriteOffset);
+ *(err + xmlErr.WriteOffset) = '\0';
+ fprintf (stderr, "XML parsing warning: %s\n", err);
+ free (err);
+ }
+ wmsMemBufferReset (&xmlErr);
+
+/* parsing XML nodes */
+ coll = wmsAllocFeatureCollection ();
+ root = xmlDocGetRootElement (xml_doc);
+ parse_feature_collection (root, coll);
+ xmlFreeDoc (xml_doc);
+
+ if (coll != NULL)
+ {
+ if (coll->first == NULL)
+ {
+ /* empty collection */
+ wmsFreeFeatureCollection (coll);
+ coll = NULL;
+ }
+ }
+
+ return coll;
+}
+
+static int
+query_TileService (rl2WmsCachePtr cache_handle, wmsCapabilitiesPtr capabilities,
+ const char *proxy)
+{
+/* attempting to get and parse a WMS GetTileService request */
+ CURL *curl = NULL;
+ CURLcode res;
+ wmsMemBuffer headerBuf;
+ wmsMemBuffer bodyBuf;
+ int http_status;
+ char *http_code;
+ char *xml_buf;
+ char *url;
+ wmsCachePtr cache = (wmsCachePtr) cache_handle;
+ int already_cached = 0;
+ int retcode = 0;
+
+/* initializes the dynamically growing buffers */
+ wmsMemBufferInitialize (&headerBuf);
+ wmsMemBufferInitialize (&bodyBuf);
+ url =
+ sqlite3_mprintf ("%srequest=GetTileService",
+ capabilities->GetTileServiceURLGet);
+
+ if (cache != NULL)
+ {
+ /* checks if it's already stored into the WMS Cache */
+ wmsCachedCapabilitiesPtr cachedCapab =
+ getWmsCachedCapabilities (cache, url);
+ if (cachedCapab != NULL)
+ {
+ /* ok, found from WMS Cache */
+ xml_buf =
+ clean_xml_str ((const char *) (cachedCapab->Response));
+ already_cached = 1;
+ goto do_tile_service;
+ }
+ }
+
+ curl = curl_easy_init ();
+ if (curl)
+ {
+ /* setting the URL */
+ curl_easy_setopt (curl, CURLOPT_URL, url);
+
+ if (proxy != NULL)
+ {
+ /* setting up the required proxy */
+ curl_easy_setopt (curl, CURLOPT_PROXY, proxy);
+ }
+
+ /* no progress meter please */
+ curl_easy_setopt (curl, CURLOPT_NOPROGRESS, 1L);
+ /* setting the output callback function */
+ curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, store_data);
+ curl_easy_setopt (curl, CURLOPT_WRITEHEADER, &headerBuf);
+ curl_easy_setopt (curl, CURLOPT_WRITEDATA, &bodyBuf);
+
+ /* Perform the request, res will get the return code */
+ res = curl_easy_perform (curl);
+ /* Check for errors */
+ if (res != CURLE_OK)
+ {
+ fprintf (stderr, "CURL error: %s\n", curl_easy_strerror (res));
+ goto stop;
+ }
+
+ /* verifying the HTTP status code */
+ check_http_header (&headerBuf, &http_status, &http_code);
+ if (http_status != 200)
+ {
+ fprintf (stderr, "Invalid HTTP status code: %d %s\n",
+ http_status, http_code);
+ if (http_code != NULL)
+ free (http_code);
+ goto stop;
+ }
+ if (http_code != NULL)
+ free (http_code);
+ }
+
+ /* attempting to parse the GetCapabilities answer */
+ xml_buf = clean_xml (&bodyBuf);
+ do_tile_service:
+ if (xml_buf != NULL)
+ {
+ parse_wms_get_tile_service (capabilities, xml_buf);
+ free (xml_buf);
+ retcode = 1;
+ }
+ if (!already_cached)
+ {
+ /* saving into the WMS Cache */
+ wmsAddCachedCapabilities (cache, url, bodyBuf.Buffer,
+ bodyBuf.WriteOffset);
+ }
+
+ /* memory cleanup */
+ stop:
+ wmsMemBufferReset (&headerBuf);
+ wmsMemBufferReset (&bodyBuf);
+ sqlite3_free (url);
+ if (curl != NULL)
+ curl_easy_cleanup (curl);
+ return retcode;
+}
+
+RL2_DECLARE rl2WmsCatalogPtr
+create_wms_catalog (rl2WmsCachePtr cache_handle, const char *url,
+ const char *proxy, char **err_msg)
+{
+/* attempting to get and parse a WMS GetCapabilities request */
+ CURL *curl = NULL;
+ CURLcode res;
+ wmsMemBuffer headerBuf;
+ wmsMemBuffer bodyBuf;
+ int http_status;
+ char *http_code;
+ wmsCapabilitiesPtr capabilities = NULL;
+ char *xml_buf;
+ wmsCachePtr cache = (wmsCachePtr) cache_handle;
+ int already_cached = 0;
+
+/* initializes the dynamically growing buffers */
+ wmsMemBufferInitialize (&headerBuf);
+ wmsMemBufferInitialize (&bodyBuf);
+
+ if (cache != NULL)
+ {
+ /* checks if it's already stored into the WMS Cache */
+ wmsCachedCapabilitiesPtr cachedCapab =
+ getWmsCachedCapabilities (cache, url);
+ if (cachedCapab != NULL)
+ {
+ /* ok, found from WMS Cache */
+ xml_buf =
+ clean_xml_str ((const char *) (cachedCapab->Response));
+ already_cached = 1;
+ goto do_capabilities;
+ }
+ }
+
+ *err_msg = NULL;
+ curl = curl_easy_init ();
+ if (curl)
+ {
+ /* setting the URL */
+ curl_easy_setopt (curl, CURLOPT_URL, url);
+
+ if (proxy != NULL)
+ {
+ /* setting up the required proxy */
+ curl_easy_setopt (curl, CURLOPT_PROXY, proxy);
+ }
+
+ /* no progress meter please */
+ curl_easy_setopt (curl, CURLOPT_NOPROGRESS, 1L);
+ /* setting the output callback function */
+ curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, store_data);
+ curl_easy_setopt (curl, CURLOPT_WRITEHEADER, &headerBuf);
+ curl_easy_setopt (curl, CURLOPT_WRITEDATA, &bodyBuf);
+
+ /* Perform the request, res will get the return code */
+ res = curl_easy_perform (curl);
+ /* Check for errors */
+ if (res != CURLE_OK)
+ {
+ fprintf (stderr, "CURL error: %s\n", curl_easy_strerror (res));
+ goto stop;
+ }
+
+ /* verifying the HTTP status code */
+ check_http_header (&headerBuf, &http_status, &http_code);
+ if (http_status != 200)
+ {
+ fprintf (stderr, "Invalid HTTP status code: %d %s\n",
+ http_status, http_code);
+ if (http_code != NULL)
+ free (http_code);
+ goto stop;
+ }
+ if (http_code != NULL)
+ free (http_code);
+
+ /* attempting to parse the GetCapabilities answer */
+ xml_buf = clean_xml (&bodyBuf);
+ do_capabilities:
+ if (xml_buf != NULL)
+ {
+ capabilities = parse_wms_capabilities (xml_buf);
+ free (xml_buf);
+ }
+
+ if (capabilities != NULL)
+ {
+ if (capabilities->GetTileServiceURLGet != NULL)
+ {
+ /* attempting to resolve WMS GetTileService */
+ int retry = 0;
+ /* first attempt */
+ if (!query_TileService
+ (cache_handle, capabilities, proxy))
+ retry = 1;
+ if (retry)
+ {
+ /* second attempt */
+ retry = 0;
+ if (!query_TileService
+ (cache_handle, capabilities, proxy))
+ retry = 1;
+ }
+ if (retry)
+ {
+ /* third attempt */
+ retry = 0;
+ if (!query_TileService
+ (cache_handle, capabilities, proxy))
+ retry = 1;
+ }
+ if (retry)
+ {
+ /* fourth attempt */
+ retry = 0;
+ if (!query_TileService
+ (cache_handle, capabilities, proxy))
+ retry = 1;
+ }
+ if (retry)
+ {
+ /* fifth attempt */
+ if (!query_TileService
+ (cache_handle, capabilities, proxy))
+ {
+ /* giving up */
+ wmsFreeCapabilities (capabilities);
+ capabilities = NULL;
+ goto stop;
+ }
+ }
+ }
+ if (!already_cached)
+ {
+ /* saving into the WMS Cache */
+ wmsAddCachedCapabilities (cache, url, bodyBuf.Buffer,
+ bodyBuf.WriteOffset);
+ }
+ }
+ }
+
+ stop:
+ if (curl != NULL)
+ curl_easy_cleanup (curl);
+ wmsMemBufferReset (&headerBuf);
+ wmsMemBufferReset (&bodyBuf);
+ return (rl2WmsCatalogPtr) capabilities;
+}
+
+RL2_DECLARE void
+destroy_wms_catalog (rl2WmsCatalogPtr handle)
+{
+/* memory cleanup: freeing a WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return;
+ wmsFreeCapabilities (ptr);
+}
+
+RL2_DECLARE int
+get_wms_format_count (rl2WmsCatalogPtr handle, int mode)
+{
+/* counting how many Formats are supported by a WMS-Catalog */
+ int count = 0;
+ wmsFormatPtr fmt;
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ fmt = ptr->firstFormat;
+ while (fmt != NULL)
+ {
+ if (mode)
+ {
+ if (fmt->FormatCode != WMS_FORMAT_UNKNOWN)
+ count++;
+ }
+ else
+ count++;
+ fmt = fmt->next;
+ }
+ return count;
+}
+
+RL2_DECLARE const char *
+get_wms_format (rl2WmsCatalogPtr handle, int index, int mode)
+{
+/* attempting to get the Nth Format supported by some WMS-Catalog object */
+ int count = 0;
+ wmsFormatPtr fmt;
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ fmt = ptr->firstFormat;
+ while (fmt != NULL)
+ {
+ if (mode)
+ {
+ if (fmt->FormatCode == WMS_FORMAT_UNKNOWN)
+ {
+ fmt = fmt->next;
+ continue;
+ }
+ }
+ if (count == index)
+ return fmt->Format;
+ count++;
+ fmt = fmt->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE const char *
+get_wms_contact_person (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Contact Person defined by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->ContactPerson;
+}
+
+RL2_DECLARE const char *
+get_wms_contact_organization (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Contact Organization defined by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->ContactOrganization;
+}
+
+RL2_DECLARE const char *
+get_wms_contact_position (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Contact Position defined by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->ContactPosition;
+}
+
+RL2_DECLARE const char *
+get_wms_contact_postal_address (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Postal Address defined by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->PostalAddress;
+}
+
+RL2_DECLARE const char *
+get_wms_contact_city (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the City (Postal Address) defined by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->City;
+}
+
+RL2_DECLARE const char *
+get_wms_contact_state_province (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the State or Province (Postal Address) defined by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->StateProvince;
+}
+
+RL2_DECLARE const char *
+get_wms_contact_post_code (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Post Code (Postal Address) defined by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->PostCode;
+}
+
+RL2_DECLARE const char *
+get_wms_contact_country (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Country (Postal Address) defined by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->Country;
+}
+
+RL2_DECLARE const char *
+get_wms_contact_voice_telephone (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Voice Telephone defined by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->VoiceTelephone;
+}
+
+RL2_DECLARE const char *
+get_wms_contact_fax_telephone (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the FAX Telephone defined by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->FaxTelephone;
+}
+
+RL2_DECLARE const char *
+get_wms_contact_email_address (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the e-mail Address defined by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->EMailAddress;
+}
+
+RL2_DECLARE const char *
+get_wms_fees (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Fees required by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->Fees;
+}
+
+RL2_DECLARE const char *
+get_wms_access_constraints (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Access Constraints imposed by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->AccessConstraints;
+}
+
+RL2_DECLARE int
+get_wms_layer_limit (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the LayerLimit supported by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ return ptr->LayerLimit;
+}
+
+RL2_DECLARE int
+get_wms_max_width (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the MaxWidth supported by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ return ptr->MaxWidth;
+}
+
+RL2_DECLARE int
+get_wms_max_height (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the MaxHeight supported by some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ return ptr->MaxHeight;
+}
+
+RL2_DECLARE const char *
+get_wms_version (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Version String from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->Version;
+}
+
+RL2_DECLARE const char *
+get_wms_name (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Name from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->Name;
+}
+
+RL2_DECLARE const char *
+get_wms_title (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Title from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->Title;
+}
+
+RL2_DECLARE const char *
+get_wms_abstract (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the Abstract from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->Abstract;
+}
+
+RL2_DECLARE const char *
+get_wms_url_GetMap_get (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the GetMap URL (method GET) from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->GetMapURLGet;
+}
+
+RL2_DECLARE const char *
+get_wms_url_GetMap_post (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the GetMap URL (method POST) from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->GetMapURLPost;
+}
+
+RL2_DECLARE const char *
+get_wms_url_GetTileService_get (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the GetTileService URL (method GET) from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->GetTileServiceURLGet;
+}
+
+RL2_DECLARE const char *
+get_wms_url_GetTileService_post (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the GetTileService URL (method POST) from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->GetTileServiceURLPost;
+}
+
+RL2_DECLARE const char *
+get_wms_url_GetFeatureInfo_get (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the GetFeatureInfo URL (method GET) from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->GetFeatureInfoURLGet;
+}
+
+RL2_DECLARE const char *
+get_wms_url_GetFeatureInfo_post (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the GetFeatureInfo URL (method POST) from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->GetFeatureInfoURLPost;
+}
+
+RL2_DECLARE const char *
+get_wms_gml_mime_type (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the GML MIME type from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->GmlMimeType;
+}
+
+RL2_DECLARE const char *
+get_wms_xml_mime_type (rl2WmsCatalogPtr handle)
+{
+/* attempting to get the XML MIME type from some WMS-Catalog object */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->XmlMimeType;
+}
+
+RL2_DECLARE int
+is_wms_tile_service (rl2WmsCatalogPtr handle)
+{
+/* testing if a WMS-Catalog actually is a TileService */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ if (ptr->firstTiled != NULL)
+ return 1;
+ return 0;
+}
+
+RL2_DECLARE const char *
+get_wms_tile_service_name (rl2WmsCatalogPtr handle)
+{
+/* return the TileService name */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->TileServiceName;
+}
+
+RL2_DECLARE const char *
+get_wms_tile_service_title (rl2WmsCatalogPtr handle)
+{
+/* return the TileService title */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->TileServiceTitle;
+}
+
+RL2_DECLARE const char *
+get_wms_tile_service_abstract (rl2WmsCatalogPtr handle)
+{
+/* return the TileService abstract */
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ return ptr->TileServiceAbstract;
+}
+
+RL2_DECLARE int
+get_wms_tile_service_count (rl2WmsCatalogPtr handle)
+{
+/* counting how many first-level tiled layers are defined within a WMS-Catalog */
+ int count = 0;
+ wmsTiledLayerPtr lyr;
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ lyr = ptr->firstTiled;
+ while (lyr != NULL)
+ {
+ count++;
+ lyr = lyr->next;
+ }
+ return count;
+}
+
+RL2_DECLARE rl2WmsTiledLayerPtr
+get_wms_catalog_tiled_layer (rl2WmsCatalogPtr handle, int index)
+{
+/* attempting to get a reference to some WMS-TiledLayer object */
+ int count = 0;
+ wmsTiledLayerPtr lyr;
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ lyr = ptr->firstTiled;
+ while (lyr != NULL)
+ {
+ if (count == index)
+ return (rl2WmsTiledLayerPtr) lyr;
+ count++;
+ lyr = lyr->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE int
+wms_tiled_layer_has_children (rl2WmsTiledLayerPtr handle)
+{
+/* testing if a WMS-TiledLayer object has TiledLayer children */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return 0;
+ if (ptr->firstChild == NULL)
+ return 0;
+ return 1;
+}
+
+RL2_DECLARE int
+get_wms_tiled_layer_children_count (rl2WmsTiledLayerPtr handle)
+{
+/* counting how many children tiled layers are defined within a WMS-TiledLayer */
+ int count = 0;
+ wmsTiledLayerPtr lyr;
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ lyr = ptr->firstChild;
+ while (lyr != NULL)
+ {
+ count++;
+ lyr = lyr->next;
+ }
+ return count;
+}
+
+RL2_DECLARE rl2WmsTiledLayerPtr
+get_wms_child_tiled_layer (rl2WmsTiledLayerPtr handle, int index)
+{
+/* attempting to get a reference to some child WMS-TiledLayer object */
+ int count = 0;
+ wmsTiledLayerPtr lyr;
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ lyr = ptr->firstChild;
+ while (lyr != NULL)
+ {
+ if (count == index)
+ return (rl2WmsTiledLayerPtr) lyr;
+ count++;
+ lyr = lyr->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE const char *
+get_wms_tiled_layer_name (rl2WmsTiledLayerPtr handle)
+{
+/* return the name corresponding to a WMS-TiledLayer object */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ return ptr->Name;
+}
+
+RL2_DECLARE const char *
+get_wms_tiled_layer_title (rl2WmsTiledLayerPtr handle)
+{
+/* return the title corresponding to a WMS-TiledLayer object */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ return ptr->Title;
+}
+
+RL2_DECLARE const char *
+get_wms_tiled_layer_abstract (rl2WmsTiledLayerPtr handle)
+{
+/* return the abstract corresponding to a WMS-TiledLayer object */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ return ptr->Abstract;
+}
+
+RL2_DECLARE const char *
+get_wms_tiled_layer_pad (rl2WmsTiledLayerPtr handle)
+{
+/* return the Pad corresponding to a WMS-TiledLayer object */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ return ptr->Pad;
+}
+
+RL2_DECLARE const char *
+get_wms_tiled_layer_bands (rl2WmsTiledLayerPtr handle)
+{
+/* return the Bands corresponding to a WMS-TiledLayer object */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ return ptr->Bands;
+}
+
+RL2_DECLARE const char *
+get_wms_tiled_layer_data_type (rl2WmsTiledLayerPtr handle)
+{
+/* return the Bands corresponding to a WMS-TiledLayer object */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ return ptr->DataType;
+}
+
+RL2_DECLARE int
+get_wms_tiled_layer_bbox (rl2WmsTiledLayerPtr handle, double *minx,
+ double *miny, double *maxx, double *maxy)
+{
+/* return the BBox corresponding to a WMS-TiledLayer object */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return 0;
+ *minx = ptr->MinLong;
+ *miny = ptr->MinLat;
+ *maxx = ptr->MaxLong;
+ *maxy = ptr->MaxLat;
+ return 1;
+}
+
+RL2_DECLARE int
+get_wms_tiled_layer_tile_size (rl2WmsTiledLayerPtr handle, int *width,
+ int *height)
+{
+/* return the Tile Size corresponding to a WMS-TiledLayer object */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return 0;
+ if (ptr->firstPattern == NULL)
+ return 0;
+ *width = ptr->firstPattern->TileWidth;
+ *height = ptr->firstPattern->TileHeight;
+ return 1;
+}
+
+RL2_DECLARE const char *
+get_wms_tiled_layer_crs (rl2WmsTiledLayerPtr handle)
+{
+/* return the CRS corresponding to a WMS-TiledLayer object */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ if (ptr->firstPattern == NULL)
+ return NULL;
+ return ptr->firstPattern->SRS;
+}
+
+RL2_DECLARE const char *
+get_wms_tiled_layer_format (rl2WmsTiledLayerPtr handle)
+{
+/* return the Format corresponding to a WMS-TiledLayer object */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ if (ptr->firstPattern == NULL)
+ return NULL;
+ return ptr->firstPattern->Format;
+}
+
+RL2_DECLARE const char *
+get_wms_tiled_layer_style (rl2WmsTiledLayerPtr handle)
+{
+/* return the Style corresponding to a WMS-TiledLayer object */
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ if (ptr->firstPattern == NULL)
+ return NULL;
+ return ptr->firstPattern->Style;
+}
+
+RL2_DECLARE int
+get_wms_tile_pattern_count (rl2WmsTiledLayerPtr handle)
+{
+/* counting how many TilePatterns are defined within a WMS-TiledLayer object */
+ int count = 0;
+ wmsTilePatternPtr pattern;
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ pattern = ptr->firstPattern;
+ while (pattern != NULL)
+ {
+ count++;
+ pattern = pattern->next;
+ }
+ return count;
+}
+
+RL2_DECLARE rl2WmsTilePatternPtr
+get_wms_tile_pattern_handle (rl2WmsTiledLayerPtr handle, int index)
+{
+/* return the Handle from a TilePattern (identified by its index) */
+ int count = 0;
+ wmsTilePatternPtr pattern;
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ pattern = ptr->firstPattern;
+ while (pattern != NULL)
+ {
+ if (count == index)
+ return (rl2WmsTilePatternPtr) pattern;
+ count++;
+ pattern = pattern->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE rl2WmsTilePatternPtr
+clone_wms_tile_pattern (rl2WmsTilePatternPtr handle)
+{
+/* clones a WMS TilePattern object */
+ char *str;
+ int len;
+ wmsTilePatternPtr clone;
+ wmsTilePatternPtr pattern = (wmsTilePatternPtr) handle;
+ if (pattern == NULL)
+ return NULL;
+
+ len = strlen (pattern->Pattern);
+ str = malloc (len + 1);
+ strcpy (str, pattern->Pattern);
+ clone = wmsAllocTilePattern (str);
+ return (rl2WmsTilePatternPtr) clone;
+}
+
+RL2_DECLARE void
+destroy_wms_tile_pattern (rl2WmsTilePatternPtr handle)
+{
+/* memory cleanup - finalizes a WMS-TilePattern object */
+ wmsTilePatternPtr pattern = (wmsTilePatternPtr) handle;
+ if (pattern == NULL)
+ return;
+ wmsFreeTilePattern (pattern);
+}
+
+RL2_DECLARE const char *
+get_wms_tile_pattern_srs (rl2WmsTiledLayerPtr handle, int index)
+{
+/* return the SRS from a TilePattern (identified by its index) */
+ int count = 0;
+ wmsTilePatternPtr pattern;
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ pattern = ptr->firstPattern;
+ while (pattern != NULL)
+ {
+ if (count == index)
+ return pattern->SRS;
+ count++;
+ pattern = pattern->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE int
+get_wms_tile_pattern_tile_width (rl2WmsTiledLayerPtr handle, int index)
+{
+/* return the TileWidth from a TilePattern (identified by its index) */
+ int count = 0;
+ wmsTilePatternPtr pattern;
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ pattern = ptr->firstPattern;
+ while (pattern != NULL)
+ {
+ if (count == index)
+ return pattern->TileWidth;
+ count++;
+ pattern = pattern->next;
+ }
+ return -1;
+}
+
+RL2_DECLARE int
+get_wms_tile_pattern_tile_height (rl2WmsTiledLayerPtr handle, int index)
+{
+/* return the TileHeight from a TilePattern (identified by its index) */
+ int count = 0;
+ wmsTilePatternPtr pattern;
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ pattern = ptr->firstPattern;
+ while (pattern != NULL)
+ {
+ if (count == index)
+ return pattern->TileHeight;
+ count++;
+ pattern = pattern->next;
+ }
+ return -1;
+}
+
+RL2_DECLARE double
+get_wms_tile_pattern_base_x (rl2WmsTiledLayerPtr handle, int index)
+{
+/* return the TileBaseX (leftmost coord) from a TilePattern (identified by its index) */
+ int count = 0;
+ wmsTilePatternPtr pattern;
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return DBL_MAX;
+
+ pattern = ptr->firstPattern;
+ while (pattern != NULL)
+ {
+ if (count == index)
+ return pattern->TileBaseX;
+ count++;
+ pattern = pattern->next;
+ }
+ return DBL_MAX;
+}
+
+RL2_DECLARE double
+get_wms_tile_pattern_base_y (rl2WmsTiledLayerPtr handle, int index)
+{
+/* return the TileBaseY (topmost coord) from a TilePattern (identified by its index) */
+ int count = 0;
+ wmsTilePatternPtr pattern;
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return DBL_MAX;
+
+ pattern = ptr->firstPattern;
+ while (pattern != NULL)
+ {
+ if (count == index)
+ return pattern->TileBaseY;
+ count++;
+ pattern = pattern->next;
+ }
+ return DBL_MAX;
+}
+
+RL2_DECLARE double
+get_wms_tile_pattern_extent_x (rl2WmsTiledLayerPtr handle, int index)
+{
+/* return the TileExtentX from a TilePattern (identified by its index) */
+ int count = 0;
+ wmsTilePatternPtr pattern;
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return DBL_MAX;
+
+ pattern = ptr->firstPattern;
+ while (pattern != NULL)
+ {
+ if (count == index)
+ return pattern->TileExtentX;
+ count++;
+ pattern = pattern->next;
+ }
+ return DBL_MAX;
+}
+
+RL2_DECLARE double
+get_wms_tile_pattern_extent_y (rl2WmsTiledLayerPtr handle, int index)
+{
+/* return the TileExtentY from a TilePattern (identified by its index) */
+ int count = 0;
+ wmsTilePatternPtr pattern;
+ wmsTiledLayerPtr ptr = (wmsTiledLayerPtr) handle;
+ if (ptr == NULL)
+ return DBL_MAX;
+
+ pattern = ptr->firstPattern;
+ while (pattern != NULL)
+ {
+ if (count == index)
+ return pattern->TileExtentY;
+ count++;
+ pattern = pattern->next;
+ }
+ return DBL_MAX;
+}
+
+RL2_DECLARE char *
+get_wms_tile_pattern_sample_url (rl2WmsTilePatternPtr handle)
+{
+/* return the sample URL for some TilePattern */
+ char *url = NULL;
+ wmsUrlArgumentPtr arg;
+ wmsTilePatternPtr ptr = (wmsTilePatternPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ arg = ptr->first;
+ while (arg != NULL)
+ {
+ if (url != NULL)
+ {
+ char *str;
+ if (arg->argValue == NULL)
+ str = sqlite3_mprintf ("%s&%s=", url, arg->argName);
+ else
+ str =
+ sqlite3_mprintf ("%s&%s=%s", url,
+ arg->argName, arg->argValue);
+ sqlite3_free (url);
+ url = str;
+ }
+ else
+ {
+ if (arg->argValue == NULL)
+ url = sqlite3_mprintf ("%s=", arg->argName);
+ else
+ url =
+ sqlite3_mprintf ("%s=%s", arg->argName, arg->argValue);
+ }
+ arg = arg->next;
+ }
+ return url;
+}
+
+RL2_DECLARE char *
+get_wms_tile_pattern_request_url (rl2WmsTilePatternPtr
+ handle,
+ const char *base_url,
+ double min_x, double min_y)
+{
+/* return a full GetMap request URL for some TilePattern */
+ char *url = NULL;
+ wmsUrlArgumentPtr arg;
+ wmsTilePatternPtr ptr = (wmsTilePatternPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ url = sqlite3_mprintf ("%s", base_url);
+ arg = ptr->first;
+ while (arg != NULL)
+ {
+ char *str;
+ if (strcasecmp (arg->argName, "bbox") == 0)
+ {
+ char *bbox =
+ sqlite3_mprintf ("%1.6f,%1.6f,%1.6f,%1.6f", min_x, min_y,
+ min_x + ptr->TileExtentX,
+ min_y + ptr->TileExtentY);
+ if (arg != ptr->first)
+ {
+ str = sqlite3_mprintf ("%s&%s=%s", url,
+ arg->argName, bbox);
+ }
+ else
+ {
+ str =
+ sqlite3_mprintf ("%s%s=%s", url, arg->argName, bbox);
+ }
+ sqlite3_free (bbox);
+ }
+ else
+ {
+ if (arg != ptr->first)
+ {
+ if (arg->argValue == NULL)
+ str = sqlite3_mprintf ("%s&%s=", url, arg->argName);
+ else
+ str =
+ sqlite3_mprintf ("%s&%s=%s", url,
+ arg->argName, arg->argValue);
+ }
+ else
+ {
+ if (arg->argValue == NULL)
+ str = sqlite3_mprintf ("%s%s=", url, arg->argName);
+ else
+ str =
+ sqlite3_mprintf ("%s%s=%s", url, arg->argName,
+ arg->argValue);
+ }
+ }
+ sqlite3_free (url);
+ url = str;
+ arg = arg->next;
+ }
+ return url;
+}
+
+RL2_DECLARE int
+get_wms_catalog_count (rl2WmsCatalogPtr handle)
+{
+/* counting how many first-level layers are defined within a WMS-Catalog */
+ int count = 0;
+ wmsLayerPtr lyr;
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ lyr = ptr->firstLayer;
+ while (lyr != NULL)
+ {
+ count++;
+ lyr = lyr->next;
+ }
+ return count;
+}
+
+RL2_DECLARE rl2WmsLayerPtr
+get_wms_catalog_layer (rl2WmsCatalogPtr handle, int index)
+{
+/* attempting to get a reference to some WMS-Layer object */
+ int count = 0;
+ wmsLayerPtr lyr;
+ wmsCapabilitiesPtr ptr = (wmsCapabilitiesPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ lyr = ptr->firstLayer;
+ while (lyr != NULL)
+ {
+ if (count == index)
+ return (rl2WmsLayerPtr) lyr;
+ count++;
+ lyr = lyr->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE int
+wms_layer_has_children (rl2WmsLayerPtr handle)
+{
+/* testing if a WMS-Layer object has Layer children */
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return 0;
+ if (ptr->firstLayer == NULL)
+ return 0;
+ return 1;
+}
+
+RL2_DECLARE int
+get_wms_layer_children_count (rl2WmsLayerPtr handle)
+{
+/* counting how many children layers are defined within a WMS-Layer */
+ int count = 0;
+ wmsLayerPtr lyr;
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ lyr = ptr->firstLayer;
+ while (lyr != NULL)
+ {
+ count++;
+ lyr = lyr->next;
+ }
+ return count;
+}
+
+RL2_DECLARE rl2WmsLayerPtr
+get_wms_child_layer (rl2WmsLayerPtr handle, int index)
+{
+/* attempting to get a reference to some child WMS-Layer object */
+ int count = 0;
+ wmsLayerPtr lyr;
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ lyr = ptr->firstLayer;
+ while (lyr != NULL)
+ {
+ if (count == index)
+ return (rl2WmsLayerPtr) lyr;
+ count++;
+ lyr = lyr->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE const char *
+get_wms_layer_name (rl2WmsLayerPtr handle)
+{
+/* return the name corresponding to a WMS-Layer object */
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ return ptr->Name;
+}
+
+RL2_DECLARE const char *
+get_wms_layer_title (rl2WmsLayerPtr handle)
+{
+/* return the title corresponding to a WMS-Layer object */
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ return ptr->Title;
+}
+
+RL2_DECLARE const char *
+get_wms_layer_abstract (rl2WmsLayerPtr handle)
+{
+/* return the abstract corresponding to a WMS-Layer object */
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+ return ptr->Abstract;
+}
+
+static int
+wms_parent_crs_count (wmsLayerPtr lyr)
+{
+/* recursively counting how many CRSs are supported by a parent Layer (inheritance) */
+ int count = 0;
+ wmsCrsPtr crs;
+ if (lyr == NULL)
+ return 0;
+
+ crs = lyr->firstCrs;
+ while (crs != NULL)
+ {
+ count++;
+ crs = crs->next;
+ }
+ count += wms_parent_crs_count (lyr->Parent);
+ return count;
+}
+
+RL2_DECLARE int
+get_wms_layer_crs_count (rl2WmsLayerPtr handle)
+{
+/* counting how many CRSs are supported by a WMS-Layer */
+ int count = 0;
+ wmsCrsPtr crs;
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ crs = ptr->firstCrs;
+ while (crs != NULL)
+ {
+ count++;
+ crs = crs->next;
+ }
+ count += wms_parent_crs_count (ptr->Parent);
+ return count;
+}
+
+static wmsCrsPtr
+wms_parent_crs (wmsLayerPtr lyr, int *cnt, int index)
+{
+/* recursively finding a CRS by index (inheritance) */
+ int count = *cnt;
+ wmsCrsPtr crs;
+ if (lyr == NULL)
+ return 0;
+
+ crs = lyr->firstCrs;
+ while (crs != NULL)
+ {
+ if (count == index)
+ return crs;
+ count++;
+ crs = crs->next;
+ }
+ *cnt = count;
+ crs = wms_parent_crs (lyr->Parent, cnt, index);
+ return crs;
+}
+
+RL2_DECLARE const char *
+get_wms_layer_crs (rl2WmsLayerPtr handle, int index)
+{
+/* attempting to get the Nth CRS supported by some WMS-Layer object */
+ int count = 0;
+ wmsCrsPtr crs;
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ crs = ptr->firstCrs;
+ while (crs != NULL)
+ {
+ if (count == index)
+ return crs->Crs;
+ count++;
+ crs = crs->next;
+ }
+ crs = wms_parent_crs (ptr->Parent, &count, index);
+ if (crs != NULL)
+ return crs->Crs;
+ return NULL;
+}
+
+RL2_DECLARE int
+get_wms_layer_style_count (rl2WmsLayerPtr handle)
+{
+/* counting how many Styles are supported by a WMS-Layer */
+ int count = 0;
+ wmsStylePtr stl;
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ stl = ptr->firstStyle;
+ while (stl != NULL)
+ {
+ count++;
+ stl = stl->next;
+ }
+ return count;
+}
+
+RL2_DECLARE const char *
+get_wms_layer_style_name (rl2WmsLayerPtr handle, int index)
+{
+/* attempting to get the Name of the Nth Style supported by some WMS-Layer object */
+ int count = 0;
+ wmsStylePtr stl;
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ stl = ptr->firstStyle;
+ while (stl != NULL)
+ {
+ if (count == index)
+ return stl->Name;
+ count++;
+ stl = stl->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE const char *
+get_wms_layer_style_title (rl2WmsLayerPtr handle, int index)
+{
+/* attempting to get the Title of the Nth Style supported by some WMS-Layer object */
+ int count = 0;
+ wmsStylePtr stl;
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ stl = ptr->firstStyle;
+ while (stl != NULL)
+ {
+ if (count == index)
+ return stl->Title;
+ count++;
+ stl = stl->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE const char *
+get_wms_layer_style_abstract (rl2WmsLayerPtr handle, int index)
+{
+/* attempting to get the Abstract of the Nth Style supported by some WMS-Layer object */
+ int count = 0;
+ wmsStylePtr stl;
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ stl = ptr->firstStyle;
+ while (stl != NULL)
+ {
+ if (count == index)
+ return stl->Abstract;
+ count++;
+ stl = stl->next;
+ }
+ return NULL;
+}
+
+static void
+wms_parent_opaque (wmsLayerPtr lyr, int *opaque)
+{
+/* recursively testing the Opaque property from a parent Layer (inheritance) */
+ if (lyr == NULL)
+ return;
+
+ if (lyr->Opaque >= 0)
+ {
+ *opaque = lyr->Opaque;
+ return;
+ }
+ wms_parent_opaque (lyr->Parent, opaque);
+}
+
+RL2_DECLARE int
+is_wms_layer_opaque (rl2WmsLayerPtr handle)
+{
+/* Tests if some WMS-Layer object declares the Opaque property */
+ int opaque = -1;
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ if (ptr->Opaque >= 0)
+ return ptr->Opaque;
+ wms_parent_opaque (ptr->Parent, &opaque);
+ return opaque;
+}
+
+static void
+wms_parent_queryable (wmsLayerPtr lyr, int *queryable)
+{
+/* recursively testing the Queryable property from a parent Layer (inheritance) */
+ if (lyr == NULL)
+ return;
+
+ if (lyr->Queryable >= 0)
+ {
+ *queryable = lyr->Queryable;
+ return;
+ }
+ wms_parent_opaque (lyr->Parent, queryable);
+}
+
+RL2_DECLARE int
+is_wms_layer_queryable (rl2WmsLayerPtr handle)
+{
+/* Tests if some WMS-Layer object declares the Queryable property */
+ int queryable = -1;
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ if (ptr->Queryable >= 0)
+ return ptr->Queryable;
+ wms_parent_queryable (ptr->Parent, &queryable);
+ return queryable;
+}
+
+RL2_DECLARE double
+get_wms_layer_min_scale_denominator (rl2WmsLayerPtr handle)
+{
+/* Return the MinScaleDenominator from some WMS-Layer object */
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return DBL_MAX;
+
+ return ptr->MinScaleDenominator;
+}
+
+RL2_DECLARE double
+get_wms_layer_max_scale_denominator (rl2WmsLayerPtr handle)
+{
+/* Return the MaxScaleDenominator from some WMS-Layer object */
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ if (ptr == NULL)
+ return DBL_MAX;
+
+ return ptr->MaxScaleDenominator;
+}
+
+RL2_DECLARE int
+get_wms_layer_geo_bbox (rl2WmsLayerPtr handle, double *minx, double *maxx,
+ double *miny, double *maxy)
+{
+/* Return the Geographic Bounding Box from some WMS-Layer object */
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ *minx = DBL_MAX;
+ *maxx = DBL_MAX;
+ *miny = DBL_MAX;
+ *maxx = DBL_MAX;
+ if (ptr == NULL)
+ return 0;
+
+ if (ptr->MinLat == DBL_MAX && ptr->MaxLat == DBL_MAX
+ && ptr->MinLong == DBL_MAX && ptr->MaxLong == DBL_MAX)
+ {
+ /* undefined: iteratively searching its Parents */
+ wmsLayerPtr parent = ptr->Parent;
+ while (parent != NULL)
+ {
+ if (parent->MinLat == DBL_MAX && parent->MaxLat == DBL_MAX
+ && parent->MinLong == DBL_MAX && parent->MaxLong == DBL_MAX)
+ {
+ parent = parent->Parent;
+ continue;
+ }
+ *miny = parent->MinLat;
+ *maxy = parent->MaxLat;
+ *minx = parent->MinLong;
+ *maxx = parent->MaxLong;
+ return 1;
+ }
+ }
+ *miny = ptr->MinLat;
+ *maxy = ptr->MaxLat;
+ *minx = ptr->MinLong;
+ *maxx = ptr->MaxLong;
+ return 1;
+}
+
+RL2_DECLARE int
+get_wms_layer_bbox (rl2WmsLayerPtr handle, const char *crs, double *minx,
+ double *maxx, double *miny, double *maxy)
+{
+/* Return the Bounding Box corresponding to given CRS from some WMS-Layer object */
+ wmsBBoxPtr bbox;
+ wmsLayerPtr ptr = (wmsLayerPtr) handle;
+ wmsLayerPtr parent;
+ *minx = DBL_MAX;
+ *maxx = DBL_MAX;
+ *miny = DBL_MAX;
+ *maxx = DBL_MAX;
+ if (ptr == NULL)
+ return 0;
+
+ bbox = ptr->firstBBox;
+ while (bbox != NULL)
+ {
+ if (strcmp (bbox->Crs, crs) == 0)
+ {
+ *miny = bbox->MinY;
+ *maxy = bbox->MaxY;
+ *minx = bbox->MinX;
+ *maxx = bbox->MaxX;
+ return 1;
+ }
+ bbox = bbox->next;
+ }
+
+/* not found: iteratively searching its Parents */
+ parent = ptr->Parent;
+ while (parent != NULL)
+ {
+ bbox = parent->firstBBox;
+ while (bbox != NULL)
+ {
+ if (strcmp (bbox->Crs, crs) == 0)
+ {
+ *miny = bbox->MinY;
+ *maxy = bbox->MaxY;
+ *minx = bbox->MinX;
+ *maxx = bbox->MaxX;
+ return 1;
+ }
+ bbox = bbox->next;
+ }
+ parent = parent->Parent;
+ }
+ return 0;
+}
+
+RL2_DECLARE void
+destroy_wms_feature_collection (rl2WmsFeatureCollectionPtr handle)
+{
+/* memory cleanup: freeing a GML Feature Collection object */
+ wmsFeatureCollectionPtr ptr = (wmsFeatureCollectionPtr) handle;
+ if (ptr == NULL)
+ return;
+ wmsFreeFeatureCollection (ptr);
+}
+
+static int
+check_swap (gaiaGeomCollPtr geom, double point_x, double point_y)
+{
+/* checking if X and Y axes should be flipped */
+ double x;
+ double y;
+ double z;
+ double m;
+ double dist;
+ double dist_flip;
+ gaiaPointPtr pt;
+ gaiaLinestringPtr ln;
+ gaiaPolygonPtr pg;
+ pt = geom->FirstPoint;
+ if (pt != NULL)
+ {
+ x = pt->X;
+ y = pt->Y;
+ goto eval;
+ }
+ ln = geom->FirstLinestring;
+ if (ln != NULL)
+ {
+ if (ln->DimensionModel == GAIA_XY_Z)
+ {
+ gaiaGetPointXYZ (ln->Coords, 0, &x, &y, &z);
+ }
+ else if (ln->DimensionModel == GAIA_XY_M)
+ {
+ gaiaGetPointXYM (ln->Coords, 0, &x, &y, &m);
+ }
+ else if (ln->DimensionModel == GAIA_XY_Z_M)
+ {
+ gaiaGetPointXYZM (ln->Coords, 0, &x, &y, &z, &m);
+ }
+ else
+ {
+ gaiaGetPoint (ln->Coords, 0, &x, &y);
+ }
+ goto eval;
+ }
+ pg = geom->FirstPolygon;
+ if (pg != NULL)
+ {
+ gaiaRingPtr ring = pg->Exterior;
+ if (ring->DimensionModel == GAIA_XY_Z)
+ {
+ gaiaGetPointXYZ (ring->Coords, 0, &x, &y, &z);
+ }
+ else if (ring->DimensionModel == GAIA_XY_M)
+ {
+ gaiaGetPointXYM (ring->Coords, 0, &x, &y, &m);
+ }
+ else if (ring->DimensionModel == GAIA_XY_Z_M)
+ {
+ gaiaGetPointXYZM (ring->Coords, 0, &x, &y, &z, &m);
+ }
+ else
+ {
+ gaiaGetPoint (ring->Coords, 0, &x, &y);
+ }
+ goto eval;
+ }
+ return 0;
+ eval:
+ dist =
+ sqrt (((x - point_x) * (x - point_x)) +
+ ((y - point_y) * (y - point_y)));
+ dist_flip =
+ sqrt (((x - point_y) * (x - point_y)) +
+ ((y - point_x) * (y - point_x)));
+ if (dist_flip < dist)
+ return 1;
+ return 0;
+}
+
+static void
+getProjParams (void *p_sqlite, int srid, char **proj_params)
+{
+/* retrieves the PROJ params from SPATIAL_SYS_REF table, if possible */
+ sqlite3 *sqlite = (sqlite3 *) p_sqlite;
+ char *sql;
+ char **results;
+ int rows;
+ int columns;
+ int i;
+ int ret;
+ int len;
+ const char *proj4text;
+ char *errMsg = NULL;
+ *proj_params = NULL;
+ sql = sqlite3_mprintf
+ ("SELECT proj4text FROM spatial_ref_sys WHERE srid = %d", srid);
+ ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &errMsg);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "unknown SRID: %d\t<%s>\n", srid, errMsg);
+ sqlite3_free (errMsg);
+ return;
+ }
+ for (i = 1; i <= rows; i++)
+ {
+ proj4text = results[(i * columns)];
+ if (proj4text != NULL)
+ {
+ len = strlen (proj4text);
+ *proj_params = malloc (len + 1);
+ strcpy (*proj_params, proj4text);
+ }
+ }
+ if (*proj_params == NULL)
+ fprintf (stderr, "unknown SRID: %d\n", srid);
+ sqlite3_free_table (results);
+}
+
+static gaiaGeomCollPtr
+reproject (gaiaGeomCollPtr geom, int srid, sqlite3 * sqlite)
+{
+/* attempting to reproject into a different CRS */
+ char *proj_from;
+ char *proj_to;
+ gaiaGeomCollPtr g2 = NULL;
+ getProjParams (sqlite, geom->Srid, &proj_from);
+ getProjParams (sqlite, srid, &proj_to);
+ if (proj_to == NULL || proj_from == NULL)
+ ;
+ else
+ g2 = gaiaTransform (geom, proj_from, proj_to);
+ if (proj_from)
+ free (proj_from);
+ if (proj_to)
+ free (proj_to);
+ return g2;
+}
+
+RL2_DECLARE void
+wms_feature_collection_parse_geometries (rl2WmsFeatureCollectionPtr
+ handle, int srid, double point_x,
+ double point_y, sqlite3 * sqlite)
+{
+/* attempting to parse any GML Geometry contained within a Feature Collection object */
+ wmsFeatureMemberPtr member;
+ wmsFeatureCollectionPtr ptr = (wmsFeatureCollectionPtr) handle;
+ if (ptr == NULL)
+ return;
+
+ member = ptr->first;
+ while (member != NULL)
+ {
+ /* looping on FeatureMembers */
+ wmsFeatureAttributePtr attr;
+ attr = member->first;
+ while (attr != NULL)
+ {
+ /* looping on FeatureAttributes */
+ if (attr->value != NULL)
+ {
+ /* attempting to parse a possible GML Geometry */
+ gaiaGeomCollPtr geom =
+ gaiaParseGml ((const unsigned char *) (attr->value),
+ sqlite);
+ if (geom != NULL)
+ {
+ if (geom->Srid > 0 && srid > 0
+ && geom->Srid != srid)
+ {
+ /* attempting to reproject into the Map CRS */
+ gaiaGeomCollPtr g2 =
+ reproject (geom, srid, sqlite);
+ if (g2 != NULL)
+ {
+ if (check_swap (g2, point_x, point_y))
+ {
+ gaiaFreeGeomColl (g2);
+ gaiaSwapCoords (geom);
+ g2 = reproject (geom, srid,
+ sqlite);
+ attr->geometry = g2;
+ gaiaFreeGeomColl (geom);
+ }
+ else
+ {
+ attr->geometry = g2;
+ gaiaFreeGeomColl (geom);
+ }
+ }
+ }
+ else
+ {
+ if (check_swap (geom, point_x, point_y))
+ gaiaSwapCoords (geom);
+ attr->geometry = geom;
+ }
+ }
+ }
+ attr = attr->next;
+ }
+ member = member->next;
+ }
+}
+
+RL2_DECLARE int
+get_wms_feature_members_count (rl2WmsFeatureCollectionPtr handle)
+{
+/* counting how many Feature Members are contained within a WMS-FeatureCollection */
+ int count = 0;
+ wmsFeatureMemberPtr member;
+ wmsFeatureCollectionPtr ptr = (wmsFeatureCollectionPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ member = ptr->first;
+ while (member != NULL)
+ {
+ count++;
+ member = member->next;
+ }
+ return count;
+}
+
+RL2_DECLARE rl2WmsFeatureMemberPtr
+get_wms_feature_member (rl2WmsFeatureCollectionPtr handle, int index)
+{
+/* attempting to get the Nth FeatureMember from some WMS-FeatureCollection object */
+ int count = 0;
+ wmsFeatureMemberPtr member;
+ wmsFeatureCollectionPtr ptr = (wmsFeatureCollectionPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ member = ptr->first;
+ while (member != NULL)
+ {
+ if (count == index)
+ return (rl2WmsFeatureMemberPtr) member;
+ count++;
+ member = member->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE int
+get_wms_feature_attributes_count (rl2WmsFeatureMemberPtr handle)
+{
+/* counting how many Feature Attributes are contained within a WMS-FeatureMember */
+ int count = 0;
+ wmsFeatureAttributePtr attr;
+ wmsFeatureMemberPtr ptr = (wmsFeatureMemberPtr) handle;
+ if (ptr == NULL)
+ return -1;
+
+ attr = ptr->first;
+ while (attr != NULL)
+ {
+ count++;
+ attr = attr->next;
+ }
+ return count;
+}
+
+RL2_DECLARE const char *
+get_wms_feature_attribute_name (rl2WmsFeatureMemberPtr handle, int index)
+{
+/* attempting to get the Nth FeatureAttribute (Name) from some WMS-FeatureMember object */
+ int count = 0;
+ wmsFeatureAttributePtr attr;
+ wmsFeatureMemberPtr ptr = (wmsFeatureMemberPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ attr = ptr->first;
+ while (attr != NULL)
+ {
+ if (count == index)
+ return attr->name;
+ count++;
+ attr = attr->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE gaiaGeomCollPtr
+get_wms_feature_attribute_geometry (rl2WmsFeatureMemberPtr handle, int index)
+{
+/* attempting to get the Nth FeatureAttribute (Geometry) from some WMS-FeatureMember object */
+ int count = 0;
+ wmsFeatureAttributePtr attr;
+ wmsFeatureMemberPtr ptr = (wmsFeatureMemberPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ attr = ptr->first;
+ while (attr != NULL)
+ {
+ if (count == index)
+ return attr->geometry;
+ count++;
+ attr = attr->next;
+ }
+ return NULL;
+}
+
+RL2_DECLARE const char *
+get_wms_feature_attribute_value (rl2WmsFeatureMemberPtr handle, int index)
+{
+/* attempting to get the Nth FeatureAttribute (Value) from some WMS-FeatureMember object */
+ int count = 0;
+ wmsFeatureAttributePtr attr;
+ wmsFeatureMemberPtr ptr = (wmsFeatureMemberPtr) handle;
+ if (ptr == NULL)
+ return NULL;
+
+ attr = ptr->first;
+ while (attr != NULL)
+ {
+ if (count == index)
+ return attr->value;
+ count++;
+ attr = attr->next;
+ }
+ return NULL;
+}
+
+static int
+check_marker (const char *url)
+{
+/* testing if some "?" marker is already defined */
+ int i;
+ int force_marker = 1;
+ for (i = 0; i < (int) strlen (url); i++)
+ {
+ if (*(url + i) == '?')
+ force_marker = 0;
+ }
+ return force_marker;
+}
+
+RL2_DECLARE unsigned char *
+do_wms_GetMap_get (rl2WmsCachePtr cache_handle, const char *url,
+ const char *proxy, const char *version, const char *layer,
+ const char *crs, int swap_xy, double minx, double miny,
+ double maxx, double maxy, int width, int height,
+ const char *style, const char *format, int opaque,
+ int from_cache, char **err_msg)
+{
+/* attempting to execute a WMS GepMap request [method GET] */
+ CURL *curl = NULL;
+ CURLcode res;
+ wmsMemBuffer headerBuf;
+ wmsMemBuffer bodyBuf;
+ int http_status;
+ char *http_code;
+ char *request;
+ char *image_format;
+ unsigned char *rgba = NULL;
+ int force_marker = check_marker (url);
+ const char *crs_prefix = "CRS";
+ rl2RasterPtr raster = NULL;
+ wmsCachePtr cache = (wmsCachePtr) cache_handle;
+
+ *err_msg = NULL;
+ if (from_cache && cache == NULL)
+ return NULL;
+
+/* masking NULL arguments */
+ if (url == NULL)
+ url = "";
+ if (version == NULL)
+ version = "";
+ if (layer == NULL)
+ layer = "";
+ if (crs == NULL)
+ crs = "";
+ if (style == NULL)
+ style = "";
+ if (format == NULL)
+ format = "";
+
+/* preparing the request URL */
+ if (strcmp (version, "1.3.0") < 0)
+ {
+ /* earlier versions of the protocol require SRS instead of CRS */
+ crs_prefix = "SRS";
+ }
+ if (force_marker)
+ {
+ /* "?" marker not declared */
+ if (swap_xy)
+ request =
+ sqlite3_mprintf ("%s?SERVICE=WMS&REQUEST=GetMap&VERSION=%s"
+ "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f"
+ "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s"
+ "&TRANSPARENT=%s&BGCOLOR=0xFFFFFF", url,
+ version, layer, crs_prefix, crs, miny, minx,
+ maxy, maxx, width, height, style, format,
+ (opaque == 0) ? "TRUE" : "FALSE");
+ else
+ request =
+ sqlite3_mprintf ("%s?SERVICE=WMS&REQUEST=GetMap&VERSION=%s"
+ "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f"
+ "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s"
+ "&TRANSPARENT=%s&BGCOLOR=0xFFFFFF", url,
+ version, layer, crs_prefix, crs, minx, miny,
+ maxx, maxy, width, height, style, format,
+ (opaque == 0) ? "TRUE" : "FALSE");
+ }
+ else
+ {
+ /* "?" marker already defined */
+ if (swap_xy)
+ request =
+ sqlite3_mprintf ("%sSERVICE=WMS&REQUEST=GetMap&VERSION=%s"
+ "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f"
+ "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s"
+ "&TRANSPARENT=%s&BGCOLOR=0xFFFFFF", url,
+ version, layer, crs_prefix, crs, miny, minx,
+ maxy, maxx, width, height, style, format,
+ (opaque == 0) ? "TRUE" : "FALSE");
+ else
+ request =
+ sqlite3_mprintf ("%sSERVICE=WMS&REQUEST=GetMap&VERSION=%s"
+ "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f"
+ "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s"
+ "&TRANSPARENT=%s&BGCOLOR=0xFFFFFF", url,
+ version, layer, crs_prefix, crs, minx, miny,
+ maxx, maxy, width, height, style, format,
+ (opaque == 0) ? "TRUE" : "FALSE");
+ }
+
+ if (cache != NULL)
+ {
+ /* checks if it's already stored into the WMS Cache */
+ wmsCachedItemPtr cachedItem = getWmsCachedItem (cache, request);
+ if (cachedItem != NULL)
+ {
+ /* ok, found from WMS Cache */
+ time_t xtime;
+ time (&xtime);
+ cachedItem->Time = xtime;
+ /* attempting to decode an RGBA image */
+ if (cachedItem->ImageFormat == WMS_FORMAT_GIF)
+ raster =
+ rl2_raster_from_gif (cachedItem->Item,
+ cachedItem->Size);
+ if (cachedItem->ImageFormat == WMS_FORMAT_PNG)
+ raster =
+ rl2_raster_from_png (cachedItem->Item,
+ cachedItem->Size);
+ if (cachedItem->ImageFormat == WMS_FORMAT_JPEG)
+ raster =
+ rl2_raster_from_jpeg (cachedItem->Item,
+ cachedItem->Size);
+ if (cachedItem->ImageFormat == WMS_FORMAT_TIFF)
+ raster =
+ rl2_raster_from_tiff (cachedItem->Item,
+ cachedItem->Size);
+ goto image_ready;
+ }
+ }
+ if (from_cache)
+ {
+ sqlite3_free (request);
+ return NULL;
+ }
+
+ curl = curl_easy_init ();
+ if (curl)
+ {
+ /* setting the URL */
+ curl_easy_setopt (curl, CURLOPT_URL, request);
+
+ if (proxy != NULL)
+ {
+ /* setting up the required proxy */
+ curl_easy_setopt (curl, CURLOPT_PROXY, proxy);
+ }
+
+ /* no progress meter please */
+ curl_easy_setopt (curl, CURLOPT_NOPROGRESS, 1L);
+ /* setting the output callback function */
+ curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, store_data);
+
+ /* initializes the dynamically growing buffers */
+ wmsMemBufferInitialize (&headerBuf);
+ wmsMemBufferInitialize (&bodyBuf);
+ curl_easy_setopt (curl, CURLOPT_WRITEHEADER, &headerBuf);
+ curl_easy_setopt (curl, CURLOPT_WRITEDATA, &bodyBuf);
+
+ /* Perform the request, res will get the return code */
+ res = curl_easy_perform (curl);
+ /* Check for errors */
+ if (res != CURLE_OK)
+ {
+ fprintf (stderr, "CURL error: %s\n", curl_easy_strerror (res));
+ goto stop;
+ }
+
+ /* verifying the HTTP status code */
+ check_http_header (&headerBuf, &http_status, &http_code);
+ if (http_status == 302)
+ {
+ while (1)
+ {
+ /* following a redirect */
+ char *redir = parse_http_redirect (&headerBuf);
+ if (redir == NULL)
+ break;
+ /* resetting all buffers */
+ if (http_code != NULL)
+ free (http_code);
+ wmsMemBufferReset (&headerBuf);
+ wmsMemBufferReset (&bodyBuf);
+ curl_easy_setopt (curl, CURLOPT_URL, redir);
+ if (proxy != NULL)
+ curl_easy_setopt (curl, CURLOPT_PROXY, proxy);
+ res = curl_easy_perform (curl);
+ if (res != CURLE_OK)
+ {
+ fprintf (stderr, "CURL error: %s\n",
+ curl_easy_strerror (res));
+ goto stop;
+ }
+ free (redir);
+ check_http_header (&headerBuf, &http_status, &http_code);
+ if (http_status == 302)
+ continue;
+ break;
+ }
+
+ }
+ if (http_status != 200)
+ {
+ fprintf (stderr, "Invalid HTTP status code: %d %s\n",
+ http_status, http_code);
+ if (http_code != NULL)
+ free (http_code);
+ goto stop;
+ }
+ if (http_code != NULL)
+ free (http_code);
+
+ /* attempting to decode an RGBA image */
+ image_format = parse_http_format (&headerBuf);
+ if (strcmp (image_format, "image/gif") == 0)
+ raster =
+ rl2_raster_from_gif (bodyBuf.Buffer, bodyBuf.WriteOffset);
+ if (strcmp (image_format, "image/png") == 0)
+ raster =
+ rl2_raster_from_png (bodyBuf.Buffer, bodyBuf.WriteOffset);
+ if (strcmp (image_format, "image/jpeg") == 0)
+ raster =
+ rl2_raster_from_jpeg (bodyBuf.Buffer, bodyBuf.WriteOffset);
+ if (strcmp (image_format, "image/tiff") == 0)
+ raster =
+ rl2_raster_from_tiff (bodyBuf.Buffer, bodyBuf.WriteOffset);
+
+ if (raster != NULL)
+ {
+ /* saving into the WMS Cache */
+ wmsAddCachedItem (cache, request, bodyBuf.Buffer,
+ bodyBuf.WriteOffset, image_format);
+ }
+
+ if (image_format != NULL)
+ free (image_format);
+
+ stop:
+ wmsMemBufferReset (&headerBuf);
+ wmsMemBufferReset (&bodyBuf);
+ curl_easy_cleanup (curl);
+ }
+
+ image_ready:
+ sqlite3_free (request);
+
+ if (raster != NULL)
+ {
+ /* exporting the image into an RGBA pix-buffer */
+ int size;
+ int ret = rl2_raster_data_to_RGBA (raster, &rgba, &size);
+ rl2_destroy_raster (raster);
+ if (ret == RL2_OK && rgba != NULL && size == (width * height * 4))
+ return rgba;
+ if (rgba != NULL)
+ free (rgba);
+ rgba = NULL;
+ }
+ return rgba;
+}
+
+RL2_DECLARE unsigned char *
+do_wms_GetMap_post (rl2WmsCachePtr cache_handle, const char *url,
+ const char *proxy, const char *version, const char *layer,
+ const char *crs, int swap_xy, double minx, double miny,
+ double maxx, double maxy, int width, int height,
+ const char *style, const char *format, int opaque,
+ int from_cache, char **err_msg)
+{
+/* attempting to execute a WMS GepMap request [method POST] */
+
+/* not yet implemented: just a stupid placeholder always returning NULL */
+ if (cache_handle == NULL || url == NULL || proxy == NULL || version == NULL
+ || layer == NULL || crs == NULL)
+ return NULL;
+ if (minx == miny || maxx == maxy || width == height || opaque == from_cache
+ || width == swap_xy)
+ return NULL;
+ if (style == NULL || format == NULL || err_msg == NULL)
+ return NULL;
+ return NULL;
+}
+
+RL2_DECLARE unsigned char *
+do_wms_GetMap_TileService_get (rl2WmsCachePtr cache_handle, const char *url,
+ const char *proxy, int width, int height,
+ int from_cache, char **err_msg)
+{
+/* attempting to execute a WMS GepMap TileService request [method GET] */
+ CURL *curl = NULL;
+ CURLcode res;
+ wmsMemBuffer headerBuf;
+ wmsMemBuffer bodyBuf;
+ int http_status;
+ char *http_code;
+ char *image_format;
+ unsigned char *rgba = NULL;
+ rl2RasterPtr raster = NULL;
+ wmsCachePtr cache = (wmsCachePtr) cache_handle;
+
+ *err_msg = NULL;
+ if (from_cache && cache == NULL)
+ return NULL;
+
+/* masking NULL arguments */
+ if (url == NULL)
+ url = "";
+
+ if (cache != NULL)
+ {
+ /* checks if it's already stored into the WMS Cache */
+ wmsCachedItemPtr cachedItem = getWmsCachedItem (cache, url);
+ if (cachedItem != NULL)
+ {
+ /* ok, found from WMS Cache */
+ time_t xtime;
+ time (&xtime);
+ cachedItem->Time = xtime;
+ /* attempting to decode an RGBA image */
+ if (cachedItem->ImageFormat == WMS_FORMAT_GIF)
+ raster =
+ rl2_raster_from_gif (cachedItem->Item,
+ cachedItem->Size);
+ if (cachedItem->ImageFormat == WMS_FORMAT_PNG)
+ raster =
+ rl2_raster_from_png (cachedItem->Item,
+ cachedItem->Size);
+ if (cachedItem->ImageFormat == WMS_FORMAT_JPEG)
+ raster =
+ rl2_raster_from_jpeg (cachedItem->Item,
+ cachedItem->Size);
+ if (cachedItem->ImageFormat == WMS_FORMAT_TIFF)
+ raster =
+ rl2_raster_from_tiff (cachedItem->Item,
+ cachedItem->Size);
+ goto image_ready;
+ }
+ }
+ if (from_cache)
+ return NULL;
+
+ curl = curl_easy_init ();
+ if (curl)
+ {
+ /* setting the URL */
+ curl_easy_setopt (curl, CURLOPT_URL, url);
+
+ if (proxy != NULL)
+ {
+ /* setting up the required proxy */
+ curl_easy_setopt (curl, CURLOPT_PROXY, proxy);
+ }
+
+ /* no progress meter please */
+ curl_easy_setopt (curl, CURLOPT_NOPROGRESS, 1L);
+ /* setting the output callback function */
+ curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, store_data);
+
+ /* initializes the dynamically growing buffers */
+ wmsMemBufferInitialize (&headerBuf);
+ wmsMemBufferInitialize (&bodyBuf);
+ curl_easy_setopt (curl, CURLOPT_WRITEHEADER, &headerBuf);
+ curl_easy_setopt (curl, CURLOPT_WRITEDATA, &bodyBuf);
+
+ /* Perform the request, res will get the return code */
+ res = curl_easy_perform (curl);
+ /* Check for errors */
+ if (res != CURLE_OK)
+ {
+ fprintf (stderr, "CURL error: %s\n", curl_easy_strerror (res));
+ goto stop;
+ }
+
+ /* verifying the HTTP status code */
+ check_http_header (&headerBuf, &http_status, &http_code);
+ if (http_status == 302)
+ {
+ while (1)
+ {
+ /* following a redirect */
+ char *redir = parse_http_redirect (&headerBuf);
+ if (redir == NULL)
+ break;
+ /* resetting all buffers */
+ if (http_code != NULL)
+ free (http_code);
+ wmsMemBufferReset (&headerBuf);
+ wmsMemBufferReset (&bodyBuf);
+ curl_easy_setopt (curl, CURLOPT_URL, redir);
+ if (proxy != NULL)
+ curl_easy_setopt (curl, CURLOPT_PROXY, proxy);
+ res = curl_easy_perform (curl);
+ if (res != CURLE_OK)
+ {
+ fprintf (stderr, "CURL error: %s\n",
+ curl_easy_strerror (res));
+ goto stop;
+ }
+ free (redir);
+ check_http_header (&headerBuf, &http_status, &http_code);
+ if (http_status == 302)
+ continue;
+ break;
+ }
+
+ }
+ if (http_status != 200)
+ {
+ fprintf (stderr, "Invalid HTTP status code: %d %s\n",
+ http_status, http_code);
+ if (http_code != NULL)
+ free (http_code);
+ goto stop;
+ }
+ if (http_code != NULL)
+ free (http_code);
+
+ /* attempting to decode an RGBA image */
+ image_format = parse_http_format (&headerBuf);
+ if (strcmp (image_format, "image/gif") == 0)
+ raster =
+ rl2_raster_from_gif (bodyBuf.Buffer, bodyBuf.WriteOffset);
+ if (strcmp (image_format, "image/png") == 0)
+ raster =
+ rl2_raster_from_png (bodyBuf.Buffer, bodyBuf.WriteOffset);
+ if (strcmp (image_format, "image/jpeg") == 0)
+ raster =
+ rl2_raster_from_jpeg (bodyBuf.Buffer, bodyBuf.WriteOffset);
+ if (strcmp (image_format, "image/tiff") == 0)
+ raster =
+ rl2_raster_from_tiff (bodyBuf.Buffer, bodyBuf.WriteOffset);
+
+ if (raster != NULL)
+ {
+ /* saving into the WMS Cache */
+ wmsAddCachedItem (cache, url, bodyBuf.Buffer,
+ bodyBuf.WriteOffset, image_format);
+ }
+
+ if (image_format != NULL)
+ free (image_format);
+
+ stop:
+ wmsMemBufferReset (&headerBuf);
+ wmsMemBufferReset (&bodyBuf);
+ curl_easy_cleanup (curl);
+ }
+
+ image_ready:
+
+ if (raster != NULL)
+ {
+ /* exporting the image into an RGBA pix-buffer */
+ int size;
+ int ret = rl2_raster_data_to_RGBA (raster, &rgba, &size);
+ rl2_destroy_raster (raster);
+ if (ret == RL2_OK && rgba != NULL && size == (width * height * 4))
+ return rgba;
+ if (rgba != NULL)
+ free (rgba);
+ rgba = NULL;
+ }
+ return rgba;
+}
+
+RL2_DECLARE unsigned char *
+do_wms_GetMap_TileService_post (rl2WmsCachePtr cache_handle, const char *url,
+ const char *proxy, int width, int height,
+ int from_cache, char **err_msg)
+{
+/* attempting to execute a WMS GepMap TileService request [method POST] */
+
+/* not yet implemented: just a stupid placeholder always returning NULL */
+ if (cache_handle == NULL || url == NULL || proxy == NULL || err_msg == NULL)
+ return NULL;
+ if (width == height || width == from_cache)
+ return NULL;
+ return NULL;
+}
+
+RL2_DECLARE rl2WmsFeatureCollectionPtr
+do_wms_GetFeatureInfo_get (const char *url, const char *proxy,
+ const char *version, const char *format,
+ const char *layer, const char *crs, int swap_xy,
+ double minx, double miny, double maxx, double maxy,
+ int width, int height, int mouse_x, int mouse_y,
+ char **err_msg)
+{
+/* attempting to execute a WMS GepFeatureInfo request [method GET] */
+ CURL *curl = NULL;
+ CURLcode res;
+ wmsMemBuffer headerBuf;
+ wmsMemBuffer bodyBuf;
+ wmsFeatureCollectionPtr coll = NULL;
+ int http_status;
+ char *http_code;
+ char *request;
+ char *multipart_boundary;
+ const char *crs_prefix = "CRS";
+ char *xml_buf;
+ int force_marker = check_marker (url);
+
+ *err_msg = NULL;
+
+/* masking NULL arguments */
+ if (url == NULL)
+ url = "";
+ if (version == NULL)
+ version = "";
+ if (format == NULL)
+ format = "";
+ if (layer == NULL)
+ layer = "";
+ if (crs == NULL)
+ crs = "";
+
+/* preparing the request URL */
+ if (strcmp (version, "1.3.0") < 0)
+ {
+ /* earlier versions of the protocol require SRS instead of CRS */
+ crs_prefix = "SRS";
+ }
+ if (force_marker)
+ {
+ if (swap_xy)
+ request =
+ sqlite3_mprintf
+ ("%s?SERVICE=WMS&REQUEST=GetFeatureInfo&VERSION=%s&LAYERS=%s"
+ "&QUERY_LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f"
+ "&WIDTH=%d&HEIGHT=%d&X=%d&Y=%d&INFO_FORMAT=%s"
+ "&FEATURE_COUNT=50", url, version, layer, layer, crs_prefix,
+ crs, miny, minx, maxy, maxx, width, height, mouse_x,
+ mouse_y, format);
+ else
+ request =
+ sqlite3_mprintf
+ ("%s?SERVICE=WMS&REQUEST=GetFeatureInfo&VERSION=%s&LAYERS=%s"
+ "&QUERY_LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f"
+ "&WIDTH=%d&HEIGHT=%d&X=%d&Y=%d&INFO_FORMAT=%s"
+ "&FEATURE_COUNT=50", url, version, layer, layer, crs_prefix,
+ crs, minx, miny, maxx, maxy, width, height, mouse_x,
+ mouse_y, format);
+ }
+ else
+ {
+ if (swap_xy)
+ request =
+ sqlite3_mprintf
+ ("%sSERVICE=WMS&REQUEST=GetFeatureInfo&VERSION=%s&LAYERS=%s"
+ "&QUERY_LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f"
+ "&WIDTH=%d&HEIGHT=%d&X=%d&Y=%d&INFO_FORMAT=%s"
+ "&FEATURE_COUNT=50", url, version, layer, layer, crs_prefix,
+ crs, miny, minx, maxy, maxx, width, height, mouse_x,
+ mouse_y, format);
+ else
+ request =
+ sqlite3_mprintf
+ ("%sSERVICE=WMS&REQUEST=GetFeatureInfo&VERSION=%s&LAYERS=%s"
+ "&QUERY_LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f"
+ "&WIDTH=%d&HEIGHT=%d&X=%d&Y=%d&INFO_FORMAT=%s"
+ "&FEATURE_COUNT=50", url, version, layer, layer, crs_prefix,
+ crs, minx, miny, maxx, maxy, width, height, mouse_x,
+ mouse_y, format);
+ }
+
+ curl = curl_easy_init ();
+ if (curl)
+ {
+ /* setting the URL */
+ curl_easy_setopt (curl, CURLOPT_URL, request);
+
+ if (proxy != NULL)
+ {
+ /* setting up the required proxy */
+ curl_easy_setopt (curl, CURLOPT_PROXY, proxy);
+ }
+
+ /* no progress meter please */
+ curl_easy_setopt (curl, CURLOPT_NOPROGRESS, 1L);
+ /* setting the output callback function */
+ curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, store_data);
+
+ /* initializes the dynamically growing buffers */
+ wmsMemBufferInitialize (&headerBuf);
+ wmsMemBufferInitialize (&bodyBuf);
+ curl_easy_setopt (curl, CURLOPT_WRITEHEADER, &headerBuf);
+ curl_easy_setopt (curl, CURLOPT_WRITEDATA, &bodyBuf);
+
+ /* Perform the request, res will get the return code */
+ res = curl_easy_perform (curl);
+ /* Check for errors */
+ if (res != CURLE_OK)
+ {
+ fprintf (stderr, "CURL error: %s\n", curl_easy_strerror (res));
+ goto stop;
+ }
+
+ /* verifying the HTTP status code */
+ check_http_header (&headerBuf, &http_status, &http_code);
+ if (http_status == 302)
+ {
+ while (1)
+ {
+ /* following a redirect */
+ char *redir = parse_http_redirect (&headerBuf);
+ if (redir == NULL)
+ break;
+ /* resetting all buffers */
+ if (http_code != NULL)
+ free (http_code);
+ wmsMemBufferReset (&headerBuf);
+ wmsMemBufferReset (&bodyBuf);
+ curl_easy_setopt (curl, CURLOPT_URL, redir);
+ if (proxy != NULL)
+ curl_easy_setopt (curl, CURLOPT_PROXY, proxy);
+ res = curl_easy_perform (curl);
+ if (res != CURLE_OK)
+ {
+ fprintf (stderr, "CURL error: %s\n",
+ curl_easy_strerror (res));
+ goto stop;
+ }
+ free (redir);
+ check_http_header (&headerBuf, &http_status, &http_code);
+ if (http_status == 302)
+ continue;
+ break;
+ }
+
+ }
+ if (http_status != 200)
+ {
+ fprintf (stderr, "Invalid HTTP status code: %d %s\n",
+ http_status, http_code);
+ if (http_code != NULL)
+ free (http_code);
+ goto stop;
+ }
+ if (http_code != NULL)
+ free (http_code);
+
+ multipart_boundary = check_http_multipart_response (&headerBuf);
+ if (multipart_boundary != NULL)
+ {
+ wmsMultipartCollectionPtr multi =
+ parse_multipart_body (&bodyBuf, multipart_boundary);
+ free (multipart_boundary);
+ if (multi != NULL)
+ {
+ wmsSinglePartResponsePtr single = multi->first;
+ while (single != NULL)
+ {
+ xml_buf = clean_xml_str (single->body);
+ if (xml_buf != NULL)
+ {
+ coll = parse_wms_feature_collection (xml_buf);
+ free (xml_buf);
+ }
+ if (coll != NULL)
+ {
+ wmsFreeMultipartCollection (multi);
+ goto stop;
+ }
+ single = single->next;
+ }
+ wmsFreeMultipartCollection (multi);
+ }
+ }
+ else
+ {
+ xml_buf = clean_xml (&bodyBuf);
+ if (xml_buf != NULL)
+ {
+ coll = parse_wms_feature_collection (xml_buf);
+ free (xml_buf);
+ }
+ }
+
+ stop:
+ wmsMemBufferReset (&headerBuf);
+ wmsMemBufferReset (&bodyBuf);
+ curl_easy_cleanup (curl);
+ }
+
+ sqlite3_free (request);
+ if (coll != NULL)
+ {
+ if (coll->first == NULL)
+ {
+ wmsFreeFeatureCollection (coll);
+ coll = NULL;
+ }
+ }
+ return (rl2WmsFeatureCollectionPtr) coll;
+}
+
+RL2_DECLARE rl2WmsFeatureCollectionPtr
+do_wms_GetFeatureInfo_post (const char *url, const char *proxy,
+ const char *version, const char *format,
+ const char *layer, const char *crs, int swap_xy,
+ double minx, double miny, double maxx, double maxy,
+ int width, int height, int mouse_x, int mouse_y,
+ char **err_msg)
+{
+/* attempting to execute a WMS GepFeatureInfo request [method POST] */
+
+/* not yet implemented: just a stupid placeholder always returning NULL */
+ if (url == NULL || proxy == NULL || version == NULL || format == NULL
+ || layer == NULL || crs == NULL)
+ return NULL;
+ if (minx == miny || maxx == maxy || width == height || mouse_x == mouse_y
+ || swap_xy == mouse_x)
+ return NULL;
+ if (err_msg == NULL)
+ return NULL;
+ return NULL;
+}
diff --git a/test-driver b/test-driver
new file mode 100644
index 0000000..32bf39e
--- /dev/null
+++ b/test-driver
@@ -0,0 +1,127 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2012-06-27.10; # UTC
+
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+# Make unconditional expansion of undefined variables an error. This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+ echo "$0: $*" >&2
+ print_usage >&2
+ exit 2
+}
+
+print_usage ()
+{
+ cat <<END
+Usage:
+ test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+ [--expect-failure={yes|no}] [--color-tests={yes|no}]
+ [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+# TODO: better error handling in option parsing (in particular, ensure
+# TODO: $log_file, $trs_file and $test_name are defined).
+test_name= # Used for reporting.
+log_file= # Where to save the output of the test script.
+trs_file= # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+ case $1 in
+ --help) print_usage; exit $?;;
+ --version) echo "test-driver $scriptversion"; exit $?;;
+ --test-name) test_name=$2; shift;;
+ --log-file) log_file=$2; shift;;
+ --trs-file) trs_file=$2; shift;;
+ --color-tests) color_tests=$2; shift;;
+ --expect-failure) expect_failure=$2; shift;;
+ --enable-hard-errors) enable_hard_errors=$2; shift;;
+ --) shift; break;;
+ -*) usage_error "invalid option: '$1'";;
+ esac
+ shift
+done
+
+if test $color_tests = yes; then
+ # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+ red='[0;31m' # Red.
+ grn='[0;32m' # Green.
+ lgn='[1;32m' # Light green.
+ blu='[1;34m' # Blue.
+ mgn='[0;35m' # Magenta.
+ std='[m' # No color.
+else
+ red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+ estatus=1
+fi
+
+case $estatus:$expect_failure in
+ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+ 0:*) col=$grn res=PASS recheck=no gcopy=no;;
+ 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
+ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
+ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
+ *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
+esac
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/test/Car_Yellow.svg b/test/Car_Yellow.svg
new file mode 100644
index 0000000..7d8fc00
--- /dev/null
+++ b/test/Car_Yellow.svg
@@ -0,0 +1,7483 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="900"
+ height="600"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ version="1.0"
+ sodipodi:docname="car.svgz"
+ inkscape:output_extension="org.inkscape.output.svgz.inkscape"
+ inkscape:export-filename="/home/hrum/Desktop/carrr/killxl_1.png"
+ inkscape:export-xdpi="100"
+ inkscape:export-ydpi="100"
+ sodipodi:modified="true">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 300 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="900 : 300 : 1"
+ inkscape:persp3d-origin="450 : 200 : 1"
+ id="perspective1323" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4399">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop4401" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop4403" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient5360"
+ inkscape:collect="always">
+ <stop
+ id="stop5362"
+ offset="0"
+ style="stop-color:black;stop-opacity:1" />
+ <stop
+ id="stop5364"
+ offset="1"
+ style="stop-color:#ebf1f1;stop-opacity:1" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient5297">
+ <stop
+ style="stop-color:#dfa60e;stop-opacity:1;"
+ offset="0"
+ id="stop5299" />
+ <stop
+ style="stop-color:#dfa60e;stop-opacity:0;"
+ offset="1"
+ id="stop5301" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4695">
+ <stop
+ style="stop-color:#fffb86;stop-opacity:1"
+ offset="0"
+ id="stop4697" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4699" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4424">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop4426" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop4428" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4298">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop4300" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop4303" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4371">
+ <stop
+ style="stop-color:#bdbdbd;stop-opacity:1;"
+ offset="0"
+ id="stop4373" />
+ <stop
+ style="stop-color:#bdbdbd;stop-opacity:0;"
+ offset="1"
+ id="stop4375" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4345">
+ <stop
+ style="stop-color:#dfeff5;stop-opacity:1;"
+ offset="0"
+ id="stop4347" />
+ <stop
+ style="stop-color:#dfeff5;stop-opacity:0;"
+ offset="1"
+ id="stop4349" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4337">
+ <stop
+ style="stop-color:#dfeff5;stop-opacity:1;"
+ offset="0"
+ id="stop4339" />
+ <stop
+ style="stop-color:#dfeff5;stop-opacity:0;"
+ offset="1"
+ id="stop4341" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4277">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4279" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4281" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4269">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4271" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4273" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4259">
+ <stop
+ style="stop-color:#dfeff5;stop-opacity:1;"
+ offset="0"
+ id="stop4261" />
+ <stop
+ style="stop-color:#dfeff5;stop-opacity:0;"
+ offset="1"
+ id="stop4263" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4247">
+ <stop
+ style="stop-color:#dfeff5;stop-opacity:1;"
+ offset="0"
+ id="stop4252" />
+ <stop
+ style="stop-color:#dfeff5;stop-opacity:0;"
+ offset="1"
+ id="stop4254" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4235">
+ <stop
+ style="stop-color:#dfeff5;stop-opacity:1;"
+ offset="0"
+ id="stop4237" />
+ <stop
+ style="stop-color:#dfeff5;stop-opacity:0;"
+ offset="1"
+ id="stop4241" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4273">
+ <stop
+ style="stop-color:#161616;stop-opacity:1;"
+ offset="0"
+ id="stop4275" />
+ <stop
+ style="stop-color:#161616;stop-opacity:0;"
+ offset="1"
+ id="stop4277" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4431">
+ <stop
+ style="stop-color:#1c1f24;stop-opacity:1"
+ offset="0"
+ id="stop4433" />
+ <stop
+ style="stop-color:#373e48;stop-opacity:0"
+ offset="1"
+ id="stop4436" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4278">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4280" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4282" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4270">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4272" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4274" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4262">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4264" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4266" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4254">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4256" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4258" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4246">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4248" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4250" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4238">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4240" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4242" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4228">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4230" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4232" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4147">
+ <stop
+ style="stop-color:black;stop-opacity:1"
+ offset="0"
+ id="stop4149" />
+ <stop
+ style="stop-color:#d6e9e8;stop-opacity:0;"
+ offset="1"
+ id="stop4151" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4139">
+ <stop
+ style="stop-color:black;stop-opacity:1"
+ offset="0"
+ id="stop4141" />
+ <stop
+ style="stop-color:white;stop-opacity:0"
+ offset="1"
+ id="stop4143" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4127">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop4130" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop4132" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4115">
+ <stop
+ style="stop-color:#fefefe;stop-opacity:1;"
+ offset="0"
+ id="stop4119" />
+ <stop
+ style="stop-color:#fefefe;stop-opacity:0;"
+ offset="1"
+ id="stop4121" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4102">
+ <stop
+ style="stop-color:#fefefe;stop-opacity:1;"
+ offset="0"
+ id="stop4105" />
+ <stop
+ style="stop-color:#fefefe;stop-opacity:0;"
+ offset="1"
+ id="stop4107" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4091">
+ <stop
+ style="stop-color:#fefefe;stop-opacity:1;"
+ offset="0"
+ id="stop4093" />
+ <stop
+ style="stop-color:#fefefe;stop-opacity:0;"
+ offset="1"
+ id="stop4095" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4076">
+ <stop
+ style="stop-color:#d7d7d7;stop-opacity:1;"
+ offset="0"
+ id="stop4078" />
+ <stop
+ style="stop-color:#d7d7d7;stop-opacity:0;"
+ offset="1"
+ id="stop4081" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4781">
+ <stop
+ style="stop-color:#1a3451;stop-opacity:1;"
+ offset="0"
+ id="stop4783" />
+ <stop
+ style="stop-color:#1a3451;stop-opacity:0;"
+ offset="1"
+ id="stop4785" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4672">
+ <stop
+ style="stop-color:#e4e4e4;stop-opacity:1;"
+ offset="0"
+ id="stop4674" />
+ <stop
+ style="stop-color:#e4e4e4;stop-opacity:0;"
+ offset="1"
+ id="stop4676" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4662">
+ <stop
+ style="stop-color:#e3ecf6;stop-opacity:1;"
+ offset="0"
+ id="stop4664" />
+ <stop
+ style="stop-color:#e3ecf6;stop-opacity:0;"
+ offset="1"
+ id="stop4666" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4652">
+ <stop
+ style="stop-color:#e3ecf6;stop-opacity:1;"
+ offset="0"
+ id="stop4654" />
+ <stop
+ style="stop-color:#e3ecf6;stop-opacity:0;"
+ offset="1"
+ id="stop4656" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4642">
+ <stop
+ style="stop-color:#3f4e50;stop-opacity:1;"
+ offset="0"
+ id="stop4644" />
+ <stop
+ style="stop-color:#3f4e50;stop-opacity:0;"
+ offset="1"
+ id="stop4646" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4558">
+ <stop
+ style="stop-color:#131313;stop-opacity:1;"
+ offset="0"
+ id="stop4560" />
+ <stop
+ style="stop-color:#131313;stop-opacity:0;"
+ offset="1"
+ id="stop4562" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4479">
+ <stop
+ style="stop-color:#e3dcc1;stop-opacity:1;"
+ offset="0"
+ id="stop4481" />
+ <stop
+ style="stop-color:#e3dcc1;stop-opacity:0;"
+ offset="1"
+ id="stop4483" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4447">
+ <stop
+ style="stop-color:#0f0b03;stop-opacity:1;"
+ offset="0"
+ id="stop4449" />
+ <stop
+ style="stop-color:#0f0b03;stop-opacity:0;"
+ offset="1"
+ id="stop4451" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4433">
+ <stop
+ style="stop-color:#231002;stop-opacity:1;"
+ offset="0"
+ id="stop4435" />
+ <stop
+ style="stop-color:#231002;stop-opacity:0;"
+ offset="1"
+ id="stop4437" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4372">
+ <stop
+ style="stop-color:#e1e1e1;stop-opacity:1;"
+ offset="0"
+ id="stop4374" />
+ <stop
+ style="stop-color:#e1e1e1;stop-opacity:0;"
+ offset="1"
+ id="stop4376" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4362">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop4364" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop4366" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4291">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4293" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4295" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4281">
+ <stop
+ style="stop-color:#c7c7c7;stop-opacity:1;"
+ offset="0"
+ id="stop4283" />
+ <stop
+ style="stop-color:#c7c7c7;stop-opacity:0;"
+ offset="1"
+ id="stop4285" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4265">
+ <stop
+ style="stop-color:#bca714;stop-opacity:1;"
+ offset="0"
+ id="stop4267" />
+ <stop
+ style="stop-color:#bca714;stop-opacity:0;"
+ offset="1"
+ id="stop4269" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4253">
+ <stop
+ style="stop-color:#84750f;stop-opacity:1"
+ offset="0"
+ id="stop4255" />
+ <stop
+ style="stop-color:#e5b027;stop-opacity:0"
+ offset="1"
+ id="stop4257" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4231">
+ <stop
+ style="stop-color:#4b5657;stop-opacity:1;"
+ offset="0"
+ id="stop4233" />
+ <stop
+ id="stop4239"
+ offset="0.78472221"
+ style="stop-color:#57524b;stop-opacity:0.66530615;" />
+ <stop
+ style="stop-color:#4b5657;stop-opacity:0;"
+ offset="1"
+ id="stop4235" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4220">
+ <stop
+ style="stop-color:#637083;stop-opacity:1;"
+ offset="0"
+ id="stop4222" />
+ <stop
+ style="stop-color:#637083;stop-opacity:0;"
+ offset="1"
+ id="stop4225" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4207">
+ <stop
+ style="stop-color:#262e2e;stop-opacity:1;"
+ offset="0"
+ id="stop4209" />
+ <stop
+ style="stop-color:#262e2e;stop-opacity:0;"
+ offset="1"
+ id="stop4211" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4186">
+ <stop
+ style="stop-color:#262e2e;stop-opacity:1;"
+ offset="0"
+ id="stop4188" />
+ <stop
+ style="stop-color:#262e2e;stop-opacity:0;"
+ offset="1"
+ id="stop4190" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4114">
+ <stop
+ style="stop-color:#090b0b;stop-opacity:1;"
+ offset="0"
+ id="stop4116" />
+ <stop
+ style="stop-color:#090b0b;stop-opacity:0;"
+ offset="1"
+ id="stop4118" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4097">
+ <stop
+ style="stop-color:#e7ecec;stop-opacity:1;"
+ offset="0"
+ id="stop4099" />
+ <stop
+ style="stop-color:#e7ecec;stop-opacity:0;"
+ offset="1"
+ id="stop4101" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4085">
+ <stop
+ style="stop-color:#c5d0d1;stop-opacity:1;"
+ offset="0"
+ id="stop4087" />
+ <stop
+ style="stop-color:#c5d0d1;stop-opacity:0;"
+ offset="1"
+ id="stop4089" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3916">
+ <stop
+ style="stop-color:#8e8e8e;stop-opacity:1;"
+ offset="0"
+ id="stop3918" />
+ <stop
+ style="stop-color:#8e8e8e;stop-opacity:0;"
+ offset="1"
+ id="stop3920" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4402">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4404" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4406" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4312">
+ <stop
+ style="stop-color:#c9d4e7;stop-opacity:1;"
+ offset="0"
+ id="stop4314" />
+ <stop
+ style="stop-color:#c9d4e7;stop-opacity:0;"
+ offset="1"
+ id="stop4316" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4300">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4302" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4304" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4258">
+ <stop
+ style="stop-color:#dedede;stop-opacity:1;"
+ offset="0"
+ id="stop4260" />
+ <stop
+ style="stop-color:#dedede;stop-opacity:0;"
+ offset="1"
+ id="stop4262" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4232">
+ <stop
+ style="stop-color:#887077;stop-opacity:1;"
+ offset="0"
+ id="stop4234" />
+ <stop
+ style="stop-color:#887077;stop-opacity:0;"
+ offset="1"
+ id="stop4236" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4222">
+ <stop
+ style="stop-color:#282123;stop-opacity:1;"
+ offset="0"
+ id="stop4224" />
+ <stop
+ style="stop-color:#282123;stop-opacity:0;"
+ offset="1"
+ id="stop4226" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4212">
+ <stop
+ style="stop-color:#d5ccce;stop-opacity:1;"
+ offset="0"
+ id="stop4214" />
+ <stop
+ style="stop-color:#d5ccce;stop-opacity:0;"
+ offset="1"
+ id="stop4216" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4206"
+ inkscape:collect="always">
+ <stop
+ id="stop4208"
+ offset="0"
+ style="stop-color:#281700;stop-opacity:1" />
+ <stop
+ id="stop4210"
+ offset="1"
+ style="stop-color:black;stop-opacity:0.23529412" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4192">
+ <stop
+ style="stop-color:#ede9ea;stop-opacity:1;"
+ offset="0"
+ id="stop4194" />
+ <stop
+ style="stop-color:#ede9ea;stop-opacity:0;"
+ offset="1"
+ id="stop4196" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4182">
+ <stop
+ style="stop-color:#746164;stop-opacity:1;"
+ offset="0"
+ id="stop4184" />
+ <stop
+ style="stop-color:#746164;stop-opacity:0;"
+ offset="1"
+ id="stop4186" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4151">
+ <stop
+ style="stop-color:#281700;stop-opacity:1"
+ offset="0"
+ id="stop4153" />
+ <stop
+ style="stop-color:#5a3502;stop-opacity:0.23651452"
+ offset="1"
+ id="stop4155" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4143">
+ <stop
+ style="stop-color:#f9cb53;stop-opacity:1;"
+ offset="0"
+ id="stop4145" />
+ <stop
+ style="stop-color:#fffffd;stop-opacity:0"
+ offset="1"
+ id="stop4147" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4061">
+ <stop
+ style="stop-color:#d4d969;stop-opacity:1;"
+ offset="0"
+ id="stop4063" />
+ <stop
+ style="stop-color:#d4d969;stop-opacity:0;"
+ offset="1"
+ id="stop4065" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4061"
+ id="linearGradient4067"
+ x1="708.0863"
+ y1="416.54196"
+ x2="710.52051"
+ y2="423.02032"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-74.8682,-105.3782)" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4069">
+ <stop
+ style="stop-color:#1f2116;stop-opacity:1;"
+ offset="0"
+ id="stop4071" />
+ <stop
+ style="stop-color:#1f2116;stop-opacity:0;"
+ offset="1"
+ id="stop4073" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4069"
+ id="linearGradient4075"
+ x1="713.03723"
+ y1="416.54196"
+ x2="716.14722"
+ y2="423.02032"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-74.8682,-105.3782)" />
+ <linearGradient
+ id="linearGradient4125"
+ inkscape:collect="always">
+ <stop
+ id="stop4127"
+ offset="0"
+ style="stop-color:#1c1001;stop-opacity:1" />
+ <stop
+ id="stop4129"
+ offset="1"
+ style="stop-color:black;stop-opacity:0" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4113">
+ <stop
+ style="stop-color:#f9c176;stop-opacity:1;"
+ offset="0"
+ id="stop4115" />
+ <stop
+ style="stop-color:#f9c176;stop-opacity:0;"
+ offset="1"
+ id="stop4117" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4000">
+ <stop
+ style="stop-color:#f0d866;stop-opacity:1;"
+ offset="0"
+ id="stop4002" />
+ <stop
+ style="stop-color:#f0d866;stop-opacity:0;"
+ offset="1"
+ id="stop4004" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3986">
+ <stop
+ style="stop-color:#6a510d;stop-opacity:1;"
+ offset="0"
+ id="stop3988" />
+ <stop
+ style="stop-color:#6a510d;stop-opacity:0;"
+ offset="1"
+ id="stop3990" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3967">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop3969" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop3971" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3957">
+ <stop
+ style="stop-color:#b6a038;stop-opacity:1;"
+ offset="0"
+ id="stop3959" />
+ <stop
+ style="stop-color:#b6a038;stop-opacity:0;"
+ offset="1"
+ id="stop3961" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3931">
+ <stop
+ style="stop-color:#1a1c23;stop-opacity:1;"
+ offset="0"
+ id="stop3933" />
+ <stop
+ style="stop-color:#1a1c23;stop-opacity:0;"
+ offset="1"
+ id="stop3935" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3921">
+ <stop
+ style="stop-color:#cab714;stop-opacity:1;"
+ offset="0"
+ id="stop3923" />
+ <stop
+ style="stop-color:#cab714;stop-opacity:0;"
+ offset="1"
+ id="stop3925" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3784">
+ <stop
+ style="stop-color:#e0e2e8;stop-opacity:1;"
+ offset="0"
+ id="stop3787" />
+ <stop
+ style="stop-color:#e0e2e8;stop-opacity:0;"
+ offset="1"
+ id="stop3789" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3774">
+ <stop
+ style="stop-color:#e0e2e8;stop-opacity:1;"
+ offset="0"
+ id="stop3776" />
+ <stop
+ style="stop-color:#e0e2e8;stop-opacity:0;"
+ offset="1"
+ id="stop3778" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3764">
+ <stop
+ style="stop-color:#b2b7c5;stop-opacity:1;"
+ offset="0"
+ id="stop3766" />
+ <stop
+ style="stop-color:#b2b7c5;stop-opacity:0;"
+ offset="1"
+ id="stop3768" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3732">
+ <stop
+ style="stop-color:#bfbfbf;stop-opacity:1;"
+ offset="0"
+ id="stop3734" />
+ <stop
+ style="stop-color:#bfbfbf;stop-opacity:0;"
+ offset="1"
+ id="stop3736" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3681">
+ <stop
+ style="stop-color:#d8f3f6;stop-opacity:1;"
+ offset="0"
+ id="stop3683" />
+ <stop
+ style="stop-color:#d8f3f6;stop-opacity:0;"
+ offset="1"
+ id="stop3685" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3887">
+ <stop
+ style="stop-color:#1b1815;stop-opacity:1;"
+ offset="0"
+ id="stop3889" />
+ <stop
+ style="stop-color:#1b1815;stop-opacity:0;"
+ offset="1"
+ id="stop3891" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3645">
+ <stop
+ style="stop-color:#c7eef2;stop-opacity:1;"
+ offset="0"
+ id="stop3647" />
+ <stop
+ style="stop-color:#c7eef2;stop-opacity:0;"
+ offset="1"
+ id="stop3649" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3708">
+ <stop
+ style="stop-color:#b4c1d1;stop-opacity:1;"
+ offset="0"
+ id="stop3710" />
+ <stop
+ style="stop-color:#b4c1d1;stop-opacity:0;"
+ offset="1"
+ id="stop3712" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3698">
+ <stop
+ style="stop-color:#405069;stop-opacity:1;"
+ offset="0"
+ id="stop3700" />
+ <stop
+ style="stop-color:#405069;stop-opacity:0;"
+ offset="1"
+ id="stop3702" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3687">
+ <stop
+ style="stop-color:#8190aa;stop-opacity:1;"
+ offset="0"
+ id="stop3689" />
+ <stop
+ style="stop-color:#8190aa;stop-opacity:0;"
+ offset="1"
+ id="stop3691" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3611">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop3613" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop3615" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3599">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop3601" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop3603" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3589">
+ <stop
+ style="stop-color:#443c30;stop-opacity:0;"
+ offset="0"
+ id="stop3591" />
+ <stop
+ id="stop3597"
+ offset="0"
+ style="stop-color:#443c30;stop-opacity:0;" />
+ <stop
+ style="stop-color:#303c44;stop-opacity:1"
+ offset="1"
+ id="stop3593" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3571">
+ <stop
+ style="stop-color:#565656;stop-opacity:1;"
+ offset="0"
+ id="stop3573" />
+ <stop
+ style="stop-color:#565656;stop-opacity:0;"
+ offset="1"
+ id="stop3575" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3549">
+ <stop
+ style="stop-color:#392b1b;stop-opacity:1;"
+ offset="0"
+ id="stop3551" />
+ <stop
+ style="stop-color:#392b1b;stop-opacity:0;"
+ offset="1"
+ id="stop3553" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3539">
+ <stop
+ style="stop-color:#392b1b;stop-opacity:1;"
+ offset="0"
+ id="stop3541" />
+ <stop
+ style="stop-color:#392b1b;stop-opacity:0;"
+ offset="1"
+ id="stop3543" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3529">
+ <stop
+ style="stop-color:#392b1b;stop-opacity:1;"
+ offset="0"
+ id="stop3531" />
+ <stop
+ style="stop-color:#392b1b;stop-opacity:0;"
+ offset="1"
+ id="stop3533" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3515">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop3517" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop3519" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3504">
+ <stop
+ style="stop-color:#1e1125;stop-opacity:1"
+ offset="0"
+ id="stop3506" />
+ <stop
+ style="stop-color:#111d25;stop-opacity:0;"
+ offset="1"
+ id="stop3508" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3480">
+ <stop
+ style="stop-color:#676986;stop-opacity:1;"
+ offset="0"
+ id="stop3482" />
+ <stop
+ style="stop-color:#676986;stop-opacity:0;"
+ offset="1"
+ id="stop3484" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3462">
+ <stop
+ style="stop-color:#e0b80d;stop-opacity:1"
+ offset="0"
+ id="stop3464" />
+ <stop
+ style="stop-color:#f6dc6d;stop-opacity:0;"
+ offset="1"
+ id="stop3466" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3443">
+ <stop
+ style="stop-color:#63441b;stop-opacity:1;"
+ offset="0"
+ id="stop3445" />
+ <stop
+ style="stop-color:#63441b;stop-opacity:0;"
+ offset="1"
+ id="stop3447" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3433">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop3435" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop3437" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3401">
+ <stop
+ style="stop-color:#00006b;stop-opacity:1;"
+ offset="0"
+ id="stop3403" />
+ <stop
+ style="stop-color:#00006b;stop-opacity:0;"
+ offset="1"
+ id="stop3405" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3393">
+ <stop
+ style="stop-color:#1a1400;stop-opacity:1"
+ offset="0"
+ id="stop3395" />
+ <stop
+ style="stop-color:#544400;stop-opacity:0;"
+ offset="1"
+ id="stop3397" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3382">
+ <stop
+ style="stop-color:#e9fdff;stop-opacity:1;"
+ offset="0"
+ id="stop3384" />
+ <stop
+ style="stop-color:#e9fdff;stop-opacity:0;"
+ offset="1"
+ id="stop3386" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3374">
+ <stop
+ style="stop-color:#eaaa00;stop-opacity:1;"
+ offset="0"
+ id="stop3376" />
+ <stop
+ style="stop-color:#eaaa00;stop-opacity:0;"
+ offset="1"
+ id="stop3378" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3346">
+ <stop
+ style="stop-color:#00006b;stop-opacity:1;"
+ offset="0"
+ id="stop3348" />
+ <stop
+ style="stop-color:#00006b;stop-opacity:0;"
+ offset="1"
+ id="stop3350" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3328">
+ <stop
+ style="stop-color:#2e3f54;stop-opacity:1;"
+ offset="0"
+ id="stop3330" />
+ <stop
+ style="stop-color:#2e3f54;stop-opacity:0;"
+ offset="1"
+ id="stop3332" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3312">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop3314" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop3316" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3302">
+ <stop
+ style="stop-color:#bfac28;stop-opacity:1"
+ offset="0"
+ id="stop3304" />
+ <stop
+ style="stop-color:#624715;stop-opacity:0;"
+ offset="1"
+ id="stop3306" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3292">
+ <stop
+ style="stop-color:#fbf6ed;stop-opacity:1;"
+ offset="0"
+ id="stop3294" />
+ <stop
+ style="stop-color:#fbf6ed;stop-opacity:0;"
+ offset="1"
+ id="stop3296" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3284">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop3286" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop3288" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3276">
+ <stop
+ style="stop-color:#2c210b;stop-opacity:1;"
+ offset="0"
+ id="stop3278" />
+ <stop
+ style="stop-color:#2c210b;stop-opacity:0;"
+ offset="1"
+ id="stop3280" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3265">
+ <stop
+ style="stop-color:#e3eef8;stop-opacity:1;"
+ offset="0"
+ id="stop3268" />
+ <stop
+ style="stop-color:#e3eef8;stop-opacity:0;"
+ offset="1"
+ id="stop3270" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3254">
+ <stop
+ style="stop-color:#583116;stop-opacity:1;"
+ offset="0"
+ id="stop3256" />
+ <stop
+ style="stop-color:#583116;stop-opacity:0;"
+ offset="1"
+ id="stop3258" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3236">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop3238" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop3240" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3226">
+ <stop
+ style="stop-color:#4c1658;stop-opacity:1"
+ offset="0"
+ id="stop3228" />
+ <stop
+ style="stop-color:#162458;stop-opacity:0;"
+ offset="1"
+ id="stop3230" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3212">
+ <stop
+ style="stop-color:#0d2133;stop-opacity:0;"
+ offset="0"
+ id="stop3214" />
+ <stop
+ id="stop3220"
+ offset="0.71428573"
+ style="stop-color:#0d2133;stop-opacity:0;" />
+ <stop
+ style="stop-color:#0d2133;stop-opacity:0.89690721;"
+ offset="1"
+ id="stop3216" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3202">
+ <stop
+ style="stop-color:#ddbe3b;stop-opacity:1;"
+ offset="0"
+ id="stop3204" />
+ <stop
+ style="stop-color:#ddbe3b;stop-opacity:0;"
+ offset="1"
+ id="stop3206" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3176">
+ <stop
+ style="stop-color:#e3eef8;stop-opacity:1"
+ offset="0"
+ id="stop3178" />
+ <stop
+ style="stop-color:#5295d2;stop-opacity:0;"
+ offset="1"
+ id="stop3180" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3160">
+ <stop
+ style="stop-color:#6f521d;stop-opacity:1;"
+ offset="0"
+ id="stop3162" />
+ <stop
+ style="stop-color:#6f521d;stop-opacity:0;"
+ offset="1"
+ id="stop3164" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3144">
+ <stop
+ style="stop-color:#a3e5e7;stop-opacity:1;"
+ offset="0"
+ id="stop3146" />
+ <stop
+ style="stop-color:#a3e5e7;stop-opacity:0;"
+ offset="1"
+ id="stop3148" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3135">
+ <stop
+ style="stop-color:#94b4e2;stop-opacity:1;"
+ offset="0"
+ id="stop3137" />
+ <stop
+ style="stop-color:#8a8925;stop-opacity:1"
+ offset="1"
+ id="stop3140" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4181">
+ <stop
+ style="stop-color:#1c2e3b;stop-opacity:1;"
+ offset="0"
+ id="stop4183" />
+ <stop
+ style="stop-color:#1c2e3b;stop-opacity:0;"
+ offset="1"
+ id="stop4185" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4166">
+ <stop
+ style="stop-color:#edd135;stop-opacity:1"
+ offset="0"
+ id="stop4168" />
+ <stop
+ style="stop-color:#edec35;stop-opacity:0;"
+ offset="1"
+ id="stop4170" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4152">
+ <stop
+ style="stop-color:#1d1504;stop-opacity:1;"
+ offset="0"
+ id="stop4154" />
+ <stop
+ style="stop-color:#1d1504;stop-opacity:0;"
+ offset="1"
+ id="stop4156" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4144"
+ inkscape:collect="always">
+ <stop
+ id="stop4146"
+ offset="0"
+ style="stop-color:#694312;stop-opacity:1" />
+ <stop
+ id="stop4148"
+ offset="1"
+ style="stop-color:#977f1a;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4134">
+ <stop
+ style="stop-color:#92cadb;stop-opacity:1;"
+ offset="0"
+ id="stop4136" />
+ <stop
+ style="stop-color:#92cadb;stop-opacity:0;"
+ offset="1"
+ id="stop4138" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4124">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop4126" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop4128" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4100">
+ <stop
+ style="stop-color:#fdfbf9;stop-opacity:1;"
+ offset="0"
+ id="stop4102" />
+ <stop
+ style="stop-color:#fdfbf9;stop-opacity:0;"
+ offset="1"
+ id="stop4104" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4078">
+ <stop
+ style="stop-color:#613c24;stop-opacity:1;"
+ offset="0"
+ id="stop4080" />
+ <stop
+ style="stop-color:#613c24;stop-opacity:0;"
+ offset="1"
+ id="stop4082" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4068">
+ <stop
+ style="stop-color:#709ac9;stop-opacity:1;"
+ offset="0"
+ id="stop4070" />
+ <stop
+ style="stop-color:#709ac9;stop-opacity:0;"
+ offset="1"
+ id="stop4072" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4040">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4042" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4044" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4022">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop4024" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop4026" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4001">
+ <stop
+ style="stop-color:#201c14;stop-opacity:1;"
+ offset="0"
+ id="stop4003" />
+ <stop
+ id="stop4009"
+ offset="0.50694442"
+ style="stop-color:#201c14;stop-opacity:0.49803922;" />
+ <stop
+ style="stop-color:#201c14;stop-opacity:0;"
+ offset="1"
+ id="stop4005" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3989">
+ <stop
+ style="stop-color:#977f1a;stop-opacity:1;"
+ offset="0"
+ id="stop3991" />
+ <stop
+ style="stop-color:#977f1a;stop-opacity:0;"
+ offset="1"
+ id="stop3993" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3979">
+ <stop
+ style="stop-color:#201c14;stop-opacity:1;"
+ offset="0"
+ id="stop3981" />
+ <stop
+ style="stop-color:#201c14;stop-opacity:0;"
+ offset="1"
+ id="stop3983" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3869">
+ <stop
+ style="stop-color:#dfc61d;stop-opacity:1;"
+ offset="0"
+ id="stop3871" />
+ <stop
+ style="stop-color:#dfc61d;stop-opacity:0;"
+ offset="1"
+ id="stop3873" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3851">
+ <stop
+ style="stop-color:#7b6752;stop-opacity:1;"
+ offset="0"
+ id="stop3853" />
+ <stop
+ style="stop-color:#7b6752;stop-opacity:0;"
+ offset="1"
+ id="stop3855" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3833">
+ <stop
+ style="stop-color:#eff4f4;stop-opacity:1;"
+ offset="0"
+ id="stop3835" />
+ <stop
+ style="stop-color:#eff4f4;stop-opacity:0;"
+ offset="1"
+ id="stop3837" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3802">
+ <stop
+ style="stop-color:#e8ebf1;stop-opacity:0;"
+ offset="0"
+ id="stop3804" />
+ <stop
+ id="stop3810"
+ offset="0.81944442"
+ style="stop-color:#e8ebf1;stop-opacity:0;" />
+ <stop
+ style="stop-color:#e8ebf1;stop-opacity:1;"
+ offset="1"
+ id="stop3806" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3782">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop3784" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop3786" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3747">
+ <stop
+ style="stop-color:#e6e1d7;stop-opacity:1"
+ offset="0"
+ id="stop3749" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop3751" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3733">
+ <stop
+ style="stop-color:#debe39;stop-opacity:1;"
+ offset="0"
+ id="stop3735" />
+ <stop
+ style="stop-color:#debe39;stop-opacity:0"
+ offset="1"
+ id="stop3737" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3725"
+ inkscape:collect="always">
+ <stop
+ id="stop3727"
+ offset="0"
+ style="stop-color:#6d899b;stop-opacity:1" />
+ <stop
+ id="stop3729"
+ offset="1"
+ style="stop-color:#d9e6e6;stop-opacity:0" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3713">
+ <stop
+ style="stop-color:white;stop-opacity:1"
+ offset="0"
+ id="stop3715" />
+ <stop
+ style="stop-color:#d9e6e6;stop-opacity:0"
+ offset="1"
+ id="stop3717" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3701">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop3703" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop3705" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3691">
+ <stop
+ style="stop-color:#021d2a;stop-opacity:1;"
+ offset="0"
+ id="stop3693" />
+ <stop
+ style="stop-color:#021d2a;stop-opacity:0;"
+ offset="1"
+ id="stop3695" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3668">
+ <stop
+ style="stop-color:#858b94;stop-opacity:1;"
+ offset="0"
+ id="stop3670" />
+ <stop
+ style="stop-color:#858b94;stop-opacity:0;"
+ offset="1"
+ id="stop3672" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3656">
+ <stop
+ style="stop-color:#d4f0fc;stop-opacity:1;"
+ offset="0"
+ id="stop3658" />
+ <stop
+ style="stop-color:#d4f0fc;stop-opacity:0;"
+ offset="1"
+ id="stop3660" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3638">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop3640" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop3642" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3610">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop3612" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop3614" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3578">
+ <stop
+ style="stop-color:#cce5f8;stop-opacity:1;"
+ offset="0"
+ id="stop3580" />
+ <stop
+ style="stop-color:#cce5f8;stop-opacity:0;"
+ offset="1"
+ id="stop3582" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3554">
+ <stop
+ style="stop-color:#e7eef4;stop-opacity:1"
+ offset="0"
+ id="stop3556" />
+ <stop
+ style="stop-color:#b8f2f4;stop-opacity:0;"
+ offset="1"
+ id="stop3558" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3536">
+ <stop
+ style="stop-color:#030303;stop-opacity:1;"
+ offset="0"
+ id="stop3538" />
+ <stop
+ style="stop-color:#030303;stop-opacity:0;"
+ offset="1"
+ id="stop3540" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3526">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop3528" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop3530" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3516">
+ <stop
+ style="stop-color:#223f69;stop-opacity:1;"
+ offset="0"
+ id="stop3518" />
+ <stop
+ style="stop-color:#223f69;stop-opacity:0;"
+ offset="1"
+ id="stop3520" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3503">
+ <stop
+ style="stop-color:#2b4268;stop-opacity:1;"
+ offset="0"
+ id="stop3505" />
+ <stop
+ style="stop-color:#2b4268;stop-opacity:0;"
+ offset="1"
+ id="stop3507" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3489">
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="0"
+ id="stop3491" />
+ <stop
+ style="stop-color:white;stop-opacity:0;"
+ offset="1"
+ id="stop3493" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3471">
+ <stop
+ style="stop-color:#647e9d;stop-opacity:1"
+ offset="0"
+ id="stop3473" />
+ <stop
+ style="stop-color:#64969d;stop-opacity:0;"
+ offset="1"
+ id="stop3475" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3461">
+ <stop
+ style="stop-color:black;stop-opacity:1;"
+ offset="0"
+ id="stop3463" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop3465" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3453">
+ <stop
+ style="stop-color:#e9f0f1;stop-opacity:1"
+ offset="0"
+ id="stop3455" />
+ <stop
+ style="stop-color:#dddcca;stop-opacity:0;"
+ offset="1"
+ id="stop3457" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3303">
+ <stop
+ style="stop-color:#1f2429;stop-opacity:1;"
+ offset="0"
+ id="stop3305" />
+ <stop
+ style="stop-color:#1f2429;stop-opacity:0;"
+ offset="1"
+ id="stop3307" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3289">
+ <stop
+ style="stop-color:#97a4af;stop-opacity:1;"
+ offset="0"
+ id="stop3291" />
+ <stop
+ style="stop-color:#97a4af;stop-opacity:0;"
+ offset="1"
+ id="stop3293" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3279">
+ <stop
+ style="stop-color:#b3890d;stop-opacity:1;"
+ offset="0"
+ id="stop3281" />
+ <stop
+ style="stop-color:#b3890d;stop-opacity:0;"
+ offset="1"
+ id="stop3283" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3269">
+ <stop
+ style="stop-color:#6c6654;stop-opacity:1;"
+ offset="0"
+ id="stop3271" />
+ <stop
+ style="stop-color:#6c6654;stop-opacity:0;"
+ offset="1"
+ id="stop3273" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3263"
+ inkscape:collect="always">
+ <stop
+ id="stop3265"
+ offset="0"
+ style="stop-color:#2a3737;stop-opacity:0.82926828" />
+ <stop
+ id="stop3267"
+ offset="1"
+ style="stop-color:#2a3737;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3255">
+ <stop
+ style="stop-color:#d09e1c;stop-opacity:1"
+ offset="0"
+ id="stop3257" />
+ <stop
+ style="stop-color:#fceeaf;stop-opacity:0;"
+ offset="1"
+ id="stop3259" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3201">
+ <stop
+ style="stop-color:#2a3737;stop-opacity:1;"
+ offset="0"
+ id="stop3203" />
+ <stop
+ style="stop-color:#2a3737;stop-opacity:0;"
+ offset="1"
+ id="stop3205" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3191">
+ <stop
+ style="stop-color:#f9dd67;stop-opacity:1;"
+ offset="0"
+ id="stop3193" />
+ <stop
+ style="stop-color:#f9dd67;stop-opacity:0;"
+ offset="1"
+ id="stop3195" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3173">
+ <stop
+ style="stop-color:#f6f6bf;stop-opacity:1;"
+ offset="0"
+ id="stop3175" />
+ <stop
+ style="stop-color:#f6f6bf;stop-opacity:0;"
+ offset="1"
+ id="stop3177" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3163">
+ <stop
+ style="stop-color:#635646;stop-opacity:1;"
+ offset="0"
+ id="stop3165" />
+ <stop
+ style="stop-color:#635646;stop-opacity:0;"
+ offset="1"
+ id="stop3167" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3155">
+ <stop
+ style="stop-color:#d5b42a;stop-opacity:1;"
+ offset="0"
+ id="stop3157" />
+ <stop
+ style="stop-color:#d5b42a;stop-opacity:0;"
+ offset="1"
+ id="stop3159" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3145">
+ <stop
+ style="stop-color:white;stop-opacity:1"
+ offset="0"
+ id="stop3147" />
+ <stop
+ style="stop-color:white;stop-opacity:0"
+ offset="1"
+ id="stop3149" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3137">
+ <stop
+ style="stop-color:#c6c6e9;stop-opacity:0.23529412"
+ offset="0"
+ id="stop3139" />
+ <stop
+ style="stop-color:white;stop-opacity:0.78902954"
+ offset="1"
+ id="stop3141" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3127">
+ <stop
+ style="stop-color:#e4b125;stop-opacity:1"
+ offset="0"
+ id="stop3129" />
+ <stop
+ style="stop-color:#f9dd67;stop-opacity:0.17073171"
+ offset="1"
+ id="stop3131" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3105">
+ <stop
+ style="stop-color:#fef7d9;stop-opacity:1;"
+ offset="0"
+ id="stop3107" />
+ <stop
+ style="stop-color:#fef7d9;stop-opacity:0;"
+ offset="1"
+ id="stop3109" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3097">
+ <stop
+ style="stop-color:#c09c07;stop-opacity:1;"
+ offset="0"
+ id="stop3099" />
+ <stop
+ style="stop-color:#c09c07;stop-opacity:0;"
+ offset="1"
+ id="stop3101" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3097"
+ id="linearGradient3103"
+ x1="578.81964"
+ y1="619.8324"
+ x2="549.17651"
+ y2="293.01831"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3105"
+ id="linearGradient3111"
+ x1="635.80188"
+ y1="431.43301"
+ x2="592.54358"
+ y2="354.18607"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3127"
+ id="radialGradient3133"
+ cx="220.48331"
+ cy="374.9101"
+ fx="220.48331"
+ fy="374.9101"
+ r="109.13879"
+ gradientTransform="matrix(2.306929,-0.850392,0.104021,0.282186,-405.5395,334.458)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3137"
+ id="linearGradient3143"
+ x1="526.29694"
+ y1="341.85712"
+ x2="520.66705"
+ y2="331.97906"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3145"
+ id="linearGradient3151"
+ x1="648.12048"
+ y1="281.90961"
+ x2="155.12331"
+ y2="396.75555"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3155"
+ id="linearGradient3161"
+ x1="497.19888"
+ y1="475.12857"
+ x2="369.67563"
+ y2="284.23935"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3163"
+ id="linearGradient3169"
+ x1="278.90961"
+ y1="382.10486"
+ x2="630.34076"
+ y2="313.81311"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3173"
+ id="linearGradient3179"
+ x1="300.8472"
+ y1="381.95486"
+ x2="585.62518"
+ y2="299.94827"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-77.88972,-100.3902)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3191"
+ id="linearGradient3197"
+ x1="516.46783"
+ y1="240.59306"
+ x2="474.34485"
+ y2="316.92365"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3263"
+ id="linearGradient3207"
+ x1="1062.2203"
+ y1="561.75232"
+ x2="660.03485"
+ y2="324.92554"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3201"
+ id="linearGradient3211"
+ gradientUnits="userSpaceOnUse"
+ x1="480.5322"
+ y1="592.43256"
+ x2="477.96204"
+ y2="481.78827"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3255"
+ id="radialGradient3261"
+ cx="489.14493"
+ cy="481.27365"
+ fx="489.14493"
+ fy="481.27365"
+ r="124.73709"
+ gradientTransform="matrix(2.212662,-0.787646,0.203308,0.571126,-761.0984,427.2059)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3269"
+ id="linearGradient3275"
+ x1="708.28009"
+ y1="348.27164"
+ x2="738.93243"
+ y2="351.77304"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3279"
+ id="linearGradient3285"
+ x1="704.07837"
+ y1="383.28564"
+ x2="747.79578"
+ y2="380.31461"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3289"
+ id="linearGradient3295"
+ x1="302.66354"
+ y1="551.52222"
+ x2="315.18057"
+ y2="506.95663"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3289"
+ id="radialGradient3299"
+ cx="192.00085"
+ cy="427.62643"
+ fx="192.00085"
+ fy="427.62643"
+ r="104.7979"
+ gradientTransform="matrix(0.165125,-4.609632e-2,0.134263,0.480952,-6.45928,167.1641)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3303"
+ id="radialGradient3309"
+ cx="140.15749"
+ cy="390.74155"
+ fx="140.15749"
+ fy="390.74155"
+ r="104.7979"
+ gradientTransform="matrix(4.06639e-2,-0.133976,0.48446,0.147039,-45.65138,342.5197)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3453"
+ id="linearGradient3459"
+ x1="688.76392"
+ y1="185.161"
+ x2="685.00781"
+ y2="213.89029"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.177749,0,0,0.555107,-194.5782,-15.36392)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3461"
+ id="linearGradient3467"
+ x1="674.72052"
+ y1="299.55396"
+ x2="676.42609"
+ y2="185.6642"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3471"
+ id="linearGradient3477"
+ x1="742.41882"
+ y1="250.53185"
+ x2="675.08093"
+ y2="238.64769"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3471"
+ id="linearGradient3481"
+ gradientUnits="userSpaceOnUse"
+ x1="462.15097"
+ y1="242.60909"
+ x2="517.61597"
+ y2="252.51253"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3471"
+ id="linearGradient3485"
+ gradientUnits="userSpaceOnUse"
+ x1="469.08337"
+ y1="283.05249"
+ x2="472.55524"
+ y2="263.90149"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3489"
+ id="radialGradient3495"
+ cx="592.63184"
+ cy="238.64769"
+ fx="592.63184"
+ fy="238.64769"
+ r="136.42288"
+ gradientTransform="matrix(1,0,0,0.307345,-78.38489,65.90054)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3503"
+ id="linearGradient3509"
+ x1="684.8739"
+ y1="164.6127"
+ x2="679.27167"
+ y2="268.60428"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3516"
+ id="linearGradient3522"
+ x1="563.31689"
+ y1="192.75229"
+ x2="563.01147"
+ y2="218.50128"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3526"
+ id="linearGradient3532"
+ x1="642.97968"
+ y1="146.95511"
+ x2="597.58594"
+ y2="292.61334"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3536"
+ id="linearGradient3542"
+ x1="631.77521"
+ y1="196.67497"
+ x2="631.1994"
+ y2="205.77863"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3536"
+ id="linearGradient3546"
+ gradientUnits="userSpaceOnUse"
+ x1="730.51471"
+ y1="231.68898"
+ x2="719.43469"
+ y2="233.08955"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3536"
+ id="linearGradient3550"
+ gradientUnits="userSpaceOnUse"
+ x1="720.0105"
+ y1="212.78142"
+ x2="714.53271"
+ y2="217.6834"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3554"
+ id="linearGradient3560"
+ x1="488.21777"
+ y1="234.49011"
+ x2="496.74564"
+ y2="242.89346"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3578"
+ id="linearGradient3584"
+ x1="615.00464"
+ y1="219.21129"
+ x2="714.03918"
+ y2="219.21129"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3578"
+ id="linearGradient3586"
+ x1="504.08594"
+ y1="233.81889"
+ x2="578.85699"
+ y2="233.81889"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3578"
+ id="linearGradient3588"
+ x1="480.31763"
+ y1="235.79958"
+ x2="530.33008"
+ y2="235.79958"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3610"
+ id="linearGradient3616"
+ x1="629.55182"
+ y1="200.91441"
+ x2="628.67688"
+ y2="216.78355"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3638"
+ id="linearGradient3644"
+ x1="745.99255"
+ y1="222.65027"
+ x2="727.56744"
+ y2="229.08752"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3656"
+ id="linearGradient3662"
+ x1="774.53485"
+ y1="222.19475"
+ x2="792.90039"
+ y2="254.87616"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3668"
+ id="linearGradient3674"
+ x1="783.61346"
+ y1="277.35779"
+ x2="755.60223"
+ y2="208.73035"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3691"
+ id="linearGradient3697"
+ x1="742.33124"
+ y1="238.50105"
+ x2="742.33124"
+ y2="232.05856"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3701"
+ id="linearGradient3707"
+ x1="749.85504"
+ y1="250.37994"
+ x2="734.10358"
+ y2="252.85582"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3725"
+ id="linearGradient3723"
+ gradientUnits="userSpaceOnUse"
+ x1="776.6106"
+ y1="253.1981"
+ x2="795.51819"
+ y2="245.49504"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3733"
+ id="radialGradient3743"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.24064,-0.844318,0.61215,0.899494,-444.1652,606.8743)"
+ cx="805.71912"
+ cy="280.53232"
+ fx="805.71912"
+ fy="280.53232"
+ r="21.205093" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3747"
+ id="linearGradient3753"
+ x1="799.26886"
+ y1="250.6106"
+ x2="790.71704"
+ y2="346.54895"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3782"
+ id="radialGradient3790"
+ cx="479.67551"
+ cy="392.98679"
+ fx="479.67551"
+ fy="392.98679"
+ r="25.253813"
+ gradientTransform="matrix(0.780868,0.595767,-0.185185,0.220762,174.4581,15.68839)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3782"
+ id="radialGradient3794"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.260506,-0.380313,9.747564e-2,0.299061,-299.8285,369.8947)"
+ cx="505.53058"
+ cy="557.56757"
+ fx="505.53058"
+ fy="557.56757"
+ r="25.253813" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3782"
+ id="radialGradient3798"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.222215,-7.535022e-2,1.91236e-2,0.282125,-169.1281,321.024)"
+ cx="509.22186"
+ cy="371.01947"
+ fx="509.22186"
+ fy="371.01947"
+ r="25.253813" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3802"
+ id="radialGradient3808"
+ cx="462.92715"
+ cy="412.08115"
+ fx="462.92715"
+ fy="412.08115"
+ r="25.253813"
+ gradientTransform="matrix(0.96,1.861594e-7,-2.280243e-7,1.245098,18.51718,-101.0004)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3833"
+ id="radialGradient3839"
+ cx="471.56958"
+ cy="412.08115"
+ fx="471.56958"
+ fy="412.08115"
+ r="25.253813"
+ gradientTransform="matrix(1,0,0,1.245098,0,-101.0003)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3851"
+ id="radialGradient3857"
+ cx="473.01892"
+ cy="418.07669"
+ fx="473.01892"
+ fy="418.07669"
+ r="22.03125"
+ gradientTransform="matrix(0.910556,-0.413385,0.625324,1.377388,-297.4944,-69.60637)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3869"
+ id="radialGradient3875"
+ cx="480.67596"
+ cy="403.62936"
+ fx="480.67596"
+ fy="403.62936"
+ r="17.331051"
+ gradientTransform="matrix(2.686108,6.599703e-2,-1.330705e-2,0.541597,-884.3109,52.08124)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3979"
+ id="linearGradient3985"
+ x1="443.11517"
+ y1="426.19351"
+ x2="478.89658"
+ y2="396.97833"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4144"
+ id="radialGradient3995"
+ cx="450.76813"
+ cy="430.66937"
+ fx="450.76813"
+ fy="430.66937"
+ r="67.121391"
+ gradientTransform="matrix(1.215577,-0.941327,0.435375,0.562219,-361.2448,512.589)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3989"
+ id="radialGradient3999"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.424237,-8.37555e-2,4.174504e-2,0.709858,-309.8335,42.33344)"
+ cx="481.8938"
+ cy="386.05667"
+ fx="481.8938"
+ fy="386.05667"
+ r="67.121391" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4001"
+ id="radialGradient4007"
+ cx="473.04962"
+ cy="418.47134"
+ fx="473.04962"
+ fy="418.47134"
+ r="26.053814"
+ gradientTransform="matrix(1.706091,-0.414658,0.417383,1.717292,-579.0585,-200.7776)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4022"
+ id="radialGradient4028"
+ cx="479.82248"
+ cy="402.54901"
+ fx="479.82248"
+ fy="402.54901"
+ r="14.360012"
+ gradientTransform="matrix(1,0,0,1.241379,0,-99.76665)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4022"
+ id="radialGradient4032"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,1.241379,0,-99.76665)"
+ cx="479.82248"
+ cy="402.54901"
+ fx="479.82248"
+ fy="402.54901"
+ r="14.360012" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4022"
+ id="radialGradient4036"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,1.241379,0,-99.76665)"
+ cx="479.82248"
+ cy="402.54901"
+ fx="479.82248"
+ fy="402.54901"
+ r="14.360012" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4040"
+ id="radialGradient4046"
+ cx="466.94797"
+ cy="413.81421"
+ fx="466.94797"
+ fy="413.81421"
+ r="8.4179382"
+ gradientTransform="matrix(1,0,0,0.588235,0,170.3941)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4040"
+ id="radialGradient4050"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.588235,0,170.3941)"
+ cx="466.94797"
+ cy="413.81421"
+ fx="466.94797"
+ fy="413.81421"
+ r="8.4179382" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4040"
+ id="radialGradient4054"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.588235,0,170.3941)"
+ cx="466.94797"
+ cy="413.81421"
+ fx="466.94797"
+ fy="413.81421"
+ r="8.4179382" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4040"
+ id="radialGradient4058"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.588235,0,170.3941)"
+ cx="466.94797"
+ cy="413.81421"
+ fx="466.94797"
+ fy="413.81421"
+ r="8.4179382" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4068"
+ id="linearGradient4074"
+ x1="511.03168"
+ y1="481.89157"
+ x2="463.19144"
+ y2="347.41248"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4078"
+ id="radialGradient4084"
+ cx="460.50089"
+ cy="492.95996"
+ fx="460.50089"
+ fy="492.95996"
+ r="67.116287"
+ gradientTransform="matrix(0.979161,-0.203084,0.114772,0.553371,-125.3668,203.2223)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4078"
+ id="radialGradient4088"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.979161,-0.203084,0.114772,0.553371,-125.3668,203.2223)"
+ cx="425.97253"
+ cy="336.0235"
+ fx="425.97253"
+ fy="336.0235"
+ r="67.116287" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4078"
+ id="radialGradient4092"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.979161,-0.203084,0.114772,0.553371,-125.3668,203.2223)"
+ cx="426.52118"
+ cy="404.56079"
+ fx="426.52118"
+ fy="404.56079"
+ r="67.116287" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4100"
+ id="radialGradient4106"
+ cx="419.17047"
+ cy="447.71176"
+ fx="419.17047"
+ fy="447.71176"
+ r="67.116287"
+ gradientTransform="matrix(1.281713,-1.169163,0.555885,0.609398,-443.2325,538.7728)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4124"
+ id="radialGradient4130"
+ cx="381.11542"
+ cy="426.09045"
+ fx="381.11542"
+ fy="426.09045"
+ r="50.980076"
+ gradientTransform="matrix(1.47594,4.856533e-2,-3.060012e-2,0.929963,-246.7346,-88.54763)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4134"
+ id="radialGradient4140"
+ cx="398.83426"
+ cy="426.7919"
+ fx="398.83426"
+ fy="426.7919"
+ r="37.412987"
+ gradientTransform="matrix(0.192646,0.172059,-0.803038,0.899119,586.3459,-124.0392)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4152"
+ id="radialGradient4158"
+ cx="440.31897"
+ cy="445.03125"
+ fx="440.31897"
+ fy="445.03125"
+ r="60.55566"
+ gradientTransform="matrix(1,0,0,0.625893,-78.38489,67.08934)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4166"
+ id="radialGradient4172"
+ cx="414.65698"
+ cy="480.39996"
+ fx="414.65698"
+ fy="480.39996"
+ r="67.121391"
+ gradientTransform="matrix(1.243584,-0.238727,4.605527e-2,0.239913,-201.5137,355.7296)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4181"
+ id="radialGradient4187"
+ cx="472.57565"
+ cy="413.2739"
+ fx="472.57565"
+ fy="413.2739"
+ r="18.667221"
+ gradientTransform="matrix(1.308121,-0.163636,4.250128e-2,0.339758,-241.2552,249.9693)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3135"
+ id="linearGradient3142"
+ x1="209.31599"
+ y1="339.37808"
+ x2="192.29843"
+ y2="391.58789"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3144"
+ id="linearGradient3150"
+ x1="207.21776"
+ y1="344.35275"
+ x2="198.61923"
+ y2="385.23102"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3160"
+ id="radialGradient3166"
+ cx="205.99931"
+ cy="367.33188"
+ fx="205.99931"
+ fy="367.33188"
+ r="13.571619"
+ gradientTransform="matrix(0.842217,-0.539139,1.038952,1.623,-427.5219,-218.8978)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3176"
+ id="radialGradient3182"
+ cx="207.70366"
+ cy="368.07138"
+ fx="207.70366"
+ fy="368.07138"
+ r="14.070637"
+ gradientTransform="matrix(0.811825,0.583901,-1.451325,2.017847,494.891,-595.3185)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3202"
+ id="radialGradient3208"
+ cx="204.73685"
+ cy="362.01141"
+ fx="197.86072"
+ fy="357.63876"
+ r="12.205135"
+ gradientTransform="matrix(1,0,0,0.746476,-81.19433,-13.4061)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3212"
+ id="radialGradient3218"
+ cx="201.20853"
+ cy="362.6933"
+ fx="201.20853"
+ fy="362.6933"
+ r="13.571619"
+ gradientTransform="matrix(1.525956,0.186163,-0.161883,1.326937,-126.4163,-254.5027)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3226"
+ id="linearGradient3232"
+ x1="211.99017"
+ y1="342.22308"
+ x2="207.79053"
+ y2="347.82849"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3236"
+ id="radialGradient3242"
+ cx="164.46255"
+ cy="330.81088"
+ fx="164.46255"
+ fy="330.81088"
+ r="8.1441183"
+ gradientTransform="matrix(1,0,0,0.119403,0,291.3111)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3236"
+ id="radialGradient3246"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.119403,0,291.3111)"
+ cx="164.46255"
+ cy="330.81088"
+ fx="164.46255"
+ fy="330.81088"
+ r="8.1441183" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3236"
+ id="radialGradient3250"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.119403,0,291.3111)"
+ cx="164.46255"
+ cy="330.81088"
+ fx="164.46255"
+ fy="330.81088"
+ r="8.1441183" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3254"
+ id="radialGradient3260"
+ cx="211.09399"
+ cy="354.80667"
+ fx="211.09399"
+ fy="354.80667"
+ r="24.674908"
+ gradientTransform="matrix(0.515315,-0.857001,1.468013,0.882716,-496.9316,118.39)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3265"
+ id="linearGradient3272"
+ x1="203.11673"
+ y1="349.28479"
+ x2="216.36612"
+ y2="354.39005"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3276"
+ id="linearGradient3282"
+ x1="203.60295"
+ y1="354.09387"
+ x2="216.12302"
+ y2="357.25427"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3284"
+ id="linearGradient3290"
+ x1="183.47957"
+ y1="437.745"
+ x2="162.62515"
+ y2="366.92084"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3292"
+ id="radialGradient3298"
+ cx="163.86942"
+ cy="385.37021"
+ fx="163.86942"
+ fy="385.37021"
+ r="36.718102"
+ gradientTransform="matrix(0.427163,0.333014,-1.137567,1.459174,457.896,-331.1504)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3302"
+ id="radialGradient3308"
+ cx="194.20291"
+ cy="375.72464"
+ fx="194.20291"
+ fy="375.72464"
+ r="36.718102"
+ gradientTransform="matrix(0.6971,0.716974,-1,0.97228,359.0799,-223.2748)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3312"
+ id="radialGradient3318"
+ cx="196.31358"
+ cy="364.18817"
+ fx="196.31358"
+ fy="364.18817"
+ r="9.9703922"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3312"
+ id="radialGradient3322"
+ gradientUnits="userSpaceOnUse"
+ cx="196.31358"
+ cy="364.18817"
+ fx="196.31358"
+ fy="364.18817"
+ r="9.9703922" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3328"
+ id="linearGradient3334"
+ x1="205.42625"
+ y1="366.93793"
+ x2="212.49017"
+ y2="366.93793"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-76.44003,-98.42743)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3346"
+ id="linearGradient3352"
+ x1="204.90874"
+ y1="367.28241"
+ x2="210.40965"
+ y2="367.28241"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3374"
+ id="linearGradient3380"
+ x1="167.64392"
+ y1="395.64648"
+ x2="159.87007"
+ y2="392.55222"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-77.69728,-99.05605)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3382"
+ id="linearGradient3388"
+ x1="155.13319"
+ y1="377.42471"
+ x2="180.15466"
+ y2="387.0513"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3393"
+ id="radialGradient3399"
+ cx="188.52689"
+ cy="375.74426"
+ fx="188.52689"
+ fy="375.74426"
+ r="13.305853"
+ gradientTransform="matrix(1.135055,0.875213,-1.284234,1.665511,378.8176,-514.278)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3401"
+ id="linearGradient3407"
+ x1="204.90874"
+ y1="367.28241"
+ x2="210.40965"
+ y2="367.28241"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3433"
+ id="radialGradient3439"
+ cx="196.48549"
+ cy="386.55505"
+ fx="196.48549"
+ fy="386.55505"
+ r="3.7596991"
+ gradientTransform="matrix(0.294237,-0.237955,2.083097,2.575803,-744.7726,-659.5648)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3443"
+ id="linearGradient3449"
+ x1="197.68881"
+ y1="388.72736"
+ x2="187.37462"
+ y2="372.39655"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3462"
+ id="radialGradient3468"
+ cx="173.96616"
+ cy="382.58182"
+ fx="173.96616"
+ fy="382.58182"
+ r="4.1256795"
+ gradientTransform="matrix(1,0,0,4.541667,0,-1354.977)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3480"
+ id="linearGradient3486"
+ x1="484.07974"
+ y1="415.62164"
+ x2="468.73596"
+ y2="390.86755"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.992267,-0.124125,0.124125,0.992267,-125.7233,-38.36704)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3504"
+ id="radialGradient3510"
+ cx="205.52574"
+ cy="385.10352"
+ fx="205.52574"
+ fy="385.10352"
+ r="36.366535"
+ gradientTransform="matrix(0.82996,0.557822,-0.935939,1.392544,316.996,-364.1477)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3515"
+ id="radialGradient3521"
+ cx="154.32501"
+ cy="447.32541"
+ fx="154.32501"
+ fy="447.32541"
+ r="36.366535"
+ gradientTransform="matrix(0.458686,-0.282258,6.121572e-2,9.9479e-2,-14.00504,316.4315)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3515"
+ id="radialGradient3525"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.401963,0.114807,-3.207855e-2,0.112314,9.85442,196.2951)"
+ cx="300.19409"
+ cy="73.224419"
+ fx="300.19409"
+ fy="73.224419"
+ r="36.366535" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3529"
+ id="linearGradient3535"
+ x1="184.10844"
+ y1="344.05197"
+ x2="214.53532"
+ y2="344.05197"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3539"
+ id="linearGradient3545"
+ x1="150.03909"
+ y1="418.61926"
+ x2="177.74803"
+ y2="418.61926"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3549"
+ id="linearGradient3555"
+ x1="113.61142"
+ y1="436.80551"
+ x2="159.87009"
+ y2="397.61154"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3571"
+ id="linearGradient3577"
+ x1="592.69977"
+ y1="533.74652"
+ x2="574.76526"
+ y2="460.54285"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="matrix(1.081244,0.233753,-0.186506,0.993388,-76.47063,-235.7659)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3589"
+ id="radialGradient3595"
+ cx="602.9469"
+ cy="490.51843"
+ fx="602.9469"
+ fy="490.51843"
+ r="43.516331"
+ gradientTransform="matrix(1.501302,-5.41187e-2,0.20617,3.295226,-399.0741,-1075.738)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3599"
+ id="radialGradient3605"
+ cx="593.91284"
+ cy="482.75339"
+ fx="593.91284"
+ fy="482.75339"
+ r="43.516331"
+ gradientTransform="matrix(1,0,0,2.162011,0,-560.9648)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3611"
+ id="radialGradient3617"
+ cx="619.23688"
+ cy="398.23822"
+ fx="619.23688"
+ fy="398.23822"
+ r="23.540674"
+ gradientTransform="matrix(1.723326,-3.210852e-8,0,0.482382,-536.5025,98.6018)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3611"
+ id="radialGradient3621"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.679045,2.059659,-0.498511,0.543538,-281.3705,-1180.781)"
+ cx="619.23688"
+ cy="398.23822"
+ fx="619.23688"
+ fy="398.23822"
+ r="23.540674" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3687"
+ id="radialGradient3693"
+ cx="620.0766"
+ cy="485.95715"
+ fx="620.0766"
+ fy="485.95715"
+ r="21.114172"
+ gradientTransform="matrix(0.992075,8.937695e-2,-0.104161,1.259592,56.92985,-155.1011)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3698"
+ id="radialGradient3704"
+ cx="605.2868"
+ cy="502.1694"
+ fx="605.2868"
+ fy="502.1694"
+ r="21.114172"
+ gradientTransform="matrix(0.536169,-0.644709,1.51465,1.757908,-479.8598,42.18411)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3708"
+ id="radialGradient3714"
+ cx="605.42615"
+ cy="495.91006"
+ fx="605.42615"
+ fy="495.91006"
+ r="22.316305"
+ gradientTransform="matrix(1.099585,-1.300947,0.799589,0.675827,-535.2,863.3251)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3645"
+ id="linearGradient3651"
+ x1="575.84106"
+ y1="502.13751"
+ x2="620.26019"
+ y2="502.13751"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-77.84199,-99.94276)" />
+ <filter
+ inkscape:collect="always"
+ id="filter3812">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.67857143"
+ id="feGaussianBlur3814" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter3882">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.89285714"
+ id="feGaussianBlur3884" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3887"
+ id="linearGradient3893"
+ x1="621.14056"
+ y1="428.82617"
+ x2="626.51508"
+ y2="480.65189"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3732"
+ id="linearGradient3738"
+ x1="815.76239"
+ y1="361.47995"
+ x2="827.73157"
+ y2="339.22711"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="matrix(0.999458,3.293136e-2,-3.293136e-2,0.999458,-63.18711,-130.1301)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3732"
+ id="linearGradient3742"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ x1="815.76239"
+ y1="361.47995"
+ x2="828.43494"
+ y2="333.24872"
+ gradientTransform="matrix(-1,0,0,-1,1578.842,643.3761)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3732"
+ id="linearGradient3746"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.99904,-4.380841e-2,4.380841e-2,-0.99904,1559.501,680.4606)"
+ spreadMethod="reflect"
+ x1="815.76239"
+ y1="361.47995"
+ x2="828.43494"
+ y2="333.24872" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3764"
+ id="linearGradient3762"
+ x1="817.96442"
+ y1="402.3941"
+ x2="838.04071"
+ y2="379.01126"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3774"
+ id="linearGradient3780"
+ x1="841.26813"
+ y1="397.07397"
+ x2="825.56464"
+ y2="364.52365"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3784"
+ id="linearGradient3791"
+ x1="829.59503"
+ y1="374.55807"
+ x2="823.86743"
+ y2="367.76315"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-77.6171,-103.6227)" />
+ <filter
+ inkscape:collect="always"
+ id="filter3895">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.67857143"
+ id="feGaussianBlur3897" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter3911">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.78571429"
+ id="feGaussianBlur3913" />
+ </filter>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3681"
+ id="radialGradient3917"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.79562,0,108.0223)"
+ cx="597.91498"
+ cy="528.53796"
+ fx="597.91498"
+ fy="528.53796"
+ r="26.296741" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3921"
+ id="linearGradient3927"
+ x1="793.74506"
+ y1="387.00751"
+ x2="810.65973"
+ y2="365.62207"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-78.38489,-101.3295)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3931"
+ id="linearGradient3945"
+ gradientUnits="userSpaceOnUse"
+ x1="678.09943"
+ y1="473.20956"
+ x2="668.18811"
+ y2="455.42188"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3957"
+ id="linearGradient3963"
+ x1="753.35242"
+ y1="408.0029"
+ x2="756.97235"
+ y2="412.57458"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3967"
+ id="linearGradient3973"
+ x1="665.91351"
+ y1="456.84949"
+ x2="835.64233"
+ y2="384.23849"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3986"
+ id="linearGradient3992"
+ x1="676.3764"
+ y1="397.07852"
+ x2="698.50787"
+ y2="395.33786"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.962424,5.965578e-2,-5.965578e-2,0.962424,-29.40688,-128.1463)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3986"
+ id="linearGradient3996"
+ gradientUnits="userSpaceOnUse"
+ x1="682.8418"
+ y1="372.46042"
+ x2="686.57184"
+ y2="376.19043"
+ gradientTransform="matrix(0.962424,5.965578e-2,-5.965578e-2,0.962424,-29.40688,-128.1463)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4000"
+ id="linearGradient4006"
+ x1="699.00525"
+ y1="423.81033"
+ x2="690.55054"
+ y2="412.99329"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.962424,5.965578e-2,-5.965578e-2,0.962424,-29.40688,-128.1463)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3986"
+ id="linearGradient4026"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(12.6601,-4.923372)"
+ x1="676.3764"
+ y1="397.07852"
+ x2="698.50787"
+ y2="395.33786" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3986"
+ id="linearGradient4028"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(12.6601,-4.923372)"
+ x1="682.8418"
+ y1="372.46042"
+ x2="686.57184"
+ y2="376.19043" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4000"
+ id="linearGradient4030"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(12.6601,-4.923372)"
+ x1="699.00525"
+ y1="423.81033"
+ x2="690.55054"
+ y2="412.99329" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3986"
+ id="linearGradient4047"
+ gradientUnits="userSpaceOnUse"
+ x1="676.3764"
+ y1="397.07852"
+ x2="698.50787"
+ y2="395.33786"
+ gradientTransform="matrix(0.902224,5.592432e-2,-5.592432e-2,0.902224,33.37051,-110.8811)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3986"
+ id="linearGradient4049"
+ gradientUnits="userSpaceOnUse"
+ x1="682.8418"
+ y1="372.46042"
+ x2="686.57184"
+ y2="376.19043"
+ gradientTransform="matrix(0.902224,5.592432e-2,-5.592432e-2,0.902224,33.37051,-110.8811)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4000"
+ id="linearGradient4051"
+ gradientUnits="userSpaceOnUse"
+ x1="699.00525"
+ y1="423.81033"
+ x2="690.55054"
+ y2="412.99329"
+ gradientTransform="matrix(0.902224,5.592432e-2,-5.592432e-2,0.902224,33.37051,-110.8811)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3986"
+ id="linearGradient4053"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(12.6601,-4.923372)"
+ x1="676.3764"
+ y1="397.07852"
+ x2="698.50787"
+ y2="395.33786" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3986"
+ id="linearGradient4055"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(12.6601,-4.923372)"
+ x1="682.8418"
+ y1="372.46042"
+ x2="686.57184"
+ y2="376.19043" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4000"
+ id="linearGradient4057"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(12.6601,-4.923372)"
+ x1="699.00525"
+ y1="423.81033"
+ x2="690.55054"
+ y2="412.99329" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4113"
+ id="radialGradient4119"
+ cx="526.59631"
+ cy="412.69949"
+ fx="526.59631"
+ fy="412.69949"
+ r="12.640368"
+ gradientTransform="matrix(1.125046,-0.199365,3.694992e-2,0.208514,-159.4829,335.711)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4125"
+ id="radialGradient4123"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.389085,4.52737e-6,-1.924383e-6,0.393458,-281.2408,145.1025)"
+ cx="526.92224"
+ cy="464.4523"
+ fx="526.92224"
+ fy="464.4523"
+ r="12.640368" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4143"
+ id="linearGradient4149"
+ x1="427.68637"
+ y1="512.70105"
+ x2="416.64786"
+ y2="501.67316"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4151"
+ id="radialGradient4157"
+ cx="428.29843"
+ cy="492.7475"
+ fx="428.29843"
+ fy="492.7475"
+ r="19.73192"
+ gradientTransform="matrix(2.008143,0.102219,0.129298,0.848555,-493.5505,33.79373)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4182"
+ id="linearGradient4188"
+ x1="419.10214"
+ y1="506.69067"
+ x2="417.08871"
+ y2="492.48914"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4192"
+ id="radialGradient4198"
+ cx="422.66373"
+ cy="503.63715"
+ fx="422.66373"
+ fy="503.63715"
+ r="5.5647421"
+ gradientTransform="matrix(1.490255,-0.214186,0.247521,1.722189,-409.517,-372.3085)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4206"
+ id="radialGradient4204"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.146791,8.447705e-4,7.089249e-2,0.835855,-99.8285,82.98763)"
+ cx="423.85788"
+ cy="490.21625"
+ fx="423.85788"
+ fy="490.21625"
+ r="19.73192" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4212"
+ id="radialGradient4218"
+ cx="410.42624"
+ cy="502.76248"
+ fx="410.42624"
+ fy="502.76248"
+ r="4.8490224"
+ gradientTransform="matrix(0.989828,0.142267,-0.366773,2.551832,188.5744,-838.5934)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4222"
+ id="radialGradient4228"
+ cx="405.57721"
+ cy="504.22623"
+ fx="405.57721"
+ fy="504.22623"
+ r="4.8490224"
+ gradientTransform="matrix(1,0,0,1.358974,0,-180.4788)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4232"
+ id="radialGradient4238"
+ cx="410.42624"
+ cy="506.60498"
+ fx="410.42624"
+ fy="506.60498"
+ r="4.8490224"
+ gradientTransform="matrix(1,0,0,1.358974,0,-180.4788)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4232"
+ id="linearGradient4250"
+ x1="417.87643"
+ y1="509.76855"
+ x2="417.18781"
+ y2="494.58783"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4258"
+ id="radialGradient4264"
+ cx="149.96861"
+ cy="441.12811"
+ fx="149.96861"
+ fy="441.12811"
+ r="2.9188709"
+ gradientTransform="matrix(1,0,0,1.986811,-78.38489,-534.7101)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4300"
+ id="radialGradient4306"
+ cx="420.2486"
+ cy="498.16202"
+ fx="420.2486"
+ fy="498.16202"
+ r="1.4920069"
+ gradientTransform="matrix(1,0,0,1.5,0,-249.081)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4312"
+ id="linearGradient4318"
+ x1="805.67865"
+ y1="286.57907"
+ x2="807.25134"
+ y2="288.71094"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4402"
+ id="linearGradient4408"
+ x1="800.95123"
+ y1="285.13364"
+ x2="810.12268"
+ y2="287.33157"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <filter
+ inkscape:collect="always"
+ id="filter4466">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.33928571"
+ id="feGaussianBlur4468" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3916"
+ id="linearGradient4062"
+ gradientUnits="userSpaceOnUse"
+ x1="286.0614"
+ y1="573.17462"
+ x2="311.55939"
+ y2="461.27554"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3916"
+ id="linearGradient4070"
+ gradientUnits="userSpaceOnUse"
+ x1="277.10938"
+ y1="593.56537"
+ x2="291.16864"
+ y2="457.79419"
+ gradientTransform="translate(-77.68155,-100.1032)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4085"
+ id="radialGradient4093"
+ cx="219.18394"
+ cy="463.98462"
+ fx="219.18394"
+ fy="463.98462"
+ r="105.50837"
+ gradientTransform="matrix(1,0,0,0.402815,-78.38489,190.1974)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4097"
+ id="radialGradient4105"
+ cx="340.86157"
+ cy="590.44562"
+ fx="340.86157"
+ fy="590.44562"
+ r="105.50837"
+ gradientTransform="matrix(0.996803,7.990067e-2,-1.999857e-2,0.249493,-65.48703,253.4908)"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4114"
+ id="radialGradient4120"
+ cx="187.41977"
+ cy="418.41058"
+ fx="187.41977"
+ fy="418.41058"
+ r="104.7979"
+ gradientTransform="matrix(0.157721,5.033537e-2,-0.113712,0.356308,127.0532,202.2839)"
+ gradientUnits="userSpaceOnUse" />
+ <filter
+ inkscape:collect="always"
+ id="filter4174">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.44642857"
+ id="feGaussianBlur4176" />
+ </filter>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4097"
+ id="radialGradient4180"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.996803,7.990067e-2,-1.999857e-2,0.249493,-65.48703,253.4908)"
+ cx="182.48717"
+ cy="328.24835"
+ fx="182.48717"
+ fy="328.24835"
+ r="105.50837" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4186"
+ id="linearGradient4193"
+ x1="264.13684"
+ y1="490.36893"
+ x2="266.32321"
+ y2="487.63358"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4186"
+ id="linearGradient4197"
+ gradientUnits="userSpaceOnUse"
+ x1="267.61819"
+ y1="484.64957"
+ x2="266.32321"
+ y2="487.63358"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4186"
+ id="linearGradient4201"
+ gradientUnits="userSpaceOnUse"
+ x1="269.60754"
+ y1="486.63892"
+ x2="262.64484"
+ y2="486.39023"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4207"
+ id="radialGradient4213"
+ cx="476.24875"
+ cy="402.01199"
+ fx="476.24875"
+ fy="402.01199"
+ r="67.121391"
+ gradientTransform="matrix(1,0,0,0.834941,-78.38489,-29.11164)"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4220"
+ id="linearGradient4344"
+ gradientUnits="userSpaceOnUse"
+ x1="637.58429"
+ y1="250.10249"
+ x2="638.33026"
+ y2="253.83252" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4231"
+ id="radialGradient4346"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.863163,-2.987113e-7,4.801722e-8,0.109288,92.86159,227.4468)"
+ cx="676.01874"
+ cy="273.28946"
+ fx="676.01874"
+ fy="273.28946"
+ r="60.177608" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4253"
+ id="radialGradient4348"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.294325,-0.11576,3.699295e-2,9.405622e-2,418.7321,306.3286)"
+ cx="603.65088"
+ cy="286.45432"
+ fx="603.65088"
+ fy="286.45432"
+ r="60.177608" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4265"
+ id="linearGradient4350"
+ gradientUnits="userSpaceOnUse"
+ x1="594.5647"
+ y1="267.14963"
+ x2="602.27344"
+ y2="267.14963" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4281"
+ id="linearGradient4352"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ x1="644.67133"
+ y1="249.68761"
+ x2="675.88177"
+ y2="252.42296" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4291"
+ id="radialGradient4354"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.5,0,128.7879)"
+ cx="604.51147"
+ cy="257.5759"
+ fx="604.51147"
+ fy="257.5759"
+ r="3.2326815" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4291"
+ id="radialGradient4356"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.5,0,128.7879)"
+ cx="604.51147"
+ cy="257.5759"
+ fx="604.51147"
+ fy="257.5759"
+ r="3.2326815" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4372"
+ id="linearGradient4378"
+ x1="678.92523"
+ y1="266.69769"
+ x2="720.89478"
+ y2="269.40009"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4220"
+ id="linearGradient4413"
+ gradientUnits="userSpaceOnUse"
+ x1="637.58429"
+ y1="250.10249"
+ x2="638.33026"
+ y2="253.83252" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4231"
+ id="radialGradient4415"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.863163,-2.987113e-7,4.801722e-8,0.109288,92.86159,227.4468)"
+ cx="676.01874"
+ cy="273.28946"
+ fx="676.01874"
+ fy="273.28946"
+ r="60.177608" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4253"
+ id="radialGradient4417"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.294325,-0.11576,3.699295e-2,9.405622e-2,418.7321,306.3286)"
+ cx="603.65088"
+ cy="286.45432"
+ fx="603.65088"
+ fy="286.45432"
+ r="60.177608" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4265"
+ id="linearGradient4419"
+ gradientUnits="userSpaceOnUse"
+ x1="594.5647"
+ y1="267.14963"
+ x2="602.27344"
+ y2="267.14963" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4281"
+ id="linearGradient4421"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ x1="644.67133"
+ y1="249.68761"
+ x2="675.88177"
+ y2="252.42296" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4291"
+ id="radialGradient4423"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.5,0,128.7879)"
+ cx="604.51147"
+ cy="257.5759"
+ fx="604.51147"
+ fy="257.5759"
+ r="3.2326815" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4291"
+ id="radialGradient4425"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1,0,0,0.5,0,128.7879)"
+ cx="604.51147"
+ cy="257.5759"
+ fx="604.51147"
+ fy="257.5759"
+ r="3.2326815" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4372"
+ id="linearGradient4429"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ x1="678.92523"
+ y1="266.69769"
+ x2="720.89478"
+ y2="269.40009"
+ gradientTransform="matrix(0.858705,3.886482e-2,-4.414177e-2,0.839932,-121.8382,-86.43088)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4433"
+ id="linearGradient4439"
+ x1="668.06061"
+ y1="253.42087"
+ x2="734.87463"
+ y2="258.94357"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4447"
+ id="linearGradient4515"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(60.48714,-133.6344)"
+ x1="608.90308"
+ y1="276.42032"
+ x2="650.42505"
+ y2="244.77008" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4447"
+ id="radialGradient4517"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.514289,-0.595306,0.182821,-0.157941,1100.91,615.3819)"
+ cx="747.15002"
+ cy="166.78223"
+ fx="747.15002"
+ fy="166.78223"
+ r="39.926956" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4447"
+ id="radialGradient4519"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.739856,-0.320138,0.117484,0.271511,161.5357,317.3356)"
+ cx="683.79651"
+ cy="134.88647"
+ fx="683.79651"
+ fy="134.88647"
+ r="39.926956" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4447"
+ id="radialGradient4521"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.401463,7.086448e-2,-1.525473e-2,8.642152e-2,436.1084,54.6916)"
+ cx="709.05914"
+ cy="210.96228"
+ fx="709.05914"
+ fy="210.96228"
+ r="39.926956" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4479"
+ id="linearGradient4523"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ x1="712.80627"
+ y1="114.62395"
+ x2="753.9635"
+ y2="136.25806" />
+ <filter
+ inkscape:collect="always"
+ id="filter4545">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.44642857"
+ id="feGaussianBlur4547" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4558"
+ id="linearGradient4564"
+ x1="559.99988"
+ y1="199.23567"
+ x2="635.59491"
+ y2="275.05173"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <filter
+ inkscape:collect="always"
+ id="filter4630">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="5.80357143"
+ id="feGaussianBlur4632" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4642"
+ id="linearGradient4823"
+ gradientUnits="userSpaceOnUse"
+ x1="606.37823"
+ y1="234.72839"
+ x2="609.51483"
+ y2="217.81898" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4652"
+ id="linearGradient4825"
+ gradientUnits="userSpaceOnUse"
+ x1="590.57513"
+ y1="207.8004"
+ x2="591.06665"
+ y2="221.51376" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4662"
+ id="linearGradient4827"
+ gradientUnits="userSpaceOnUse"
+ x1="604.88623"
+ y1="204.88826"
+ x2="609.51483"
+ y2="217.81898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4672"
+ id="radialGradient4829"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.999999,3.201878e-7,-1.567992e-7,0.97942,-590.426,4.35713)"
+ cx="590.42639"
+ cy="211.72324"
+ fx="590.42639"
+ fy="211.72324"
+ r="4.1057906" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4672"
+ id="radialGradient4831"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.886522,2.956985e-8,-3.266845e-8,0.97942,71.57181,4.357303)"
+ cx="594.53229"
+ cy="215.82903"
+ fx="594.53229"
+ fy="215.82903"
+ r="4.1057906" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4781"
+ id="linearGradient4833"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-14.41844,-60.48714)"
+ x1="563.97198"
+ y1="217.64542"
+ x2="565.73035"
+ y2="226.78882" />
+ <filter
+ inkscape:collect="always"
+ id="filter4080">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1"
+ id="feGaussianBlur4082" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4076"
+ id="linearGradient4083"
+ x1="602.77075"
+ y1="486.47464"
+ x2="602.77075"
+ y2="433.98584"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4091"
+ id="linearGradient4098"
+ x1="600.28412"
+ y1="531.22437"
+ x2="597.30011"
+ y2="501.89203"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4102"
+ id="linearGradient4109"
+ x1="598.29474"
+ y1="489.32935"
+ x2="615.52893"
+ y2="466.4519"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4115"
+ id="linearGradient4123"
+ x1="558.83258"
+ y1="515.56879"
+ x2="597.30005"
+ y2="490.702"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4127"
+ id="linearGradient4135"
+ x1="273.53192"
+ y1="428.28635"
+ x2="264.58524"
+ y2="413.86362"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4139"
+ id="linearGradient4145"
+ x1="249.65982"
+ y1="399.93823"
+ x2="257.61719"
+ y2="425.30234"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4147"
+ id="linearGradient4153"
+ x1="249.65982"
+ y1="399.93823"
+ x2="277.01862"
+ y2="413.86362"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <filter
+ inkscape:collect="always"
+ id="filter4224">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.67857143"
+ id="feGaussianBlur4226" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4228"
+ id="linearGradient4234"
+ x1="187.08812"
+ y1="432.51541"
+ x2="244.7619"
+ y2="432.51541"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4362"
+ id="linearGradient4236"
+ x1="600.0354"
+ y1="283.68604"
+ x2="607.74414"
+ y2="283.68604"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4238"
+ id="linearGradient4244"
+ x1="459.85052"
+ y1="267.57874"
+ x2="477.13748"
+ y2="267.57874"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4246"
+ id="linearGradient4252"
+ x1="407.23315"
+ y1="315.05783"
+ x2="431.14667"
+ y2="315.05783"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4254"
+ id="linearGradient4260"
+ x1="410.04651"
+ y1="319.65982"
+ x2="480.3804"
+ y2="319.65982"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4262"
+ id="linearGradient4268"
+ x1="392.46304"
+ y1="327.71793"
+ x2="409.34317"
+ y2="327.71793"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4270"
+ id="linearGradient4276"
+ x1="374.73767"
+ y1="326.70889"
+ x2="399.49643"
+ y2="326.70889"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4278"
+ id="linearGradient4284"
+ x1="317.20578"
+ y1="328.47754"
+ x2="407.41916"
+ y2="328.47754"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <filter
+ inkscape:collect="always"
+ id="filter4350">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.89285714"
+ id="feGaussianBlur4352" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4366">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.67857143"
+ id="feGaussianBlur4368" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4431"
+ id="linearGradient4438"
+ x1="880.4281"
+ y1="437.11658"
+ x2="738.35809"
+ y2="833.83514"
+ gradientUnits="userSpaceOnUse" />
+ <filter
+ inkscape:collect="always"
+ id="filter4239">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="3.57142857"
+ id="feGaussianBlur4241" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4273"
+ id="linearGradient4279"
+ x1="613.41998"
+ y1="435.97183"
+ x2="605.15906"
+ y2="501.4426"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <filter
+ inkscape:collect="always"
+ id="filter4311">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="7.58928571"
+ id="feGaussianBlur4313" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4230">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="3.57142857"
+ id="feGaussianBlur4232" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4235"
+ id="linearGradient4243"
+ x1="587.30756"
+ y1="450.17422"
+ x2="618.75269"
+ y2="426.07004"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4247"
+ id="linearGradient4256"
+ x1="625.53857"
+ y1="522.99243"
+ x2="638.98773"
+ y2="490.16827"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4259"
+ id="linearGradient4266"
+ x1="617.16638"
+ y1="517.51941"
+ x2="629.43457"
+ y2="486.68463"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4269"
+ id="linearGradient4275"
+ x1="630.03174"
+ y1="462.89209"
+ x2="625.07727"
+ y2="442.50134"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4277"
+ id="linearGradient4283"
+ x1="610.16138"
+ y1="461.56955"
+ x2="619.28265"
+ y2="461.56955"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <filter
+ inkscape:collect="always"
+ id="filter4317">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="3.57142857"
+ id="feGaussianBlur4319" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4337"
+ id="linearGradient4343"
+ x1="609.17426"
+ y1="512.84015"
+ x2="620.71899"
+ y2="485.98407"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4345"
+ id="linearGradient4351"
+ x1="600.88672"
+ y1="513.19611"
+ x2="612.92053"
+ y2="483.85333"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4371"
+ id="linearGradient4377"
+ x1="531.07898"
+ y1="529.25177"
+ x2="531.07898"
+ y2="461.08847"
+ gradientUnits="userSpaceOnUse"
+ spreadMethod="reflect"
+ gradientTransform="translate(-72.37048,-100.7364)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4371"
+ id="linearGradient4381"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-86.4041,-100.0681)"
+ spreadMethod="reflect"
+ x1="531.07898"
+ y1="529.25177"
+ x2="531.07898"
+ y2="461.08847" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4371"
+ id="linearGradient4385"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-97.09638,-100.0681)"
+ spreadMethod="reflect"
+ x1="531.07898"
+ y1="529.25177"
+ x2="531.07898"
+ y2="461.08847" />
+ <filter
+ inkscape:collect="always"
+ id="filter4264"
+ height="1.5">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="27.77358491"
+ id="feGaussianBlur4266" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4298"
+ id="linearGradient4307"
+ x1="806.45526"
+ y1="424.80765"
+ x2="742.04913"
+ y2="422.23459"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.997846,6.559965e-2,-6.559965e-2,0.997846,-49.97998,-150.2238)" />
+ <filter
+ inkscape:collect="always"
+ id="filter4331">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.35849057"
+ id="feGaussianBlur4333" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4424"
+ id="linearGradient4430"
+ x1="551.87695"
+ y1="567.98212"
+ x2="429.81885"
+ y2="541.82678"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.3849,-102.9901)" />
+ <filter
+ inkscape:collect="always"
+ id="filter4444">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="4.24528302"
+ id="feGaussianBlur4446" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.12725075"
+ width="1.2545015"
+ y="-0.1892378"
+ height="1.3784755"
+ id="filter5213">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.7766483"
+ id="feGaussianBlur5215" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.11453065"
+ width="1.2290612"
+ y="-0.17718832"
+ height="1.3543766"
+ id="filter4440">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.1137124"
+ id="feGaussianBlur4442" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4461">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.1074524"
+ id="feGaussianBlur4463" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4506">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.51691406"
+ id="feGaussianBlur4508" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.077959254"
+ width="1.1559185"
+ y="-0.24318457"
+ height="1.4863691"
+ id="filter4647">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.75888801"
+ id="feGaussianBlur4649" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.080201022"
+ width="1.1604021"
+ y="-0.13277864"
+ height="1.2655573"
+ id="filter4687">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.3524949"
+ id="feGaussianBlur4689" />
+ </filter>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4695"
+ id="radialGradient4701"
+ cx="552.00769"
+ cy="340.00449"
+ fx="552.00769"
+ fy="340.00449"
+ r="31.366995"
+ gradientTransform="matrix(-0.427101,1.496232,-0.742129,-0.211841,956.9881,-512.8847)"
+ gradientUnits="userSpaceOnUse" />
+ <filter
+ inkscape:collect="always"
+ id="filter4735">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.77282991"
+ id="feGaussianBlur4737" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4751">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="3.6092948"
+ id="feGaussianBlur4753" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4821">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="4.374536"
+ id="feGaussianBlur4823" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.12236567"
+ width="1.2447313"
+ y="-0.39596942"
+ height="1.7919388"
+ id="filter4893">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.7069002"
+ id="feGaussianBlur4895" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.034960445"
+ width="1.0699209"
+ y="-0.10277939"
+ height="1.2055588"
+ id="filter4947">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.2348114"
+ id="feGaussianBlur4949" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4994">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.6873641"
+ id="feGaussianBlur4996" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter5024">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.7069622"
+ id="feGaussianBlur5026" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.047612153"
+ width="1.0952243"
+ y="-0.1651314"
+ height="1.3302628"
+ id="filter5054">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.4150039"
+ id="feGaussianBlur5056" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3713"
+ id="linearGradient5059"
+ gradientUnits="userSpaceOnUse"
+ x1="798.31927"
+ y1="234.29056"
+ x2="788.5506"
+ y2="244.34135"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5297"
+ id="linearGradient5303"
+ x1="645.68506"
+ y1="289.03711"
+ x2="583.46631"
+ y2="294.4978"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <filter
+ inkscape:collect="always"
+ x="-0.036760788"
+ width="1.0735216"
+ y="-0.17685832"
+ height="1.3537166"
+ id="filter5340">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.3900881"
+ id="feGaussianBlur5342" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5360"
+ id="linearGradient5358"
+ gradientUnits="userSpaceOnUse"
+ x1="294.23193"
+ y1="394.53784"
+ x2="260.16937"
+ y2="419.76807"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <filter
+ inkscape:collect="always"
+ x="-0.075094663"
+ width="1.1501893"
+ y="-0.10326871"
+ height="1.2065374"
+ id="filter5448">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.27909919"
+ id="feGaussianBlur5450" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.20134354"
+ width="1.4026871"
+ y="-0.18221875"
+ height="1.3644375"
+ id="filter5508">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.70922253"
+ id="feGaussianBlur5510" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.19371016"
+ width="1.3874203"
+ y="-0.16509387"
+ height="1.3301877"
+ id="filter5552">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.52305616"
+ id="feGaussianBlur5554" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter5610">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="4.5241276"
+ id="feGaussianBlur5612" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter5679">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.8969747"
+ id="feGaussianBlur5681" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter5748">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.0084971"
+ id="feGaussianBlur5750" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.044116557"
+ width="1.0882331"
+ y="-0.16439871"
+ height="1.3287975"
+ id="filter5838">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="5.4251221"
+ id="feGaussianBlur5840" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.023196984"
+ width="1.046394"
+ y="-0.50276864"
+ height="2.0055373"
+ id="filter5896">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.2174569"
+ id="feGaussianBlur5898" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter5926">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.87283971"
+ id="feGaussianBlur5928" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.05482376"
+ width="1.1096475"
+ y="-0.1674969"
+ height="1.3349938"
+ id="filter4360">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.70581615"
+ id="feGaussianBlur4362" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4383">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="2.5159755"
+ id="feGaussianBlur4385" />
+ </filter>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4399"
+ id="radialGradient4405"
+ cx="739.79919"
+ cy="216.44469"
+ fx="739.79919"
+ fy="216.44469"
+ r="35.906616"
+ gradientTransform="matrix(0.809484,0.371506,-0.140237,0.305567,92.80111,-233.5642)"
+ gradientUnits="userSpaceOnUse" />
+ <filter
+ inkscape:collect="always"
+ x="-0.02131998"
+ width="1.04264"
+ y="-0.16752668"
+ height="1.3350533"
+ id="filter4385">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.6408897"
+ id="feGaussianBlur4387" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.0090293167"
+ width="1.0180587"
+ y="-0.23531374"
+ height="1.4706275"
+ id="filter4411">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.85177159"
+ id="feGaussianBlur4413" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4351">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.1659612"
+ id="feGaussianBlur4353" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4390">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.82609887"
+ id="feGaussianBlur4392" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ id="filter4460">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.1496964"
+ id="feGaussianBlur4462" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.13562258"
+ width="1.2712452"
+ y="-0.1850353"
+ height="1.3700706"
+ id="filter4512">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.43204539"
+ id="feGaussianBlur4514" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.1083551"
+ width="1.2167102"
+ y="-0.38971812"
+ height="1.7794362"
+ id="filter4574">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.43095577"
+ id="feGaussianBlur4576" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.10435339"
+ width="1.2087069"
+ y="-0.4341251"
+ height="1.8682503"
+ id="filter4643">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.66592198"
+ id="feGaussianBlur4645" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.094631292"
+ width="1.1892626"
+ y="-0.38826987"
+ height="1.7765397"
+ id="filter4697">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.6560049"
+ id="feGaussianBlur4699" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.060788251"
+ width="1.1215765"
+ y="-0.28173354"
+ height="1.5634671"
+ id="filter4733">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.49205234"
+ id="feGaussianBlur4735" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ x="-0.19363794"
+ width="1.3872759"
+ y="-0.8794359"
+ height="2.7588718"
+ id="filter4773">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="3.0950543"
+ id="feGaussianBlur4775" />
+ </filter>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3638"
+ id="linearGradient3499"
+ gradientUnits="userSpaceOnUse"
+ x1="745.99255"
+ y1="222.65027"
+ x2="727.56744"
+ y2="229.08752"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4642"
+ id="linearGradient3501"
+ gradientUnits="userSpaceOnUse"
+ x1="606.37823"
+ y1="234.72839"
+ x2="609.51483"
+ y2="217.81898" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4652"
+ id="linearGradient3505"
+ gradientUnits="userSpaceOnUse"
+ x1="590.57513"
+ y1="207.8004"
+ x2="591.06665"
+ y2="221.51376" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4662"
+ id="linearGradient3507"
+ gradientUnits="userSpaceOnUse"
+ x1="604.88623"
+ y1="204.88826"
+ x2="609.51483"
+ y2="217.81898" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4672"
+ id="radialGradient3509"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.999999,3.201878e-7,-1.567992e-7,0.97942,-590.426,4.35713)"
+ cx="590.42639"
+ cy="211.72324"
+ fx="590.42639"
+ fy="211.72324"
+ r="4.1057906" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4672"
+ id="radialGradient3511"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.886522,2.956985e-8,-3.266845e-8,0.97942,71.57181,4.357303)"
+ cx="594.53229"
+ cy="215.82903"
+ fx="594.53229"
+ fy="215.82903"
+ r="4.1057906" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4781"
+ id="linearGradient3513"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-14.41844,-60.48714)"
+ x1="563.97198"
+ y1="217.64542"
+ x2="565.73035"
+ y2="226.78882" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3713"
+ id="linearGradient3517"
+ gradientUnits="userSpaceOnUse"
+ x1="798.31927"
+ y1="234.29056"
+ x2="788.5506"
+ y2="244.34135"
+ gradientTransform="translate(-78.38489,-99.39986)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4143"
+ id="linearGradient3519"
+ gradientUnits="userSpaceOnUse"
+ x1="427.68637"
+ y1="512.70105"
+ x2="416.64786"
+ y2="501.67316" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.85333634"
+ inkscape:cx="487.04984"
+ inkscape:cy="307.94611"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer6"
+ inkscape:window-width="1280"
+ inkscape:window-height="968"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ width="900px"
+ height="600px"
+ showgrid="false"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ <dc:date>17.10.06</dc:date>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Konstantin Rotkevich</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <cc:license
+ rdf:resource="http://artlibre.org/licence.php/lalgb.html" />
+ <dc:description>rksr at yandex.ru</dc:description>
+ </cc:Work>
+ <cc:License
+ rdf:about="http://artlibre.org/licence.php/lalgb.html">
+ <cc:permits
+ rdf:resource="http://web.resource.org/cc/Reproduction" />
+ <cc:permits
+ rdf:resource="http://web.resource.org/cc/Distribution" />
+ <cc:permits
+ rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
+ <cc:requires
+ rdf:resource="http://web.resource.org/cc/ShareAlike" />
+ <cc:requires
+ rdf:resource="http://web.resource.org/cc/Notice" />
+ <cc:requires
+ rdf:resource="http://web.resource.org/cc/Attribution" />
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:groupmode="layer"
+ id="layer6"
+ inkscape:label="background"
+ style="opacity:1;display:inline">
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.7625;fill:url(#linearGradient4438);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4427"
+ sodipodi:cx="550.01093"
+ sodipodi:cy="476.82574"
+ sodipodi:rx="445.91678"
+ sodipodi:ry="154.73453"
+ d="M 995.9277 476.82574 A 445.91678 154.73453 0 1 1 104.09415,476.82574 A 445.91678 154.73453 0 1 1 995.9277 476.82574 z"
+ transform="matrix(0.983314,-0.181917,0.181917,0.983314,-175.1608,6.48194)" />
+ <path
+ style="opacity:0.97391304;fill:#06060a;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4264)"
+ d="M 164.83796,433.18809 C 164.83796,433.18809 204.936,449.13471 241.85376,462.1645 C 278.77151,475.1943 410.23245,487.47891 423.26225,487.47891 C 436.29204,487.47891 483.1611,500.66875 502.52684,497.25126 C 520.98571,493.99381 539.44459,474.44912 539.44459,474.44912 C 539.44459,474.44912 542.70204,428.84483 573.1049,413.6434 C 603.50775,398.44197 673,352.83769 683.85816,350.66606 C 694.71632,348.49442 725.11918,341.97952 725.11918,341.97952 L 751.17877,326.7781 C 751.17877,326.77 [...]
+ id="path3716"
+ sodipodi:nodetypes="cssscssccssscc" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer5"
+ inkscape:label="wheels"
+ style="opacity:1;display:inline">
+ <path
+ style="opacity:0.85217393;fill:url(#linearGradient4307);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4331)"
+ d="M 703.36904,289.21781 C 749.09922,279.91112 774.88898,280.03213 754.64624,316.67865 C 757.6876,316.82066 746.6168,325.98292 749.55629,325.1429 C 750.17056,324.84874 751.96766,324.42963 750.63907,325.32764 C 748.59361,326.98201 746.28199,328.29031 743.93642,329.46746 C 732.20074,332.81703 682.33513,334.68927 643.17424,327.65834 C 642.06217,325.5492 642.65577,320.40184 645.06894,314.03804 C 649.86967,300.45198 656.50651,285.68981 658.89324,283.68408 C 661.6656,281.67653 664.37278 [...]
+ id="path4294"
+ sodipodi:nodetypes="cccccccccccccc" />
+ <path
+ style="fill:url(#linearGradient4430);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4444)"
+ d="M 507.31434,479.3774 C 446.52917,482.28533 385.51598,476.44791 324.71645,467.5249 C 314.17867,464.71134 304.99466,457.80894 298.74117,448.94871 C 296.26119,446.03913 293.8089,443.10602 291.31767,440.20602 C 288.53698,434.84703 291.20619,428.02353 295.94625,424.73112 C 307.4069,413.06999 323.35091,406.83838 339.31846,404.56854 C 363.74133,400.57273 387.45575,391.71223 412.43352,391.57863 C 425.7454,391.49498 438.81013,394.38365 451.71465,397.33715 C 465.0969,400.27803 478.50077, [...]
+ id="path4335"
+ sodipodi:nodetypes="ccccccccccccc" />
+ <path
+ style="color:black;fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ d="M 522.70943,392.79655 C 515.79624,429.61834 526.79803,464.46977 508.63117,474.91029 C 501.34478,479.09779 466.51813,472.83041 459.08309,471.22303 C 433.11052,465.60805 418.91994,424.04272 428.60589,372.4524 C 438.29184,320.86209 467.2321,283.54877 493.20467,289.16375 C 519.17725,294.77874 532.39538,341.20623 522.70943,392.79655 z "
+ id="path3566"
+ sodipodi:nodetypes="cssssc" />
+ <path
+ style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 268.95405,429.00835 C 268.95405,429.00835 428.04764,451.70244 568.67393,381.3893 C 731.13892,300.15681 767.17866,248.52418 771.38034,240.12082 C 775.58202,231.71746 781.55909,183.91031 767.55349,181.10919 C 753.54789,178.30807 701.72716,169.90471 666.71315,188.11199 C 631.69915,206.31927 456.62912,274.94672 446.8252,284.75064 C 437.02127,294.55457 291.36301,416.40331 268.95405,429.00835 z "
+ id="path3709"
+ sodipodi:nodetypes="csssssc" />
+ <path
+ sodipodi:nodetypes="cssssc"
+ id="path3569"
+ d="M 522.70943,392.79655 C 515.79624,429.61834 526.79803,464.46977 508.63117,474.91029 C 501.34478,479.09779 466.51813,472.83041 459.08309,471.22303 C 433.11052,465.60805 418.91994,424.04272 428.60589,372.4524 C 438.29184,320.86209 467.2321,283.54877 493.20467,289.16375 C 519.17725,294.77874 532.39538,341.20623 522.70943,392.79655 z "
+ style="opacity:0.5345912;color:black;fill:url(#linearGradient3577);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;color:black;fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ id="path3560"
+ sodipodi:cx="593.91284"
+ sodipodi:cy="482.75339"
+ sodipodi:rx="43.516331"
+ sodipodi:ry="94.082794"
+ d="M 637.42917 482.75339 A 43.516331 94.082794 0 1 1 550.39651,482.75339 A 43.516331 94.082794 0 1 1 637.42917 482.75339 z"
+ transform="matrix(1.081244,0.233753,-0.186506,0.993388,-37.57335,-235.7659)" />
+ <path
+ transform="matrix(1.081244,0.233753,-0.186506,0.993388,-37.57335,-235.7659)"
+ d="M 637.42917 482.75339 A 43.516331 94.082794 0 1 1 550.39651,482.75339 A 43.516331 94.082794 0 1 1 637.42917 482.75339 z"
+ sodipodi:ry="94.082794"
+ sodipodi:rx="43.516331"
+ sodipodi:cy="482.75339"
+ sodipodi:cx="593.91284"
+ id="path3579"
+ style="opacity:1;color:black;fill:url(#radialGradient3595);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0.777707,0.190235,-0.134149,0.808448,126.6633,-119.1808)"
+ d="M 637.42917 482.75339 A 43.516331 94.082794 0 1 1 550.39651,482.75339 A 43.516331 94.082794 0 1 1 637.42917 482.75339 z"
+ sodipodi:ry="94.082794"
+ sodipodi:rx="43.516331"
+ sodipodi:cy="482.75339"
+ sodipodi:cx="593.91284"
+ id="path3562"
+ style="opacity:1;color:black;fill:url(#radialGradient3605);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ style="opacity:0.41666667;fill:#c1c1c1;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;filter:url(#filter4317)"
+ d="M 553.06375,408.78461 C 550.07973,424.43348 533.99476,455.1318 519.69088,455.1318 C 505.387,455.1318 493.77805,442.8349 493.77805,427.68336 C 493.77805,412.53184 505.387,400.23494 519.69088,400.23494 C 533.99476,400.23494 554.55576,393.63308 553.06375,408.78461 z "
+ id="path2794"
+ sodipodi:nodetypes="csssc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;color:black;fill:#2b3034;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ id="path3623"
+ sodipodi:cx="605.78479"
+ sodipodi:cy="482.27875"
+ sodipodi:rx="21.114172"
+ sodipodi:ry="55.664635"
+ d="M 626.89896 482.27875 A 21.114172 55.664635 0 1 1 584.67062,482.27875 A 21.114172 55.664635 0 1 1 626.89896 482.27875 z"
+ transform="matrix(1.306165,0.356718,-0.229553,1.074913,-154.298,-347.0167)" />
+ <path
+ transform="matrix(1.306165,0.356718,-0.229553,1.074913,-154.298,-347.0167)"
+ d="M 626.89896 482.27875 A 21.114172 55.664635 0 1 1 584.67062,482.27875 A 21.114172 55.664635 0 1 1 626.89896 482.27875 z"
+ sodipodi:ry="55.664635"
+ sodipodi:rx="21.114172"
+ sodipodi:cy="482.27875"
+ sodipodi:cx="605.78479"
+ id="path3677"
+ style="opacity:1;color:black;fill:url(#radialGradient3693);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(1.173682,0.320536,-0.20627,0.965885,-87.61596,-273.6685)"
+ d="M 626.89896 482.27875 A 21.114172 55.664635 0 1 1 584.67062,482.27875 A 21.114172 55.664635 0 1 1 626.89896 482.27875 z"
+ sodipodi:ry="55.664635"
+ sodipodi:rx="21.114172"
+ sodipodi:cy="482.27875"
+ sodipodi:cx="605.78479"
+ id="path3629"
+ style="opacity:1;color:black;fill:#212e3d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;color:black;fill:url(#radialGradient3704);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ id="path3695"
+ sodipodi:cx="605.78479"
+ sodipodi:cy="482.27875"
+ sodipodi:rx="21.114172"
+ sodipodi:ry="55.664635"
+ d="M 626.89896 482.27875 A 21.114172 55.664635 0 1 1 584.67062,482.27875 A 21.114172 55.664635 0 1 1 626.89896 482.27875 z"
+ transform="matrix(1.173682,0.320536,-0.20627,0.965885,-87.61596,-273.6685)" />
+ <path
+ style="opacity:1;color:black;fill:#303038;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ d="M 523.14636,335.19389 C 513.12105,341.78379 503.61551,358.49528 499.11511,379.56889 C 494.36159,401.82786 496.52804,422.63067 503.67761,433.22514 C 504.32267,433.5434 504.98652,433.81765 505.67761,434.00639 C 518.19881,437.42597 533.09489,418.17241 538.89636,391.00639 C 544.69781,363.84036 539.23005,338.98846 526.70886,335.56889 C 525.535,335.2483 524.35211,335.12779 523.14636,335.19389 z "
+ id="path3627" />
+ <path
+ id="path3706"
+ d="M 523.14636,335.19389 C 513.12105,341.78379 503.61551,358.49528 499.11511,379.56889 C 494.36159,401.82786 496.52804,422.63067 503.67761,433.22514 C 504.32267,433.5434 504.98652,433.81765 505.67761,434.00639 C 518.19881,437.42597 533.09489,418.17241 538.89636,391.00639 C 544.69781,363.84036 539.23005,338.98846 526.70886,335.56889 C 525.535,335.2483 524.35211,335.12779 523.14636,335.19389 z "
+ style="opacity:1;color:black;fill:url(#radialGradient3714);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
+ <path
+ style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 695.67097,308.23316 C 695.67097,308.23316 705.39529,325.73693 716.09204,327.68179 C 732.46891,330.6594 743.72704,327.41053 749.15473,323.79207 C 757.90661,317.95748 764.71364,295.63566 766.6585,269.33588 C 767.73423,254.78912 769.5758,236.27319 766.6585,228.49373 C 763.74121,220.71428 756.93418,212.93482 756.93418,212.93482 C 756.93418,212.93482 754.01689,210.01753 749.15473,212.93482 C 744.29257,215.85212 730.67852,236.27319 722.89906,241.13535 C 715.11961,245.99751 707.3401 [...]
+ id="path3607"
+ sodipodi:nodetypes="csssscsssc" />
+ <path
+ style="fill:url(#radialGradient3617);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 555.61388,310.9966 C 555.61388,310.9966 545.21442,284.57073 525.71546,282.27282 C 506.21651,279.97493 494.51713,276.52807 488.01747,283.42177 C 481.51782,290.31549 476.31809,304.1029 497.11699,301.805 C 517.91588,299.50709 546.51437,305.25184 555.61388,310.9966 z "
+ id="path3609"
+ sodipodi:nodetypes="csssc" />
+ <path
+ sodipodi:nodetypes="csssc"
+ id="path3619"
+ d="M 563.1875,363.80074 C 563.1875,363.80074 580.36473,321.59556 563.74154,295.70183 C 547.11834,269.80815 539.28168,251.94162 525.82483,251.94113 C 512.36795,251.94067 493.05341,261.26151 515.69263,283.5304 C 538.33183,305.79926 560.25864,346.45226 563.1875,363.80074 z "
+ style="fill:url(#radialGradient3621);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="opacity:1;color:black;fill:#1a1c2c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ d="M 517.83386,343.22514 C 516.57207,343.29432 515.29804,343.62293 514.02136,344.16264 C 507.65696,352.65979 502.20889,365.08193 499.11511,379.56889 C 495.54997,396.26312 495.86959,412.13806 499.27136,423.50639 C 499.27646,423.51079 499.26626,423.53325 499.27136,423.53764 C 500.48263,424.58032 501.81776,425.32816 503.27136,425.72514 C 513.72684,428.58056 526.14578,412.50312 530.99011,389.81889 C 535.83445,367.13465 531.28934,346.39307 520.83386,343.53764 C 519.85366,343.26994 518. [...]
+ id="path3625" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;color:black;fill:#262932;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.55500793;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ id="path3631"
+ sodipodi:cx="605.78479"
+ sodipodi:cy="482.27875"
+ sodipodi:rx="21.114172"
+ sodipodi:ry="55.664635"
+ d="M 626.89896 482.27875 A 21.114172 55.664635 0 1 1 584.67062,482.27875 A 21.114172 55.664635 0 1 1 626.89896 482.27875 z"
+ transform="matrix(0.343077,9.369479e-2,-6.029425e-2,0.282336,338.3958,192.627)" />
+ <path
+ transform="matrix(0.343077,9.369479e-2,-6.029425e-2,0.282336,340.6992,193.0109)"
+ d="M 626.89896 482.27875 A 21.114172 55.664635 0 1 1 584.67062,482.27875 A 21.114172 55.664635 0 1 1 626.89896 482.27875 z"
+ sodipodi:ry="55.664635"
+ sodipodi:rx="21.114172"
+ sodipodi:cy="482.27875"
+ sodipodi:cx="605.78479"
+ id="path3633"
+ style="opacity:1;color:black;fill:#0c0912;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.55500793;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;color:black;fill:#74849d;fill-opacity:1;fill-rule:evenodd;stroke:#abbcd1;stroke-width:2.55500793;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ id="path3635"
+ sodipodi:cx="605.78479"
+ sodipodi:cy="482.27875"
+ sodipodi:rx="21.114172"
+ sodipodi:ry="55.664635"
+ d="M 626.89896 482.27875 A 21.114172 55.664635 0 1 1 584.67062,482.27875 A 21.114172 55.664635 0 1 1 626.89896 482.27875 z"
+ transform="matrix(0.186168,5.084278e-2,-3.271823e-2,0.153208,423.2207,281.295)" />
+ <path
+ transform="matrix(0.186168,5.084278e-2,-3.271823e-2,0.153208,426.067,281.8379)"
+ d="M 626.89896 482.27875 A 21.114172 55.664635 0 1 1 584.67062,482.27875 A 21.114172 55.664635 0 1 1 626.89896 482.27875 z"
+ sodipodi:ry="55.664635"
+ sodipodi:rx="21.114172"
+ sodipodi:cy="482.27875"
+ sodipodi:cx="605.78479"
+ id="path3637"
+ style="opacity:1;color:black;fill:#192028;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.55500793;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ style="fill:url(#linearGradient3651);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 516.67478,430.72664 C 516.67478,430.72664 529.12524,424.81267 537.52931,401.15679 C 545.93337,377.50091 540.95319,371.58694 540.95319,371.58694 C 540.95319,371.58694 539.39688,392.75273 537.52931,395.86535 C 535.66174,398.97796 530.05904,403.95814 531.61534,402.09058 C 533.17165,400.223 535.35047,393.99777 535.973,389.32885 C 536.59552,384.65993 534.72796,382.16984 534.72796,382.16984 C 534.72796,382.16984 531.30408,403.02436 526.63515,409.87212 C 521.96623,416.71987 514.4959 [...]
+ id="path3642" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4266);stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 512.42804,440.46299 C 512.42804,440.46299 537.38115,447.75698 550.04966,385.56614"
+ id="path3653"
+ sodipodi:nodetypes="cs" />
+ <path
+ sodipodi:nodetypes="cs"
+ id="path3655"
+ d="M 515.1153,445.83751 C 515.1153,445.83751 541.79568,453.63639 555.34111,387.14066"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4256);stroke-width:2.56612968;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cs"
+ id="path3686"
+ d="M 504.1414,426.09313 C 504.1414,426.09313 523.77885,431.83331 533.74864,382.89074"
+ style="opacity:0.75833333;fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4351);stroke-width:1.57394791;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="opacity:1;fill:#cbe8fd;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 519.25863,387.26074 C 519.25863,387.26074 519.83447,381.11843 521.562,379.96675 C 523.28952,378.81507 525.78483,377.66338 524.24925,377.47144 C 522.71368,377.27949 520.60226,377.08754 520.60226,377.08754 C 520.60226,377.08754 516.76332,380.54259 516.76332,382.07817 C 516.76332,383.61374 515.61164,386.87684 515.61164,386.87684 C 515.61164,386.87684 516.18748,385.34127 519.25863,387.26074 z "
+ id="path3899" />
+ <path
+ style="opacity:0.75833333;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4343);stroke-width:2.01947713;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 508.17567,430.70663 C 508.17567,430.70663 529.17244,436.84415 539.83234,384.51374"
+ id="path3688"
+ sodipodi:nodetypes="cs" />
+ <path
+ style="opacity:1;fill:#cbe8fd;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 526.36067,386.301 C 526.36067,386.301 524.05731,392.25136 521.94589,392.63525 C 519.83447,393.01915 519.45058,393.01915 519.45058,393.01915 C 519.45058,393.01915 520.98615,395.32251 522.32978,394.55472 C 523.67341,393.78693 526.93651,389.18021 526.36067,386.301 z "
+ id="path3901" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4243);stroke-width:1.16600001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 537.29809,327.53473 C 537.29809,327.53473 510.61771,319.73585 497.07228,386.23158"
+ id="path3690"
+ sodipodi:nodetypes="cs" />
+ <path
+ style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 513.4445,375.63605 L 509.46582,350.27193 C 509.46582,350.27193 511.45516,345.79591 516.92585,344.80124 C 522.39654,343.80657 524.38589,344.80124 524.38589,344.80124 L 521.40187,369.17069 C 521.40187,369.17069 515.93118,368.17602 513.4445,375.63605 z "
+ id="path3185" />
+ <path
+ style="fill:#c7eef2;fill-opacity:0.14937762;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4230)"
+ d="M 474.83853,392.24233 C 474.83853,392.24233 486.57194,331.9546 508.00149,318.09177 C 526.70088,305.9951 534.01552,310.2632 538.90169,312.43483 C 543.78786,314.60646 543.24495,304.29121 538.35878,301.57666 C 533.47261,298.86212 525.36663,296.64492 514.64914,299.22274 C 511.31071,300.02572 500.89812,305.91993 499.26939,308.09156 C 497.64067,310.2632 488.41123,325.46462 485.69669,330.89371 C 482.98215,336.32279 478.63888,361.29656 478.63888,361.29656 L 474.83853,392.24233 z "
+ id="path3692"
+ sodipodi:nodetypes="csssssscc" />
+ <path
+ id="path4072"
+ d="M 513.4445,375.63605 L 511.9525,345.29857 C 511.9525,345.29857 508.99539,342.63538 517.42318,343.30924 C 522.34283,343.7026 524.38589,344.80124 524.38589,344.80124 L 521.40187,369.17069 C 521.40187,369.17069 515.93118,368.17602 513.4445,375.63605 z "
+ style="fill:url(#linearGradient4083);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ sodipodi:nodetypes="ccsccc" />
+ <path
+ style="opacity:0.65416721;fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter3812)"
+ d="M 511.21337,467.70656 C 511.21337,467.70656 490.58286,460.64875 481.89633,445.44733 C 473.2098,430.2459 473.20981,425.90263 469.40945,408.52957 C 468.50332,404.38727 466.6949,367.26855 466.15199,371.61182 C 465.60908,375.95509 449.32184,391.69942 450.95056,398.21432 C 452.57929,404.72922 444.97858,406.90085 446.06439,411.24412 C 447.15021,415.58738 428.33592,419.80413 431.40588,435.67498 C 434.47142,451.52304 441.72113,466.62074 467.78072,460.10585 C 477.77412,457.6075 488.4112 [...]
+ id="path3758"
+ sodipodi:nodetypes="cssssssssc" />
+ <path
+ style="fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 511.9525,401.99484 L 518.41786,401.99484 L 521.89921,399.50816 L 521.89921,413.93089 C 521.89921,413.93089 515.43384,422.88293 513.4445,423.87761 C 511.45516,424.87228 507.97381,424.37494 507.97381,424.37494 L 511.9525,401.99484 z "
+ id="path4087" />
+ <path
+ style="fill:url(#linearGradient3893);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter3882)"
+ d="M 525.86433,334.12434 C 525.86433,334.12434 534.31,332.20487 539.68452,337.19549 C 545.05903,342.18612 548.13019,354.08683 548.13019,362.14861 C 548.13019,370.21038 548.13019,387.86951 546.21072,390.17287 C 544.29125,392.47624 540.45231,391.32455 541.60399,378.27216 C 542.75567,365.21976 541.98789,349.09621 537.76505,342.95391 C 534.36779,338.01244 531.62274,334.50824 525.86433,334.12434 z "
+ id="path3848"
+ sodipodi:nodetypes="csssssc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4275);stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 549.28187,389.78898 C 549.28187,389.78898 557.34364,347.94453 541.98788,337.19549"
+ id="path3895"
+ sodipodi:nodetypes="cs" />
+ <path
+ id="path4089"
+ d="M 512.44984,404.97885 L 518.9152,404.97885 L 521.40187,402.49217 L 521.89921,413.93089 C 521.89921,413.93089 517.42318,420.89359 513.4445,423.87761 C 511.66518,425.2121 510.46049,423.38027 510.46049,423.38027 L 512.44984,404.97885 z "
+ style="fill:url(#linearGradient4098);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ sodipodi:nodetypes="ccccscc" />
+ <path
+ sodipodi:nodetypes="cs"
+ id="path3897"
+ d="M 538.72082,386.37612 C 538.72082,386.37612 546.14176,347.85788 532.00663,337.96328"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4283);stroke-width:0.46025509;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ transform="matrix(0.69343,0,0,1.311927,334.6472,-400.8506)"
+ d="M 624.21172 528.53796 A 26.296741 20.922226 0 1 1 571.61824,528.53796 A 26.296741 20.922226 0 1 1 624.21172 528.53796 z"
+ sodipodi:ry="20.922226"
+ sodipodi:rx="26.296741"
+ sodipodi:cy="528.53796"
+ sodipodi:cx="597.91498"
+ id="path3915"
+ style="opacity:0.61666667;fill:url(#radialGradient3917);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.82916667;fill:#1e2128;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ id="path3693"
+ sodipodi:cx="826.30621"
+ sodipodi:cy="368.13058"
+ sodipodi:rx="8.6865301"
+ sodipodi:ry="40.718113"
+ d="M 834.99274 368.13058 A 8.6865301 40.718113 0 1 1 817.61968,368.13058 A 8.6865301 40.718113 0 1 1 834.99274 368.13058 z"
+ transform="matrix(1.352718,5.019885e-2,-9.500183e-2,0.967236,-332.4221,-125.8317)" />
+ <path
+ style="opacity:0.82916667;fill:#1e2128;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ d="M 754.24011,232.31889 C 747.75388,232.07819 740.7504,249.54765 738.61511,271.28764 C 736.47981,293.02762 740.00385,310.85944 746.49011,311.10014 C 752.97634,311.34084 759.9798,293.90262 762.11511,272.16264 C 764.25041,250.42266 760.72634,232.55958 754.24011,232.31889 z M 752.39636,237.41264 C 758.07765,237.62348 761.17291,253.24566 759.30261,272.28764 C 757.43233,291.32962 751.32764,306.62347 745.64636,306.41264 C 739.96507,306.20181 736.86981,290.57962 738.74011,271.53764 C 74 [...]
+ id="path3700" />
+ <path
+ style="opacity:0.82916667;fill:#3f4654;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ d="M 752.36191,237.94389 C 751.40028,237.9082 750.41484,238.33357 749.4507,239.14072 C 753.42961,243.11479 755.33514,256.51551 753.78517,272.2962 C 752.26086,287.81547 747.88211,300.77691 743.24011,304.67535 C 743.98946,305.42379 744.81177,305.83928 745.69847,305.87218 C 751.29341,306.07981 757.31285,291.04886 759.15474,272.2962 C 760.99662,253.54355 757.95685,238.1515 752.36191,237.94389 z "
+ id="path3703" />
+ <path
+ style="opacity:0.82916667;fill:#1e2128;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ d="M 748.69095,236.97514 C 747.83004,238.29118 746.99335,239.87425 746.19095,241.66264 C 749.43465,245.72227 750.92013,257.22481 749.5972,270.69389 C 748.21922,284.72366 744.20317,296.42843 740.00345,299.72514 C 740.3289,301.28761 740.70254,302.72755 741.12845,304.00639 C 746.4248,302.54937 751.86484,288.20634 753.5972,270.56889 C 755.21475,254.10025 753.03442,240.24175 748.69095,236.97514 z "
+ id="path3713" />
+ <path
+ style="fill:#b2b7c5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 759.59386,267.37345 C 759.59386,267.37345 762.8513,267.6449 762.3084,272.25962 C 761.76549,276.87434 759.23808,299.59657 750.90733,307.54865 C 744.93534,313.24919 742.76371,305.91993 742.76371,305.91993 C 742.76371,305.91993 746.56406,308.90592 748.46424,305.64848 C 750.36442,302.39103 759.05095,291.26141 759.59386,267.37345 z "
+ id="path3722"
+ sodipodi:nodetypes="csscsc" />
+ <path
+ sodipodi:nodetypes="csscsc"
+ id="path3724"
+ d="M 750.09297,269.27363 C 750.09297,269.27363 754.70768,266.28763 754.16478,270.90235 C 753.62187,275.51707 753.04342,292.86576 745.20679,301.30521 C 741.67789,305.10557 740.04917,301.30521 740.04917,301.30521 C 740.04917,301.30521 738.69189,304.2912 740.59207,301.03376 C 742.49225,297.77631 749.55006,293.16159 750.09297,269.27363 z "
+ style="fill:url(#linearGradient3762);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="opacity:0.7375;fill:#b2b7c5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 757.69368,249.18603 C 757.69368,249.18603 759.86531,247.28585 759.86531,252.17202 C 759.86531,257.0582 761.49404,267.91636 760.67967,268.18781 C 759.86531,268.45927 758.77949,266.01618 759.05095,261.40146 C 759.3224,256.78674 757.69368,248.91457 757.69368,249.18603 z "
+ id="path3726" />
+ <path
+ style="fill:#b2b7c5;fill-opacity:0.29460581;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 743.84952,303.7483 C 746.29261,301.84812 747.37842,295.06177 749.55006,294.2474 C 751.72169,293.43304 756.06495,293.97595 753.35041,297.50485 C 750.63587,301.03376 749.82151,307.54865 747.64988,307.00575 C 745.47824,306.46284 744.66388,304.83411 743.84952,303.7483 z "
+ id="path3728" />
+ <path
+ id="path3740"
+ d="M 748.19279,311.34901 C 748.19279,311.34901 758.7795,305.37702 760.67968,280.13179 C 762.57986,254.88656 762.57986,252.44348 762.57986,252.44348"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient3742);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient3746);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 744.19488,312.36287 C 744.19488,312.36287 755.03305,306.8604 758.03736,281.72265 C 761.04167,256.5849 761.14869,254.14416 761.14869,254.14416"
+ id="path3744" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:#23262f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3770"
+ sodipodi:cx="826.52386"
+ sodipodi:cy="373.25284"
+ sodipodi:rx="2.6872582"
+ sodipodi:ry="8.8295631"
+ d="M 829.21112 373.25284 A 2.6872582 8.8295631 0 1 1 823.83661,373.25284 A 2.6872582 8.8295631 0 1 1 829.21112 373.25284 z"
+ transform="matrix(0.994016,0.109233,-0.109233,0.994016,-31.13222,-190.5209)" />
+ <path
+ transform="matrix(0.994016,0.109233,-0.109233,0.994016,-31.13222,-190.5209)"
+ d="M 829.21112 373.25284 A 2.6872582 8.8295631 0 1 1 823.83661,373.25284 A 2.6872582 8.8295631 0 1 1 829.21112 373.25284 z"
+ sodipodi:ry="8.8295631"
+ sodipodi:rx="2.6872582"
+ sodipodi:cy="373.25284"
+ sodipodi:cx="826.52386"
+ id="path3772"
+ style="opacity:1;fill:url(#linearGradient3780);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ style="fill:url(#linearGradient3791);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 749.29067,261.95227 L 745.06783,263.10395 L 743.14836,268.47847 C 743.14836,268.47847 748.13898,272.31741 748.13898,270.39794 C 748.13898,268.47847 749.67456,262.33616 749.29067,261.95227 z "
+ id="path3782" />
+ <path
+ style="opacity:0.15;fill:#e0e2e8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 747.37119,245.06092 L 750.05845,260.41669 C 750.05845,260.41669 754.66518,252.35491 747.37119,245.06092 z "
+ id="path3793" />
+ <path
+ style="fill:#e0e2e8;fill-opacity:0.1120332;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter3911)"
+ d="M 738.15774,272.70129 C 738.3077,262.95421 741.22889,235.07967 752.74571,232.00852 C 764.26253,228.93737 763.87864,255.80995 763.87864,255.80995 C 763.87864,255.80995 765.03032,239.30251 763.49475,233.92799 C 761.95917,228.55347 761.57527,224.71453 756.96855,222.02727 C 753.32096,219.89951 750.15685,222.55619 746.60341,227.40179 C 742.38057,233.1602 735.89995,255.32795 735.08659,270.78182 C 734.3188,285.36979 733.55101,301.10945 737.38995,308.01954 C 741.22889,314.92964 747.371 [...]
+ id="path3795"
+ sodipodi:nodetypes="cscsssssssss" />
+ <path
+ style="fill:#e0e2e8;fill-opacity:0.32780086;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter3895)"
+ d="M 744.30004,229.32126 C 744.30004,229.32126 751.97792,218.95613 755.43297,221.25949 C 758.88801,223.56285 764.26253,232.00852 764.26253,232.00852 C 764.26253,232.00852 763.87864,227.40179 760.42359,218.95613 C 756.75499,209.98847 749.29066,213.58161 747.37119,215.50108 C 745.45172,217.42055 744.30004,229.32126 744.30004,229.32126 z "
+ id="path3797"
+ sodipodi:nodetypes="cscssc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient3738);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 754.60235,231.13399 C 754.60235,231.13399 744.26121,235.20857 739.74619,260.11935 C 735.70242,282.43016 739.75864,287.47124 739.75864,287.47124"
+ id="path3730"
+ sodipodi:nodetypes="csc" />
+ <path
+ style="fill:url(#linearGradient4109);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 525.38056,371.65736 L 531.84592,360.71598 C 531.84592,360.71598 532.84059,379.61473 531.34858,384.09076 C 529.85658,388.56678 528.86191,384.58809 528.86191,384.58809 C 528.86191,384.58809 529.35924,374.64138 525.38056,371.65736 z "
+ id="path4100"
+ sodipodi:nodetypes="ccscc" />
+ <path
+ style="fill:#5d5d5d;fill-opacity:0.16182574;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4239)"
+ d="M 469.51602,412.59282 C 469.51602,412.59282 469.51602,456.19983 487.80283,469.56327 C 506.08964,482.9267 528.59648,463.23322 528.59648,463.23322 C 528.59648,463.23322 545.47661,447.75976 548.99331,434.39633 C 552.51,421.03289 538.44322,455.49649 520.15642,455.49649 C 501.86961,455.49649 487.80283,425.95626 484.98948,413.9995 C 482.17612,402.04274 471.62604,394.30602 469.51602,412.59282 z "
+ id="path4209" />
+ <path
+ style="fill:url(#linearGradient4123);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 509.96315,381.60408 L 499.02177,381.60408 C 499.02177,381.60408 496.03775,403.98418 497.52976,412.93622 C 503.99512,406.9682 509.96315,401.4975 509.96315,401.4975 C 509.96315,401.4975 506.4818,388.56678 509.96315,381.60408 z "
+ id="path4113"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="opacity:1;fill:url(#linearGradient4279);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 496.2429,402.04274 C 496.2429,402.04274 503.44694,378.00855 513.29368,373.08518 C 523.14043,368.1618 528.59648,364.06245 530.7065,375.31587 C 532.81651,386.56929 541.95992,364.76579 540.55324,361.24909 C 539.14656,357.7324 536.33321,339.44559 529.29982,337.33557 C 522.26643,335.22556 518.2356,337.03012 511.71635,348.58899 C 492.74691,382.22251 497.64957,391.49266 496.2429,402.04274 z "
+ id="path4244"
+ sodipodi:nodetypes="csssssc" />
+ <path
+ style="fill:#161616;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4311)"
+ d="M 469.67897,422.88293 C 469.67897,422.88293 469.67897,384.09076 475.64699,364.19733 C 481.61502,344.30391 488.57772,319.43712 497.52976,312.47443 C 506.4818,305.51173 519.41253,303.52238 513.4445,298.54903 C 507.47647,293.57567 499.5191,283.62896 487.58305,295.56501 C 475.64699,307.50107 463.71094,336.34654 460.72693,354.25062 C 457.74291,372.1547 457.74291,414.92556 457.74291,414.92556 C 457.74291,414.92556 457.74291,434.81899 469.67897,422.88293 z "
+ id="path4281" />
+ <path
+ style="opacity:0.06666667;fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4377);stroke-width:2.9000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:2.9, 2.9;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 509.02224,474.28642 C 509.02224,474.28642 484.29634,475.62295 470.26272,448.22398 C 456.22911,420.82502 460.90698,382.73377 460.90698,382.73377"
+ id="path4369" />
+ <path
+ id="path4379"
+ d="M 494.98862,474.95469 C 494.98862,474.95469 470.26272,476.29122 456.2291,448.89225 C 442.19549,421.49329 446.87336,383.40204 446.87336,383.40204"
+ style="opacity:0.06666667;fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4381);stroke-width:2.9000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:2.9, 2.9;stroke-dashoffset:0;stroke-opacity:1" />
+ <path
+ style="opacity:0.06666667;fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4385);stroke-width:2.9000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:2.9, 2.9;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 484.29634,474.95469 C 484.29634,474.95469 459.57044,476.29122 445.53682,448.89225 C 431.50321,421.49329 436.18108,383.40204 436.18108,383.40204"
+ id="path4383" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer3"
+ inkscape:label="main_color"
+ style="opacity:1;display:inline">
+ <path
+ style="fill:#ffbe00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 547.33386,87.912642 C 505.90529,87.912642 462.691,93.622462 457.33386,94.69389 C 451.97671,95.76532 447.32494,99.69389 445.89636,99.69389 C 444.46778,99.69389 441.61511,101.10908 439.11511,102.53764 C 436.61511,103.96622 434.816,107.91263 431.95886,110.41264 C 429.10172,112.91264 384.11511,160.75638 384.11511,160.75639 L 380.17761,162.19389 C 380.17761,162.19389 285.90082,173.97067 229.11511,188.25639 C 172.3294,202.5421 138.75351,224.68943 118.39636,236.47514 C 98.03922,248. [...]
+ id="path2177" />
+ <g
+ id="g3620"
+ style="fill:#e1eee5;fill-opacity:1"
+ transform="translate(-78.38489,-99.39986)">
+ <path
+ style="fill:#e1eee5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 504.08593,258.32995 L 552.61286,253.37822 L 578.85702,211.7837 L 534.78664,209.30783 L 504.08593,258.32995 z "
+ id="path3622"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="fill:#e1eee5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 498.63903,259.87554 L 530.33009,207.32714 L 479.61735,262.17118 L 498.63903,259.87554 z "
+ id="path3624"
+ sodipodi:nodetypes="cccc" />
+ <path
+ style="fill:#e1eee5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 615.00464,203.36576 C 615.00464,203.36576 628.86948,217.2306 641.2488,222.6775 C 653.62812,228.1244 670.464,235.05682 676.40607,235.05682 C 685.31918,235.05682 714.0392,233.57131 714.0392,233.57131 L 712.55368,214.25956 C 712.55368,214.25956 711.06817,211.28853 699.6792,210.29818 C 690.2933,209.48201 646.6957,205.34645 646.6957,205.34645 L 615.00464,203.36576 z "
+ id="path3626"
+ sodipodi:nodetypes="cssccscc" />
+ </g>
+ <path
+ style="fill:#2b3545;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 440.87281,107.22963 L 395.70951,157.3039 L 383.79999,163.95232 C 383.79999,163.95232 384.52212,166.57915 391.87506,166.84176 C 394.83895,166.94761 401.14292,166.27109 405.52269,165.42572 C 412.00845,164.17387 417.76357,160.45092 417.76357,160.45092 L 399.58235,162.85866 L 445.0745,106.87949 L 440.87281,107.22963 z "
+ id="path3618"
+ sodipodi:nodetypes="cccsscccc" />
+ <g
+ id="g3590"
+ transform="translate(-78.38489,-99.39986)">
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3572"
+ d="M 479.94459,260.47585 L 552.61286,253.37822 L 578.85702,211.7837 L 520.30184,207.69841 L 479.94459,260.47585 z "
+ style="fill:url(#linearGradient3586);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path3574"
+ d="M 498.63903,259.87554 L 530.33009,207.32714 L 479.61735,262.17118 L 498.63903,259.87554 z "
+ style="fill:url(#linearGradient3588);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cssccscc"
+ id="path3576"
+ d="M 615.00464,203.36576 C 615.00464,203.36576 628.86948,217.2306 641.2488,222.6775 C 653.62812,228.1244 670.464,235.05682 676.40607,235.05682 C 685.31918,235.05682 714.0392,233.57131 714.0392,233.57131 L 712.55368,214.25956 C 712.55368,214.25956 711.06817,211.28853 699.6792,210.29818 C 690.2933,209.48201 646.6957,205.34645 646.6957,205.34645 L 615.00464,203.36576 z "
+ style="fill:url(#linearGradient3584);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ </g>
+ <path
+ style="fill:#152032;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 390.10251,166.4033 L 476.23696,157.29966 L 499.3462,113.8823 L 453.828,109.68061 L 438.42183,106.17921 C 438.42183,106.17921 451.72716,102.67781 455.92884,102.67781 C 460.13052,102.67781 531.55909,103.37809 534.36021,103.37809 C 537.16133,103.37809 540.66273,108.28005 544.16413,111.78146 C 547.66553,115.28286 570.0745,126.48734 574.27618,128.58818 C 578.47786,130.68902 598.78598,135.59098 598.78598,135.59098 L 636.60111,134.19042 L 642.90363,175.50695 C 642.90363,175.50695 61 [...]
+ id="path3497"
+ sodipodi:nodetypes="cccccsssscccssc" />
+ <g
+ id="g4507"
+ transform="translate(-139.5572,33.88604)"
+ style="opacity:1;filter:url(#filter4545)">
+ <path
+ sodipodi:nodetypes="csc"
+ id="path4443"
+ d="M 675.55691,139.92646 C 675.55691,139.92646 684.88035,115.82078 714.94388,118.8263 C 740.54587,121.38579 750.11082,143.09149 750.11082,143.09149"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#614d19;stroke-width:5.30000019;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4515);stroke-width:5.30000019;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 675.55691,139.92646 C 675.55691,139.92646 684.88035,115.82078 714.94388,118.8263 C 740.54587,121.38579 750.11082,143.09149 750.11082,143.09149"
+ id="path4445"
+ sodipodi:nodetypes="csc" />
+ <path
+ sodipodi:nodetypes="csc"
+ id="path4455"
+ d="M 675.55691,139.92646 C 675.55691,139.92646 684.88035,115.82078 714.94388,118.8263 C 740.54587,121.38579 750.11082,143.09149 750.11082,143.09149"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#radialGradient4517);stroke-width:5.30000019;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#radialGradient4519);stroke-width:5.30000019;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 675.55691,139.92646 C 675.55691,139.92646 684.88035,115.82078 714.94388,118.8263 C 740.54587,121.38579 750.11082,143.09149 750.11082,143.09149"
+ id="path4467"
+ sodipodi:nodetypes="csc" />
+ <path
+ sodipodi:nodetypes="csc"
+ id="path4471"
+ d="M 675.55691,139.92646 C 675.55691,139.92646 684.88035,115.82078 714.94388,118.8263 C 740.54587,121.38579 750.11082,143.09149 750.11082,143.09149"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#radialGradient4521);stroke-width:5.30000019;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cssc"
+ id="path4477"
+ d="M 674.88444,140.08037 C 674.88444,140.08037 685.6315,120.48122 702.2379,118.9436 C 715.66597,117.70026 723.872,118.9436 734.06738,125.1603 C 744.26276,131.37699 750.72813,142.56704 750.72813,142.56704"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4523);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ </g>
+ <path
+ style="opacity:0.54166667;fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient3169);stroke-width:1.89999998;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ d="M 182.3294,251.12319 C 182.3294,251.12319 178.40082,257.19462 179.47225,259.69462 C 180.54368,262.19462 178.75797,264.69462 191.25797,267.55176 C 209.28868,271.67306 243.04368,275.05176 256.25797,277.55176 C 269.47225,280.05176 305.18654,284.69462 321.61511,280.40891 C 338.04368,276.12319 358.75797,265.76605 389.11511,250.76605 C 419.47225,235.76605 468.75797,217.19462 491.97225,210.40891 C 515.18654,203.62319 540.54368,195.40891 542.68654,194.69462 C 544.8294,193.98034 548.043 [...]
+ id="path2181"
+ sodipodi:nodetypes="cssssssssc" />
+ <path
+ style="fill:#e9f0f1;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3467);stroke-width:1.70000005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ d="M 476.05261,97.31889 C 471.12809,97.3189 447.66032,98.06255 446.27136,98.69389 C 444.88237,99.32524 439.56403,101.62631 438.42761,102.13139 C 437.94686,102.34506 437.09672,104.25333 436.27136,106.38139 C 436.31757,106.35184 436.40958,106.30567 436.42761,106.28764 C 437.1419,105.57336 441.62402,103.81442 443.05261,103.10014 C 444.48118,102.38585 454.83386,101.8412 458.58386,101.66264 C 462.33386,101.48407 500.55705,101.29656 535.02136,102.72514 C 569.48564,104.15371 620.90529,10 [...]
+ id="path2187"
+ sodipodi:nodetypes="csscssssssssssscccssssssssssc" />
+ <path
+ style="fill:#03222f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 649.84568,108.59506 C 649.84568,108.59506 660.22479,107.8211 665.28128,108.33708 C 670.33776,108.85305 684.17659,109.88499 687.90242,110.65895 C 691.62826,111.43291 694.02344,111.94887 695.62023,113.75478 C 700.68323,117.29378 693.08223,114.36435 695.53304,117.24579 C 698.83118,125.87932 711.29692,167.41583 711.29692,167.41583 C 711.29692,167.41583 690.03148,171.80159 681.51528,173.60749 C 672.99909,175.41339 658.89413,178.50922 658.89413,178.50922 C 658.89413,178.50922 655.7 [...]
+ id="path3664"
+ sodipodi:nodetypes="csscccscsssc" />
+ <path
+ style="fill:#213447;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 633.09971,113.53216 L 641.50307,174.80667 C 641.50307,174.80667 649.90643,166.4033 649.20615,163.60218 C 648.50587,160.80106 643.99929,123.45073 642.20335,120.8851 C 639.75237,117.3837 636.60111,114.23244 633.09971,113.53216 z "
+ id="path3499"
+ sodipodi:nodetypes="ccssc" />
+ <path
+ style="fill:#d4f0fc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 649.68256,110.07139 C 649.68256,110.07139 659.53155,109.31377 664.32977,109.81885 C 669.12799,110.32393 682.25998,111.33408 685.79551,112.09169 C 689.33105,112.84931 691.60389,113.35438 693.11912,115.12215 C 694.63435,116.88992 695.6445,117.90007 698.67496,127.74906 C 701.70541,137.59804 711.04933,167.65008 711.04933,167.65008 C 711.04933,167.65008 687.81582,171.94323 679.7346,173.711 C 671.65338,175.47876 658.26885,178.50922 658.26885,178.50922 C 658.26885,178.50922 655.2384 [...]
+ id="path2191" />
+ <path
+ id="path3654"
+ d="M 649.68256,110.07139 C 649.68256,110.07139 659.53155,109.31377 664.32977,109.81885 C 669.12799,110.32393 682.25998,111.33408 685.79551,112.09169 C 689.33105,112.84931 691.60389,113.35438 693.11912,115.12215 C 694.63435,116.88992 695.6445,117.90007 698.67496,127.74906 C 701.70541,137.59804 711.04933,167.65008 711.04933,167.65008 C 711.04933,167.65008 687.81582,171.94323 679.7346,173.711 C 671.65338,175.47876 658.26885,178.50922 658.26885,178.50922 C 658.26885,178.50922 655.2384 [...]
+ style="fill:url(#linearGradient3662);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:#042b3d;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 655.49093,112.34423 C 655.49093,112.34423 684.78536,113.35438 688.06835,114.61707 C 691.35135,115.87976 691.85643,115.37469 693.11912,117.90007 C 694.38181,120.42545 707.51379,167.14501 707.51379,167.14501 L 670.89576,175.22623 L 655.49093,112.34423 z "
+ id="path2193" />
+ <path
+ style="fill:#d1e3ec;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 656.50109,114.36454 C 656.50109,114.36454 672.91607,114.86961 678.97698,115.62723 C 685.0379,116.38484 689.07851,116.38484 690.59374,118.15261 C 692.10896,119.92037 695.89704,135.83028 695.89704,135.83028 L 704.48333,168.15516 L 671.40084,174.72115 L 656.50109,114.36454 z "
+ id="path2195" />
+ <path
+ style="fill:#def3fd;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3499);stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ d="M 649.68256,118.40515 L 652.20794,116.1323 L 653.21809,115.62723 L 667.10769,171.69069 L 656.24855,173.45846 L 650.18763,124.7186 L 649.68256,118.40515 z "
+ id="path2197" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient3275);stroke-width:1.70000005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ d="M 658.04368,178.98034 C 658.04368,178.98034 649.47225,182.90891 647.3294,184.33748 C 645.18654,185.76605 642.3294,188.62319 641.97225,191.12319 C 641.61511,193.62319 645.54368,203.62319 649.8294,210.76605 C 654.11511,217.90891 657.3294,228.62319 657.68654,231.83748 C 658.04368,235.05176 660.90083,267.55176 659.11511,279.33748 C 657.3294,291.12319 651.97225,325.76605 651.97225,325.76605 L 651.97225,325.76605"
+ id="path2199"
+ sodipodi:nodetypes="cssssscc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient3753);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 712.68654,169.69462 C 712.68654,169.69462 729.8294,178.98034 733.04368,185.40891 C 736.25797,191.83748 740.54368,198.26605 740.54368,206.12319 C 740.54368,212.55176 728.79761,256.00431 727.3294,260.40891 C 724.82939,267.90891 721.61511,278.98034 717.3294,283.62319 C 713.04368,288.26605 701.25797,297.19462 696.61511,299.69462 C 691.97225,302.19462 691.97225,302.19462 691.97225,302.19462"
+ id="path2201"
+ sodipodi:nodetypes="csssssc" />
+ <path
+ style="fill:url(#linearGradient3111);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4460)"
+ d="M 469.27625,312.92883 C 469.27625,312.92883 484.07444,303.52998 507.38055,290.93269 C 513.22003,287.77637 513.87426,283.92191 520.68302,280.46154 C 524.00018,278.77568 533.13999,277.56265 536.65229,275.83904 C 561.18893,263.79809 590.208,251.11138 619.80878,241.62395 C 697.05574,216.86531 732.70819,206.96185 737.65991,205.97151 C 742.61164,204.98116 746.78146,196.82656 756.5024,193.8962 C 764.08801,191.60953 762.89339,191.98211 767.63668,186.36439 C 772.6267,180.45444 771.33166 [...]
+ id="path2203"
+ sodipodi:nodetypes="cssssssscsssssssc" />
+ <path
+ style="fill:url(#linearGradient3103);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 767.36511,167.88139 L 767.36511,185.16264 C 767.36509,185.16265 752.51628,194.0882 745.58386,196.06889 C 738.65142,198.04959 729.73503,207.95126 722.80261,211.91264 C 715.87017,215.87401 635.6489,232.72616 578.20886,258.47514 C 564.34913,264.68812 552.04271,270.37643 541.08386,275.53764 C 548.34159,274.79043 555.81727,275.75558 561.45886,280.50639 C 575.03029,291.93496 575.17317,301.47515 579.45886,316.47514 C 583.74458,331.47514 585.58819,366.77301 581.27136,371.85014 C 574. [...]
+ id="path3094" />
+ <path
+ style="opacity:0.60833333;fill:url(#linearGradient3151);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4821)"
+ d="M 77.0773,324.66661 C 77.0773,324.66661 74.27617,333.06997 84.78038,338.67221 C 95.28458,344.27445 183.51987,375.08678 221.335,375.08678 C 259.15013,375.08678 229.73836,336.57137 236.04088,314.86269 C 242.3434,293.154 247.24536,238.53216 291.36301,234.33048 C 335.48066,230.12879 444.02408,221.02515 446.8252,220.32487 C 449.62632,219.62459 521.05489,202.81787 528.75797,197.91591 C 536.46105,193.01395 547.66553,188.81227 504.24817,186.01115 C 460.8308,183.21003 413.91203,181.8094 [...]
+ id="path3115" />
+ <path
+ style="fill:url(#radialGradient3133);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4366)"
+ d="M 122.96554,236.48941 C 122.96554,236.48941 134.22811,237.94806 139.13008,242.14974 C 144.03204,246.35142 144.94638,255.24099 144.94638,259.44267 C 144.94638,263.64435 138.70195,273.54616 138.70195,273.54616 L 131.69914,284.75064 C 131.69914,284.75064 151.30699,268.6442 166.01287,257.43972 C 180.71875,246.23524 222.73556,221.72543 237.44144,214.02235 C 252.14732,206.31927 313.77197,185.31087 322.17534,183.21003 C 330.5787,181.10919 346.68514,179.00835 343.18374,174.80667 C 339. [...]
+ id="path3117"
+ sodipodi:nodetypes="cssccssssssc" />
+ <path
+ style="fill:url(#linearGradient3161);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4350)"
+ d="M 507.83386,188.72514 C 506.22195,188.7192 502.89882,188.94337 496.77136,190.25639 C 486.96742,192.35724 465.04403,198.61152 455.24011,201.41264 C 445.43618,204.21376 387.29395,221.03624 362.08386,224.53764 C 336.87377,228.03903 234.6334,240.30051 204.52136,255.00639 C 174.4093,269.71228 166.02127,286.85583 150.61511,288.25639 C 135.20895,289.65696 131.00998,284.03624 128.20886,287.53764 C 125.40774,291.03903 85.46735,332.38139 79.86511,332.38139 C 79.86511,332.38138 116.98888, [...]
+ id="path3153" />
+ <path
+ sodipodi:nodetypes="cssssssssc"
+ id="path3171"
+ d="M 182.82457,251.12319 C 182.82457,251.12319 178.89599,256.20427 179.96742,258.70427 C 181.03885,261.20427 179.25314,263.70427 191.75314,266.56141 C 209.78385,270.68271 243.53885,274.06141 256.75314,276.56141 C 269.96742,279.06141 305.68171,283.70427 322.11028,279.41856 C 338.53885,275.13284 359.25314,264.7757 389.61028,249.7757 C 419.96742,234.7757 469.25314,216.20427 492.46742,209.41856 C 515.68171,202.63284 541.03885,194.41856 543.18171,193.70427 C 545.32457,192.98999 548.538 [...]
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient3179);stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ id="path3181"
+ d="M 85.34297,330.5012 C 85.34297,330.5012 82.54184,330.15267 93.04605,335.75491 C 103.55025,341.35715 183.51987,375.08678 221.335,375.08678 C 259.15013,375.08678 229.73836,336.57137 236.04088,314.86269 C 242.3434,293.154 247.24536,238.53216 291.36301,234.33048 C 335.48066,230.12879 444.02408,221.02515 446.8252,220.32487 C 449.62632,219.62459 521.05489,202.81787 528.75797,197.91591 C 536.46105,193.01395 547.66553,188.81227 504.24817,186.01115 C 460.8308,183.21003 413.91203,181.809 [...]
+ style="fill:url(#linearGradient3197);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4751)"
+ sodipodi:nodetypes="csssssssssssscssssc" />
+ <path
+ style="fill:url(#linearGradient3207);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 767.36511,167.88139 L 772.45886,172.10014 C 772.45882,181.54952 765.84155,192.71003 757.05261,194.35014 C 750.60033,195.55422 744.50968,200.64154 742.11511,204.16264 C 738.06065,210.12448 730.31408,207.82145 722.80261,210.52864 C 715.29113,213.23581 635.6489,232.72616 578.20886,258.47514 C 564.34913,264.68812 552.04271,270.37643 541.08386,275.53764 C 548.34159,274.79043 555.81727,275.75558 561.45886,280.50639 C 575.03029,291.93496 575.17317,301.47515 579.45886,316.47514 C 583 [...]
+ id="path3199"
+ sodipodi:nodetypes="ccsssscssssccsccsssscccccscccsscsccssscscssc" />
+ <path
+ style="fill:url(#linearGradient3211);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 767.36511,167.88139 L 767.36511,185.16264 C 767.36509,185.16265 754.39128,198.05695 747.45886,200.03764 C 740.52644,202.01835 729.73503,206.22125 722.80261,210.18263 C 715.87017,214.144 635.6489,232.72616 578.20886,258.47514 C 564.34913,264.68812 552.04271,270.37643 541.08386,275.53764 C 548.34159,274.79043 555.81727,275.75558 561.45886,280.50639 C 575.03029,291.93496 575.17317,301.47515 579.45886,316.47514 C 583.74458,331.47514 585.58819,366.77301 581.27136,371.85014 C 574.8 [...]
+ id="path3209"
+ sodipodi:nodetypes="ccssscssssccsccsssscccccscccsscssccssscscsscccc" />
+ <path
+ style="fill:url(#radialGradient3261);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 614.6875,200.25205 C 585.47753,200.39247 534.83704,209.12351 502.09375,218.37705 C 464.40776,229.02744 407.0146,259.70908 388.09375,270.0958 C 393.42073,270.60877 398.79299,272.55329 403.84375,276.7833 C 421.66719,291.71042 422.9936,317.06685 420.28125,329.93955 C 421.18763,328.50687 406.42501,356.99486 407.23833,355.36821 C 414.17075,341.50337 483.44366,312.84599 500.80359,296.37148 C 506.53153,290.93569 520.69762,277.84113 541.56517,274.16946 C 590.617,265.53871 643.01572,2 [...]
+ id="path3213"
+ sodipodi:nodetypes="cscscssssc" />
+ <path
+ style="opacity:1;fill:url(#linearGradient3459);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.70000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
+ d="M 712.07351,127.98197 C 685.12448,102.43142 671.49022,101.21441 630.21331,100.33036 C 624.46699,100.20728 609.46376,98.18674 600.9921,97.69157 C 547.96571,94.59215 454.36816,96.6962 460.69548,95.30056 C 472.55515,92.68464 499.35073,87.973874 552.46516,87.462659 C 604.86596,86.958311 643.94784,90.97476 672.36381,98.30321 C 690.14904,102.88999 712.77453,126.49913 712.07351,127.98197 z "
+ id="path3450"
+ sodipodi:nodetypes="csssssc" />
+ <g
+ id="g4084"
+ transform="translate(-78.38489,-99.39986)">
+ <g
+ transform="translate(44.31034,60.83881)"
+ id="g4835">
+ <g
+ transform="translate(-43.95867,-60.48714)"
+ id="g4803">
+ <path
+ style="fill:#80989b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 585.52954,212.72203 L 604.87136,211.66702 C 604.87136,211.66702 608.96442,211.32535 609.44306,216.59039 C 609.79473,220.45875 608.73972,223.97545 608.73972,223.97545 L 582.36451,223.62378 C 582.36451,223.62378 580.2545,220.81043 581.30951,217.99707 C 582.36451,215.18372 585.17787,212.72203 585.52954,212.72203 z "
+ id="path4805"
+ sodipodi:nodetypes="ccsccsc" />
+ <path
+ style="fill:#ccdbed;fill-opacity:0.72614112;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 583.06785,221.1621 C 584.47453,221.51376 603.46468,221.51376 604.87136,221.51376 C 606.27803,221.51376 606.98137,220.45876 606.98137,219.05208 C 606.98137,217.6454 605.57469,214.12871 603.11301,213.42537 C 600.65132,212.72203 585.88121,213.0737 585.88121,213.0737 C 585.88121,213.0737 583.06785,215.18372 582.71618,216.94206 C 582.36451,218.70041 583.06785,221.1621 583.06785,221.1621 z "
+ id="path4807" />
+ <path
+ sodipodi:nodetypes="ccsccsc"
+ id="path4809"
+ d="M 585.52954,212.72203 L 604.87136,211.66702 C 604.87136,211.66702 608.96442,211.32535 609.44306,216.59039 C 609.79473,220.45875 608.73972,223.97545 608.73972,223.97545 L 582.36451,223.62378 C 582.36451,223.62378 580.2545,220.81043 581.30951,217.99707 C 582.36451,215.18372 585.17787,212.72203 585.52954,212.72203 z "
+ style="fill:url(#linearGradient3501);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ id="path4811"
+ d="M 583.06785,221.1621 C 584.47453,221.51376 603.46468,221.51376 604.87136,221.51376 C 606.27803,221.51376 606.98137,220.45876 606.98137,219.05208 C 606.98137,217.6454 605.57469,214.12871 603.11301,213.42537 C 600.65132,212.72203 585.88121,213.0737 585.88121,213.0737 C 585.88121,213.0737 583.06785,215.18372 582.71618,216.94206 C 582.36451,218.70041 583.06785,221.1621 583.06785,221.1621 z "
+ style="fill:url(#linearGradient3505);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:url(#linearGradient3507);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 585.52954,212.72203 L 604.87136,211.66702 C 604.87136,211.66702 608.96442,211.32535 609.44306,216.59039 C 609.79473,220.45875 608.73972,223.97545 608.73972,223.97545 L 582.36451,223.62378 C 582.36451,223.62378 580.2545,220.81043 581.30951,217.99707 C 582.36451,215.18372 585.17787,212.72203 585.52954,212.72203 z "
+ id="path4813"
+ sodipodi:nodetypes="ccsccsc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#1f3157;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 592.56293,208.502 C 592.56293,208.502 590.10124,211.31535 591.85959,213.42537 C 593.61793,215.53539 597.83797,214.83205 597.83797,214.83205"
+ id="path4815" />
+ <path
+ id="path4817"
+ d="M 592.56293,208.502 C 592.56293,208.502 590.10124,211.31535 591.85959,213.42537 C 593.61793,215.53539 597.83797,214.83205 597.83797,214.83205"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#radialGradient3509);stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#radialGradient3511);stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 592.56293,208.502 C 592.56293,208.502 590.10124,211.31535 591.85959,213.42537 C 593.61793,215.53539 597.83797,214.83205 597.83797,214.83205"
+ id="path4819" />
+ </g>
+ <path
+ id="path4821"
+ d="M 539.10918,160.32329 L 562.31936,160.67496 L 564.78105,163.83998 C 564.78105,163.83998 559.15434,162.78497 556.34098,162.4333 C 553.52763,162.08163 540.51586,163.13664 540.51586,163.13664 C 540.51586,163.13664 535.59249,163.48831 539.10918,160.32329 z "
+ style="fill:url(#linearGradient3513);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ </g>
+ <g
+ style="opacity:0.87083333;filter:url(#filter4080)"
+ id="g3171"
+ transform="translate(44.31034,60.83881)">
+ <g
+ id="g3173"
+ transform="translate(-43.95867,-60.48714)">
+ <path
+ sodipodi:nodetypes="ccsccsc"
+ id="path3175"
+ d="M 585.52954,212.72203 L 604.87136,211.66702 C 604.87136,211.66702 608.96442,211.32535 609.44306,216.59039 C 609.79473,220.45875 608.73972,223.97545 608.73972,223.97545 L 582.36451,223.62378 C 582.36451,223.62378 580.2545,220.81043 581.30951,217.99707 C 582.36451,215.18372 585.17787,212.72203 585.52954,212.72203 z "
+ style="fill:#80989b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ id="path3177"
+ d="M 583.06785,221.1621 C 584.47453,221.51376 603.46468,221.51376 604.87136,221.51376 C 606.27803,221.51376 606.98137,220.45876 606.98137,219.05208 C 606.98137,217.6454 605.57469,214.12871 603.11301,213.42537 C 600.65132,212.72203 585.88121,213.0737 585.88121,213.0737 C 585.88121,213.0737 583.06785,215.18372 582.71618,216.94206 C 582.36451,218.70041 583.06785,221.1621 583.06785,221.1621 z "
+ style="fill:#ccdbed;fill-opacity:0.72614112;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:url(#linearGradient4823);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 585.52954,212.72203 L 604.87136,211.66702 C 604.87136,211.66702 608.96442,211.32535 609.44306,216.59039 C 609.79473,220.45875 608.73972,223.97545 608.73972,223.97545 L 582.36451,223.62378 C 582.36451,223.62378 580.2545,220.81043 581.30951,217.99707 C 582.36451,215.18372 585.17787,212.72203 585.52954,212.72203 z "
+ id="path3179"
+ sodipodi:nodetypes="ccsccsc" />
+ <path
+ style="fill:url(#linearGradient4825);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 583.06785,221.1621 C 584.47453,221.51376 603.46468,221.51376 604.87136,221.51376 C 606.27803,221.51376 606.98137,220.45876 606.98137,219.05208 C 606.98137,217.6454 605.57469,214.12871 603.11301,213.42537 C 600.65132,212.72203 585.88121,213.0737 585.88121,213.0737 C 585.88121,213.0737 583.06785,215.18372 582.71618,216.94206 C 582.36451,218.70041 583.06785,221.1621 583.06785,221.1621 z "
+ id="path3182" />
+ <path
+ sodipodi:nodetypes="ccsccsc"
+ id="path3184"
+ d="M 585.52954,212.72203 L 604.87136,211.66702 C 604.87136,211.66702 608.96442,211.32535 609.44306,216.59039 C 609.79473,220.45875 608.73972,223.97545 608.73972,223.97545 L 582.36451,223.62378 C 582.36451,223.62378 580.2545,220.81043 581.30951,217.99707 C 582.36451,215.18372 585.17787,212.72203 585.52954,212.72203 z "
+ style="fill:url(#linearGradient4827);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ id="path3186"
+ d="M 592.56293,208.502 C 592.56293,208.502 590.10124,211.31535 591.85959,213.42537 C 593.61793,215.53539 597.83797,214.83205 597.83797,214.83205"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#1f3157;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#radialGradient4829);stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 592.56293,208.502 C 592.56293,208.502 590.10124,211.31535 591.85959,213.42537 C 593.61793,215.53539 597.83797,214.83205 597.83797,214.83205"
+ id="path3188" />
+ <path
+ id="path3190"
+ d="M 592.56293,208.502 C 592.56293,208.502 590.10124,211.31535 591.85959,213.42537 C 593.61793,215.53539 597.83797,214.83205 597.83797,214.83205"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#radialGradient4831);stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ <path
+ style="fill:url(#linearGradient4833);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 539.10918,160.32329 L 562.31936,160.67496 L 564.78105,163.83998 C 564.78105,163.83998 559.15434,162.78497 556.34098,162.4333 C 553.52763,162.08163 540.51586,163.13664 540.51586,163.13664 C 540.51586,163.13664 535.59249,163.48831 539.10918,160.32329 z "
+ id="path3193" />
+ </g>
+ </g>
+ <path
+ sodipodi:nodetypes="csscssssssssssscccssssssssssc"
+ id="path3469"
+ d="M 476.05261,97.31889 C 471.12809,97.3189 447.66032,98.06255 446.27136,98.69389 C 444.88237,99.32524 439.56403,101.62631 438.42761,102.13139 C 437.94686,102.34506 437.09672,104.25333 436.27136,106.38139 C 436.31757,106.35184 436.40958,106.30567 436.42761,106.28764 C 437.1419,105.57336 441.62402,103.81442 443.05261,103.10014 C 444.48118,102.38585 454.83386,101.8412 458.58386,101.66264 C 462.33386,101.48407 500.55705,101.29656 535.02136,102.72514 C 569.48564,104.15371 620.90529,10 [...]
+ style="fill:url(#linearGradient3477);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.70000005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#linearGradient3481);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.70000005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ d="M 476.05261,97.31889 C 471.12809,97.3189 447.66032,98.06255 446.27136,98.69389 C 444.88237,99.32524 439.56403,101.62631 438.42761,102.13139 C 437.94686,102.34506 437.09672,104.25333 436.27136,106.38139 C 436.31757,106.35184 436.40958,106.30567 436.42761,106.28764 C 437.1419,105.57336 441.62402,103.81442 443.05261,103.10014 C 444.48118,102.38585 454.83386,101.8412 458.58386,101.66264 C 462.33386,101.48407 500.55705,101.29656 535.02136,102.72514 C 569.48564,104.15371 620.90529,10 [...]
+ id="path3479"
+ sodipodi:nodetypes="csscssssssssssscccssssssssssc" />
+ <path
+ sodipodi:nodetypes="csscssssssssssscccssssssssssc"
+ id="path3483"
+ d="M 476.05261,97.31889 C 471.12809,97.3189 447.66032,98.06255 446.27136,98.69389 C 444.88237,99.32524 439.56403,101.62631 438.42761,102.13139 C 437.94686,102.34506 437.09672,104.25333 436.27136,106.38139 C 436.31757,106.35184 436.40958,106.30567 436.42761,106.28764 C 437.1419,105.57336 441.62402,103.81442 443.05261,103.10014 C 444.48118,102.38585 454.83386,101.8412 458.58386,101.66264 C 462.33386,101.48407 500.55705,101.29656 535.02136,102.72514 C 569.48564,104.15371 620.90529,10 [...]
+ style="fill:url(#linearGradient3485);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.70000005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#radialGradient3495);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.70000005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ d="M 476.05261,97.31889 C 471.12809,97.3189 447.66032,98.06255 446.27136,98.69389 C 444.88237,99.32524 439.56403,101.62631 438.42761,102.13139 C 437.94686,102.34506 437.09672,104.25333 436.27136,106.38139 C 436.31757,106.35184 436.40958,106.30567 436.42761,106.28764 C 437.1419,105.57336 441.62402,103.81442 443.05261,103.10014 C 444.48118,102.38585 454.83386,101.8412 458.58386,101.66264 C 462.33386,101.48407 500.55705,101.29656 535.02136,102.72514 C 569.48564,104.15371 620.90529,10 [...]
+ id="path3487"
+ sodipodi:nodetypes="csscssssssssssscccssssssssssc" />
+ <path
+ style="fill:url(#linearGradient3509);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 552.56749,123.68622 C 552.56749,123.68622 572.87562,134.19042 582.67954,136.29126 C 592.48346,138.3921 637.30139,139.79266 637.30139,139.79266 L 638.00167,162.20162 L 633.79999,169.20443 L 549.76637,163.60219 L 521.05489,150.99714 C 521.05489,150.99714 553.96805,132.08958 552.56749,123.68622 z "
+ id="path3501"
+ sodipodi:nodetypes="cscccccc" />
+ <path
+ style="fill:#152032;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 426.19621,159.42526 L 456.89693,109.41281 L 452.93554,109.41281 L 420.25414,160.91078 L 426.19621,159.42526 z "
+ id="path3512" />
+ <path
+ style="fill:url(#linearGradient3522);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 440.06105,106.44177 C 440.06105,106.44177 453.43072,109.41281 461.84865,109.90798 C 470.26659,110.40315 502.948,107.92729 508.3949,107.92729 C 513.8418,107.92729 536.61975,104.95625 536.61975,104.95625 C 536.61975,104.95625 498.49144,102.48039 493.53971,102.48039 C 488.58799,102.48039 451.9452,102.48039 446.99347,103.96591 C 442.04174,105.45142 439.0707,106.93694 440.06105,106.44177 z "
+ id="path3514" />
+ <path
+ style="fill:#334d77;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 399.95205,166.85285 L 476.20867,157.93974 L 496.51075,124.26799 L 503.93834,111.88867 L 499.97696,111.88867 L 474.22797,154.47353 L 422.23483,159.42526 L 454.97631,109.35273 L 452.15031,109.2077 L 420.25414,159.42526 L 399.95205,166.85285 z "
+ id="path3524"
+ sodipodi:nodetypes="ccccccccccc" />
+ <path
+ style="fill:url(#linearGradient3532);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 467.27136,101.53764 C 462.62292,101.55717 459.52136,101.618 458.58386,101.66264 C 454.83386,101.8412 444.48118,102.38585 443.05261,103.10014 C 441.62402,103.81442 437.1419,105.57336 436.42761,106.28764 C 436.32802,106.38723 435.71045,106.70057 434.83386,107.13139 C 433.95757,108.28139 433.04746,109.46011 431.95886,110.41264 C 429.10172,112.91264 384.11511,160.75638 384.11511,160.75639 L 381.86511,161.56889 C 381.73455,161.73474 381.63862,161.86237 381.61511,161.85014 C 381.61 [...]
+ id="path2189" />
+ <path
+ id="path3534"
+ d="M 467.27136,101.53764 C 462.62292,101.55717 459.52136,101.618 458.58386,101.66264 C 454.83386,101.8412 444.48118,102.38585 443.05261,103.10014 C 441.62402,103.81442 437.1419,105.57336 436.42761,106.28764 C 436.32802,106.38723 435.71045,106.70057 434.83386,107.13139 C 433.95757,108.28139 433.04746,109.46011 431.95886,110.41264 C 429.10172,112.91264 384.11511,160.75638 384.11511,160.75639 L 381.86511,161.56889 C 381.73455,161.73474 381.63862,161.86237 381.61511,161.85014 C 381.61 [...]
+ style="fill:url(#linearGradient3542);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#linearGradient3546);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 467.27136,101.53764 C 462.62292,101.55717 459.52136,101.618 458.58386,101.66264 C 454.83386,101.8412 444.48118,102.38585 443.05261,103.10014 C 441.62402,103.81442 437.1419,105.57336 436.42761,106.28764 C 436.32802,106.38723 435.71045,106.70057 434.83386,107.13139 C 433.95757,108.28139 433.04746,109.46011 431.95886,110.41264 C 429.10172,112.91264 384.11511,160.75638 384.11511,160.75639 L 381.86511,161.56889 C 381.73455,161.73474 381.63862,161.86237 381.61511,161.85014 C 381.61 [...]
+ id="path3544" />
+ <path
+ id="path3548"
+ d="M 467.27136,101.53764 C 462.62292,101.55717 459.52136,101.618 458.58386,101.66264 C 454.83386,101.8412 444.48118,102.38585 443.05261,103.10014 C 441.62402,103.81442 437.1419,105.57336 436.42761,106.28764 C 436.32802,106.38723 435.71045,106.70057 434.83386,107.13139 C 433.95757,108.28139 433.04746,109.46011 431.95886,110.41264 C 429.10172,112.91264 384.11511,160.75638 384.11511,160.75639 L 381.86511,161.56889 C 381.73455,161.73474 381.63862,161.86237 381.61511,161.85014 C 381.61 [...]
+ style="fill:url(#linearGradient3550);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#linearGradient3560);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 467.27136,101.53764 C 462.62292,101.55717 459.52136,101.618 458.58386,101.66264 C 454.83386,101.8412 444.48118,102.38585 443.05261,103.10014 C 441.62402,103.81442 437.1419,105.57336 436.42761,106.28764 C 436.32802,106.38723 435.71045,106.70057 434.83386,107.13139 C 433.95757,108.28139 433.04746,109.46011 431.95886,110.41264 C 429.10172,112.91264 384.11511,160.75638 384.11511,160.75639 L 381.86511,161.56889 C 381.73455,161.73474 381.63862,161.86237 381.61511,161.85014 C 381.61 [...]
+ id="path3552" />
+ <path
+ sodipodi:nodetypes="cssssscc"
+ id="path3277"
+ d="M 658.04368,178.98034 C 658.04368,178.98034 649.47225,182.90891 647.3294,184.33748 C 645.18654,185.76605 642.3294,188.62319 641.97225,191.12319 C 641.61511,193.62319 645.54368,203.62319 649.8294,210.76605 C 654.11511,217.90891 657.3294,228.62319 657.68654,231.83748 C 658.04368,235.05176 660.90083,267.55176 659.11511,279.33748 C 657.3294,291.12319 651.97225,325.76605 651.97225,325.76605 L 651.97225,325.76605"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient3285);stroke-width:1.70000005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#linearGradient3616);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 438.07169,105.82907 C 438.07169,105.82907 443.23003,108.571 449.91867,109.41945 C 463.00238,111.0791 481.18051,111.08118 486.74116,111.08118 C 495.14452,111.08118 534.36021,110.3809 534.36021,110.3809 C 534.36021,110.3809 576.37702,108.28005 598.78598,111.08118 C 621.19494,113.8823 637.65153,115.98314 637.65153,115.98314 C 637.65153,115.98314 641.50307,111.08118 605.78878,108.28005 C 568.55121,105.35945 515.45265,102.67781 515.45265,102.67781 C 515.45265,102.67781 480.45962,1 [...]
+ id="path3595"
+ sodipodi:nodetypes="csscscscsc" />
+ <path
+ style="fill:url(#linearGradient3674);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 660.76077,134.19042 C 660.76077,134.19042 683.36911,134.11971 687.72156,130.68902 C 690.53986,128.46758 687.02128,123.68622 688.61777,117.61954 L 691.22296,117.3837 C 691.22296,117.3837 693.3238,126.1372 696.8252,139.44252 C 700.3266,152.74784 704.17814,167.80386 704.17814,167.80386 L 671.61511,174.80667 L 660.76077,134.19042 z "
+ id="path3666"
+ sodipodi:nodetypes="csccsccc" />
+ <path
+ style="opacity:0.11666667;fill:#03222f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 662.51147,137.69182 C 662.51147,137.69182 690.87282,136.29126 692.97366,135.59098 C 695.0745,134.8907 695.77478,134.19042 695.77478,134.19042 L 690.52268,118.08398 L 687.02128,116.33328 C 687.02128,116.33328 690.52268,129.6386 689.12212,130.33888 C 687.72156,131.03916 676.16693,133.84028 672.31539,134.19042 C 668.46385,134.54056 661.11091,134.8907 661.11091,134.8907 L 662.51147,137.69182 z "
+ id="path3676" />
+ <path
+ style="fill:#a0bcc8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 543.11511,111.06889 L 556.42761,120.88139 C 556.42761,120.88139 577.41273,131.72444 583.36511,133.47514 C 589.31749,135.22584 606.14783,136.63778 618.05261,136.28764 C 622.19129,136.16591 628.98737,136.19777 636.11511,136.25639 L 635.80261,133.10014 C 622.12541,133.15379 607.96506,133.29681 600.52136,133.13139 C 584.76506,132.78125 579.16905,130.6896 569.36511,125.78764 C 559.56119,120.88568 543.11511,111.06889 543.11511,111.06889 z M 689.83386,129.97514 C 689.83386,129.97514 [...]
+ id="path3678"
+ sodipodi:nodetypes="ccssccssccsccssc" />
+ <path
+ style="fill:#264c5f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 667.76357,171.30526 L 653.75797,115.98314 C 653.75797,115.98314 652.70755,115.28286 650.60671,117.03356 C 648.50587,118.78426 652.70755,115.98314 653.05769,117.3837 C 653.40783,118.78426 665.66273,171.6554 665.66273,171.6554 L 667.76357,171.30526 z "
+ id="path3683" />
+ <path
+ style="fill:#264c5f;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 656.90923,175.15681 L 667.76357,173.05597 L 668.11371,174.80667 L 657.60951,176.90751 L 656.90923,175.15681 z "
+ id="path3685" />
+ <path
+ style="fill:#172f3b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 652.70755,112.1316 C 652.70755,112.1316 648.15573,112.1316 648.15573,114.58258 C 648.15573,117.03356 651.30699,114.58258 652.70755,112.1316 z "
+ id="path3687"
+ sodipodi:nodetypes="csc" />
+ <path
+ id="path3689"
+ d="M 649.68256,118.40515 L 652.20794,116.1323 L 653.21809,115.62723 L 667.10769,171.69069 L 656.24855,173.45846 L 650.18763,124.7186 L 649.68256,118.40515 z "
+ style="opacity:0.3875;fill:url(#linearGradient3697);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3644);stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ style="opacity:1;fill:url(#linearGradient3707);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ d="M 649.68256,118.40515 L 652.20794,116.1323 L 653.21809,115.62723 L 667.10769,171.69069 L 656.24855,173.45846 L 650.18763,124.7186 L 649.68256,118.40515 z "
+ id="path3699" />
+ <path
+ sodipodi:nodetypes="cscssc"
+ id="path3721"
+ d="M 692.50259,112.07391 C 692.50259,112.07391 706.5906,150.62246 708.02968,155.8991 C 710.13052,163.60218 712.93164,169.20442 712.93164,169.20442 C 712.93164,169.20442 715.73585,162.66523 720.41989,158.45832 C 723.84629,155.38095 729.25526,154.20269 730.43864,154.49854 C 733.23976,155.19882 705.80791,119.77699 692.50259,112.07391 z "
+ style="fill:url(#linearGradient3723);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:url(#radialGradient3743);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 712.06814,169.57826 C 712.06814,169.57826 727.40592,175.64919 731.6076,182.65199 C 735.80928,189.65479 750.54161,175.15406 749.14105,170.25209 C 747.74049,165.35013 740.95961,155.40054 731.85597,155.40054 C 722.75233,155.40054 722.22417,154.26209 719.42305,159.16405 C 716.62193,164.06601 712.06814,170.27854 712.06814,169.57826 z "
+ id="path3731"
+ sodipodi:nodetypes="cssssc" />
+ <path
+ style="opacity:0.79166667;fill:url(#linearGradient3517);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 697.23858,115.21807 C 697.23858,115.21807 706.5906,150.62246 708.02968,155.8991 C 710.13052,163.60218 712.93164,169.20442 712.93164,169.20442 C 712.93164,169.20442 715.73585,162.66523 720.41989,158.45832 C 723.84629,155.38095 729.21948,154.53816 730.43864,154.49854 C 734.454,154.36805 716.63765,121.75926 700.08106,113.72383 C 698.59643,113.00329 699.44656,117.80124 697.23858,115.21807 z "
+ id="path3711"
+ sodipodi:nodetypes="cscsssc" />
+ <path
+ style="fill:#e5c645;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 77.20423,326.22315 C 77.20423,326.22315 79.63531,338.86476 92.76314,342.7545 C 99.86383,344.8584 73.3145,336.43368 73.3145,336.43368 L 72.34207,325.73693 C 72.34207,325.73693 73.80072,327.19558 77.20423,326.22315 z "
+ id="path3557"
+ sodipodi:nodetypes="csccc" />
+ <path
+ style="opacity:1;fill:url(#linearGradient3945);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 561.31306,384.71243 C 565.54041,384.96109 567.52975,383.96642 570.6381,383.59342 L 615.14964,357.98064 C 615.14964,357.98064 691.49066,312.47442 702.43204,306.00906 C 713.37343,299.5437 730.9045,284.74796 730.9045,284.74796 C 730.9045,284.74796 727.79616,282.13695 730.28284,273.68225 C 732.76951,265.22754 729.7855,266.71955 729.7855,266.71955 C 729.7855,266.71955 649.21713,310.98242 633.30239,319.93446 C 617.38765,328.8865 587.05018,347.28792 585.06083,348.77993 C 583.07149,3 [...]
+ id="path3929"
+ sodipodi:nodetypes="cccscscssssc" />
+ <path
+ style="fill:url(#linearGradient4564);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4630)"
+ d="M 539.30596,119.5082 C 539.30596,119.5082 567.15675,136.41761 576.10879,137.41229 C 585.06083,138.40696 588.04485,154.3217 601.97024,157.30571 C 615.89564,160.28972 641.75709,166.25775 641.75709,166.25775 C 641.75709,166.25775 641.75709,174.21512 636.78374,175.20979 C 631.81038,176.20446 601.97024,175.20979 601.97024,175.20979 L 472.66298,170.23644 L 496.53509,139.40163 C 496.53509,139.40163 536.32194,123.48689 539.30596,119.5082 z "
+ id="path4556" />
+ <path
+ style="opacity:0.70869565;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter5024);enable-background:accumulate"
+ id="path4998"
+ d="M 736.09507,205.60157 C 736.79278,205.09537 737.60759,204.79539 738.38676,204.44153 C 739.50744,203.95078 740.36152,203.1358 741.11694,202.1969 C 741.83412,201.24426 742.40859,200.19916 742.96376,199.14736 C 743.38184,198.23698 744.03664,197.47275 744.69644,196.7303 C 745.40704,196.0272 745.91388,195.16408 746.53805,194.39225 C 747.86298,193.58447 749.69671,193.79463 751.1471,194.24552 C 751.92493,194.8317 755.11259,195.04991 752.06492,194.95888 C 752.94704,194.78289 753.73127, [...]
+ sodipodi:nodetypes="ccccccccsccccccsssccccccccccscccccccccccsccccsccccsccscccccccccsccscsccccccccccccccccscccccccscccsssccccccsccccccscc" />
+ <path
+ style="opacity:0.55217393;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter5054);enable-background:accumulate"
+ id="path5028"
+ d="M 645.77192,232.47071 C 648.43629,231.29231 651.16491,230.27266 653.89379,229.25653 C 655.86508,228.55601 657.80686,227.78494 659.72914,226.96062 C 672.62582,225.94771 658.86314,229.91311 665.25727,226.11105 C 667.07187,224.92043 668.55113,223.32554 670.06179,221.78735 C 670.97791,218.87694 676.91508,218.56 674.64499,222.18089 C 674.90817,222.1022 675.70486,221.99354 675.43452,221.94482 C 668.05345,220.61479 678.94125,221.36516 679.36684,221.41089 C 682.12303,221.81219 676.5462 [...]
+ sodipodi:nodetypes="ccccccscscsscccccscsccccccccccsscccccssccccccccccscccccccccccccscccccsscccccccc" />
+ <path
+ style="opacity:0.43043482;fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 658.16565,179.52978 C 652.76055,181.64482 649.06782,183.11037 646.53266,185.03049 C 643.9975,186.95061 642.6934,188.88886 642.50141,190.93674 C 642.30517,193.02992 643.26845,196.72726 644.59516,200.53049 C 645.92187,204.33372 647.62609,208.1663 649.15766,210.24924 L 649.26811,209.88951 C 647.87446,207.99415 646.26076,204.00034 645.06462,200.21799 C 643.86957,196.43907 643.34661,192.68159 643.50141,191.03049 C 643.66044,189.33409 644.71796,187.66715 647.12641,185.84299 C 649.5 [...]
+ id="path5139"
+ sodipodi:nodetypes="csssccssscc" />
+ <path
+ style="fill:url(#linearGradient5303);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 537.5146,181.69442 C 538.8384,181.69442 607.01427,185.99678 629.18797,182.68727 C 600.39525,192.28484 516.00279,208.50144 516.00279,208.50144 C 516.00279,208.50144 533.21223,202.87527 538.50745,198.24196 C 543.80266,193.60865 545.78837,190.29914 535.52889,191.62294 C 525.26941,192.94675 500.11715,193.60865 513.35518,191.62294 C 526.59322,189.63724 537.18364,182.68727 537.5146,181.69442 z "
+ id="path5282" />
+ <path
+ style="opacity:0.79166667;color:black;fill:url(#linearGradient5059);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 699.43135,113.57383 C 689.93508,101.48759 666.14349,95.49917 640.53886,92.290302 C 615.08503,89.100332 634.73426,107.6483 639.93421,108.01109 C 645.13417,108.37388 658.31544,108.13202 658.31544,108.13202 C 658.31544,108.13202 681.89662,108.8576 688.4268,110.67153 C 694.95697,112.48547 697.73834,115.5087 697.73834,115.5087 C 700.00483,116.99144 699.67399,115.22751 699.43135,113.57383 z "
+ id="path4387"
+ sodipodi:nodetypes="csscscc" />
+ <path
+ sodipodi:nodetypes="csscscc"
+ id="path4389"
+ d="M 699.43135,113.57383 C 689.93508,101.48759 666.14349,95.49917 640.53886,92.290302 C 615.08503,89.100332 641.69127,118.63299 644.38072,114.1678 C 647.87048,108.37388 658.31544,108.13202 658.31544,108.13202 C 658.31544,108.13202 681.89662,108.8576 688.4268,110.67153 C 694.95697,112.48547 697.73834,115.5087 697.73834,115.5087 C 700.00483,116.99144 699.67399,115.22751 699.43135,113.57383 z "
+ style="opacity:0.12999998;color:black;fill:url(#radialGradient4405);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer4"
+ inkscape:label="headlamps"
+ style="opacity:1;display:inline">
+ <path
+ sodipodi:nodetypes="csssssssssc"
+ id="path3300"
+ d="M 106.42385,245.70477 C 106.42385,245.70477 115.22986,237.61304 121.30129,236.54161 C 127.37272,235.47019 135.54368,236.48034 139.11511,240.76605 C 142.68654,245.05176 147.55656,253.67395 144.8294,261.12319 C 140.20106,273.76552 118.38288,294.99049 105.58701,306.41906 C 93.34277,317.35496 84.8294,322.90891 81.25797,324.33748 C 77.68654,325.76605 75.8575,327.40383 73.71464,325.61811 C 71.57179,323.8324 72.93908,309.1716 74.11511,302.55176 C 75.08489,297.09289 81.28335,279.39876 [...]
+ style="fill:url(#radialGradient3308);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3290);stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#radialGradient3260);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 103.21678,253.53386 C 106.13408,250.85967 107.34962,246.24062 111.23935,243.80954 C 115.12907,241.37846 118.04637,237.24562 125.33961,237.97495 C 132.63285,238.70427 139.43987,243.32332 140.1692,247.69927 C 140.89852,252.07521 141.14163,261.0702 140.41231,263.01507 C 139.68298,264.95993 115.12907,291.94492 113.18421,293.40357 C 111.23935,294.86222 98.84084,304.34343 94.22179,302.64167 C 89.60274,300.93992 91.06138,271.03763 97.13908,262.52885 C 103.21678,254.02007 103.45989,2 [...]
+ id="path3252" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;color:black;fill:url(#radialGradient3468);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ id="path3460"
+ sodipodi:cx="173.96616"
+ sodipodi:cy="382.58182"
+ sodipodi:rx="4.1256795"
+ sodipodi:ry="18.737461"
+ d="M 178.09184 382.58182 A 4.1256795 18.737461 0 1 1 169.84048,382.58182 A 4.1256795 18.737461 0 1 1 178.09184 382.58182 z"
+ transform="matrix(0.879978,0.475015,-0.475015,0.879978,120.2732,-136.2899)" />
+ <path
+ style="opacity:0.57916667;fill:#131001;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 302.40301,329.76471 C 302.40301,329.76471 290.02369,350.0668 286.55748,359.97025 C 283.09127,369.87371 288.043,373.83509 291.01403,375.81578 C 293.98507,377.79647 304.3837,383.73855 322.20992,383.24337 C 340.03614,382.7482 356.04874,380.09321 356.04874,380.09321 L 387.07756,369.87371 C 387.07756,369.87371 345.48304,385.71924 323.69544,381.75786 C 301.90783,377.79647 286.55748,375.32061 288.043,362.44612 C 289.52851,349.57162 303.88853,329.76471 302.40301,329.76471 z "
+ id="path4174"
+ sodipodi:nodetypes="csssccssc" />
+ <path
+ sodipodi:nodetypes="cssssssss"
+ id="path3997"
+ d="M 351.94009,283.81763 C 358.00101,279.52448 383.50736,260.33158 403.71041,277.25163 C 423.91346,294.17169 422.90331,324.47627 418.8627,334.83033 C 414.82209,345.18439 404.9731,360.58922 389.31574,368.67044 C 373.65837,376.75166 348.90964,381.80242 338.30304,382.3075 C 327.69643,382.81257 310.52384,382.3075 301.93754,379.52958 C 293.35125,376.75166 285.27003,369.68059 287.29033,360.58922 C 289.31064,351.49785 299.6543,334.82251 304.21039,328.76941 C 321.88806,305.28336 345.87918 [...]
+ style="fill:url(#radialGradient3999);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#radialGradient3995);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 351.94009,283.81763 C 358.00101,279.52448 383.50736,260.33158 403.71041,277.25163 C 423.91346,294.17169 422.90331,324.47627 418.8627,334.83033 C 414.82209,345.18439 404.9731,360.58922 389.31574,368.67044 C 373.65837,376.75166 348.90964,381.80242 338.30304,382.3075 C 327.69643,382.81257 310.52384,382.3075 301.93754,379.52958 C 293.35125,376.75166 285.27003,369.68059 287.29033,360.58922 C 289.31064,351.49785 299.6543,334.82251 304.21039,328.76941 C 321.88806,305.28336 345.87918 [...]
+ id="path3987"
+ sodipodi:nodetypes="cssssssss" />
+ <path
+ style="fill:#f8ffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 383.95886,270.41264 C 369.4521,270.87246 356.09449,280.86734 351.92761,283.81889 C 345.8667,288.11203 321.88653,305.27033 304.20886,328.75639 C 299.65277,334.80949 289.32291,351.50878 287.30261,360.60014 C 285.28231,369.69151 293.34133,376.75972 301.92761,379.53764 C 310.51391,382.31556 327.696,382.82395 338.30261,382.31889 C 348.90921,381.81381 373.64525,376.74385 389.30261,368.66264 C 404.95997,360.58142 414.8245,345.17295 418.86511,334.81889 C 422.90572,324.46483 423.9119, [...]
+ id="path2185" />
+ <path
+ sodipodi:nodetypes="cssssssss"
+ id="path4203"
+ d="M 351.94009,283.81763 C 358.00101,279.52448 383.50736,260.33158 403.71041,277.25163 C 423.91346,294.17169 422.90331,324.47627 418.8627,334.83033 C 414.82209,345.18439 404.9731,360.58922 389.31574,368.67044 C 373.65837,376.75166 348.90964,381.80242 338.30304,382.3075 C 327.69643,382.81257 310.52384,382.3075 301.93754,379.52958 C 293.35125,376.75166 285.27003,369.68059 287.29033,360.58922 C 289.31064,351.49785 299.6543,334.82251 304.21039,328.76941 C 321.88806,305.28336 345.87918 [...]
+ style="fill:url(#radialGradient4213);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.79166667;fill:#acb7cd;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ id="path3764"
+ sodipodi:cx="465.95761"
+ sodipodi:cy="412.08112"
+ sodipodi:rx="25.253813"
+ sodipodi:ry="31.443474"
+ d="M 491.21142 412.08112 A 25.253813 31.443474 0 1 1 440.7038,412.08112 A 25.253813 31.443474 0 1 1 491.21142 412.08112 z"
+ transform="matrix(1.050635,-0.131427,0.137809,1.10165,-158.4362,-79.05712)" />
+ <path
+ transform="matrix(1.050635,-0.131427,0.137809,1.10165,-158.4362,-79.05712)"
+ d="M 491.21142 412.08112 A 25.253813 31.443474 0 1 1 440.7038,412.08112 A 25.253813 31.443474 0 1 1 491.21142 412.08112 z"
+ sodipodi:ry="31.443474"
+ sodipodi:rx="25.253813"
+ sodipodi:cy="412.08112"
+ sodipodi:cx="465.95761"
+ id="path3796"
+ style="opacity:0.79166667;fill:url(#radialGradient3798);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(1.050635,-0.131427,0.137809,1.10165,-158.4362,-79.05712)"
+ d="M 491.21142 412.08112 A 25.253813 31.443474 0 1 1 440.7038,412.08112 A 25.253813 31.443474 0 1 1 491.21142 412.08112 z"
+ sodipodi:ry="31.443474"
+ sodipodi:rx="25.253813"
+ sodipodi:cy="412.08112"
+ sodipodi:cx="465.95761"
+ id="path3780"
+ style="opacity:0.79166667;fill:url(#radialGradient3790);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ sodipodi:type="arc" />
+ <path
+ style="opacity:0.79166667;fill:url(#radialGradient3794);fill-opacity:1;fill-rule:nonzero;stroke:url(#radialGradient4007);stroke-width:1.79009581;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ d="M 414.46159,310.70331 C 416.8535,329.82442 407.83149,346.36158 392.23625,348.31243 C 376.64103,350.26328 364.17083,336.41465 361.77892,317.29354 C 359.387,298.17242 367.97467,280.98387 383.56989,279.03302 C 399.16513,277.08217 412.06967,291.58219 414.46159,310.70331 z "
+ id="path3792"
+ sodipodi:nodetypes="csssc" />
+ <path
+ transform="matrix(0.97281,-0.121692,0.118261,0.945388,-114.1181,-19.20057)"
+ d="M 491.21142 412.08112 A 25.253813 31.443474 0 1 1 440.7038,412.08112 A 25.253813 31.443474 0 1 1 491.21142 412.08112 z"
+ sodipodi:ry="31.443474"
+ sodipodi:rx="25.253813"
+ sodipodi:cy="412.08112"
+ sodipodi:cx="465.95761"
+ id="path3766"
+ style="opacity:0.79166667;fill:#acb7cd;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.86666667;fill:url(#radialGradient3808);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ id="path3800"
+ sodipodi:cx="465.95761"
+ sodipodi:cy="412.08112"
+ sodipodi:rx="25.253813"
+ sodipodi:ry="31.443474"
+ d="M 491.21142 412.08112 A 25.253813 31.443474 0 1 1 440.7038,412.08112 A 25.253813 31.443474 0 1 1 491.21142 412.08112 z"
+ transform="matrix(0.97281,-0.121692,0.118261,0.945388,-114.1181,-19.20057)" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.79166667;fill:#8eacb3;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ id="path3768"
+ sodipodi:cx="465.95761"
+ sodipodi:cy="412.08112"
+ sodipodi:rx="25.253813"
+ sodipodi:ry="31.443474"
+ d="M 491.21142 412.08112 A 25.253813 31.443474 0 1 1 440.7038,412.08112 A 25.253813 31.443474 0 1 1 491.21142 412.08112 z"
+ transform="matrix(0.875529,-0.109522,0.110442,0.882883,-66.12,0.456372)" />
+ <path
+ transform="matrix(0.875529,-0.109522,0.110442,0.882883,-66.12,0.456372)"
+ d="M 491.21142 412.08112 A 25.253813 31.443474 0 1 1 440.7038,412.08112 A 25.253813 31.443474 0 1 1 491.21142 412.08112 z"
+ sodipodi:ry="31.443474"
+ sodipodi:rx="25.253813"
+ sodipodi:cy="412.08112"
+ sodipodi:cx="465.95761"
+ id="path3831"
+ style="opacity:0.79166667;fill:url(#radialGradient3839);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ sodipodi:type="arc" />
+ <path
+ style="opacity:0.79166667;fill:#b3a28e;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ d="M 383.88365,285.47595 C 372.49266,286.90088 364.45651,298.91747 364.99413,312.97075 C 372.99869,313.61886 385.41925,314.21928 391.97939,312.42951 C 396.49933,311.19635 402.82028,308.32969 408.4715,305.54795 C 404.98218,292.82911 394.73612,284.11838 383.88365,285.47595 z "
+ id="path3818" />
+ <path
+ id="path3841"
+ d="M 383.88365,285.47595 C 372.49266,286.90088 364.45651,298.91747 364.99413,312.97075 C 372.99869,313.61886 385.41925,314.21928 391.97939,312.42951 C 396.49933,311.19635 402.82028,308.32969 408.4715,305.54795 C 404.98218,292.82911 394.73612,284.11838 383.88365,285.47595 z "
+ style="opacity:1;fill:url(#radialGradient3857);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.60000002;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline" />
+ <path
+ id="path4066"
+ d="M 383.95886,270.41264 C 369.4521,270.87246 356.09449,280.86734 351.92761,283.81889 C 345.8667,288.11203 321.88653,305.27033 304.20886,328.75639 C 299.65277,334.80949 289.32291,351.50878 287.30261,360.60014 C 285.28231,369.69151 293.34133,376.75972 301.92761,379.53764 C 310.51391,382.31556 327.696,382.82395 338.30261,382.31889 C 348.90921,381.81381 373.64525,376.74385 389.30261,368.66264 C 404.95997,360.58142 414.8245,345.17295 418.86511,334.81889 C 422.90572,324.46483 423.9119, [...]
+ style="fill:url(#linearGradient4074);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#radialGradient4084);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 383.95886,270.41264 C 369.4521,270.87246 356.09449,280.86734 351.92761,283.81889 C 345.8667,288.11203 321.88653,305.27033 304.20886,328.75639 C 299.65277,334.80949 289.32291,351.50878 287.30261,360.60014 C 285.28231,369.69151 293.34133,376.75972 301.92761,379.53764 C 310.51391,382.31556 327.696,382.82395 338.30261,382.31889 C 348.90921,381.81381 373.64525,376.74385 389.30261,368.66264 C 404.95997,360.58142 414.8245,345.17295 418.86511,334.81889 C 422.90572,324.46483 423.9119, [...]
+ id="path4076" />
+ <path
+ id="path4086"
+ d="M 383.95886,270.41264 C 369.4521,270.87246 356.09449,280.86734 351.92761,283.81889 C 345.8667,288.11203 321.88653,305.27033 304.20886,328.75639 C 299.65277,334.80949 289.32291,351.50878 287.30261,360.60014 C 285.28231,369.69151 293.34133,376.75972 301.92761,379.53764 C 310.51391,382.31556 327.696,382.82395 338.30261,382.31889 C 348.90921,381.81381 373.64525,376.74385 389.30261,368.66264 C 404.95997,360.58142 414.8245,345.17295 418.86511,334.81889 C 422.90572,324.46483 423.9119, [...]
+ style="fill:url(#radialGradient4088);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#radialGradient4092);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 383.95886,270.41264 C 369.4521,270.87246 356.09449,280.86734 351.92761,283.81889 C 345.8667,288.11203 321.88653,305.27033 304.20886,328.75639 C 299.65277,334.80949 289.32291,351.50878 287.30261,360.60014 C 285.28231,369.69151 293.34133,376.75972 301.92761,379.53764 C 310.51391,382.31556 327.696,382.82395 338.30261,382.31889 C 348.90921,381.81381 373.64525,376.74385 389.30261,368.66264 C 404.95997,360.58142 414.8245,345.17295 418.86511,334.81889 C 422.90572,324.46483 423.9119, [...]
+ id="path4090" />
+ <path
+ style="opacity:0.625;fill:url(#radialGradient4106);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 384.65914,271.8132 C 370.15238,272.27302 356.09449,280.86734 351.92761,283.81889 C 345.8667,288.11203 321.88653,305.27033 304.20886,328.75639 C 299.65277,334.80949 289.32291,351.50878 287.30261,360.60014 C 285.28231,369.69151 293.34133,376.75972 301.92761,379.53764 C 310.51391,382.31556 327.696,382.82395 338.30261,382.31889 C 348.90921,381.81381 373.64525,376.74385 389.30261,368.66264 C 404.95997,360.58142 414.8245,345.17295 418.86511,334.81889 C 422.90572,324.46483 423.9119, [...]
+ id="path4098"
+ sodipodi:nodetypes="cssssssssc" />
+ <path
+ style="fill:url(#radialGradient4158);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 392.52446,366.90267 C 392.52446,366.90267 408.36999,355.01852 411.34103,349.57162 C 414.31206,344.12472 421.73966,328.27919 421.73966,322.33712 C 421.73966,316.39504 423.72035,305.99642 421.24448,307.97711 C 418.76862,309.9578 418.76862,313.91918 418.76862,317.38539 C 418.76862,320.8516 414.80724,334.71644 414.80724,337.68748 C 414.80724,340.65851 406.88447,352.04749 404.40861,354.52335 C 401.93274,356.99922 394.00998,360.9606 391.03894,363.93163 C 388.0679,366.90267 379.6499 [...]
+ id="path4150" />
+ <path
+ style="fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 359.12613,283.0889 C 359.12613,283.0889 368.64532,275.41069 378.13432,273.47514 C 382.01577,272.68341 392.85204,276.09311 394.80981,277.12802 C 397.48165,278.5404 403.90057,285.97147 405.62046,287.75245 C 407.34035,289.53344 410.59608,295.61358 410.59608,295.61358 C 410.59608,295.61358 400.58337,279.39998 388.79076,276.8829 C 376.99816,274.36581 367.26366,278.32821 359.12613,283.0889 z "
+ id="path4160"
+ sodipodi:nodetypes="cssscsc" />
+ <path
+ style="opacity:0.55;fill:url(#radialGradient4172);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 351.94009,283.81763 C 358.00101,279.52448 383.50736,260.33158 403.71041,277.25163 C 423.91346,294.17169 422.90331,324.47627 418.8627,334.83033 C 414.82209,345.18439 404.9731,360.58922 389.31574,368.67044 C 373.65837,376.75166 348.90964,381.80242 338.30304,382.3075 C 327.69643,382.81257 310.52384,382.3075 301.93754,379.52958 C 293.35125,376.75166 285.27003,369.68059 287.29033,360.58922 C 289.31064,351.49785 299.6543,334.82251 304.21039,328.76941 C 321.88806,305.28336 345.87918 [...]
+ id="path4164"
+ sodipodi:nodetypes="cssssssss" />
+ <path
+ style="opacity:0.52916721;fill:#2e221c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 362.99724,302.0669 C 362.99724,302.0669 368.00159,288.21654 375.92437,285.72836 C 383.84715,283.24018 390.81814,283.11671 395.42481,286.03367 C 401.64411,289.97177 405.2524,292.78882 407.61748,297.7328 C 409.98254,302.67678 413.20774,310.50736 412.7475,314.80671 C 412.28725,319.10606 412.9617,306.54588 409.5523,299.23738 C 406.32107,292.31083 396.80646,283.11616 390.29608,282.93249 C 383.78568,282.74884 376.13913,283.45585 373.8668,285.2372 C 371.59447,287.01855 364.56255,292 [...]
+ id="path3812"
+ sodipodi:nodetypes="csssssssc" />
+ <path
+ style="fill:#97705c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 397.05779,344.96469 C 397.05779,344.96469 408.84967,339.49735 411.797,331.14414 C 414.74433,322.79095 415.45006,316.46476 415.45006,316.46476 C 415.45006,316.46476 414.89872,332.00373 410.07785,337.34759 C 405.25697,342.69145 397.08853,345.21036 397.05779,344.96469 z "
+ id="path3814"
+ sodipodi:nodetypes="cscsc" />
+ <path
+ style="opacity:0.5;fill:url(#radialGradient3875);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 401.99849,306.66973 C 401.99849,306.66973 396.96104,294.32505 388.6082,295.36993 C 380.25536,296.41481 373.00777,294.32723 370.7358,300.10079 C 368.46385,305.87435 367.78884,312.44621 367.78884,312.44621 C 367.78884,312.44621 373.74679,316.19219 377.06327,314.77927 C 380.37974,313.36633 380.37901,305.38192 384.8011,304.82874 C 389.2232,304.27557 395.24224,304.52069 395.24224,304.52069 L 401.99849,306.66973 z "
+ id="path3859" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.5;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3985);stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path3977"
+ sodipodi:cx="466.45279"
+ sodipodi:cy="412.82385"
+ sodipodi:rx="21.787603"
+ sodipodi:ry="27.234505"
+ d="M 488.24039 412.82385 A 21.787603 27.234505 0 1 1 444.66519,412.82385 A 21.787603 27.234505 0 1 1 488.24039 412.82385 z"
+ transform="matrix(0.992267,-0.124125,0.124125,0.992267,-126.706,-38.24411)" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:url(#radialGradient4028);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4012"
+ sodipodi:cx="465.46246"
+ sodipodi:cy="413.31903"
+ sodipodi:rx="14.360012"
+ sodipodi:ry="17.826221"
+ d="M 479.82248 413.31903 A 14.360012 17.826221 0 1 1 451.10245,413.31903 A 14.360012 17.826221 0 1 1 479.82248 413.31903 z"
+ transform="matrix(0.992267,-0.124125,0.124125,0.992267,-125.7233,-38.36704)" />
+ <path
+ d="M 479.82248 413.31903 A 14.360012 17.826221 0 1 1 451.10245,413.31903 A 14.360012 17.826221 0 1 1 479.82248 413.31903 z"
+ sodipodi:ry="17.826221"
+ sodipodi:rx="14.360012"
+ sodipodi:cy="413.31903"
+ sodipodi:cx="465.46246"
+ id="path4030"
+ style="opacity:0.45;fill:url(#radialGradient4032);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc"
+ transform="matrix(1.197564,-0.149807,0.158605,1.267896,-232.8913,-143.1619)" />
+ <path
+ transform="matrix(-1.097867,0.501287,-0.530727,-1.162345,1116.898,561.6833)"
+ sodipodi:type="arc"
+ style="opacity:0.45;fill:url(#radialGradient4036);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4034"
+ sodipodi:cx="465.46246"
+ sodipodi:cy="413.31903"
+ sodipodi:rx="14.360012"
+ sodipodi:ry="17.826221"
+ d="M 479.82248 413.31903 A 14.360012 17.826221 0 1 1 451.10245,413.31903 A 14.360012 17.826221 0 1 1 479.82248 413.31903 z" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.86666667;fill:url(#radialGradient4046);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4038"
+ sodipodi:cx="466.94797"
+ sodipodi:cy="413.81421"
+ sodipodi:rx="8.4179382"
+ sodipodi:ry="4.9517283"
+ d="M 475.36591 413.81421 A 8.4179382 4.9517283 0 1 1 458.53003,413.81421 A 8.4179382 4.9517283 0 1 1 475.36591 413.81421 z"
+ transform="matrix(0.992267,-0.124125,0.124125,0.992267,-125.7233,-38.36704)" />
+ <path
+ d="M 475.36591 413.81421 A 8.4179382 4.9517283 0 1 1 458.53003,413.81421 A 8.4179382 4.9517283 0 1 1 475.36591 413.81421 z"
+ sodipodi:ry="4.9517283"
+ sodipodi:rx="8.4179382"
+ sodipodi:cy="413.81421"
+ sodipodi:cx="466.94797"
+ id="path4048"
+ style="opacity:0.86666667;fill:url(#radialGradient4050);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc"
+ transform="matrix(0.875529,-0.109522,8.688782e-2,0.694587,-65.81522,73.76134)" />
+ <path
+ transform="matrix(0.563477,-0.679,0.538673,0.447025,-113.9995,430.5144)"
+ sodipodi:type="arc"
+ style="opacity:0.41666667;fill:url(#radialGradient4054);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4052"
+ sodipodi:cx="466.94797"
+ sodipodi:cy="413.81421"
+ sodipodi:rx="8.4179382"
+ sodipodi:ry="4.9517283"
+ d="M 475.36591 413.81421 A 8.4179382 4.9517283 0 1 1 458.53003,413.81421 A 8.4179382 4.9517283 0 1 1 475.36591 413.81421 z"
+ inkscape:transform-center-y="5.6332985"
+ inkscape:transform-center-x="-0.70447809" />
+ <path
+ inkscape:transform-center-y="5.6332579"
+ d="M 475.36591 413.81421 A 8.4179382 4.9517283 0 1 1 458.53003,413.81421 A 8.4179382 4.9517283 0 1 1 475.36591 413.81421 z"
+ sodipodi:ry="4.9517283"
+ sodipodi:rx="8.4179382"
+ sodipodi:cy="413.81421"
+ sodipodi:cx="466.94797"
+ id="path4056"
+ style="opacity:0.41666667;fill:url(#radialGradient4058);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc"
+ transform="matrix(0.563477,-0.679,0.538673,0.447025,-116.0256,438.2533)"
+ inkscape:transform-center-x="-0.70447743" />
+ <path
+ transform="matrix(0.563477,-0.679,0.538673,0.447025,-116.0256,438.2533)"
+ sodipodi:type="arc"
+ style="opacity:0.41666667;fill:#bcb37c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4060"
+ sodipodi:cx="466.94797"
+ sodipodi:cy="413.81421"
+ sodipodi:rx="8.4179382"
+ sodipodi:ry="4.9517283"
+ d="M 475.36591 413.81421 A 8.4179382 4.9517283 0 1 1 458.53003,413.81421 A 8.4179382 4.9517283 0 1 1 475.36591 413.81421 z"
+ inkscape:transform-center-y="5.6332579"
+ inkscape:transform-center-x="-0.70447743" />
+ <path
+ inkscape:transform-center-y="5.6332665"
+ d="M 475.36591 413.81421 A 8.4179382 4.9517283 0 1 1 458.53003,413.81421 A 8.4179382 4.9517283 0 1 1 475.36591 413.81421 z"
+ sodipodi:ry="4.9517283"
+ sodipodi:rx="8.4179382"
+ sodipodi:cy="413.81421"
+ sodipodi:cx="466.94797"
+ id="path4062"
+ style="opacity:0.41666667;fill:#bcb37c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc"
+ transform="matrix(0.563477,-0.679,0.538673,0.447025,-83.77881,460.6682)"
+ inkscape:transform-center-x="-0.70447601" />
+ <path
+ transform="matrix(-0.133299,-1.102194,0.803897,0.434273,105.2602,651.2804)"
+ sodipodi:type="arc"
+ style="opacity:0.41666667;fill:#bcb37c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3.0999999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4064"
+ sodipodi:cx="466.94797"
+ sodipodi:cy="413.81421"
+ sodipodi:rx="8.4179382"
+ sodipodi:ry="4.9517283"
+ d="M 475.36591 413.81421 A 8.4179382 4.9517283 0 1 1 458.53003,413.81421 A 8.4179382 4.9517283 0 1 1 475.36591 413.81421 z"
+ inkscape:transform-center-y="7.4209309"
+ inkscape:transform-center-x="-5.3407733" />
+ <path
+ style="fill:#fdfbf9;fill-opacity:0.46058092;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 295.47059,360.46543 C 327.16165,331.7454 342.01683,319.86125 342.01683,319.86125 L 352.91063,307.97711 C 352.91063,307.97711 346.47339,309.9578 343.00718,314.90953 C 339.54097,319.86125 330.62786,327.78402 327.16165,330.25988 C 323.69544,332.73575 303.39335,351.55231 303.39335,351.55231 L 295.47059,360.46543 z "
+ id="path4108" />
+ <path
+ style="fill:#fdfbf9;fill-opacity:0.46058092;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 324.19061,326.79367 C 331.6182,322.83229 339.0458,314.90953 341.52166,312.92883 C 343.99752,310.94814 350.92994,301.53986 350.92994,301.53986 L 356.37684,294.60744 C 356.37684,294.60744 348.94925,303.52055 346.47339,305.99642 C 343.99752,308.47228 337.0651,314.90953 334.58924,315.89987 C 332.11338,316.89022 325.67613,325.30815 324.19061,326.79367 z "
+ id="path4110" />
+ <path
+ style="fill:#fdfbf9;fill-opacity:0.46058092;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 290.51886,358.48473 C 290.51886,358.48473 298.44162,356.00887 303.88853,348.58128 C 309.33543,341.15369 309.33543,338.67782 313.29681,335.21161 C 317.25819,331.7454 321.21957,327.28885 321.21957,327.28885 L 325.18096,321.84195 C 325.18096,321.84195 320.22923,321.84195 317.75336,325.30815 C 315.2775,328.77436 310.82094,333.72609 309.33543,336.69713 C 307.84991,339.66817 309.33543,340.16334 304.3837,345.11507 C 299.43197,350.0668 295.96576,355.5137 295.96576,355.5137 L 290.5188 [...]
+ id="path4112" />
+ <path
+ style="fill:#fdfbf9;fill-opacity:0.46058092;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 295.96576,367.89302 C 295.96576,367.89302 305.37404,356.50404 307.84991,354.52335 C 310.32577,352.54266 310.82094,349.57162 316.26785,346.60059 C 321.71475,343.62955 328.15199,336.20196 328.15199,336.20196 L 335.08441,330.75506 L 344.4927,323.32746 C 344.4927,323.32746 349.44442,317.38539 351.42512,316.39504 C 353.40581,315.4047 354.39615,313.42401 356.37684,312.43366 C 358.35754,311.44332 354.89133,315.4047 354.89133,315.4047 C 354.89133,315.4047 347.46373,319.36608 346.4733 [...]
+ id="path4114" />
+ <path
+ style="fill:#fdfbf9;fill-opacity:0.46058092;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 380.68488,291.86978 C 380.68488,291.86978 384.67635,283.885 380.07024,286.95635 C 375.46412,290.02771 375.21899,296.04675 371.16569,299.54799 C 367.11237,303.04921 363.42748,305.5063 363.42748,305.5063 L 380.68488,291.86978 z "
+ id="path4116" />
+ <path
+ style="fill:#fdfbf9;fill-opacity:0.46058092;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 358.20564,291.68758 L 368.278,288.43147 C 368.278,288.43147 367.47897,282.04402 369.75129,280.26267 C 372.02362,278.48132 365.69835,287.75611 365.69835,287.75611 L 362.07492,290.70453 L 358.20564,291.68758 z "
+ id="path4118" />
+ <path
+ style="fill:#fdfbf9;fill-opacity:0.46058092;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 298.44162,370.86405 C 300.91749,369.87371 332.60855,353.03783 332.60855,353.03783 L 354.39615,342.14403 L 349.44442,337.68748 C 349.44442,337.68748 343.00718,342.6392 337.0651,346.60059 C 331.12303,350.56197 319.73406,358.48473 316.76302,360.9606 C 313.79198,363.43646 298.44162,371.8544 298.44162,370.86405 z "
+ id="path4120" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#radialGradient4130);stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 292.99472,366.4075 C 292.99472,366.4075 289.03334,351.05714 308.34508,327.78402 C 327.65682,304.5109 343.99752,291.14123 351.92029,287.17985 C 359.84305,283.21847 371.7272,274.30535 376.67893,273.31501 C 381.63066,272.32466 393.01963,275.79087 393.01963,275.79087"
+ id="path4122" />
+ <path
+ style="fill:url(#radialGradient4140);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 295.96576,367.89302 C 295.96576,367.89302 310.82094,330.25988 321.21957,320.8516 C 331.6182,311.44332 369.74651,277.77156 369.74651,277.77156 C 369.74651,277.77156 343.99752,292.13158 332.11338,303.52055 C 320.22923,314.90953 304.87887,332.24057 298.44162,346.60059 C 292.00438,360.9606 296.46093,368.88336 295.96576,367.89302 z "
+ id="path4132" />
+ <path
+ style="fill:#483317;fill-opacity:0.85477181;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 414.80723,327.78402 C 414.80723,327.78402 416.02381,345.50861 385.59204,364.92198 C 356.87202,383.24337 317.75336,376.80613 317.75336,376.80613 C 317.75336,376.80613 353.11786,382.79082 392.52446,358.48473 C 413.92323,345.28592 409.36033,339.17299 414.80723,327.78402 z "
+ id="path4142"
+ sodipodi:nodetypes="cscsc" />
+ <path
+ style="fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 355.88167,376.06337 C 355.88167,376.06337 382.12583,370.86405 395.99067,357.2468 C 409.85551,343.62955 412.33137,338.92541 414.31206,329.51712 C 416.29276,320.10884 416.78793,343.62955 398.96171,356.75163 C 381.13549,369.87371 373.21272,371.8544 355.88167,376.06337 z "
+ id="path4162" />
+ <path
+ sodipodi:nodetypes="csssssssc"
+ id="path4177"
+ d="M 413.16511,324.44077 C 413.16511,324.44077 409.83182,338.78529 402.25841,342.19189 C 394.68501,345.59851 387.7774,346.54455 382.85843,344.19215 C 376.21749,341.01625 372.30171,338.64514 369.3692,334.01514 C 366.4367,329.38514 362.30913,321.99035 362.25829,317.66673 C 362.20748,313.34312 363.02137,325.89503 367.2702,332.74964 C 371.29699,339.24602 381.83108,347.25244 388.31757,346.6658 C 394.80409,346.07915 402.3136,344.47386 404.3596,342.43657 C 406.4056,340.39929 412.72439,33 [...]
+ style="opacity:0.68333333;fill:#2e221c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="opacity:0.70833333;fill:url(#radialGradient4187);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 395.97981,310.41682 C 395.97981,310.41682 395.61103,307.46875 391.18893,308.02193 C 386.76684,308.5751 382.0378,310.66376 382.0378,310.66376 C 382.0378,310.66376 380.01133,314.41049 377.0018,314.28792 C 373.99228,314.16536 366.99018,310.05095 366.99018,310.05095 C 366.99018,310.05095 365.88493,313.1834 367.60482,314.96438 C 369.32469,316.74537 376.94071,317.78878 378.90608,317.54293 C 380.87145,317.29708 386.70611,316.06817 386.70611,316.06817 C 386.70611,316.06817 390.39173, [...]
+ id="path4179" />
+ <path
+ style="fill:url(#linearGradient3142);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 113.18421,246.96994 C 113.18421,246.96994 118.28948,241.62157 121.20677,241.37846 C 124.12407,241.13535 131.40933,240.55479 135.55015,247.45616 C 139.92609,254.7494 140.89852,262.28574 140.89852,262.28574 C 140.89852,262.28574 134.57771,274.44114 127.04137,281.97749 C 119.50502,289.51384 117.80326,292.18803 117.80326,292.18803 C 117.80326,292.18803 107.34962,281.99851 107.34962,269.33588 C 107.34962,256.69426 108.56516,252.31831 113.18421,246.96994 z "
+ id="path2243"
+ sodipodi:nodetypes="csscscsc" />
+ <path
+ style="opacity:0.40251573;color:black;fill:url(#radialGradient3399);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ d="M 114.83444,274.07109 C 114.83444,288.87403 129.97843,285.76051 100.73836,298.82516 C 92.24803,302.6187 92.1432,292.3121 92.1432,277.50916 C 92.1432,262.70622 100.37806,253.44269 109.67734,253.44269 C 118.97662,253.44269 114.83444,259.26815 114.83444,274.07109 z "
+ id="path3390"
+ sodipodi:nodetypes="csssc" />
+ <path
+ style="fill:url(#linearGradient3150);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 119.99123,288.78452 C 119.99123,288.78452 111.48245,282.2206 110.51002,271.03763 C 109.53759,259.85466 110.26691,252.31832 113.67043,248.6717 C 117.07394,245.02508 125.82582,242.35089 131.66042,249.15791 C 137.49501,255.96493 140.1692,263.9875 140.1692,263.9875 C 140.1692,263.9875 126.79826,283.92236 119.99123,288.78452 z "
+ id="path2245"
+ sodipodi:nodetypes="cssscc" />
+ <path
+ style="fill:url(#radialGradient3182);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 112.45489,253.53386 C 114.64398,248.55899 119.67932,248.01827 124.61029,248.91481 C 129.95866,249.88724 133.60528,255.47872 135.79325,259.61155 C 137.98122,263.74439 137.49501,267.87723 137.49501,267.87723 L 120.96367,288.78452 C 120.96367,288.78452 112.00988,281.20019 110.75313,270.30831 C 110.02381,263.9875 110.3454,258.32783 112.45489,253.53386 z "
+ id="path2247"
+ sodipodi:nodetypes="cssccss" />
+ <path
+ style="fill:url(#radialGradient3166);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 120.92761,248.56889 C 117.32855,248.57594 114.10068,249.80649 112.45886,253.53764 C 110.35634,258.31577 110.02013,263.96083 110.74011,270.25639 C 115.00395,268.58078 124.00609,265.57752 129.95886,267.38139 C 132.44981,268.13622 134.44713,268.91701 136.08386,269.63139 L 137.49011,267.88139 C 137.49011,267.88139 137.99057,263.73298 135.80261,259.60014 C 133.61464,255.46731 129.96348,249.88507 124.61511,248.91264 C 123.38237,248.6885 122.1273,248.56654 120.92761,248.56889 z "
+ id="path3152" />
+ <path
+ style="opacity:0.71698112;color:black;fill:url(#radialGradient3208);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ d="M 135.74765,261.98393 C 135.74765,269.85985 130.76597,266.04137 124.02874,266.04137 C 117.2915,266.04137 111.33738,269.85985 111.33738,261.98393 C 111.33738,254.10801 116.80528,247.71596 123.54252,247.71596 C 130.27975,247.71596 135.74765,254.10801 135.74765,261.98393 z "
+ id="path3192"
+ sodipodi:nodetypes="csssc" />
+ <path
+ id="path3210"
+ d="M 120.92761,248.56889 C 117.32855,248.57594 114.10068,249.80649 112.45886,253.53764 C 110.35634,258.31577 110.02013,263.96083 110.74011,270.25639 C 115.00395,268.58078 124.00609,265.57752 129.95886,267.38139 C 132.44981,268.13622 134.44713,268.91701 136.08386,269.63139 L 137.49011,267.88139 C 137.49011,267.88139 137.99057,263.73298 135.80261,259.60014 C 133.61464,255.46731 129.96348,249.88507 124.61511,248.91264 C 123.38237,248.6885 122.1273,248.56654 120.92761,248.56889 z "
+ style="fill:url(#radialGradient3218);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="opacity:0.67924529;fill:#583916;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 110.02381,258.15291 C 110.02381,258.15291 110.99624,250.85967 113.67043,248.91481 C 116.34461,246.96994 120.96367,242.594 126.79826,245.7544 C 132.63285,248.91481 136.76569,255.96494 138.22433,260.09777 C 139.68298,264.23061 136.76569,252.80453 133.11907,249.15791 C 129.47245,245.51129 123.63785,242.594 120.23434,243.80954 C 116.83083,245.02508 109.53759,247.69927 110.02381,258.15291 z "
+ id="path3222" />
+ <path
+ style="fill:url(#linearGradient3232);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 111.23935,249.15791 C 112.69799,247.21305 117.31705,241.86467 120.72056,241.13535 C 124.12407,240.40603 130.68799,241.13535 133.84839,244.53886 C 137.00879,247.94237 143.08649,260.34088 140.41231,259.85466 C 137.73812,259.36845 136.27947,255.72183 135.30704,253.29075 C 134.33461,250.85967 132.63285,247.21305 129.71555,245.51129 C 126.79826,243.80954 125.58272,242.83711 121.44988,243.56643 C 117.31705,244.29575 111.23935,248.91481 111.23935,249.15791 z "
+ id="path3224" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;color:black;fill:url(#radialGradient3242);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ id="path3234"
+ sodipodi:cx="164.46255"
+ sodipodi:cy="330.81088"
+ sodipodi:rx="8.1441183"
+ sodipodi:ry="0.97243196"
+ d="M 172.60667 330.81088 A 8.1441183 0.97243196 0 1 1 156.31844,330.81088 A 8.1441183 0.97243196 0 1 1 172.60667 330.81088 z"
+ transform="matrix(0.537313,0,0,1,33.32501,-87.00135)" />
+ <path
+ transform="matrix(0.502762,0.189566,-0.352804,0.935697,161.3102,-95.69029)"
+ d="M 172.60667 330.81088 A 8.1441183 0.97243196 0 1 1 156.31844,330.81088 A 8.1441183 0.97243196 0 1 1 172.60667 330.81088 z"
+ sodipodi:ry="0.97243196"
+ sodipodi:rx="8.1441183"
+ sodipodi:cy="330.81088"
+ sodipodi:cx="164.46255"
+ id="path3244"
+ style="opacity:1;color:black;fill:url(#radialGradient3246);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;color:black;fill:url(#radialGradient3250);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ id="path3248"
+ sodipodi:cx="164.46255"
+ sodipodi:cy="330.81088"
+ sodipodi:rx="8.1441183"
+ sodipodi:ry="0.97243196"
+ d="M 172.60667 330.81088 A 8.1441183 0.97243196 0 1 1 156.31844,330.81088 A 8.1441183 0.97243196 0 1 1 172.60667 330.81088 z"
+ transform="matrix(0.391988,0.367492,-0.683944,0.729535,292.7195,-54.32051)" />
+ <path
+ style="fill:url(#linearGradient3272);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 111.48245,252.80453 C 113.42732,250.61656 112.9411,247.94237 117.80326,246.48373 C 122.66542,245.02508 125.58272,244.29575 129.47245,247.69927 C 133.36217,251.10278 135.55015,254.50629 136.27947,256.69426 C 137.00879,258.88223 137.98123,264.71682 137.98123,264.71682 C 137.98123,264.71682 133.11907,251.10278 126.31204,249.88724 C 119.50502,248.6717 116.10151,248.42859 111.48245,252.80453 z "
+ id="path3263" />
+ <path
+ style="fill:url(#linearGradient3282);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 112.69799,252.80453 C 112.69799,252.80453 114.48848,249.66908 118.65414,248.79325 C 122.34744,248.01673 127.52658,249.30911 129.594,250.85967 C 133.48373,253.77696 135.84244,259.02053 136.15792,260.21932 C 136.76569,262.52885 137.73812,267.1479 137.73812,267.1479 C 137.73812,267.1479 134.45616,254.50629 129.594,252.07521 C 124.73184,249.64413 121.20677,248.79325 118.77569,249.27947 C 116.34461,249.76568 114.76442,250.61656 112.69799,252.80453 z "
+ id="path3274"
+ sodipodi:nodetypes="cssscssc" />
+ <path
+ style="opacity:0.67295598;fill:url(#radialGradient3298);fill-opacity:1;fill-rule:evenodd;stroke:#abbcd1;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ d="M 106.08004,246.04857 C 106.08004,246.04857 114.88605,237.95684 120.95748,236.88541 C 127.02891,235.81399 135.19987,236.82414 138.7713,241.10985 C 142.34273,245.39556 147.21275,254.01775 144.48559,261.46699 C 139.85725,274.10932 118.03907,295.33429 105.2432,306.76286 C 92.99896,317.69876 84.48559,323.25271 80.91416,324.68128 C 77.34273,326.10985 75.51369,327.74763 73.37083,325.96191 C 71.22798,324.1762 72.59527,309.5154 73.7713,302.89556 C 74.74108,297.43669 80.93954,279.74256 [...]
+ id="path2183"
+ sodipodi:nodetypes="csssssssssc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.67295598;color:black;fill:url(#radialGradient3318);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ id="path3310"
+ sodipodi:cx="201.12688"
+ sodipodi:cy="364.18817"
+ sodipodi:rx="9.9703922"
+ sodipodi:ry="9.9703922"
+ d="M 211.09727 364.18817 A 9.9703922 9.9703922 0 1 1 191.15648,364.18817 A 9.9703922 9.9703922 0 1 1 211.09727 364.18817 z"
+ transform="matrix(1,0,0,1.448276,-77.00966,-262.3129)" />
+ <path
+ transform="matrix(0.724138,0,0,1.048752,-20.15116,-118.7314)"
+ d="M 211.09727 364.18817 A 9.9703922 9.9703922 0 1 1 191.15648,364.18817 A 9.9703922 9.9703922 0 1 1 211.09727 364.18817 z"
+ sodipodi:ry="9.9703922"
+ sodipodi:rx="9.9703922"
+ sodipodi:cy="364.18817"
+ sodipodi:cx="201.12688"
+ id="path3320"
+ style="opacity:0.67295598;color:black;fill:url(#radialGradient3322);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.67295598;color:black;fill:url(#linearGradient3407);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ id="path3324"
+ sodipodi:cx="207.65919"
+ sodipodi:cy="367.28241"
+ sodipodi:rx="2.750453"
+ sodipodi:ry="2.750453"
+ d="M 210.40965 367.28241 A 2.750453 2.750453 0 1 1 204.90874,367.28241 A 2.750453 2.750453 0 1 1 210.40965 367.28241 z"
+ transform="matrix(0.646447,0,0,1,-3.99385,-99.88607)" />
+ <path
+ style="opacity:0.84905659;fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient3334);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 122.42231,267.87723 C 122.42231,267.87723 131.1742,266.9048 135.55014,269.33587"
+ id="path3326" />
+ <path
+ transform="matrix(0.641448,-8.024053e-2,0.124125,0.992267,213.93,-33.81471)"
+ d="M 210.40965 367.28241 A 2.750453 2.750453 0 1 1 204.90874,367.28241 A 2.750453 2.750453 0 1 1 210.40965 367.28241 z"
+ sodipodi:ry="2.750453"
+ sodipodi:rx="2.750453"
+ sodipodi:cy="367.28241"
+ sodipodi:cx="207.65919"
+ id="path3336"
+ style="opacity:0.67295598;color:black;fill:url(#linearGradient3352);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.40000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ style="fill:url(#linearGradient3388);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 78.39093,319.10975 C 78.39093,319.10975 81.48519,295.04328 85.61087,287.13573 C 89.73655,279.22818 95.92507,269.60159 98.67552,262.72546 C 101.42597,255.84933 101.76978,253.09888 101.76978,253.09888 C 101.76978,253.09888 88.01752,266.50734 84.92326,272.35205 C 81.829,278.19676 74.89694,292.74018 73.23383,306.0451 C 71.8586,317.04691 73.23383,322.20401 73.23383,322.20401 L 78.39093,319.10975 z "
+ id="path3354"
+ sodipodi:nodetypes="csscsscc" />
+ <path
+ sodipodi:nodetypes="csscsscc"
+ id="path3372"
+ d="M 79.07854,319.45356 C 79.07854,319.45356 82.1728,295.38709 86.29848,287.47954 C 90.42416,279.57199 96.61268,269.9454 99.36313,263.06927 C 102.11358,256.19314 102.45739,253.44269 102.45739,253.44269 C 102.45739,253.44269 88.70513,266.85115 85.61087,272.69586 C 82.51661,278.54057 75.58455,293.08399 73.92144,306.38891 C 72.54621,317.39072 73.92144,322.54782 73.92144,322.54782 L 79.07854,319.45356 z "
+ style="opacity:0.40251573;fill:url(#linearGradient3380);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="opacity:0.7106918;fill:white;fill-opacity:0.76433123;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 74.95286,316.01549 C 74.95286,314.64026 76.32809,303.98226 76.6719,300.888 C 77.0157,297.79374 78.39093,292.98045 79.07854,291.60522 C 79.76616,290.22999 82.1728,286.44812 82.1728,286.44812 L 87.67371,277.85295 L 94.54984,265.81972 C 94.54984,265.81972 99.36314,265.13211 95.92507,267.88256 C 92.487,270.63301 89.39274,276.47773 87.3299,278.88437 C 85.26706,281.29102 83.54803,285.07289 82.1728,287.82335 C 80.79758,290.5738 78.73474,302.26322 78.73474,302.26322 L 76.6719,311.202 [...]
+ id="path3409" />
+ <path
+ style="opacity:0.7106918;fill:white;fill-opacity:0.76433123;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 78.39093,317.04691 C 79.07854,309.82697 81.14138,302.26322 81.14138,302.26322 C 81.14138,302.26322 82.1728,295.7309 82.86042,294.35567 C 83.54803,292.98045 83.20422,291.60522 84.57945,289.88619 C 85.95468,288.16715 87.3299,286.79193 87.3299,286.79193 C 87.3299,286.79193 87.67371,290.22999 86.29848,291.94903 C 84.92326,293.66806 83.54803,292.29283 82.86042,298.48135 C 82.1728,304.66987 82.1728,304.32606 81.48519,307.07652 C 80.79758,309.82697 79.42235,316.01549 78.39093,317.04691 z "
+ id="path3411" />
+ <path
+ style="opacity:0.7106918;fill:white;fill-opacity:0.76433123;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 78.39093,317.04691 L 89.73655,294.69948 L 90.08036,288.85477 L 92.487,283.69767 C 92.487,283.69767 93.86223,280.60341 93.86223,281.97863 C 93.86223,283.35386 95.92507,283.01005 93.86223,287.47954 C 91.79939,291.94903 90.76797,294.69948 89.73655,296.41851 C 88.70513,298.13754 83.89184,309.48316 83.20422,311.2022 C 82.51661,312.92123 79.07854,317.04691 78.39093,317.04691 z "
+ id="path3413" />
+ <path
+ style="opacity:0.7106918;fill:white;fill-opacity:0.76433123;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 89.39274,277.85295 L 95.92507,270.97682 L 99.36314,264.10069 L 103.83262,258.94359 L 104.52023,260.66262 C 104.52023,260.66262 103.48881,262.38166 101.76978,264.4445 C 100.05075,266.50734 96.95649,270.28921 95.58126,271.66443 C 94.20604,273.03966 92.1432,277.16534 92.1432,277.16534 L 89.39274,277.85295 z "
+ id="path3415" />
+ <path
+ style="opacity:0.7106918;fill:white;fill-opacity:0.76433123;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 100.39455,256.88075 C 101.76978,256.19314 107.27069,251.72365 107.27069,251.72365 L 107.27069,255.50552 L 100.39455,256.88075 z "
+ id="path3417" />
+ <path
+ style="opacity:0.7106918;fill:white;fill-opacity:0.51592353;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 88.70513,285.76051 L 95.23746,275.44631 L 102.8012,268.91398 L 105.55165,264.7883 C 105.55165,264.7883 104.86404,272.00824 103.48881,273.03966 C 102.11359,274.07108 97.3003,278.19676 97.3003,278.19676 L 91.45558,283.69767 L 88.70513,285.76051 z "
+ id="path3419" />
+ <path
+ style="opacity:0.7106918;fill:white;fill-opacity:0.76433123;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 107.61449,251.37984 C 107.61449,251.37984 117.58489,243.12848 121.36676,242.09706 C 125.14863,241.06564 127.21147,239.69042 127.21147,239.69042 L 122.74199,239.69042 C 122.74199,239.69042 117.24108,241.75326 115.86585,242.78468 C 114.49063,243.8161 107.9583,251.37984 107.61449,251.37984 z "
+ id="path3421" />
+ <path
+ style="fill:url(#linearGradient3449);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 115.86585,290.22999 C 115.86585,290.22999 108.64591,280.2596 108.1302,275.79011 C 107.61449,271.32063 107.44259,265.81972 107.44259,265.81972 C 107.44259,265.81972 109.67733,265.47592 109.84924,266.16353 C 110.02114,266.85114 109.67733,265.47592 110.02114,267.36685 C 110.36495,269.25779 110.36495,273.03966 111.05256,274.58679 C 111.74017,276.13392 113.63111,280.0877 115.35014,281.97863 C 117.06918,283.86957 119.30392,287.13573 119.30392,287.13573 L 115.86585,290.22999 z "
+ id="path3441" />
+ <path
+ style="fill:url(#radialGradient3439);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 118.2725,287.99525 C 118.2725,287.99525 112.77159,280.94721 111.91207,279.57199 C 111.05256,278.19676 110.19304,277.68105 111.22446,280.4315 C 112.25588,283.18196 117.41298,289.37048 117.41298,289.37048 L 118.2725,287.99525 z "
+ id="path3423" />
+ <path
+ style="fill:url(#linearGradient3486);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 405.66435,309.65532 C 405.66435,309.65532 386.1318,292.00251 378.62655,292.94136 C 371.12129,293.88022 369.58549,287.1426 378.1998,289.52988 C 386.8141,291.91716 401.74026,300.44458 405.66435,309.65532 z "
+ id="path3470" />
+ <path
+ style="fill:#bdd1e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 126.14636,236.13139 C 124.47073,236.12039 122.82047,236.26979 121.30261,236.53764 C 115.23118,237.60907 106.4276,245.69388 106.42761,245.69389 C 106.57456,246.28171 106.5622,246.87109 106.42761,247.44389 C 110.26503,243.94049 118.10549,237.68594 124.70886,238.19389 C 133.81251,238.89417 139.41483,245.52985 140.11511,249.38139 C 140.81539,253.23294 143.26349,261.63857 131.70886,274.94389 C 120.15424,288.2492 83.74081,319.04972 81.99011,320.10014 C 80.34883,321.08491 74.99926,3 [...]
+ id="path4243" />
+ <path
+ id="path3502"
+ d="M 126.14636,236.13139 C 124.47073,236.12039 122.82047,236.26979 121.30261,236.53764 C 115.23118,237.60907 106.4276,245.69388 106.42761,245.69389 C 106.57456,246.28171 106.5622,246.87109 106.42761,247.44389 C 110.26503,243.94049 118.10549,237.68594 124.70886,238.19389 C 133.81251,238.89417 139.41483,245.52985 140.11511,249.38139 C 140.81539,253.23294 143.26349,261.63857 131.70886,274.94389 C 120.15424,288.2492 83.74081,319.04972 81.99011,320.10014 C 80.34883,321.08491 74.99926,3 [...]
+ style="opacity:0.74166667;fill:url(#radialGradient3510);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#radialGradient3521);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 126.14636,236.13139 C 124.47073,236.12039 122.82047,236.26979 121.30261,236.53764 C 115.23118,237.60907 106.4276,245.69388 106.42761,245.69389 C 106.57456,246.28171 106.5622,246.87109 106.42761,247.44389 C 110.26503,243.94049 118.10549,237.68594 124.70886,238.19389 C 133.81251,238.89417 139.41483,245.52985 140.11511,249.38139 C 140.81539,253.23294 143.26349,261.63857 131.70886,274.94389 C 120.15424,288.2492 83.74081,319.04972 81.99011,320.10014 C 80.34883,321.08491 74.99926,3 [...]
+ id="path3513" />
+ <path
+ id="path3523"
+ d="M 126.14636,236.13139 C 124.47073,236.12039 122.82047,236.26979 121.30261,236.53764 C 115.23118,237.60907 106.4276,245.69388 106.42761,245.69389 C 106.57456,246.28171 106.5622,246.87109 106.42761,247.44389 C 110.26503,243.94049 118.10549,237.68594 124.70886,238.19389 C 133.81251,238.89417 139.41483,245.52985 140.11511,249.38139 C 140.81539,253.23294 143.26349,261.63857 131.70886,274.94389 C 120.15424,288.2492 83.74081,319.04972 81.99011,320.10014 C 80.34883,321.08491 74.99926,3 [...]
+ style="fill:url(#radialGradient3525);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#linearGradient3535);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 106.23927,248.28558 C 106.23927,248.28558 112.08398,242.78468 115.17824,241.06564 C 118.2725,239.34661 122.39818,238.31519 125.83625,238.659 C 129.27431,239.00281 136.15044,242.44087 136.15044,242.44087 C 136.15044,242.44087 127.55528,239.34661 124.80483,239.69042 C 122.05437,240.03423 112.42779,244.84752 108.30211,248.9732 C 104.17643,253.09888 106.23927,248.62939 106.23927,248.28558 z "
+ id="path3527" />
+ <path
+ style="fill:url(#linearGradient3545);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 71.85861,321.5164 C 71.85861,321.5164 70.13957,325.29827 76.6719,324.26685 C 83.20422,323.23543 99.36314,311.546 99.36314,311.546 C 99.36314,311.546 83.54803,325.29827 77.0157,326.67349 C 70.48338,328.04872 72.20241,322.54781 71.85861,321.5164 z "
+ id="path3537" />
+ <path
+ style="fill:url(#linearGradient3555);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 77.35951,326.32969 C 77.35951,326.32969 73.92144,304.32606 75.64048,296.0747 C 77.35951,287.82335 69.45196,314.98407 72.89002,324.26685 C 75.64048,326.6735 77.35951,327.0173 77.35951,326.32969 z "
+ id="path3547"
+ sodipodi:nodetypes="cscc" />
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer7"
+ inkscape:label="details"
+ style="display:inline">
+ <path
+ transform="matrix(0.853358,0.208001,-0.16483,1.076867,66.69561,-221.2967)"
+ d="M 430.1953 499.40536 A 19.147421 9.9467125 0 1 1 391.90046,499.40536 A 19.147421 9.9467125 0 1 1 430.1953 499.40536 z"
+ sodipodi:ry="9.9467125"
+ sodipodi:rx="19.147421"
+ sodipodi:cy="499.40536"
+ sodipodi:cx="411.04788"
+ id="path4202"
+ style="opacity:0.80416667;fill:url(#radialGradient4204);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3519);stroke-width:1.16900003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ style="fill:#17110e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 586.05551,360.71598 L 728.79083,280.64494 L 730.78017,285.12097 L 593.51554,364.19733 L 584.5635,371.16003 L 586.05551,360.71598 z "
+ id="path3940" />
+ <path
+ style="fill:#9ab1bf;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 585.99517,359.9523 L 592.52087,364.69467 L 730.28284,285.12097 L 728.79083,280.64494 L 585.99517,359.9523 z "
+ id="path3942"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3947"
+ d="M 585.99517,359.9523 L 592.52087,364.69467 L 730.28284,285.12097 L 728.79083,280.64494 L 585.99517,359.9523 z "
+ style="fill:url(#linearGradient3963);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient3973);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 588.02861,361.24909 L 592.95198,365.11745 L 714.98126,294.08024"
+ id="path3965" />
+ <path
+ style="opacity:0.75416667;fill:url(#linearGradient3992);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 605.431,273.08827 L 614.53818,269.56864 C 614.53818,269.56864 616.86711,290.13369 616.9749,296.14646 C 617.08267,302.15922 617.77887,318.05844 617.77887,318.05844 L 608.69742,313.41139 C 608.69742,313.41139 607.34954,280.89498 605.431,273.08827 z "
+ id="path3975" />
+ <path
+ id="path3994"
+ d="M 605.431,273.08827 L 614.53818,269.56864 C 614.53818,269.56864 616.86711,290.13369 616.9749,296.14646 C 617.08267,302.15922 617.77887,318.05844 617.77887,318.05844 L 608.69742,313.41139 C 608.69742,313.41139 607.34954,280.89498 605.431,273.08827 z "
+ style="opacity:1;fill:url(#linearGradient3996);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="opacity:0.64166667;fill:url(#linearGradient4006);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 611.82741,321.05295 L 618.27235,317.84879 L 609.14641,313.9197 C 609.14641,313.9197 608.40073,318.19787 611.82741,321.05295 z "
+ id="path3998"
+ sodipodi:nodetypes="cccc" />
+ <g
+ id="g4021"
+ transform="matrix(0.947617,5.873799e-2,-5.873799e-2,0.947617,-20.41642,-121.9174)">
+ <path
+ style="opacity:0.75416667;fill:url(#linearGradient4026);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 695.50191,369.65074 L 704.70262,365.42339 C 704.70262,365.42339 708.43264,386.56015 708.92998,392.77685 C 709.42731,398.99354 711.16799,415.40562 711.16799,415.40562 L 701.46994,411.17827 C 701.46994,411.17827 697.98859,377.60811 695.50191,369.65074 z "
+ id="path4008" />
+ <path
+ id="path4010"
+ d="M 695.50191,369.65074 L 704.70262,365.42339 C 704.70262,365.42339 708.43264,386.56015 708.92998,392.77685 C 709.42731,398.99354 711.16799,415.40562 711.16799,415.40562 L 701.46994,411.17827 C 701.46994,411.17827 697.98859,377.60811 695.50191,369.65074 z "
+ style="opacity:1;fill:url(#linearGradient4028);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="opacity:0.64166667;fill:url(#linearGradient4030);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 705.19996,418.88697 L 711.66532,415.15695 L 701.96728,411.6756 C 701.96728,411.6756 701.46994,416.15162 705.19996,418.88697 z "
+ id="path4013"
+ sodipodi:nodetypes="cccc" />
+ </g>
+ <path
+ id="path4032"
+ d="M 628.49935,265.2563 L 637.03687,261.95682 C 637.03687,261.95682 639.22012,281.23553 639.32117,286.87219 C 639.42221,292.50886 640.07486,307.41358 640.07486,307.41358 L 631.56144,303.05721 C 631.56144,303.05721 630.29788,272.57468 628.49935,265.2563 z "
+ style="opacity:0.75416667;fill:url(#linearGradient4047);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="opacity:1;fill:url(#linearGradient4049);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 628.49935,265.2563 L 637.03687,261.95682 C 637.03687,261.95682 639.22012,281.23553 639.32117,286.87219 C 639.42221,292.50886 640.07486,307.41358 640.07486,307.41358 L 631.56144,303.05721 C 631.56144,303.05721 630.29788,272.57468 628.49935,265.2563 z "
+ id="path4035" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path4037"
+ d="M 634.49566,310.22079 L 640.53747,307.21704 L 631.98235,303.53373 C 631.98235,303.53373 631.28331,307.54429 634.49566,310.22079 z "
+ style="opacity:0.64166667;fill:url(#linearGradient4051);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <g
+ transform="matrix(0.888343,5.506388e-2,-5.506388e-2,0.888343,41.79381,-105.2072)"
+ id="g4039">
+ <path
+ id="path4041"
+ d="M 695.50191,369.65074 L 704.70262,365.42339 C 704.70262,365.42339 708.43264,386.56015 708.92998,392.77685 C 709.42731,398.99354 711.16799,415.40562 711.16799,415.40562 L 701.46994,411.17827 C 701.46994,411.17827 697.98859,377.60811 695.50191,369.65074 z "
+ style="opacity:0.75416667;fill:url(#linearGradient4053);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="opacity:1;fill:url(#linearGradient4055);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 695.50191,369.65074 L 704.70262,365.42339 C 704.70262,365.42339 708.43264,386.56015 708.92998,392.77685 C 709.42731,398.99354 711.16799,415.40562 711.16799,415.40562 L 701.46994,411.17827 C 701.46994,411.17827 697.98859,377.60811 695.50191,369.65074 z "
+ id="path4043" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="path4045"
+ d="M 705.19996,418.88697 L 711.66532,415.15695 L 701.96728,411.6756 C 701.96728,411.6756 701.46994,416.15162 705.19996,418.88697 z "
+ style="opacity:0.64166667;fill:url(#linearGradient4057);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ </g>
+ <path
+ style="opacity:0.64166667;fill:#331409;fill-opacity:1;fill-rule:nonzero;stroke:#dade7b;stroke-width:2.06900001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.52282158;display:inline"
+ d="M 464.06738,316.44334 C 465.12018,319.89488 455.44952,325.81729 448.17664,328.03571 C 440.90376,330.25414 438.76918,327.93264 437.71637,324.48111 C 436.66356,321.02957 437.08924,317.74858 444.36211,315.53016 C 451.63499,313.31174 463.01457,312.99181 464.06738,316.44334 z "
+ id="path4082"
+ sodipodi:nodetypes="csssc" />
+ <path
+ sodipodi:nodetypes="csssc"
+ id="path4085"
+ d="M 462.74736,316.93124 C 463.69756,319.95425 454.96932,325.14136 448.40518,327.08435 C 441.84105,329.02735 439.91449,326.99408 438.96428,323.97107 C 438.01406,320.94806 438.39825,318.07443 444.96238,316.13144 C 451.52652,314.18845 461.79715,313.90824 462.74736,316.93124 z "
+ style="opacity:0.80416667;fill:url(#radialGradient4119);fill-opacity:1;fill-rule:nonzero;stroke:#232408;stroke-width:1.03935397;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.7759336;display:inline" />
+ <path
+ style="opacity:0.80416667;fill:url(#radialGradient4123);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.03935397;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.7759336;display:inline"
+ d="M 462.74736,316.93124 C 463.69756,319.95425 454.96932,325.14136 448.40518,327.08435 C 441.84105,329.02735 439.91449,326.99408 438.96428,323.97107 C 438.01406,320.94806 438.39825,318.07443 444.96238,316.13144 C 451.52652,314.18845 461.79715,313.90824 462.74736,316.93124 z "
+ id="path4121"
+ sodipodi:nodetypes="csssc" />
+ <path
+ style="fill:url(#linearGradient4075);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4067);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 625.65723,318.69709 L 626.0089,323.62047 L 640.42735,315.88374 L 640.77902,311.66371 L 625.65723,318.69709 z "
+ id="path4059" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.80416667;fill:url(#radialGradient4157);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient4149);stroke-width:1.16900003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4141"
+ sodipodi:cx="411.04788"
+ sodipodi:cy="499.40536"
+ sodipodi:rx="19.147421"
+ sodipodi:ry="9.9467125"
+ d="M 430.1953 499.40536 A 19.147421 9.9467125 0 1 1 391.90046,499.40536 A 19.147421 9.9467125 0 1 1 430.1953 499.40536 z"
+ transform="matrix(0.853358,0.208001,-0.16483,1.076867,66.69561,-221.2967)" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:url(#linearGradient4250);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.16900003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ id="path4242"
+ sodipodi:cx="414.03192"
+ sodipodi:cy="500.15137"
+ sodipodi:rx="8.7033739"
+ sodipodi:ry="11.687387"
+ d="M 422.7353 500.15137 A 8.7033739 11.687387 0 1 1 405.32855,500.15137 A 8.7033739 11.687387 0 1 1 422.7353 500.15137 z"
+ transform="matrix(0.995425,-0.143072,0.118651,0.825515,-135.5801,48.91704)" />
+ <path
+ style="opacity:1;fill:#2f2728;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 336.6459,393.01565 C 336.6459,393.01565 345.35034,394.25154 346.79487,396.88619 C 348.23938,399.52084 349.58385,401.4593 349.33794,404.69219 C 349.09204,407.92509 339.7457,412.11069 339.7457,412.11069 C 339.7457,412.11069 346.55321,405.09244 344.8085,400.36924 C 343.06378,395.64604 336.59587,392.66756 336.6459,393.01565 z "
+ id="path4163" />
+ <path
+ id="path4190"
+ d="M 336.6459,393.01565 C 336.6459,393.01565 345.35034,394.25154 346.79487,396.88619 C 348.23938,399.52084 349.58385,401.4593 349.33794,404.69219 C 349.09204,407.92509 339.7457,412.11069 339.7457,412.11069 C 339.7457,412.11069 344.76099,406.60615 343.01628,401.88295 C 341.27156,397.15975 336.59587,392.66756 336.6459,393.01565 z "
+ style="opacity:0.52083333;fill:url(#radialGradient4198);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ sodipodi:nodetypes="csscsc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:#251f20;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.16900003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ id="path4161"
+ sodipodi:cx="414.03192"
+ sodipodi:cy="500.15137"
+ sodipodi:rx="8.7033739"
+ sodipodi:ry="11.687387"
+ d="M 422.7353 500.15137 A 8.7033739 11.687387 0 1 1 405.32855,500.15137 A 8.7033739 11.687387 0 1 1 422.7353 500.15137 z"
+ transform="matrix(0.995425,-0.143072,0.118651,0.825515,-135.5801,48.91704)" />
+ <path
+ transform="matrix(0.995425,-0.143072,0.118651,0.825515,-135.5801,48.91704)"
+ d="M 422.7353 500.15137 A 8.7033739 11.687387 0 1 1 405.32855,500.15137 A 8.7033739 11.687387 0 1 1 422.7353 500.15137 z"
+ sodipodi:ry="11.687387"
+ sodipodi:rx="8.7033739"
+ sodipodi:cy="500.15137"
+ sodipodi:cx="414.03192"
+ id="path4180"
+ style="opacity:1;fill:url(#linearGradient4188);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.16900003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:inline"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:url(#radialGradient4218);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.16900003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4200"
+ sodipodi:cx="410.42624"
+ sodipodi:cy="502.76236"
+ sodipodi:rx="4.8490224"
+ sodipodi:ry="6.5896969"
+ d="M 415.27526 502.76236 A 4.8490224 6.5896969 0 1 1 405.57722,502.76236 A 4.8490224 6.5896969 0 1 1 415.27526 502.76236 z"
+ transform="matrix(0.989828,-0.142267,0.142267,0.989828,-145.2534,-36.58689)" />
+ <path
+ transform="matrix(0.989828,-0.142267,0.142267,0.989828,-145.2534,-36.58689)"
+ d="M 415.27526 502.76236 A 4.8490224 6.5896969 0 1 1 405.57722,502.76236 A 4.8490224 6.5896969 0 1 1 415.27526 502.76236 z"
+ sodipodi:ry="6.5896969"
+ sodipodi:rx="4.8490224"
+ sodipodi:cy="502.76236"
+ sodipodi:cx="410.42624"
+ id="path4220"
+ style="opacity:1;fill:url(#radialGradient4228);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.16900003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:url(#radialGradient4238);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.16900003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4230"
+ sodipodi:cx="410.42624"
+ sodipodi:cy="502.76236"
+ sodipodi:rx="4.8490224"
+ sodipodi:ry="6.5896969"
+ d="M 415.27526 502.76236 A 4.8490224 6.5896969 0 1 1 405.57722,502.76236 A 4.8490224 6.5896969 0 1 1 415.27526 502.76236 z"
+ transform="matrix(0.989828,-0.142267,0.142267,0.989828,-145.2534,-36.58689)" />
+ <path
+ style="fill:black;fill-opacity:0.53112033;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 331.66833,390.55612 C 331.66833,390.55612 341.36638,392.04812 344.84773,395.03214 C 348.32908,398.01615 351.56176,402.49217 351.06442,406.47086 C 350.56709,410.44954 345.34506,411.94155 341.86371,412.68755 C 338.38236,413.43356 333.65768,412.19022 333.65768,412.19022 C 333.65768,412.19022 340.37171,412.43889 344.84773,409.70354 C 349.32375,406.96819 351.06442,403.23818 348.08041,399.75683 C 345.0964,396.27548 342.11238,393.54013 337.63636,393.29146 C 333.16034,393.0428 329.18 [...]
+ id="path4252" />
+ <path
+ style="opacity:0.80869565;color:black;fill:black;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter4574);enable-background:accumulate"
+ d="M 735.11511,187.28764 L 734.05261,187.41264 C 734.45519,187.53021 734.42843,187.56114 734.05261,187.69389 C 733.62116,187.81916 733.15515,187.89297 732.70886,187.94389 C 732.64552,187.95581 732.58407,187.96184 732.52136,187.97514 C 731.98258,187.87965 730.90343,187.99919 730.89636,187.94389 C 730.52137,188.00496 730.30572,188.09529 730.24011,188.19389 C 730.17865,188.21489 730.11113,188.22958 730.05261,188.25639 C 730.01909,188.28425 730.0118,188.29645 729.99011,188.31889 C 729 [...]
+ id="path4542" />
+ <path
+ style="opacity:0.48260869;fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.1293754;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4466)"
+ d="M 722.46415,193.34131 C 722.46415,193.34131 717.74296,192.98903 722.74768,190.2592 C 727.8822,187.45854 728.31495,189.18556 730.04782,188.00407 C 732.55019,186.29792 734.43152,187.03463 735.58993,189.51694 C 736.38614,191.22309 734.20413,190.23978 731.36054,190.46726 C 726.84233,190.82869 730.15837,189.83789 727.08731,191.54404 C 723.65446,193.45116 723.48785,194.25126 722.46415,193.34131 z "
+ id="path4410"
+ sodipodi:nodetypes="csssssc" />
+ <path
+ style="fill:#3f5b8b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 722.01465,191.65653 C 722.01465,191.65653 721.83881,189.72234 725.70718,187.61233 C 729.67588,185.44758 729.1153,185.80012 730.45471,184.88689 C 732.3889,183.56813 734.65853,183.67154 735.55392,185.59023 C 736.16934,186.90899 735.02641,187.70025 732.82848,187.87608 C 729.33615,188.15545 729.83929,188.31567 727.46553,189.63443 C 724.81213,191.10853 722.80591,192.35987 722.01465,191.65653 z "
+ id="path4308"
+ sodipodi:nodetypes="csssssc" />
+ <path
+ sodipodi:nodetypes="csssssc"
+ id="path4310"
+ d="M 722.01465,191.65653 C 722.01465,191.65653 721.83881,189.72234 725.70718,187.61233 C 729.67588,185.44758 729.1153,185.80012 730.45471,184.88689 C 732.3889,183.56813 734.65853,183.67154 735.55392,185.59023 C 736.16934,186.90899 735.02641,187.70025 732.82848,187.87608 C 729.33615,188.15545 729.83929,188.31567 727.46553,189.63443 C 724.81213,191.10853 722.80591,192.35987 722.01465,191.65653 z "
+ style="fill:url(#linearGradient4318);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="csssssc"
+ id="path4324"
+ d="M 722.01465,191.65653 C 722.01465,191.65653 721.83881,189.72234 725.70718,187.61233 C 729.67588,185.44758 729.1153,185.80012 730.45471,184.88689 C 732.3889,183.56813 734.65853,183.67154 735.55392,185.59023 C 736.16934,186.90899 735.02641,187.70025 732.82848,187.87608 C 729.33615,188.15545 729.83929,188.31567 727.46553,189.63443 C 724.81213,191.10853 722.80591,192.35987 722.01465,191.65653 z "
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4408);stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter4360);enable-background:accumulate"
+ id="path3433"
+ d="M 438.49647,326.80167 C 438.77002,327.51298 439.32913,327.90728 440.00261,328.19438 C 440.80847,328.48368 441.65269,328.65588 442.48437,328.85547 C 443.83508,329.22333 445.19468,329.17931 446.56333,328.96995 C 448.38907,328.53061 450.56415,327.39211 452.56013,326.40096 C 454.95453,325.21322 457.3171,323.96404 459.61427,322.59748 C 460.87269,321.81449 463.18166,318.13498 464.37913,317.35367 L 462.79522,321.24118 C 461.57762,322.02884 462.20124,321.63427 460.92348,322.42354 C 458 [...]
+ sodipodi:nodetypes="ccccscccccccccc" />
+ <path
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter4512);enable-background:accumulate"
+ id="path4466"
+ d="M 730.34438,185.37195 C 729.92943,185.56261 727.41879,186.80045 727.02071,187.0247 C 726.60793,187.24492 726.24191,187.53199 725.88661,187.83314 C 725.55452,188.14592 725.21882,188.44866 724.83822,188.7011 C 724.45145,188.9462 724.0562,189.1621 723.73127,189.48838 C 723.43302,189.79891 723.27785,190.19739 723.13664,190.5956 C 723.0066,190.84885 723.07167,190.72398 722.94151,190.97026 L 721.87618,190.91834 C 722.00462,190.67623 721.9399,190.79598 722.07027,190.55906 C 722.21763, [...]
+ sodipodi:nodetypes="cscssccccscsscc" />
+ <path
+ style="fill:black;fill-opacity:0.53112033;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 72.83295,335.92889 C 72.83295,335.92889 77.05298,345.0723 77.40465,346.83065 C 77.75632,348.58899 72.48128,346.83065 71.77794,343.66562 C 71.0746,340.5006 72.48128,336.9839 72.83295,335.92889 z "
+ id="path4254" />
+ <path
+ id="path4256"
+ d="M 72.83295,335.92889 C 72.83295,335.92889 77.05298,345.0723 77.40465,346.83065 C 77.75632,348.58899 72.48128,346.83065 71.77794,343.66562 C 71.0746,340.5006 72.48128,336.9839 72.83295,335.92889 z "
+ style="fill:url(#radialGradient4264);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="opacity:1;fill:#728c8c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 178.73763,376.87939 C 178.73763,376.87939 181.72164,378.3714 182.46765,379.8634 C 183.21365,381.35541 186.94367,385.08543 186.94367,385.08543 L 192.66303,390.05878 C 192.66303,390.05878 191.41969,394.5348 189.67901,393.54013 C 187.93834,392.54546 186.44633,389.06411 184.95432,388.06944 C 183.46232,387.07477 180.72697,384.58809 179.7323,383.84209 C 178.73763,383.09608 176.49962,382.84742 176.00228,380.85807 C 175.50495,378.86873 176.25095,376.38205 178.73763,376.87939 z "
+ id="path4182" />
+ <path
+ id="path4184"
+ d="M 178.73763,376.87939 C 178.73763,376.87939 181.72164,378.3714 182.46765,379.8634 C 183.21365,381.35541 186.94367,385.08543 186.94367,385.08543 L 192.66303,390.05878 C 192.66303,390.05878 191.41969,394.5348 189.67901,393.54013 C 187.93834,392.54546 186.44633,389.06411 184.95432,388.06944 C 183.46232,387.07477 180.72697,384.58809 179.7323,383.84209 C 178.73763,383.09608 176.49962,382.84742 176.00228,380.85807 C 175.50495,378.86873 176.25095,376.38205 178.73763,376.87939 z "
+ style="opacity:1;fill:url(#linearGradient4193);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="opacity:1;fill:url(#linearGradient4197);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 178.73763,376.87939 C 178.73763,376.87939 181.72164,378.3714 182.46765,379.8634 C 183.21365,381.35541 186.94367,385.08543 186.94367,385.08543 L 192.66303,390.05878 C 192.66303,390.05878 191.41969,394.5348 189.67901,393.54013 C 187.93834,392.54546 186.44633,389.06411 184.95432,388.06944 C 183.46232,387.07477 180.72697,384.58809 179.7323,383.84209 C 178.73763,383.09608 176.49962,382.84742 176.00228,380.85807 C 175.50495,378.86873 176.25095,376.38205 178.73763,376.87939 z "
+ id="path4195" />
+ <path
+ id="path4199"
+ d="M 178.73763,376.87939 C 178.73763,376.87939 181.72164,378.3714 182.46765,379.8634 C 183.21365,381.35541 186.94367,385.08543 186.94367,385.08543 L 192.66303,390.05878 C 192.66303,390.05878 191.41969,394.5348 189.67901,393.54013 C 187.93834,392.54546 186.44633,389.06411 184.95432,388.06944 C 183.46232,387.07477 180.72697,384.58809 179.7323,383.84209 C 178.73763,383.09608 176.49962,382.84742 176.00228,380.85807 C 175.50495,378.86873 176.25095,376.38205 178.73763,376.87939 z "
+ style="opacity:1;fill:url(#linearGradient4201);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:#c4d3ac;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4135);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 179.7323,319.43712 L 190.67368,307.50107 L 198.13372,307.99841 L 187.19233,321.42647 L 179.7323,319.43712 z "
+ id="path4125" />
+ <path
+ id="path4137"
+ d="M 179.7323,319.43712 L 190.67368,307.50107 L 198.13372,307.99841 L 187.19233,321.42647 L 179.7323,319.43712 z "
+ style="fill:url(#linearGradient4153);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4145);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:url(#linearGradient5358);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 179.7323,319.43712 L 190.67368,307.50107 L 198.13372,307.99841 L 187.19233,321.42647 L 179.7323,319.43712 z "
+ id="path5356" />
+ <path
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter5448);enable-background:accumulate"
+ id="path5366"
+ d="M 185.96928,312.67762 C 185.37032,313.07236 182.46211,317.22609 181.94963,317.72508 C 181.46054,318.20731 180.99769,318.71535 180.58139,319.26172 C 179.96899,319.55129 180.9035,319.56387 180.88108,319.5605 C 179.81112,319.39957 180.10056,319.55254 180.66835,319.33882 C 181.50671,319.09616 182.18638,319.21227 183.00334,319.49035 C 182.76017,320.42462 180.87921,319.55779 182.36487,319.35661 C 183.37319,319.02348 183.95617,319.60218 184.79471,319.83042 C 185.17432,320.25792 185.80 [...]
+ sodipodi:nodetypes="cscscccccccccccccscc" />
+ <path
+ style="opacity:1;color:black;fill:black;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter5508);enable-background:accumulate"
+ id="path5462"
+ d="M 191.99601,315.26159 C 192.36752,314.80225 192.74023,314.34407 193.09392,313.87077 C 193.63887,313.14736 194.20743,312.44258 194.79387,311.75252 C 195.2509,311.22739 195.69672,310.69174 196.16675,310.17811 C 196.51474,309.80716 196.87421,309.4474 197.2316,309.08557 C 197.55195,308.76468 197.7941,308.39362 198.00615,307.99804 C 196.75588,307.58805 198.61797,307.70297 197.59587,307.92757 C 197.09195,308.05432 196.57324,308.09077 196.05639,308.12176 C 195.2045,308.15435 194.34797 [...]
+ sodipodi:nodetypes="cssssccssccscsccssscc" />
+ <path
+ style="fill:black;fill-opacity:0.75;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 186.88264,313.75825 C 187.17067,316.71047 186.88264,316.99849 186.88264,316.99849 L 192.28304,310.66202 L 186.88264,313.75825 z "
+ id="path5512" />
+ <path
+ id="path5514"
+ d="M 190.05087,315.41437 C 187.67471,316.71047 186.88264,316.99849 186.88264,316.99849 C 187.28251,314.74631 190.0857,312.73446 192.28304,310.66202 L 190.05087,315.41437 z "
+ style="fill:black;fill-opacity:0.75;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter5552)"
+ sodipodi:nodetypes="cccc" />
+ </g>
+ <g
+ inkscape:label="contours"
+ inkscape:groupmode="layer"
+ id="layer1"
+ style="display:none">
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#d56060;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 78.04368,347.90891 C 78.04368,347.90891 71.61511,346.83748 71.61511,342.90891 C 71.61511,338.98034 73.40082,336.12319 73.40082,336.12319 C 73.40082,336.12319 71.61511,326.12319 71.61511,323.62319 C 71.61511,321.12319 73.04368,300.05176 76.61511,290.76605 C 80.18654,281.48034 92.68654,258.62319 101.61511,252.19462 C 110.54368,245.76605 98.04368,248.26605 118.40082,236.48034 C 138.75797,224.69462 172.3294,202.55176 229.11511,188.26605 C 285.90082,173.98034 380.18654,162.19462 3 [...]
+ id="path1933"
+ sodipodi:nodetypes="cscsssssccssssssccsssssscccssssccsccssssssscscsc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 84.8294,343.26605 C 84.8294,343.26605 101.25797,348.26605 110.90082,351.12319 C 120.54368,353.98034 143.75797,361.48034 155.90082,364.69462 C 168.04368,367.90891 224.11511,378.62319 240.90082,381.48034 C 257.68654,384.33748 275.90082,387.90891 283.75797,398.62319 C 291.61511,409.33748 293.04368,414.69462 292.68654,417.55176 C 292.3294,420.40891 291.61511,427.19462 284.47225,427.90891 C 277.3294,428.62319 236.61511,426.48034 201.25797,416.48034 C 165.90082,406.48034 135.72225, [...]
+ id="path2822"
+ sodipodi:nodetypes="csssssssssc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 182.3294,251.12319 C 182.3294,251.12319 178.40082,257.19462 179.47225,259.69462 C 180.54368,262.19462 178.75797,264.69462 191.25797,267.55176 C 209.28868,271.67306 243.04368,275.05176 256.25797,277.55176 C 269.47225,280.05176 305.18654,284.69462 321.61511,280.40891 C 338.04368,276.12319 358.75797,265.76605 389.11511,250.76605 C 419.47225,235.76605 468.75797,217.19462 491.97225,210.40891 C 515.18654,203.62319 540.54368,195.40891 542.68654,194.69462 C 544.8294,193.98034 548.043 [...]
+ id="path2824"
+ sodipodi:nodetypes="cssssssssc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 106.42385,245.70477 C 106.42385,245.70477 115.22986,237.61304 121.30129,236.54161 C 127.37272,235.47019 135.54368,236.48034 139.11511,240.76605 C 142.68654,245.05176 147.55656,253.67395 144.8294,261.12319 C 140.20106,273.76552 118.38288,294.99049 105.58701,306.41906 C 93.34277,317.35496 84.8294,322.90891 81.25797,324.33748 C 77.68654,325.76605 75.8575,327.40383 73.71464,325.61811 C 71.57179,323.8324 72.93908,309.1716 74.11511,302.55176 C 75.08489,297.09289 81.28335,279.39876 [...]
+ id="path2826"
+ sodipodi:nodetypes="csssssssssc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 351.94009,283.81763 C 358.00101,279.52448 383.50736,260.33158 403.71041,277.25163 C 423.91346,294.17169 422.90331,324.47627 418.8627,334.83033 C 414.82209,345.18439 404.9731,360.58922 389.31574,368.67044 C 373.65837,376.75166 348.90964,381.80242 338.30304,382.3075 C 327.69643,382.81257 310.52384,382.3075 301.93754,379.52958 C 293.35125,376.75166 285.27003,369.68059 287.29033,360.58922 C 289.31064,351.49785 299.6543,334.82251 304.21039,328.76941 C 321.88806,305.28336 345.87918 [...]
+ id="path2828"
+ sodipodi:nodetypes="cssssssss" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 476.05261,97.31889 C 471.12809,97.3189 447.66032,98.06255 446.27136,98.69389 C 444.88237,99.32524 439.56403,101.62631 438.42761,102.13139 C 437.94686,102.34506 437.09672,104.25333 436.27136,106.38139 C 436.31757,106.35184 436.40958,106.30567 436.42761,106.28764 C 437.1419,105.57336 441.62402,103.81442 443.05261,103.10014 C 444.48118,102.38585 454.83386,101.8412 458.58386,101.66264 C 462.33386,101.48407 500.55705,101.29656 535.02136,102.72514 C 569.48564,104.15371 620.90529,10 [...]
+ id="path2832"
+ sodipodi:nodetypes="csscssssssssssscccssssssssssc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#d56060;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 467.27136,101.53764 C 462.62292,101.55717 459.52136,101.618 458.58386,101.66264 C 454.83386,101.8412 444.48118,102.38585 443.05261,103.10014 C 441.62402,103.81442 437.1419,105.57336 436.42761,106.28764 C 436.32802,106.38723 435.71045,106.70057 434.83386,107.13139 C 433.95757,108.28139 433.04746,109.46011 431.95886,110.41264 C 429.10172,112.91264 384.11511,160.75638 384.11511,160.75639 L 381.86511,161.56889 C 381.73455,161.73474 381.63862,161.86237 381.61511,161.85014 C 381.61 [...]
+ id="path2837" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 649.68256,110.07139 C 649.68256,110.07139 659.53155,109.31377 664.32977,109.81885 C 669.12799,110.32393 682.25998,111.33408 685.79551,112.09169 C 689.33105,112.84931 691.60389,113.35438 693.11912,115.12215 C 694.63435,116.88992 695.6445,117.90007 698.67496,127.74906 C 701.70541,137.59804 711.04933,167.65008 711.04933,167.65008 C 711.04933,167.65008 687.81582,171.94323 679.7346,173.711 C 671.65338,175.47876 658.26885,178.50922 658.26885,178.50922 C 658.26885,178.50922 655.2384 [...]
+ id="path2858" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 655.49093,112.34423 C 655.49093,112.34423 684.78536,113.35438 688.06835,114.61707 C 691.35135,115.87976 691.85643,115.37469 693.11912,117.90007 C 694.38181,120.42545 707.51379,167.14501 707.51379,167.14501 L 670.89576,175.22623 L 655.49093,112.34423 z "
+ id="path2860" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 656.50109,114.36454 C 656.50109,114.36454 672.91607,114.86961 678.97698,115.62723 C 685.0379,116.38484 689.07851,116.38484 690.59374,118.15261 C 692.10896,119.92037 695.89704,135.83028 695.89704,135.83028 L 704.48333,168.15516 L 671.40084,174.72115 L 656.50109,114.36454 z "
+ id="path2862" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 649.68256,118.40515 L 652.20794,116.1323 L 653.21809,115.62723 L 667.10769,171.69069 L 656.24855,173.45846 L 650.18763,124.7186 L 649.68256,118.40515 z "
+ id="path2864" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 658.04368,178.98034 C 658.04368,178.98034 649.47225,182.90891 647.3294,184.33748 C 645.18654,185.76605 642.3294,188.62319 641.97225,191.12319 C 641.61511,193.62319 645.54368,203.62319 649.8294,210.76605 C 654.11511,217.90891 657.3294,228.62319 657.68654,231.83748 C 658.04368,235.05176 660.90083,267.55176 659.11511,279.33748 C 657.3294,291.12319 651.97225,325.76605 651.97225,325.76605 L 651.97225,325.76605"
+ id="path2868"
+ sodipodi:nodetypes="cssssscc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 712.68654,169.69462 C 712.68654,169.69462 729.8294,178.98034 733.04368,185.40891 C 736.25797,191.83748 740.54368,198.26605 740.54368,206.12319 C 740.54368,212.55176 728.79761,256.00431 727.3294,260.40891 C 724.82939,267.90891 721.61511,278.98034 717.3294,283.62319 C 713.04368,288.26605 701.25797,297.19462 696.61511,299.69462 C 691.97225,302.19462 691.97225,302.19462 691.97225,302.19462"
+ id="path2870"
+ sodipodi:nodetypes="csssssc" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 469.27625,312.92883 C 469.27625,312.92883 542.56182,266.38259 619.80878,241.62395 C 697.05574,216.86531 732.70819,206.96185 737.65991,205.97151 C 742.61164,204.98116 745.58268,193.09701 753.50544,193.09701 C 761.42821,193.09701 761.42821,191.11632 767.37028,186.16459 C 773.31236,181.21287 771.33166,171.30941 771.33166,171.30941 C 771.33166,171.30941 751.52475,157.44457 727.75646,155.46388 C 703.98816,153.48319 738.65026,158.43492 747.56337,168.33837 C 756.47648,178.24183 727. [...]
+ id="path2174" />
+ </g>
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.72916667;fill:url(#radialGradient4306);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.16900003;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4240"
+ sodipodi:cx="420.2486"
+ sodipodi:cy="498.16202"
+ sodipodi:rx="1.4920069"
+ sodipodi:ry="2.2380104"
+ d="M 421.7406 498.16202 A 1.4920069 2.2380104 0 1 1 418.75659,498.16202 A 1.4920069 2.2380104 0 1 1 421.7406 498.16202 z"
+ transform="matrix(0.715574,-0.698537,0.698537,0.715574,-306.5912,333.86)" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer8"
+ inkscape:label="radiator"
+ style="display:inline">
+ <path
+ style="opacity:1;fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 87.76927,346.24226 C 87.76927,346.24226 103.96548,351.06645 113.47194,353.82313 C 122.97842,356.57981 145.86437,363.8161 157.83548,366.91736 C 169.80659,370.01863 225.08496,380.35617 241.63326,383.11286 C 258.18157,385.86954 276.13823,389.31539 283.88425,399.65293 C 291.63026,409.99049 293.03863,415.15926 292.68654,417.91594 C 292.33445,420.67262 291.63026,427.21974 284.58843,427.90891 C 277.54661,428.59807 237.40817,426.53057 202.55111,416.88219 C 167.69404,407.23381 137.942 [...]
+ id="path2179"
+ sodipodi:nodetypes="csssssssssc" />
+ <path
+ sodipodi:nodetypes="cssscscszcsc"
+ id="path3301"
+ d="M 103.83871,352.54266 C 103.83871,352.54266 115.72285,370.36888 124.63597,373.33992 C 133.54908,376.31096 146.42357,384.23372 174.64842,391.66131 C 202.87327,399.0889 254.86642,411.46823 266.25539,412.95374 C 277.64437,414.43926 291.5092,416.41995 291.5092,416.41995 C 291.5092,416.41995 295.96577,421.37168 283.09127,424.83789 C 278.09927,426.18189 217.72846,416.41995 217.72846,416.41995 C 217.72846,416.41995 163.25945,402.55511 144.44288,395.6227 C 125.62631,388.69028 113.31726 [...]
+ style="opacity:1;fill:url(#radialGradient3309);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ style="fill:url(#linearGradient4062);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.79999995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 108.11511,353.44389 L 107.17761,354.97514 C 107.17761,354.97514 108.38609,355.66934 110.58386,356.81889 L 112.14636,360.28764 C 111.94419,360.1715 111.27136,359.78764 111.27136,359.78764 L 110.36511,361.31889 C 110.36511,361.31889 111.41325,361.91626 113.36511,362.94389 L 114.49011,365.44389 C 114.48915,365.44331 114.42761,365.41264 114.42761,365.41264 L 113.52136,366.94389 C 113.52136,366.94389 114.46936,367.46221 115.70886,368.13139 L 116.33386,369.53764 L 117.24011,369.131 [...]
+ id="path3877" />
+ <path
+ id="path4065"
+ d="M 108.81845,352.74055 L 107.88095,354.2718 C 107.88095,354.2718 109.08943,354.966 111.2872,356.11555 L 112.8497,359.5843 C 112.64753,359.46816 111.9747,359.0843 111.9747,359.0843 L 111.06845,360.61555 C 111.06845,360.61555 112.11659,361.21292 114.06845,362.24055 L 115.19345,364.74055 C 115.19249,364.73997 115.13095,364.7093 115.13095,364.7093 L 114.2247,366.24055 C 114.2247,366.24055 115.1727,366.75887 116.4122,367.42805 L 117.0372,368.8343 L 117.94345,368.42805 L 117.8497,368. [...]
+ style="opacity:0.52916721;fill:url(#linearGradient4070);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.79999995;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="opacity:1;fill:#2c3339;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 103.83871,352.54266 C 103.83871,352.54266 115.72285,370.36888 124.63597,373.33992 C 133.54908,376.31096 146.42357,384.23372 174.64842,391.66131 C 202.87327,399.0889 254.86642,411.46823 266.25539,412.95374 C 277.64437,414.43926 291.5092,416.41995 291.5092,416.41995 C 291.5092,416.41995 295.96577,421.37168 283.09127,424.83789 C 278.09927,426.18189 217.72846,416.41995 217.72846,416.41995 C 217.72846,416.41995 163.25945,402.55511 144.44288,395.6227 C 125.62631,388.69028 113.31726 [...]
+ id="path3113"
+ sodipodi:nodetypes="cssscscszcsc" />
+ <path
+ sodipodi:nodetypes="cssscscszcsc"
+ id="path4111"
+ d="M 103.83871,352.54266 C 103.83871,352.54266 115.72285,370.36888 124.63597,373.33992 C 133.54908,376.31096 146.42357,384.23372 174.64842,391.66131 C 202.87327,399.0889 254.86642,411.46823 266.25539,412.95374 C 277.64437,414.43926 291.5092,416.41995 291.5092,416.41995 C 291.5092,416.41995 295.96577,421.37168 283.09127,424.83789 C 278.09927,426.18189 217.72846,416.41995 217.72846,416.41995 C 217.72846,416.41995 163.25945,402.55511 144.44288,395.6227 C 125.62631,388.69028 113.31726 [...]
+ style="opacity:0.56734691;fill:url(#radialGradient4120);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ sodipodi:nodetypes="cssscscszcsc"
+ id="path3287"
+ d="M 103.83871,352.54266 C 103.83871,352.54266 115.72285,370.36888 124.63597,373.33992 C 133.54908,376.31096 146.42357,384.23372 174.64842,391.66131 C 202.87327,399.0889 254.86642,411.46823 266.25539,412.95374 C 277.64437,414.43926 291.5092,416.41995 291.5092,416.41995 C 291.5092,416.41995 295.96577,421.37168 283.09127,424.83789 C 278.09927,426.18189 217.72846,416.41995 217.72846,416.41995 C 217.72846,416.41995 163.25945,402.55511 144.44288,395.6227 C 125.62631,388.69028 113.31726 [...]
+ style="opacity:1;fill:url(#linearGradient3295);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ style="opacity:0.56734691;fill:url(#radialGradient3299);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 103.83871,352.54266 C 103.83871,352.54266 115.72285,370.36888 124.63597,373.33992 C 133.54908,376.31096 146.42357,384.23372 174.64842,391.66131 C 202.87327,399.0889 254.86642,411.46823 266.25539,412.95374 C 277.64437,414.43926 291.5092,416.41995 291.5092,416.41995 C 291.5092,416.41995 295.96577,421.37168 283.09127,424.83789 C 278.09927,426.18189 217.72846,416.41995 217.72846,416.41995 C 217.72846,416.41995 163.25945,402.55511 144.44288,395.6227 C 125.62631,388.69028 113.31726 [...]
+ id="path3297"
+ sodipodi:nodetypes="cssscscszcsc" />
+ <path
+ style="opacity:1;fill:#7c7c7c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline"
+ d="M 84.14636,343.03764 C 82.46423,343.08891 80.2401,347.0689 83.05261,353.63139 C 86.26689,361.13139 97.60844,373.75491 112.67761,383.10014 C 135.71332,397.38585 165.91422,406.47515 201.27136,416.47514 C 236.6285,426.47514 277.316,428.62691 284.45886,427.91264 C 291.60172,427.19835 292.32046,420.39481 292.67761,417.53764 C 293.03475,414.6805 291.62851,409.34569 283.77136,398.63139 C 275.91421,387.91711 257.68208,384.33229 240.89636,381.47514 C 224.11065,378.61799 168.03922,367.90 [...]
+ id="path4077" />
+ <path
+ id="path4083"
+ d="M 84.14636,343.03764 C 82.46423,343.08891 80.2401,347.0689 83.05261,353.63139 C 86.26689,361.13139 97.60844,373.75491 112.67761,383.10014 C 135.71332,397.38585 165.91422,406.47515 201.27136,416.47514 C 236.6285,426.47514 277.316,428.62691 284.45886,427.91264 C 291.60172,427.19835 292.32046,420.39481 292.67761,417.53764 C 293.03475,414.6805 291.62851,409.34569 283.77136,398.63139 C 275.91421,387.91711 257.68208,384.33229 240.89636,381.47514 C 224.11065,378.61799 168.03922,367.90 [...]
+ style="opacity:1;fill:url(#radialGradient4093);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" />
+ <path
+ style="opacity:1;fill:url(#radialGradient4105);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4174)"
+ d="M 84.14636,343.03764 C 82.46423,343.08891 80.2401,347.0689 83.05261,353.63139 C 86.26689,361.13139 97.60844,373.75491 112.67761,383.10014 C 135.71332,397.38585 165.91422,406.47515 201.27136,416.47514 C 236.6285,426.47514 277.316,428.62691 284.45886,427.91264 C 291.60172,427.19835 292.32046,420.39481 292.67761,417.53764 C 293.03475,414.6805 291.62851,409.34569 283.77136,398.63139 C 275.91421,387.91711 257.68208,384.33229 240.89636,381.47514 C 224.11065,378.61799 168.03922,367.90 [...]
+ id="path4095" />
+ <path
+ style="fill:#212a2a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 291.57131,418.5712 C 291.57131,418.5712 292.97799,424.54958 282.42791,425.60459 C 271.87783,426.6596 221.94077,416.46118 221.94077,416.46118 C 221.94077,416.46118 282.07624,427.01127 286.99961,423.14291 C 291.92298,419.27454 292.27465,418.92287 291.57131,418.5712 z "
+ id="path4107"
+ sodipodi:nodetypes="cscsc" />
+ <path
+ style="fill:#212a2a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 84.78971,353.1607 C 84.78971,353.1607 91.47143,364.76579 97.80148,370.04083 C 104.13152,375.31587 113.6266,384.1076 133.32008,391.84433 C 153.01357,399.58106 207.17066,413.9995 207.17066,413.9995 L 227.56748,417.86786 C 227.56748,417.86786 170.59704,402.39441 155.47526,397.82271 C 140.35347,393.25101 103.42819,382.70092 84.78971,353.1607 z "
+ id="path4109" />
+ <path
+ id="path4178"
+ d="M 84.14636,343.03764 C 82.46423,343.08891 80.2401,347.0689 83.05261,353.63139 C 86.26689,361.13139 97.60844,373.75491 112.67761,383.10014 C 135.71332,397.38585 165.91422,406.47515 201.27136,416.47514 C 236.6285,426.47514 277.316,428.62691 284.45886,427.91264 C 291.60172,427.19835 292.32046,420.39481 292.67761,417.53764 C 293.03475,414.6805 291.62851,409.34569 283.77136,398.63139 C 275.91421,387.91711 257.68208,384.33229 240.89636,381.47514 C 224.11065,378.61799 168.03922,367.90 [...]
+ style="opacity:1;fill:url(#radialGradient4180);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4174)" />
+ <g
+ style="opacity:1;display:inline"
+ id="g4303"
+ transform="translate(-74.31481,-84.12812)">
+ <path
+ id="path4216"
+ d="M 596.80275,265.65761 L 596.30541,260.68425 C 596.30541,260.68425 598.04608,259.44091 599.28942,259.19225 C 600.53276,258.94358 602.02477,256.20823 604.51145,255.95956 C 606.99813,255.7109 608.7388,257.45157 608.7388,257.45157 C 608.7388,257.45157 615.7015,254.21889 628.88089,251.98088 C 642.06029,249.74287 660.46171,248.25086 660.46171,248.25086 L 676.62511,248.49953 L 677.61978,249.99154 C 677.61978,249.99154 693.03719,251.23488 696.0212,251.48354 C 699.00522,251.73221 709. [...]
+ style="fill:#758084;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:url(#linearGradient4344);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 596.80275,265.65761 L 596.30541,260.68425 C 596.30541,260.68425 598.04608,259.44091 599.28942,259.19225 C 600.53276,258.94358 602.02477,256.20823 604.51145,255.95956 C 606.99813,255.7109 608.7388,257.45157 608.7388,257.45157 C 608.7388,257.45157 615.7015,254.21889 628.88089,251.98088 C 642.06029,249.74287 660.46171,248.25086 660.46171,248.25086 L 676.62511,248.49953 L 677.61978,249.99154 C 677.61978,249.99154 693.03719,251.23488 696.0212,251.48354 C 699.00522,251.73221 709. [...]
+ id="path4218" />
+ <path
+ id="path4229"
+ d="M 596.80275,265.65761 L 596.30541,260.68425 C 596.30541,260.68425 598.04608,259.44091 599.28942,259.19225 C 600.53276,258.94358 602.02477,256.20823 604.51145,255.95956 C 606.99813,255.7109 608.7388,257.45157 608.7388,257.45157 C 608.7388,257.45157 615.7015,254.21889 628.88089,251.98088 C 642.06029,249.74287 660.46171,248.25086 660.46171,248.25086 L 676.62511,248.49953 L 677.61978,249.99154 C 677.61978,249.99154 693.03719,251.23488 696.0212,251.48354 C 699.00522,251.73221 709. [...]
+ style="fill:url(#radialGradient4346);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:url(#radialGradient4348);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 596.80275,265.65761 L 596.30541,260.68425 C 596.30541,260.68425 598.04608,259.44091 599.28942,259.19225 C 600.53276,258.94358 602.02477,256.20823 604.51145,255.95956 C 606.99813,255.7109 608.7388,257.45157 608.7388,257.45157 C 608.7388,257.45157 615.7015,254.21889 628.88089,251.98088 C 642.06029,249.74287 660.46171,248.25086 660.46171,248.25086 L 676.62511,248.49953 L 677.61978,249.99154 C 677.61978,249.99154 693.03719,251.23488 696.0212,251.48354 C 699.00522,251.73221 709. [...]
+ id="path4241" />
+ <path
+ id="path4261"
+ d="M 597.05142,266.15495 L 602.27344,266.40361 L 601.77611,267.89562 L 597.30009,268.14429 L 597.05142,266.15495 z "
+ style="fill:#1c1903;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:url(#linearGradient4350);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 597.05142,266.15495 L 602.27344,266.40361 L 601.77611,267.89562 L 597.30009,268.14429 L 597.05142,266.15495 z "
+ id="path4263" />
+ <path
+ id="path4273"
+ d="M 602.02477,266.65228 C 602.02477,266.65228 603.26811,263.91694 605.75479,262.92227 C 608.24147,261.92759 623.90754,255.46223 627.88623,254.71623 C 631.86491,253.97022 659.96437,250.48887 666.92707,250.98621 C 673.88977,251.48355 676.87379,250.73754 676.87379,250.73754 L 674.88444,249.99154 C 674.88444,249.99154 653.25034,250.24021 650.76366,250.98621 C 648.27699,251.73221 627.14022,253.47289 621.9182,255.21356 C 616.69617,256.95424 604.26278,262.92227 604.26278,262.92227 L 6 [...]
+ style="fill:#393306;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ id="path4275"
+ d="M 629.37823,258.19758 L 629.37823,258.19758 z "
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ id="path4277"
+ d="M 629.37823,257.45157 L 629.6269,258.94358 C 629.6269,258.94358 666.42974,254.46756 675.38178,254.71623 C 684.33382,254.9649 716.41197,257.20291 716.41197,257.20291 L 716.41197,256.20823 C 716.41197,256.20823 680.6038,252.97555 672.8951,253.47289 C 665.1864,253.97022 629.12957,257.20291 629.37823,257.45157 z "
+ style="fill:url(#linearGradient4439);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cs"
+ id="path4279"
+ d="M 613.96083,255.95957 C 613.96083,255.95957 652.75301,246.51019 675.38178,249.24554"
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4352);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ transform="matrix(0.911681,-0.410899,0.410899,0.911681,-53.19376,271.1417)"
+ d="m 607.74416,257.5759 c 0,0.89268 -1.44732,1.61634 -3.23269,1.61634 -1.78536,0 -3.23268,-0.72366 -3.23268,-1.61634 0,-0.89268 1.44732,-1.61634 3.23268,-1.61634 1.78537,0 3.23269,0.72366 3.23269,1.61634 z"
+ sodipodi:ry="1.6163408"
+ sodipodi:rx="3.2326815"
+ sodipodi:cy="257.5759"
+ sodipodi:cx="604.51147"
+ id="path4289"
+ style="opacity:0.86666667;fill:url(#radialGradient4354);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.86666667;fill:url(#radialGradient4356);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4299"
+ sodipodi:cx="604.51147"
+ sodipodi:cy="257.5759"
+ sodipodi:rx="3.2326815"
+ sodipodi:ry="1.6163408"
+ d="m 607.74416,257.5759 c 0,0.89268 -1.44732,1.61634 -3.23269,1.61634 -1.78536,0 -3.23268,-0.72366 -3.23268,-1.61634 0,-0.89268 1.44732,-1.61634 3.23268,-1.61634 1.78537,0 3.23269,0.72366 3.23269,1.61634 z"
+ transform="matrix(0.614811,3.566555e-2,-2.194153e-2,0.999364,232.7835,-18.41272)" />
+ </g>
+ <g
+ transform="matrix(0.858705,3.886498e-2,-4.414177e-2,0.839932,-119.0173,-73.44549)"
+ id="g4380"
+ style="opacity:1;display:inline">
+ <path
+ style="fill:#758084;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 596.80275,265.65761 L 596.30541,260.68425 C 596.30541,260.68425 598.04608,259.44091 599.28942,259.19225 C 600.53276,258.94358 602.02477,256.20823 604.51145,255.95956 C 606.99813,255.7109 608.7388,257.45157 608.7388,257.45157 C 608.7388,257.45157 615.7015,254.21889 628.88089,251.98088 C 642.06029,249.74287 660.46171,248.25086 660.46171,248.25086 L 676.62511,248.49953 L 677.61978,249.99154 C 677.61978,249.99154 693.03719,251.23488 696.0212,251.48354 C 699.00522,251.73221 709. [...]
+ id="path4382" />
+ <path
+ id="path4384"
+ d="M 596.80275,265.65761 L 596.30541,260.68425 C 596.30541,260.68425 598.04608,259.44091 599.28942,259.19225 C 600.53276,258.94358 602.02477,256.20823 604.51145,255.95956 C 606.99813,255.7109 608.7388,257.45157 608.7388,257.45157 C 608.7388,257.45157 615.7015,254.21889 628.88089,251.98088 C 642.06029,249.74287 660.46171,248.25086 660.46171,248.25086 L 676.62511,248.49953 L 677.61978,249.99154 C 677.61978,249.99154 693.03719,251.23488 696.0212,251.48354 C 699.00522,251.73221 709. [...]
+ style="fill:url(#linearGradient4413);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:url(#radialGradient4415);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 596.80275,265.65761 L 596.30541,260.68425 C 596.30541,260.68425 598.04608,259.44091 599.28942,259.19225 C 600.53276,258.94358 602.02477,256.20823 604.51145,255.95956 C 606.99813,255.7109 608.7388,257.45157 608.7388,257.45157 C 608.7388,257.45157 615.7015,254.21889 628.88089,251.98088 C 642.06029,249.74287 660.46171,248.25086 660.46171,248.25086 L 676.62511,248.49953 L 677.61978,249.99154 C 677.61978,249.99154 693.03719,251.23488 696.0212,251.48354 C 699.00522,251.73221 709. [...]
+ id="path4386" />
+ <path
+ id="path4388"
+ d="M 596.80275,265.65761 L 596.30541,260.68425 C 596.30541,260.68425 598.04608,259.44091 599.28942,259.19225 C 600.53276,258.94358 602.02477,256.20823 604.51145,255.95956 C 606.99813,255.7109 608.7388,257.45157 608.7388,257.45157 C 608.7388,257.45157 615.7015,254.21889 628.88089,251.98088 C 642.06029,249.74287 660.46171,248.25086 660.46171,248.25086 L 676.62511,248.49953 L 677.61978,249.99154 C 677.61978,249.99154 693.03719,251.23488 696.0212,251.48354 C 699.00522,251.73221 709. [...]
+ style="fill:url(#radialGradient4417);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:#1c1903;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 597.05142,266.15495 L 602.27344,266.40361 L 601.77611,267.89562 L 597.30009,268.14429 L 597.05142,266.15495 z "
+ id="path4390" />
+ <path
+ id="path4392"
+ d="M 597.05142,266.15495 L 602.27344,266.40361 L 601.77611,267.89562 L 597.30009,268.14429 L 597.05142,266.15495 z "
+ style="fill:url(#linearGradient4419);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ style="fill:#393306;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 602.02477,266.65228 C 602.02477,266.65228 603.26811,263.91694 605.75479,262.92227 C 608.24147,261.92759 623.90754,255.46223 627.88623,254.71623 C 631.86491,253.97022 659.96437,250.48887 666.92707,250.98621 C 673.88977,251.48355 676.87379,250.73754 676.87379,250.73754 L 674.88444,249.99154 C 674.88444,249.99154 653.25034,250.24021 650.76366,250.98621 C 648.27699,251.73221 627.14022,253.47289 621.9182,255.21356 C 616.69617,256.95424 604.26278,262.92227 604.26278,262.92227 L 6 [...]
+ id="path4394" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:black;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 629.37823,258.19758 L 629.37823,258.19758 z "
+ id="path4396" />
+ <path
+ style="fill:#231002;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 629.37823,257.45157 L 629.6269,258.94358 C 629.6269,258.94358 666.42974,254.46756 675.38178,254.71623 C 684.33382,254.9649 716.41197,257.20291 716.41197,257.20291 L 716.41197,256.20823 C 716.41197,256.20823 680.6038,252.97555 672.8951,253.47289 C 665.1864,253.97022 629.12957,257.20291 629.37823,257.45157 z "
+ id="path4398" />
+ <path
+ style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:url(#linearGradient4421);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 613.96083,255.95957 C 613.96083,255.95957 652.75301,246.51019 675.38178,249.24554"
+ id="path4400"
+ sodipodi:nodetypes="cs" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:0.86666667;fill:url(#radialGradient4423);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path4402"
+ sodipodi:cx="604.51147"
+ sodipodi:cy="257.5759"
+ sodipodi:rx="3.2326815"
+ sodipodi:ry="1.6163408"
+ d="m 607.74416,257.5759 c 0,0.89268 -1.44732,1.61634 -3.23269,1.61634 -1.78536,0 -3.23268,-0.72366 -3.23268,-1.61634 0,-0.89268 1.44732,-1.61634 3.23268,-1.61634 1.78537,0 3.23269,0.72366 3.23269,1.61634 z"
+ transform="matrix(0.911681,-0.410899,0.410899,0.911681,-53.19376,271.1417)" />
+ <path
+ transform="matrix(0.614811,3.566555e-2,-2.194153e-2,0.999364,232.7835,-18.41272)"
+ d="m 607.74416,257.5759 c 0,0.89268 -1.44732,1.61634 -3.23269,1.61634 -1.78536,0 -3.23268,-0.72366 -3.23268,-1.61634 0,-0.89268 1.44732,-1.61634 3.23268,-1.61634 1.78537,0 3.23269,0.72366 3.23269,1.61634 z"
+ sodipodi:ry="1.6163408"
+ sodipodi:rx="3.2326815"
+ sodipodi:cy="257.5759"
+ sodipodi:cx="604.51147"
+ id="path4404"
+ style="opacity:0.86666667;fill:url(#radialGradient4425);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc" />
+ </g>
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer9"
+ inkscape:label="highlights"
+ style="opacity:1;display:inline">
+ <path
+ style="opacity:0.56956524;fill:url(#linearGradient4234);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 125.58336,322.56546 C 125.58336,322.56546 138.24346,328.19217 145.27684,326.78549 C 152.31023,325.37881 166.37701,323.97214 166.37701,323.97214 L 166.37701,332.4122 L 150.90355,332.4122 L 142.46349,335.22556 L 142.46349,339.44559 L 126.99003,333.81888 L 139.65013,340.85227 C 139.65013,340.85227 132.61675,343.66562 126.99003,343.66562 C 121.36332,343.66562 108.70323,340.85227 108.70323,340.85227 L 118.54997,338.03891 L 118.54997,333.81888 L 115.73661,328.19217 L 125.58336,322. [...]
+ id="path4167" />
+ <path
+ style="opacity:0.52608696;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 148.0902,349.29233 C 153.71691,350.69901 155.12359,354.91904 164.97033,354.91904 C 174.81707,354.91904 184.66382,357.7324 184.66382,357.7324 C 184.66382,357.7324 183.25714,353.51237 173.41039,350.69901 C 163.56365,347.88566 157.93694,346.47898 166.37701,346.47898 C 174.81707,346.47898 181.85046,345.0723 173.41039,342.25895 C 164.97033,339.44559 159.34362,340.85227 159.34362,340.85227 C 159.34362,340.85227 166.37701,350.69901 157.93694,347.88566 C 149.49688,345.0723 146.68352, [...]
+ id="path4171" />
+ <path
+ style="opacity:0.64583333;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 104.48319,346.47898 C 104.48319,346.47898 124.17668,346.47898 134.02342,350.69901 C 143.87017,354.91904 152.31023,359.13908 152.31023,359.13908 L 141.05681,352.10569 L 148.0902,349.29233 L 132.61675,347.88566 L 122.77,343.66562 L 111.51658,342.25895 L 104.48319,346.47898 z "
+ id="path4173" />
+ <path
+ style="opacity:0.37391304;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 148.0902,271.92507 C 148.0902,271.92507 134.02342,283.17849 134.02342,287.39852 C 134.02342,291.61855 144.5735,290.21188 150.20021,288.10186 C 155.82693,285.99184 183.96048,273.33174 183.96048,273.33174 C 183.96048,273.33174 202.24728,264.18834 207.17066,262.78166 C 212.09403,261.37499 211.39069,257.85829 208.57733,259.26497 C 205.76398,260.67165 181.14712,272.62841 176.92709,271.92507 C 172.70706,271.22173 186.07049,264.89168 193.10388,262.07832 C 200.13727,259.26497 214.907 [...]
+ id="path4181" />
+ <path
+ style="opacity:0.64583333;fill:url(#linearGradient4284);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 238.8209,248.01155 C 238.8209,248.01155 253.59102,240.27482 264.84444,238.86814 C 276.09786,237.46147 290.16463,232.53809 290.16463,232.53809 C 290.16463,232.53809 286.64794,231.13142 293.68133,226.20805 C 300.71471,221.28467 308.45144,219.878 311.2648,219.17466 C 314.07815,218.47132 322.51822,217.06464 322.51822,217.06464 L 328.84827,212.84461 C 328.84827,212.84461 330.25494,208.62458 325.33157,210.73459 C 320.4082,212.84461 299.30804,217.06464 295.088,219.17466 C 290.86797, [...]
+ id="path4183" />
+ <path
+ style="opacity:0.64583333;fill:url(#linearGradient4276);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 300.71471,233.24143 C 297.19802,230.42808 293.68133,229.72474 299.30804,226.20805 C 304.93475,222.69135 313.37481,221.28467 313.37481,221.28467 L 321.11154,221.28467 C 321.11154,221.28467 320.4082,227.61472 316.89151,229.0214 C 313.37481,230.42808 301.41805,233.94477 300.71471,233.24143 z "
+ id="path4185" />
+ <path
+ style="opacity:0.64583333;fill:url(#linearGradient4268);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 314.07815,233.24143 C 320.4082,231.83476 321.11154,232.53809 324.62823,229.0214 C 328.14493,225.50471 330.95828,223.39469 330.95828,223.39469 L 324.62823,226.20805 L 316.18817,229.72474 L 314.07815,233.24143 z "
+ id="path4187" />
+ <path
+ style="opacity:0.52916721;fill:url(#linearGradient4260);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 331.66162,226.20805 C 340.10169,223.39469 343.61838,223.39469 349.24509,223.39469 C 354.8718,223.39469 361.20185,222.69135 366.82856,221.98801 C 372.45527,221.28467 371.75193,221.98801 380.192,220.58134 C 388.63206,219.17466 401.9955,217.06464 401.9955,217.06464 C 401.9955,217.06464 399.88548,214.25129 397.07213,214.25129 C 394.25877,214.25129 378.08198,217.76798 371.04859,217.06464 C 364.01521,216.3613 354.16846,216.3613 354.16846,216.3613 C 354.16846,216.3613 346.43174,218. [...]
+ id="path4189" />
+ <path
+ style="opacity:0.64583333;fill:url(#linearGradient4252);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 328.84827,219.17466 C 333.0683,219.17466 337.28833,219.17466 343.61838,217.06464 C 349.94843,214.95463 352.76178,213.54795 352.76178,213.54795 L 345.7284,212.14127 C 345.7284,212.14127 336.58499,214.25129 333.77164,215.65796 C 330.95828,217.06464 328.84827,219.17466 328.84827,219.17466 z "
+ id="path4191" />
+ <path
+ style="opacity:0.64583333;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 181.14712,229.72474 C 183.96048,229.72474 191.6972,231.13142 197.32391,229.72474 C 202.95062,228.31806 207.874,224.09803 207.874,224.09803 C 207.874,224.09803 212.09403,224.80137 214.90738,221.98801 C 217.72074,219.17466 221.94077,214.25129 217.72074,214.95463 C 213.50071,215.65796 205.06064,217.76798 205.06064,217.76798 L 206.46732,221.28467 C 206.46732,221.28467 206.46732,224.80137 201.54395,225.50471 C 196.62057,226.20805 188.18051,228.31806 188.18051,228.31806 L 181.14712 [...]
+ id="path4193" />
+ <path
+ style="opacity:0.64583333;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 157.93694,237.46147 C 168.48702,234.64811 174.11373,232.53809 177.63043,229.72474 C 181.14712,226.91138 187.47717,222.69135 187.47717,222.69135 C 187.47717,222.69135 191.6972,219.878 183.25714,223.39469 C 174.81707,226.91138 161.45364,231.13142 157.2336,233.24143 C 153.01357,235.35145 143.16683,240.27482 143.16683,240.27482 L 157.93694,237.46147 z "
+ id="path4196" />
+ <path
+ style="opacity:0.64583333;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 197.32391,204.40454 C 197.32391,204.40454 226.1608,199.48117 246.55763,192.44778 C 266.95445,185.4144 316.89151,176.27099 321.81488,175.56765 C 326.73825,174.86431 337.28833,172.05096 331.66162,176.97433 C 326.03491,181.8977 346.69544,172.03842 349.5088,172.03842 C 352.32215,172.03842 371.34818,168.39074 371.34818,165.57739 C 371.34818,162.76403 335.17832,171.34762 330.25494,172.05096 C 325.33157,172.7543 252.88768,186.82107 241.63426,189.63443 C 230.38084,192.44778 202.24728 [...]
+ id="path4198"
+ sodipodi:nodetypes="cssssssscc" />
+ <path
+ style="opacity:0.64583333;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4893)"
+ d="M 704.43118,172.05096 C 707.24453,172.05096 706.54119,174.86431 709.35455,172.7543 C 712.1679,170.64428 714.98126,171.34762 714.98126,171.34762 L 722.71799,175.56765 C 722.71799,175.56765 729.04803,180.49102 724.12466,179.78769 C 719.20129,179.08435 714.27792,176.27099 714.27792,176.27099 L 703.0245,176.97433 L 661.33418,182.75928 L 704.43118,172.05096 z "
+ id="path4204"
+ sodipodi:nodetypes="csccscccc" />
+ <path
+ style="opacity:0.64583333;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4224)"
+ d="M 739.59812,158.68752 L 744.52149,161.50088 L 747.33484,166.42425 L 751.55488,167.83093 L 752.25821,172.05096 L 754.36823,172.7543 L 757.88492,169.2376 L 755.77491,165.72091 C 755.77491,165.72091 751.55488,167.12759 751.55488,164.31423 C 751.55488,161.50088 749.44486,160.0942 749.44486,160.0942 L 745.22483,160.0942 L 739.59812,158.68752 z "
+ id="path4206" />
+ <path
+ style="opacity:0.23043476;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter4947);enable-background:accumulate"
+ id="path4897"
+ d="M 621.30197,239.4505 C 624.12027,237.47741 626.76633,235.27038 629.39174,233.05097 C 633.25309,229.49658 633.88791,227.80033 639.23868,229.1477 C 640.29607,233.23181 635.44654,232.21121 636.21233,232.04658 C 639.53848,230.49824 640.65506,230.62118 644.68309,231.3182 C 647.60018,232.80428 639.83652,234.69854 646.92039,230.04636 C 649.61517,227.30332 653.17826,229.07588 656.53784,229.24406 C 650.50013,229.76573 657.20885,228.33896 658.58855,228.03677 C 660.71903,227.75977 662.755 [...]
+ <path
+ style="opacity:0.44347827;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter4994);enable-background:accumulate"
+ d="M 628.74011,237.72514 C 627.76327,238.05425 626.76357,238.38192 625.77136,238.66264 C 623.26828,239.46019 620.85528,240.45984 618.39636,241.38139 C 615.98832,242.26771 613.5685,243.10706 611.17761,244.03764 L 614.92761,244.47514 C 617.30226,243.58626 619.67633,242.73572 622.05261,241.85014 C 624.52331,240.90825 626.99045,239.90157 629.52136,239.13139 C 630.52917,238.86432 631.50306,238.5272 632.49011,238.19389 L 628.74011,237.72514 z M 611.55261,244.56889 C 610.12813,244.80021 [...]
+ id="path4953" />
+ <g
+ id="g5323"
+ style="filter:url(#filter5340)"
+ transform="translate(-78.38489,-99.39986)">
+ <path
+ d="M 281.13082,464.2974 C 286.24765,464.39344 291.38584,463.96362 296.45879,464.70349 C 301.75947,465.84482 307.12087,466.41227 312.53309,466.57891 C 317.58938,466.2882 322.39177,467.42402 327.02176,469.34731 C 331.33931,471.63868 336.07884,472.76726 340.9172,473.16063 C 360.54752,473.86979 338.38068,473.91879 345.29405,473.48198 C 378.91864,469.34197 342.6429,480.0824 358.34407,470.74052 L 368.6817,471.57398 C 363.58324,476.93587 338.02842,475.12321 357.86277,475.00812 C 358.65 [...]
+ id="path5309"
+ style="opacity:0.43043482;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ d="M 363.54863,478.71991 C 368.66255,478.40666 373.53416,480.00853 378.46215,481.06233 C 384.17653,481.50018 389.23671,481.93532 394.24098,484.89162 C 397.70604,487.49478 405.30244,487.24884 390.84081,486.34005 L 401.05309,487.78157 C 392.54615,488.00984 389.79691,489.78455 384.01981,485.97468 C 379.00064,483.25927 373.74202,483.16968 368.1792,482.45331 C 363.35069,481.28632 358.50572,480.07211 353.48792,480.31337 L 363.54863,478.71991 z "
+ id="path5317"
+ style="opacity:0.43043482;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ d="M 295.67278,462.82011 C 301.41449,460.46974 307.0718,461.53313 313.42699,462.11698 C 315.96967,462.35058 308.31531,462.18736 305.76745,462.01942 C 304.15183,461.91293 308.98499,461.65284 310.5911,461.44795 C 312.3367,461.04697 343.91306,467.58294 323.71027,466.14566 C 329.90899,463.09129 325.27787,464.83208 338.55264,466.09636 L 328.28941,467.1942 C 337.32642,465.87831 338.72426,464.61444 333.93557,467.4821 C 331.24073,467.6468 299.83048,466.33587 320.79228,462.93155 C 279.88 [...]
+ id="path5319"
+ style="opacity:0.43043482;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ </g>
+ <g
+ id="g5570"
+ style="filter:url(#filter5610)"
+ transform="translate(-78.38489,-99.39986)">
+ <path
+ sodipodi:nodetypes="ccccccccccccccccccccc"
+ id="path5564"
+ d="M 199.9375,392.53125 C 196.24354,398.29427 192.07048,404.72674 185.25079,406.79648 C 175.25073,412.14514 164.07968,416.81578 157.56744,426.46587 C 154.64216,430.63281 150.08698,436.31923 153.5625,441.5 C 158.02488,446.12965 165.39662,444.29424 171.16801,443.98591 C 173.50998,443.70474 175.79719,443.54801 177.53125,445.28125 C 180.13689,446.73175 183.99793,445.0898 186.0625,447.03125 C 189.39183,452.03377 196.46011,452.84508 202.125,451.6875 C 211.03645,452.19821 217.27172,460 [...]
+ style="opacity:0.58260869;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ id="path5556"
+ d="M 198.5,395.21875 C 192.97038,400.14782 188.65542,406.9127 181.34375,409.21875 C 171.40463,415.2619 162.67051,423.52265 152.71875,429.625 C 150.44445,433.18679 154.30698,436.72337 156.65625,439.125 C 160.25571,442.83382 165.73418,441.95716 170.34375,441.46875 C 171.63481,441.77371 171.26775,443.78154 173.0625,443.1875 C 176.07912,442.6342 179.20312,442.94012 181.34375,445.3125 C 188.31255,449.02565 196.89898,448.23541 203.53154,452.72784 C 205.00394,453.39574 208.22493,455.63 [...]
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ </g>
+ <path
+ style="opacity:0.85652174;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter5679);enable-background:accumulate"
+ d="M 128.95886,288.47514 C 124.19448,292.41848 122.2469,298.44635 118.14636,303.00639 C 115.54704,300.31717 114.35188,305.2205 112.45886,306.28764 C 106.30032,312.18203 98.91434,316.73029 90.70886,319.22514 C 87.2608,324.87902 81.08769,328.72137 75.52136,331.38139 C 78.50305,331.42865 77.25637,335.44262 79.42761,336.41264 C 79.92977,338.29881 81.01424,340.6136 83.36511,339.85014 C 86.78668,339.72794 88.33981,344.2353 92.02136,343.19389 C 100.79429,341.73506 107.4715,350.06744 116. [...]
+ id="path5616" />
+ <path
+ style="opacity:1;fill:#cee5e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4506)"
+ d="M 432.08386,237.38139 C 432.08386,237.38139 424.59116,240.88929 415.86511,245.35014 C 407.13906,249.81099 397.19667,255.19324 392.27136,259.00639 L 387.86628,262.59584 C 392.63571,258.90337 407.59377,250.70845 416.30261,246.25639 C 425.01145,241.80433 436.9414,235.57013 436.9414,235.57013 L 432.08386,237.38139 z "
+ id="path4468"
+ sodipodi:nodetypes="csccscc" />
+ <path
+ style="opacity:0.44347827;fill:url(#radialGradient4701);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4735)"
+ d="M 467.0223,235.95197 C 466.83739,236.13687 459.13404,239.80043 457.01482,240.33024 C 453.89411,241.11041 454.43706,242.14514 452.63656,244.39577 C 452.31095,244.80278 452.01109,245.22973 451.69836,245.6467 C 450.68982,246.99142 455.05384,244.69159 456.70209,245.02124 C 456.87988,245.05679 452.96191,248.20103 449.50922,250.96317 C 447.94142,252.21742 445.09858,254.09051 448.57102,254.09051 C 452.29942,254.09051 457.51066,250.40252 460.76763,248.77404 C 462.46875,247.92348 462.97 [...]
+ id="path4693" />
+ <path
+ style="fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter5748)"
+ d="M 353.80261,166.40619 C 287.00158,176.01331 218.30175,184.54191 157.23587,215.04995 C 144.47946,221.37815 131.69951,227.93401 120.74011,237.06244 C 128.76923,236.89943 133.85457,229.97774 140.84632,227.16753 C 198.75813,193.91588 265.3758,181.31056 330.86511,172.84369 C 339.96119,171.54766 368.40317,165.7958 377.3886,163.86725 C 376.03319,163.27562 355.4084,166.14348 353.80261,166.40619 z "
+ id="path5690"
+ sodipodi:nodetypes="ccccccc" />
+ <g
+ id="g5792"
+ transform="translate(-62.38489,-113.3999)"
+ style="filter:url(#filter5838)">
+ <path
+ style="opacity:0.56956524;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 451.54761,267.12585 C 451.13239,273.66074 445.76494,278.50433 440.30713,281.36394 C 425.37513,289.63987 409.04419,294.99942 394.04502,303.13137 C 392.69934,304.53356 388.81588,304.92253 389.07028,302.51234 C 391.33139,300.72745 394.20428,299.97795 396.6785,298.53727 C 411.64555,291.39622 427.47402,285.94195 441.62855,277.18325 C 444.77689,275.00936 447.60447,271.83424 448.09383,267.90371 C 448.66618,266.42703 450.41663,267.31451 451.54761,267.12585 z "
+ id="path5754" />
+ <path
+ style="opacity:0.56956524;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 503.65921,281.60132 C 477.2224,283.7835 451.58475,290.96432 425.96437,297.44065 C 408.51967,302.01159 391.49294,308.12747 374.959,315.31234 C 369.70851,317.84233 364.72914,320.8925 359.85957,324.0845 C 354.33929,324.0845 348.81902,324.0845 343.29874,324.0845 C 357.33832,314.54212 373.6056,309.17419 389.48251,303.57188 C 406.20534,298.03029 423.36458,293.95652 440.44274,289.68882 C 455.4555,286.126 470.63152,282.96659 486.03019,281.69628 C 491.90367,281.43475 497.78336,281.6 [...]
+ id="path5782" />
+ <path
+ style="opacity:0.56956524;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 340.10654,325.06082 C 353.10451,320.32563 365.39787,313.6987 378.81447,310.11822 C 393.20184,305.82779 407.82752,302.39893 422.40913,298.85006 C 435.99718,295.93663 449.68081,293.11485 463.58998,292.37389 C 472.67696,291.55037 481.79544,290.94034 490.92422,291.2511 C 494.10185,291.29026 497.2795,291.34089 500.45746,291.33905 C 494.79715,291.33905 489.13684,291.33905 483.47653,291.33905 C 489.36422,291.30092 495.25208,291.27904 501.13949,291.20598 C 490.92288,291.12897 480.7 [...]
+ id="path5786" />
+ <path
+ style="opacity:0.56956524;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 302.25275,333.12543 C 314.38964,328.09896 327.20617,324.90968 339.23248,319.59095 C 343.49208,317.86482 347.73636,316.09972 352.02634,314.44967 C 357.30748,314.44964 362.58861,314.44967 367.86975,314.44968 C 354.46275,319.61022 341.32343,325.50743 327.59479,329.79693 C 324.69919,330.85152 321.83313,331.98478 318.9706,333.12542 C 313.39798,333.12539 307.82536,333.12542 302.25275,333.12543 z "
+ id="path5790" />
+ <path
+ style="opacity:0.56956524;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 548.19769,292.35928 C 541.05047,294.50642 533.49958,293.916 526.14033,294.26178 C 513.59579,294.20243 501.10183,292.83468 488.56074,292.66289 C 492.57805,292.61554 496.59583,292.62094 500.61323,292.65401 C 487.45327,292.52806 474.19236,293.67363 461.13407,291.49595 C 454.19837,290.86474 447.25594,290.18024 440.3015,289.84941 C 439.34351,290.0293 433.96854,289.8992 437.29693,289.42643 C 446.3222,288.33755 455.43201,288.56081 464.50095,288.72245 C 459.65775,290.14615 454.5608 [...]
+ id="path5812" />
+ <path
+ style="opacity:0.56956524;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 448.95197,289.22824 C 458.33168,289.24441 467.71141,289.20295 477.09111,289.23251 C 473.27773,290.2501 469.28351,289.58972 465.38986,289.86625 C 454.3555,289.96978 443.29976,290.03834 432.29439,289.10931 C 439.04423,289.80733 445.80852,290.3528 452.56389,290.99267 C 456.53184,293.61581 461.48438,293.50007 466.05076,293.5051 C 461.27112,293.69872 456.49137,294.09945 451.70449,293.92874 C 455.26402,292.41838 459.23686,292.64564 462.94401,291.70725 C 465.55076,291.10534 469.19 [...]
+ id="path5814" />
+ <path
+ style="opacity:0.56956524;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 427.9548,291.345 C 421.01755,295.24443 413.99716,299.14942 406.45793,301.75452 C 402.23518,302.55188 397.89782,302.76583 393.62147,302.84203 C 390.16956,300.85356 395.80131,299.16122 397.32828,298.14086 C 403.85037,294.21522 411.19389,291.47332 418.85364,291.13551 C 422.65973,290.73211 419.11062,295.01562 417.02886,294.70124 C 407.85869,298.96355 398.0819,301.6451 388.61022,305.12122 C 383.33628,305.12122 378.06233,305.12122 372.78839,305.12122 C 381.9494,301.77394 391.2030 [...]
+ id="path5816" />
+ </g>
+ <path
+ transform="matrix(2.099877,7.334661e-2,-8.580182e-2,1.259985,-855.8121,-226.2624)"
+ d="M 607.74412 283.68604 A 3.854351 1.3676729 0 1 1 600.03542,283.68604 A 3.854351 1.3676729 0 1 1 607.74412 283.68604 z"
+ sodipodi:ry="1.3676729"
+ sodipodi:rx="3.854351"
+ sodipodi:cy="283.68604"
+ sodipodi:cx="603.88977"
+ id="path4408"
+ style="opacity:0.56956522;fill:url(#linearGradient4236);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.20000005;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter:url(#filter4733)"
+ sodipodi:type="arc" />
+ <g
+ style="opacity:1;display:inline;filter:url(#filter4385)"
+ id="g3453"
+ transform="translate(-78.38489,-101.3999)">
+ <path
+ sodipodi:nodetypes="cccccccccccccccccccccccccccccccscccccccccccc"
+ d="M 572.1296,195.82531 C 574.03004,196.07489 583.21661,195.76317 575.04453,195.96908 C 579.18355,195.34793 583.22496,195.96143 587.31963,196.26363 C 589.80992,196.50315 592.30543,196.52267 594.80388,196.47574 C 586.26964,196.86322 595.14507,196.1297 597.1362,196.02724 C 601.15939,195.58889 605.15908,195.89016 609.1735,196.03655 C 611.63714,196.02628 614.08018,196.45796 616.50672,196.8448 C 618.78631,197.31354 621.11656,197.14961 623.42504,197.2536 C 625.92127,197.63889 628.4416 [...]
+ id="path3448"
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ sodipodi:nodetypes="cccscccsccccccccccccccccccccccsscccccccc"
+ d="M 605.43294,196.45237 C 607.91269,196.42469 610.3878,196.42481 612.86194,196.60192 C 615.08122,196.78456 617.30551,196.81953 619.53094,196.81415 C 610.49756,196.62887 623.4896,196.89318 626.72544,197.43397 C 629.23286,197.85512 631.74965,198.20854 634.25712,198.62899 C 636.70704,199.11843 639.19686,199.15023 641.67557,199.35092 C 644.17,199.63374 646.61584,200.14794 649.1268,200.27573 C 649.51905,200.28094 650.6958,200.29019 650.30353,200.29136 C 641.48674,200.31755 654.4112, [...]
+ id="path3451"
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ </g>
+ <path
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter4411);enable-background:accumulate"
+ id="path4393"
+ d="M 465.9186,178.25723 C 468.43628,178.33387 470.92871,178.47044 473.42871,178.76377 C 475.90358,179.00967 478.29896,179.70653 480.74112,180.1389 C 490.28646,180.70333 479.65456,180.59566 482.82788,180.49185 C 486.90968,180.32951 490.99436,180.2603 495.07822,180.17461 C 497.51413,180.12786 499.94998,180.0778 502.38584,180.02833 C 501.21409,180.05294 500.04233,180.07809 498.87056,180.10217 C 498.06512,180.11874 500.48136,180.06569 501.28679,180.04881 C 504.19768,179.98781 507.1067 [...]
+ sodipodi:nodetypes="cccccsssccccccccccccccccccscccccccccsccccccccccccsccccccc" />
+ <g
+ id="g3473"
+ style="fill:white;filter:url(#filter4390)"
+ transform="translate(-78.38489,-99.39986)">
+ <path
+ d="M 833.15211,263.29784 C 835.77192,261.6999 838.18168,262.57341 837.35155,265.64364 L 835.13725,265.58112 C 835.51743,264.36105 836.74216,261.66874 835.34188,263.50987 L 833.15211,263.29784 z "
+ id="path3463"
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ d="M 843.95451,277.36203 C 843.92944,277.77651 843.90438,278.191 843.87931,278.60549 L 841.67304,278.59074 C 841.70315,278.18117 841.73327,277.7716 841.76339,277.36203 L 843.95451,277.36203 z "
+ id="path3471"
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path4409"
+ d="M 803.16345,302.58571 C 804.4486,302.26635 805.75041,302.02036 807.04504,301.74343 C 808.44608,301.4433 809.83989,301.11053 811.23656,300.79083 C 812.37483,300.5269 813.51798,300.28536 814.66167,300.04632 C 815.66426,299.86181 816.64824,299.59891 817.61488,299.27732 C 818.54787,298.94717 819.44824,298.53512 820.34262,298.11361 C 821.27352,297.66703 822.16396,297.14245 823.01904,296.56509 C 823.83045,295.98552 824.60655,295.35777 825.31599,294.65689 C 826.11276,293.78257 826.7 [...]
+ <path
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path4417"
+ d="M 833.18001,285.62603 C 831.59519,286.09411 830.12592,286.86815 828.70028,287.68924 C 827.0214,288.63544 825.61484,289.88607 824.51163,291.4584 C 824.37895,291.68674 824.24628,291.91508 824.1136,292.14343 L 822.96412,292.08253 C 823.10032,291.85123 823.23652,291.61994 823.37272,291.38865 C 824.4853,289.80202 825.89544,288.53256 827.58719,287.57254 C 828.98727,286.75251 830.42841,285.98041 831.97386,285.46861 L 833.18001,285.62603 z " />
+ <path
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path4428"
+ d="M 817.47954,287.02994 C 818.73632,286.10486 820.15544,285.42631 821.52266,284.68226 C 823.41606,283.67857 825.13369,282.3968 826.85262,281.12789 C 827.12156,280.93035 827.3905,280.73282 827.65944,280.53529 L 828.77546,280.64031 C 828.5056,280.83769 828.23575,281.03506 827.96589,281.23244 C 826.24125,282.49759 824.52286,283.78188 822.63617,284.80173 C 821.29546,285.54367 819.91153,286.23049 818.66914,287.13276 L 817.47954,287.02994 z " />
+ <path
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path4436"
+ d="M 807.30022,282.70462 C 806.69478,281.42948 805.72131,280.47361 804.6532,279.58291 C 802.65981,278.10661 800.52146,276.83909 798.40708,275.54625 C 797.04846,274.74106 797.72659,275.13587 796.37294,274.36142 L 797.98721,274.19143 C 799.3352,274.96969 798.66009,274.57299 800.01232,275.38191 C 802.13384,276.68967 804.28075,277.96821 806.29533,279.43818 C 807.39342,280.34151 808.40721,281.31059 809.00961,282.62531 L 807.30022,282.70462 z " />
+ <path
+ style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path4444"
+ d="M 807.39515,255.32634 C 805.13238,255.11794 809.45257,255.21666 810.01296,255.34397 C 807.12514,255.38645 809.67569,255.29672 811.26458,255.34645 C 812.05692,255.54176 816.43278,255.11646 814.842,255.75102 C 812.9026,255.78128 810.9628,255.77107 809.02323,255.76551 C 806.74637,255.29024 814.41155,256.00237 815.08758,256.0446 C 816.30924,256.25386 821.6132,255.95162 816.15929,256.30494 C 814.66449,256.09831 813.16689,255.92786 811.661,255.82957 C 808.21909,255.46442 812.21455, [...]
+ </g>
+ <path
+ style="fill:#1c2e3b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 349.44442,289.40813 C 349.44442,289.40813 363.55685,278.76191 370.73686,277.52398 C 377.91686,276.28605 388.31549,275.54329 393.01963,277.52398 C 397.72377,279.50467 401.68516,282.97088 401.68516,282.97088 C 401.68516,282.97088 396.23826,274.80053 380.8879,275.04811 C 365.53754,275.2957 349.44442,289.40813 349.44442,289.40813 z "
+ id="path4239" />
+ <path
+ style="opacity:0.75;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3927);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 726.80149,258.82192 C 726.80149,258.82192 723.81748,269.26597 720.33613,275.73134 C 716.85478,282.1967 712.37876,288.66206 704.42139,293.63542 C 696.46402,298.60877 696.46402,298.60877 696.46402,298.60877"
+ id="path3919" />
+ <path
+ style="opacity:0.64583333;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4224)"
+ d="M 466.70267,311.31204 C 466.70267,311.31204 484.98948,298.65194 487.09949,299.35528 C 489.20951,300.05862 475.84607,311.31204 475.84607,311.31204 L 468.81268,319.04877 L 461.7793,323.2688 C 461.7793,323.2688 470.21936,316.23541 466.70267,311.31204 z "
+ id="path4201" />
+ <path
+ style="opacity:0.40869565;fill:white;fill-opacity:0.75;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4440)"
+ d="M 421.97743,300.02484 C 428.58554,299.83897 437.47208,290.59554 445.55131,288.94225 C 448.94951,288.24686 472.28725,276.35893 475.9605,277.21591 C 478.79015,277.87607 455.27936,289.48969 453.78262,290.68995 C 451.95893,292.1524 448.14869,292.49824 446.11543,293.67214 C 443.52429,295.16814 439.87249,296.27329 437.36491,297.27981 C 435.11352,298.18348 433.9241,299.26636 432.48988,300.0944 C 431.00277,300.95298 428.6992,303.47485 427.58417,304.73228 C 425.72504,306.82884 423.92037 [...]
+ id="path4222"
+ sodipodi:nodetypes="csssssssssc" />
+ <path
+ style="opacity:1;fill:white;fill-opacity:0.75;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter5213)"
+ d="M 422.26692,315.64432 C 422.09706,317.45992 422.77823,319.32056 423.59374,320.95158 C 424.52613,322.81636 426.15167,317.46125 428.01645,316.52886 C 429.47466,315.79976 431.82226,312.8977 432.43917,311.66387 C 433.49616,309.54989 437.7531,308.56663 439.9578,308.12569 C 442.45048,307.62716 444.76195,305.70841 447.47642,305.02979 C 450.53429,304.26532 452.15145,302.06033 454.99504,301.49162 C 455.89385,301.31185 459.99298,297.37822 460.3023,297.0689 C 462.17734,295.19387 464.6585, [...]
+ id="path5155" />
+ <path
+ style="opacity:1;fill:#fff600;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4647)"
+ d="M 492.95886,215.22514 C 486.78924,217.28408 466.07377,224.16019 460.27955,226.5306 C 462.38458,227.74155 478.60477,220.08954 480.74265,219.88596 C 485.06326,218.57954 497.44392,213.88199 501.53379,212.29195 C 501.54055,211.8419 493.35428,215.06983 492.95886,215.22514 z "
+ id="path4510"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="opacity:1;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4687)"
+ d="M 422.7182,251.1582 C 415.74842,255.23726 395.39528,264.4289 389.55261,269.97514 C 390.115,271.2847 394.55674,272.10929 394.99174,270.78857 C 399.64935,265.47244 416.71979,255.022 423.28023,251.81375 C 423.09414,251.26564 423.54118,250.93119 422.7182,251.1582 z "
+ id="path4512"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="opacity:1;fill:url(#linearGradient3143);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4461)"
+ d="M 378.19774,270.74504 C 378.19774,270.74504 491.64312,221.72543 510.55069,215.42291 C 529.45825,209.12039 616.29298,188.81227 619.0941,188.81227 C 621.89522,188.81227 603.68794,191.61339 577.77758,197.21563 C 551.86721,202.81787 473.43584,218.22403 449.62632,228.72823 C 425.81679,239.23244 376.79718,270.04476 378.19774,270.74504 z "
+ id="path3135" />
+ <path
+ style="opacity:0.56956524;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter5896);enable-background:accumulate"
+ id="path5842"
+ d="M 493.60176,181.55652 C 497.90285,181.50523 502.18285,181.97167 506.47895,182.11911 C 522.03366,182.23108 484.56703,182.22398 503.21013,182.13839 C 513.84415,180.81138 522.59053,181.91214 532.43515,184.0366 C 536.74496,184.58355 541.08093,184.94235 545.4054,185.3803 C 564.25286,185.67655 527.79065,186.77493 541.73105,185.03742 C 551.54906,183.81864 561.55902,184.35387 571.39984,184.36089 C 575.21327,184.42367 579.027,184.44448 582.84088,184.44534 C 553.04333,186.50989 570.03524 [...]
+ <path
+ style="opacity:0.56956524;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter5926)"
+ d="M 541.70886,274.10014 C 535.62176,274.419 530.37512,276.59241 525.20886,277.88139 C 515.04724,280.41673 505.653,287.33122 494.36511,305.13139 C 486.84547,316.98929 483.22897,327.28162 479.05261,339.16264 C 474.87625,351.04366 461.57032,383.65913 449.17347,400.99461 L 461.24011,383.41264 C 471.04896,364.9489 475.81385,351.35587 479.99011,339.47514 C 484.16637,327.59441 487.7514,317.42248 495.20886,305.66264 C 506.42555,287.97475 515.53763,281.3177 525.42761,278.85014 C 533.85615 [...]
+ id="path5908"
+ sodipodi:nodetypes="csssccsssccc" />
+ <path
+ sodipodi:nodetypes="csssccsssccc"
+ id="path4364"
+ d="M 539.70886,274.10014 C 533.62176,274.419 528.37512,276.59241 523.20886,277.88139 C 513.04724,280.41673 503.653,287.33122 492.36511,305.13139 C 484.84547,316.98929 481.22897,327.28162 477.05261,339.16264 C 472.87625,351.04366 459.57032,383.65913 447.17347,400.99461 L 459.24011,383.41264 C 469.04896,364.9489 473.81385,351.35587 477.99011,339.47514 C 482.16637,327.59441 485.7514,317.42248 493.20886,305.66264 C 504.42555,287.97475 513.53763,281.3177 523.42761,278.85014 C 531.85615 [...]
+ style="opacity:0.56956524;fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4383)" />
+ <path
+ style="fill:white;fill-opacity:0.58506224;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 521.91476,176.44683 L 522.79394,179.61185 L 527.1898,177.67767 L 532.28901,174.68848 L 541.78408,171.34762 L 533.69569,173.45764 C 533.69569,173.45764 531.89338,171.78721 530.17899,171.87513 C 528.4646,171.96304 526.83814,173.80931 526.83814,173.80931 L 525.07979,175.04015 L 522.96977,175.56765 L 521.91476,176.44683 z "
+ id="path4358"
+ sodipodi:nodetypes="cccccczcccc" />
+ <path
+ sodipodi:nodetypes="cccccczcccc"
+ id="path4406"
+ d="M 381.46562,168.59198 L 382.08087,171.28455 L 385.94098,169.83082 L 390.45165,167.51829 L 398.75259,165.08123 L 391.71391,166.53914 C 391.71391,166.53914 390.23999,165.06604 388.76395,165.07326 C 387.28792,165.08048 385.80977,166.56801 385.80977,166.56801 L 384.24553,167.53348 L 382.41037,167.89455 L 381.46562,168.59198 z "
+ style="fill:url(#linearGradient4244);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cs"
+ id="path4411"
+ d="M 410.03028,166.47989 C 410.03028,166.47989 448.077,159.61555 484.80919,169.12418"
+ style="opacity:0.68333333;fill:none;fill-opacity:0.58506224;fill-rule:evenodd;stroke:url(#linearGradient4429);stroke-width:0.51016539;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:#131313;fill-opacity:0.72614112;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 522.79394,182.24937 L 527.71731,182.77687 L 527.89314,181.3702 L 529.47566,179.61185 L 531.58567,178.38101 L 533.69569,176.97433 C 533.69569,176.97433 528.59648,180.31519 527.54147,180.84269 C 526.48647,181.3702 523.49728,181.3702 523.49728,181.3702 L 522.79394,182.24937 z "
+ id="path4431" />
+ <path
+ style="opacity:0.33913042;fill:black;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4351)"
+ d="M 723.74011,283.28764 L 586.17761,358.28764 L 586.67761,359.16264 L 723.43176,283.38554 L 723.74011,283.28764 z "
+ id="path3452"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="opacity:0.48260869;color:black;fill:black;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter4643);enable-background:accumulate"
+ id="path4580"
+ d="M 530.44587,184.72471 C 529.0348,184.5993 527.61968,184.43401 526.25018,184.06255 C 525.02029,183.61158 523.81991,183.09715 522.4972,183.06851 C 528.41033,182.57942 521.44607,183.63356 525.55504,184.36957 C 529.74407,184.73666 518.6199,184.08647 529.84014,184.48481 C 533.34789,184.73269 527.83661,184.36325 526.7192,184.17212 C 524.90336,183.96736 518.87984,184.03921 526.77044,183.9797 C 531.44706,184.32598 524.36369,184.54237 528.08752,183.95711 C 522.82175,182.12544 530.14168, [...]
+ <path
+ style="opacity:0.48260869;color:black;fill:black;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter4697);enable-background:accumulate"
+ id="path4647"
+ d="M 524.94946,182.2867 C 529.06943,184.22193 523.50851,183.25107 525.05262,183.01083 C 526.43936,182.7444 527.80045,182.36232 529.16414,181.99937 C 529.69745,181.94674 527.03243,181.78997 527.56809,181.80617 C 530.07329,181.88195 530.90372,181.72326 529.14644,181.96445 C 524.94823,182.68658 534.09396,182.8187 527.21252,182.70899 C 529.02064,182.54897 530.76914,182.03149 532.50842,181.54001 C 534.58427,180.97823 536.61812,180.28688 538.57224,179.38867 C 539.2715,178.96255 542.9303 [...]
+ <path
+ style="opacity:0.48260869;color:black;fill:black;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;filter:url(#filter4773);enable-background:accumulate"
+ d="M 381.43289,173.91755 C 385.48294,173.53956 389.56097,173.44096 393.62411,173.51817 C 396.10718,173.94765 398.61542,174.30352 401.02777,175.05515 C 400.8412,176.00594 399.27905,175.31905 398.53114,175.53198 C 395.28188,175.44405 392.01882,175.16271 388.84142,174.47676 C 387.47492,173.87116 389.39209,173.40671 390.04607,173.4273 C 394.0905,172.61221 398.16968,171.91424 402.13117,170.73799 C 401.6203,171.00238 399.97763,171.16866 400.53962,171.93023 C 401.64559,172.17048 402.7966 [...]
+ id="path4738" />
+ </g>
+ <path
+ style="opacity:0.68333333;fill:none;fill-opacity:0.58506224;fill-rule:evenodd;stroke:url(#linearGradient4378);stroke-width:0.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 554.97169,172.40263 C 554.97169,172.40263 598.75453,162.20422 642.00986,171.52345"
+ id="path4370"
+ sodipodi:nodetypes="cs" />
+</svg>
diff --git a/test/Circle_and_quadratic_bezier.svg b/test/Circle_and_quadratic_bezier.svg
new file mode 100644
index 0000000..09ac548
--- /dev/null
+++ b/test/Circle_and_quadratic_bezier.svg
@@ -0,0 +1,35 @@
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="256" height="256" version="1.1"
+xmlns="http://www.w3.org/2000/svg">
+
+<!-- circle and a quadratic bezier path approximating it -->
+<circle cx="128" cy="128" r="112" stroke="black" stroke-width="8"
+fill="none"/>
+<path d="M 16 128 Q 16 82 49 49 T 128 16 207 49 240 128 207 207 128 240 49 207 16 128" stroke="red" stroke-width="4" fill="none"/>
+
+<!-- visualization of on-curve points -->
+<g stroke-width="2" fill="#FFFFFF" fill-opacity="0.5" stroke="black">
+<rect x="10" y="122" width="12" height="12"/>
+<rect x="234" y="122" width="12" height="12"/>
+<rect x="122" y="10" width="12" height="12"/>
+<rect x="122" y="234" width="12" height="12"/>
+<rect x="43" y="43" width="12" height="12"/>
+<rect x="43" y="201" width="12" height="12"/>
+<rect x="201" y="43" width="12" height="12"/>
+<rect x="201" y="201" width="12" height="12"/>
+</g>
+<!-- visualization of off-curve points -->
+<g stroke-width="2" fill="none" stroke="green">
+<circle cx="16" cy="82" r="6"/>
+<circle cx="82" cy="16" r="6"/>
+<circle cx="174" cy="16" r="6"/>
+<circle cx="240" cy="82" r="6"/>
+<circle cx="16" cy="174" r="6"/>
+<circle cx="82" cy="240" r="6"/>
+<circle cx="174" cy="240" r="6"/>
+<circle cx="240" cy="174" r="6"/>
+</g>
+
+</svg>
+
diff --git a/test/Coat_of_arms_Holy_See.svg b/test/Coat_of_arms_Holy_See.svg
new file mode 100644
index 0000000..aae42f3
--- /dev/null
+++ b/test/Coat_of_arms_Holy_See.svg
@@ -0,0 +1,3454 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="1160"
+ height="1300"
+ id="svg548"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="Santa Sede.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata505">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="838"
+ inkscape:window-width="1600"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.87211803"
+ inkscape:cx="806.94479"
+ inkscape:cy="1004.9592"
+ inkscape:window-x="-8"
+ inkscape:window-y="-8"
+ inkscape:current-layer="svg548"
+ inkscape:showpageshadow="false"
+ height="1300px"
+ width="1160px"
+ showgrid="false"
+ inkscape:window-maximized="1" />
+ <defs
+ id="defs550">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 650 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="1160 : 650 : 1"
+ inkscape:persp3d-origin="580 : 433.33333 : 1"
+ id="perspective4488" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3716">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop3718" />
+ <stop
+ style="stop-color:#000000;stop-opacity:0;"
+ offset="1"
+ id="stop3720" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient5938">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop5940" />
+ <stop
+ id="stop5946"
+ offset="0.5"
+ style="stop-color:#000000;stop-opacity:0;" />
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="1"
+ id="stop5942" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient7546">
+ <stop
+ style="stop-color:#6d0000;stop-opacity:1;"
+ offset="0"
+ id="stop7548" />
+ <stop
+ style="stop-color:#8a0000;stop-opacity:0;"
+ offset="1"
+ id="stop7550" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient13829">
+ <stop
+ id="stop13831"
+ offset="0.00000000"
+ style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+ <stop
+ id="stop13833"
+ offset="1.0000000"
+ style="stop-color:#c9c9c9;stop-opacity:1.0000000;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient15699">
+ <stop
+ style="stop-color:black;stop-opacity:0.78431374;"
+ offset="0"
+ id="stop15701" />
+ <stop
+ style="stop-color:black;stop-opacity:0;"
+ offset="1"
+ id="stop15703" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient47938">
+ <stop
+ id="stop47940"
+ offset="0"
+ style="stop-color:black;stop-opacity:0.78431374;" />
+ <stop
+ id="stop47942"
+ offset="1"
+ style="stop-color:black;stop-opacity:0;" />
+ </linearGradient>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6703"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.588501" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6705"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.4512358" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6707"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.4512358" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6709"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.5615053" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6711"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.4512358" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6713"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.4512358" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6715"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.588501" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6717"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.4512358" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6719"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.4512358" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6721"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.5615053" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient47938"
+ id="linearGradient6725"
+ gradientUnits="userSpaceOnUse"
+ x1="67.848282"
+ y1="738.42761"
+ x2="50.14476"
+ y2="719.41022" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient7546"
+ id="linearGradient6733"
+ gradientUnits="userSpaceOnUse"
+ x1="66.986511"
+ y1="737.42224"
+ x2="54.166351"
+ y2="717.97394" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient7546"
+ id="linearGradient6735"
+ gradientUnits="userSpaceOnUse"
+ x1="66.986511"
+ y1="737.42224"
+ x2="54.166351"
+ y2="717.97394" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient7546"
+ id="linearGradient6741"
+ gradientUnits="userSpaceOnUse"
+ x1="66.986511"
+ y1="737.42224"
+ x2="54.166351"
+ y2="717.97394" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient47938"
+ id="linearGradient6747"
+ gradientUnits="userSpaceOnUse"
+ x1="67.848282"
+ y1="738.42761"
+ x2="50.14476"
+ y2="719.41022" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient7546"
+ id="linearGradient6755"
+ gradientUnits="userSpaceOnUse"
+ x1="66.986511"
+ y1="737.42224"
+ x2="54.166351"
+ y2="717.97394" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient7546"
+ id="linearGradient6757"
+ gradientUnits="userSpaceOnUse"
+ x1="66.986511"
+ y1="737.42224"
+ x2="54.166351"
+ y2="717.97394" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient7546"
+ id="linearGradient6765"
+ gradientUnits="userSpaceOnUse"
+ x1="66.986511"
+ y1="737.42224"
+ x2="54.166351"
+ y2="717.97394" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6769"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.5615053" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient13829"
+ id="radialGradient6771"
+ gradientUnits="userSpaceOnUse"
+ cx="483"
+ cy="295.36218"
+ fx="483"
+ fy="295.36218"
+ r="8.588501" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5938"
+ id="linearGradient4151"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,986.49452,-26.402233)"
+ x1="220.00923"
+ y1="585.75665"
+ x2="289.75815"
+ y2="336.03055" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5938"
+ id="linearGradient4180"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(172.5,-26.402233)"
+ x1="220.00923"
+ y1="585.75665"
+ x2="289.75815"
+ y2="336.03055" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4206"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,975.26137,-19.173586)"
+ x1="712.1015"
+ y1="361.16354"
+ x2="691.15192"
+ y2="340.79373" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4365"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,1048.5681,-18.173536)"
+ x1="332.67072"
+ y1="560.21875"
+ x2="362.8866"
+ y2="524.28125" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3716"
+ id="linearGradient4383"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(45,11.2031)"
+ x1="541.22974"
+ y1="620.25403"
+ x2="541.22974"
+ y2="896.74103" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4388"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,1048.5681,-18.173536)"
+ x1="465.00714"
+ y1="722.60028"
+ x2="503.29758"
+ y2="684.6947" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4391"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,1065.8524,0.112804)"
+ x1="180.64561"
+ y1="371"
+ x2="216.08575"
+ y2="335.03125" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4394"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,1048.5681,-18.173536)"
+ x1="142.45555"
+ y1="371"
+ x2="181.51711"
+ y2="335.03125" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4420"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(184.73857,-18.173536)"
+ x1="317.13693"
+ y1="706.63019"
+ x2="340.87903"
+ y2="732.13678" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4431"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,1048.5681,-18.173536)"
+ x1="357.59586"
+ y1="591.03546"
+ x2="386.45517"
+ y2="558.97174" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4436"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,1048.5681,-18.173536)"
+ x1="137.17198"
+ y1="353.92398"
+ x2="153.66492"
+ y2="337.09677" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4442"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,992.54577,-0.887246)"
+ x1="712.1015"
+ y1="361.16354"
+ x2="691.15192"
+ y2="340.79373" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4446"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,975.26137,-19.173586)"
+ x1="528.66467"
+ y1="557.83734"
+ x2="505.2981"
+ y2="532.68506" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4458"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,975.26137,-19.173586)"
+ x1="317.13693"
+ y1="706.63019"
+ x2="340.87903"
+ y2="732.13678" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5938"
+ id="linearGradient4463"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,986.49452,-26.402233)"
+ x1="275.27222"
+ y1="605.04657"
+ x2="371.20041"
+ y2="483.05093" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4468"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,975.26137,-19.173586)"
+ x1="387.77902"
+ y1="745.27277"
+ x2="341.07867"
+ y2="697.09375" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4520"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,975.26137,-19.173586)"
+ x1="515.59467"
+ y1="592.45251"
+ x2="483.5217"
+ y2="560.38879" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient4525"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,975.26137,-19.173586)"
+ x1="718.15417"
+ y1="353.92398"
+ x2="706.30652"
+ y2="340.63934" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3716"
+ id="linearGradient4532"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(45,11.2031)"
+ x1="541.22974"
+ y1="620.25403"
+ x2="541.22974"
+ y2="896.74103" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3716"
+ id="linearGradient4536"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(45,11.2031)"
+ x1="541.22974"
+ y1="620.25403"
+ x2="541.22974"
+ y2="896.74103" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3716"
+ id="linearGradient4540"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(45,11.2031)"
+ x1="541.22974"
+ y1="620.25403"
+ x2="541.22974"
+ y2="896.74103" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5938"
+ id="linearGradient4568"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(172.5,-26.402233)"
+ x1="275.27222"
+ y1="605.04657"
+ x2="371.20041"
+ y2="483.05093" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3716"
+ id="linearGradient5423"
+ x1="580.93158"
+ y1="743.56537"
+ x2="580.93158"
+ y2="647.30627"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3716"
+ id="linearGradient2719"
+ gradientUnits="userSpaceOnUse"
+ x1="580.93158"
+ y1="743.56537"
+ x2="580.93158"
+ y2="647.30627"
+ gradientTransform="matrix(-1,0,0,1,1160,0)" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5938"
+ id="linearGradient2727"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(173.50548,-26.402233)"
+ x1="220.00923"
+ y1="585.75665"
+ x2="289.75815"
+ y2="336.03055" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5938"
+ id="linearGradient2756"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,987.5,-26.402233)"
+ x1="220.00923"
+ y1="585.75665"
+ x2="289.75815"
+ y2="336.03055" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient2782"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(184.73863,-19.173586)"
+ x1="712.1015"
+ y1="361.16354"
+ x2="691.15192"
+ y2="340.79373" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient2941"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(111.4319,-18.173536)"
+ x1="332.67072"
+ y1="560.21875"
+ x2="362.8866"
+ y2="524.28125" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3716"
+ id="linearGradient2980"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,1115,11.2031)"
+ x1="541.22974"
+ y1="620.25403"
+ x2="541.22974"
+ y2="896.74103" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient2983"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(94.1476,0.112804)"
+ x1="180.64561"
+ y1="371"
+ x2="216.08575"
+ y2="335.03125" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient2986"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(111.4319,-18.173536)"
+ x1="142.45555"
+ y1="371"
+ x2="181.51711"
+ y2="335.03125" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient3004"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(111.4319,-18.173536)"
+ x1="357.59586"
+ y1="591.03546"
+ x2="386.45517"
+ y2="558.97174" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient3009"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(111.4319,-18.173536)"
+ x1="137.17198"
+ y1="353.92398"
+ x2="153.66492"
+ y2="337.09677" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient3015"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(167.45423,-0.887246)"
+ x1="712.1015"
+ y1="361.16354"
+ x2="691.15192"
+ y2="340.79373" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient3019"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(184.73863,-19.173586)"
+ x1="528.66467"
+ y1="557.83734"
+ x2="505.2981"
+ y2="532.68506" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient3031"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(184.73863,-19.173586)"
+ x1="317.13693"
+ y1="706.63019"
+ x2="340.87903"
+ y2="732.13678" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5938"
+ id="linearGradient3036"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(173.50548,-26.402233)"
+ x1="275.27222"
+ y1="605.04657"
+ x2="371.20041"
+ y2="483.05093" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient3041"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(184.73863,-19.173586)"
+ x1="387.77902"
+ y1="745.27277"
+ x2="341.07867"
+ y2="697.09375" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient3093"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(184.73863,-19.173586)"
+ x1="515.59467"
+ y1="592.45251"
+ x2="483.5217"
+ y2="560.38879" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient15699"
+ id="linearGradient3098"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(184.73863,-19.173586)"
+ x1="718.15417"
+ y1="353.92398"
+ x2="706.30652"
+ y2="340.63934" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3716"
+ id="linearGradient3105"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,1115,11.2031)"
+ x1="541.22974"
+ y1="620.25403"
+ x2="541.22974"
+ y2="896.74103" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3716"
+ id="linearGradient3109"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,1115,11.2031)"
+ x1="541.22974"
+ y1="620.25403"
+ x2="541.22974"
+ y2="896.74103" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3716"
+ id="linearGradient3113"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,1115,11.2031)"
+ x1="541.22974"
+ y1="620.25403"
+ x2="541.22974"
+ y2="896.74103" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5938"
+ id="linearGradient3141"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-1,0,0,1,987.5,-26.402233)"
+ x1="275.27222"
+ y1="605.04657"
+ x2="371.20041"
+ y2="483.05093" />
+ </defs>
+ <g
+ transform="translate(-7.956705,953.48578)"
+ id="g3012" />
+ <rect
+ width="0"
+ height="0"
+ x="-223.51041"
+ y="1042.4105"
+ transform="scale(-1,1)"
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke-width:1pt"
+ id="rect1788" />
+ <rect
+ width="0"
+ height="0"
+ x="219.20564"
+ y="1155.7438"
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke-width:1pt"
+ id="rect4458" />
+ <g
+ style="fill-rule:evenodd"
+ id="Layer 2"
+ transform="matrix(1.12205,0,0,1.12205,-16490.58,-3469.5957)" />
+ <g
+ style="fill-rule:evenodd"
+ id="g22906"
+ transform="matrix(26.40912,0,0,27.77001,-39646.771,-7528.2797)">
+ <defs
+ id="defs22908">
+ <polygon
+ id="XMLID_5_"
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 " />
+ </defs>
+ <clipPath
+ id="XMLID_23_">
+ <use
+ height="1063.9662"
+ width="602.03467"
+ y="0"
+ x="0"
+ xlink:href="#XMLID_5_"
+ id="use22912" />
+ </clipPath>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:2.26212406;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="g24507"
+ transform="matrix(17.58441,0,0,18.49055,-38203.071,-13390.408)">
+ <g
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ transform="matrix(1.659777,0,0,1.659777,-197.8029,53.47059)"
+ id="g24483">
+ <defs
+ id="defs24485" />
+ <clipPath
+ id="clipPath24489">
+ <polygon
+ id="use24491"
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 " />
+ </clipPath>
+ </g>
+ <g
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ transform="matrix(1.659777,0,0,1.659777,-115.3058,53.47059)"
+ id="g24495">
+ <defs
+ id="defs24497" />
+ <clipPath
+ id="clipPath24501">
+ <polygon
+ id="use24503"
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 " />
+ </clipPath>
+ </g>
+ </g>
+ <g
+ id="g8182"
+ transform="matrix(17.35147,0,0,17.35147,-31220.83,-3483.6127)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs8184" />
+ <clipPath
+ id="clipPath8188">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon8190" />
+ </clipPath>
+ </g>
+ <g
+ id="g8192"
+ transform="matrix(17.35147,0,0,17.35147,-30358.4,-3483.6127)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs8194" />
+ <clipPath
+ id="clipPath8198">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon8200" />
+ </clipPath>
+ </g>
+ <g
+ style="fill-rule:evenodd"
+ id="g5178"
+ transform="matrix(24.8662,0,0,24.8662,-30066.59,3391.5043)">
+ <defs
+ id="defs5180" />
+ <clipPath
+ id="clipPath5184">
+ <use
+ height="1063.9662"
+ width="602.03467"
+ y="0"
+ x="0"
+ xlink:href="#XMLID_5_"
+ id="use5186" />
+ </clipPath>
+ </g>
+ <g
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:2.26212406;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="g5188"
+ transform="matrix(16.55706,0,0,16.55706,-28707.23,-1857.6507)">
+ <g
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ transform="matrix(1.659777,0,0,1.659777,-197.8029,53.47059)"
+ id="g5190">
+ <defs
+ id="defs5192" />
+ <clipPath
+ id="clipPath5196">
+ <polygon
+ id="polygon5198"
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 " />
+ </clipPath>
+ </g>
+ <g
+ style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ transform="matrix(1.659777,0,0,1.659777,-115.3058,53.47059)"
+ id="g5200">
+ <defs
+ id="defs5202" />
+ <clipPath
+ id="clipPath5206">
+ <polygon
+ id="polygon5208"
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 " />
+ </clipPath>
+ </g>
+ </g>
+ <g
+ id="g6952"
+ transform="matrix(11.22601,0,0,11.22601,-17271.77,3682.8903)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs6954" />
+ <clipPath
+ id="clipPath6958">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon6960" />
+ </clipPath>
+ </g>
+ <g
+ id="g6962"
+ transform="matrix(11.22601,0,0,11.22601,-16713.8,3682.8903)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs6964" />
+ <clipPath
+ id="clipPath6968">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon6970" />
+ </clipPath>
+ </g>
+ <g
+ id="g51404"
+ transform="matrix(12.5761,0,0,12.5761,-16820.7,-195.92742)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs51406" />
+ <clipPath
+ id="clipPath51410">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon51412" />
+ </clipPath>
+ </g>
+ <g
+ id="g51414"
+ transform="matrix(12.5761,0,0,12.5761,-16195.621,-195.92742)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs51416" />
+ <clipPath
+ id="clipPath51420">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon51422" />
+ </clipPath>
+ </g>
+ <rect
+ width="0"
+ height="0"
+ x="-191.58888"
+ y="1061.1434"
+ transform="scale(-1,1)"
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke-width:1pt"
+ id="rect2304" />
+ <rect
+ width="0"
+ height="0"
+ x="187.28412"
+ y="1174.4768"
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke-width:1pt"
+ id="rect2341" />
+ <g
+ id="g2367"
+ transform="matrix(29.1862,0,0,30.69019,-41713.241,-12382.978)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs2369" />
+ <clipPath
+ id="clipPath2371">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon2373" />
+ </clipPath>
+ </g>
+ <g
+ id="g2375"
+ transform="matrix(29.1862,0,0,30.69019,-40262.571,-12382.978)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs2377" />
+ <clipPath
+ id="clipPath2379">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon2381" />
+ </clipPath>
+ </g>
+ <g
+ id="g2410"
+ transform="matrix(27.48103,0,0,27.48103,-32014.18,-953.60172)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs2412" />
+ <clipPath
+ id="clipPath2414">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon2416" />
+ </clipPath>
+ </g>
+ <g
+ id="g2418"
+ transform="matrix(27.48103,0,0,27.48103,-30648.28,-953.60172)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs2420" />
+ <clipPath
+ id="clipPath2422">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon2424" />
+ </clipPath>
+ </g>
+ <rect
+ width="0"
+ height="0"
+ x="-191.58888"
+ y="1061.1434"
+ transform="scale(-1,1)"
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke-width:1pt"
+ id="rect2707" />
+ <rect
+ width="0"
+ height="0"
+ x="187.28412"
+ y="1174.4768"
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke-width:1pt"
+ id="rect2743" />
+ <g
+ id="g2779"
+ transform="matrix(29.1862,0,0,30.69019,-41713.241,-12382.978)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs2781" />
+ <clipPath
+ id="clipPath2783">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon2785" />
+ </clipPath>
+ </g>
+ <g
+ id="g2787"
+ transform="matrix(29.1862,0,0,30.69019,-40262.571,-12382.978)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs2789" />
+ <clipPath
+ id="clipPath2791">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon2793" />
+ </clipPath>
+ </g>
+ <g
+ id="g2821"
+ transform="matrix(27.48103,0,0,27.48103,-32014.18,-953.60172)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs2823" />
+ <clipPath
+ id="clipPath2825">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon2827" />
+ </clipPath>
+ </g>
+ <g
+ id="g2829"
+ transform="matrix(27.48103,0,0,27.48103,-30648.28,-953.60172)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs2831" />
+ <clipPath
+ id="clipPath2833">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon2835" />
+ </clipPath>
+ </g>
+ <rect
+ width="0"
+ height="0"
+ x="-155.43951"
+ y="1053.3907"
+ transform="scale(-1,1)"
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke-width:1pt"
+ id="rect4897" />
+ <rect
+ width="0"
+ height="0"
+ x="151.13475"
+ y="1166.724"
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke-width:1pt"
+ id="rect4934" />
+ <g
+ id="g4960"
+ transform="matrix(29.1862,0,0,30.69019,-41749.391,-12390.728)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs4962" />
+ <clipPath
+ id="clipPath4964">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon4966" />
+ </clipPath>
+ </g>
+ <g
+ id="g4968"
+ transform="matrix(29.1862,0,0,30.69019,-40298.721,-12390.728)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs4970" />
+ <clipPath
+ id="clipPath4972">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon4974" />
+ </clipPath>
+ </g>
+ <g
+ id="g5002"
+ transform="matrix(27.48103,0,0,27.48103,-32050.33,-961.35472)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs5004" />
+ <clipPath
+ id="clipPath5006">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon5008" />
+ </clipPath>
+ </g>
+ <g
+ id="g5010"
+ transform="matrix(27.48103,0,0,27.48103,-30684.43,-961.35472)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.36290848;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <defs
+ id="defs5012" />
+ <clipPath
+ id="clipPath5014">
+ <polygon
+ points="469.75879,342.92773 529.12402,342.16113 529.12402,440.2207 469.75879,440.2207 469.75879,342.92773 "
+ id="polygon5016" />
+ </clipPath>
+ </g>
+ <path
+ style="fill:#d40000;fill-opacity:1;stroke:#000000;stroke-width:10;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 1149.3125,10.8281 C 1111.7423,40.190825 1063.8125,86.844833 1063.8125,167.23435 L 1063.8125,1047.2656 C 1063.8125,1114.7293 1014.7185,1184.8906 932.4375,1184.8906 L 736.4062,1184.8906 C 651.5185,1184.8906 598.647,1240.4157 580,1289.1719 C 561.353,1240.4157 508.4815,1184.8906 423.5937,1184.8906 L 227.5625,1184.8906 C 145.2815,1184.8906 96.1875,1114.7293 96.1875,1047.2656 L 96.1875,167.23435 C 96.1875,86.844833 48.2578,40.190825 10.6875,10.8281 L 1149.3125,10.8281 z "
+ id="path3740"
+ sodipodi:nodetypes="cccccccccccc" />
+ <path
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2.20000005;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 588.53125,62.504017 L 586.53125,81.472767 L 601.71875,79.472767 L 601.71875,98.035267 L 586.53125,96.035267 L 588.0625,121.69152 C 590.14521,122.02097 592.12123,122.50802 594.03125,123.22277 C 595.26965,127.20351 595.02043,132.44764 594.03125,137.06652 C 593.99016,137.0464 593.94821,137.02379 593.90625,137.00402 C 610.4107,149.84148 624.98124,162.76147 637.53125,177.06652 C 638.39837,173.62894 640.31926,170.34618 642.5625,170.16027 C 646.48607,169.83509 647.2406,176.14419 647.3 [...]
+ id="path6941" />
+ <rect
+ style="fill:#d40000;fill-opacity:1;stroke:none;stroke-width:5;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect3534"
+ width="373.4808"
+ height="474.10776"
+ x="406.37808"
+ y="31.51989" />
+ <path
+ sodipodi:nodetypes="ccscc"
+ d="M 589.12867,477.14752 C 589.12867,477.14752 628.04492,439.31449 628.04492,439.31449 C 649.77723,520.42059 708.51682,581.25888 736.6581,558.24148 C 736.6581,558.24148 697.74185,596.0745 697.74185,596.0745 C 669.60057,619.09191 610.86098,558.25362 589.12867,477.14752 z "
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ id="path4734" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 594.0404,472.38752 C 615.77269,553.49361 674.49287,614.31116 702.63415,591.29377 C 701.55151,592.34628 697.7279,596.07502 697.7279,596.07502 C 669.58662,619.0924 610.86646,558.24362 589.13415,477.13752 C 589.13415,477.13752 592.96251,473.43541 594.0404,472.38752 z "
+ id="path4898" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 628.0404,439.32502 C 649.77271,520.43112 708.52412,581.24866 736.6654,558.23127 C 736.6654,558.23127 732.7446,562.0276 731.6029,563.13752 C 703.2991,585.20435 645.03872,524.58693 623.4154,443.88752 L 623.4154,443.79377 C 624.37941,442.85659 628.0404,439.32502 628.0404,439.32502 z "
+ id="path4911" />
+ <path
+ d="M 621.42433,481.94705 C 623.80603,487.92926 626.05972,493.91147 628.90555,499.89366 L 638.39033,492.03581 C 640.93588,497.48267 643.70772,502.92954 647.22963,508.37641 L 636.026,512.16304 C 641.40806,520.76324 646.99671,529.36344 654.79598,537.96364 L 642.00628,547.50199 C 636.1824,537.30945 631.08493,527.11691 627.22408,516.92437 L 618.10806,524.2292 C 614.83507,519.10889 612.24892,513.48606 609.45308,507.88861 L 620.28794,504.10203 C 616.8336,498.79054 613.37926,493.47904 609.9 [...]
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80800009;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path5897"
+ sodipodi:nodetypes="ccccccccccccc" />
+ <path
+ id="path5951"
+ style="opacity:0.63902438;fill:url(#linearGradient3141);fill-opacity:1;stroke:none;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 589.12867,477.14752 C 589.12867,477.14752 628.04492,439.31449 628.04492,439.31449 C 649.77723,520.42059 708.51682,581.25888 736.6581,558.24148 C 736.6581,558.24148 697.74185,596.0745 697.74185,596.0745 C 669.60057,619.09191 610.86098,558.25362 589.12867,477.14752 z "
+ sodipodi:nodetypes="ccscc" />
+ <path
+ id="path5230"
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 571.87681,477.14752 C 571.87681,477.14752 532.96056,439.31449 532.96056,439.31449 C 511.22825,520.42059 452.48866,581.25888 424.34738,558.24148 C 424.34738,558.24148 463.26363,596.0745 463.26363,596.0745 C 491.40491,619.09191 550.1445,558.25362 571.87681,477.14752 z "
+ sodipodi:nodetypes="ccscc" />
+ <path
+ id="path5232"
+ d="M 532.96508,439.32502 C 511.23277,520.43112 452.48136,581.24866 424.34008,558.23127 C 424.34008,558.23127 428.26088,562.0276 429.40258,563.13752 C 457.70638,585.20435 515.96676,524.58693 537.59008,443.88752 L 537.59008,443.79377 C 536.62607,442.85659 532.96508,439.32502 532.96508,439.32502 z "
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 570.5068,1084.8309 C 573.80769,1084.8309 586.20929,1084.9581 590.0068,1099.7684 C 593.80431,1114.5786 587.47555,1145.3309 587.47555,1145.3309 C 587.47556,1145.3309 581.65766,1151.6434 570.5068,1151.6434 C 559.35594,1151.6434 553.53805,1145.3309 553.53805,1145.3309 C 553.53805,1145.3309 547.2093,1114.5786 551.0068,1099.7684 C 554.80431,1084.9581 567.20589,1084.8309 570.5068,1084.8309 z "
+ id="path10983"
+ sodipodi:nodetypes="cscscsc" />
+ <path
+ sodipodi:nodetypes="cc"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ d="M 570.5068,1151.6602 L 570.5068,1111.6103"
+ id="path10985" />
+ <path
+ id="path10987"
+ d="M 574.27266,1151.1539 C 574.48657,1137.3141 576.22759,1124.5766 574.91556,1110.7368"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ d="M 578.03852,1150.521 C 578.24404,1136.6555 581.15059,1123.1183 578.95695,1109.5527"
+ id="path10989"
+ sodipodi:nodetypes="cc" />
+ <path
+ id="path10991"
+ d="M 581.8044,1148.8755 C 581.92051,1135.0357 586.19773,1121.1958 582.99836,1107.356"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ d="M 585.57025,1146.9766 C 585.57289,1133.1368 590.8365,1118.3786 586.76421,1104.5388"
+ id="path10993"
+ sodipodi:nodetypes="cc" />
+ <path
+ sodipodi:nodetypes="cc"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ d="M 566.72624,1151.1539 C 566.51233,1137.3141 564.77131,1124.5766 566.08334,1110.7368"
+ id="path10995" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path10997"
+ d="M 562.96038,1150.521 C 562.75486,1136.6555 559.84831,1123.1183 562.04195,1109.5527"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cc"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ d="M 559.1945,1148.8755 C 559.07839,1135.0357 554.80117,1121.1958 558.00054,1107.356"
+ id="path10999" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path11001"
+ d="M 555.42865,1146.9766 C 555.42601,1133.1368 550.1624,1118.3786 554.23469,1104.5388"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path11003"
+ sodipodi:cx="215.82497"
+ sodipodi:cy="1113.4174"
+ sodipodi:rx="16.835613"
+ sodipodi:ry="16.835613"
+ d="M 232.66058 1113.4174 A 16.835613 16.835613 0 1 1 198.98935,1113.4174 A 16.835613 16.835613 0 1 1 232.66058 1113.4174 z"
+ transform="matrix(-1,0,0,1,786.3318,-28.719729)" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 580.61139,679.61582 C 580.6114,716.04342 580.61139,1074.0015 580.61139,1074.0016 C 580.66239,1077.6079 578.76764,1080.9624 575.65266,1082.7805 C 572.53769,1084.5985 568.68509,1084.5985 565.57012,1082.7805 C 562.45514,1080.9624 560.56039,1077.6079 560.61139,1074.0016 C 560.61139,1074.0016 560.6114,695.68754 560.61139,664.77207 C 560.61139,664.77207 580.61139,679.61582 580.61139,679.61582 z "
+ id="path11005"
+ sodipodi:nodetypes="csssccc" />
+ <path
+ sodipodi:nodetypes="cscscsc"
+ id="path4314"
+ d="M 583.66665,1093.6041 C 586.96754,1093.6041 599.36914,1093.7313 603.16665,1108.5416 C 606.96416,1123.3518 600.6354,1154.1041 600.6354,1154.1041 C 600.63541,1154.1041 594.81751,1160.4166 583.66665,1160.4166 C 572.51579,1160.4166 566.6979,1154.1041 566.6979,1154.1041 C 566.6979,1154.1041 560.36915,1123.3518 564.16665,1108.5416 C 567.96416,1093.7313 580.36574,1093.6041 583.66665,1093.6041 z "
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ id="path4316"
+ d="M 583.66665,1160.4334 L 583.66665,1120.3835"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ sodipodi:nodetypes="cc" />
+ <path
+ sodipodi:nodetypes="cc"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ d="M 587.43251,1159.9271 C 587.64642,1146.0873 589.38744,1133.3498 588.07541,1119.51"
+ id="path4318" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path4320"
+ d="M 591.19837,1159.2942 C 591.40389,1145.4287 594.31044,1131.8915 592.1168,1118.3259"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cc"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ d="M 594.96425,1157.6487 C 595.08036,1143.8089 599.35758,1129.969 596.15821,1116.1292"
+ id="path4322" />
+ <path
+ sodipodi:nodetypes="cc"
+ id="path4324"
+ d="M 598.7301,1155.7498 C 598.73274,1141.91 603.99635,1127.1518 599.92406,1113.312"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
+ <path
+ id="path4326"
+ d="M 579.88609,1159.9271 C 579.67218,1146.0873 577.93116,1133.3498 579.24319,1119.51"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ d="M 576.12023,1159.2942 C 575.91471,1145.4287 573.00816,1131.8915 575.2018,1118.3259"
+ id="path4328"
+ sodipodi:nodetypes="cc" />
+ <path
+ id="path4330"
+ d="M 572.35435,1157.6487 C 572.23824,1143.8089 567.96102,1129.969 571.16039,1116.1292"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
+ d="M 568.5885,1155.7498 C 568.58586,1141.91 563.32225,1127.1518 567.39454,1113.312"
+ id="path4332"
+ sodipodi:nodetypes="cc" />
+ <path
+ transform="matrix(-1,0,0,1,799.49165,-19.946498)"
+ d="M 232.66058 1113.4174 A 16.835613 16.835613 0 1 1 198.98935,1113.4174 A 16.835613 16.835613 0 1 1 232.66058 1113.4174 z"
+ sodipodi:ry="16.835613"
+ sodipodi:rx="16.835613"
+ sodipodi:cy="1113.4174"
+ sodipodi:cx="215.82497"
+ id="path11257"
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="csssccc"
+ id="path3694"
+ d="M 580.61139,679.61582 C 580.6114,716.04342 580.61139,1074.0015 580.61139,1074.0016 C 580.66239,1077.6079 578.76764,1080.9624 575.65266,1082.7805 C 572.53769,1084.5985 568.68509,1084.5985 565.57012,1082.7805 C 562.45514,1080.9624 560.56039,1077.6079 560.61139,1074.0016 C 560.61139,1074.0016 560.6114,695.68754 560.61139,664.77207 C 560.61139,664.77207 580.61139,679.61582 580.61139,679.61582 z "
+ style="fill:url(#linearGradient3113);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="csssccc"
+ id="path7626"
+ d="M 593.77124,671.61527 C 593.77124,671.61527 593.77124,1082.7747 593.77124,1082.7748 C 593.82224,1086.3811 591.92749,1089.7356 588.81251,1091.5537 C 585.69754,1093.3717 581.84494,1093.3717 578.72997,1091.5537 C 575.61499,1089.7356 573.72024,1086.3811 573.77124,1082.7748 C 573.77124,1082.7748 573.77124,656.77152 573.77124,656.77152 C 573.77124,656.77152 593.77124,671.61527 593.77124,671.61527 z "
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:url(#linearGradient3109);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 593.77124,671.61527 C 593.77124,671.61527 593.77124,1082.7747 593.77124,1082.7748 C 593.82224,1086.3811 591.92749,1089.7356 588.81251,1091.5537 C 585.69754,1093.3717 581.84494,1093.3717 578.72997,1091.5537 C 575.61499,1089.7356 573.72024,1086.3811 573.77124,1082.7748 C 573.77124,1082.7748 573.77124,656.77152 573.77124,656.77152 C 573.77124,656.77152 593.77124,671.61527 593.77124,671.61527 z "
+ id="path3696"
+ sodipodi:nodetypes="csssccc" />
+ <path
+ sodipodi:nodetypes="csssccssssscc"
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 570.77549,664.86402 C 570.77549,723.97353 553.13176,801.37135 525.86924,858.30152 C 512.23798,886.76661 496.12431,910.06525 479.77549,923.48902 C 463.42667,936.91279 448.51792,940.88267 431.61924,933.77027 C 419.66259,928.73788 410.15462,926.43548 401.33799,927.70777 C 401.33799,927.70777 412.5654,936.57963 403.08799,948.08277 C 403.14677,947.71109 403.10889,947.49119 403.02549,947.39527 C 403.06954,947.49235 403.16741,947.6399 404.21299,947.48902 C 406.74615,947.12347 413.7083 [...]
+ id="path10973" />
+ <path
+ id="path3698"
+ d="M 570.77549,664.86402 C 570.77549,723.97353 553.13176,801.37135 525.86924,858.30152 C 512.23798,886.76661 496.12431,910.06525 479.77549,923.48902 C 463.42667,936.91279 448.51792,940.88267 431.61924,933.77027 C 419.66259,928.73788 410.15462,926.43548 401.33799,927.70777 C 401.33799,927.70777 412.5654,936.57963 403.08799,948.08277 C 403.14677,947.71109 403.10889,947.49119 403.02549,947.39527 C 403.06954,947.49235 403.16741,947.6399 404.21299,947.48902 C 406.74615,947.12347 413.7083 [...]
+ style="opacity:0.73170734;fill:url(#linearGradient3105);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="csssccssssscc" />
+ <path
+ id="path10971"
+ d="M 587.0231,664.86402 C 587.0231,723.97353 604.66683,801.37135 631.92935,858.30152 C 645.56061,886.76661 661.67428,910.06525 678.0231,923.48902 C 694.37192,936.91279 709.28067,940.88267 726.17935,933.77027 C 738.136,928.73788 747.64397,926.43548 756.4606,927.70777 C 756.4606,927.70777 745.23319,936.57963 754.7106,948.08277 C 754.65182,947.71109 754.6897,947.49119 754.7731,947.39527 C 754.72905,947.49235 754.63118,947.6399 753.5856,947.48902 C 751.05244,947.12347 744.0902,947.93121 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="csssccssssscc" />
+ <path
+ transform="matrix(0.915398,0,0,0.915398,846.84763,-405.2289)"
+ d="M 83.756039 781.91168 A 18.298054 18.298054 0 1 1 47.159931,781.91168 A 18.298054 18.298054 0 1 1 83.756039 781.91168 z"
+ sodipodi:ry="18.298054"
+ sodipodi:rx="18.298054"
+ sodipodi:cy="781.91168"
+ sodipodi:cx="65.457985"
+ id="path16019"
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:1.09242105;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(1.233244,0,0,1.233244,835.92923,-585.94221)"
+ d="M 71.022861 726.92322 A 13.582061 13.582061 0 1 1 43.858739,726.92322 A 13.582061 13.582061 0 1 1 71.022861 726.92322 z"
+ sodipodi:ry="13.582061"
+ sodipodi:rx="13.582061"
+ sodipodi:cy="726.92322"
+ sodipodi:cx="57.4408"
+ id="path16021"
+ style="fill:url(#linearGradient6725);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ id="path4402"
+ style="font-size:12px;fill:#c0c0c0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt"
+ d="M 893.19461,313.323 L 875.4656,331.30138 L 887.28445,343.28659 L 905.01385,325.3085 C 910.92363,319.31564 899.10439,307.33012 893.19461,313.323 z " />
+ <path
+ d="M 893.19461,313.323 L 875.4656,331.30138 L 887.28445,343.28659 L 905.01385,325.3085 C 910.92363,319.31564 899.10439,307.33012 893.19461,313.323 z "
+ style="font-size:12px;fill:url(#linearGradient3098);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.89469233pt"
+ id="path20940" />
+ <path
+ style="font-size:12px;fill:#c0c0c0;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 869.55106,325.29517 L 851.83231,343.29517 L 690.11356,507.26392 L 713.76981,531.23267 L 875.45731,367.26392 L 893.20731,349.29517 C 890.83569,339.71437 878.99859,327.69982 869.55106,325.29517 z M 680.45731,517.07642 L 574.08231,624.95142 L 597.70731,648.92017 L 704.08231,541.04517 C 701.71068,531.4643 689.90492,519.48108 680.45731,517.07642 z "
+ id="path4406" />
+ <path
+ id="path4430"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 851.82674,343.28705 L 834.09773,361.26543 C 822.27857,373.25088 780.91108,427.18541 780.91108,427.18541 C 780.91108,427.18541 725.57795,471.3158 713.7588,483.30132 L 696.02978,501.27971 C 707.84902,489.29419 780.91147,439.17085 780.91147,439.17085 C 780.91147,439.17085 737.3975,507.27257 719.66857,525.25105 L 737.3975,507.27257 C 749.21674,495.28715 792.73266,439.17326 792.73032,439.17085 C 792.73266,439.17326 840.0075,403.21446 851.82643,391.22925 L 875.46521,367.258 C 863.645 [...]
+ <path
+ id="path17285"
+ d="M 869.55106,325.29517 L 851.83231,343.29517 L 690.11356,507.26392 L 713.76981,531.23267 L 875.45731,367.26392 L 893.20731,349.29517 C 890.83569,339.71437 878.99859,327.69982 869.55106,325.29517 z M 680.45731,517.07642 L 574.08231,624.95142 L 597.70731,648.92017 L 704.08231,541.04517 C 701.71068,531.4643 689.90492,519.48108 680.45731,517.07642 z "
+ style="font-size:12px;fill:url(#linearGradient3093);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ <path
+ d="M 820.97508,538.81517 L 820.97508,538.81517 L 820.97508,519.79895 L 833.19408,529.30679 L 820.97508,538.81517 z "
+ style="font-size:12px;fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4524"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ id="path4251"
+ d="M 376.70731,747.07642 C 306.32731,747.07642 249.20731,804.19644 249.20731,874.57642 C 249.20731,944.95642 306.32731,1002.0764 376.70731,1002.0764 C 447.08731,1002.0764 504.2073,944.95643 504.20731,874.57642 C 504.20731,804.19642 447.0873,747.07645 376.70731,747.07642 z M 361.20731,781.32642 C 365.07131,781.32642 368.2073,784.4624 368.20731,788.32642 C 368.20731,793.00716 371.99529,796.79517 376.67606,796.79517 C 381.35683,796.79517 385.14481,793.00716 385.14481,788.32642 C 385.14 [...]
+ style="fill:#919191;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="csssccssssccsssssssccsssssccsssssssccc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#d72b2b;fill-opacity:1;stroke:#000000;stroke-width:1.0161109;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path4889"
+ sodipodi:cx="65.457985"
+ sodipodi:cy="781.91168"
+ sodipodi:rx="18.298054"
+ sodipodi:ry="18.298054"
+ d="M 83.756039 781.91168 A 18.298054 18.298054 0 1 1 47.159931,781.91168 A 18.298054 18.298054 0 1 1 83.756039 781.91168 z"
+ transform="matrix(0.984145,0,0,0.984144,202.78893,-13.734656)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:url(#linearGradient6733);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path4891"
+ sodipodi:cx="57.4408"
+ sodipodi:cy="726.92322"
+ sodipodi:rx="13.582061"
+ sodipodi:ry="13.582061"
+ d="M 71.022861 726.92322 A 13.582061 13.582061 0 1 1 43.858739,726.92322 A 13.582061 13.582061 0 1 1 71.022861 726.92322 z"
+ transform="matrix(-1.36268,0,0,1.36268,345.48253,-234.7847)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path6587"
+ sodipodi:cx="50.932728"
+ sodipodi:cy="723.24475"
+ sodipodi:rx="3.0182357"
+ sodipodi:ry="3.0182357"
+ d="M 53.950963 723.24475 A 3.0182357 3.0182357 0 1 1 47.914492,723.24475 A 3.0182357 3.0182357 0 1 1 53.950963 723.24475 z"
+ transform="matrix(-1,0,0,1,326.80373,31.953254)" />
+ <path
+ transform="matrix(-0.375,0,0,0.375,277.42703,483.98139)"
+ d="M 53.950963 723.24475 A 3.0182357 3.0182357 0 1 1 47.914492,723.24475 A 3.0182357 3.0182357 0 1 1 53.950963 723.24475 z"
+ sodipodi:ry="3.0182357"
+ sodipodi:rx="3.0182357"
+ sodipodi:cy="723.24475"
+ sodipodi:cx="50.932728"
+ id="path6611"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ id="path4418"
+ style="font-size:12px;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt"
+ d="M 615.44204,571.0111 L 650.89968,606.96757 C 657.40851,606.96787 662.85863,601.44112 662.71891,594.98205 C 662.71891,594.98205 662.71891,582.99693 650.89968,571.01141 C 639.08044,559.02598 627.2612,559.02567 627.2612,559.02567 C 621.77074,559.77519 617.15924,565.01855 615.44204,571.0111 z " />
+ <path
+ id="path4420"
+ style="font-size:12px;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt"
+ d="M 615.44204,571.0111 L 591.80357,606.96787 L 615.44204,630.93882 L 650.89968,606.96757 C 652.23425,605.79959 650.89968,594.98245 639.08044,582.99693 C 627.2612,571.01141 615.97475,571.29762 615.44204,571.0111 z " />
+ <path
+ id="path4422"
+ style="font-size:12px;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 597.71303,612.9606 C 607.37893,603.15872 621.3515,588.98956 639.08044,582.99708 C 633.17074,600.97509 619.19817,615.14415 609.53227,624.94611 L 597.71303,612.9606 z " />
+ <path
+ id="path4424"
+ style="font-size:12px;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80909872pt"
+ d="M 615.44173,630.93899 L 609.53227,624.94642 C 609.53227,624.94642 616.51859,617.86181 621.35143,612.96106 C 633.17082,600.97539 650.8996,606.96818 650.8996,606.96818 L 615.44173,630.93899 z " />
+ <path
+ id="path4426"
+ style="font-size:12px;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80909872pt"
+ d="M 591.80357,606.96804 L 597.71303,612.9606 C 597.71303,612.9606 604.69928,605.87606 609.53211,600.97524 C 621.3515,588.98956 615.44189,571.01141 615.44189,571.01141 L 591.80357,606.96804 z " />
+ <path
+ style="font-size:12px;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt"
+ d="M 591.80357,606.96787 C 550.43616,648.91721 503.15929,672.88824 473.61104,702.85206 C 449.97264,726.82301 466.33967,745.17048 472.92997,750.9787 C 479.5205,756.78661 497.44398,775.03189 520.88791,750.79404 C 550.43616,720.83013 574.07456,672.88824 615.44204,630.93882 C 615.44165,618.9534 603.62249,606.96787 591.80357,606.96787 z "
+ id="path4428" />
+ <rect
+ id="rect4432"
+ style="font-size:12px;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00098872;stroke-miterlimit:4;stroke-dasharray:none"
+ transform="matrix(0.6547792,-0.7558202,0.7131899,0.7009709,0,0)"
+ y="819.88318"
+ x="-211.38948"
+ height="65.672768"
+ width="20.631729" />
+ <rect
+ id="rect4442"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00089395;stroke-miterlimit:4;stroke-dasharray:none"
+ transform="matrix(0.6559657,-0.7547907,0.7142968,0.6998428,0,0)"
+ y="817.16058"
+ x="-231.12549"
+ height="72.160538"
+ width="22.667192" />
+ <path
+ d="M 303.44319,753.38244 C 296.57852,758.31886 290.10317,764.02257 284.13911,770.48701 C 278.17513,776.95146 273.0018,783.87392 268.616,791.1319 L 261.93174,786.91418 C 266.53701,779.29243 271.97031,772.02316 278.23374,765.23419 C 284.49725,758.44513 291.2969,752.45498 298.50628,747.27084 L 303.44319,753.38244 z "
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path4456"
+ sodipodi:nodetypes="csccscc" />
+ <path
+ d="M 859.45432,367.66824 L 878.63187,386.68499 L 859.45432,405.70068 L 869.04256,415.2096 L 888.22011,396.19284 L 926.57413,434.22527 L 907.39658,453.24204 L 916.9859,462.74987 L 936.16237,443.73418 L 955.33992,462.74987 L 897.80834,519.79906 L 859.45432,481.76663 L 878.63187,462.74987 L 888.22011,472.25879 L 897.80834,462.74987 L 859.45432,424.71743 L 849.86608,434.22635 L 859.45432,443.73418 L 840.27785,462.74987 L 821.10029,443.73418 L 830.68853,434.22527 L 821.10029,424.71743 L [...]
+ style="font-size:12px;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4478" />
+ <path
+ d="M 801.92342,576.8475 L 801.92342,595.86372 L 849.86568,643.40454 L 849.86568,605.37209 L 840.27744,595.86372 L 821.10043,595.86372 L 801.92342,576.8475 z "
+ style="font-size:12px;fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path4480" />
+ <path
+ d="M 753.98059,529.69773 L 792.07213,567.46989 L 792.52567,586.35569 L 753.98059,548.1338 L 753.98059,529.69773 z "
+ style="font-size:12px;fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4482" />
+ <path
+ d="M 792.33464,586.35588 L 811.51165,567.33966 L 811.51165,548.32345 L 792.33464,567.33966 L 792.33464,586.35588 z "
+ style="font-size:12px;fill:#7a7a7a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4484" />
+ <path
+ d="M 744.39204,538.81508 L 763.56905,519.79887 L 763.56905,500.78265 L 744.39204,519.79887 L 744.39204,538.81508 z "
+ style="font-size:12px;fill:#7a7a7a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4486" />
+ <path
+ d="M 763.56885,500.78264 L 763.56885,519.79885 L 773.15763,510.29048 L 763.56885,500.78264 z "
+ style="font-size:12px;fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4488" />
+ <path
+ d="M 811.51175,548.32323 L 811.51175,567.33944 L 821.10053,557.83107 L 811.51175,548.32323 z "
+ style="font-size:12px;fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4490" />
+ <path
+ d="M 725.02409,500.78253 L 744.39216,519.79876 L 744.39216,538.81498 L 725.02409,519.21861 L 725.02409,500.78253 z "
+ style="font-size:12px;fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4492" />
+ <path
+ d="M 840.27734,481.7662 L 859.45435,462.74999 L 859.45435,443.73377 L 840.27734,462.74999 L 840.27734,481.7662 z "
+ style="font-size:12px;fill:#7a7a7a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4494" />
+ <path
+ d="M 801.92324,519.79878 L 821.10025,500.78257 L 821.10025,481.76635 L 801.92324,500.78257 L 801.92324,519.79878 z "
+ style="font-size:12px;fill:#7a7a7a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4496" />
+ <path
+ d="M 792.33446,472.25841 L 821.10025,443.73382 L 821.10025,424.71759 L 782.74623,462.75003 L 792.33446,472.25841 z "
+ style="font-size:12px;fill:#7a7a7a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4498" />
+ <path
+ d="M 821.10025,424.71754 L 821.10025,443.73375 L 830.68903,434.22538 L 821.10025,424.71754 z "
+ style="font-size:12px;fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4500" />
+ <path
+ d="M 840.27734,481.7662 L 821.10033,462.74999 L 821.10033,443.73377 L 840.27734,462.74999 L 840.27734,481.7662 z "
+ style="font-size:12px;fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4502" />
+ <path
+ d="M 888.22014,472.2582 L 859.45435,443.7336 L 859.45435,424.71739 L 897.80838,462.74983 L 888.22014,472.2582 z "
+ style="font-size:12px;fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4504" />
+ <path
+ d="M 859.45439,481.76644 L 897.80842,519.79887 L 916.98543,519.79887 L 926.57421,529.30671 L 926.57421,567.33969 L 859.45439,500.59321 L 859.45439,481.76644 z "
+ style="font-size:12px;fill:#a5a5a5;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4506" />
+ <path
+ d="M 821.10043,595.86372 L 878.63147,538.81507 L 897.80848,538.81507 L 840.27744,595.86372 L 821.10043,595.86372 z "
+ style="font-size:12px;fill:#cdcdcd;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4508" />
+ <path
+ d="M 849.86568,605.37209 L 907.39726,548.32345 L 897.80848,538.81507 L 840.27744,595.86372 L 849.86568,605.37209 z "
+ style="font-size:12px;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4510" />
+ <path
+ d="M 849.86588,605.3718 L 849.86588,643.40423 L 907.39746,586.35559 L 907.39746,548.32314 L 849.86588,605.3718 z "
+ style="font-size:12px;fill:#7a7a7a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4512" />
+ <path
+ d="M 897.80863,519.79879 L 955.33967,462.75014 L 974.51668,462.75014 L 916.98564,519.79879 L 897.80863,519.79879 z "
+ style="font-size:12px;fill:#cdcdcd;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4514" />
+ <path
+ d="M 926.57358,529.30706 L 984.10516,472.25841 L 974.51638,462.75003 L 916.98534,519.79869 L 926.57358,529.30706 z "
+ style="font-size:12px;fill:#bfbfbf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4516" />
+ <path
+ d="M 926.57408,529.30701 L 926.57408,567.33944 L 984.10566,510.2908 L 984.10566,472.25836 L 926.57408,529.30701 z "
+ style="font-size:12px;fill:#7a7a7a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4518" />
+ <path
+ d="M 916.98528,462.75025 L 926.57405,453.24188 L 926.57405,434.22565 L 907.39704,453.24188 L 916.98528,462.75025 z "
+ style="font-size:12px;fill:#7a7a7a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4520" />
+ <path
+ d="M 869.04258,415.20964 L 878.63135,405.70128 L 878.63135,386.68506 L 859.45434,405.70128 L 869.04258,415.20964 z "
+ style="font-size:12px;fill:#7a7a7a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4522" />
+ <path
+ d="M 801.92314,519.79878 L 782.74613,500.78257 L 792.3349,491.27419 L 801.92314,500.78257 L 801.92314,519.79878 z "
+ style="font-size:12px;fill:#7a7a7a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4526" />
+ <path
+ d="M 859.45434,443.73382 L 849.8661,434.22545 L 859.45434,424.71761 L 859.45434,443.73382 z "
+ style="font-size:12px;fill:#7a7a7a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path4528" />
+ <path
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 273.01978,930.76392 L 265.86353,934.13892 L 265.86353,951.76392 C 271.01022,959.02573 276.96729,965.89242 283.70728,972.2015 C 290.44726,978.51046 297.67183,983.96897 305.23853,988.60776 L 310.01978,983.38897 L 310.23853,965.38892 C 295.63789,956.44641 282.96955,944.63905 273.01978,930.76392 z "
+ id="path5138" />
+ <path
+ d="M 305.24627,970.58409 C 298.04133,966.16689 292.23031,962.02595 285.81252,956.01852 C 279.39472,950.01117 271.07881,941.34984 266.17736,934.43463"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path4468"
+ sodipodi:nodetypes="csc" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 309.96853,965.75064 L 305.18606,970.44459 L 305.18606,987.98037"
+ id="path5145"
+ sodipodi:nodetypes="ccc" />
+ <path
+ style="font-size:12px;fill:#000000;fill-opacity:0.43820226;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 265.86356,934.85767 L 265.86356,951.76392 C 271.01025,959.02573 276.96732,965.89242 283.70731,972.2015 C 290.44729,978.51046 297.67186,983.96897 305.23856,988.60776 L 310.01981,983.38897 L 310.23856,966.20142 L 305.67606,970.6702 L 305.67606,987.98276 L 304.67606,987.98276 L 304.67606,970.8265 C 297.5981,966.47064 291.80758,962.33314 285.45731,956.38892 C 279.0593,950.40005 270.81546,941.80864 265.86356,934.85767 z "
+ id="path21900" />
+ <path
+ transform="matrix(0.984145,0,0,0.984144,207.65983,203.86789)"
+ d="M 83.756039 781.91168 A 18.298054 18.298054 0 1 1 47.159931,781.91168 A 18.298054 18.298054 0 1 1 83.756039 781.91168 z"
+ sodipodi:ry="18.298054"
+ sodipodi:rx="18.298054"
+ sodipodi:cy="781.91168"
+ sodipodi:cx="65.457985"
+ id="path2399"
+ style="fill:#d72b2b;fill-opacity:1;stroke:#000000;stroke-width:1.0161109;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-1.36268,0,0,1.36268,350.35343,-17.182145)"
+ d="M 71.022861 726.92322 A 13.582061 13.582061 0 1 1 43.858739,726.92322 A 13.582061 13.582061 0 1 1 71.022861 726.92322 z"
+ sodipodi:ry="13.582061"
+ sodipodi:rx="13.582061"
+ sodipodi:cy="726.92322"
+ sodipodi:cx="57.4408"
+ id="path2401"
+ style="fill:url(#linearGradient6735);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-1,0,0,1,331.67543,249.55579)"
+ d="M 53.950963 723.24475 A 3.0182357 3.0182357 0 1 1 47.914492,723.24475 A 3.0182357 3.0182357 0 1 1 53.950963 723.24475 z"
+ sodipodi:ry="3.0182357"
+ sodipodi:rx="3.0182357"
+ sodipodi:cy="723.24475"
+ sodipodi:cx="50.932728"
+ id="path2403"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path2405"
+ sodipodi:cx="50.932728"
+ sodipodi:cy="723.24475"
+ sodipodi:rx="3.0182357"
+ sodipodi:ry="3.0182357"
+ d="M 53.950963 723.24475 A 3.0182357 3.0182357 0 1 1 47.914492,723.24475 A 3.0182357 3.0182357 0 1 1 53.950963 723.24475 z"
+ transform="matrix(-0.375,0,0,0.375,282.29903,701.58389)" />
+ <path
+ style="opacity:0.8;fill:#a5a5a5;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ d="M 792.33231,491.26392 L 792.33231,510.32692 L 801.92606,519.79517 L 801.92606,500.79517 L 792.33231,491.26392 z "
+ id="rect17303"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="font-size:12px;fill:url(#linearGradient3041);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.89469233pt"
+ d="M 627.26981,559.01392 C 621.77935,559.76342 617.17451,565.02135 615.45731,571.01392 L 591.80106,606.98267 C 550.43366,648.93198 503.16181,672.89383 473.61356,702.85767 C 467.12323,709.43931 463.66503,715.57956 462.17606,721.17017 L 459.83231,718.88892 L 449.08231,731.32642 L 446.95731,729.23267 L 432.08231,746.32642 L 483.64481,796.82642 L 498.48856,779.73267 L 495.95731,777.26392 L 506.67606,764.92017 L 503.73856,762.04517 C 509.009,760.53441 514.76595,757.13158 520.89481,750.79 [...]
+ id="path19984" />
+ <path
+ id="path5234"
+ d="M 566.96508,472.38752 C 545.23279,553.49361 486.51261,614.31116 458.37133,591.29377 C 459.45397,592.34628 463.27758,596.07502 463.27758,596.07502 C 491.41886,619.0924 550.13902,558.24362 571.87133,477.13752 C 571.87133,477.13752 568.04297,473.43541 566.96508,472.38752 z "
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="ccccccccccccc"
+ id="path5906"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80800009;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 539.58115,481.94705 C 537.19945,487.92926 534.94576,493.91147 532.09993,499.89366 L 522.61515,492.03581 C 520.0696,497.48267 517.29776,502.92954 513.77585,508.37641 L 524.97948,512.16304 C 519.59742,520.76324 514.00877,529.36344 506.2095,537.96364 L 518.9992,547.50199 C 524.82308,537.30945 529.92055,527.11691 533.7814,516.92437 L 542.89742,524.2292 C 546.17041,519.10889 548.75656,513.48606 551.5524,507.88861 L 540.71754,504.10203 C 544.17188,498.79054 547.62622,493.47904 551.08 [...]
+ <path
+ sodipodi:nodetypes="ccscc"
+ d="M 571.87681,477.14752 C 571.87681,477.14752 532.96056,439.31449 532.96056,439.31449 C 511.22825,520.42059 452.48866,581.25888 424.34738,558.24148 C 424.34738,558.24148 463.26363,596.0745 463.26363,596.0745 C 491.40491,619.09191 550.1445,558.25362 571.87681,477.14752 z "
+ style="opacity:0.63902438;fill:url(#linearGradient3036);fill-opacity:1;stroke:none;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ id="path6930" />
+ <path
+ style="fill:#bfbfbf;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 376.70731,729.07642 C 306.32731,729.07642 249.20731,786.19644 249.20731,856.57642 C 249.20731,926.95642 306.32731,984.07647 376.70731,984.07647 C 447.08731,984.07647 504.2073,926.95643 504.20731,856.57642 C 504.20731,786.19642 447.0873,729.07645 376.70731,729.07642 z M 361.20731,763.32642 C 365.07131,763.32642 368.2073,766.4624 368.20731,770.32642 C 368.20731,775.00716 371.99529,778.79517 376.67606,778.79517 C 381.35683,778.79517 385.14481,775.00716 385.14481,770.32642 C 385.14 [...]
+ id="path2425" />
+ <path
+ style="fill:#000000;fill-opacity:0.24157302;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 372.73856,743.10767 C 314.11504,743.85272 261.79717,796.94977 263.08231,855.88892 C 262.63114,903.87181 295.23513,950.90081 341.80106,964.67017 C 383.35806,978.14197 432.52818,965.91034 461.13303,932.49551 C 491.04789,899.6261 499.49131,848.38252 479.44855,808.26035 C 461.25503,769.26587 419.695,741.98662 376.45731,743.07642 C 375.2175,743.06818 373.97806,743.07913 372.73856,743.10767 z M 391.58231,749.23267 C 439.83095,754.65118 482.08112,797.38855 483.64481,846.38892 C 483.17 [...]
+ id="path21835" />
+ <path
+ style="font-size:12px;fill:url(#linearGradient3031);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt"
+ d="M 562.25543,660.90273 C 538.61695,696.8588 514.97817,720.83013 509.06878,726.82269 C 497.85297,738.21726 485.43031,738.80853 485.43031,738.80853 C 485.43031,738.80853 485.43031,726.82269 497.24954,714.83727 C 503.15901,708.84462 526.79771,684.87337 562.25543,660.90273 z "
+ id="path20881" />
+ <path
+ id="path21880"
+ d="M 480.43478,930.76392 L 487.59103,934.13892 L 487.59103,951.76392 C 482.44434,959.02573 476.48727,965.89242 469.74728,972.2015 C 463.0073,978.51046 455.78273,983.96897 448.21603,988.60776 L 443.43478,983.38897 L 443.21603,965.38892 C 457.81667,956.44641 470.48501,944.63905 480.43478,930.76392 z "
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="csc"
+ id="path21882"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 448.20829,970.58409 C 455.41323,966.16689 461.22425,962.02595 467.64204,956.01852 C 474.05984,950.01117 482.37575,941.34984 487.2772,934.43463" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path21884"
+ d="M 443.48603,965.75064 L 448.2685,970.44459 L 448.2685,987.98037"
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ id="path21923"
+ d="M 487.53784,934.85767 L 487.53784,951.76392 C 482.39115,959.02573 476.43408,965.89242 469.69409,972.2015 C 462.95411,978.51046 455.72954,983.96897 448.16284,988.60776 L 443.38159,983.38897 L 443.16284,966.20142 L 447.72534,970.6702 L 447.72534,987.98276 L 448.72534,987.98276 L 448.72534,970.8265 C 455.8033,966.47064 461.59382,962.33314 467.94409,956.38892 C 474.3421,950.40005 482.58594,941.80864 487.53784,934.85767 z "
+ style="font-size:12px;fill:#000000;fill-opacity:0.43820226;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#d72b2b;fill-opacity:1;stroke:#000000;stroke-width:1.0161109;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path21888"
+ sodipodi:cx="65.457985"
+ sodipodi:cy="781.91168"
+ sodipodi:rx="18.298054"
+ sodipodi:ry="18.298054"
+ d="M 83.756039 781.91168 A 18.298054 18.298054 0 1 1 47.159931,781.91168 A 18.298054 18.298054 0 1 1 83.756039 781.91168 z"
+ transform="matrix(0.984145,0,0,0.984144,416.32463,203.86789)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:url(#linearGradient6741);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path21890"
+ sodipodi:cx="57.4408"
+ sodipodi:cy="726.92322"
+ sodipodi:rx="13.582061"
+ sodipodi:ry="13.582061"
+ d="M 71.022861 726.92322 A 13.582061 13.582061 0 1 1 43.858739,726.92322 A 13.582061 13.582061 0 1 1 71.022861 726.92322 z"
+ transform="matrix(-1.36268,0,0,1.36268,559.01823,-17.182145)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path21892"
+ sodipodi:cx="50.932728"
+ sodipodi:cy="723.24475"
+ sodipodi:rx="3.0182357"
+ sodipodi:ry="3.0182357"
+ d="M 53.950963 723.24475 A 3.0182357 3.0182357 0 1 1 47.914492,723.24475 A 3.0182357 3.0182357 0 1 1 53.950963 723.24475 z"
+ transform="matrix(-1,0,0,1,538.67203,249.55579)" />
+ <path
+ transform="matrix(-0.375,0,0,0.375,489.29533,701.58389)"
+ d="M 53.950963 723.24475 A 3.0182357 3.0182357 0 1 1 47.914492,723.24475 A 3.0182357 3.0182357 0 1 1 53.950963 723.24475 z"
+ sodipodi:ry="3.0182357"
+ sodipodi:rx="3.0182357"
+ sodipodi:cy="723.24475"
+ sodipodi:cx="50.932728"
+ id="path21894"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt"
+ d="M 692.26981,505.10767 C 686.38402,505.45643 680.85263,510.30146 680.45731,517.07642 C 689.90492,519.48108 701.71068,531.4643 704.08231,541.04517 C 710.59117,541.04548 716.03461,535.53549 715.89481,529.07642 C 710.76333,516.69692 704.10206,510.693 692.26981,505.10767 z "
+ id="path4414" />
+ <path
+ id="path19417"
+ d="M 692.26981,505.10767 C 686.38402,505.45643 680.85263,510.30146 680.45731,517.07642 C 689.90492,519.48108 701.71068,531.4643 704.08231,541.04517 C 710.59117,541.04548 716.03461,535.53549 715.89481,529.07642 C 710.76333,516.69692 704.10206,510.693 692.26981,505.10767 z "
+ style="font-size:12px;opacity:0.8;fill:url(#linearGradient3019);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.89469233pt" />
+ <path
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt"
+ d="M 861.14481,333.85767 C 855.25903,334.20642 849.69638,339.05145 849.30106,345.82642 L 849.33231,345.85767 L 851.83231,343.29517 C 861.27991,345.69982 873.08571,357.68307 875.45731,367.26392 L 872.95731,369.79517 C 879.46617,369.79549 884.90961,364.28549 884.76981,357.82642 C 879.63833,345.4469 872.97705,339.44298 861.14481,333.85767 z "
+ id="path4408" />
+ <path
+ style="font-size:12px;opacity:0.6;fill:url(#linearGradient3015);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 861.57921,334.14401 C 855.70251,334.4922 850.17729,339.35421 849.76671,346.11276 L 852.26671,343.58151 C 861.71424,345.98616 873.55134,358.00071 875.92296,367.58151 L 873.42296,370.11276 C 879.91801,370.09545 885.34379,364.59275 885.20421,358.14401 C 880.07271,345.76449 873.41146,339.72932 861.57921,334.14401 z "
+ id="path19405" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#c0c0c0;fill-opacity:1;stroke:#000000;stroke-width:1.09242105;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path3471"
+ sodipodi:cx="65.457985"
+ sodipodi:cy="781.91168"
+ sodipodi:rx="18.298054"
+ sodipodi:ry="18.298054"
+ d="M 83.756039 781.91168 A 18.298054 18.298054 0 1 1 47.159931,781.91168 A 18.298054 18.298054 0 1 1 83.756039 781.91168 z"
+ transform="matrix(-0.915398,0,0,0.915398,313.15253,-404.2288)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:url(#linearGradient6747);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path3473"
+ sodipodi:cx="57.4408"
+ sodipodi:cy="726.92322"
+ sodipodi:rx="13.582061"
+ sodipodi:ry="13.582061"
+ d="M 71.022861 726.92322 A 13.582061 13.582061 0 1 1 43.858739,726.92322 A 13.582061 13.582061 0 1 1 71.022861 726.92322 z"
+ transform="matrix(-1.233244,0,0,1.233244,324.07093,-584.94221)" />
+ <path
+ d="M 266.80539,314.32305 L 284.5344,332.30143 L 272.71555,344.28664 L 254.98615,326.30855 C 249.07637,320.31568 260.89561,308.33016 266.80539,314.32305 z "
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt"
+ id="path3485" />
+ <path
+ id="path3487"
+ style="font-size:12px;fill:url(#linearGradient3009);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.89469233pt"
+ d="M 266.80539,314.32305 L 284.5344,332.30143 L 272.71555,344.28664 L 254.98615,326.30855 C 249.07637,320.31568 260.89561,308.33016 266.80539,314.32305 z " />
+ <path
+ id="path3439"
+ d="M 290.44894,326.29522 L 308.16769,344.29522 L 469.88644,508.26397 L 446.23019,532.23272 L 284.54269,368.26397 L 266.79269,350.29522 C 269.16431,340.71443 281.00141,328.69987 290.44894,326.29522 z M 479.54269,518.07647 L 585.91769,625.95147 L 562.29269,649.92022 L 455.91769,542.04522 C 458.28932,532.46435 470.09508,520.48113 479.54269,518.07647 z "
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ <path
+ d="M 308.17326,344.28709 L 325.90227,362.26548 C 337.72143,374.25093 379.08892,428.18546 379.08892,428.18546 C 379.08892,428.18546 434.42205,472.31586 446.2412,484.30136 L 463.97022,502.27976 C 452.15098,490.29424 379.08853,440.17089 379.08853,440.17089 C 379.08853,440.17089 422.6025,508.27262 440.33143,526.25109 L 422.6025,508.27262 C 410.78326,496.2872 367.26734,440.1733 367.26968,440.17089 C 367.26734,440.1733 319.9925,404.21452 308.17357,392.2293 L 284.53479,368.25805 C 296.3540 [...]
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path3577" />
+ <path
+ style="font-size:12px;fill:url(#linearGradient3004);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 290.44894,326.29522 L 308.16769,344.29522 L 469.88644,508.26397 L 446.23019,532.23272 L 284.54269,368.26397 L 266.79269,350.29522 C 269.16431,340.71443 281.00141,328.69987 290.44894,326.29522 z M 479.54269,518.07647 L 585.91769,625.95147 L 562.29269,649.92022 L 455.91769,542.04522 C 458.28932,532.46435 470.09508,520.48113 479.54269,518.07647 z "
+ id="path3463" />
+ <path
+ d="M 544.55792,572.01116 L 509.10028,607.96762 C 502.59145,607.96793 497.14133,602.44117 497.28105,595.9821 C 497.28105,595.9821 497.28105,583.99698 509.10028,572.01146 C 520.91952,560.02603 532.73876,560.02572 532.73876,560.02572 C 538.22922,560.77524 542.84072,566.0186 544.55792,572.01116 z "
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt"
+ id="path3443" />
+ <path
+ d="M 544.55792,572.01116 L 568.19639,607.96793 L 544.55792,631.93887 L 509.10028,607.96762 C 507.76571,606.79963 509.10028,595.98249 520.91952,583.99698 C 532.73876,572.01146 544.02521,572.29768 544.55792,572.01116 z "
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt"
+ id="path3445" />
+ <path
+ d="M 562.28693,613.96065 C 552.62103,604.15877 538.64846,589.98961 520.91952,583.99713 C 526.82922,601.97514 540.80179,616.14419 550.46769,625.94615 L 562.28693,613.96065 z "
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ id="path3447" />
+ <path
+ d="M 544.55823,631.93904 L 550.46769,625.94647 C 550.46769,625.94647 543.48137,618.86186 538.64853,613.96111 C 526.82914,601.97545 509.10036,607.96823 509.10036,607.96823 L 544.55823,631.93904 z "
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80909872pt"
+ id="path3449" />
+ <path
+ d="M 568.19639,607.96808 L 562.28693,613.96065 C 562.28693,613.96065 555.30068,606.87612 550.46785,601.97529 C 538.64846,589.98961 544.55807,572.01146 544.55807,572.01146 L 568.19639,607.96808 z "
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80909872pt"
+ id="path3451" />
+ <path
+ id="path3453"
+ d="M 568.19639,607.96793 C 609.5638,649.91726 656.84067,673.88829 686.38892,703.85212 C 710.02732,727.82306 693.66029,746.17053 687.06999,751.97875 C 680.47946,757.78666 662.55598,776.03193 639.11205,751.79409 C 609.5638,721.83019 585.9254,673.88829 544.55792,631.93887 C 544.55831,619.95345 556.37747,607.96793 568.19639,607.96793 z "
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3469"
+ style="font-size:12px;fill:#d8a002;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 339.02492,539.81521 L 339.02492,539.81521 L 339.02492,520.799 L 326.80592,530.30684 L 339.02492,539.81521 z " />
+ <path
+ id="path3489"
+ d="M 281.13644,316.85772 C 287.01314,317.20592 292.53836,322.06791 292.94894,328.82647 L 290.44894,326.29522 C 281.00141,328.69987 269.16431,340.71443 266.79269,350.29522 L 269.29269,352.82647 C 262.79764,352.80915 257.37186,347.30647 257.51144,340.85772 C 262.64294,328.47819 269.30419,322.44304 281.13644,316.85772 z "
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ <path
+ id="path3491"
+ d="M 298.85519,334.85772 C 304.74097,335.20647 310.30362,340.0515 310.69894,346.82647 L 310.66769,346.85772 L 308.16769,344.29522 C 298.72009,346.69987 286.91429,358.68312 284.54269,368.26397 L 287.04269,370.79522 C 280.53383,370.79553 275.09039,365.28554 275.23019,358.82647 C 280.36167,346.44694 287.02295,340.44304 298.85519,334.85772 z "
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt" />
+ <path
+ id="path3495"
+ style="font-size:12px;fill:#d8a002;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 300.54561,482.76649 L 262.19158,520.79891 L 243.01457,520.79891 L 233.42579,530.30676 L 233.42579,568.33974 L 300.54561,501.59326 L 300.54561,482.76649 z " />
+ <path
+ id="path3497"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 310.13432,606.37214 L 252.60274,549.3235 L 262.19152,539.81512 L 319.72256,596.86378 L 310.13432,606.37214 z " />
+ <path
+ id="path3499"
+ style="font-size:12px;fill:#bb8a02;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 310.13412,606.37185 L 310.13412,644.40428 L 252.60254,587.35564 L 252.60254,549.32319 L 310.13412,606.37185 z " />
+ <path
+ id="path3501"
+ style="font-size:12px;fill:#ffcc3c;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 262.19137,520.79885 L 204.66033,463.75019 L 185.48332,463.75019 L 243.01436,520.79885 L 262.19137,520.79885 z " />
+ <path
+ id="path3503"
+ style="font-size:12px;fill:#bb8a02;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 243.01472,463.7503 L 233.42595,454.24193 L 233.42595,435.22571 L 252.60296,454.24193 L 243.01472,463.7503 z " />
+ <path
+ id="path3505"
+ style="font-size:12px;fill:#bb8a02;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 290.95742,416.20969 L 281.36865,406.70133 L 281.36865,387.6851 L 300.54566,406.70133 L 290.95742,416.20969 z " />
+ <path
+ style="font-size:12px;opacity:0.6;fill:url(#linearGradient2986);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 281.13644,316.85772 C 287.01314,317.20592 292.53836,322.06791 292.94894,328.82647 L 290.44894,326.29522 C 281.00141,328.69987 269.16431,340.71443 266.79269,350.29522 L 269.29269,352.82647 C 262.79764,352.80915 257.37186,347.30647 257.51144,340.85772 C 262.64294,328.47819 269.30419,322.44304 281.13644,316.85772 z "
+ id="path3523" />
+ <path
+ id="path3525"
+ d="M 298.42079,335.14406 C 304.29749,335.49226 309.82271,340.35425 310.23329,347.11281 L 307.73329,344.58156 C 298.28576,346.98621 286.44866,359.00077 284.07704,368.58156 L 286.57704,371.11281 C 280.08199,371.09549 274.65621,365.59281 274.79579,359.14406 C 279.92729,346.76453 286.58854,340.72938 298.42079,335.14406 z "
+ style="font-size:12px;opacity:0.6;fill:url(#linearGradient2983);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="csssccssssscc"
+ style="opacity:0.51219512;fill:url(#linearGradient2980);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 587.0231,664.86402 C 587.0231,723.97353 604.66683,801.37135 631.92935,858.30152 C 645.56061,886.76661 661.67428,910.06525 678.0231,923.48902 C 694.37192,936.91279 709.28067,940.88267 726.17935,933.77027 C 738.136,928.73788 747.64397,926.43548 756.4606,927.70777 C 756.4606,927.70777 745.23319,936.57963 754.7106,948.08277 C 754.65182,947.71109 754.6897,947.49119 754.7731,947.39527 C 754.72905,947.49235 754.63118,947.6399 753.5856,947.48902 C 751.05244,947.12347 744.0902,947.93121 [...]
+ id="path3700" />
+ <g
+ id="g4649"
+ transform="matrix(-1,0,0,1,1160,0)">
+ <rect
+ id="rect3455"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00098872;stroke-miterlimit:4;stroke-dasharray:none"
+ transform="matrix(0.6547792,-0.7558202,0.7131899,0.7009709,0,0)"
+ y="820.53955"
+ x="-212.10445"
+ height="65.672768"
+ width="20.631729" />
+ <rect
+ id="rect3457"
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke:#000000;stroke-width:1.00089395;stroke-miterlimit:4;stroke-dasharray:none"
+ transform="matrix(0.6559657,-0.7547907,0.7142968,0.6998428,0,0)"
+ y="817.81775"
+ x="-231.84062"
+ height="72.160545"
+ width="22.667192" />
+ <path
+ style="font-size:12px;fill:url(#linearGradient4420);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt"
+ d="M 562.25543,661.90278 C 538.61695,697.85884 514.97817,721.83019 509.06878,727.82274 C 497.85297,739.21731 485.43031,739.80858 485.43031,739.80858 C 485.43031,739.80858 485.43031,727.82274 497.24954,715.83732 C 503.15901,709.84467 526.79771,685.87342 562.25543,661.90278 z "
+ id="path3459" />
+ <path
+ id="path3475"
+ d="M 376.70731,748.07647 C 306.32731,748.07647 249.20731,805.1965 249.20731,875.57647 C 249.20731,945.95647 306.32731,1003.0764 376.70731,1003.0764 C 447.08731,1003.0764 504.2073,945.95648 504.20731,875.57647 C 504.20731,805.19647 447.0873,748.0765 376.70731,748.07647 z M 361.20731,782.32647 C 365.07131,782.32647 368.2073,785.46245 368.20731,789.32647 C 368.20731,794.00721 371.99529,797.79522 376.67606,797.79522 C 381.35683,797.79522 385.14481,794.00721 385.14481,789.32647 C 385.1 [...]
+ style="fill:#bb8a02;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="csssccssssccsssssssccsssssccsssssssccc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#d72b2b;fill-opacity:1;stroke:#000000;stroke-width:1.0161109;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path3477"
+ sodipodi:cx="65.457985"
+ sodipodi:cy="781.91168"
+ sodipodi:rx="18.298054"
+ sodipodi:ry="18.298054"
+ d="m 83.756039,781.91168 c 0,10.10574 -8.192318,18.29806 -18.298054,18.29806 -10.105736,0 -18.298054,-8.19232 -18.298054,-18.29806 0,-10.10573 8.192318,-18.29805 18.298054,-18.29805 10.105736,0 18.298054,8.19232 18.298054,18.29805 z"
+ transform="matrix(0.984145,0,0,0.984144,202.78877,-12.734605)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:url(#linearGradient6755);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path3479"
+ sodipodi:cx="57.4408"
+ sodipodi:cy="726.92322"
+ sodipodi:rx="13.582061"
+ sodipodi:ry="13.582061"
+ d="m 71.022861,726.92322 c 0,7.50116 -6.080896,13.58206 -13.582061,13.58206 -7.501165,0 -13.582061,-6.0809 -13.582061,-13.58206 0,-7.50117 6.080896,-13.58206 13.582061,-13.58206 7.501165,0 13.582061,6.08089 13.582061,13.58206 z"
+ transform="matrix(1.36268,0,0,1.36268,188.93549,-233.78461)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path3481"
+ sodipodi:cx="50.932728"
+ sodipodi:cy="723.24475"
+ sodipodi:rx="3.0182357"
+ sodipodi:ry="3.0182357"
+ d="m 53.950963,723.24475 c 0,1.66693 -1.35131,3.01824 -3.018235,3.01824 -1.666926,0 -3.018236,-1.35131 -3.018236,-3.01824 0,-1.66692 1.35131,-3.01823 3.018236,-3.01823 1.666925,0 3.018235,1.35131 3.018235,3.01823 z"
+ transform="translate(207.61387,32.953304)" />
+ <path
+ transform="matrix(0.375,0,0,0.375,256.99027,484.98139)"
+ d="m 53.950963,723.24475 c 0,1.66693 -1.35131,3.01824 -3.018235,3.01824 -1.666926,0 -3.018236,-1.35131 -3.018236,-3.01824 0,-1.66692 1.35131,-3.01823 3.018236,-3.01823 1.666925,0 3.018235,1.35131 3.018235,3.01823 z"
+ sodipodi:ry="3.0182357"
+ sodipodi:rx="3.0182357"
+ sodipodi:cy="723.24475"
+ sodipodi:cx="50.932728"
+ id="path3483"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ d="M 303.44319,754.38249 C 296.57852,759.31891 290.10317,765.02261 284.13911,771.48707 C 278.17513,777.95151 273.0018,784.87397 268.616,792.13194 L 261.93174,787.91423 C 266.53701,780.29247 271.97031,773.02321 278.23374,766.23424 C 284.49725,759.44519 291.2969,753.45503 298.50628,748.27089 L 303.44319,754.38249 z "
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path3493"
+ sodipodi:nodetypes="csccscc" />
+ <path
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 273.01981,931.76397 L 265.86356,935.13897 L 265.86356,952.76397 C 271.01025,960.02581 276.96732,966.89252 283.70731,973.2015 C 290.44729,979.51046 297.67186,984.96907 305.23856,989.60786 L 310.01981,984.38897 L 310.23856,966.38892 C 295.63792,957.44642 282.96958,945.6391 273.01981,931.76397 z "
+ id="path3507" />
+ <path
+ d="M 305.2463,971.5842 C 298.04136,967.16702 292.23034,963.02602 285.81255,957.01861 C 279.39475,951.01122 271.07884,942.34989 266.17739,935.43467"
+ style="font-size:12px;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path3509"
+ sodipodi:nodetypes="csc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 309.96856,966.75072 L 305.18609,971.4447 L 305.18609,988.98047"
+ id="path3511"
+ sodipodi:nodetypes="ccc" />
+ <path
+ style="font-size:12px;fill:#000000;fill-opacity:0.43820226;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 265.86356,935.85772 L 265.86356,952.76397 C 271.01025,960.02581 276.96732,966.89252 283.70731,973.2015 C 290.44729,979.51046 297.67186,984.96907 305.23856,989.60786 L 310.01981,984.38897 L 310.23856,967.20142 L 305.67606,971.6703 L 305.67606,988.98286 L 304.67606,988.98286 L 304.67606,971.8265 C 297.5981,967.47071 291.80758,963.33322 285.45731,957.38892 C 279.0593,951.4001 270.81546,942.80868 265.86356,935.85772 z "
+ id="path3513" />
+ <path
+ transform="matrix(0.984145,0,0,0.984144,207.65987,204.86789)"
+ d="m 83.756039,781.91168 c 0,10.10574 -8.192318,18.29806 -18.298054,18.29806 -10.105736,0 -18.298054,-8.19232 -18.298054,-18.29806 0,-10.10573 8.192318,-18.29805 18.298054,-18.29805 10.105736,0 18.298054,8.19232 18.298054,18.29805 z"
+ sodipodi:ry="18.298054"
+ sodipodi:rx="18.298054"
+ sodipodi:cy="781.91168"
+ sodipodi:cx="65.457985"
+ id="path3515"
+ style="fill:#d72b2b;fill-opacity:1;stroke:#000000;stroke-width:1.0161109;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(1.36268,0,0,1.36268,193.80659,-16.182145)"
+ d="m 71.022861,726.92322 c 0,7.50116 -6.080896,13.58206 -13.582061,13.58206 -7.501165,0 -13.582061,-6.0809 -13.582061,-13.58206 0,-7.50117 6.080896,-13.58206 13.582061,-13.58206 7.501165,0 13.582061,6.08089 13.582061,13.58206 z"
+ sodipodi:ry="13.582061"
+ sodipodi:rx="13.582061"
+ sodipodi:cy="726.92322"
+ sodipodi:cx="57.4408"
+ id="path3517"
+ style="fill:url(#linearGradient6757);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ transform="translate(212.48487,250.55579)"
+ d="m 53.950963,723.24475 c 0,1.66693 -1.35131,3.01824 -3.018235,3.01824 -1.666926,0 -3.018236,-1.35131 -3.018236,-3.01824 0,-1.66692 1.35131,-3.01823 3.018236,-3.01823 1.666925,0 3.018235,1.35131 3.018235,3.01823 z"
+ sodipodi:ry="3.0182357"
+ sodipodi:rx="3.0182357"
+ sodipodi:cy="723.24475"
+ sodipodi:cx="50.932728"
+ id="path3519"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path3521"
+ sodipodi:cx="50.932728"
+ sodipodi:cy="723.24475"
+ sodipodi:rx="3.0182357"
+ sodipodi:ry="3.0182357"
+ d="m 53.950963,723.24475 c 0,1.66693 -1.35131,3.01824 -3.018235,3.01824 -1.666926,0 -3.018236,-1.35131 -3.018236,-3.01824 0,-1.66692 1.35131,-3.01823 3.018236,-3.01823 1.666925,0 3.018235,1.35131 3.018235,3.01823 z"
+ transform="matrix(0.375,0,0,0.375,261.86137,702.58389)" />
+ <path
+ style="font-size:12px;fill:url(#linearGradient4388);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.89469233pt"
+ d="M 627.26981,560.01397 C 621.77935,560.76347 617.17451,566.0214 615.45731,572.01397 L 591.80106,607.98272 C 550.43366,649.93203 503.16181,673.89388 473.61356,703.85772 C 467.12323,710.43936 463.66503,716.57961 462.17606,722.17022 L 459.83231,719.88897 L 449.08231,732.32647 L 446.95731,730.23272 L 432.08231,747.32647 L 483.64481,797.82647 L 498.48856,780.73272 L 495.95731,778.26397 L 506.67606,765.92022 L 503.73856,763.04522 C 509.009,761.53446 514.76595,758.13163 520.89481,751.7 [...]
+ id="path3465" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 376.70731,730.07647 C 306.32731,730.07647 249.20731,787.1965 249.20731,857.57647 C 249.20731,927.95647 306.32731,985.07647 376.70731,985.07647 C 447.08731,985.07647 504.2073,927.95648 504.20731,857.57647 C 504.20731,787.19647 447.0873,730.0765 376.70731,730.07647 z M 361.20731,764.32647 C 365.07131,764.32647 368.2073,767.46245 368.20731,771.32647 C 368.20731,776.00721 371.99529,779.79522 376.67606,779.79522 C 381.35683,779.79522 385.14481,776.00721 385.14481,771.32647 C 385.1 [...]
+ id="path3527" />
+ <path
+ style="fill:#000000;fill-opacity:0.24157302;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 372.73856,744.10772 C 314.11504,744.85277 261.79717,797.94983 263.08231,856.88897 C 262.63114,904.87186 295.23513,951.90086 341.80106,965.67022 C 383.35806,979.14197 432.52818,966.91041 461.13303,933.49556 C 491.04789,900.62615 499.49131,849.38257 479.44855,809.2604 C 461.25503,770.26592 419.695,742.98667 376.45731,744.07647 C 375.2175,744.06823 373.97806,744.07917 372.73856,744.10772 z M 391.58231,750.23272 C 439.83095,755.65123 482.08112,798.3886 483.64481,847.38897 C 483.1 [...]
+ id="path3529" />
+ <path
+ id="path3531"
+ d="M 480.43482,931.76397 L 487.59107,935.13897 L 487.59107,952.76397 C 482.44438,960.02581 476.48731,966.89252 469.74732,973.2015 C 463.00734,979.51046 455.78277,984.96907 448.21607,989.60786 L 443.43482,984.38897 L 443.21607,966.38892 C 457.81671,957.44642 470.48505,945.6391 480.43482,931.76397 z "
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="csc"
+ id="path3533"
+ style="font-size:12px;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 448.20833,971.5842 C 455.41327,967.16702 461.22429,963.02602 467.64208,957.01861 C 474.05988,951.01122 482.37579,942.34989 487.27724,935.43467" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path3535"
+ d="M 443.48607,966.75072 L 448.26854,971.4447 L 448.26854,988.98047"
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <path
+ id="path3537"
+ d="M 487.53784,935.85772 L 487.53784,952.76397 C 482.39115,960.02581 476.43408,966.89252 469.69409,973.2015 C 462.95411,979.51046 455.72954,984.96907 448.16284,989.60786 L 443.38159,984.38897 L 443.16284,967.20142 L 447.72534,971.6703 L 447.72534,988.98286 L 448.72534,988.98286 L 448.72534,971.8265 C 455.8033,967.47071 461.59382,963.33322 467.94409,957.38892 C 474.3421,951.4001 482.58594,942.80868 487.53784,935.85772 z "
+ style="font-size:12px;fill:#000000;fill-opacity:0.43820226;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#d72b2b;fill-opacity:1;stroke:#000000;stroke-width:1.0161109;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path3539"
+ sodipodi:cx="65.457985"
+ sodipodi:cy="781.91168"
+ sodipodi:rx="18.298054"
+ sodipodi:ry="18.298054"
+ d="m 83.756039,781.91168 c 0,10.10574 -8.192318,18.29806 -18.298054,18.29806 -10.105736,0 -18.298054,-8.19232 -18.298054,-18.29806 0,-10.10573 8.192318,-18.29805 18.298054,-18.29805 10.105736,0 18.298054,8.19232 18.298054,18.29805 z"
+ transform="matrix(0.984145,0,0,0.984144,416.32447,204.86789)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:url(#linearGradient6765);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path3541"
+ sodipodi:cx="57.4408"
+ sodipodi:cy="726.92322"
+ sodipodi:rx="13.582061"
+ sodipodi:ry="13.582061"
+ d="m 71.022861,726.92322 c 0,7.50116 -6.080896,13.58206 -13.582061,13.58206 -7.501165,0 -13.582061,-6.0809 -13.582061,-13.58206 0,-7.50117 6.080896,-13.58206 13.582061,-13.58206 7.501165,0 13.582061,6.08089 13.582061,13.58206 z"
+ transform="matrix(1.36268,0,0,1.36268,402.47117,-16.182145)" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ id="path3543"
+ sodipodi:cx="50.932728"
+ sodipodi:cy="723.24475"
+ sodipodi:rx="3.0182357"
+ sodipodi:ry="3.0182357"
+ d="m 53.950963,723.24475 c 0,1.66693 -1.35131,3.01824 -3.018235,3.01824 -1.666926,0 -3.018236,-1.35131 -3.018236,-3.01824 0,-1.66692 1.35131,-3.01823 3.018236,-3.01823 1.666925,0 3.018235,1.35131 3.018235,3.01823 z"
+ transform="translate(421.14957,250.55579)" />
+ <path
+ transform="matrix(0.375,0,0,0.375,470.52607,702.58389)"
+ d="m 53.950963,723.24475 c 0,1.66693 -1.35131,3.01824 -3.018235,3.01824 -1.666926,0 -3.018236,-1.35131 -3.018236,-3.01824 0,-1.66692 1.35131,-3.01823 3.018236,-3.01823 1.666925,0 3.018235,1.35131 3.018235,3.01823 z"
+ sodipodi:ry="3.0182357"
+ sodipodi:rx="3.0182357"
+ sodipodi:cy="723.24475"
+ sodipodi:cx="50.932728"
+ id="path3545"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:type="arc" />
+ </g>
+ <path
+ id="path3547"
+ style="font-size:12px;fill:#bb8a02;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 319.72266,482.76626 L 300.54565,463.75003 L 300.54565,444.73382 L 319.72266,463.75003 L 319.72266,482.76626 z " />
+ <path
+ id="path3549"
+ style="font-size:12px;fill:#d8a002;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 338.89975,425.71759 L 338.89975,444.7338 L 329.31097,435.22544 L 338.89975,425.71759 z " />
+ <path
+ id="path3551"
+ style="font-size:12px;fill:#d8a002;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 319.72266,482.76626 L 338.89967,463.75003 L 338.89967,444.73382 L 319.72266,463.75003 L 319.72266,482.76626 z " />
+ <path
+ id="path3553"
+ style="font-size:12px;fill:#d8a002;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 271.77986,473.25825 L 300.54565,444.73366 L 300.54565,425.71743 L 262.19162,463.74987 L 271.77986,473.25825 z " />
+ <path
+ id="path3555"
+ style="font-size:12px;fill:#ffcc3c;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 338.89957,596.86378 L 281.36853,539.81512 L 262.19152,539.81512 L 319.72256,596.86378 L 338.89957,596.86378 z " />
+ <path
+ id="path3557"
+ style="font-size:12px;fill:#bb8a02;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 300.54566,444.73387 L 310.1339,435.22549 L 300.54566,425.71766 L 300.54566,444.73387 z " />
+ <path
+ id="path3559"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 300.54568,368.6683 L 281.36813,387.68505 L 300.54568,406.70074 L 290.95744,416.20964 L 271.77989,397.19289 L 233.42587,435.22533 L 252.60342,454.24208 L 243.0141,463.74992 L 223.83763,444.73423 L 204.66008,463.74992 L 262.19166,520.79912 L 300.54568,482.76667 L 281.36813,463.74992 L 271.77989,473.25884 L 262.19166,463.74992 L 300.54568,425.71748 L 310.13392,435.22639 L 300.54568,444.73423 L 319.72215,463.74992 L 338.89971,444.73423 L 329.31147,435.22533 L 338.89971,425.71748 L [...]
+ <path
+ id="path3583"
+ d="M 467.73019,506.10772 C 473.61598,506.45648 479.14737,511.30151 479.54269,518.07647 C 470.09508,520.48113 458.28932,532.46435 455.91769,542.04522 C 449.40883,542.04553 443.96539,536.53554 444.10519,530.07647 C 449.23667,517.69697 455.89794,511.69305 467.73019,506.10772 z "
+ style="font-size:12px;fill:#c0c0c0;fill-rule:evenodd;stroke:#000000;stroke-width:0.89469233pt" />
+ <path
+ style="font-size:12px;opacity:0.8;fill:url(#linearGradient2941);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.89469233pt"
+ d="M 467.73019,506.10772 C 473.61598,506.45648 479.14737,511.30151 479.54269,518.07647 C 470.09508,520.48113 458.28932,532.46435 455.91769,542.04522 C 449.40883,542.04553 443.96539,536.53554 444.10519,530.07647 C 449.23667,517.69697 455.89794,511.69305 467.73019,506.10772 z "
+ id="path3561" />
+ <path
+ id="path3579"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 233.42642,530.30711 L 175.89484,473.25847 L 185.48362,463.75008 L 243.01466,520.79874 L 233.42642,530.30711 z " />
+ <path
+ id="path3581"
+ style="font-size:12px;fill:#bb8a02;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 233.42592,530.30706 L 233.42592,568.33949 L 175.89434,511.29085 L 175.89434,473.25841 L 233.42592,530.30706 z " />
+ <path
+ id="path3585"
+ style="font-size:12px;fill:#d8a002;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 358.07658,577.84755 L 358.07658,596.86378 L 310.13432,644.40459 L 310.13432,606.37214 L 319.72256,596.86378 L 338.89957,596.86378 L 358.07658,577.84755 z " />
+ <path
+ id="path3587"
+ style="font-size:12px;fill:#d8a002;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 406.01941,530.69778 L 367.92787,568.46993 L 367.47433,587.35574 L 406.01941,549.13385 L 406.01941,530.69778 z " />
+ <path
+ id="path3589"
+ style="font-size:12px;fill:#bb8a02;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 367.66536,587.35593 L 348.48835,568.33971 L 348.48835,549.3235 L 367.66536,568.33971 L 367.66536,587.35593 z " />
+ <path
+ id="path3591"
+ style="font-size:12px;fill:#bb8a02;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 415.60796,539.81513 L 396.43095,520.79891 L 396.43095,501.7827 L 415.60796,520.79891 L 415.60796,539.81513 z " />
+ <path
+ id="path3593"
+ style="font-size:12px;fill:#d8a002;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 396.43115,501.78269 L 396.43115,520.7989 L 386.84237,511.29053 L 396.43115,501.78269 z " />
+ <path
+ id="path3595"
+ style="font-size:12px;fill:#d8a002;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 348.48825,549.32328 L 348.48825,568.33949 L 338.89947,558.83112 L 348.48825,549.32328 z " />
+ <path
+ id="path3597"
+ style="font-size:12px;fill:#d8a002;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 434.97591,501.78258 L 415.60784,520.79881 L 415.60784,539.81503 L 434.97591,520.21866 L 434.97591,501.78258 z " />
+ <path
+ id="path3599"
+ style="font-size:12px;fill:#bb8a02;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 358.07676,520.79883 L 338.89975,501.78261 L 338.89975,482.7664 L 358.07676,501.78261 L 358.07676,520.79883 z " />
+ <path
+ id="path3601"
+ style="font-size:12px;fill:#bb8a02;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 367.66554,473.25845 L 338.89975,444.73387 L 338.89975,425.71765 L 377.25377,463.75008 L 367.66554,473.25845 z " />
+ <path
+ id="path3603"
+ style="font-size:12px;fill:#bb8a02;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none"
+ d="M 358.07686,520.79883 L 377.25387,501.78261 L 367.6651,492.27423 L 358.07686,501.78261 L 358.07686,520.79883 z " />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3605"
+ d="M 367.66769,492.26397 L 367.66769,511.32696 L 358.07394,520.79522 L 358.07394,501.79522 L 367.66769,492.26397 z "
+ style="opacity:0.8;fill:#d8a002;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 589.90348,623.97115 C 601.76884,624.31619 613.3469,625.82432 622.99723,629.7524 C 628.11449,631.8321 630.57693,637.66639 628.49723,642.78365 C 626.41753,647.9009 620.58324,650.36335 615.46598,648.28365 C 607.94482,645.22223 592.84745,643.62583 578.49723,643.97115 C 564.14701,644.31646 549.80943,646.43899 544.15348,648.1899 C 540.69549,649.41126 536.84637,648.64203 534.12343,646.18539 C 531.40048,643.72877 530.24052,639.97885 531.1008,636.41382 C 531.96107,632.8488 534.70358,630 [...]
+ id="path7644" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 579.62223,593.4399 C 582.79489,593.57409 585.71528,595.20702 587.49093,597.83967 C 589.26658,600.47232 589.68645,603.79179 588.62223,606.78365 C 586.97525,611.61057 584.87677,628.46614 584.65348,644.6899 C 584.43019,660.91365 585.99868,678.15086 587.96598,684.3149 C 589.64009,689.57885 586.72994,695.20328 581.46598,696.8774 C 576.20202,698.55151 570.57759,695.64135 568.90348,690.3774 C 565.16488,678.66347 564.41511,661.75943 564.65348,644.4399 C 564.89185,627.12036 566.04026,61 [...]
+ id="path8535" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 751.40348,927.37744 C 753.11679,927.37023 754.81286,927.48264 756.46598,927.72119 C 765.28262,928.99348 773.15282,936.66847 774.46598,944.97119 C 775.77915,953.27392 773.3278,961.29733 769.18473,969.90869 C 765.04167,978.51987 758.83923,987.68377 750.80973,997.06497 C 718.69172,1034.5887 656.457,1076.0336 578.90348,1076.0336 C 501.34996,1076.0336 439.11525,1034.5887 406.99723,997.06497 C 398.96773,987.68386 392.7653,978.51987 388.62223,969.90869 C 384.47916,961.29733 382.02782, [...]
+ id="path8047"
+ sodipodi:nodetypes="csssssssssssccsssssssssccsc" />
+ <g
+ id="g3393"
+ transform="matrix(1.0873285,0,0,0.84954444,-51.191382,49.567569)">
+ <path
+ transform="matrix(-1.625546,0,0,1.501868,1060.3522,265.21492)"
+ d="m 354.82142,147.67857 c 0,5.42423 -26.38322,9.82143 -58.92857,9.82143 -32.54535,0 -58.92857,-4.3972 -58.92857,-9.82143 0,-5.42422 26.38322,-9.82142 58.92857,-9.82142 32.54535,0 58.92857,4.3972 58.92857,9.82142 z"
+ sodipodi:ry="9.8214283"
+ sodipodi:rx="58.92857"
+ sodipodi:cy="147.67857"
+ sodipodi:cx="295.89285"
+ id="path7630"
+ style="fill:#c80035;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.64000666;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ id="path3408"
+ d="m 580.00128,126.519 c 72.9737,53.6335 113.0937,102.31664 113.0937,241.09374 0,43.201 -14.071,77.42629 -19.3125,107.5 -27.5797,-6.70446 -52.4028,-13.40625 -93.7812,-13.40625 -41.3785,0 -66.2016,6.70179 -93.7813,13.40625 -5.2415,-30.07371 -19.3125,-64.299 -19.3125,-107.5 0,-138.7771 40.12,-187.46024 113.0938,-241.09374 z"
+ style="font-size:12px;fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="ccccccccccccc"
+ id="path3410"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80800003;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 588.52719,62.519293 -2,18.945934 15.2024,-2 0,18.57816 -15.2024,-2.00001 2,33.516103 -17.05208,0 2,-33.516103 -15.20224,2.00001 0,-18.57816 15.20224,2 -2,-18.945934 17.05208,0 z" />
+ <path
+ sodipodi:nodetypes="ccccccc"
+ id="path30507"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.4872309;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 692.12592,252.31404 c -28.54025,-9.33657 -63.83389,-14.65321 -108.03953,-14.76828 -44.14658,0.11507 -89.00399,5.32565 -117.48517,14.66219 l 4.05849,21.44133 c 25.77923,-8.81054 67.7049,-15.45319 108.55895,-15.5025 40.79499,0.0493 89.78303,6.91357 110.2322,15.24743 0.22835,1.82703 2.67506,-21.08017 2.67506,-21.08017 z" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path30509"
+ style="font-size:12px;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ d="m 470.73383,271.99541 13.11451,-13.53703 -15.99641,-4.62275" />
+ <path
+ sodipodi:nodetypes="cccccccccccccccccccc"
+ id="path30511"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98292708;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 480.86929,240.1778 7.58561,-12.81512 c 0,0 7.16275,8.11396 16.18347,6.74366 8.96945,-1.35734 11.42829,-16.45623 11.42829,-16.45623 0,0 11.87073,14.00009 20.12264,13.36667 8.25191,-0.73685 12.29691,-6.97202 12.29691,-6.97202 0,0 6.72033,6.46356 14.63909,5.83013 7.91875,-0.72391 18.61469,-16.60275 18.61469,-16.60275 0,0 7.0191,16.24078 14.93785,16.96472 7.91876,0.64634 17.56399,-11.49654 17.56399,-11.49654 0,0 3.57497,10.31585 13.64639,11.99638 10.05861,1.73222 16.40735,-11.996 [...]
+ <path
+ sodipodi:nodetypes="czczczczczczczczczczczczczczczczc"
+ id="path30513"
+ d="m 707.20298,226.40977 c -5.18615,10.39396 -12.65929,20.2387 -24.30181,17.82547 -11.64253,-2.41321 -12.09633,-12.38473 -12.09633,-12.38473 0,0 -7.17382,9.45171 -15.23013,7.50394 -8.14643,-1.96956 -10.68533,-15.91727 -10.68533,-15.91727 0,0 -8.82981,12.01233 -18.31695,10.99799 -9.42987,-1.0082 -12.95057,-11.37668 -12.95057,-11.37668 0,0 -4.71139,9.8844 -15.5968,9.45721 -11.33455,-0.4448 -17.14626,-14.89051 -17.14626,-14.89051 0,0 -7.96472,14.81072 -18.04592,14.7989 -10.07065,-0.0 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path30515"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 579.62416,239.9322 c 43.00871,0.0451 81.67919,5.39116 109.38921,13.98097 1.8818,0.63072 4.1802,-0.856 4.76917,-2.59798 0.58897,-1.84711 -0.74698,-4.12971 -2.57133,-4.76043 -27.86803,-8.90517 -67.50097,-14.52159 -111.58705,-14.56664 -44.02862,0.0451 -83.81957,5.66147 -111.6876,14.56664 -1.82436,0.63072 -3.16029,2.91332 -2.57133,4.76043 0.53151,1.74198 2.88736,3.2287 4.7117,2.59798 27.75312,-8.58981 66.59599,-13.93592 109.54723,-13.98097 z" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path30517"
+ style="font-size:12px;fill:#ce1126;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.9046002;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 690.41925,266.53558 4.84881,-4.31644 -3.28478,-4.43522 -8.97776,1.91302 7.41373,6.83864 z" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path30519"
+ style="font-size:12px;fill:#ce1126;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.7890479;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 470.08956,266.55492 -5.51538,-3.32909 3.55427,-5.09837 8.71475,1.81791 -6.75364,6.60955 z" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path30523"
+ d="m 554.64309,196.83787 c 0,0 15.79435,-0.13553 17.77708,-2.39277 2.31778,-2.63867 2.0068,-6.38552 -0.49622,-8.51375 -1.93391,-1.73883 -6.50202,-3.66478 -9.47681,-3.12285 -2.97481,0.54193 -6.75776,1.30206 -7.02711,4.51457 -0.22781,2.71708 9.01141,4.66102 9.01141,4.66102 0,0 -11.78121,-2.17319 -13.59546,0.11334 -2.01668,2.54165 -3.29474,6.30714 -0.64112,9.64292 1.96182,2.46612 14.6721,-0.79126 14.6721,-0.79126 0,0 -11.00334,2.04557 -9.4635,7.14082 0.85403,2.82595 6.59166,4.0148 10 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path30525"
+ d="m 607.07888,197.25863 c 0,0 -15.78771,0.48442 -17.85487,-1.69332 -2.41648,-2.54576 -2.24834,-6.30202 0.17181,-8.52687 1.86628,-1.81343 6.35768,-3.91722 9.35087,-3.49241 2.99321,0.42479 6.80227,1.03588 7.19368,4.23542 0.33106,2.70613 -8.82726,5.01119 -8.82726,5.01119 0,0 11.68969,-2.63394 13.58961,-0.4203 2.11191,2.46061 3.53233,6.17313 1.00766,9.61057 -1.86649,2.54126 -14.69125,-0.21488 -14.69125,-0.21488 0,0 11.07297,1.61223 9.72821,6.76408 -0.74583,2.85738 -6.43393,4.27049 -1 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path30527"
+ d="m 580.81139,166.20476 c 0,0 0.47705,16.03108 -1.66763,18.13011 -2.5071,2.45374 -6.20632,2.283 -8.3974,-0.17446 -1.78591,-1.89506 -3.85776,-6.45569 -3.43941,-9.49501 0.41834,-3.03937 1.02017,-6.90713 4.17112,-7.30459 2.66505,-0.33616 4.93511,8.96336 4.93511,8.96336 0,0 -2.59393,-11.8699 -0.41391,-13.79912 2.42326,-2.14447 6.07941,-3.58678 9.46465,-1.02319 2.5027,1.89528 -0.2116,14.91774 -0.2116,14.91774 0,0 1.58775,-11.24369 6.6614,-9.8782 2.81399,0.75734 4.20566,6.53313 3.69885 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="matrix(-1.134361,0.02226644,0.0219284,1.151848,960.3866,-583.49977)"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ sodipodi:ry="10.704739"
+ sodipodi:rx="5.9470773"
+ sodipodi:cy="670.55981"
+ sodipodi:cx="347.70578"
+ id="path30529"
+ style="color:#000000;fill:#ce1126;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.87467283;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path30533"
+ d="m 488.25223,207.08644 c 0,0 15.44944,-3.33609 16.94822,-5.94996 1.75204,-3.05559 0.71033,-6.66385 -2.16088,-8.24156 -2.23698,-1.31158 -7.09188,-2.27226 -9.90013,-1.13791 -2.80826,1.13433 -6.36547,2.64639 -5.99749,5.84877 0.31123,2.70855 9.74665,2.7395 9.74665,2.7395 0,0 -11.97129,0.25996 -13.29922,2.86836 -1.47609,2.89944 -1.98772,6.84826 1.26858,9.57865 2.40737,2.01854 14.22081,-3.75098 14.22081,-3.75098 0,0 -10.37925,4.23595 -7.8682,8.91623 1.39268,2.59581 7.24856,2.59703 11. [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path30535"
+ d="m 539.71449,196.86409 c 0,0 -15.37431,3.67658 -17.82819,1.96196 -2.86853,-2.00437 -3.44265,-5.71902 -1.50889,-8.38987 1.47197,-2.15543 5.45905,-5.12772 8.47549,-5.31854 3.01645,-0.19084 6.86896,-0.36457 7.88184,2.69112 0.85669,2.58445 -7.66369,6.70049 -7.66369,6.70049 0,0 10.93605,-4.95166 13.23311,-3.16798 2.55336,1.98272 4.67542,5.33236 2.87776,9.21256 -1.32901,2.86861 -14.43749,2.769 -14.43749,2.769 0,0 11.16698,-0.66597 10.8627,4.65482 -0.16876,2.95105 -5.46428,5.48933 -9.6 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path30537"
+ d="m 507.86765,171.76332 c 0,0 3.62076,15.61131 1.93217,18.10302 -1.97393,2.91275 -5.63219,3.49571 -8.2625,1.53215 -2.12269,-1.49465 -5.04987,-5.54321 -5.23779,-8.60615 -0.18793,-3.06295 -0.35903,-6.97485 2.65025,-8.00335 2.54523,-0.8699 6.59877,7.78185 6.59877,7.78185 0,0 -4.87648,-11.10466 -3.11987,-13.43712 1.95262,-2.5927 5.2514,-4.7475 9.07269,-2.92211 2.82506,1.34949 2.72698,14.66003 2.72698,14.66003 0,0 -0.65587,-11.33911 4.58413,-11.03014 2.90626,0.17135 5.40599,5.54852 5. [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="matrix(-1.107124,0.25188,0.248056,1.124191,732.32723,-639.81696)"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ sodipodi:ry="10.704739"
+ sodipodi:rx="5.9470773"
+ sodipodi:cy="670.55981"
+ sodipodi:cx="347.70578"
+ id="path30539"
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.87467301;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path30543"
+ d="m 673.97079,206.65986 c 0,0 -15.52216,-2.96759 -17.08084,-5.54511 -1.82207,-3.01305 -0.8639,-6.6451 1.97011,-8.29067 2.2061,-1.36445 7.03749,-2.44037 9.87114,-1.37316 2.83366,1.06721 6.42478,2.49422 6.1308,5.70447 -0.24865,2.71523 -9.68075,2.97063 -9.68075,2.97063 0,0 11.97399,-0.0249 13.36174,2.55116 1.54259,2.86352 2.1452,6.7991 -1.0472,9.60618 -2.36013,2.07528 -14.30345,-3.4116 -14.30345,-3.4116 0,0 10.47414,3.98787 8.07178,8.72659 -1.3324,2.62822 -7.18663,2.76879 -11.12092, [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path30545"
+ d="m 622.28707,197.66474 c 0,0 15.45491,3.30977 17.86854,1.53725 2.82149,-2.07204 3.30973,-5.79936 1.31488,-8.42347 -1.52131,-2.1198 -5.57587,-4.99642 -8.59588,-5.11542 -3.02003,-0.11901 -6.87548,-0.20103 -7.81757,2.8779 -0.79682,2.60414 7.81619,6.51632 7.81619,6.51632 0,0 -11.0473,-4.6901 -13.30257,-2.85224 -2.5069,2.04289 -4.55108,5.44209 -2.66438,9.27847 1.39483,2.83619 14.4974,2.42475 14.4974,2.42475 0,0 -11.17927,-0.40012 -10.75229,4.91195 0.23681,2.94625 5.58944,5.35781 9.75 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path30547"
+ d="m 653.54534,171.81317 c 0,0 -3.25953,15.69317 -1.51391,18.14401 2.04059,2.865 5.7113,3.36074 8.29558,1.33515 2.08761,-1.54476 4.92056,-5.66184 5.03775,-8.72839 0.11721,-3.0666 0.19799,-6.98148 -2.83419,-7.9381 -2.5646,-0.8091 -6.41739,7.93669 -6.41739,7.93669 0,0 4.6189,-11.21759 2.80895,-13.50762 -2.0119,-2.54557 -5.35949,-4.62124 -9.13761,-2.70548 -2.79315,1.41636 -2.38795,14.72089 -2.38795,14.72089 0,0 0.39404,-11.35159 -4.83739,-10.91803 -2.9015,0.24046 -5.27647,5.6756 -5.5 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="matrix(1.112631,0.22547,-0.222047,1.129783,410.42113,-634.20317)"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ sodipodi:ry="10.704739"
+ sodipodi:rx="5.9470773"
+ sodipodi:cy="670.55981"
+ sodipodi:cx="347.70578"
+ id="path30549"
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.8746739;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path30553"
+ d="m 475.28048,212.46897 c 0,0 -13.26384,8.70839 -16.14243,7.93068 -3.36502,-0.90911 -5.13496,-4.21192 -4.19744,-7.38726 0.67315,-2.53233 3.44486,-6.69216 6.22278,-7.90106 2.77793,-1.20891 6.34897,-2.68698 8.3141,-0.15455 1.6621,2.14191 -5.00088,8.92568 -5.00088,8.92568 0,0 8.6617,-8.39504 11.41544,-7.49876 3.061,0.99626 6.1681,3.42712 5.75895,7.69505 -0.30249,3.15529 -12.6818,7.53397 -12.6818,7.53397 0,0 10.29735,-4.43732 11.77145,0.67794 0.81758,2.83706 -3.33013,7.03451 -7.13481 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscszzss"
+ id="path30555"
+ d="m 433.84966,197.13424 c -0.33592,-4.86097 1.25039,-7.72618 5.03366,-5.20179 3.21679,2.14645 7.10149,14.16922 7.10149,14.16922 0,0 -4.36995,-10.45609 0.66764,-11.95291 2.79399,-0.83019 6.92773,3.38145 8.63565,7.24481 1.70791,3.86334 1.76276,8.29991 -1.054,11.18973 -2.8566,2.9307 -7.54716,1.9812 -10.16135,0.16429 -8.30933,-5.77514 -9.9621,-11.83678 -10.22309,-15.61335 z"
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="matrix(-0.959407,0.614975,0.605638,0.974197,379.83053,-641.28547)"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ sodipodi:ry="10.704739"
+ sodipodi:rx="5.9470773"
+ sodipodi:cy="670.55981"
+ sodipodi:cx="347.70578"
+ id="path30557"
+ style="fill:#ce1126;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.87467152;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path30561"
+ d="m 687.2269,212.25057 c 0,0 13.26384,8.70838 16.14243,7.93069 3.36502,-0.90911 5.13496,-4.21193 4.19744,-7.38726 -0.67315,-2.53233 -3.44486,-6.69217 -6.22278,-7.90107 -2.77793,-1.20891 -6.34897,-2.68698 -8.3141,-0.15455 -1.6621,2.14191 5.00088,8.92569 5.00088,8.92569 0,0 -8.6617,-8.39505 -11.41544,-7.49877 -3.061,0.99626 -6.1681,3.42712 -5.75895,7.69505 0.30249,3.15528 12.6818,7.53397 12.6818,7.53397 0,0 -10.29735,-4.43732 -11.77145,0.67793 -0.81758,2.83707 3.33013,7.03452 7.134 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscszzss"
+ id="path30563"
+ d="m 728.65792,196.91584 c 0.33592,-4.86097 -1.25039,-7.72618 -5.03366,-5.20179 -3.21679,2.14645 -7.10149,14.16922 -7.10149,14.16922 0,0 4.36995,-10.45609 -0.66764,-11.9529 -2.79399,-0.83021 -6.92773,3.38144 -8.63565,7.2448 -1.70791,3.86334 -1.76276,8.2999 1.054,11.18974 2.8566,2.9307 7.54716,1.9812 10.16135,0.16427 8.30933,-5.77513 9.9621,-11.83677 10.22309,-15.61334 z"
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="matrix(0.959407,0.614975,-0.605638,0.974197,782.67733,-641.50377)"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ sodipodi:ry="10.704739"
+ sodipodi:rx="5.9470773"
+ sodipodi:cy="670.55981"
+ sodipodi:cx="347.70578"
+ id="path30565"
+ style="color:#000000;fill:#ce1126;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.87467152;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.597761,0,0,0.606976,775.66983,43.196121)"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ sodipodi:ry="7.5"
+ sodipodi:rx="7.5"
+ sodipodi:cy="295.36218"
+ sodipodi:cx="483"
+ id="path30567"
+ style="color:#000000;fill:url(#radialGradient6703);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.91228688;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.684019,0,0,0.694564,878.96833,5.904871)"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ sodipodi:ry="7.5"
+ sodipodi:rx="7.5"
+ sodipodi:cy="295.36218"
+ sodipodi:cx="483"
+ id="path30569"
+ style="color:#000000;fill:url(#radialGradient6705);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.67113805;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.684019,0,0,0.694564,944.17354,6.551761)"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ sodipodi:ry="7.5"
+ sodipodi:rx="7.5"
+ sodipodi:cy="295.36218"
+ sodipodi:cx="483"
+ id="path30571"
+ style="color:#000000;fill:url(#radialGradient6707);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.67113805;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.612964,0,0,0.622414,971.87629,38.152502)"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ sodipodi:ry="7.5"
+ sodipodi:rx="7.5"
+ sodipodi:cy="295.36218"
+ sodipodi:cx="483"
+ id="path30573"
+ style="color:#000000;fill:url(#radialGradient6709);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.86486006;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ id="path30575"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 580.50816,264.14464 c 41.46043,0.0451 78.73882,5.39117 105.45129,13.98098 1.81407,0.63072 4.02972,-0.856 4.59749,-2.59797 0.56776,-1.84712 -0.7201,-4.12972 -2.47877,-4.76044 -26.86481,-8.90517 -65.07099,-14.52157 -107.57001,-14.56662 -42.44362,0.0451 -80.80214,5.66145 -107.66694,14.56662 -1.75867,0.63072 -3.04652,2.91332 -2.47876,4.76044 0.51237,1.74197 2.78342,3.22869 4.54209,2.59797 26.75403,-8.58981 64.19858,-13.93591 105.60361,-13.98098 z" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path30577"
+ style="font-size:12px;fill:#ce1126;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.83999985;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 580.59687,251.78799 -7.86942,-3.35145 7.22854,-4.36663 8.41016,3.85693 -7.76928,3.86115 z" />
+ <rect
+ transform="matrix(-0.992514,-0.122131,-0.129098,0.9916318,0,0)"
+ rx="2.695121"
+ ry="2.6950891"
+ y="168.98897"
+ x="-678.01978"
+ height="5.9145055"
+ width="20.260513"
+ id="rect30579"
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.70478141;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <rect
+ transform="matrix(-0.9918422,-0.127472,-0.123691,0.9923208,0,0)"
+ rx="4.7435818"
+ ry="3.9607508"
+ y="162.76663"
+ x="-681.052"
+ height="11.388265"
+ width="28.074228"
+ id="rect30581"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.76791477;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <rect
+ transform="matrix(0.9918422,-0.127472,0.123691,0.9923208,0,0)"
+ rx="2.695266"
+ ry="2.6952682"
+ y="313.39493"
+ x="477.27469"
+ height="6.1462088"
+ width="20.186039"
+ id="rect30583"
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.71713197;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <rect
+ transform="matrix(0.9918422,-0.127472,0.123691,0.9923208,0,0)"
+ rx="4.5860181"
+ ry="3.9607508"
+ y="310.69928"
+ x="473.11319"
+ height="11.388265"
+ width="28.074228"
+ id="rect30585"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.76791477;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path30587"
+ style="font-size:12px;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 580.57989,256.0399 -16.02708,-7.53419 14.93305,-8.35733 16.87993,7.4375 -15.7859,8.45402 z" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path30589"
+ style="font-size:12px;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 689.56998,271.37726 -14.11864,-13.34783 16.39169,-4.32749" />
+ <path
+ transform="matrix(0,1.152063,1.134573,0,89.5077,-89.84818)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path30593"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.67167157;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0,1.152063,1.134573,0,89.5077,-83.396878)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path30595"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.67167157;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0,1.152063,1.134573,0,148.4416,-89.53448)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path30599"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.67167157;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0,1.152063,1.134573,0,148.4416,-83.083178)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path30601"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.67167157;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0.181913,1.137158,1.119894,-0.184717,-15.1258,-2.527129)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path30605"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.67167199;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0.181913,1.137158,1.119894,-0.184717,-14.1068,3.840792)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path30607"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.67167199;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.181913,1.137158,-1.119894,-0.184717,1175.1139,-2.507319)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path30611"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.67167199;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.181913,1.137158,-1.119894,-0.184717,1174.0952,3.860602)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path30613"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.67167199;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="ccccccc"
+ id="path3105"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.48722994;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 677.89253,465.95529 c -25.06984,-8.20125 -56.07187,-12.87142 -94.90222,-12.9725 -38.77848,0.10108 -78.18135,4.67806 -103.1993,12.87932 l 3.56499,18.83414 c 22.64455,-7.73922 59.47218,-13.57414 95.35848,-13.61746 35.83443,0.0433 78.86566,6.0729 96.82827,13.39339 0.20058,1.60487 2.34978,-18.51689 2.34978,-18.51689 z" />
+ <path
+ sodipodi:nodetypes="cccccccccccccccccccc"
+ id="path3109"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98292643;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 492.32413,455.29479 6.66321,-11.25684 c 0,0 6.29179,7.12731 14.21561,5.92365 7.87879,-1.1923 10.03864,-14.4552 10.03864,-14.4552 0,0 10.42728,12.29773 17.67578,11.74131 7.2485,-0.64724 10.80164,-6.12423 10.80164,-6.12423 0,0 5.90316,5.67761 12.85902,5.12119 6.95585,-0.63589 16.35119,-14.58391 16.35119,-14.58391 0,0 6.1656,14.26597 13.12146,14.90186 6.95585,0.56775 15.42825,-10.09859 15.42825,-10.09859 0,0 3.14026,9.06148 11.98703,10.53766 8.83551,1.5216 14.41226,-10.53768 14. [...]
+ <path
+ sodipodi:nodetypes="czczczczczczczczczczczczczczczczc"
+ id="path3111"
+ d="m 691.13626,443.2009 c -4.55554,9.13009 -11.11996,17.77774 -21.34678,15.65796 -10.22683,-2.11979 -10.62545,-10.8788 -10.62545,-10.8788 0,0 -6.3015,8.30242 -13.37819,6.5915 -7.15584,-1.73006 -9.38602,-13.98179 -9.38602,-13.98179 0,0 -7.75613,10.55165 -16.08966,9.66067 -8.28322,-0.88561 -11.37581,-9.99332 -11.37581,-9.99332 0,0 -4.1385,8.6825 -13.70028,8.30726 -9.95629,-0.39072 -15.06132,-13.07989 -15.06132,-13.07989 0,0 -6.99622,13.00978 -15.85158,12.9994 -8.84609,-0.0104 -12.29 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ id="path3131"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 579.07067,455.07905 c 37.77897,0.0396 71.74723,4.7356 96.08778,12.28092 1.65298,0.55403 3.6719,-0.75189 4.18925,-2.28206 0.51735,-1.6225 -0.65615,-3.62755 -2.25866,-4.18158 -24.47935,-7.82234 -59.29304,-12.75581 -98.01837,-12.79537 -38.67485,0.0396 -73.62733,4.97303 -98.10668,12.79537 -1.60253,0.55403 -2.77602,2.55908 -2.25867,4.18158 0.46688,1.53017 2.53626,2.83609 4.13877,2.28206 24.37842,-7.54532 58.4981,-12.24134 96.22658,-12.28092 z" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path3215"
+ d="m 557.12714,417.22477 c 0,0 13.87381,-0.11904 15.61544,-2.10181 2.03595,-2.31782 1.76279,-5.60906 -0.43588,-7.4785 -1.69875,-1.5274 -5.71139,-3.21918 -8.32446,-2.74313 -2.61307,0.47604 -5.93603,1.14373 -6.17263,3.9656 -0.20011,2.38672 7.91565,4.09428 7.91565,4.09428 0,0 -10.34865,-1.90895 -11.9423,0.0995 -1.77145,2.2326 -2.8941,5.54021 -0.56315,8.47037 1.72326,2.16625 12.88801,-0.69504 12.88801,-0.69504 0,0 -9.66536,1.79685 -8.31277,6.27252 0.75018,2.48234 5.79014,3.52663 9.406 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path3217"
+ d="m 603.18689,417.59437 c 0,0 -13.86797,0.4255 -15.68377,-1.48744 -2.12264,-2.23618 -1.97495,-5.53568 0.15092,-7.49 1.63935,-1.59294 5.5846,-3.4409 8.21383,-3.06777 2.62924,0.37315 5.97513,0.90994 6.31895,3.72041 0.29081,2.37708 -7.75389,4.40184 -7.75389,4.40184 0,0 10.26826,-2.31363 11.93715,-0.36919 1.85511,2.16143 3.10281,5.42251 0.88513,8.44196 -1.63953,2.23226 -12.90483,-0.18874 -12.90483,-0.18874 0,0 9.72652,1.41618 8.54529,5.9416 -0.65514,2.50992 -5.65159,3.75121 -9.28776, [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path3219"
+ d="m 580.1133,390.31652 c 0,0 0.41904,14.08177 -1.46486,15.92556 -2.20224,2.15537 -5.45165,2.00541 -7.37629,-0.15323 -1.56876,-1.66463 -3.38867,-5.6707 -3.02119,-8.34048 0.36747,-2.66976 0.89611,-6.06723 3.66392,-6.41636 2.34099,-0.29528 4.33502,7.87344 4.33502,7.87344 0,0 -2.27852,-10.42656 -0.36359,-12.12119 2.1286,-1.88369 5.34018,-3.15063 8.31379,-0.89876 2.19837,1.66479 -0.18588,13.10377 -0.18588,13.10377 0,0 1.39469,-9.87648 5.85139,-8.67703 2.47182,0.66524 3.69427,5.73872 3 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="matrix(-0.996426,0.01955892,0.01926197,1.011787,913.53342,-268.22617)"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ sodipodi:ry="10.704739"
+ sodipodi:rx="5.9470773"
+ sodipodi:cy="670.55981"
+ sodipodi:cx="347.70578"
+ id="path3221"
+ style="color:#000000;fill:#ce1126;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.99575341;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path3225"
+ d="m 498.80923,426.22713 c 0,0 13.57084,-2.93043 14.88737,-5.22647 1.539,-2.68403 0.62396,-5.85354 -1.89812,-7.23939 -1.96497,-1.15211 -6.22953,-1.99597 -8.6963,-0.99955 -2.46679,0.99641 -5.59145,2.32459 -5.26822,5.13758 0.27339,2.37921 8.56149,2.40638 8.56149,2.40638 0,0 -10.51562,0.22833 -11.68208,2.51957 -1.2966,2.54688 -1.74602,6.01554 1.11432,8.41391 2.11465,1.77312 12.49161,-3.29487 12.49161,-3.29487 0,0 -9.11717,3.72089 -6.91146,7.83206 1.22334,2.28017 6.36716,2.28125 9.793 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path3227"
+ d="m 544.01364,417.24774 c 0,0 -13.50484,3.22951 -15.66033,1.72338 -2.51973,-1.76063 -3.02403,-5.02361 -1.32542,-7.36969 1.29299,-1.89332 4.79525,-4.5042 7.4449,-4.67182 2.64966,-0.16762 6.03372,-0.32023 6.92343,2.36389 0.75252,2.2702 -6.73181,5.88572 -6.73181,5.88572 0,0 9.60626,-4.34954 11.62401,-2.78274 2.24287,1.74163 4.10689,4.68395 2.52783,8.09232 -1.16741,2.51981 -12.68193,2.43232 -12.68193,2.43232 0,0 9.8091,-0.58499 9.54182,4.0888 -0.14824,2.59221 -4.79984,4.82184 -8.4516 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path3229"
+ d="m 516.03931,395.19915 c 0,0 3.18049,13.71303 1.69723,15.90175 -1.73391,2.55856 -4.94734,3.07065 -7.25781,1.34584 -1.86457,-1.31291 -4.43582,-4.86917 -4.60088,-7.55966 -0.16508,-2.69052 -0.31537,-6.12674 2.32798,-7.03017 2.23574,-0.76412 5.79638,6.83559 5.79638,6.83559 0,0 -4.28351,-9.75436 -2.7405,-11.8032 1.71518,-2.27746 4.61284,-4.17021 7.96947,-2.5668 2.48155,1.18541 2.39539,12.87744 2.39539,12.87744 0,0 -0.57612,-9.96033 4.02672,-9.68892 2.55286,0.15051 4.74863,4.87383 5.0 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="matrix(-0.972501,0.221252,0.217893,0.987493,713.20543,-317.69566)"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ sodipodi:ry="10.704739"
+ sodipodi:rx="5.9470773"
+ sodipodi:cy="670.55981"
+ sodipodi:cx="347.70578"
+ id="path3231"
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.99575359;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path29316"
+ d="m 661.94524,425.85267 c 0,0 -13.63472,-2.60674 -15.00387,-4.87083 -1.60051,-2.64668 -0.75885,-5.83709 1.73055,-7.28256 1.93785,-1.19855 6.18176,-2.14364 8.67085,-1.20618 2.4891,0.93745 5.64355,2.19092 5.38531,5.01082 -0.21841,2.38505 -8.50361,2.6094 -8.50361,2.6094 0,0 10.518,-0.0219 11.73701,2.24097 1.35501,2.51532 1.88435,5.97234 -0.91987,8.43809 -2.07315,1.82294 -12.5642,-2.99676 -12.5642,-2.99676 0,0 9.20052,3.50295 7.09028,7.66546 -1.17039,2.30865 -6.31276,2.4321 -9.76865, [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path29318"
+ d="m 616.54608,417.95129 c 0,0 13.57565,2.90733 15.69579,1.35034 2.47842,-1.82009 2.90729,-5.09417 1.155,-7.3992 -1.33632,-1.86203 -4.89786,-4.38887 -7.55065,-4.4934 -2.6528,-0.10454 -6.03945,-0.17658 -6.86698,2.52794 -0.69993,2.28749 6.86577,5.72397 6.86577,5.72397 0,0 -9.70399,-4.11982 -11.68502,-2.50543 -2.20207,1.79449 -3.99769,4.78036 -2.34041,8.15024 1.22523,2.49133 12.73457,2.12991 12.73457,2.12991 0,0 -9.81991,-0.35145 -9.44485,4.31469 0.20801,2.58798 4.90978,4.70632 8.567 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path3239"
+ d="m 644.00346,395.24314 c 0,0 -2.86319,13.78492 -1.32984,15.93775 1.79247,2.51662 5.01683,2.95209 7.28687,1.1728 1.83377,-1.35692 4.32224,-4.97337 4.42518,-7.66704 0.10296,-2.69371 0.17392,-6.13256 -2.48956,-6.97284 -2.25276,-0.71072 -5.63706,6.97161 -5.63706,6.97161 0,0 4.05726,-9.85359 2.46739,-11.86517 -1.76726,-2.23601 -4.70779,-4.0593 -8.02651,-2.37648 -2.45351,1.24412 -2.09758,12.93088 -2.09758,12.93088 0,0 0.34613,-9.97128 -4.24918,-9.59044 -2.54869,0.21121 -4.63487,4.9854 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="matrix(0.977339,0.198054,-0.195047,0.992405,430.44243,-312.76436)"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ sodipodi:ry="10.704739"
+ sodipodi:rx="5.9470773"
+ sodipodi:cy="670.55981"
+ sodipodi:cx="347.70578"
+ id="path3241"
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.99575424;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.600844,0,0,0.610107,842.01553,249.50863)"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ sodipodi:ry="7.5"
+ sodipodi:rx="7.5"
+ sodipodi:cy="295.36218"
+ sodipodi:cx="483"
+ id="path3261"
+ style="color:#000000;fill:url(#radialGradient6711);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.90247178;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.600844,0,0,0.610107,899.29184,250.07673)"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ sodipodi:ry="7.5"
+ sodipodi:rx="7.5"
+ sodipodi:cy="295.36218"
+ sodipodi:cx="483"
+ id="path3263"
+ style="color:#000000;fill:url(#radialGradient6713);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.90247178;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ id="path3267"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
+ d="m 579.84719,476.34734 c 36.41895,0.0396 69.16438,4.73561 92.62869,12.28092 1.59349,0.55403 3.53972,-0.7519 4.03844,-2.28207 0.49873,-1.6225 -0.63252,-3.62754 -2.17735,-4.18156 -23.59812,-7.82233 -57.15853,-12.75581 -94.48978,-12.79538 -37.2826,0.0396 -70.97682,4.97305 -94.57494,12.79538 -1.54482,0.55402 -2.67607,2.55906 -2.17735,4.18156 0.45007,1.53017 2.44496,2.8361 3.98979,2.28207 23.50081,-7.54531 56.3922,-12.24134 92.7625,-12.28092 z" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3269"
+ style="font-size:12px;fill:#ce1126;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.83999932;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 579.9251,465.49321 -6.91252,-2.94394 6.34957,-3.83564 7.38751,3.38794 -6.82456,3.39164 z" />
+ <rect
+ transform="matrix(-0.992514,-0.122131,-0.129098,0.9916318,0,0)"
+ rx="2.3674018"
+ ry="2.3673773"
+ y="382.39935"
+ x="-696.46033"
+ height="5.1953254"
+ width="17.79689"
+ id="rect3271"
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.70478129;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <rect
+ transform="matrix(-0.991842,-0.127473,-0.123691,0.9923208,0,0)"
+ rx="4.1667795"
+ ry="3.4791369"
+ y="376.39105"
+ x="-697.84924"
+ height="10.003489"
+ width="24.660467"
+ id="rect3273"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.76791471;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <rect
+ transform="matrix(0.991842,-0.127473,0.123691,0.9923208,0,0)"
+ rx="2.3675313"
+ ry="2.3675332"
+ y="526.53253"
+ x="458.4097"
+ height="5.39885"
+ width="17.731491"
+ id="rect3275"
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.71713197;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <rect
+ transform="matrix(0.991842,-0.127473,0.123691,0.9923208,0,0)"
+ rx="4.0283756"
+ ry="3.4791369"
+ y="524.16467"
+ x="454.75424"
+ height="10.003489"
+ width="24.660467"
+ id="rect3277"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.76791471;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3279"
+ style="font-size:12px;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 579.91019,469.2281 -14.07823,-6.61806 13.11723,-7.3411 14.82738,6.53312 -13.86638,7.42604 z" />
+ <path
+ transform="matrix(0,1.011976,0.996612,0,148.5511,165.39863)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path3289"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.7646504;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0,1.011976,0.996612,0,148.5511,171.06563)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path3291"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.7646504;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0,1.011976,0.996612,0,200.31883,165.67443)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path3299"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.7646504;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0,1.011976,0.996612,0,200.31883,171.34123)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path3301"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.7646504;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.159793,0.998883,-0.983718,-0.162256,1102.1506,242.11933)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path3319"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.76465076;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.159793,0.998883,-0.983718,-0.162256,1101.2556,247.71283)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path29353"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.76465076;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ d="m 696.9413,367.167 c -29.97313,-9.8053 -67.03872,-15.38887 -113.46373,-15.50973 -46.36299,0.12086 -93.47249,5.59305 -123.3836,15.39833 l 4.26225,22.51781 c 27.0735,-9.25289 71.10408,-16.22904 114.00923,-16.28083 42.84313,0.0518 94.29065,7.26067 115.76649,16.01293 0.2398,1.91877 2.80936,-22.13851 2.80936,-22.13851 z"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.48723102;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path30333"
+ sodipodi:nodetypes="ccccccc" />
+ <path
+ d="m 475.07838,354.42148 7.96645,-13.45851 c 0,0 7.52236,8.5213 16.99597,7.08223 9.41978,-1.4255 12.00206,-17.28242 12.00206,-17.28242 0,0 12.46671,14.70296 21.13291,14.03773 8.6662,-0.77384 12.91429,-7.32205 12.91429,-7.32205 0,0 7.05773,6.78807 15.37405,6.12284 8.31632,-0.76026 19.54926,-17.43631 19.54926,-17.43631 0,0 7.3715,17.05616 15.68782,17.81644 8.31632,0.67879 18.44579,-12.07373 18.44579,-12.07373 0,0 3.75446,10.83377 14.33152,12.59866 10.56361,1.81921 17.23109,-12.59868 [...]
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.9829272;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path30337"
+ sodipodi:nodetypes="cccccccccccccccccccc" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 712.77531,339.96221 c -5.44653,10.91579 -13.29486,21.25479 -25.5219,18.72041 -12.22705,-2.53438 -12.70364,-13.00651 -12.70364,-13.00651 0,0 -7.53398,9.92623 -15.99477,7.88068 -8.55542,-2.06844 -11.22179,-16.71641 -11.22179,-16.71641 0,0 -9.27311,12.61539 -19.23656,11.55014 -9.9033,-1.05881 -13.60076,-11.94785 -13.60076,-11.94785 0,0 -4.94793,10.38067 -16.37986,9.93202 -11.9036,-0.46713 -18.00709,-15.6381 -18.00709,-15.6381 0,0 -8.36459,15.5543 -18.95192,15.54188 -10.57626,-0. [...]
+ id="path30339"
+ sodipodi:nodetypes="czczczczczczczczczczczczczczczczc" />
+ <path
+ d="m 578.79131,354.16353 c 45.16799,0.0473 85.77995,5.66183 114.88117,14.68289 1.97628,0.66239 4.39007,-0.89896 5.00861,-2.72841 0.61853,-1.93984 -0.78449,-4.33704 -2.70043,-4.99942 -29.26716,-9.35226 -70.8899,-15.25065 -117.18935,-15.29795 -46.2391,0.0473 -88.02779,5.94569 -117.29495,15.29795 -1.91595,0.66238 -3.31896,3.05958 -2.70042,4.99942 0.55818,1.82945 3.03231,3.3908 4.94825,2.72841 29.14649,-9.02106 69.93949,-14.63556 115.04712,-14.68289 z"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path30341" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 552.55619,308.90558 c 0,0 16.58731,-0.14233 18.66959,-2.5129 2.43414,-2.77116 2.10755,-6.7061 -0.52113,-8.94117 -2.03101,-1.82616 -6.82847,-3.84881 -9.95261,-3.27965 -3.12415,0.56914 -7.09703,1.36744 -7.3799,4.74122 -0.23925,2.85352 9.46383,4.89504 9.46383,4.89504 0,0 -12.3727,-2.28231 -14.27803,0.11901 -2.11792,2.66926 -3.46015,6.6238 -0.6733,10.12705 2.06031,2.58994 15.40871,-0.83096 15.40871,-0.83096 0,0 -11.55576,2.14827 -9.93861,7.4993 0.8969,2.96785 6.9226,4.2164 11.246 [...]
+ id="path30349"
+ sodipodi:nodetypes="cscsscsscszzsc" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 607.62463,309.34745 c 0,0 -16.58034,0.50871 -18.75129,-1.77837 -2.53779,-2.67356 -2.36122,-6.61838 0.18044,-8.95493 1.95998,-1.90449 6.67687,-4.1139 9.82034,-3.66777 3.14348,0.4461 7.14377,1.0879 7.55484,4.44804 0.34768,2.84201 -9.27044,5.26279 -9.27044,5.26279 0,0 12.27658,-2.76615 14.27188,-0.4414 2.21794,2.58416 3.70967,6.48307 1.05825,10.09307 -1.9602,2.66886 -15.42883,-0.22566 -15.42883,-0.22566 0,0 11.62889,1.69318 10.21662,7.10368 -0.78327,3.00083 -6.75695,4.48491 -11. [...]
+ id="path30351"
+ sodipodi:nodetypes="cscsscsscszzsc" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 580.03865,276.73449 c 0,0 0.50099,16.83594 -1.75137,19.04035 -2.63296,2.57691 -6.51791,2.39761 -8.81898,-0.18322 -1.87558,-1.99019 -4.05144,-6.77979 -3.61209,-9.97172 0.43934,-3.19194 1.07138,-7.2539 4.38052,-7.67131 2.79886,-0.35305 5.18289,9.41334 5.18289,9.41334 0,0 -2.72416,-12.46582 -0.43469,-14.4919 2.54491,-2.25211 6.38463,-3.76684 9.93983,-1.07454 2.62834,1.99041 -0.22223,15.66667 -0.22223,15.66667 0,0 1.66747,-11.80816 6.99584,-10.37412 2.95526,0.79534 4.41681,6.8611 [...]
+ id="path30353"
+ sodipodi:nodetypes="cscsscsscszzsc" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:#ce1126;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.83285886;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30355"
+ sodipodi:cx="347.70578"
+ sodipodi:cy="670.55981"
+ sodipodi:rx="5.9470773"
+ sodipodi:ry="10.704739"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ transform="matrix(-1.191312,0.02338434,0.02302933,1.209677,978.67019,-510.60896)" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 482.83204,319.66904 c 0,0 16.22509,-3.50357 17.79911,-6.24869 1.84001,-3.20898 0.746,-6.99842 -2.26936,-8.65532 -2.34929,-1.37744 -7.44794,-2.38635 -10.39718,-1.19505 -2.94925,1.19129 -6.68505,2.77925 -6.29859,6.14241 0.32685,2.84456 10.23599,2.87704 10.23599,2.87704 0,0 -12.57232,0.27301 -13.96692,3.01237 -1.5502,3.04502 -2.08752,7.19209 1.33226,10.05955 2.52825,2.11991 14.93479,-3.9393 14.93479,-3.9393 0,0 -10.90035,4.44864 -8.26324,9.36389 1.46261,2.72614 7.61248,2.72742 1 [...]
+ id="path30359"
+ sodipodi:nodetypes="cscsscsscszzsc" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 536.87764,308.93341 c 0,0 -16.14618,3.86117 -18.72326,2.06047 -3.01255,-2.105 -3.61549,-6.00614 -1.58465,-8.8111 1.54588,-2.26362 5.73313,-5.38515 8.90102,-5.58555 3.16789,-0.20041 7.21382,-0.38286 8.27755,2.82621 0.8997,2.71422 -8.04845,7.0369 -8.04845,7.0369 0,0 11.4851,-5.20025 13.89749,-3.32702 2.68155,2.08226 4.91014,5.60007 3.02224,9.67507 -1.39574,3.01265 -15.16234,2.90805 -15.16234,2.90805 0,0 11.72763,-0.69943 11.40807,4.88849 -0.17723,3.09922 -5.73862,5.76492 -10.10 [...]
+ id="path30361"
+ sodipodi:nodetypes="cscsscsscszzsc" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 503.43297,282.57246 c 0,0 3.80255,16.39508 2.02918,19.01189 -2.07303,3.05899 -5.91496,3.67122 -8.67732,1.60908 -2.22927,-1.56971 -5.30341,-5.82151 -5.50076,-9.03823 -0.19737,-3.21673 -0.37706,-7.32502 2.78331,-8.40515 2.67301,-0.91357 6.93006,8.17251 6.93006,8.17251 0,0 -5.12131,-11.66215 -3.2765,-14.11172 2.05064,-2.72289 5.51504,-4.98584 9.52818,-3.06883 2.9669,1.41724 2.8639,15.39606 2.8639,15.39606 0,0 -0.6888,-11.90841 4.81428,-11.58392 3.05216,0.17996 5.6774,5.82707 6.0 [...]
+ id="path30363"
+ sodipodi:nodetypes="cscsscsscszzsc" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.83285862;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30365"
+ sodipodi:cx="347.70578"
+ sodipodi:cy="670.55981"
+ sodipodi:rx="5.9470773"
+ sodipodi:ry="10.704739"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ transform="matrix(-1.162708,0.264526,0.26051,1.180632,739.16073,-569.75397)" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 677.87492,319.22106 c 0,0 -16.30147,-3.11658 -17.93841,-5.82349 -1.91355,-3.16433 -0.90727,-6.97875 2.06902,-8.70693 2.31686,-1.43295 7.39082,-2.56289 10.36674,-1.44209 2.97593,1.12079 6.74734,2.61943 6.4386,5.99087 -0.26113,2.85154 -10.16679,3.11978 -10.16679,3.11978 0,0 12.57516,-0.0262 14.03259,2.67924 1.62004,3.0073 2.2529,7.14044 -1.09977,10.08848 -2.47863,2.17947 -15.02157,-3.58289 -15.02157,-3.58289 0,0 11,4.18806 8.47703,9.16469 -1.3993,2.7602 -7.54745,2.9078 -11.6792 [...]
+ id="path30369"
+ sodipodi:nodetypes="cscsscsscszzsc" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 623.59638,309.77432 c 0,0 16.23084,3.47594 18.76565,1.61442 2.96315,-2.17608 3.4759,-6.0905 1.3809,-8.84636 -1.59769,-2.22622 -5.85582,-5.24727 -9.02745,-5.37225 -3.17165,-0.12498 -7.22067,-0.21112 -8.21006,3.02238 -0.83682,2.73487 8.20862,6.84348 8.20862,6.84348 0,0 -11.60195,-4.92559 -13.97045,-2.99545 -2.63276,2.14548 -4.77957,5.71534 -2.79815,9.7443 1.46487,2.97861 15.22527,2.54651 15.22527,2.54651 0,0 -11.74054,-0.4202 -11.29213,5.15857 0.2487,3.09415 5.87007,5.6268 10.2 [...]
+ id="path30371"
+ sodipodi:nodetypes="cscsscsscszzsc" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 656.42397,282.62483 c 0,0 -3.42318,16.48104 -1.58992,19.05493 2.14305,3.00883 5.99805,3.5295 8.71207,1.4022 2.19243,-1.62232 5.16761,-5.9461 5.29068,-9.16663 0.12309,-3.22053 0.20793,-7.33197 -2.97649,-8.33661 -2.69336,-0.84972 -6.73957,8.33515 -6.73957,8.33515 0,0 4.85079,-11.7808 2.94997,-14.18581 -2.11291,-2.67334 -5.62857,-4.85325 -9.59638,-2.84128 -2.93338,1.48744 -2.50784,15.45997 -2.50784,15.45997 0,0 0.41383,-11.92153 -5.08025,-11.4662 -3.04718,0.25252 -5.54138,5.9605 [...]
+ id="path30373"
+ sodipodi:nodetypes="cscsscsscszzsc" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.83285928;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30375"
+ sodipodi:cx="347.70578"
+ sodipodi:cy="670.55981"
+ sodipodi:rx="5.9470773"
+ sodipodi:ry="10.704739"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ transform="matrix(1.168492,0.23679,-0.233195,1.186505,401.09333,-563.85837)" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 469.20896,325.3214 c 0,0 -13.92977,9.1456 -16.95288,8.32885 -3.53396,-0.95475 -5.39277,-4.42337 -4.40818,-7.75815 0.70695,-2.65945 3.61781,-7.02815 6.53521,-8.29773 2.91739,-1.26961 6.66771,-2.82189 8.73151,-0.16233 1.74555,2.24946 -5.25195,9.37383 -5.25195,9.37383 0,0 9.09656,-8.81651 11.98856,-7.87527 3.21468,1.04629 6.47778,3.5992 6.04809,8.08141 -0.31768,3.31369 -13.31851,7.91221 -13.31851,7.91221 0,0 10.81435,-4.6601 12.36245,0.71196 0.85864,2.97949 -3.49731,7.38771 -7.4 [...]
+ id="path30379"
+ sodipodi:nodetypes="cscsscsscszzsc" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 425.69817,309.21689 c -0.35279,-5.10501 1.31315,-8.11408 5.28637,-5.46294 3.37829,2.25421 7.45803,14.88061 7.45803,14.88061 0,0 -4.58935,-10.98105 0.70116,-12.55303 2.93426,-0.87187 7.27555,3.55124 9.06921,7.60854 1.79366,4.0573 1.85127,8.71662 -1.1069,11.75154 -3.00002,3.07783 -7.92609,2.08064 -10.67152,0.1725 -8.72651,-6.06507 -10.46226,-12.43104 -10.73635,-16.39722 z"
+ id="path30381"
+ sodipodi:nodetypes="cscszzss" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ce1126;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.83285725;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path30383"
+ sodipodi:cx="347.70578"
+ sodipodi:cy="670.55981"
+ sodipodi:rx="5.9470773"
+ sodipodi:ry="10.704739"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ transform="matrix(-1.007575,0.64585,0.636045,1.023107,368.96653,-571.29607)" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 691.79622,325.092 c 0,0 13.92977,9.1456 16.95288,8.32885 3.53396,-0.95475 5.39277,-4.42337 4.40818,-7.75815 -0.70695,-2.65945 -3.61781,-7.02814 -6.53521,-8.29773 -2.91739,-1.26961 -6.66771,-2.82189 -8.73151,-0.16233 -1.74555,2.24946 5.25195,9.37383 5.25195,9.37383 0,0 -9.09656,-8.81651 -11.98856,-7.87527 -3.21468,1.04629 -6.47778,3.5992 -6.04809,8.08141 0.31768,3.31369 13.31851,7.91221 13.31851,7.91221 0,0 -10.81435,-4.6601 -12.36245,0.71196 -0.85864,2.97949 3.49731,7.38771 7 [...]
+ id="path30387"
+ sodipodi:nodetypes="cscsscsscszzsc" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 735.30731,308.9879 c 0.35279,-5.10501 -1.31315,-8.11408 -5.28637,-5.46294 -3.37829,2.2542 -7.45803,14.8806 -7.45803,14.8806 0,0 4.58935,-10.98106 -0.70116,-12.55302 -2.93426,-0.87187 -7.27555,3.55122 -9.06921,7.60852 -1.79366,4.0573 -1.85127,8.71663 1.1069,11.75155 3.00002,3.07783 7.92609,2.08065 10.67152,0.17251 8.72651,-6.06509 10.46226,-12.43104 10.73635,-16.39722 z"
+ id="path30389"
+ sodipodi:nodetypes="cscszzss" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:#ce1126;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.83285725;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30391"
+ sodipodi:cx="347.70578"
+ sodipodi:cy="670.55981"
+ sodipodi:rx="5.9470773"
+ sodipodi:ry="10.704739"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ transform="matrix(1.007575,0.64585,-0.636045,1.023107,792.03903,-571.52557)" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:url(#radialGradient6715);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.82086921;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30393"
+ sodipodi:cx="483"
+ sodipodi:cy="295.36218"
+ sodipodi:rx="7.5"
+ sodipodi:ry="7.5"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ transform="matrix(-0.627772,0,0,0.637449,784.67963,147.55033)" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:url(#radialGradient6717);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.59124863;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30395"
+ sodipodi:cx="483"
+ sodipodi:cy="295.36218"
+ sodipodi:rx="7.5"
+ sodipodi:ry="7.5"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ transform="matrix(-0.718361,0,0,0.729435,893.16419,108.38673)" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:url(#radialGradient6719);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.59124863;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30397"
+ sodipodi:cx="483"
+ sodipodi:cy="295.36218"
+ sodipodi:rx="7.5"
+ sodipodi:ry="7.5"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ transform="matrix(-0.718361,0,0,0.729435,961.64314,109.06614)" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:url(#radialGradient6721);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.77570975;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30399"
+ sodipodi:cx="483"
+ sodipodi:cy="295.36218"
+ sodipodi:rx="7.5"
+ sodipodi:ry="7.5"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ transform="matrix(-0.643739,0,0,0.653662,990.73673,142.25343)" />
+ <path
+ d="m 579.7197,379.59159 c 43.54197,0.0473 82.69194,5.66182 110.74554,14.68287 1.90514,0.6624 4.23203,-0.89896 4.8283,-2.72839 0.59627,-1.93984 -0.75624,-4.33704 -2.60322,-4.99943 -28.21357,-9.35226 -68.33792,-15.25066 -112.97062,-15.29796 -44.57454,0.0473 -84.85887,5.9457 -113.07244,15.29796 -1.84696,0.66239 -3.19947,3.05959 -2.60321,4.99943 0.5381,1.82943 2.92316,3.39079 4.77014,2.72839 28.09723,-9.02105 67.42171,-14.63556 110.90551,-14.68287 z"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path30401" />
+ <path
+ d="m 579.81285,366.61456 -8.26451,-3.51972 7.59146,-4.58585 8.8324,4.05057 -8.15935,4.055 z"
+ style="font-size:12px;fill:#ce1126;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.83999997;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path30403"
+ sodipodi:nodetypes="ccccc" />
+ <rect
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.70478135;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="rect30405"
+ width="21.2777"
+ height="6.2114458"
+ x="-695.56909"
+ y="282.55237"
+ ry="2.8303971"
+ rx="2.8304305"
+ transform="matrix(-0.992514,-0.122131,-0.129097,0.991632,0,0)" />
+ <rect
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.76791507;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="rect30407"
+ width="29.483702"
+ height="11.960027"
+ x="-698.18048"
+ y="276.10733"
+ ry="4.1596055"
+ rx="4.9817362"
+ transform="matrix(-0.9918422,-0.127472,-0.123691,0.9923208,0,0)" />
+ <rect
+ style="color:#000000;fill:#058e6e;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.71713233;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="rect30409"
+ width="21.199492"
+ height="6.4547873"
+ x="458.89334"
+ y="426.66656"
+ ry="2.8305888"
+ rx="2.8305833"
+ transform="matrix(0.9918422,-0.127472,0.123691,0.9923208,0,0)" />
+ <rect
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.76791507;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="rect30411"
+ width="29.483702"
+ height="11.960027"
+ x="454.52304"
+ y="423.83554"
+ ry="4.1596055"
+ rx="4.8162622"
+ transform="matrix(0.9918422,-0.127472,0.123691,0.9923208,0,0)" />
+ <path
+ d="m 579.79502,371.07993 -16.83173,-7.91246 15.68278,-8.7769 17.72739,7.8109 -16.57844,8.87846 z"
+ style="font-size:12px;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path30413"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.63956207;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30419"
+ sodipodi:cx="291.28146"
+ sodipodi:cy="407.84235"
+ sodipodi:rx="1.9624354"
+ sodipodi:ry="1.9624354"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ transform="matrix(0,1.209903,1.191535,0,64.0684,7.826202)" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.63956207;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30421"
+ sodipodi:cx="291.28146"
+ sodipodi:cy="407.84235"
+ sodipodi:rx="1.9624354"
+ sodipodi:ry="1.9624354"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ transform="matrix(0,1.209903,1.191535,0,64.0684,14.601481)" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.63956207;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30425"
+ sodipodi:cx="291.28146"
+ sodipodi:cy="407.84235"
+ sodipodi:rx="1.9624354"
+ sodipodi:ry="1.9624354"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ transform="matrix(0,1.209903,1.191535,0,125.961,8.155782)" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.63956207;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30427"
+ sodipodi:cx="291.28146"
+ sodipodi:cy="407.84235"
+ sodipodi:rx="1.9624354"
+ sodipodi:ry="1.9624354"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ transform="matrix(0,1.209903,1.191535,0,125.961,14.931061)" />
+ <path
+ transform="matrix(0.159793,0.998883,0.983718,-0.162256,56.6408,242.10193)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path3309"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.76465076;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(0.159793,0.998883,0.983718,-0.162256,57.5357,247.69543)"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ sodipodi:ry="1.9624354"
+ sodipodi:rx="1.9624354"
+ sodipodi:cy="407.84235"
+ sodipodi:cx="291.28146"
+ id="path3311"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.76465076;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3133"
+ style="font-size:12px;fill:#ce1126;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.90459961;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 676.39339,478.44755 4.2592,-3.79158 -2.88536,-3.89592 -7.88609,1.68041 6.51225,6.00709 z" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path3253"
+ d="m 673.5894,430.76336 c 0,0 11.651,7.64945 14.17956,6.96632 2.95584,-0.79855 4.51057,-3.69975 3.68705,-6.48899 -0.5913,-2.2244 -3.02598,-5.87842 -5.46612,-6.94032 -2.44014,-1.06193 -5.57694,-2.36027 -7.30313,-0.13578 -1.45999,1.88148 4.39279,7.84037 4.39279,7.84037 0,0 -7.60845,-7.37423 -10.02735,-6.58695 -2.68879,0.87513 -5.41808,3.0104 -5.05868,6.75939 0.26571,2.77159 11.13973,6.61784 11.13973,6.61784 0,0 -9.04522,-3.89776 -10.34007,0.5955 -0.71817,2.49208 2.92519,6.17915 6.26 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscszzss"
+ id="path3255"
+ d="m 709.98245,417.29285 c 0.29508,-4.26988 -1.09834,-6.7867 -4.42157,-4.56925 -2.82564,1.88544 -6.23797,12.4463 -6.23797,12.4463 0,0 3.83858,-9.18468 -0.58646,-10.4995 -2.45425,-0.72924 -6.08534,2.9703 -7.58558,6.36387 -1.50023,3.39356 -1.54841,7.29067 0.92584,9.82912 2.50924,2.57432 6.62945,1.74028 8.92576,0.14429 7.29894,-5.0729 8.75074,-10.39746 8.97998,-13.71483 z"
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ transform="matrix(0.842746,0.540196,-0.531994,0.855738,757.43313,-319.17736)"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ sodipodi:ry="10.704739"
+ sodipodi:rx="5.9470773"
+ sodipodi:cy="670.55981"
+ sodipodi:cx="347.70578"
+ id="path3257"
+ style="color:#000000;fill:#ce1126;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.9957518;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.53843,0,0,0.54673,923.62601,277.83493)"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ sodipodi:ry="7.5"
+ sodipodi:rx="7.5"
+ sodipodi:cy="295.36218"
+ sodipodi:cx="483"
+ id="path3265"
+ style="color:#000000;fill:url(#radialGradient6769);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.12301064;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path3281"
+ style="font-size:12px;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 675.64738,482.70048 -12.40185,-11.72476 14.3985,-3.80129" />
+ <path
+ d="m 695.14895,382.10256 5.09224,-4.53316 -3.4497,-4.65788 -9.42849,2.00906 7.78595,7.18198 z"
+ style="font-size:12px;fill:#ce1126;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.90460026;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path30343"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ d="M 694.25704,387.18731 679.42956,373.16934 696.6442,368.6246"
+ style="font-size:12px;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path30415"
+ sodipodi:nodetypes="ccc" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.63956243;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30437"
+ sodipodi:cx="291.28146"
+ sodipodi:cy="407.84235"
+ sodipodi:rx="1.9624354"
+ sodipodi:ry="1.9624354"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ transform="matrix(-0.191046,1.194249,-1.176119,-0.193991,1204.178,99.552197)" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.63956243;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30439"
+ sodipodi:cx="291.28146"
+ sodipodi:cy="407.84235"
+ sodipodi:rx="1.9624354"
+ sodipodi:ry="1.9624354"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ transform="matrix(-0.191046,1.194249,-1.176119,-0.193991,1203.1082,106.23984)" />
+ <path
+ sodipodi:nodetypes="cscsscsscszzsc"
+ id="path3245"
+ d="m 487.41518,430.95525 c 0,0 -11.651,7.64947 -14.17956,6.96634 -2.95584,-0.79856 -4.51057,-3.69977 -3.68705,-6.48901 0.5913,-2.2244 3.02598,-5.87842 5.46612,-6.94032 2.44014,-1.06191 5.57694,-2.36025 7.30313,-0.13576 1.45999,1.88146 -4.39279,7.84037 -4.39279,7.84037 0,0 7.60845,-7.37423 10.02735,-6.58695 2.68879,0.87512 5.41808,3.0104 5.05868,6.75937 -0.26571,2.77161 -11.13973,6.61784 -11.13973,6.61784 0,0 9.04522,-3.89774 10.34007,0.59551 0.71817,2.49209 -2.92519,6.17916 -6.267 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cscszzss"
+ id="path3247"
+ d="m 451.02183,417.48486 c -0.29508,-4.26989 1.09834,-6.78672 4.42157,-4.56926 2.82564,1.88543 6.23797,12.4463 6.23797,12.4463 0,0 -3.83858,-9.18468 0.58646,-10.4995 2.45425,-0.72924 6.08534,2.9703 7.58558,6.36386 1.50023,3.39357 1.54841,7.29068 -0.92584,9.82913 -2.50924,2.57432 -6.62945,1.74028 -8.92576,0.14428 -7.29894,-5.07289 -8.75074,-10.39745 -8.97998,-13.71481 z"
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ d="M 464.43407,387.83649 478.207,373.61983 461.40749,368.765"
+ style="font-size:12px;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30335"
+ sodipodi:nodetypes="ccc" />
+ <path
+ d="m 463.75745,382.12287 -5.79229,-3.49624 3.73273,-5.35433 9.15227,1.90919 -7.09271,6.94138 z"
+ style="font-size:12px;fill:#ce1126;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.78904796;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="path30345"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.63956243;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30431"
+ sodipodi:cx="291.28146"
+ sodipodi:cy="407.84235"
+ sodipodi:rx="1.9624354"
+ sodipodi:ry="1.9624354"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ transform="matrix(0.191046,1.194249,1.176119,-0.193991,-45.8188,99.531397)" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.63956243;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ id="path30433"
+ sodipodi:cx="291.28146"
+ sodipodi:cy="407.84235"
+ sodipodi:rx="1.9624354"
+ sodipodi:ry="1.9624354"
+ d="m 293.2439,407.84235 c 0,1.08382 -0.87861,1.96243 -1.96244,1.96243 -1.08382,0 -1.96243,-0.87861 -1.96243,-1.96243 0,-1.08383 0.87861,-1.96244 1.96243,-1.96244 1.08383,0 1.96244,0.87861 1.96244,1.96244 z"
+ transform="matrix(0.191046,1.194249,1.176119,-0.193991,-44.7488,106.21904)" />
+ <path
+ sodipodi:nodetypes="ccc"
+ id="path3107"
+ style="font-size:12px;color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ d="m 483.42111,483.24348 11.51982,-11.89097 -14.05128,-4.06065" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ id="path3135"
+ style="font-size:12px;fill:#ce1126;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.78904742;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 482.85519,478.46453 -4.84473,-2.92429 3.12208,-4.47843 7.65506,1.59688 -5.93241,5.80584 z" />
+ <path
+ transform="matrix(-0.842746,0.540196,0.531994,0.855738,403.57143,-318.98547)"
+ d="m 353.65286,670.55981 c 0,5.91207 -2.6626,10.70474 -5.94708,10.70474 -3.28448,0 -5.94708,-4.79267 -5.94708,-10.70474 0,-5.91206 2.6626,-10.70473 5.94708,-10.70473 3.28448,0 5.94708,4.79267 5.94708,10.70473 z"
+ sodipodi:ry="10.704739"
+ sodipodi:rx="5.9470773"
+ sodipodi:cy="670.55981"
+ sodipodi:cx="347.70578"
+ id="path3249"
+ style="fill:#ce1126;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.9957518;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(-0.525075,0,0,0.53317,751.27763,282.26533)"
+ d="m 490.5,295.36218 c 0,4.14214 -3.35786,7.5 -7.5,7.5 -4.14214,0 -7.5,-3.35786 -7.5,-7.5 0,-4.14213 3.35786,-7.5 7.5,-7.5 4.14214,0 7.5,3.35787 7.5,7.5 z"
+ sodipodi:ry="7.5"
+ sodipodi:rx="7.5"
+ sodipodi:cy="295.36218"
+ sodipodi:cx="483"
+ id="path3259"
+ style="color:#000000;fill:url(#radialGradient6771);fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.17700267;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="cccsccs"
+ id="rect3671"
+ d="m 580.00123,121.12727 c 5.22664,0 9.80741,0.51315 14.03125,2.09375 1.23839,3.98074 0.98918,9.22487 0,13.84375 -3.55531,-1.74034 -10.38477,-2.1875 -14.03125,-2.1875 -3.64648,0 -10.47594,0.44716 -14.03125,2.1875 -0.98918,-4.61888 -1.23839,-9.86301 0,-13.84375 4.22384,-1.5806 8.80461,-2.09375 14.03125,-2.09375 z"
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ <path
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 878.86356,315.85767 C 872.98686,316.20586 867.46164,321.06787 867.05106,327.82642 L 869.55106,325.29517 C 878.99859,327.69982 890.83569,339.71437 893.20731,349.29517 L 890.70731,351.82642 C 897.20236,351.80911 902.62814,346.30641 902.48856,339.85767 C 897.35706,327.47815 890.69581,321.44298 878.86356,315.85767 z "
+ id="path4404" />
+ <path
+ id="path16052"
+ d="M 878.86356,315.85767 C 872.98686,316.20586 867.46164,321.06787 867.05106,327.82642 L 869.55106,325.29517 C 878.99859,327.69982 890.83569,339.71437 893.20731,349.29517 L 890.70731,351.82642 C 897.20236,351.80911 902.62814,346.30641 902.48856,339.85767 C 897.35706,327.47815 890.69581,321.44298 878.86356,315.85767 z "
+ style="font-size:12px;opacity:0.6;fill:url(#linearGradient2782);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none" />
+ <g
+ id="g4646"
+ transform="matrix(-0.9752694,0.2210193,0.2210193,0.9752694,923.99706,-78.342178)">
+ <path
+ id="path7762"
+ d="M 168.36283,358.99684 C 168.78788,359.04044 169.17418,359.26323 169.42478,359.60931 C 169.67539,359.95538 169.76653,360.3919 169.67533,360.80934 C 168.40818,367.38047 166.22682,373.79877 160.05033,377.02809 C 159.57125,377.32597 158.96555,377.32989 158.48265,377.03824 C 157.99975,376.74658 157.7213,376.20867 157.76196,375.646 C 157.80262,375.08333 158.15552,374.59104 158.67533,374.37184 C 163.65757,371.76692 165.48959,366.52659 166.70658,360.21559 C 166.8496,359.43534 167.57535 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path7764"
+ d="M 170.73294,360.14331 C 171.18038,360.15217 171.6005,360.36034 171.87859,360.71098 C 172.15669,361.06162 172.26371,361.51811 172.17044,361.95581 C 170.89365,368.57684 168.41314,374.93164 163.92044,380.17456 C 163.588,380.62642 163.03124,380.85504 162.47718,380.76721 C 161.92313,380.67937 161.46438,380.28974 161.28801,379.75722 C 161.11163,379.2247 161.24711,378.63826 161.63919,378.23706 C 165.7075,373.4894 168.02556,367.6544 169.23294,361.39331 C 169.35625,360.66374 169.99309,3 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path7766"
+ d="M 173.12942,361.83571 C 173.57686,361.84457 173.99698,362.05274 174.27507,362.40338 C 174.55317,362.75402 174.66019,363.21051 174.56692,363.64821 C 173.30909,370.17076 171.43156,377.29704 166.97317,382.52321 C 166.64073,382.97507 166.08397,383.20369 165.52991,383.11586 C 164.97586,383.02802 164.51711,382.63839 164.34074,382.10587 C 164.16436,381.57335 164.29984,380.98691 164.69192,380.58571 C 168.53478,376.08107 170.40303,369.44523 171.62942,363.08571 C 171.75273,362.35614 172. [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path7768"
+ d="M 178.30716,365.36501 C 178.72551,365.40972 179.10585,365.62806 179.35543,365.96678 C 179.60501,366.30549 179.70088,366.73344 179.61966,367.14626 C 178.35519,373.70332 176.21282,380.87799 172.36966,386.30251 C 171.89504,386.98424 170.95764,387.15213 170.27591,386.67751 C 169.59418,386.20289 169.42629,385.26549 169.90091,384.58376 C 173.31991,379.75793 175.46243,372.90878 176.68216,366.58376 C 176.82457,365.81681 177.53101,365.28698 178.30716,365.36501 z "
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path7770"
+ d="M 175.75442,363.65115 C 176.20736,363.6507 176.63625,363.85493 176.92141,364.20683 C 177.20658,364.55873 177.31748,365.02064 177.22317,365.46365 C 176.58245,368.78624 175.55145,372.36323 173.81692,375.2449 C 172.08239,378.12657 169.44999,380.4275 165.91067,380.46365 C 165.37141,380.47443 164.86787,380.19488 164.59185,379.73148 C 164.31584,379.26808 164.30984,378.69218 164.57614,378.22313 C 164.84244,377.75409 165.34005,377.46411 165.87942,377.46365 C 168.17924,377.44016 169.823 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 180.71923,367.1425 C 181.17217,367.14205 181.60106,367.34628 181.88622,367.69818 C 182.17139,368.05008 182.28229,368.51199 182.18798,368.955 C 180.91643,375.54889 178.60034,381.67603 172.87548,386.92375 C 172.26279,387.48466 171.31139,387.44269 170.75048,386.83 C 170.18957,386.21731 170.23154,385.26591 170.84423,384.705 C 176.01833,379.96214 178.00663,374.68072 179.21923,368.3925 C 179.34254,367.66293 179.97938,367.13223 180.71923,367.1425 z "
+ id="path7772" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 183.14207,368.83977 C 183.56712,368.88337 183.95342,369.10616 184.20402,369.45224 C 184.45463,369.79831 184.54577,370.23483 184.45457,370.65227 C 183.183,377.24615 180.86693,383.3733 175.14207,388.62102 C 174.52938,389.18193 173.57798,389.13996 173.01707,388.52727 C 172.45616,387.91458 172.49813,386.96318 173.11082,386.40227 C 178.28492,381.65941 180.27319,376.37799 181.48582,370.08977 C 181.61424,369.2969 182.34438,368.74586 183.14207,368.83977 z "
+ id="path7774" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 185.76707,370.40227 C 186.19212,370.44587 186.57842,370.66866 186.82902,371.01474 C 187.07963,371.36081 187.17077,371.79733 187.07957,372.21477 C 185.7875,378.91516 182.79453,384.59592 177.14207,389.77727 C 176.52938,390.33818 175.57798,390.29621 175.01707,389.68352 C 174.45616,389.07083 174.49813,388.11943 175.11082,387.55852 C 180.35732,382.74929 182.95002,377.83399 184.14207,371.65227 C 184.27012,370.87273 184.98077,370.32608 185.76707,370.40227 z "
+ id="path7776" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 188.68309,372.35443 C 189.10814,372.39803 189.49444,372.62082 189.74504,372.9669 C 189.99565,373.31297 190.08679,373.74949 189.99559,374.16693 C 188.70079,380.88137 185.75837,385.46257 180.18309,390.57318 C 179.5704,391.13409 178.619,391.09212 178.05809,390.47943 C 177.49718,389.86674 177.53915,388.91534 178.15184,388.35443 C 183.47552,383.47446 185.86872,379.74087 187.05809,373.57318 C 187.2005,372.80623 187.90694,372.2764 188.68309,372.35443 z "
+ id="path7778" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 191.07957,373.40227 C 191.49792,373.44698 191.87826,373.66532 192.12784,374.00404 C 192.37742,374.34275 192.47329,374.7707 192.39207,375.18352 C 191.13083,381.72383 189.21902,387.95564 183.07957,391.30852 C 182.34607,391.70547 181.42965,391.43265 181.03269,390.69915 C 180.63574,389.96564 180.90857,389.04922 181.64207,388.65227 C 186.66136,385.91113 188.23161,380.96284 189.45457,374.62102 C 189.59698,373.85407 190.30342,373.32424 191.07957,373.40227 z "
+ id="path7780" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 193.73582,375.08977 C 194.15417,375.13448 194.53451,375.35282 194.78409,375.69154 C 195.03367,376.03025 195.12954,376.4582 195.04832,376.87102 C 193.81205,383.28203 192.75559,389.89984 186.92332,395.24602 C 186.31063,395.80693 185.35923,395.76496 184.79832,395.15227 C 184.23741,394.53958 184.27938,393.58818 184.89207,393.02727 C 189.95876,388.38287 190.86297,382.77958 192.11082,376.30852 C 192.25323,375.54157 192.95967,375.01174 193.73582,375.08977 z "
+ id="path7782" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 196.39207,376.65227 C 196.81042,376.69698 197.19076,376.91532 197.44034,377.25404 C 197.68992,377.59275 197.78579,378.0207 197.70457,378.43352 C 196.43444,385.02003 194.18719,391.32793 189.14207,396.71477 C 188.79686,397.1709 188.22229,397.39101 187.66069,397.28226 C 187.09908,397.17352 186.64821,396.75484 186.49821,396.20282 C 186.34822,395.6508 186.52522,395.06152 186.95457,394.68352 C 191.50956,389.82001 193.55305,384.16659 194.76707,377.87102 C 194.90948,377.10407 195.615 [...]
+ id="path7784" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 199.04832,378.33977 C 199.46667,378.38448 199.84701,378.60282 200.09659,378.94154 C 200.34617,379.28025 200.44204,379.7082 200.36082,380.12102 C 199.08924,386.71491 196.77318,392.84205 191.04832,398.08977 C 190.43563,398.65068 189.48423,398.60871 188.92332,397.99602 C 188.36241,397.38333 188.40438,396.43193 189.01707,395.87102 C 194.19117,391.12816 196.17944,385.84674 197.39207,379.55852 C 197.53509,378.77827 198.26084,378.24423 199.04832,378.33977 z "
+ id="path7786" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 201.70457,380.15227 C 202.12962,380.19587 202.51592,380.41866 202.76652,380.76474 C 203.01713,381.11081 203.10827,381.54733 203.01707,381.96477 C 201.74992,388.5359 199.56856,394.9542 193.39207,398.18352 C 192.91299,398.4814 192.30729,398.48532 191.82439,398.19367 C 191.34149,397.90201 191.06304,397.3641 191.1037,396.80143 C 191.14436,396.23876 191.49726,395.74647 192.01707,395.52727 C 196.99931,392.92235 198.83133,387.68202 200.04832,381.37102 C 200.19134,380.59077 200.91709 [...]
+ id="path7788" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 204.07468,381.29874 C 204.52212,381.3076 204.94224,381.51577 205.22033,381.86641 C 205.49843,382.21705 205.60545,382.67354 205.51218,383.11124 C 204.23539,389.73227 201.75488,396.08707 197.26218,401.32999 C 196.92974,401.78185 196.37298,402.01047 195.81892,401.92264 C 195.26487,401.8348 194.80612,401.44517 194.62975,400.91265 C 194.45337,400.38013 194.58885,399.79369 194.98093,399.39249 C 199.04924,394.64483 201.3673,388.80983 202.57468,382.54874 C 202.69799,381.81917 203.334 [...]
+ id="path7790" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 206.47116,382.99114 C 206.9186,383 207.33872,383.20817 207.61681,383.55881 C 207.89491,383.90945 208.00193,384.36594 207.90866,384.80364 C 206.65083,391.32619 204.7733,398.45247 200.31491,403.67864 C 199.98247,404.1305 199.42571,404.35912 198.87165,404.27129 C 198.3176,404.18345 197.85885,403.79382 197.68248,403.2613 C 197.5061,402.72878 197.64158,402.14234 198.03366,401.74114 C 201.87652,397.2365 203.74477,390.60066 204.97116,384.24114 C 205.09447,383.51157 205.73131,382.980 [...]
+ id="path7792" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 211.6489,386.52044 C 212.06725,386.56515 212.44759,386.78349 212.69717,387.12221 C 212.94675,387.46092 213.04262,387.88887 212.9614,388.30169 C 211.69693,394.85875 209.55456,402.03342 205.7114,407.45794 C 205.23678,408.13967 204.29938,408.30756 203.61765,407.83294 C 202.93592,407.35832 202.76803,406.42092 203.24265,405.73919 C 206.66165,400.91336 208.80417,394.06421 210.0239,387.73919 C 210.16631,386.97224 210.87275,386.44241 211.6489,386.52044 z "
+ id="path7794" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 209.22605,384.28704 C 209.67899,384.28659 210.10788,384.49082 210.39304,384.84272 C 210.67821,385.19462 210.78911,385.65653 210.6948,386.09954 C 210.05408,389.42213 209.02308,392.99912 207.28855,395.88079 C 205.55402,398.76246 202.92162,401.06339 199.3823,401.09954 C 198.84304,401.11032 198.3395,400.83077 198.06348,400.36737 C 197.78747,399.90397 197.78147,399.32807 198.04777,398.85902 C 198.31407,398.38998 198.81168,398.1 199.35105,398.09954 C 201.65087,398.07605 203.29523,3 [...]
+ id="path7796" />
+ </g>
+ <path
+ sodipodi:nodetypes="ccsscss"
+ d="M 739.90679,315.02714 C 739.90679,315.02714 779.00228,277.02387 779.00228,277.02387 C 776.35773,279.51395 773.96599,282.71901 771.91453,286.69334 C 741.15133,346.29137 788.48383,515.85204 736.6581,558.24148 C 736.6581,558.24148 697.74185,596.0745 697.74185,596.0745 C 749.56758,553.68507 702.23508,384.1244 732.99828,324.52637 C 735.00329,320.64203 737.33335,317.49251 739.90679,315.02714 z "
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ id="path4730" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 776.2279,280.01252 C 774.66387,281.93665 773.22489,284.16313 771.9154,286.70002 C 741.27237,346.06525 788.11348,514.52136 737.25915,557.73127 C 780.54361,508.32584 737.63668,348.71113 767.2904,291.26252 C 769.29541,287.3782 771.62321,284.22788 774.19665,281.76252 C 774.85435,281.13244 775.53977,280.55407 776.2279,280.01252 z "
+ id="path4906" />
+ <path
+ d="M 746.20604,400.45559 C 746.22298,406.7879 746.23995,413.1076 746.2569,419.91841 L 754.017,412.65223 L 754.39678,431.00618 L 746.69955,434.46524 C 746.95859,445.20523 748.50098,456.13185 748.24168,467.35182 L 739.05579,473.67704 C 739.50852,462.28171 740.19594,450.70205 739.66845,439.30672 L 730.98682,447.1258 C 730.79878,440.69627 730.61075,434.52554 730.42271,428.58752 L 739.2258,424.75987 C 739.0495,418.48738 738.17532,412.56386 737.02016,406.78081 L 746.20604,400.45559 z "
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80800003;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path5895"
+ sodipodi:nodetypes="ccccccccccccc" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 737.88415,319.76252 C 708.22111,377.22918 751.17395,536.91086 707.82165,586.26252 C 706.03311,588.00127 704.28404,589.70627 703.1654,590.79377 C 746.14432,541.14635 703.39754,381.87956 733.00915,324.51252 C 735.01415,320.62818 737.34196,317.47788 739.9154,315.01252 C 747.85939,306.43843 739.82577,316.22488 737.88415,319.76252 z M 703.1654,590.79377 C 703.09269,590.87776 703.01986,590.96039 702.94665,591.04377 C 702.87829,591.10078 702.79661,591.14346 702.7279,591.20002 C 702.82 [...]
+ id="path4890"
+ sodipodi:nodetypes="cccscccssc" />
+ <path
+ id="path5936"
+ style="opacity:0.50243901;fill:url(#linearGradient2756);fill-opacity:1;stroke:none;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 739.90679,315.02714 C 739.90679,315.02714 779.00228,277.02387 779.00228,277.02387 C 776.35773,279.51395 773.96599,282.71901 771.91453,286.69334 C 741.15133,346.29137 788.48383,515.85204 736.6581,558.24148 C 736.6581,558.24148 697.74185,596.0745 697.74185,596.0745 C 749.56758,553.68507 702.23508,384.1244 732.99828,324.52637 C 735.00329,320.64203 737.33335,317.49251 739.90679,315.02714 z "
+ sodipodi:nodetypes="ccsscss" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ d="M 739.90679,315.02714 C 739.90679,315.02714 779.00228,277.02387 779.00228,277.02387 C 797.19857,259.89045 827.36361,276.60725 840.99918,309.49992 C 840.99918,309.49992 802.08293,347.33295 802.08293,347.33295 C 788.40249,314.33205 758.08362,297.61364 739.90679,315.02714 z "
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ id="path4728" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 762.38415,303.26252 C 778.72144,303.53117 797.14508,318.85562 806.9779,342.57502 C 805.90083,343.62211 802.07165,347.32502 802.07165,347.32502 C 788.96446,315.70692 760.60083,299.07046 742.25915,313.04377 C 742.77917,312.40626 743.30818,311.77203 743.8529,311.20002 C 744.03079,311.01322 744.20375,310.84866 744.38415,310.66877 C 744.46756,310.58768 744.70038,310.35002 744.7904,310.26252 C 744.82846,310.22605 744.87723,310.20493 744.9154,310.16877 C 750.00373,305.34756 756.03889, [...]
+ id="path4881" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 796.57165,270.20002 C 812.86892,270.56604 831.20858,285.87091 841.00915,309.51252 C 841.00915,309.51252 837.32856,313.06402 836.3529,314.01252 C 822.65971,281.05436 792.36163,264.36035 774.19665,281.76252 C 774.19665,281.76252 779.00915,277.01252 779.00915,277.01252 C 784.12686,272.19374 790.19446,270.05679 796.57165,270.20002 z "
+ id="path4901"
+ sodipodi:nodetypes="cccccc" />
+ <g
+ transform="matrix(0.9752694,0.2210193,-0.2210193,0.9752694,237.00843,-78.342178)"
+ id="g5240">
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 168.36283,358.99684 C 168.78788,359.04044 169.17418,359.26323 169.42478,359.60931 C 169.67539,359.95538 169.76653,360.3919 169.67533,360.80934 C 168.40818,367.38047 166.22682,373.79877 160.05033,377.02809 C 159.57125,377.32597 158.96555,377.32989 158.48265,377.03824 C 157.99975,376.74658 157.7213,376.20867 157.76196,375.646 C 157.80262,375.08333 158.15552,374.59104 158.67533,374.37184 C 163.65757,371.76692 165.48959,366.52659 166.70658,360.21559 C 166.8496,359.43534 167.57535 [...]
+ id="path5242" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 170.73294,360.14331 C 171.18038,360.15217 171.6005,360.36034 171.87859,360.71098 C 172.15669,361.06162 172.26371,361.51811 172.17044,361.95581 C 170.89365,368.57684 168.41314,374.93164 163.92044,380.17456 C 163.588,380.62642 163.03124,380.85504 162.47718,380.76721 C 161.92313,380.67937 161.46438,380.28974 161.28801,379.75722 C 161.11163,379.2247 161.24711,378.63826 161.63919,378.23706 C 165.7075,373.4894 168.02556,367.6544 169.23294,361.39331 C 169.35625,360.66374 169.99309,3 [...]
+ id="path5244" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 173.12942,361.83571 C 173.57686,361.84457 173.99698,362.05274 174.27507,362.40338 C 174.55317,362.75402 174.66019,363.21051 174.56692,363.64821 C 173.30909,370.17076 171.43156,377.29704 166.97317,382.52321 C 166.64073,382.97507 166.08397,383.20369 165.52991,383.11586 C 164.97586,383.02802 164.51711,382.63839 164.34074,382.10587 C 164.16436,381.57335 164.29984,380.98691 164.69192,380.58571 C 168.53478,376.08107 170.40303,369.44523 171.62942,363.08571 C 171.75273,362.35614 172. [...]
+ id="path5246" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 178.30716,365.36501 C 178.72551,365.40972 179.10585,365.62806 179.35543,365.96678 C 179.60501,366.30549 179.70088,366.73344 179.61966,367.14626 C 178.35519,373.70332 176.21282,380.87799 172.36966,386.30251 C 171.89504,386.98424 170.95764,387.15213 170.27591,386.67751 C 169.59418,386.20289 169.42629,385.26549 169.90091,384.58376 C 173.31991,379.75793 175.46243,372.90878 176.68216,366.58376 C 176.82457,365.81681 177.53101,365.28698 178.30716,365.36501 z "
+ id="path5248" />
+ <path
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 175.75442,363.65115 C 176.20736,363.6507 176.63625,363.85493 176.92141,364.20683 C 177.20658,364.55873 177.31748,365.02064 177.22317,365.46365 C 176.58245,368.78624 175.55145,372.36323 173.81692,375.2449 C 172.08239,378.12657 169.44999,380.4275 165.91067,380.46365 C 165.37141,380.47443 164.86787,380.19488 164.59185,379.73148 C 164.31584,379.26808 164.30984,378.69218 164.57614,378.22313 C 164.84244,377.75409 165.34005,377.46411 165.87942,377.46365 C 168.17924,377.44016 169.823 [...]
+ id="path5250" />
+ <path
+ id="path5252"
+ d="M 180.71923,367.1425 C 181.17217,367.14205 181.60106,367.34628 181.88622,367.69818 C 182.17139,368.05008 182.28229,368.51199 182.18798,368.955 C 180.91643,375.54889 178.60034,381.67603 172.87548,386.92375 C 172.26279,387.48466 171.31139,387.44269 170.75048,386.83 C 170.18957,386.21731 170.23154,385.26591 170.84423,384.705 C 176.01833,379.96214 178.00663,374.68072 179.21923,368.3925 C 179.34254,367.66293 179.97938,367.13223 180.71923,367.1425 z "
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5254"
+ d="M 183.14207,368.83977 C 183.56712,368.88337 183.95342,369.10616 184.20402,369.45224 C 184.45463,369.79831 184.54577,370.23483 184.45457,370.65227 C 183.183,377.24615 180.86693,383.3733 175.14207,388.62102 C 174.52938,389.18193 173.57798,389.13996 173.01707,388.52727 C 172.45616,387.91458 172.49813,386.96318 173.11082,386.40227 C 178.28492,381.65941 180.27319,376.37799 181.48582,370.08977 C 181.61424,369.2969 182.34438,368.74586 183.14207,368.83977 z "
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5256"
+ d="M 185.76707,370.40227 C 186.19212,370.44587 186.57842,370.66866 186.82902,371.01474 C 187.07963,371.36081 187.17077,371.79733 187.07957,372.21477 C 185.7875,378.91516 182.79453,384.59592 177.14207,389.77727 C 176.52938,390.33818 175.57798,390.29621 175.01707,389.68352 C 174.45616,389.07083 174.49813,388.11943 175.11082,387.55852 C 180.35732,382.74929 182.95002,377.83399 184.14207,371.65227 C 184.27012,370.87273 184.98077,370.32608 185.76707,370.40227 z "
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5258"
+ d="M 188.68309,372.35443 C 189.10814,372.39803 189.49444,372.62082 189.74504,372.9669 C 189.99565,373.31297 190.08679,373.74949 189.99559,374.16693 C 188.70079,380.88137 185.75837,385.46257 180.18309,390.57318 C 179.5704,391.13409 178.619,391.09212 178.05809,390.47943 C 177.49718,389.86674 177.53915,388.91534 178.15184,388.35443 C 183.47552,383.47446 185.86872,379.74087 187.05809,373.57318 C 187.2005,372.80623 187.90694,372.2764 188.68309,372.35443 z "
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5260"
+ d="M 191.07957,373.40227 C 191.49792,373.44698 191.87826,373.66532 192.12784,374.00404 C 192.37742,374.34275 192.47329,374.7707 192.39207,375.18352 C 191.13083,381.72383 189.21902,387.95564 183.07957,391.30852 C 182.34607,391.70547 181.42965,391.43265 181.03269,390.69915 C 180.63574,389.96564 180.90857,389.04922 181.64207,388.65227 C 186.66136,385.91113 188.23161,380.96284 189.45457,374.62102 C 189.59698,373.85407 190.30342,373.32424 191.07957,373.40227 z "
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5262"
+ d="M 193.73582,375.08977 C 194.15417,375.13448 194.53451,375.35282 194.78409,375.69154 C 195.03367,376.03025 195.12954,376.4582 195.04832,376.87102 C 193.81205,383.28203 192.75559,389.89984 186.92332,395.24602 C 186.31063,395.80693 185.35923,395.76496 184.79832,395.15227 C 184.23741,394.53958 184.27938,393.58818 184.89207,393.02727 C 189.95876,388.38287 190.86297,382.77958 192.11082,376.30852 C 192.25323,375.54157 192.95967,375.01174 193.73582,375.08977 z "
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5264"
+ d="M 196.39207,376.65227 C 196.81042,376.69698 197.19076,376.91532 197.44034,377.25404 C 197.68992,377.59275 197.78579,378.0207 197.70457,378.43352 C 196.43444,385.02003 194.18719,391.32793 189.14207,396.71477 C 188.79686,397.1709 188.22229,397.39101 187.66069,397.28226 C 187.09908,397.17352 186.64821,396.75484 186.49821,396.20282 C 186.34822,395.6508 186.52522,395.06152 186.95457,394.68352 C 191.50956,389.82001 193.55305,384.16659 194.76707,377.87102 C 194.90948,377.10407 195.615 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5266"
+ d="M 199.04832,378.33977 C 199.46667,378.38448 199.84701,378.60282 200.09659,378.94154 C 200.34617,379.28025 200.44204,379.7082 200.36082,380.12102 C 199.08924,386.71491 196.77318,392.84205 191.04832,398.08977 C 190.43563,398.65068 189.48423,398.60871 188.92332,397.99602 C 188.36241,397.38333 188.40438,396.43193 189.01707,395.87102 C 194.19117,391.12816 196.17944,385.84674 197.39207,379.55852 C 197.53509,378.77827 198.26084,378.24423 199.04832,378.33977 z "
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5268"
+ d="M 201.70457,380.15227 C 202.12962,380.19587 202.51592,380.41866 202.76652,380.76474 C 203.01713,381.11081 203.10827,381.54733 203.01707,381.96477 C 201.74992,388.5359 199.56856,394.9542 193.39207,398.18352 C 192.91299,398.4814 192.30729,398.48532 191.82439,398.19367 C 191.34149,397.90201 191.06304,397.3641 191.1037,396.80143 C 191.14436,396.23876 191.49726,395.74647 192.01707,395.52727 C 196.99931,392.92235 198.83133,387.68202 200.04832,381.37102 C 200.19134,380.59077 200.91709 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5270"
+ d="M 204.07468,381.29874 C 204.52212,381.3076 204.94224,381.51577 205.22033,381.86641 C 205.49843,382.21705 205.60545,382.67354 205.51218,383.11124 C 204.23539,389.73227 201.75488,396.08707 197.26218,401.32999 C 196.92974,401.78185 196.37298,402.01047 195.81892,401.92264 C 195.26487,401.8348 194.80612,401.44517 194.62975,400.91265 C 194.45337,400.38013 194.58885,399.79369 194.98093,399.39249 C 199.04924,394.64483 201.3673,388.80983 202.57468,382.54874 C 202.69799,381.81917 203.334 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5272"
+ d="M 206.47116,382.99114 C 206.9186,383 207.33872,383.20817 207.61681,383.55881 C 207.89491,383.90945 208.00193,384.36594 207.90866,384.80364 C 206.65083,391.32619 204.7733,398.45247 200.31491,403.67864 C 199.98247,404.1305 199.42571,404.35912 198.87165,404.27129 C 198.3176,404.18345 197.85885,403.79382 197.68248,403.2613 C 197.5061,402.72878 197.64158,402.14234 198.03366,401.74114 C 201.87652,397.2365 203.74477,390.60066 204.97116,384.24114 C 205.09447,383.51157 205.73131,382.980 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5274"
+ d="M 211.6489,386.52044 C 212.06725,386.56515 212.44759,386.78349 212.69717,387.12221 C 212.94675,387.46092 213.04262,387.88887 212.9614,388.30169 C 211.69693,394.85875 209.55456,402.03342 205.7114,407.45794 C 205.23678,408.13967 204.29938,408.30756 203.61765,407.83294 C 202.93592,407.35832 202.76803,406.42092 203.24265,405.73919 C 206.66165,400.91336 208.80417,394.06421 210.0239,387.73919 C 210.16631,386.97224 210.87275,386.44241 211.6489,386.52044 z "
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ id="path5276"
+ d="M 209.22605,384.28704 C 209.67899,384.28659 210.10788,384.49082 210.39304,384.84272 C 210.67821,385.19462 210.78911,385.65653 210.6948,386.09954 C 210.05408,389.42213 209.02308,392.99912 207.28855,395.88079 C 205.55402,398.76246 202.92162,401.06339 199.3823,401.09954 C 198.84304,401.11032 198.3395,400.83077 198.06348,400.36737 C 197.78747,399.90397 197.78147,399.32807 198.04777,398.85902 C 198.31407,398.38998 198.81168,398.1 199.35105,398.09954 C 201.65087,398.07605 203.29523,3 [...]
+ style="fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ <path
+ id="path5278"
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 421.09869,315.02714 C 421.09869,315.02714 382.0032,277.02387 382.0032,277.02387 C 384.64775,279.51395 387.03949,282.71901 389.09095,286.69334 C 419.85415,346.29137 372.52165,515.85204 424.34738,558.24148 C 424.34738,558.24148 463.26363,596.0745 463.26363,596.0745 C 411.4379,553.68507 458.7704,384.1244 428.0072,324.52637 C 426.00219,320.64203 423.67213,317.49251 421.09869,315.02714 z "
+ sodipodi:nodetypes="ccsscss" />
+ <path
+ sodipodi:nodetypes="ccccccccccccc"
+ id="path5910"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80800003;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 414.79945,400.45559 C 414.7825,406.7879 414.76554,413.1076 414.74859,419.91841 L 406.98849,412.65223 L 406.6087,431.00618 L 414.30593,434.46524 C 414.04689,445.20523 412.50451,456.13185 412.76381,467.35182 L 421.9497,473.67704 C 421.49696,462.28171 420.80954,450.70205 421.33703,439.30672 L 430.01866,447.1258 C 430.2067,440.69627 430.39473,434.52554 430.58277,428.58752 L 421.77969,424.75987 C 421.95599,418.48738 422.83017,412.56386 423.98533,406.78081 L 414.79945,400.45559 z " />
+ <path
+ id="path5280"
+ d="M 384.77758,280.01252 C 386.34161,281.93665 387.78059,284.16313 389.09008,286.70002 C 419.73311,346.06525 372.892,514.52136 423.74633,557.73127 C 380.46187,508.32584 423.3688,348.71113 393.71508,291.26252 C 391.71007,287.3782 389.38227,284.22788 386.80883,281.76252 C 386.15113,281.13244 385.46571,280.55407 384.77758,280.01252 z "
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccscccssc"
+ id="path5284"
+ d="M 423.12133,319.76252 C 452.78437,377.22918 409.83153,536.91086 453.18383,586.26252 C 454.97237,588.00127 456.72144,589.70627 457.84008,590.79377 C 414.86116,541.14635 457.60794,381.87956 427.99633,324.51252 C 425.99133,320.62818 423.66352,317.47788 421.09008,315.01252 C 413.14609,306.43843 421.17971,316.22488 423.12133,319.76252 z M 457.84008,590.79377 C 457.91279,590.87776 457.98562,590.96039 458.05883,591.04377 C 458.12719,591.10078 458.20887,591.14346 458.27758,591.20002 C 45 [...]
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="ccsscss"
+ d="M 421.09869,315.02714 C 421.09869,315.02714 382.0032,277.02387 382.0032,277.02387 C 384.64775,279.51395 387.03949,282.71901 389.09095,286.69334 C 419.85415,346.29137 372.52165,515.85204 424.34738,558.24148 C 424.34738,558.24148 463.26363,596.0745 463.26363,596.0745 C 411.4379,553.68507 458.7704,384.1244 428.0072,324.52637 C 426.00219,320.64203 423.67213,317.49251 421.09869,315.02714 z "
+ style="opacity:0.50243901;fill:url(#linearGradient2727);fill-opacity:1;stroke:none;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ id="path6932" />
+ <path
+ id="path5282"
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="M 421.09869,315.02714 C 421.09869,315.02714 382.0032,277.02387 382.0032,277.02387 C 363.80691,259.89045 333.64187,276.60725 320.0063,309.49992 C 320.0063,309.49992 358.92255,347.33295 358.92255,347.33295 C 372.60299,314.33205 402.92186,297.61364 421.09869,315.02714 z "
+ sodipodi:nodetypes="ccccc" />
+ <path
+ id="path5286"
+ d="M 398.62133,303.26252 C 382.28404,303.53117 363.8604,318.85562 354.02758,342.57502 C 355.10465,343.62211 358.93383,347.32502 358.93383,347.32502 C 372.04102,315.70692 400.40465,299.07046 418.74633,313.04377 C 418.22631,312.40626 417.6973,311.77203 417.15258,311.20002 C 416.97469,311.01322 416.80173,310.84866 416.62133,310.66877 C 416.53792,310.58768 416.3051,310.35002 416.21508,310.26252 C 416.17702,310.22605 416.12825,310.20493 416.09008,310.16877 C 411.00175,305.34756 404.96659 [...]
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="cccccc"
+ id="path5288"
+ d="M 364.43383,270.20002 C 348.13656,270.56604 329.7969,285.87091 319.99633,309.51252 C 319.99633,309.51252 323.67692,313.06402 324.65258,314.01252 C 338.34577,281.05436 368.64385,264.36035 386.80883,281.76252 C 386.80883,281.76252 381.99633,277.01252 381.99633,277.01252 C 376.87862,272.19374 370.81102,270.05679 364.43383,270.20002 z "
+ style="fill:#ffbd03;fill-opacity:1;stroke:#000000;stroke-width:0.80800003;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" />
+ <path
+ sodipodi:nodetypes="ccccccccccccc"
+ id="path5893"
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80800003;stroke-miterlimit:4;stroke-dasharray:none"
+ d="M 775.57967,282.75571 C 781.51443,282.02518 784.70161,283.77194 789.42175,285.47133 L 793.97444,277.51332 C 799.31483,277.95725 807.6934,282.23017 811.07102,285.91709 C 807.13898,287.68731 803.18164,289.2499 799.6645,291.98199 C 809.34504,298.81116 819.59941,306.7861 825.09018,314.2218 L 812.53864,326.47459 C 807.82394,315.95052 801.40906,305.6197 792.47025,298.65723 C 789.48071,301.2424 787.83166,304.49778 785.72977,307.52678 C 781.15879,303.62305 775.08567,300.85576 768.43794,3 [...]
+ <path
+ d="M 385.42582,282.75571 C 379.49105,282.02518 376.30387,283.77194 371.58373,285.47133 L 367.03104,277.51332 C 361.69066,277.95725 353.31209,282.23017 349.93446,285.91709 C 353.8665,287.68731 357.82384,289.2499 361.34098,291.98199 C 351.66044,298.81116 341.40607,306.7861 335.9153,314.2218 L 348.46684,326.47459 C 353.18155,315.95052 359.59642,305.6197 368.53524,298.65723 C 371.52477,301.2424 373.17383,304.49778 375.27571,307.52678 C 379.84669,303.62305 385.91982,300.85576 392.56755,3 [...]
+ style="font-size:12px;fill:#ffbd03;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.80800003;stroke-miterlimit:4;stroke-dasharray:none"
+ id="path5908"
+ sodipodi:nodetypes="ccccccccccccc" />
+ <path
+ id="path5421"
+ d="M 579.62223,593.4399 C 582.79489,593.57409 585.71528,595.20702 587.49093,597.83967 C 589.26658,600.47232 589.68645,603.79179 588.62223,606.78365 C 586.97525,611.61057 584.87677,628.46614 584.65348,644.6899 C 584.43019,660.91365 585.99868,678.15086 587.96598,684.3149 C 589.64009,689.57885 586.72994,695.20328 581.46598,696.8774 C 576.20202,698.55151 570.57759,695.64135 568.90348,690.3774 C 565.16488,678.66347 564.41511,661.75943 564.65348,644.4399 C 564.89185,627.12036 566.04026,61 [...]
+ style="fill:url(#linearGradient2719);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+</svg>
diff --git a/test/Flag_of_the_United_Kingdom.svg b/test/Flag_of_the_United_Kingdom.svg
new file mode 100644
index 0000000..36c9889
--- /dev/null
+++ b/test/Flag_of_the_United_Kingdom.svg
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30" width="1200" height="600">
+<clipPath id="t">
+ <path d="M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"/>
+</clipPath>
+<path d="M0,0 v30 h60 v-30 z" fill="#00247d"/>
+<path d="M0,0 L60,30 M60,0 L0,30" stroke="#fff" stroke-width="6"/>
+<path d="M0,0 L60,30 M60,0 L0,30" clip-path="url(#t)" stroke="#cf142b" stroke-width="4"/>
+<path d="M30,0 v30 M0,15 h60" stroke="#fff" stroke-width="10"/>
+<path d="M30,0 v30 M0,15 h60" stroke="#cf142b" stroke-width="6"/>
+</svg>
diff --git a/test/Flag_of_the_United_States.svg b/test/Flag_of_the_United_States.svg
new file mode 100644
index 0000000..f02c7a8
--- /dev/null
+++ b/test/Flag_of_the_United_States.svg
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1235" height="650">
+<defs>
+<polygon id="pt" points="-0.1624598481164531,0 0,-0.5 0.1624598481164531,0" transform="scale(0.0616)" fill="#FFF"/>
+<g id="star"><use xlink:href="#pt" transform="rotate(-144)"/><use xlink:href="#pt" transform="rotate(-72)"/><use xlink:href="#pt"/><use xlink:href="#pt" transform="rotate(72)"/><use xlink:href="#pt" transform="rotate(144)"/></g>
+<g id="s5"><use xlink:href="#star" x="-0.252"/><use xlink:href="#star" x="-0.126"/><use xlink:href="#star"/><use xlink:href="#star" x="0.126"/><use xlink:href="#star" x="0.252"/></g>
+<g id="s6"><use xlink:href="#s5" x="-0.063"/><use xlink:href="#star" x="0.315"/></g>
+<g id="x4"><use xlink:href="#s6"/><use xlink:href="#s5" y="0.054"/><use xlink:href="#s6" y="0.108"/><use xlink:href="#s5" y="0.162"/></g>
+<g id="u"><use xlink:href="#x4" y="-0.216"/><use xlink:href="#x4"/><use xlink:href="#s6" y="0.216"/></g>
+<rect id="stripe" width="1235" height="50" fill="#B22234"/>
+</defs>
+<rect width="1235" height="650" fill="#FFF"/><use xlink:href="#stripe"/><use xlink:href="#stripe" y="100"/><use xlink:href="#stripe" y="200"/><use xlink:href="#stripe" y="300"/><use xlink:href="#stripe" y="400"/><use xlink:href="#stripe" y="500"/><use xlink:href="#stripe" y="600"/><rect width="494" height="350" fill="#3C3B6E"/><use xlink:href="#u" transform="translate(247,175) scale(650)"/></svg>
\ No newline at end of file
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..216ae98
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,106 @@
+check_PROGRAMS = test_coverage test_palette \
+ test_section test_raster \
+ test_mask test_webp test_gif \
+ test1 test2 test3 test4 test5 \
+ test6 test7 test8 test9 test10 \
+ test11 test12 test13 test14 \
+ test15 test16 test17 test18 \
+ test19 test20 test_tifin \
+ test_wr_tiff test_wms1 test_wms2 \
+ test_paint check_sql_stmt \
+ test_map_nile_8 test_map_nile_u8 \
+ test_map_nile_u16 test_map_nile_32 \
+ test_map_nile_u32 test_map_nile_flt \
+ test_map_nile_dbl test_map_ascii \
+ test_map_rgb test_map_gray \
+ test_map_srtm test_map_mono \
+ test_map_indiana test_load_wms \
+ test_map_noref test_map_trento \
+ test_map_trieste test_map_infrared \
+ test_map_orbetello test_raster_symbolizer \
+ test_svg
+
+AM_CPPFLAGS = -I at srcdir@/../headers @LIBXML2_CFLAGS@
+AM_LDFLAGS = -L../src -lrasterlite2 @LIBCAIRO_LIBS@ @LIBPNG_LIBS@ \
+ @LIBWEBP_LIBS@ @LIBLZMA_LIBS@ @LIBSPATIALITE_LIBS@ \
+ @LIBCURL_LIBS@ @LIBXML2_LIBS@ $(GCOV_FLAGS)
+
+TESTS = $(check_PROGRAMS)
+
+MOSTLYCLEANFILES = *.gcna *.gcno *.gcda
+
+EXTRA_DIST = jpeg1.jpg jpeg2.jpg png1.png mask1.png \
+ webp_no_alpha.webp gif1.gif mono3t.tif mono3s.tif \
+ mono4t.tif mono4s.tif gray-tiled.tif gray-striped.tif \
+ plt-tiled.tif plt-striped.tif rgb-tiled.tif \
+ rgb-striped.tif test_under_valgrind.sh \
+ asprintf4win.h fnmatch_impl4win.h \
+ fnmatch4win.h scandir4win.h \
+ map_samples/usgs-gray/gray1.tif \
+ map_samples/usgs-gray/gray2.tif \
+ map_samples/usgs-rgb/rgb1.tif \
+ map_samples/usgs-rgb/rgb2.tif \
+ map_samples/usgs-srtm/srtm1.tif \
+ map_samples/usgs-srtm/srtm2.tif \
+ map_samples/usgs-nile-8/nile1-int8.tif \
+ map_samples/usgs-nile-8/nile2-int8.tif \
+ map_samples/usgs-nile-u8/nile1-uint8.tif \
+ map_samples/usgs-nile-u8/nile2-uint8.tif \
+ map_samples/usgs-nile-u16/nile1-uint16.tif \
+ map_samples/usgs-nile-u16/nile2-uint16.tif \
+ map_samples/usgs-nile-32/nile1-int32.tif \
+ map_samples/usgs-nile-32/nile2-int32.tif \
+ map_samples/usgs-nile-u32/nile1-uint32.tif \
+ map_samples/usgs-nile-u32/nile2-uint32.tif \
+ map_samples/usgs-nile-flt/nile1-flt.tif \
+ map_samples/usgs-nile-flt/nile2-flt.tif \
+ map_samples/usgs-nile-dbl/nile1-dbl.tif \
+ map_samples/usgs-nile-dbl/nile2-dbl.tif \
+ map_samples/usgs-indiana/indiana1.tif \
+ map_samples/usgs-indiana/indiana2.tif \
+ map_samples/ctrt/cap1.tif \
+ map_samples/ctrt/cap2.tif \
+ map_samples/ascii/ascii1.asc \
+ map_samples/ascii/ascii2.asc \
+ map_samples/trento-rgb/trento-rgb1.jpg \
+ map_samples/trento-rgb/trento-rgb1.jgw \
+ map_samples/trento-rgb/trento-rgb2.jpg \
+ map_samples/trento-rgb/trento-rgb2.jgw \
+ map_samples/trento-gray/trento-gray1.jpg \
+ map_samples/trento-gray/trento-gray1.jgw \
+ map_samples/trento-gray/trento-gray2.jpg \
+ map_samples/trento-gray/trento-gray2.jgw \
+ map_samples/orbview3-trieste/trieste1.tif \
+ map_samples/orbview3-trieste/trieste2.tif \
+ map_samples/tuscany-infrared/infrared1.tif \
+ map_samples/tuscany-infrared/infrared2.tfw \
+ map_samples/tuscany-infrared/infrared2.tif \
+ map_samples/orbview3-orbetello/orbetello1.tif \
+ map_samples/orbview3-orbetello/orbetello2.tfw \
+ map_samples/orbview3-orbetello/orbetello2.tif \
+ raster_symbolizer_1.xml raster_symbolizer_2.xml \
+ raster_symbolizer_3.xml raster_symbolizer_4.xml \
+ raster_symbolizer_5.xml raster_symbolizer_6.xml \
+ srtm_categ.xml srtm_interp.xml srtm_brightness.xml \
+ srtm_relief_25.xml srtm_relief_75.xml ir_gray.xml \
+ ir_gray_gamma.xml ir_false_color1.xml \
+ ir_false_color2.xml ir_false_color1_gamma.xml \
+ ir_false_color2_gamma.xml rgb_histogram.xml \
+ rgb_normalize.xml gray_gamma.xml gray_histogram.xml \
+ gray_normalize.xml rgb_normalize2.xml \
+ rgb_histogram2.xml rgb_gamma.xml gray_normalize2.xml \
+ gray_histogram2.xml gray_gamma2.xml group_style_1.xml \
+ group_style_2.xml bicycle.svg car_repair.svg \
+ Car_Yellow.svg Circle_and_quadratic_bezier.svg \
+ Coat_of_arms_Holy_See.svg doctors.svg fastfood.svg \
+ Flag_of_the_United_Kingdom.svg Flag_of_the_United_States.svg \
+ hospital.svg jewelry.svg motorcycle.svg \
+ Negative_and_positive_skew_diagrams_(English).svg \
+ Netherlands_roundel.svg pharmacy.svg photo.svg restaurant.svg \
+ Roundel_of_the_Royal_Canadian_Air_Force_(1946-1965).svg \
+ Roundel_of_the_Syrian_Air_Force.svg \
+ Royal_Coat_of_Arms_of_the_United_Kingdom.svg \
+ supermarket.svg tobacco.svg
+
+SUBDIRS = sql_stmt_security_tests sql_stmt_tests
+
diff --git a/test/Makefile.in b/test/Makefile.in
new file mode 100644
index 0000000..cdb3113
--- /dev/null
+++ b/test/Makefile.in
@@ -0,0 +1,2001 @@
+# Makefile.in generated by automake 1.13.4 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.
+
+ at 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@
+pkgincludedir = $(includedir)/@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@
+check_PROGRAMS = test_coverage$(EXEEXT) test_palette$(EXEEXT) \
+ test_section$(EXEEXT) test_raster$(EXEEXT) test_mask$(EXEEXT) \
+ test_webp$(EXEEXT) test_gif$(EXEEXT) test1$(EXEEXT) \
+ test2$(EXEEXT) test3$(EXEEXT) test4$(EXEEXT) test5$(EXEEXT) \
+ test6$(EXEEXT) test7$(EXEEXT) test8$(EXEEXT) test9$(EXEEXT) \
+ test10$(EXEEXT) test11$(EXEEXT) test12$(EXEEXT) \
+ test13$(EXEEXT) test14$(EXEEXT) test15$(EXEEXT) \
+ test16$(EXEEXT) test17$(EXEEXT) test18$(EXEEXT) \
+ test19$(EXEEXT) test20$(EXEEXT) test_tifin$(EXEEXT) \
+ test_wr_tiff$(EXEEXT) test_wms1$(EXEEXT) test_wms2$(EXEEXT) \
+ test_paint$(EXEEXT) check_sql_stmt$(EXEEXT) \
+ test_map_nile_8$(EXEEXT) test_map_nile_u8$(EXEEXT) \
+ test_map_nile_u16$(EXEEXT) test_map_nile_32$(EXEEXT) \
+ test_map_nile_u32$(EXEEXT) test_map_nile_flt$(EXEEXT) \
+ test_map_nile_dbl$(EXEEXT) test_map_ascii$(EXEEXT) \
+ test_map_rgb$(EXEEXT) test_map_gray$(EXEEXT) \
+ test_map_srtm$(EXEEXT) test_map_mono$(EXEEXT) \
+ test_map_indiana$(EXEEXT) test_load_wms$(EXEEXT) \
+ test_map_noref$(EXEEXT) test_map_trento$(EXEEXT) \
+ test_map_trieste$(EXEEXT) test_map_infrared$(EXEEXT) \
+ test_map_orbetello$(EXEEXT) test_raster_symbolizer$(EXEEXT) \
+ test_svg$(EXEEXT)
+subdir = test
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/depcomp $(top_srcdir)/test-driver
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(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)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+check_sql_stmt_SOURCES = check_sql_stmt.c
+check_sql_stmt_OBJECTS = check_sql_stmt.$(OBJEXT)
+check_sql_stmt_LDADD = $(LDADD)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+test1_SOURCES = test1.c
+test1_OBJECTS = test1.$(OBJEXT)
+test1_LDADD = $(LDADD)
+test10_SOURCES = test10.c
+test10_OBJECTS = test10.$(OBJEXT)
+test10_LDADD = $(LDADD)
+test11_SOURCES = test11.c
+test11_OBJECTS = test11.$(OBJEXT)
+test11_LDADD = $(LDADD)
+test12_SOURCES = test12.c
+test12_OBJECTS = test12.$(OBJEXT)
+test12_LDADD = $(LDADD)
+test13_SOURCES = test13.c
+test13_OBJECTS = test13.$(OBJEXT)
+test13_LDADD = $(LDADD)
+test14_SOURCES = test14.c
+test14_OBJECTS = test14.$(OBJEXT)
+test14_LDADD = $(LDADD)
+test15_SOURCES = test15.c
+test15_OBJECTS = test15.$(OBJEXT)
+test15_LDADD = $(LDADD)
+test16_SOURCES = test16.c
+test16_OBJECTS = test16.$(OBJEXT)
+test16_LDADD = $(LDADD)
+test17_SOURCES = test17.c
+test17_OBJECTS = test17.$(OBJEXT)
+test17_LDADD = $(LDADD)
+test18_SOURCES = test18.c
+test18_OBJECTS = test18.$(OBJEXT)
+test18_LDADD = $(LDADD)
+test19_SOURCES = test19.c
+test19_OBJECTS = test19.$(OBJEXT)
+test19_LDADD = $(LDADD)
+test2_SOURCES = test2.c
+test2_OBJECTS = test2.$(OBJEXT)
+test2_LDADD = $(LDADD)
+test20_SOURCES = test20.c
+test20_OBJECTS = test20.$(OBJEXT)
+test20_LDADD = $(LDADD)
+test3_SOURCES = test3.c
+test3_OBJECTS = test3.$(OBJEXT)
+test3_LDADD = $(LDADD)
+test4_SOURCES = test4.c
+test4_OBJECTS = test4.$(OBJEXT)
+test4_LDADD = $(LDADD)
+test5_SOURCES = test5.c
+test5_OBJECTS = test5.$(OBJEXT)
+test5_LDADD = $(LDADD)
+test6_SOURCES = test6.c
+test6_OBJECTS = test6.$(OBJEXT)
+test6_LDADD = $(LDADD)
+test7_SOURCES = test7.c
+test7_OBJECTS = test7.$(OBJEXT)
+test7_LDADD = $(LDADD)
+test8_SOURCES = test8.c
+test8_OBJECTS = test8.$(OBJEXT)
+test8_LDADD = $(LDADD)
+test9_SOURCES = test9.c
+test9_OBJECTS = test9.$(OBJEXT)
+test9_LDADD = $(LDADD)
+test_coverage_SOURCES = test_coverage.c
+test_coverage_OBJECTS = test_coverage.$(OBJEXT)
+test_coverage_LDADD = $(LDADD)
+test_gif_SOURCES = test_gif.c
+test_gif_OBJECTS = test_gif.$(OBJEXT)
+test_gif_LDADD = $(LDADD)
+test_load_wms_SOURCES = test_load_wms.c
+test_load_wms_OBJECTS = test_load_wms.$(OBJEXT)
+test_load_wms_LDADD = $(LDADD)
+test_map_ascii_SOURCES = test_map_ascii.c
+test_map_ascii_OBJECTS = test_map_ascii.$(OBJEXT)
+test_map_ascii_LDADD = $(LDADD)
+test_map_gray_SOURCES = test_map_gray.c
+test_map_gray_OBJECTS = test_map_gray.$(OBJEXT)
+test_map_gray_LDADD = $(LDADD)
+test_map_indiana_SOURCES = test_map_indiana.c
+test_map_indiana_OBJECTS = test_map_indiana.$(OBJEXT)
+test_map_indiana_LDADD = $(LDADD)
+test_map_infrared_SOURCES = test_map_infrared.c
+test_map_infrared_OBJECTS = test_map_infrared.$(OBJEXT)
+test_map_infrared_LDADD = $(LDADD)
+test_map_mono_SOURCES = test_map_mono.c
+test_map_mono_OBJECTS = test_map_mono.$(OBJEXT)
+test_map_mono_LDADD = $(LDADD)
+test_map_nile_32_SOURCES = test_map_nile_32.c
+test_map_nile_32_OBJECTS = test_map_nile_32.$(OBJEXT)
+test_map_nile_32_LDADD = $(LDADD)
+test_map_nile_8_SOURCES = test_map_nile_8.c
+test_map_nile_8_OBJECTS = test_map_nile_8.$(OBJEXT)
+test_map_nile_8_LDADD = $(LDADD)
+test_map_nile_dbl_SOURCES = test_map_nile_dbl.c
+test_map_nile_dbl_OBJECTS = test_map_nile_dbl.$(OBJEXT)
+test_map_nile_dbl_LDADD = $(LDADD)
+test_map_nile_flt_SOURCES = test_map_nile_flt.c
+test_map_nile_flt_OBJECTS = test_map_nile_flt.$(OBJEXT)
+test_map_nile_flt_LDADD = $(LDADD)
+test_map_nile_u16_SOURCES = test_map_nile_u16.c
+test_map_nile_u16_OBJECTS = test_map_nile_u16.$(OBJEXT)
+test_map_nile_u16_LDADD = $(LDADD)
+test_map_nile_u32_SOURCES = test_map_nile_u32.c
+test_map_nile_u32_OBJECTS = test_map_nile_u32.$(OBJEXT)
+test_map_nile_u32_LDADD = $(LDADD)
+test_map_nile_u8_SOURCES = test_map_nile_u8.c
+test_map_nile_u8_OBJECTS = test_map_nile_u8.$(OBJEXT)
+test_map_nile_u8_LDADD = $(LDADD)
+test_map_noref_SOURCES = test_map_noref.c
+test_map_noref_OBJECTS = test_map_noref.$(OBJEXT)
+test_map_noref_LDADD = $(LDADD)
+test_map_orbetello_SOURCES = test_map_orbetello.c
+test_map_orbetello_OBJECTS = test_map_orbetello.$(OBJEXT)
+test_map_orbetello_LDADD = $(LDADD)
+test_map_rgb_SOURCES = test_map_rgb.c
+test_map_rgb_OBJECTS = test_map_rgb.$(OBJEXT)
+test_map_rgb_LDADD = $(LDADD)
+test_map_srtm_SOURCES = test_map_srtm.c
+test_map_srtm_OBJECTS = test_map_srtm.$(OBJEXT)
+test_map_srtm_LDADD = $(LDADD)
+test_map_trento_SOURCES = test_map_trento.c
+test_map_trento_OBJECTS = test_map_trento.$(OBJEXT)
+test_map_trento_LDADD = $(LDADD)
+test_map_trieste_SOURCES = test_map_trieste.c
+test_map_trieste_OBJECTS = test_map_trieste.$(OBJEXT)
+test_map_trieste_LDADD = $(LDADD)
+test_mask_SOURCES = test_mask.c
+test_mask_OBJECTS = test_mask.$(OBJEXT)
+test_mask_LDADD = $(LDADD)
+test_paint_SOURCES = test_paint.c
+test_paint_OBJECTS = test_paint.$(OBJEXT)
+test_paint_LDADD = $(LDADD)
+test_palette_SOURCES = test_palette.c
+test_palette_OBJECTS = test_palette.$(OBJEXT)
+test_palette_LDADD = $(LDADD)
+test_raster_SOURCES = test_raster.c
+test_raster_OBJECTS = test_raster.$(OBJEXT)
+test_raster_LDADD = $(LDADD)
+test_raster_symbolizer_SOURCES = test_raster_symbolizer.c
+test_raster_symbolizer_OBJECTS = test_raster_symbolizer.$(OBJEXT)
+test_raster_symbolizer_LDADD = $(LDADD)
+test_section_SOURCES = test_section.c
+test_section_OBJECTS = test_section.$(OBJEXT)
+test_section_LDADD = $(LDADD)
+test_svg_SOURCES = test_svg.c
+test_svg_OBJECTS = test_svg.$(OBJEXT)
+test_svg_LDADD = $(LDADD)
+test_tifin_SOURCES = test_tifin.c
+test_tifin_OBJECTS = test_tifin.$(OBJEXT)
+test_tifin_LDADD = $(LDADD)
+test_webp_SOURCES = test_webp.c
+test_webp_OBJECTS = test_webp.$(OBJEXT)
+test_webp_LDADD = $(LDADD)
+test_wms1_SOURCES = test_wms1.c
+test_wms1_OBJECTS = test_wms1.$(OBJEXT)
+test_wms1_LDADD = $(LDADD)
+test_wms2_SOURCES = test_wms2.c
+test_wms2_OBJECTS = test_wms2.$(OBJEXT)
+test_wms2_LDADD = $(LDADD)
+test_wr_tiff_SOURCES = test_wr_tiff.c
+test_wr_tiff_OBJECTS = test_wr_tiff.$(OBJEXT)
+test_wr_tiff_LDADD = $(LDADD)
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = check_sql_stmt.c test1.c test10.c test11.c test12.c test13.c \
+ test14.c test15.c test16.c test17.c test18.c test19.c test2.c \
+ test20.c test3.c test4.c test5.c test6.c test7.c test8.c \
+ test9.c test_coverage.c test_gif.c test_load_wms.c \
+ test_map_ascii.c test_map_gray.c test_map_indiana.c \
+ test_map_infrared.c test_map_mono.c test_map_nile_32.c \
+ test_map_nile_8.c test_map_nile_dbl.c test_map_nile_flt.c \
+ test_map_nile_u16.c test_map_nile_u32.c test_map_nile_u8.c \
+ test_map_noref.c test_map_orbetello.c test_map_rgb.c \
+ test_map_srtm.c test_map_trento.c test_map_trieste.c \
+ test_mask.c test_paint.c test_palette.c test_raster.c \
+ test_raster_symbolizer.c test_section.c test_svg.c \
+ test_tifin.c test_webp.c test_wms1.c test_wms2.c \
+ test_wr_tiff.c
+DIST_SOURCES = check_sql_stmt.c test1.c test10.c test11.c test12.c \
+ test13.c test14.c test15.c test16.c test17.c test18.c test19.c \
+ test2.c test20.c test3.c test4.c test5.c test6.c test7.c \
+ test8.c test9.c test_coverage.c test_gif.c test_load_wms.c \
+ test_map_ascii.c test_map_gray.c test_map_indiana.c \
+ test_map_infrared.c test_map_mono.c test_map_nile_32.c \
+ test_map_nile_8.c test_map_nile_dbl.c test_map_nile_flt.c \
+ test_map_nile_u16.c test_map_nile_u32.c test_map_nile_u8.c \
+ test_map_noref.c test_map_orbetello.c test_map_rgb.c \
+ test_map_srtm.c test_map_trento.c test_map_trieste.c \
+ test_mask.c test_paint.c test_palette.c test_raster.c \
+ test_raster_symbolizer.c test_section.c test_svg.c \
+ test_tifin.c test_webp.c test_wms1.c test_wms2.c \
+ test_wr_tiff.c
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ check recheck distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# 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
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red='[0;31m'; \
+ grn='[0;32m'; \
+ lgn='[1;32m'; \
+ blu='[1;34m'; \
+ mgn='[0;35m'; \
+ brg='[1m'; \
+ std='[m'; \
+ fi; \
+}
+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__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT at .log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAIRO_CFLAGS = @LIBCAIRO_CFLAGS@
+LIBCAIRO_LIBS = @LIBCAIRO_LIBS@
+LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@
+LIBLZMA_LIBS = @LIBLZMA_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
+LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
+LIBTOOL = @LIBTOOL@
+LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@
+LIBWEBP_LIBS = @LIBWEBP_LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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_CXX = @ac_ct_CXX@
+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@
+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@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = -I at srcdir@/../headers @LIBXML2_CFLAGS@
+AM_LDFLAGS = -L../src -lrasterlite2 @LIBCAIRO_LIBS@ @LIBPNG_LIBS@ \
+ @LIBWEBP_LIBS@ @LIBLZMA_LIBS@ @LIBSPATIALITE_LIBS@ \
+ @LIBCURL_LIBS@ @LIBXML2_LIBS@ $(GCOV_FLAGS)
+
+TESTS = $(check_PROGRAMS)
+MOSTLYCLEANFILES = *.gcna *.gcno *.gcda
+EXTRA_DIST = jpeg1.jpg jpeg2.jpg png1.png mask1.png \
+ webp_no_alpha.webp gif1.gif mono3t.tif mono3s.tif \
+ mono4t.tif mono4s.tif gray-tiled.tif gray-striped.tif \
+ plt-tiled.tif plt-striped.tif rgb-tiled.tif \
+ rgb-striped.tif test_under_valgrind.sh \
+ asprintf4win.h fnmatch_impl4win.h \
+ fnmatch4win.h scandir4win.h \
+ map_samples/usgs-gray/gray1.tif \
+ map_samples/usgs-gray/gray2.tif \
+ map_samples/usgs-rgb/rgb1.tif \
+ map_samples/usgs-rgb/rgb2.tif \
+ map_samples/usgs-srtm/srtm1.tif \
+ map_samples/usgs-srtm/srtm2.tif \
+ map_samples/usgs-nile-8/nile1-int8.tif \
+ map_samples/usgs-nile-8/nile2-int8.tif \
+ map_samples/usgs-nile-u8/nile1-uint8.tif \
+ map_samples/usgs-nile-u8/nile2-uint8.tif \
+ map_samples/usgs-nile-u16/nile1-uint16.tif \
+ map_samples/usgs-nile-u16/nile2-uint16.tif \
+ map_samples/usgs-nile-32/nile1-int32.tif \
+ map_samples/usgs-nile-32/nile2-int32.tif \
+ map_samples/usgs-nile-u32/nile1-uint32.tif \
+ map_samples/usgs-nile-u32/nile2-uint32.tif \
+ map_samples/usgs-nile-flt/nile1-flt.tif \
+ map_samples/usgs-nile-flt/nile2-flt.tif \
+ map_samples/usgs-nile-dbl/nile1-dbl.tif \
+ map_samples/usgs-nile-dbl/nile2-dbl.tif \
+ map_samples/usgs-indiana/indiana1.tif \
+ map_samples/usgs-indiana/indiana2.tif \
+ map_samples/ctrt/cap1.tif \
+ map_samples/ctrt/cap2.tif \
+ map_samples/ascii/ascii1.asc \
+ map_samples/ascii/ascii2.asc \
+ map_samples/trento-rgb/trento-rgb1.jpg \
+ map_samples/trento-rgb/trento-rgb1.jgw \
+ map_samples/trento-rgb/trento-rgb2.jpg \
+ map_samples/trento-rgb/trento-rgb2.jgw \
+ map_samples/trento-gray/trento-gray1.jpg \
+ map_samples/trento-gray/trento-gray1.jgw \
+ map_samples/trento-gray/trento-gray2.jpg \
+ map_samples/trento-gray/trento-gray2.jgw \
+ map_samples/orbview3-trieste/trieste1.tif \
+ map_samples/orbview3-trieste/trieste2.tif \
+ map_samples/tuscany-infrared/infrared1.tif \
+ map_samples/tuscany-infrared/infrared2.tfw \
+ map_samples/tuscany-infrared/infrared2.tif \
+ map_samples/orbview3-orbetello/orbetello1.tif \
+ map_samples/orbview3-orbetello/orbetello2.tfw \
+ map_samples/orbview3-orbetello/orbetello2.tif \
+ raster_symbolizer_1.xml raster_symbolizer_2.xml \
+ raster_symbolizer_3.xml raster_symbolizer_4.xml \
+ raster_symbolizer_5.xml raster_symbolizer_6.xml \
+ srtm_categ.xml srtm_interp.xml srtm_brightness.xml \
+ srtm_relief_25.xml srtm_relief_75.xml ir_gray.xml \
+ ir_gray_gamma.xml ir_false_color1.xml \
+ ir_false_color2.xml ir_false_color1_gamma.xml \
+ ir_false_color2_gamma.xml rgb_histogram.xml \
+ rgb_normalize.xml gray_gamma.xml gray_histogram.xml \
+ gray_normalize.xml rgb_normalize2.xml \
+ rgb_histogram2.xml rgb_gamma.xml gray_normalize2.xml \
+ gray_histogram2.xml gray_gamma2.xml group_style_1.xml \
+ group_style_2.xml bicycle.svg car_repair.svg \
+ Car_Yellow.svg Circle_and_quadratic_bezier.svg \
+ Coat_of_arms_Holy_See.svg doctors.svg fastfood.svg \
+ Flag_of_the_United_Kingdom.svg Flag_of_the_United_States.svg \
+ hospital.svg jewelry.svg motorcycle.svg \
+ Negative_and_positive_skew_diagrams_(English).svg \
+ Netherlands_roundel.svg pharmacy.svg photo.svg restaurant.svg \
+ Roundel_of_the_Royal_Canadian_Air_Force_(1946-1965).svg \
+ Roundel_of_the_Syrian_Air_Force.svg \
+ Royal_Coat_of_Arms_of_the_United_Kingdom.svg \
+ supermarket.svg tobacco.svg
+
+SUBDIRS = sql_stmt_security_tests sql_stmt_tests
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
+$(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) --gnu test/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu test/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):
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+check_sql_stmt$(EXEEXT): $(check_sql_stmt_OBJECTS) $(check_sql_stmt_DEPENDENCIES) $(EXTRA_check_sql_stmt_DEPENDENCIES)
+ @rm -f check_sql_stmt$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(check_sql_stmt_OBJECTS) $(check_sql_stmt_LDADD) $(LIBS)
+
+test1$(EXEEXT): $(test1_OBJECTS) $(test1_DEPENDENCIES) $(EXTRA_test1_DEPENDENCIES)
+ @rm -f test1$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test1_OBJECTS) $(test1_LDADD) $(LIBS)
+
+test10$(EXEEXT): $(test10_OBJECTS) $(test10_DEPENDENCIES) $(EXTRA_test10_DEPENDENCIES)
+ @rm -f test10$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test10_OBJECTS) $(test10_LDADD) $(LIBS)
+
+test11$(EXEEXT): $(test11_OBJECTS) $(test11_DEPENDENCIES) $(EXTRA_test11_DEPENDENCIES)
+ @rm -f test11$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test11_OBJECTS) $(test11_LDADD) $(LIBS)
+
+test12$(EXEEXT): $(test12_OBJECTS) $(test12_DEPENDENCIES) $(EXTRA_test12_DEPENDENCIES)
+ @rm -f test12$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test12_OBJECTS) $(test12_LDADD) $(LIBS)
+
+test13$(EXEEXT): $(test13_OBJECTS) $(test13_DEPENDENCIES) $(EXTRA_test13_DEPENDENCIES)
+ @rm -f test13$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test13_OBJECTS) $(test13_LDADD) $(LIBS)
+
+test14$(EXEEXT): $(test14_OBJECTS) $(test14_DEPENDENCIES) $(EXTRA_test14_DEPENDENCIES)
+ @rm -f test14$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test14_OBJECTS) $(test14_LDADD) $(LIBS)
+
+test15$(EXEEXT): $(test15_OBJECTS) $(test15_DEPENDENCIES) $(EXTRA_test15_DEPENDENCIES)
+ @rm -f test15$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test15_OBJECTS) $(test15_LDADD) $(LIBS)
+
+test16$(EXEEXT): $(test16_OBJECTS) $(test16_DEPENDENCIES) $(EXTRA_test16_DEPENDENCIES)
+ @rm -f test16$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test16_OBJECTS) $(test16_LDADD) $(LIBS)
+
+test17$(EXEEXT): $(test17_OBJECTS) $(test17_DEPENDENCIES) $(EXTRA_test17_DEPENDENCIES)
+ @rm -f test17$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test17_OBJECTS) $(test17_LDADD) $(LIBS)
+
+test18$(EXEEXT): $(test18_OBJECTS) $(test18_DEPENDENCIES) $(EXTRA_test18_DEPENDENCIES)
+ @rm -f test18$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test18_OBJECTS) $(test18_LDADD) $(LIBS)
+
+test19$(EXEEXT): $(test19_OBJECTS) $(test19_DEPENDENCIES) $(EXTRA_test19_DEPENDENCIES)
+ @rm -f test19$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test19_OBJECTS) $(test19_LDADD) $(LIBS)
+
+test2$(EXEEXT): $(test2_OBJECTS) $(test2_DEPENDENCIES) $(EXTRA_test2_DEPENDENCIES)
+ @rm -f test2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test2_OBJECTS) $(test2_LDADD) $(LIBS)
+
+test20$(EXEEXT): $(test20_OBJECTS) $(test20_DEPENDENCIES) $(EXTRA_test20_DEPENDENCIES)
+ @rm -f test20$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test20_OBJECTS) $(test20_LDADD) $(LIBS)
+
+test3$(EXEEXT): $(test3_OBJECTS) $(test3_DEPENDENCIES) $(EXTRA_test3_DEPENDENCIES)
+ @rm -f test3$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test3_OBJECTS) $(test3_LDADD) $(LIBS)
+
+test4$(EXEEXT): $(test4_OBJECTS) $(test4_DEPENDENCIES) $(EXTRA_test4_DEPENDENCIES)
+ @rm -f test4$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test4_OBJECTS) $(test4_LDADD) $(LIBS)
+
+test5$(EXEEXT): $(test5_OBJECTS) $(test5_DEPENDENCIES) $(EXTRA_test5_DEPENDENCIES)
+ @rm -f test5$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test5_OBJECTS) $(test5_LDADD) $(LIBS)
+
+test6$(EXEEXT): $(test6_OBJECTS) $(test6_DEPENDENCIES) $(EXTRA_test6_DEPENDENCIES)
+ @rm -f test6$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test6_OBJECTS) $(test6_LDADD) $(LIBS)
+
+test7$(EXEEXT): $(test7_OBJECTS) $(test7_DEPENDENCIES) $(EXTRA_test7_DEPENDENCIES)
+ @rm -f test7$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test7_OBJECTS) $(test7_LDADD) $(LIBS)
+
+test8$(EXEEXT): $(test8_OBJECTS) $(test8_DEPENDENCIES) $(EXTRA_test8_DEPENDENCIES)
+ @rm -f test8$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test8_OBJECTS) $(test8_LDADD) $(LIBS)
+
+test9$(EXEEXT): $(test9_OBJECTS) $(test9_DEPENDENCIES) $(EXTRA_test9_DEPENDENCIES)
+ @rm -f test9$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test9_OBJECTS) $(test9_LDADD) $(LIBS)
+
+test_coverage$(EXEEXT): $(test_coverage_OBJECTS) $(test_coverage_DEPENDENCIES) $(EXTRA_test_coverage_DEPENDENCIES)
+ @rm -f test_coverage$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_coverage_OBJECTS) $(test_coverage_LDADD) $(LIBS)
+
+test_gif$(EXEEXT): $(test_gif_OBJECTS) $(test_gif_DEPENDENCIES) $(EXTRA_test_gif_DEPENDENCIES)
+ @rm -f test_gif$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_gif_OBJECTS) $(test_gif_LDADD) $(LIBS)
+
+test_load_wms$(EXEEXT): $(test_load_wms_OBJECTS) $(test_load_wms_DEPENDENCIES) $(EXTRA_test_load_wms_DEPENDENCIES)
+ @rm -f test_load_wms$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_load_wms_OBJECTS) $(test_load_wms_LDADD) $(LIBS)
+
+test_map_ascii$(EXEEXT): $(test_map_ascii_OBJECTS) $(test_map_ascii_DEPENDENCIES) $(EXTRA_test_map_ascii_DEPENDENCIES)
+ @rm -f test_map_ascii$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_ascii_OBJECTS) $(test_map_ascii_LDADD) $(LIBS)
+
+test_map_gray$(EXEEXT): $(test_map_gray_OBJECTS) $(test_map_gray_DEPENDENCIES) $(EXTRA_test_map_gray_DEPENDENCIES)
+ @rm -f test_map_gray$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_gray_OBJECTS) $(test_map_gray_LDADD) $(LIBS)
+
+test_map_indiana$(EXEEXT): $(test_map_indiana_OBJECTS) $(test_map_indiana_DEPENDENCIES) $(EXTRA_test_map_indiana_DEPENDENCIES)
+ @rm -f test_map_indiana$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_indiana_OBJECTS) $(test_map_indiana_LDADD) $(LIBS)
+
+test_map_infrared$(EXEEXT): $(test_map_infrared_OBJECTS) $(test_map_infrared_DEPENDENCIES) $(EXTRA_test_map_infrared_DEPENDENCIES)
+ @rm -f test_map_infrared$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_infrared_OBJECTS) $(test_map_infrared_LDADD) $(LIBS)
+
+test_map_mono$(EXEEXT): $(test_map_mono_OBJECTS) $(test_map_mono_DEPENDENCIES) $(EXTRA_test_map_mono_DEPENDENCIES)
+ @rm -f test_map_mono$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_mono_OBJECTS) $(test_map_mono_LDADD) $(LIBS)
+
+test_map_nile_32$(EXEEXT): $(test_map_nile_32_OBJECTS) $(test_map_nile_32_DEPENDENCIES) $(EXTRA_test_map_nile_32_DEPENDENCIES)
+ @rm -f test_map_nile_32$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_nile_32_OBJECTS) $(test_map_nile_32_LDADD) $(LIBS)
+
+test_map_nile_8$(EXEEXT): $(test_map_nile_8_OBJECTS) $(test_map_nile_8_DEPENDENCIES) $(EXTRA_test_map_nile_8_DEPENDENCIES)
+ @rm -f test_map_nile_8$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_nile_8_OBJECTS) $(test_map_nile_8_LDADD) $(LIBS)
+
+test_map_nile_dbl$(EXEEXT): $(test_map_nile_dbl_OBJECTS) $(test_map_nile_dbl_DEPENDENCIES) $(EXTRA_test_map_nile_dbl_DEPENDENCIES)
+ @rm -f test_map_nile_dbl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_nile_dbl_OBJECTS) $(test_map_nile_dbl_LDADD) $(LIBS)
+
+test_map_nile_flt$(EXEEXT): $(test_map_nile_flt_OBJECTS) $(test_map_nile_flt_DEPENDENCIES) $(EXTRA_test_map_nile_flt_DEPENDENCIES)
+ @rm -f test_map_nile_flt$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_nile_flt_OBJECTS) $(test_map_nile_flt_LDADD) $(LIBS)
+
+test_map_nile_u16$(EXEEXT): $(test_map_nile_u16_OBJECTS) $(test_map_nile_u16_DEPENDENCIES) $(EXTRA_test_map_nile_u16_DEPENDENCIES)
+ @rm -f test_map_nile_u16$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_nile_u16_OBJECTS) $(test_map_nile_u16_LDADD) $(LIBS)
+
+test_map_nile_u32$(EXEEXT): $(test_map_nile_u32_OBJECTS) $(test_map_nile_u32_DEPENDENCIES) $(EXTRA_test_map_nile_u32_DEPENDENCIES)
+ @rm -f test_map_nile_u32$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_nile_u32_OBJECTS) $(test_map_nile_u32_LDADD) $(LIBS)
+
+test_map_nile_u8$(EXEEXT): $(test_map_nile_u8_OBJECTS) $(test_map_nile_u8_DEPENDENCIES) $(EXTRA_test_map_nile_u8_DEPENDENCIES)
+ @rm -f test_map_nile_u8$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_nile_u8_OBJECTS) $(test_map_nile_u8_LDADD) $(LIBS)
+
+test_map_noref$(EXEEXT): $(test_map_noref_OBJECTS) $(test_map_noref_DEPENDENCIES) $(EXTRA_test_map_noref_DEPENDENCIES)
+ @rm -f test_map_noref$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_noref_OBJECTS) $(test_map_noref_LDADD) $(LIBS)
+
+test_map_orbetello$(EXEEXT): $(test_map_orbetello_OBJECTS) $(test_map_orbetello_DEPENDENCIES) $(EXTRA_test_map_orbetello_DEPENDENCIES)
+ @rm -f test_map_orbetello$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_orbetello_OBJECTS) $(test_map_orbetello_LDADD) $(LIBS)
+
+test_map_rgb$(EXEEXT): $(test_map_rgb_OBJECTS) $(test_map_rgb_DEPENDENCIES) $(EXTRA_test_map_rgb_DEPENDENCIES)
+ @rm -f test_map_rgb$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_rgb_OBJECTS) $(test_map_rgb_LDADD) $(LIBS)
+
+test_map_srtm$(EXEEXT): $(test_map_srtm_OBJECTS) $(test_map_srtm_DEPENDENCIES) $(EXTRA_test_map_srtm_DEPENDENCIES)
+ @rm -f test_map_srtm$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_srtm_OBJECTS) $(test_map_srtm_LDADD) $(LIBS)
+
+test_map_trento$(EXEEXT): $(test_map_trento_OBJECTS) $(test_map_trento_DEPENDENCIES) $(EXTRA_test_map_trento_DEPENDENCIES)
+ @rm -f test_map_trento$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_trento_OBJECTS) $(test_map_trento_LDADD) $(LIBS)
+
+test_map_trieste$(EXEEXT): $(test_map_trieste_OBJECTS) $(test_map_trieste_DEPENDENCIES) $(EXTRA_test_map_trieste_DEPENDENCIES)
+ @rm -f test_map_trieste$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_map_trieste_OBJECTS) $(test_map_trieste_LDADD) $(LIBS)
+
+test_mask$(EXEEXT): $(test_mask_OBJECTS) $(test_mask_DEPENDENCIES) $(EXTRA_test_mask_DEPENDENCIES)
+ @rm -f test_mask$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_mask_OBJECTS) $(test_mask_LDADD) $(LIBS)
+
+test_paint$(EXEEXT): $(test_paint_OBJECTS) $(test_paint_DEPENDENCIES) $(EXTRA_test_paint_DEPENDENCIES)
+ @rm -f test_paint$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_paint_OBJECTS) $(test_paint_LDADD) $(LIBS)
+
+test_palette$(EXEEXT): $(test_palette_OBJECTS) $(test_palette_DEPENDENCIES) $(EXTRA_test_palette_DEPENDENCIES)
+ @rm -f test_palette$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_palette_OBJECTS) $(test_palette_LDADD) $(LIBS)
+
+test_raster$(EXEEXT): $(test_raster_OBJECTS) $(test_raster_DEPENDENCIES) $(EXTRA_test_raster_DEPENDENCIES)
+ @rm -f test_raster$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_raster_OBJECTS) $(test_raster_LDADD) $(LIBS)
+
+test_raster_symbolizer$(EXEEXT): $(test_raster_symbolizer_OBJECTS) $(test_raster_symbolizer_DEPENDENCIES) $(EXTRA_test_raster_symbolizer_DEPENDENCIES)
+ @rm -f test_raster_symbolizer$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_raster_symbolizer_OBJECTS) $(test_raster_symbolizer_LDADD) $(LIBS)
+
+test_section$(EXEEXT): $(test_section_OBJECTS) $(test_section_DEPENDENCIES) $(EXTRA_test_section_DEPENDENCIES)
+ @rm -f test_section$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_section_OBJECTS) $(test_section_LDADD) $(LIBS)
+
+test_svg$(EXEEXT): $(test_svg_OBJECTS) $(test_svg_DEPENDENCIES) $(EXTRA_test_svg_DEPENDENCIES)
+ @rm -f test_svg$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_svg_OBJECTS) $(test_svg_LDADD) $(LIBS)
+
+test_tifin$(EXEEXT): $(test_tifin_OBJECTS) $(test_tifin_DEPENDENCIES) $(EXTRA_test_tifin_DEPENDENCIES)
+ @rm -f test_tifin$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_tifin_OBJECTS) $(test_tifin_LDADD) $(LIBS)
+
+test_webp$(EXEEXT): $(test_webp_OBJECTS) $(test_webp_DEPENDENCIES) $(EXTRA_test_webp_DEPENDENCIES)
+ @rm -f test_webp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_webp_OBJECTS) $(test_webp_LDADD) $(LIBS)
+
+test_wms1$(EXEEXT): $(test_wms1_OBJECTS) $(test_wms1_DEPENDENCIES) $(EXTRA_test_wms1_DEPENDENCIES)
+ @rm -f test_wms1$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_wms1_OBJECTS) $(test_wms1_LDADD) $(LIBS)
+
+test_wms2$(EXEEXT): $(test_wms2_OBJECTS) $(test_wms2_DEPENDENCIES) $(EXTRA_test_wms2_DEPENDENCIES)
+ @rm -f test_wms2$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_wms2_OBJECTS) $(test_wms2_LDADD) $(LIBS)
+
+test_wr_tiff$(EXEEXT): $(test_wr_tiff_OBJECTS) $(test_wr_tiff_DEPENDENCIES) $(EXTRA_test_wr_tiff_DEPENDENCIES)
+ @rm -f test_wr_tiff$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_wr_tiff_OBJECTS) $(test_wr_tiff_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/check_sql_stmt.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test10.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test11.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test12.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test13.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test14.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test15.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test17.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test18.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test19.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test20.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test3.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test4.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test5.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test6.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test7.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test9.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_coverage.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_gif.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_load_wms.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_ascii.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_gray.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_indiana.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_infrared.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_mono.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_nile_32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_nile_8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_nile_dbl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_nile_flt.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_nile_u16.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_nile_u32.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_nile_u8.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_noref.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_orbetello.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_rgb.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_srtm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_trento.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_map_trieste.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_mask.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_paint.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_palette.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_raster.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_raster_symbolizer.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_section.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_svg.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_tifin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_webp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_wms1.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_wms2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_wr_tiff.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(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-recursive
+
+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-recursive
+
+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
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ else \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all $(check_PROGRAMS)
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+test_coverage.log: test_coverage$(EXEEXT)
+ @p='test_coverage$(EXEEXT)'; \
+ b='test_coverage'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_palette.log: test_palette$(EXEEXT)
+ @p='test_palette$(EXEEXT)'; \
+ b='test_palette'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_section.log: test_section$(EXEEXT)
+ @p='test_section$(EXEEXT)'; \
+ b='test_section'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_raster.log: test_raster$(EXEEXT)
+ @p='test_raster$(EXEEXT)'; \
+ b='test_raster'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_mask.log: test_mask$(EXEEXT)
+ @p='test_mask$(EXEEXT)'; \
+ b='test_mask'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_webp.log: test_webp$(EXEEXT)
+ @p='test_webp$(EXEEXT)'; \
+ b='test_webp'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_gif.log: test_gif$(EXEEXT)
+ @p='test_gif$(EXEEXT)'; \
+ b='test_gif'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test1.log: test1$(EXEEXT)
+ @p='test1$(EXEEXT)'; \
+ b='test1'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test2.log: test2$(EXEEXT)
+ @p='test2$(EXEEXT)'; \
+ b='test2'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test3.log: test3$(EXEEXT)
+ @p='test3$(EXEEXT)'; \
+ b='test3'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test4.log: test4$(EXEEXT)
+ @p='test4$(EXEEXT)'; \
+ b='test4'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test5.log: test5$(EXEEXT)
+ @p='test5$(EXEEXT)'; \
+ b='test5'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test6.log: test6$(EXEEXT)
+ @p='test6$(EXEEXT)'; \
+ b='test6'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test7.log: test7$(EXEEXT)
+ @p='test7$(EXEEXT)'; \
+ b='test7'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test8.log: test8$(EXEEXT)
+ @p='test8$(EXEEXT)'; \
+ b='test8'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test9.log: test9$(EXEEXT)
+ @p='test9$(EXEEXT)'; \
+ b='test9'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test10.log: test10$(EXEEXT)
+ @p='test10$(EXEEXT)'; \
+ b='test10'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test11.log: test11$(EXEEXT)
+ @p='test11$(EXEEXT)'; \
+ b='test11'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test12.log: test12$(EXEEXT)
+ @p='test12$(EXEEXT)'; \
+ b='test12'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test13.log: test13$(EXEEXT)
+ @p='test13$(EXEEXT)'; \
+ b='test13'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test14.log: test14$(EXEEXT)
+ @p='test14$(EXEEXT)'; \
+ b='test14'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test15.log: test15$(EXEEXT)
+ @p='test15$(EXEEXT)'; \
+ b='test15'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test16.log: test16$(EXEEXT)
+ @p='test16$(EXEEXT)'; \
+ b='test16'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test17.log: test17$(EXEEXT)
+ @p='test17$(EXEEXT)'; \
+ b='test17'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test18.log: test18$(EXEEXT)
+ @p='test18$(EXEEXT)'; \
+ b='test18'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test19.log: test19$(EXEEXT)
+ @p='test19$(EXEEXT)'; \
+ b='test19'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test20.log: test20$(EXEEXT)
+ @p='test20$(EXEEXT)'; \
+ b='test20'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_tifin.log: test_tifin$(EXEEXT)
+ @p='test_tifin$(EXEEXT)'; \
+ b='test_tifin'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_wr_tiff.log: test_wr_tiff$(EXEEXT)
+ @p='test_wr_tiff$(EXEEXT)'; \
+ b='test_wr_tiff'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_wms1.log: test_wms1$(EXEEXT)
+ @p='test_wms1$(EXEEXT)'; \
+ b='test_wms1'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_wms2.log: test_wms2$(EXEEXT)
+ @p='test_wms2$(EXEEXT)'; \
+ b='test_wms2'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_paint.log: test_paint$(EXEEXT)
+ @p='test_paint$(EXEEXT)'; \
+ b='test_paint'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+check_sql_stmt.log: check_sql_stmt$(EXEEXT)
+ @p='check_sql_stmt$(EXEEXT)'; \
+ b='check_sql_stmt'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_nile_8.log: test_map_nile_8$(EXEEXT)
+ @p='test_map_nile_8$(EXEEXT)'; \
+ b='test_map_nile_8'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_nile_u8.log: test_map_nile_u8$(EXEEXT)
+ @p='test_map_nile_u8$(EXEEXT)'; \
+ b='test_map_nile_u8'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_nile_u16.log: test_map_nile_u16$(EXEEXT)
+ @p='test_map_nile_u16$(EXEEXT)'; \
+ b='test_map_nile_u16'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_nile_32.log: test_map_nile_32$(EXEEXT)
+ @p='test_map_nile_32$(EXEEXT)'; \
+ b='test_map_nile_32'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_nile_u32.log: test_map_nile_u32$(EXEEXT)
+ @p='test_map_nile_u32$(EXEEXT)'; \
+ b='test_map_nile_u32'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_nile_flt.log: test_map_nile_flt$(EXEEXT)
+ @p='test_map_nile_flt$(EXEEXT)'; \
+ b='test_map_nile_flt'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_nile_dbl.log: test_map_nile_dbl$(EXEEXT)
+ @p='test_map_nile_dbl$(EXEEXT)'; \
+ b='test_map_nile_dbl'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_ascii.log: test_map_ascii$(EXEEXT)
+ @p='test_map_ascii$(EXEEXT)'; \
+ b='test_map_ascii'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_rgb.log: test_map_rgb$(EXEEXT)
+ @p='test_map_rgb$(EXEEXT)'; \
+ b='test_map_rgb'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_gray.log: test_map_gray$(EXEEXT)
+ @p='test_map_gray$(EXEEXT)'; \
+ b='test_map_gray'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_srtm.log: test_map_srtm$(EXEEXT)
+ @p='test_map_srtm$(EXEEXT)'; \
+ b='test_map_srtm'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_mono.log: test_map_mono$(EXEEXT)
+ @p='test_map_mono$(EXEEXT)'; \
+ b='test_map_mono'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_indiana.log: test_map_indiana$(EXEEXT)
+ @p='test_map_indiana$(EXEEXT)'; \
+ b='test_map_indiana'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_load_wms.log: test_load_wms$(EXEEXT)
+ @p='test_load_wms$(EXEEXT)'; \
+ b='test_load_wms'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_noref.log: test_map_noref$(EXEEXT)
+ @p='test_map_noref$(EXEEXT)'; \
+ b='test_map_noref'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_trento.log: test_map_trento$(EXEEXT)
+ @p='test_map_trento$(EXEEXT)'; \
+ b='test_map_trento'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_trieste.log: test_map_trieste$(EXEEXT)
+ @p='test_map_trieste$(EXEEXT)'; \
+ b='test_map_trieste'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_infrared.log: test_map_infrared$(EXEEXT)
+ @p='test_map_infrared$(EXEEXT)'; \
+ b='test_map_infrared'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_map_orbetello.log: test_map_orbetello$(EXEEXT)
+ @p='test_map_orbetello$(EXEEXT)'; \
+ b='test_map_orbetello'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_raster_symbolizer.log: test_raster_symbolizer$(EXEEXT)
+ @p='test_raster_symbolizer$(EXEEXT)'; \
+ b='test_raster_symbolizer'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+test_svg.log: test_svg$(EXEEXT)
+ @p='test_svg$(EXEEXT)'; \
+ b='test_svg'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+ at am__EXEEXT_TRUE@.test$(EXEEXT).log:
+ at am__EXEEXT_TRUE@ @p='$<'; \
+ at am__EXEEXT_TRUE@ $(am__set_b); \
+ at am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ at am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+ at am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ at am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+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
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+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:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+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)
+
+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-recursive
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) check-am install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+ check-TESTS check-am clean clean-checkPROGRAMS clean-generic \
+ clean-libtool cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic 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-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \
+ uninstall uninstall-am
+
+
+# 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:
diff --git a/test/Negative_and_positive_skew_diagrams_(English).svg b/test/Negative_and_positive_skew_diagrams_(English).svg
new file mode 100644
index 0000000..2b88f17
--- /dev/null
+++ b/test/Negative_and_positive_skew_diagrams_(English).svg
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="445.646"
+ height="158.54199"
+ viewBox="0 0 445.646 158.54199"
+ id="svg2583"
+ xml:space="preserve"
+ style="overflow:visible"><defs
+ id="defs2655">
+
+
+
+
+
+
+
+
+
+
+ </defs>
+ <style
+ type="text/css"
+ id="style2585" />
+
+ <g
+ transform="translate(-226,0)"
+ id="g2590"
+ style="opacity:0.05">
+ <g
+ id="g2592">
+ <path
+ d="M 385.81885,18.89307 C 352.96045,18.41065 325.32471,122.95703 251.23487,122.73828 L 345.23487,122.73828 C 360.84424,122.73828 365.00635,18.89307 385.81885,18.89307 z"
+ id="path2594"
+ style="fill:#919bc9" />
+ </g>
+ </g><g
+ transform="translate(234,0)"
+ id="g2596"
+ style="opacity:0.05">
+ <g
+ id="g2598">
+ <path
+ d="M 52.20752,18.89355 C 73.02002,18.89355 77.18213,122.73925 92.7915,122.73925 L 186.7915,122.73925 C 112.70166,122.95801 85.06543,18.41113 52.20752,18.89355 z"
+ id="path2600"
+ style="fill:#919bc9" />
+ </g>
+ </g><g
+ transform="translate(234,0)"
+ id="g2602">
+ <g
+ id="g2604">
+ <g
+ id="g2606">
+ <line
+ id="line2608"
+ y2="131.03516"
+ x2="5"
+ y1="6.0351601"
+ x1="5"
+ style="fill:none;stroke:#000000" />
+ <path
+ d="M 5,0 C 6.05371,2.83984 7.85156,6.36328 9.75488,8.54688 L 5,6.82715 L 0.24512,8.54688 C 2.14844,6.36328 3.94678,2.83984 5,0 z"
+ id="path2610" />
+ </g>
+ </g>
+ <g
+ id="g2612">
+ <g
+ id="g2614">
+ <line
+ id="line2616"
+ y2="126.03516"
+ x2="200"
+ y1="126.03516"
+ x1="0"
+ style="fill:none;stroke:#000000" />
+ <path
+ d="M 206.03516,126.03516 C 203.19532,127.08887 199.67188,128.88672 197.48828,130.79004 L 199.20801,126.03516 L 197.48828,121.28028 C 199.67188,123.18359 203.19531,124.98242 206.03516,126.03516 z"
+ id="path2618" />
+ </g>
+ </g>
+ </g><path
+ d="M 326.7915,122.73926 C 311.18212,122.73926 307.02002,18.89258 286.20752,18.89258 C 265.39502,18.89258 261.23291,122.73926 245.62354,122.73926"
+ id="path2620"
+ style="opacity:0.5;fill:none;stroke:#919bc9;stroke-width:1;stroke-dasharray:5, 5" /><path
+ d="M 420.7915,122.73926 C 346.70166,122.95703 319.06543,18.41162 286.20752,18.89258 C 265.39746,19.19727 261.23291,122.73926 245.62354,122.73926"
+ id="path2622"
+ style="fill:none;stroke:#ff0000;stroke-width:1" /><g
+ transform="translate(-226,0)"
+ id="g2624">
+ <g
+ id="g2626">
+ <g
+ id="g2628">
+ <line
+ id="line2630"
+ y2="131.03516"
+ x2="244.61084"
+ y1="6.0351601"
+ x1="244.61084"
+ style="fill:none;stroke:#000000" />
+ <path
+ d="M 244.61084,0 C 245.66455,2.83984 247.4624,6.36328 249.36572,8.54688 L 244.61084,6.82715 L 239.85596,8.54688 C 241.75928,6.36328 243.55713,2.83984 244.61084,0 z"
+ id="path2632" />
+ </g>
+ </g>
+ <g
+ id="g2634">
+ <g
+ id="g2636">
+ <line
+ id="line2638"
+ y2="126.03516"
+ x2="439.61084"
+ y1="126.03516"
+ x1="239.61084"
+ style="fill:none;stroke:#000000" />
+ <path
+ d="M 445.646,126.03516 C 442.80616,127.08887 439.28272,128.88672 437.09912,130.79004 L 438.81885,126.03516 L 437.09912,121.28028 C 439.28271,123.18359 442.80615,124.98242 445.646,126.03516 z"
+ id="path2640" />
+ </g>
+ </g>
+ </g><path
+ d="M 119.23486,122.73926 C 134.84424,122.73926 139.00634,18.89258 159.81884,18.89258 C 180.63134,18.89258 184.79345,122.73926 200.40282,122.73926"
+ id="path2642"
+ style="opacity:0.5;fill:none;stroke:#919bc9;stroke-width:1;stroke-dasharray:5, 5" /><path
+ d="M 25.23486,122.73926 C 99.3247,122.95703 126.96142,18.41162 159.81884,18.89258 C 180.62939,19.19727 184.79345,122.73926 200.40282,122.73926"
+ id="path2644"
+ style="fill:none;stroke:#ff0000;stroke-width:1" /><text
+ x="283.6499"
+ y="154.64551"
+ id="text2646"
+ style="font-size:12px"><tspan
+ x="283.6499"
+ y="154.64551"
+ id="tspan2648"
+ style="font-size:12px;font-family:ArialMT">Positive Skew</tspan></text>
+<text
+ x="79.103973"
+ y="154.64551"
+ id="text2650"
+ style="font-size:12px"><tspan
+ x="79.103973"
+ y="154.64551"
+ id="tspan2652"
+ style="font-size:12px;font-family:ArialMT">Negative Skew</tspan></text>
+
+ </svg>
\ No newline at end of file
diff --git a/test/Netherlands_roundel.svg b/test/Netherlands_roundel.svg
new file mode 100644
index 0000000..ba1adcb
--- /dev/null
+++ b/test/Netherlands_roundel.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="600" viewBox="-60,-60 120,120">
+ <circle r="60" fill="#fff"/>
+ <g fill="#21468b">
+ <use xlink:href="#q" transform="rotate(-40)"/>
+ <use xlink:href="#q" transform="rotate(-120)"/>
+ </g>
+ <g fill="#ae1c28">
+ <path id="q" d="M 0,0 V -60 A 60 60 0 0 1 60,0 z"/>
+ <use xlink:href="#q" transform="rotate(30)"/>
+ </g>
+ <circle r="13" fill="#f7660d"/>
+</svg>
\ No newline at end of file
diff --git a/test/Roundel_of_the_Royal_Canadian_Air_Force_(1946-1965).svg b/test/Roundel_of_the_Royal_Canadian_Air_Force_(1946-1965).svg
new file mode 100644
index 0000000..7577755
--- /dev/null
+++ b/test/Roundel_of_the_Royal_Canadian_Air_Force_(1946-1965).svg
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ sodipodi:docname="Roundel_of_the_Royal_Canadian_Air_Force_(1946-1965).svg"
+ y="0.00000000"
+ x="0.00000000"
+ version="1.0"
+ inkscape:version="0.47 r22583"
+ sodipodi:version="0.32"
+ id="svg1476"
+ height="600"
+ width="600"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs3">
+ <inkscape:perspective
+ inkscape:persp3d-origin="300 : 400 : 1"
+ inkscape:vp_z="700 : 600 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="-50 : 600 : 1"
+ id="perspective2952"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ inkscape:persp3d-origin="300 : 400 : 1"
+ inkscape:vp_z="700 : 600 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="-50 : 600 : 1"
+ id="perspective2969"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <sodipodi:namedview
+ inkscape:window-y="-8"
+ inkscape:window-x="-8"
+ inkscape:window-height="1004"
+ inkscape:window-width="1280"
+ inkscape:current-layer="layer1"
+ inkscape:document-units="px"
+ inkscape:cy="190.48421"
+ inkscape:cx="-198.67195"
+ inkscape:zoom="0.35"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:showpageshadow="false"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata4">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:groupmode="layer"
+ inkscape:label="Layer 1"
+ transform="translate(4.7e-5,300.00003)">
+ <circle
+ id="circle1321"
+ style="fill:#00005b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-opacity:1"
+ r="27.5"
+ cy="36"
+ cx="108"
+ sodipodi:cx="108"
+ sodipodi:cy="36"
+ sodipodi:rx="27.5"
+ sodipodi:ry="27.5"
+ transform="matrix(10.909091,0,0,10.909091,-878.18187,-392.7273)"
+ d="M 135.5,36 C 135.5,51.187831 123.18783,63.5 108,63.5 92.812169,63.5 80.5,51.187831 80.5,36 80.5,20.812169 92.812169,8.5 108,8.5 c 15.18783,0 27.5,12.312169 27.5,27.5 z" />
+ <circle
+ id="circle1323"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-opacity:1"
+ r="16.5"
+ cy="36"
+ cx="108"
+ sodipodi:cx="108"
+ sodipodi:cy="36"
+ sodipodi:rx="16.5"
+ sodipodi:ry="16.5"
+ transform="matrix(12.121211,0,0,12.121211,-1009.0907,-436.3635)"
+ d="m 124.5,36 c 0,9.112698 -7.3873,16.5 -16.5,16.5 -9.112698,0 -16.5,-7.387302 -16.5,-16.5 0,-9.112698 7.387302,-16.5 16.5,-16.5 9.1127,0 16.5,7.387302 16.5,16.5 z" />
+ <path
+ style="fill:#c80c02;fill-opacity:1"
+ d="M 287.10028,177.71375 C 286.51039,177.46342 285.5693,177.11147 285.00896,176.93166 C 284.01966,176.61425 284.0218,176.57022 285.08264,175.41216 C 286.35557,174.02254 289.72955,160.06468 291.73812,148.75363 C 292.49758,144.47692 292.62802,139.77121 292.90103,138.29648 C 293.17404,136.82176 293.55538,134.16725 293.74854,132.39758 C 293.94166,130.62791 294.41419,127.73208 294.79858,125.96241 C 295.18298,124.19274 295.66153,119.69946 295.86204,115.97735 L 296.22659,109.20986 L 294. [...]
+ id="path2960"
+ sodipodi:nodetypes="csssssscccsssssssssssssssssssssssssscccsssssssssssssssssssssssssscccssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssscccssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssscccsscccccssssssssc" />
+ </g>
+</svg>
diff --git a/test/Roundel_of_the_Syrian_Air_Force.svg b/test/Roundel_of_the_Syrian_Air_Force.svg
new file mode 100644
index 0000000..520c38e
--- /dev/null
+++ b/test/Roundel_of_the_Syrian_Air_Force.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="600" version="1.1">
+ <g transform="translate(300,300)">
+ <circle r="300" fill="#ce1126"/>
+ <circle r="200" fill="#fff"/>
+ <circle r="100" fill="#000"/>
+ <path id="a" fill="#009e60" d="M 150,-45 L 160.103,-13.906 192.798,-13.906 L 166.347,5.312 176.45,36.406 L 150,17.188 123.55,36.406 L 133.653,5.312 107.202,-13.906 L 139.897,-13.906 z" />
+ <use xlink:href="#a" transform="scale(-1,1)"/>
+ </g>
+</svg>
diff --git a/test/Royal_Coat_of_Arms_of_the_United_Kingdom.svg b/test/Royal_Coat_of_Arms_of_the_United_Kingdom.svg
new file mode 100644
index 0000000..942e55e
--- /dev/null
+++ b/test/Royal_Coat_of_Arms_of_the_United_Kingdom.svg
@@ -0,0 +1,3909 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg id="svg2" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="1500" width="1550" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata id="metadata7">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <dc:title/>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g id="layer1" transform="translate(148.6 692.44)">
+ <g id="g12394">
+ <g id="g12274" transform="matrix(1 0 0 .99960 -127.77 -683.43)">
+ <path id="path12245" d="m1178.4 1204.9c-21.191 0-38.25 17.151-38.25 38.281 0 21.131 17.057 38.25 38.25 38.25s38.25-17.119 38.25-38.25c0-21.13-17.059-38.281-38.25-38.281zm0 16.5c12.457 0 21.781 9.788 21.781 21.781-0.0001 11.994-9.3078 21.75-21.781 21.75-12.474 0.0001-21.75-9.7565-21.75-21.75 0.0001-11.993 9.2928-21.781 21.75-21.781z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12186" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1178.4 1208.4c-18.968 0-34.179 15.6-34.179 34.759 0 19.158 15.209 34.728 34.179 34.728s34.179-15.57 34.179-34.728c0-19.16-15.212-34.759-34.179-34.759zm0 9.177c14.416 0 25.401 11.473 25.401 25.582 0 14.111-10.97 25.551-25.401 25.551-14.432 0-25.401-11.44-25.401-25.551 0-14.109 10.985-25.582 25.401-25.582z" fill="#ffefa7"/>
+ </g>
+ <g id="g37218" transform="translate(-126.46 -681.95)">
+ <g id="g36663-6" transform="matrix(-1 0 0 1 1601.7 -810.58)" fill="#488121">
+ <path id="path36404-8-3-2" d="m796.47 1969c1.5363-7.6401-3.0025-13.39-6.0958-19.589 17.944 0.9024 19.836 6.8 28.066 10.725 2.9052-9.147-0.8727-16.62-2.6957-24.296 12.097 4.2085 16.787 11.127 22.424 17.346 2.9018-7.6921 4.8421-15.831 7.1195-25.323 7.8625 6.3368 10.216 16.01 12.371 24.122 1.8947-8.3571 9.125-13.261 17.732-17.274-0.59068 6.196-1.7642 13.594-1.4359 22.743 6.9513-5.8879 13.897-11.794 22.644-11.911-0.99954 7.1604-3.5989 11.146-2.3834 23.689 2.6706-4.7241 5.1331-9.4103 10. [...]
+ </g>
+ <path id="path37127" d="m754.12 1127c-2.7349 4.6328-4.2988 10.1-5.75 15.562a4.5266 4.5266 0 0 1 -8.7812 -0.1563c-0.94057-4.1486-3.8141-7.2923-7.9062-10.062 0.42387 4.3401 0.76289 9.1035 0.5625 14.687a4.5266 4.5266 0 0 1 -7.4688 3.3126c-4.8894-4.1415-9.3411-7.6789-13.906-9.5 0.99744 4.3936 1.9199 9.4025 1.0625 18.25a4.5266 4.5266 0 0 1 -8.4375 1.7812c-1.5641-2.7668-2.9035-5.069-4.5625-7.0625-2.5102 5.3224-6.606 9.2758-11.125 11.906a4.5266 4.5266 0 0 1 -6.5938 -2.5626c-1.7934-5.718-0.6 [...]
+ <path id="path37127-2" d="m753.41 1147.6c-1.5847 2.3949-4.1176 4.1435-6.9188 4.7762s-5.8397 0.1426-8.3-1.3387c-1.3238 3.2994-4.2973 5.8879-7.7477 6.7444-3.4503 0.8565-7.2892-0.041-10.002-2.3381-0.61946-0.5247-1.0076-0.7358-1.5938-1.2188-0.0325 1.7885 0.0144 3.4163-0.1875 5.5-0.44067 4.4469-3.7805 8.4666-8.0714 9.7145s-9.2656-0.3537-12.022-3.8707c-2.3334 2.3677-4.8235 4.4835-7.375 5.9687-2.9126 1.6867-6.5969 1.9716-9.7341 0.7525-3.1372-1.219-5.6626-3.9167-6.6721-7.1275-0.43904-1.3999- [...]
+ <path id="path37127-2-4" d="m752.59 1161.2c-3.2568 1.4168-6.8668 2.013-10.406 1.7187-4.1878 3.7757-9.8996 5.8099-15.531 5.5313-2.4498 4.8032-6.7649 8.6242-11.829 10.475-5.0644 1.8504-10.826 1.7114-15.796-0.381-0.88032 0.6119-1.7592 1.4336-2.625 1.9376-4.3158 2.5172-9.5222 3.4703-14.45 2.6453-4.9277-0.8251-9.5396-3.4221-12.8-7.2079-7.1547 2.2277-15.429 0.3903-20.969-4.6562-4.8365 1.3512-10.144 0.9456-14.719-1.125-3.0884 1.7418-6.6113 2.7065-10.156 2.7812-4.0646 4.5197-10.109 7.1919-16 [...]
+ <path id="path37127-2-4-2" d="m751.69 1176.3c-1.5553 0.3336-3.1329 0.5634-4.7188 0.6874-3.7688 2.3985-7.9903 4.0828-12.375 4.9376-8.0309 9.3158-21.099 14-33.219 11.906-5.7386 2.8303-12.246 4.083-18.625 3.5856-6.3792-0.4975-12.613-2.7437-17.844-6.4294-7.0396 0.4297-14.196-1.2793-20.281-4.8437-3.5088 0.2139-7.0489-0.093-10.469-0.9063-1.5232 0.4995-3.0799 0.8965-4.6562 1.1876-3.9172 3.119-8.4959 5.403-13.344 6.6562-5.7065 8.0868-14.901 13.62-24.719 14.875-8.5609 5.7923-19.697 7.6112-29. [...]
+ <path id="path37127-2-4-2-6" d="m751 1190.2c-2.9535 1.5817-6.0687 2.8614-9.2812 3.8125-10.071 9.72-24.428 14.829-38.375 13.656-13.612 5.2717-29.572 4.0795-42.25-3.1563-6.8469-0.2251-13.643-1.8973-19.812-4.875-2.1224-0.03-4.2429-0.197-6.3438-0.5-3.3468 2.288-6.9771 4.1609-10.781 5.5625-7.1774 8.2948-17.197 14.083-27.969 16.156-9.8699 5.7719-21.787 7.957-33.062 6.0626-9.37 3.4589-19.801 3.9788-29.469 1.4687-2.0851 0.3854-4.1951 0.6361-6.3125 0.75-2.1787 2.2187-4.5679 4.2306-7.125 6-0.5 [...]
+ </g>
+ <g id="g22948" transform="translate(-133.85 -681.95)">
+ <path id="path22032-9-8-4" d="m292.63 1413.6-9.0963 3.6426c-3.2103 7.3279 0.3698 13.494 7.7324 15.558-6.4787-7.5923-5.1149-12.9 1.3638-19.201z" stroke="#2d5016" fill="#447821"/>
+ <path id="path22032-9-8" d="m563.06 1336.8-9.7935 0.3135c-5.8811-5.4238-5.0761-12.508 0.83944-17.353-2.8875 9.554 0.49169 13.869 8.954 17.04z" stroke="#2d5016" fill="#447821"/>
+ <path id="path22032-9-1" d="m564.92 1345.2-7.0211-10.812c-10.086-2.5547-16.89 3.2869-17.519 13.084 7.825-9.8267 14.873-9.1998 24.54-2.2725z" stroke="#2d5016" fill="#447821"/>
+ <path id="path22032-9" d="m592.6 1371.7-6.6494-11.044c-9.9928-2.8961-16.992 2.7107-17.953 12.481 8.1545-9.555 15.178-8.6888 24.603-1.4369z" stroke="#2d5016" fill="#447821"/>
+ <path id="path22032" d="m590.99 1360.9-10.873-6.9259c-2.6431-10.063 3.1385-16.918 12.93-17.633-9.7577 7.9109-9.069 14.954-2.0571 24.559z" stroke="#2d5016" fill="#447821"/>
+ <g id="g19007" transform="translate(211.14 648.81)">
+ <g id="g18697" transform="matrix(.69536 .71866 -.71866 .69536 1345 -337.25)">
+ <path id="path18520" d="m50.536 1419.7c0.56702-2.549 0.12353-7.4607-0.89151-12.778l-1.1887 1.3373c-0.2199-4.2555-0.45998-8.4958-2.2288-11.59l-1.6344 1.783c-0.23147-3.4603-1.3539-6.7424-3.566-9.8066l-0.8915 2.5259c-1.0488-2.5638-1.4465-5.9958-3.566-7.132l-1.1887 1.783s-0.86437-3.9075-1.783-5.7948c-0.64339-1.3218-1.9982-2.558-2.6745-3.8632-0.66436-1.2821-1.6344-4.0118-1.6344-4.0118s-2.6447 6.8008-2.8231 9.9551c-0.0902 1.5947 1.1887 4.0118 1.1887 4.0118l-2.526-1.4858c-1.2328 2.2783-0. [...]
+ <path id="path18522" d="m48.753 1421.2s-7.0086-2.8514-12.633-7.8886c-4.3899-3.9317-7.0262-8.9165-8.3175-12.616-1.5416-4.4166-0.24268-8.7705 1.0809-13.079 0.78047-2.5408 0.006-4.681-0.18082-6.7239-0.19928-2.1817 0.74123-4.9327 0.28862-5.159 0 0 0.85225 5.3768 2.7098 8.0934 1.5863 2.3199 3.6643 2.8854 5.7018 5.5836 2.665 3.5292 5.2606 8.0397 6.5954 11.137 2.8976 6.7224 4.7547 20.653 4.7547 20.653z" fill="#4b8820"/>
+ <path id="path18552" d="m543.94 1349.5c-0.0501 0.7137-0.19516 1.4611-0.4375 2.25-1.3195 4.2955-2.3676 8.1359-1.0625 11.875 1.2015 3.4425 3.7073 8.195 7.7812 11.844 3.1852 2.8527 6.355 4.6819 8.8125 5.9374-0.64949-4.0861-1.9444-11.835-3.9688-16.531-1.2469-2.8929-3.8244-7.3724-6.375-10.75-0.86636-1.1473-1.7128-1.8007-2.6875-2.5625-0.65306-0.5104-1.3602-1.3178-2.0625-2.0625z" transform="translate(-512.81 36.393)" fill="#529423"/>
+ <path id="path18554" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m25.847 1387.8c0.94158 2.1719 5.0573 4.3701 7.5282 10.431l-0.008-2.6889s-1.2464-2.408-2.6795-3.9353c-1.3928-1.4843-4.8407-3.8067-4.8407-3.8068z" fill="#325819"/>
+ <path id="path18554-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m25.554 1399.9c1.8146 1.5202 6.4789 1.6424 11.403 5.9548l-1.2114-2.4006s-2.1929-1.5947-4.1582-2.3185c-1.9101-0.7033-6.033-1.2356-6.033-1.2357z" fill="#325819"/>
+ <path id="path18554-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m33.722 1414.1c2.0814 1.1277 6.6763 0.317 12.361 3.5605l-1.6659-2.1106s-2.467-1.1253-4.5372-1.4424c-2.012-0.3082-6.1582-0.01-6.1582-0.01z" fill="#325819"/>
+ <path id="path18554-1-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m28.814 1407.7c2.0814 1.1277 6.6763 0.317 12.361 3.5605l-1.6659-2.1106s-2.467-1.1253-4.5372-1.4424c-2.012-0.3082-6.1582-0.01-6.1582-0.01z" fill="#325819"/>
+ <path id="path18554-1-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m24.241 1393.7c1.6456 1.7017 6.2716 2.3112 10.717 7.115l-0.95365-2.5141s-2.014-1.8154-3.8929-2.7408c-1.826-0.8993-5.8698-1.8625-5.8698-1.8625z" fill="#325819"/>
+ <path id="path18554-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m36.736 1386.9c0.23487 2.3555-2.2901 6.2793-1.4978 12.776l-1.302-2.3526s-0.08351-2.7102 0.42474-4.742c0.494-1.9746 2.3751-5.6817 2.3751-5.6818z" fill="#325819"/>
+ <path id="path18554-0-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m41.404 1394.1c0.23487 2.3555-2.2901 6.2793-1.4978 12.776l-1.302-2.3526s-0.08351-2.7102 0.42474-4.742c0.494-1.9746 2.3751-5.6817 2.3751-5.6818z" fill="#325819"/>
+ <path id="path18554-0-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m46.079 1400.4c0.23487 2.3555-2.2901 6.2793-1.4978 12.776l-1.302-2.3526s-0.08351-2.7102 0.42474-4.742c0.494-1.9746 2.3751-5.6817 2.3751-5.6818z" fill="#325819"/>
+ <path id="path18524" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m54.78 1428.2 2.2955-2.25c-8.772-7.9145-15.5-15.94-19.928-24.062-4.5797-8.3988-7.3114-19.855-7.9751-28.44-0.64974 9.4515 2.1459 21.399 5.7993 29.161 7.4593 15.848 19.726 26.567 19.809 25.591z" stroke="#325819" fill="#447821"/>
+ </g>
+ <g id="g18697-5" transform="matrix(.79966 .60045 .60045 -.79966 -537.4 1810.8)">
+ <path id="path18520-1" d="m50.536 1419.7c0.56702-2.549 0.12353-7.4607-0.89151-12.778l-1.1887 1.3373c-0.2199-4.2555-0.45998-8.4958-2.2288-11.59l-1.6344 1.783c-0.23147-3.4603-1.3539-6.7424-3.566-9.8066l-0.8915 2.5259c-1.0488-2.5638-1.4465-5.9958-3.566-7.132l-1.1887 1.783s-0.86437-3.9075-1.783-5.7948c-0.64339-1.3218-1.9982-2.558-2.6745-3.8632-0.66436-1.2821-1.6344-4.0118-1.6344-4.0118s-2.6447 6.8008-2.8231 9.9551c-0.0902 1.5947 1.1887 4.0118 1.1887 4.0118l-2.526-1.4858c-1.2328 2.2783- [...]
+ <path id="path18522-3" d="m48.753 1421.2s-7.0086-2.8514-12.633-7.8886c-4.3899-3.9317-7.0262-8.9165-8.3175-12.616-1.5416-4.4166-0.24268-8.7705 1.0809-13.079 0.78047-2.5408 0.006-4.681-0.18082-6.7239-0.19928-2.1817 0.74123-4.9327 0.28862-5.159 0 0 0.85225 5.3768 2.7098 8.0934 1.5863 2.3199 3.6643 2.8854 5.7018 5.5836 2.665 3.5292 5.2606 8.0397 6.5954 11.137 2.8976 6.7224 4.7547 20.653 4.7547 20.653z" fill="#4b8820"/>
+ <path id="path18552-2" d="m543.94 1349.5c-0.0501 0.7137-0.19516 1.4611-0.4375 2.25-1.3195 4.2955-2.3676 8.1359-1.0625 11.875 1.2015 3.4425 3.7073 8.195 7.7812 11.844 3.1852 2.8527 6.355 4.6819 8.8125 5.9374-0.64949-4.0861-1.9444-11.835-3.9688-16.531-1.2469-2.8929-3.8244-7.3724-6.375-10.75-0.86636-1.1473-1.7128-1.8007-2.6875-2.5625-0.65306-0.5104-1.3602-1.3178-2.0625-2.0625z" transform="translate(-512.81 36.393)" fill="#529423"/>
+ <path id="path18554-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m25.847 1387.8c0.94158 2.1719 5.0573 4.3701 7.5282 10.431l-0.008-2.6889s-1.2464-2.408-2.6795-3.9353c-1.3928-1.4843-4.8407-3.8067-4.8407-3.8068z" fill="#325819"/>
+ <path id="path18554-2-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m25.554 1399.9c1.8146 1.5202 6.4789 1.6424 11.403 5.9548l-1.2114-2.4006s-2.1929-1.5947-4.1582-2.3185c-1.9101-0.7033-6.033-1.2356-6.033-1.2357z" fill="#325819"/>
+ <path id="path18554-1-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m33.722 1414.1c2.0814 1.1277 6.6763 0.317 12.361 3.5605l-1.6659-2.1106s-2.467-1.1253-4.5372-1.4424c-2.012-0.3082-6.1582-0.01-6.1582-0.01z" fill="#325819"/>
+ <path id="path18554-1-7-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m28.814 1407.7c2.0814 1.1277 6.6763 0.317 12.361 3.5605l-1.6659-2.1106s-2.467-1.1253-4.5372-1.4424c-2.012-0.3082-6.1582-0.01-6.1582-0.01z" fill="#325819"/>
+ <path id="path18554-1-5-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m24.241 1393.7c1.6456 1.7017 6.2716 2.3112 10.717 7.115l-0.95365-2.5141s-2.014-1.8154-3.8929-2.7408c-1.826-0.8993-5.8698-1.8625-5.8698-1.8625z" fill="#325819"/>
+ <path id="path18554-0-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m36.736 1386.9c0.23487 2.3555-2.2901 6.2793-1.4978 12.776l-1.302-2.3526s-0.08351-2.7102 0.42474-4.742c0.494-1.9746 2.3751-5.6817 2.3751-5.6818z" fill="#325819"/>
+ <path id="path18554-0-1-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m41.404 1394.1c0.23487 2.3555-2.2901 6.2793-1.4978 12.776l-1.302-2.3526s-0.08351-2.7102 0.42474-4.742c0.494-1.9746 2.3751-5.6817 2.3751-5.6818z" fill="#325819"/>
+ <path id="path18554-0-3-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m46.079 1400.4c0.23487 2.3555-2.2901 6.2793-1.4978 12.776l-1.302-2.3526s-0.08351-2.7102 0.42474-4.742c0.494-1.9746 2.3751-5.6817 2.3751-5.6818z" fill="#325819"/>
+ <path id="path18524-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m54.78 1428.2 2.2955-2.25c-8.772-7.9145-15.5-15.94-19.928-24.062-4.5797-8.3988-7.3114-19.855-7.9751-28.44-0.64974 9.4515 2.1459 21.399 5.7993 29.161 7.4593 15.848 19.726 26.567 19.809 25.591z" stroke="#325819" fill="#447821"/>
+ </g>
+ <g id="g18697-5-6" transform="matrix(.97421 .22563 .22563 -.97421 -99.355 2060)">
+ <path id="path18520-1-9" d="m50.536 1419.7c0.56702-2.549 0.12353-7.4607-0.89151-12.778l-1.1887 1.3373c-0.2199-4.2555-0.45998-8.4958-2.2288-11.59l-1.6344 1.783c-0.23147-3.4603-1.3539-6.7424-3.566-9.8066l-0.8915 2.5259c-1.0488-2.5638-1.4465-5.9958-3.566-7.132l-1.1887 1.783s-0.86437-3.9075-1.783-5.7948c-0.64339-1.3218-1.9982-2.558-2.6745-3.8632-0.66436-1.2821-1.6344-4.0118-1.6344-4.0118s-2.6447 6.8008-2.8231 9.9551c-0.0902 1.5947 1.1887 4.0118 1.1887 4.0118l-2.526-1.4858c-1.2328 2.278 [...]
+ <path id="path18522-3-1" d="m48.753 1421.2s-7.0086-2.8514-12.633-7.8886c-4.3899-3.9317-7.0262-8.9165-8.3175-12.616-1.5416-4.4166-0.24268-8.7705 1.0809-13.079 0.78047-2.5408 0.006-4.681-0.18082-6.7239-0.19928-2.1817 0.74123-4.9327 0.28862-5.159 0 0 0.85225 5.3768 2.7098 8.0934 1.5863 2.3199 3.6643 2.8854 5.7018 5.5836 2.665 3.5292 5.2606 8.0397 6.5954 11.137 2.8976 6.7224 4.7547 20.653 4.7547 20.653z" fill="#4b8820"/>
+ <path id="path18552-2-4" d="m543.94 1349.5c-0.0501 0.7137-0.19516 1.4611-0.4375 2.25-1.3195 4.2955-2.3676 8.1359-1.0625 11.875 1.2015 3.4425 3.7073 8.195 7.7812 11.844 3.1852 2.8527 6.355 4.6819 8.8125 5.9374-0.64949-4.0861-1.9444-11.835-3.9688-16.531-1.2469-2.8929-3.8244-7.3724-6.375-10.75-0.86636-1.1473-1.7128-1.8007-2.6875-2.5625-0.65306-0.5104-1.3602-1.3178-2.0625-2.0625z" transform="translate(-512.81 36.393)" fill="#529423"/>
+ <path id="path18554-6-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m25.847 1387.8c0.94158 2.1719 5.0573 4.3701 7.5282 10.431l-0.008-2.6889s-1.2464-2.408-2.6795-3.9353c-1.3928-1.4843-4.8407-3.8067-4.8407-3.8068z" fill="#325819"/>
+ <path id="path18554-2-9-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m25.554 1399.9c1.8146 1.5202 6.4789 1.6424 11.403 5.9548l-1.2114-2.4006s-2.1929-1.5947-4.1582-2.3185c-1.9101-0.7033-6.033-1.2356-6.033-1.2357z" fill="#325819"/>
+ <path id="path18554-1-0-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m33.722 1414.1c2.0814 1.1277 6.6763 0.317 12.361 3.5605l-1.6659-2.1106s-2.467-1.1253-4.5372-1.4424c-2.012-0.3082-6.1582-0.01-6.1582-0.01z" fill="#325819"/>
+ <path id="path18554-1-7-0-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m28.814 1407.7c2.0814 1.1277 6.6763 0.317 12.361 3.5605l-1.6659-2.1106s-2.467-1.1253-4.5372-1.4424c-2.012-0.3082-6.1582-0.01-6.1582-0.01z" fill="#325819"/>
+ <path id="path18554-1-5-3-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m24.241 1393.7c1.6456 1.7017 6.2716 2.3112 10.717 7.115l-0.95365-2.5141s-2.014-1.8154-3.8929-2.7408c-1.826-0.8993-5.8698-1.8625-5.8698-1.8625z" fill="#325819"/>
+ <path id="path18554-0-9-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m36.736 1386.9c0.23487 2.3555-2.2901 6.2793-1.4978 12.776l-1.302-2.3526s-0.08351-2.7102 0.42474-4.742c0.494-1.9746 2.3751-5.6817 2.3751-5.6818z" fill="#325819"/>
+ <path id="path18554-0-1-5-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m41.404 1394.1c0.23487 2.3555-2.2901 6.2793-1.4978 12.776l-1.302-2.3526s-0.08351-2.7102 0.42474-4.742c0.494-1.9746 2.3751-5.6817 2.3751-5.6818z" fill="#325819"/>
+ <path id="path18554-0-3-3-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m46.079 1400.4c0.23487 2.3555-2.2901 6.2793-1.4978 12.776l-1.302-2.3526s-0.08351-2.7102 0.42474-4.742c0.494-1.9746 2.3751-5.6817 2.3751-5.6818z" fill="#325819"/>
+ <path id="path18524-1-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m56.305 1429.7 6.3951 2.6201c-8.772-7.9145-21.125-22.284-25.554-30.406-4.5797-8.3988-7.3114-19.855-7.9751-28.44-0.64974 9.4515 2.1459 21.399 5.7993 29.161 7.4593 15.848 21.252 28.04 21.334 27.064z" stroke="#325819" fill="#447821"/>
+ </g>
+ <path id="path18265" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m527.31 1291.9s-1.0459 12.112 0.0312 18.75c0.71829 4.4263 2.9441 10.413 4.625 14.562-3.0148-0.6666-6.1223-1.2418-9.375-1.8125-5.8568-1.0275-11.558-1.4958-17.25-1.4063-2.1655 0.034-4.3307 0.1424-6.5 0.3438-1.4348-0.333-4.4786-1.028-6.875-1.5938-5.3644-1.2662-10.604-3.8684-14.812-7.4062-4.3581-3.6631-11.438-12.719-11.438-12.719l-3.1875 2.4376s6.8748 9.0096 12.031 13.344c4.0278 3.3855 8 [...]
+ <path id="path18265-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m528.31 1292s-0.99457 12.147 0.0312 18.469c0.84044 5.179 3.9329 12.928 5.5625 16.781-3.6933-0.8794-7.4867-1.6286-11.562-2.3437-5.7725-1.0127-11.377-1.4942-16.969-1.4063-1.7212 0.027-3.4638 0.1152-5.1875 0.25l0.0312-0.062s-5.5174-1.2409-8.4688-1.9376c-5.5194-1.3028-10.914-3.9803-15.25-7.625-4.5577-3.8308-11.562-12.875-11.562-12.875l-1.5938 1.2188s6.9182 9.0212 11.875 13.188c4.5903 3 [...]
+ </g>
+ </g>
+ <use id="use12073" xlink:href="#g22948" transform="matrix(-1 0 0 1 1252.8 0)" height="1500" width="1550" y="0" x="0"/>
+ <use id="use12075" xlink:href="#g18418" transform="matrix(-1 0 0 1 1252.8 0)" height="1500" width="1550" y="0" x="0"/>
+ <g id="g12752" transform="translate(-133.79 -681.95)">
+ <g id="g13160" transform="translate(0,4)">
+ <g id="g12855" transform="translate(.30654)">
+ <g id="g12794">
+ <path id="path12960" d="m614.5 1333.9h272.39l0.54046-1.081 32.427-34.589 1.0809-11.89-20.537-18.916-280.5-0.5405-21.078 16.754 1.0809 12.971 14.592 37.292z" stroke="#6c6753" fill="#e0e0e0"/>
+ <path id="path12790" d="m654.67 1268.2s-13.211 11.038-13.955 18.809c-0.53423 5.583 2.7822 11.819 7.2809 15.168 6.2411 4.6462 15.89 0.6102 23.056 3.6405 7.4511 3.1507 11.747 11.986 19.416 14.562 49.033 16.468 1.1369 3.6517 155.33 0.6067 7.8653-0.1553 10.781-11.55 16.989-16.382 5.4477-4.2398 14.894-8.2093 17.596-14.562 3.3998-7.9943-5.4607-21.843-5.4607-21.843h-220.25z" fill="#eaeaea"/>
+ <path id="path12792" d="m674.7 1266.4s-13.184 4.1803-16.382 11.528c-1.4529 3.3379-2.5401 8.3135 0 10.921 5.3643 5.5073 14.486 3.2268 21.843 5.4607 8.6977 2.6412 14.365 11.899 23.056 14.562 18.573 5.69 38.822 1.9114 58.247 1.8202 24.897-0.1169 51.623 6.4823 74.629-3.0337 6.3488-2.626 9.3917-10.236 15.169-13.955 4.8008-3.0907 13.375-4.5271 15.775-9.7078 2.8502-6.1524-6.0674-16.382-6.0674-16.382l-186.27-1.2135z" fill="#f4f4f4"/>
+ </g>
+ <g id="g12851" transform="translate(2.0872 3.6526)">
+ <path id="path12960-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m614.5 1324.9v10h272.41v-10h-272.41z" stroke="#806600" fill="#d1b948"/>
+ <path id="path12960-3-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m614.5 1327.4v5h272.41 1.5312l0.6875-1.375 0.53125-1.0937-2.75-1.375v-1.1563h-272.41z" fill="#e7cd54"/>
+ </g>
+ </g>
+ <g id="g13090" transform="translate(-.25112)">
+ <g id="g12864-0" transform="matrix(-1 0 0 1 1520.9 0)">
+ <g id="g12773-5">
+ <g id="g12690-2">
+ <g id="g11762-2">
+ <path id="path12913-7" d="m323.91 1424.2s49.002-51.665 81.069-63.175c10.998-3.9479 32.866-3.2866 32.866-3.2866l-1.0955-35.787-4.0169-9.4945-15.337-9.1294-22.276-0.3652-23.006 6.208-22.641 18.624-21.545 10.59-28.484 12.781-13.511 13.146-0.73035 8.0338 38.708 51.855z" stroke="#6c6753" fill="#e4c900"/>
+ <path id="path11758-3" d="m317.48 1343.7s-6.548 8.7074-4.1411 13.344c1.7454 3.362 6.0827 5.203 9.6625 6.4416 12.981 4.4913 41.813 7.1549 55.214 4.1411 7.3915-1.6622 14.722-7.996 13.343-14.724-1.4458-7.0552-7.3273-11.35-13.343-18.405-0.80535-0.08 6.252-3.6264 21.166-9.6625 2.7012-1.0933 3.2874-3.7781 1.3804-5.9815-6.9981-8.0854-29.448-9.2024-29.448-9.2024l-23.466 18.405-30.368 15.644z" fill="#efd75b"/>
+ <path id="path11760-7" d="m323.92 1340.5s-3.012 7.5342 0 11.043c7.2207 8.4111 23.933 6.3145 34.969 7.362 4.8955 0.4646 10.499 1.5966 14.724-0.9203 2.4861-1.4812 4.5441-4.4687 4.6012-7.3619 0.17074-8.6541-12.423-19.325-12.423-19.325-0.39068-0.6511 13.93-6.8073 20.705-7.3619 1.2229-0.1001 0.83081-0.9376 0-1.8405-6.2526-6.7954-25.767-3.6809-25.767-3.6809l-36.81 22.086z" fill="#f6e078"/>
+ </g>
+ <g id="g12686-9">
+ <path id="path12913-0-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m436.88 1349.4s-5.6696-0.1818-12.719 0.1563c-7.0492 0.3381-15.425 1.0463-22 3.4063-17.51 6.2851-37.747 22.36-54.188 36.875-16.44 14.515-28.812 27.562-28.812 27.562l7.25 6.9063s12.11-12.774 28.188-26.969c16.077-14.195 36.381-29.744 50.938-34.969 4.424-1.588 12.491-2.4943 19.125-2.8125s11.906-0.1563 11.906-0.1563l0.3125-10z" stroke="#806600" fill="#d1b948"/>
+ <path id="path12913-0-2-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m436.78 1351.9s-5.5546-0.1768-12.5 0.1563-15.244 1.1143-21.281 3.2813c-16.772 6.0201-37.025 21.94-53.375 36.375s-28.656 27.406-28.656 27.406l3.625 3.4688s12.176-12.85 28.344-27.125 36.455-29.948 51.75-35.438c4.9616-1.7809 13.106-2.6455 19.844-2.9687 6.7378-0.3232 12.094-0.1563 12.094-0.1563l0.15625-5z" fill="#e7cd54"/>
+ </g>
+ </g>
+ <g id="g11841-3">
+ <g id="g11833-9">
+ <path id="path12915-9" d="m389.64 1335.9c14.73 13.55 14.033 32.119 18.259 56.254l33.231-0.3652-0.36518-67.209-8.0338 9.8597-8.399 1.8259-16.798-5.8428-17.894 5.4776z" fill="#fff"/>
+ <path id="path12915-7-8-7" d="m428.52 1391.9 12.609-0.1386-0.36518-67.209-8.0338 9.8597-8.399 1.8259 4.1894 55.662z" fill="#f4f4f4"/>
+ <path id="path12915-3-0" d="m434.52 1391.8 6.6077-0.073-0.36518-67.209-8.0338 9.8597 1.7914 57.422z" fill="#eaeaea"/>
+ <path id="path12915-7-3" d="m389.64 1335.9c14.73 13.55 14.033 32.119 18.259 56.254l33.231-0.3652-0.36518-67.209-8.0338 9.8597-8.399 1.8259-16.798-5.8428-17.894 5.4776z" stroke="#6c6753" fill="none"/>
+ </g>
+ <path id="path11839-9" d="m410.92 1379.5c-3.6637-12.175-4.3843-26.194-11.203-37.211 0 0 3.6618-1.5103 5.6016-1.6005 2.1688-0.1009 6.4018 1.2004 6.4018 1.2004l5.6016 43.612-6.4018-6.0017z" fill="#f4f4f4"/>
+ </g>
+ </g>
+ <g id="g12764-8">
+ <path id="path12958-6" d="m595.04 1290.1c0.788 3.6391-0.57512 9.0581-0.0406 16.757 0.57815 8.3266 3.0091 16.434 2.6216 25.463-0.25068 5.8405-1.5656 12.412-2.0987 17.655-0.72772 7.1573-0.46525 10.145 1.6527 11.881 2.9873 1.2723 13.459 6.3194 16.292 7.5762 36.562 16.224 55.493 30.711 85.341 47.135l7.5664-48.101-9.7282-17.835-18.376-13.511-19.456-5.4046-18.916-16.754-22.159-4.8641-14.592-10.809-4.8641-10.809-3.2428 1.6214h0.00005z" stroke="#6c6753" fill="#e4c900"/>
+ <g id="g12760-5">
+ <path id="path12958-4-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m594.56 1354.1c-4.1242 4.8813-2.8763 10.825 7.751 15.515 3.7639 1.8577 7.3593 3.654 9.125 4.4374 19.292 8.5605 33.572 16.594 47.312 24.781l5.0938-8.5937c-13.884-8.273-28.599-16.583-48.344-25.344-1.0666-0.4733-4.9763-2.3875-8.75-4.25s-10.263-5.7256-12.188-6.5459z" stroke="#806600" fill="#d1b948"/>
+ <path id="path12958-4-8-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m595.03 1357.3c-0.56954 7.0415 2.4348 6.7266 8.4067 10.025 3.7664 1.8589 7.4403 3.7003 9.0312 4.4062 19.405 8.6106 33.755 16.698 47.531 24.906l2.5625-4.2812c-13.848-8.2515-28.431-16.508-48.062-25.219-1.2414-0.5508-5.0725-2.4199-8.8438-4.2812-3.7712-1.8613-8.9157-4.8277-10.625-5.5559z" fill="#e7cd54"/>
+ </g>
+ <g id="g12703-2">
+ <path id="path12699-7" d="m605.65 1300.1s-3.52 10.418-3.3867 15.804c0.14459 5.8399 3.86 11.129 4.5156 16.933 0.59154 5.2382-2.0018 10.733-0.56444 15.804 1.2948 4.5687 4.1158 8.9876 7.9022 11.853 5.3612 4.0575 12.508 5.4748 19.191 6.209 9.9563 1.0938 20.399 0.3022 29.916-2.8223 5.2117-1.7112 11.408-3.6933 14.111-8.4667 2.8737-5.0755 3.3882-12.75 0-17.498-3.6984-5.1821-12.417-3.2647-18.062-6.2089-7.6411-3.9853-13.166-11.407-20.885-15.24-7.0373-3.4948-15.775-2.8409-22.578-6.7733-4. [...]
+ <path id="path12701-0" d="m612.99 1307.4s-1.7397 7.8624-1.6933 11.853c0.0665 5.7219 2.3502 11.231 2.8222 16.933 0.37245 4.5002-2.0365 9.5165 0 13.547 2.0026 3.9632 6.506 6.5159 10.724 7.9022 9.116 2.9958 19.577 2.6947 28.787 0 5.3598-1.5683 11.43-4.1322 14.111-9.0311 2.1678-3.9612 2.2027-9.6048 0-13.547-2.6205-4.6897-11.238-7.337-17.465-10.934-10.418-6.0171-19.224-11.644-19.224-11.644l-18.062-5.08z" fill="#f6e078"/>
+ </g>
+ </g>
+ <g id="g13065-3">
+ <path id="path12747-9" d="m282.73 1376.3s0.61719 6.4728 4.163 14.393c2.2511 5.028 7.0481 11.008 9.2366 17.123 3.2469 9.0716 3.5663 25.081 7.7041 31.07 2.1229 3.0724 13.977 7.5281 13.977 7.5281l373.56 0.4575s8.8345-2.8953 11.172-7.5585c2.8131-5.6126-1.4366-16.42 0.0918-25.082 1.1102-6.2918 2.7272-13.957 3.8574-20.261 1.2985-7.2424 1.1858-10.382 2.2882-17.67h-426.05z" fill="#fff"/>
+ <path id="path12747-3-9-9-9" d="m624.33 1446.9 67.046 0.023s8.8345-2.8953 11.172-7.5585c2.8131-5.6126-1.4366-16.42 0.0918-25.082 1.1102-6.2918 2.7272-13.957 3.8574-20.261 1.2985-7.2424 1.1858-10.382 2.2882-17.67h-77.607c1.5795 23.516-1.1301 47.032-6.8484 70.548zm-268.02-70.548h-73.58s0.61719 6.4728 4.163 14.393c2.2511 5.028 7.0481 11.008 9.2366 17.123 3.2469 9.0716 3.5663 25.081 7.7041 31.07 2.1229 3.0724 13.977 7.5281 13.977 7.5281l48.082 0.01-0.68163 0.9558c-3.0394-23.149-9.162 [...]
+ <path id="path12747-3-9-7-9" d="m650.33 1446.9 27.046 0.023s22.835-2.8953 25.172-7.5585c2.8131-5.6126-1.4366-16.42 0.0918-25.082 1.1102-6.2918 2.7272-13.957 3.8574-20.261 1.2985-7.2424 1.1858-10.382 2.2882-17.67h-51.607c1.5795 23.516-1.1301 47.032-6.8484 70.548zm-314.02-70.548h-53.58s0.61719 6.4728 4.163 14.393c2.2511 5.028 7.0481 11.008 9.2366 17.123 3.2469 9.0716 3.5663 25.081 7.7041 31.07 2.1229 3.0724 33.977 7.5281 33.977 7.5281l8.0816 0.01-0.68163 0.9558c-3.0394-23.149-9.162 [...]
+ <path id="path12747-3-9-1" d="m672.33 1446.9 19.046 0.023s8.8345-2.8953 11.172-7.5585c2.8131-5.6126-1.4366-16.42 0.0918-25.082 1.1102-6.2918 2.7272-13.957 3.8574-20.261 1.2985-7.2424 1.1858-10.382 2.2882-17.67h-29.607c1.5795 23.516-1.1301 47.032-6.8484 70.548zm-356.02-70.548h-33.58s0.61719 6.4728 4.163 14.393c2.2511 5.028 7.0481 11.008 9.2366 17.123 3.2469 9.0716 3.5663 25.081 7.7041 31.07 2.1229 3.0724 13.977 7.5281 13.977 7.5281l8.0816 0.01-0.68163 0.9558c-3.0394-23.149-9.1624- [...]
+ <path id="path12747-3-7" d="m282.73 1376.3s0.61719 6.4728 4.163 14.393c2.2511 5.028 7.0481 11.008 9.2366 17.123 3.2469 9.0716 3.5663 25.081 7.7041 31.07 2.1229 3.0724 13.977 7.5281 13.977 7.5281l373.56 0.4575s8.8345-2.8953 11.172-7.5585c2.8131-5.6126-1.4366-16.42 0.0918-25.082 1.1102-6.2918 2.7272-13.957 3.8574-20.261 1.2985-7.2424 1.1858-10.382 2.2882-17.67h-426.05z" stroke="#6c6753" fill="none"/>
+ </g>
+ <g id="g12894-2" transform="translate(211.14 648.81)">
+ <path id="path12747-0-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m87.094 790.72c-0.07524 1.9218 0.86233 4.0146 1.6562 4.9947 1.5878 1.9602 3.371 2.8908 5.3125 3.8125 3.883 1.8434 8.3583 3.0938 12.594 3.0938l373.56 0.4375c1.7019 0 2.6306-0.34762 4.2812-0.65625 7.0683-1.3216 12.317-7.9675 8.4963-14.844-4.1384 3.2503-8.319 4.6439-12.746 5.5l-373.56-0.44c-5.9569-0.6688-11.062-2.8155-16.592-7.3267-1.4123 1.3464-2.9269 3.5257-3.0013 5.4257z" stro [...]
+ <path id="path12747-0-2-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m106.66 800.09 373.56 0.22102c4.9146 0.0479 13.402-2.2369 12.022-9.5296-2.871 2.0042-7.1706 4.1575-11.991 4.4776l-373.56-0.22102c-8.0052-0.0453-13.757-3.7226-16.103-6.4566-5.6023 8.3898 12.668 12.044 16.071 11.509z" fill="#f6e078"/>
+ </g>
+ </g>
+ <g id="g12864">
+ <g id="g12773">
+ <g id="g12690">
+ <g id="g11762">
+ <path id="path12913" d="m323.91 1424.2s49.002-51.665 81.069-63.175c10.998-3.9479 32.866-3.2866 32.866-3.2866l-1.0955-35.787-4.0169-9.4945-15.337-9.1294-22.276-0.3652-23.006 6.208-22.641 18.624-21.545 10.59-28.484 12.781-13.511 13.146-0.73035 8.0338 38.708 51.855z" stroke="#6c6753" fill="#e4c900"/>
+ <path id="path11758" d="m317.48 1343.7s-6.548 8.7074-4.1411 13.344c1.7454 3.362 6.0827 5.203 9.6625 6.4416 12.981 4.4913 41.813 7.1549 55.214 4.1411 7.3915-1.6622 14.722-7.996 13.343-14.724-1.4458-7.0552-7.3273-11.35-13.343-18.405-0.80535-0.08 6.252-3.6264 21.166-9.6625 2.7012-1.0933 3.2874-3.7781 1.3804-5.9815-6.9981-8.0854-29.448-9.2024-29.448-9.2024l-23.466 18.405-30.368 15.644z" fill="#efd75b"/>
+ <path id="path11760" d="m323.92 1340.5s-3.012 7.5342 0 11.043c7.2207 8.4111 23.933 6.3145 34.969 7.362 4.8955 0.4646 10.499 1.5966 14.724-0.9203 2.4861-1.4812 4.5441-4.4687 4.6012-7.3619 0.17074-8.6541-12.423-19.325-12.423-19.325-0.39068-0.6511 13.93-6.8073 20.705-7.3619 1.2229-0.1001 0.83081-0.9376 0-1.8405-6.2526-6.7954-25.767-3.6809-25.767-3.6809l-36.81 22.086z" fill="#f6e078"/>
+ </g>
+ <g id="g12686">
+ <path id="path12913-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m436.88 1349.4s-5.6696-0.1818-12.719 0.1563c-7.0492 0.3381-15.425 1.0463-22 3.4063-17.51 6.2851-37.747 22.36-54.188 36.875-16.44 14.515-28.812 27.562-28.812 27.562l7.25 6.9063s12.11-12.774 28.188-26.969c16.077-14.195 36.381-29.744 50.938-34.969 4.424-1.588 12.491-2.4943 19.125-2.8125s11.906-0.1563 11.906-0.1563l0.3125-10z" stroke="#806600" fill="#d1b948"/>
+ <path id="path12913-0-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m436.78 1351.9s-5.5546-0.1768-12.5 0.1563-15.244 1.1143-21.281 3.2813c-16.772 6.0201-37.025 21.94-53.375 36.375s-28.656 27.406-28.656 27.406l3.625 3.4688s12.176-12.85 28.344-27.125 36.455-29.948 51.75-35.438c4.9616-1.7809 13.106-2.6455 19.844-2.9687 6.7378-0.3232 12.094-0.1563 12.094-0.1563l0.15625-5z" fill="#e7cd54"/>
+ </g>
+ </g>
+ <g id="g11841">
+ <g id="g11833">
+ <path id="path12915" d="m389.64 1335.9c14.73 13.55 14.033 32.119 18.259 56.254l33.231-0.3652-0.36518-67.209-8.0338 9.8597-8.399 1.8259-16.798-5.8428-17.894 5.4776z" fill="#fff"/>
+ <path id="path12915-7-8" d="m428.52 1391.9 12.609-0.1386-0.36518-67.209-8.0338 9.8597-8.399 1.8259 4.1894 55.662z" fill="#f4f4f4"/>
+ <path id="path12915-3" d="m434.52 1391.8 6.6077-0.073-0.36518-67.209-8.0338 9.8597 1.7914 57.422z" fill="#eaeaea"/>
+ <path id="path12915-7" d="m389.64 1335.9c14.73 13.55 14.033 32.119 18.259 56.254l33.231-0.3652-0.36518-67.209-8.0338 9.8597-8.399 1.8259-16.798-5.8428-17.894 5.4776z" stroke="#6c6753" fill="none"/>
+ </g>
+ <path id="path11839" d="m410.92 1379.5c-3.6637-12.175-4.3843-26.194-11.203-37.211 0 0 3.6618-1.5103 5.6016-1.6005 2.1688-0.1009 6.4018 1.2004 6.4018 1.2004l5.6016 43.612-6.4018-6.0017z" fill="#f4f4f4"/>
+ </g>
+ </g>
+ <g id="g12764">
+ <path id="path12958" d="m595.04 1290.1c0.788 3.6391-0.57512 9.0581-0.0406 16.757 0.57815 8.3266 3.0091 16.434 2.6216 25.463-0.25068 5.8405-1.5656 12.412-2.0987 17.655-0.72772 7.1573-0.46525 10.145 1.6527 11.881 2.9873 1.2723 13.459 6.3194 16.292 7.5762 36.562 16.224 55.493 30.711 85.341 47.135l7.5664-48.101-9.7282-17.835-18.376-13.511-19.456-5.4046-18.916-16.754-22.159-4.8641-14.592-10.809-4.8641-10.809-3.2428 1.6214h0.00005z" stroke="#6c6753" fill="#e4c900"/>
+ <g id="g12760">
+ <path id="path12958-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m594.56 1354.1c-4.1242 4.8813-2.8763 10.825 7.751 15.515 3.7639 1.8577 7.3593 3.654 9.125 4.4374 19.292 8.5605 33.572 16.594 47.312 24.781l5.0938-8.5937c-13.884-8.273-28.599-16.583-48.344-25.344-1.0666-0.4733-4.9763-2.3875-8.75-4.25s-10.263-5.7256-12.188-6.5459z" stroke="#806600" fill="#d1b948"/>
+ <path id="path12958-4-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m595.03 1357.3c-0.56954 7.0415 2.4348 6.7266 8.4067 10.025 3.7664 1.8589 7.4403 3.7003 9.0312 4.4062 19.405 8.6106 33.755 16.698 47.531 24.906l2.5625-4.2812c-13.848-8.2515-28.431-16.508-48.062-25.219-1.2414-0.5508-5.0725-2.4199-8.8438-4.2812-3.7712-1.8613-8.9157-4.8277-10.625-5.5559z" fill="#e7cd54"/>
+ </g>
+ <g id="g12703">
+ <path id="path12699" d="m605.65 1300.1s-3.52 10.418-3.3867 15.804c0.14459 5.8399 3.86 11.129 4.5156 16.933 0.59154 5.2382-2.0018 10.733-0.56444 15.804 1.2948 4.5687 4.1158 8.9876 7.9022 11.853 5.3612 4.0575 12.508 5.4748 19.191 6.209 9.9563 1.0938 20.399 0.3022 29.916-2.8223 5.2117-1.7112 11.408-3.6933 14.111-8.4667 2.8737-5.0755 3.3882-12.75 0-17.498-3.6984-5.1821-12.417-3.2647-18.062-6.2089-7.6411-3.9853-13.166-11.407-20.885-15.24-7.0373-3.4948-15.775-2.8409-22.578-6.7733-4.03 [...]
+ <path id="path12701" d="m612.99 1307.4s-1.7397 7.8624-1.6933 11.853c0.0665 5.7219 2.3502 11.231 2.8222 16.933 0.37245 4.5002-2.0365 9.5165 0 13.547 2.0026 3.9632 6.506 6.5159 10.724 7.9022 9.116 2.9958 19.577 2.6947 28.787 0 5.3598-1.5683 11.43-4.1322 14.111-9.0311 2.1678-3.9612 2.2027-9.6048 0-13.547-2.6205-4.6897-11.238-7.337-17.465-10.934-10.418-6.0171-19.224-11.644-19.224-11.644l-18.062-5.08z" fill="#f6e078"/>
+ </g>
+ </g>
+ <g id="g13065">
+ <path id="path12747" d="m282.73 1376.3s0.61719 6.4728 4.163 14.393c2.2511 5.028 7.0481 11.008 9.2366 17.123 3.2469 9.0716 3.5663 25.081 7.7041 31.07 2.1229 3.0724 13.977 7.5281 13.977 7.5281l373.56 0.4575s8.8345-2.8953 11.172-7.5585c2.8131-5.6126-1.4366-16.42 0.0918-25.082 1.1102-6.2918 2.7272-13.957 3.8574-20.261 1.2985-7.2424 1.1858-10.382 2.2882-17.67h-426.05z" fill="#fff"/>
+ <path id="path12747-3-9-9" d="m624.33 1446.9 67.046 0.023s8.8345-2.8953 11.172-7.5585c2.8131-5.6126-1.4366-16.42 0.0918-25.082 1.1102-6.2918 2.7272-13.957 3.8574-20.261 1.2985-7.2424 1.1858-10.382 2.2882-17.67h-77.607c1.5795 23.516-1.1301 47.032-6.8484 70.548zm-268.02-70.548h-73.58s0.61719 6.4728 4.163 14.393c2.2511 5.028 7.0481 11.008 9.2366 17.123 3.2469 9.0716 3.5663 25.081 7.7041 31.07 2.1229 3.0724 13.977 7.5281 13.977 7.5281l48.082 0.01-0.68163 0.9558c-3.0394-23.149-9.1624- [...]
+ <path id="path12747-3-9-7" d="m650.33 1446.9 27.046 0.023s22.835-2.8953 25.172-7.5585c2.8131-5.6126-1.4366-16.42 0.0918-25.082 1.1102-6.2918 2.7272-13.957 3.8574-20.261 1.2985-7.2424 1.1858-10.382 2.2882-17.67h-51.607c1.5795 23.516-1.1301 47.032-6.8484 70.548zm-314.02-70.548h-53.58s0.61719 6.4728 4.163 14.393c2.2511 5.028 7.0481 11.008 9.2366 17.123 3.2469 9.0716 3.5663 25.081 7.7041 31.07 2.1229 3.0724 33.977 7.5281 33.977 7.5281l8.0816 0.01-0.68163 0.9558c-3.0394-23.149-9.1624- [...]
+ <path id="path12747-3-9" d="m672.33 1446.9 19.046 0.023s8.8345-2.8953 11.172-7.5585c2.8131-5.6126-1.4366-16.42 0.0918-25.082 1.1102-6.2918 2.7272-13.957 3.8574-20.261 1.2985-7.2424 1.1858-10.382 2.2882-17.67h-29.607c1.5795 23.516-1.1301 47.032-6.8484 70.548zm-356.02-70.548h-33.58s0.61719 6.4728 4.163 14.393c2.2511 5.028 7.0481 11.008 9.2366 17.123 3.2469 9.0716 3.5663 25.081 7.7041 31.07 2.1229 3.0724 13.977 7.5281 13.977 7.5281l8.0816 0.01-0.68163 0.9558c-3.0394-23.149-9.1624-23 [...]
+ <path id="path12747-3" d="m282.73 1376.3s0.61719 6.4728 4.163 14.393c2.2511 5.028 7.0481 11.008 9.2366 17.123 3.2469 9.0716 3.5663 25.081 7.7041 31.07 2.1229 3.0724 13.977 7.5281 13.977 7.5281l373.56 0.4575s8.8345-2.8953 11.172-7.5585c2.8131-5.6126-1.4366-16.42 0.0918-25.082 1.1102-6.2918 2.7272-13.957 3.8574-20.261 1.2985-7.2424 1.1858-10.382 2.2882-17.67h-426.05z" stroke="#6c6753" fill="none"/>
+ </g>
+ <g id="g12894" transform="translate(211.14 648.81)">
+ <path id="path12747-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m87.094 790.72c-0.07524 1.9218 0.86233 4.0146 1.6562 4.9947 1.5878 1.9602 3.371 2.8908 5.3125 3.8125 3.883 1.8434 8.3583 3.0938 12.594 3.0938l373.56 0.4375c1.7019 0 2.6306-0.34762 4.2812-0.65625 7.0683-1.3216 12.317-7.9675 8.4963-14.844-4.1384 3.2503-8.319 4.6439-12.746 5.5l-373.56-0.44c-5.9569-0.6688-11.062-2.8155-16.592-7.3267-1.4123 1.3464-2.9269 3.5257-3.0013 5.4257z" stroke [...]
+ <path id="path12747-0-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m106.66 800.09 373.56 0.22102c4.9146 0.0479 13.402-2.2369 12.022-9.5296-2.871 2.0042-7.1706 4.1575-11.991 4.4776l-373.56-0.22102c-8.0052-0.0453-13.757-3.7226-16.103-6.4566-5.6023 8.3898 12.668 12.044 16.071 11.509z" fill="#f6e078"/>
+ </g>
+ </g>
+ </g>
+ <g id="g12828" transform="translate(211.14 648.81)">
+ <path id="path12749-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m409.66 613.69-1.16 0.69s-4.1954 2.4179-9 5.9062c-4.8046 3.4884-10.325 7.8014-13.531 13.25-1.0832 1.841-1.8537 3.9781-2.4062 6.3438-0.55254 2.3656-1.071 4.807 0 7.875 1.9163 5.4893 6.1077 9.1215 10.312 11.781 4.2048 2.6598 8.6451 4.5549 12.125 6.375 6.6678 3.4874 13.036 3.4668 16.781 5.375 6.4477 3.2852 14.472 10.286 22.625 14.656 7.5406 4.0424 15.055 4.5917 20 7.3125 10.198 5.610 [...]
+ <path id="path12749-3-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m410.34 616.19-0.59375 0.34375s-4.0892 2.3746-8.7812 5.7812c-4.6921 3.4066-10.042 7.7383-12.844 12.5-0.89094 1.5142-1.6287 3.5002-2.125 5.625-0.49629 2.1248-0.85631 4.3157-0.0937 6.5 1.652 4.7321 5.344 7.9584 9.3125 10.469 3.9686 2.5103 8.3321 4.3956 11.938 6.2812 5.9245 3.0986 12.273 3.0625 16.75 5.3438 6.9157 3.5236 14.928 10.545 22.656 14.688 6.9069 3.7027 14.441 4.2678 20.03 [...]
+ </g>
+ </g>
+ <g id="g12706" transform="translate(197.14 655.94)" stroke="#806600" fill="#e4c900">
+ <path id="path12595-9" d="m267.43 782.33c-0.24664-0.8097-2.4929-0.94192-16.003-0.94192-10.464 0-15.716-0.21645-15.716-0.64765 0-0.35622 0.33643-0.81033 0.74764-1.0091 0.64179-0.31027 0.74765-3.0528 0.74765-19.37 0-16.13-0.11321-19.127-0.74765-19.79-0.41121-0.42995-0.74764-1.0297-0.74764-1.3328 0-0.30426 6.9267-0.55106 15.467-0.55106 13.289 0 15.507-0.13265 15.754-0.94191 0.7167-2.3531 1.1771-0.47294 1.1771 4.807 0 5.5297-0.0346 5.7093-0.91151 4.7096-0.78913-0.89973-2.3615-1.0392-11. [...]
+ <path id="path12593-3" d="m399.43 782.33c-0.24663-0.8097-2.4929-0.94192-16.003-0.94192-10.464 0-15.716-0.21645-15.716-0.64765 0-0.35622 0.33643-0.81033 0.74763-1.0091 0.6418-0.31027 0.74766-3.0528 0.74766-19.37 0-16.13-0.11321-19.127-0.74766-19.79-0.4112-0.42995-0.74763-1.0297-0.74763-1.3328 0-0.30426 6.9267-0.55106 15.467-0.55106 13.289 0 15.507-0.13265 15.754-0.94191 0.71671-2.3531 1.1771-0.47294 1.1771 4.807 0 5.5297-0.0347 5.7093-0.91149 4.7096-0.78914-0.89973-2.3616-1.0392-11.7 [...]
+ <path id="path12591-8" d="m292.54 780.88c-3.8703-1.0505-7.1305-3.6145-8.27-6.5039-0.82591-2.0943-0.95561-4.2152-1.093-17.874-0.12607-12.532-0.29299-15.641-0.87224-16.247-1.4432-1.509-0.6082-1.8511 4.5172-1.8511 3.2629 0 5.2335 0.24388 5.2335 0.64766 0 0.35621-0.33644 0.81032-0.74764 1.0091-0.63374 0.30638-0.74652 2.4799-0.7403 14.266 0.005 9.7756 0.19069 14.371 0.62473 15.475 1.65 4.1956 10.001 5.9264 14.717 3.0501 3.3629-2.051 3.5912-3.237 3.5912-18.652 0-10.905-0.12668-13.263-0.74 [...]
+ <path id="path12581-4" d="m165.52 738.73c-5.3864 0.0163-5.6943 0.46707-4.3768 1.8447 1.1227 1.1738 1.1227 38.626 0 39.169-0.41119 0.19875-0.74763 0.66895-0.74763 1.0596 0 0.51712 3.4243 0.6341 12.585 0.43179 14.043-0.31022 15.578-0.68347 19.221-4.6116 1.1118-1.199 2.6561-3.7923 3.4267-5.7693 1.2892-3.3075 1.4018-4.1678 1.4018-10.813 0-6.6448-0.11266-7.5051-1.4018-10.813-0.77057-1.977-2.337-4.6027-3.4734-5.8281-3.4833-3.7564-5.5328-4.2349-19.423-4.5527-3.0497-0.0699-5.4162-0.12325-7. [...]
+ <path id="path12577-8" d="m210.76 780.74c0-0.35622 0.33645-0.81033 0.74765-1.0091 0.64179-0.31027 0.74764-3.0528 0.74764-19.37 0-16.13-0.1132-19.127-0.74764-19.79-1.4768-1.5442-0.668-1.8839 4.4859-1.8839s5.9627 0.33968 4.4858 1.8839c-0.63391 0.66282-0.74763 3.6239-0.74763 19.467s0.11372 18.804 0.74763 19.467c1.4768 1.5442 0.66801 1.8839-4.4858 1.8839-3.2629 0-5.2335-0.24387-5.2335-0.64765z"/>
+ <path id="path12575-3" d="m419.56 781.8c0-0.3031 0.33642-0.90286 0.74763-1.3328 0.62933-0.65802 0.74765-3.3534 0.74765-17.032v-16.25h-5.5681c-4.4817 0-5.7459 0.20275-6.4796 1.0392-0.87673 0.99962-0.91149 0.82003-0.91149-4.7096 0-5.2799 0.4604-7.16 1.1771-4.807 0.24617 0.80821 2.4031 0.94192 15.194 0.94192 12.643 0 15.002-0.14307 15.528-0.94192 1.1882-1.8038 1.4953-0.90864 1.4953 4.3586 0 4.9489-0.61536 7.3578-1.3029 5.1005-0.24801-0.81419-1.3106-0.98172-6.2268-0.98172h-5.9278v16.013 [...]
+ </g>
+ <g id="g12696" transform="translate(221.14 654.3)" stroke="#806600" fill="#e4c900">
+ <path id="path12589-0" d="m697.83 739.81c-5.7745-0.0747-11.018 2.366-14.61 6.986-4.4268 5.6941-5.8236 15.234-3.4111 23.254 1.8977 6.3089 6.9172 11.518 12.539 13.01 3.6428 0.96737 10.772 0.35115 14.143-1.2362 4.4266-2.0846 8.2921-7.2421 9.6726-12.873 1.2973-5.2918 1.3146-9.1142 0.0466-14.286-1.7522-7.147-6.1537-12.055-12.476-13.933-2.0035-0.59486-3.9784-0.89741-5.9033-0.92228zm0.49842 7.5551c3.1194-0.0344 4.9488 0.85244 7.3051 3.3556 6.3248 6.7189 4.6492 20.45-2.9906 24.471-2.7211 1. [...]
+ <path id="path12585-2" d="m895.02 739.81c-5.7745-0.0747-11.018 2.366-14.61 6.986-4.4268 5.6941-5.8237 15.234-3.4111 23.254 1.8976 6.3089 6.9172 11.518 12.539 13.01 3.6428 0.96737 10.772 0.35115 14.143-1.2362 4.4267-2.0846 8.2921-7.2421 9.6726-12.873 1.2975-5.2918 1.3146-9.1142 0.0466-14.286-1.7521-7.147-6.1537-12.055-12.476-13.933-2.0034-0.59486-3.9784-0.89741-5.9032-0.92228zm0.49841 7.5551c3.1194-0.0344 4.9488 0.85244 7.3051 3.3556 6.3248 6.7189 4.6492 20.45-2.9906 24.471-2.721 1.4 [...]
+ <path id="path12573-9" d="m626.48 782.37c0-0.35622 0.33645-0.81033 0.74764-1.0091 0.64179-0.31027 0.74765-3.0528 0.74765-19.37 0-16.13-0.11321-19.127-0.74765-19.79-0.41119-0.42995-0.74764-1.0297-0.74764-1.3328 0-0.30307 2.9158-0.55105 6.4796-0.55105 5.8985 0 7.4682 0.412 5.9811 1.5699-0.27414 0.21345-0.49843 0.78512-0.49843 1.2704 0 0.67191 8.5398 21.172 9.2329 22.164 0.077 0.11023 1.696-3.2807 3.5977-7.5355 6.7828-15.175 6.4193-14.188 5.7344-15.57-0.34186-0.68967-0.62158-1.3991-0.6 [...]
+ <path id="path12571-0" d="m725.18 782.37c0-0.35622 0.33644-0.81033 0.74764-1.0091 1.1226-0.54274 1.1226-37.986 0-39.16-1.4941-1.5622-0.6431-1.8839 4.9843-1.8839 3.1526 0 5.7319 0.14512 5.7319 0.3225 0 0.17737-0.26683 0.86081-0.59297 1.5187-0.5292 1.0676 0.42213 2.5274 8.8471 13.576l9.4401 12.379 0.13525-12.767c0.11541-10.895 0.0241-12.845-0.62304-13.301-1.739-1.2261-0.51119-1.7281 4.226-1.7281 4.9173 0 5.7038 0.34975 4.2366 1.8839-0.63391 0.66282-0.74765 3.6239-0.74765 19.467s0.1137 [...]
+ <path id="path12569-5" d="m794.4 740.37c-5.3864 0.0163-5.6943 0.46707-4.3768 1.8447 1.1226 1.1738 1.1226 38.626 0 39.169-0.4112 0.19875-0.74764 0.66895-0.74764 1.0596 0 0.51712 3.4242 0.6341 12.585 0.43179 14.043-0.31022 15.578-0.68347 19.221-4.6116 1.1118-1.199 2.6561-3.7923 3.4267-5.7693 1.2892-3.3075 1.4018-4.1678 1.4018-10.813 0-6.6448-0.11264-7.5051-1.4018-10.813-0.77058-1.977-2.337-4.6027-3.4734-5.8281-3.4833-3.7564-5.5328-4.2349-19.423-4.5527-3.0497-0.0699-5.4162-0.12325-7.21 [...]
+ <path id="path12565-2" d="m841.48 740.35c-5.0287-0.008-7.8347 0.14199-7.8347 0.43172 0 0.33577 0.33646 0.96335 0.74765 1.3933 1.1226 1.1738 1.1226 38.626 0 39.169-0.41119 0.19875-0.74765 0.64453-0.74765 1.0008 0 0.40377 1.9706 0.64761 5.2335 0.64761 5.1538 0 5.9627-0.33973 4.4858-1.8839-0.5878-0.61457-0.74764-2.3782-0.74764-8.2419v-7.4569h4.3612c3.6061 0 4.4613 0.19121 4.9375 1.0989 0.31714 0.60434 2.1722 4.0541 4.1276 7.6728 3.0642 5.6705 3.4536 6.6868 2.788 7.3-0.42471 0.39126-0.7 [...]
+ <path id="path12561-2" d="m922.37 782.37c0-0.35622 0.33647-0.81032 0.74765-1.0091 0.64181-0.31027 0.74763-3.0528 0.74763-19.37 0-16.13-0.11318-19.127-0.74763-19.79-1.4768-1.5442-0.66799-1.8839 4.4859-1.8839s5.9627 0.33968 4.4859 1.8839c-0.63395 0.66282-0.7477 3.6239-0.7477 19.467s0.11375 18.804 0.7477 19.467c1.4768 1.5442 0.66798 1.8838-4.4859 1.8838-3.2629 0-5.2335-0.24388-5.2335-0.64765z"/>
+ <path id="path12544-7" d="m951.79 783.44c0-0.3031 0.33647-0.90285 0.7477-1.3328 0.62928-0.65802 0.74764-3.3534 0.74764-17.032v-16.25h-5.5681c-4.4817 0-5.7459 0.20275-6.4796 1.0392-0.87671 0.99962-0.91149 0.82003-0.91149-4.7096 0-5.2799 0.46044-7.16 1.1771-4.807 0.24615 0.80821 2.403 0.94192 15.194 0.94192 12.643 0 15.002-0.14307 15.528-0.94192 1.1882-1.8038 1.4953-0.90864 1.4953 4.3586 0 4.9489-0.61536 7.3578-1.303 5.1005-0.24799-0.81419-1.3106-0.98173-6.2268-0.98173h-5.9278v16.013c [...]
+ </g>
+ </g>
+ <g id="g18418" transform="translate(77.288 -33.134)">
+ <g id="g17276-9" transform="matrix(.57673 .81694 -.81694 .57673 1482 118.02)">
+ <g id="g17270-8">
+ <g id="g17182-4">
+ <path id="path14522-58" d="m-284.19 1259.7c8.3552 5.9001 17.565 4.572 25.92 6.8361 3.0295 7.4057 5.9232 14.812 13.387 22.217 7.0413-7.5007 11.008-15.001 15.096-22.502 7.9754-1.265 15.951-1.2448 23.926-4.5573-3.951-6.931-5.774-13.862-15.381-20.793 1.1088-8.64 3.4086-17.28 1.709-25.92-10.808 0.7344-17.319 4.9063-24.496 8.5451-8.1005-3.2281-9.3234-6.4563-24.496-9.6844-3.8182 8.8299 1.1259 17.66 1.709 26.49-5.968 5.6492-14.184 8.8602-17.375 19.369z" stroke="#2d5016" fill="#447821"/>
+ <path id="path14522-5-8" d="m-281.84 1259c7.5406 5.3248 18.511 1.9103 26.052 3.9537 2.7341 6.6836 4.1639 16.617 10.9 23.301 6.3548-6.7694 8.1621-16.789 11.852-23.558 7.1978-1.1416 17.498 1.0925 24.696-1.897-3.5658-6.2553-9.3475-11.772-18.018-18.027 1.0007-7.7976 7.065-17.959 5.5311-25.757-9.754 0.6629-16.812 9.0076-23.289 12.292-7.3107-2.9133-9.153-10.259-22.846-13.172-3.4459 7.9689 5.0048 18.597 5.5311 26.566-5.3861 5.0985-17.528 6.8144-20.408 16.298z" fill="#4e8d21"/>
+ </g>
+ <path id="path17186-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-267.19 1216.5c3.8922 8.5461 11.961 20.239 18.765 29.008-0.33651 1.381-0.56602 1.4165-1.4522 2.5227-8.3086 2.2507-18.979 5.2921-31.812 10.656 9.4016-0.5221 22.342-4.6886 33-7.8437 0.63816 0.2139 1.2993 0.5317 1.9375 1.0937-0.1315 8.484-0.12691 19.253 1.4062 32.594 2.0538-8.9312 1.771-22.022 1.6875-32.969 0.55653-0.5589 1.166-0.996 1.8438-1.3124 10.456 3.9291 25.903 8.1801 32.656 [...]
+ </g>
+ <g id="g14954-4" transform="translate(-29.258 -36.81)">
+ <g id="g14915-7">
+ <g id="g14805-0" transform="translate(-.61411)">
+ <path id="path14278-4-0-0-6-4" d="m-198.63 1259.9c1.3246-1.4812 1.9271-3.4027 0.66156-6.1756-1.0178-2.2302-4.2251-3.4547-5.9101-3.7694-3.9526-0.7383-7.4737 2.4461-11.271 2.4461-3.7971 0-7.3182-3.1844-11.271-2.4461-1.685 0.3147-4.8922 1.5392-5.9101 3.7694-1.2655 2.7729-0.60903 4.6461 0.66156 6.1756 1.294 1.5577 3.185 2.7927 4.4112 4.1905 1.2362 1.4093 0.16766 4.1377 0.048 3.7985 0.16247 0.036-2.7554 0.3044-3.7656-1.2747-1.002-1.5664-1.6627-3.7262-2.7995-5.402-1.1161-1.6457-2.733-2 [...]
+ <path id="path14691-5-0" d="m-201.98 1303.7-2.2292 3.0731-1.5908 5.7509-2.265 2.2562-3.2686 0.4156s2.3684-7.8461 0.4375-11.983c-0.89784-1.9233-4.6354-4.392-4.6354-4.392s-3.4535 2.2191-4.26 4.4231c-1.4084 3.8489 0.41356 11.617 0.41356 11.617l-2.0422 0.562-2.7715-1.61-2.6581-9.022-1.6833-1.3394-1.9755-1.0625-3.3352-0.5094-4.918 0.2861-3.6112-1.2402-1.2804-3.036s8.194 0.1695 11.658-2.8035c1.6109-1.3823 2.9826-5.6463 2.9826-5.6463s-2.5951-3.4242-4.9348-3.6077c-4.0859-0.3209-11.549 4. [...]
+ <g id="g14707-6">
+ <g id="g14513-5" transform="translate(211.14 648.81)" fill="#800000">
+ <path id="path14394-4-38" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-438.95 605.41c-0.59398-0.0193-1.5345 0.0769-2.0926 0.34375-0.8879 0.42458-1.2305 1.2365-1.5 2-0.26719 0.75715 0.0613 1.7188 0.0613 1.7188 0.81307-0.13211 0.6485-1.0222 2.1875-2.0031 0.69517-0.4431 1.7063-0.56512 2.6255-0.28013 1.467 0.4549 2.765 0.86755 3.9683 1.8769 1.2033 1.0093 2.4144 2.1169 4 2.8438 1.106 0.50698 2.476 0.625 3.4062 0.625 0.93028 0 2.269-0.11802 3.375- [...]
+ <g id="g14467-5" transform="translate(0 .13155)">
+ <path id="path14394-4-7-12" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-458.5 637.45c-0.18367 0.52581-0.35275 1.3912-0.25156 1.9589 0.161 0.90329 0.84569 1.4195 1.5042 1.8578 0.65302 0.4346 1.668 0.38975 1.668 0.38975 0.0991-0.76076-0.80157-0.8439-1.316-2.4729-0.23237-0.73584-0.0685-1.671 0.46082-2.4187 0.84481-1.1934 1.602-2.2465 2.9061-3.0608 1.3041-0.81427 2.7046-1.6101 3.8437-2.8391 0.79446-0.85722 1.2887-2.051 1.5473-2.8823 0.25862-0. [...]
+ <path id="path14394-4-7-4-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-434.37 666.55c0.44064 0.34065 1.208 0.77495 1.7786 0.85865 0.90781 0.13319 1.6142-0.35292 2.2383-0.83881 0.61895-0.48189 0.89767-1.4589 0.89767-1.4589-0.69028-0.33479-1.0542 0.49326-2.7623 0.46561-0.77155-0.0125-1.6068-0.46391-2.1485-1.2027-0.86461-1.1791-1.624-2.2307-1.9836-3.7255-0.35964-1.4948-0.67122-3.0752-1.4765-4.5447-0.56169-1.0249-1.5376-1.8716-2.2444-2.3801- [...]
+ </g>
+ <g id="g14467-1-6" transform="matrix(-1 0 0 1 -852.67 .13155)">
+ <path id="path14394-4-7-8-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-458.5 637.45c-0.18367 0.52581-0.35275 1.3912-0.25156 1.9589 0.161 0.90329 0.84569 1.4195 1.5042 1.8578 0.65302 0.4346 1.668 0.38975 1.668 0.38975 0.0991-0.76076-0.80157-0.8439-1.316-2.4729-0.23237-0.73584-0.0685-1.671 0.46082-2.4187 0.84481-1.1934 1.602-2.2465 2.9061-3.0608 1.3041-0.81427 2.7046-1.6101 3.8437-2.8391 0.79446-0.85722 1.2887-2.051 1.5473-2.8823 0.25862-0 [...]
+ <path id="path14394-4-7-4-5-55" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-434.37 666.55c0.44064 0.34065 1.208 0.77495 1.7786 0.85865 0.90781 0.13319 1.6142-0.35292 2.2383-0.83881 0.61895-0.48189 0.89767-1.4589 0.89767-1.4589-0.69028-0.33479-1.0542 0.49326-2.7623 0.46561-0.77155-0.0125-1.6068-0.46391-2.1485-1.2027-0.86461-1.1791-1.624-2.2307-1.9836-3.7255-0.35964-1.4948-0.67122-3.0752-1.4765-4.5447-0.56169-1.0249-1.5376-1.8716-2.2444-2.38 [...]
+ </g>
+ </g>
+ <path id="path14533-05" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-205 1250.8c-1.8151 0.01-3.0507 0.7502-4.7232 1.4688-1.6725 0.7185-3.7712 1.409-5.3081 1.4374-1.7045 0.032-3.8613-0.6321-5.6524-1.3754-1.7911-0.7434-3.2258-1.5628-5.2226-1.4058-1.6583 0.1303-2.9979 0.8161-4.2812 1.7812-0.87703 0.6597-1.5 1.8125-1.5 1.8126 1.1728-0.1215 1.9417-2.3784 5.8438-2.5938 1.6931-0.093 3.4044 0.5412 5.1875 1.2812 1.7831 0.7401 3.6313 1.227 5.625 1.1902 [...]
+ <path id="path14533-8-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-243.91 1264.7c-0.50457 1.7437-0.14467 3.1383 0.0708 4.9457 0.21532 1.8076 0.28304 4.0159-0.12506 5.4979-0.45214 1.6438-1.7 3.5241-2.9202 5.0313-1.2203 1.5072-2.4125 2.651-2.8276 4.6105-0.34478 1.6273-0.0665 3.1063 0.49553 4.6105 0.38425 1.028 1.3134 1.952 1.3135 1.952 0.21568-1.1592-1.731-2.5359-0.83226-6.3392 0.39041-1.6501 1.4834-3.1116 2.6981-4.612 1.2149-1.5005 2.2054-3 [...]
+ <path id="path14561-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-244.35 1302.6c1.0394 0.9562 2.208 1.1126 3.4848 1.3708 2.7091 0.5477 5.1728-0.5562 7.5272-0.2589 0.95589 0.1206 2.396 0.3752 3.2446 0.9449 0.75734 0.5088 1.5485 1.7 1.9254 2.4196 0.56793 1.0766 0.61946 2.0272 0.85129 3.3721 0.23185 1.345 0.3844 2.5872 1.0539 3.8659 0.72259 1.38 2.214 3.3416 5.1605 3.3104l1.6147-0.6705s-0.50296 0.087-1.1141 0.1395c-0.61094 0.055-1.341 0.036-1. [...]
+ <path id="path14561-9-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-186.1 1302.3c-1.0394 0.9562-2.208 1.1126-3.4848 1.3708-2.7091 0.5477-5.1728-0.5562-7.5272-0.2589-0.95589 0.1206-2.396 0.3752-3.2446 0.9449-0.75734 0.5088-1.5485 1.7-1.9254 2.4196-0.56793 1.0766-0.61946 2.0272-0.85129 3.3721-0.23185 1.345-0.3844 2.5872-1.0539 3.8659-0.72259 1.38-2.214 3.3416-5.1605 3.3104l-1.6147-0.6705s0.50296 0.087 1.1141 0.1395c0.61094 0.055 1.341 0.036 1 [...]
+ <path id="path14561-93-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-181.01 1286.7c-0.22701-1.394-1.0495-2.2387-1.8944-3.2303-1.7926-2.1037-4.412-2.757-6.0803-4.4448-0.67736-0.6852-1.6528-1.7748-1.9684-2.7469-0.28146-0.8678-0.16812-2.2934-0.0201-3.0921 0.21821-1.1975 0.76469-1.977 1.4129-3.178 0.64825-1.201 1.2954-2.2723 1.5584-3.6914 0.28388-1.5318 0.32223-3.9956-2.0145-5.7907l-1.684-0.4697s0.44932 0.2421 0.96245 0.5783c0.51449 0.334 1.077 [...]
+ </g>
+ </g>
+ <g id="g14845-9" transform="translate(0 .36517)">
+ <path id="path14522-3-7" d="m-236.58 1277.7c4.4403-3.1355 9.3347-2.4298 13.775-3.633 1.61-3.9357 3.1478-7.8714 7.1145-11.807 3.742 3.9863 5.8502 7.9723 8.0228 11.959 4.2384 0.6723 8.4769 0.6615 12.715 2.4219-2.0997 3.6834-3.0685 7.3669-8.1742 11.05 0.58926 4.5915 1.8115 9.1833 0.90824 13.775-5.7437-0.3903-9.2038-2.6073-13.018-4.5412-4.3049 1.7154-4.9548 3.4311-13.018 5.1468-2.0292-4.6926 0.59836-9.3852 0.90824-14.078-3.1716-3.0023-7.5378-4.7087-9.2338-10.293z" stroke="#2d5016" fi [...]
+ <g id="g14598-3-5" transform="matrix(.53144 0 0 -.53144 -101.42 1966.6)" stroke-width="1.8817">
+ <path id="path14278-4-0-0-6-7-3" d="m-203.04 1264.1c1.2262-1.3978 3.1173-2.6328 4.4112-4.1905 1.2706-1.5295 1.9271-3.4027 0.66156-6.1756-1.0178-2.2302-4.2251-3.4547-5.9101-3.7694-3.9526-0.7383-7.4737 2.4461-11.271 2.4461-3.7971 0-7.3182-3.1844-11.271-2.4461-1.685 0.3147-4.8922 1.5392-5.9101 3.7694-1.2655 2.7729-0.60903 4.6461 0.66156 6.1756 1.294 1.5577 3.185 2.7927 4.4112 4.1905 1.2362 1.4093 0.16766 4.1377 0.048 3.7985 0.16247 0.036-2.7554 0.3044-3.7656-1.2747-1.002-1.5664-1.6 [...]
+ <g id="g14513-7-9" transform="translate(211.14 648.81)" stroke-width="1.8817" fill="#800000">
+ <path id="path14394-4-3-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-438.95 605.41c-0.59398-0.0193-1.5345 0.0769-2.0926 0.34375-0.8879 0.42458-1.2305 1.2365-1.5 2-0.26719 0.75715 0.0613 1.7188 0.0613 1.7188 0.81307-0.13211 0.6485-1.0222 2.1875-2.0031 0.69517-0.4431 1.7063-0.56512 2.6255-0.28013 1.467 0.4549 2.765 0.86755 3.9683 1.8769 1.2033 1.0093 2.4144 2.1169 4 2.8438 1.106 0.50698 2.476 0.625 3.4062 0.625 0.93028 0 2.269-0.11802 3.375 [...]
+ <g id="g14467-2-4" transform="translate(0 .13155)" stroke-width="1.8817">
+ <path id="path14394-4-7-5-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-458.5 637.45c-0.18367 0.52581-0.35275 1.3912-0.25156 1.9589 0.161 0.90329 0.84569 1.4195 1.5042 1.8578 0.65302 0.4346 1.668 0.38975 1.668 0.38975 0.0991-0.76076-0.80157-0.8439-1.316-2.4729-0.23237-0.73584-0.0685-1.671 0.46082-2.4187 0.84481-1.1934 1.602-2.2465 2.9061-3.0608 1.3041-0.81427 2.7046-1.6101 3.8437-2.8391 0.79446-0.85722 1.2887-2.051 1.5473-2.8823 0.25862-0 [...]
+ <path id="path14394-4-7-4-6-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-434.37 666.55c0.44064 0.34065 1.208 0.77495 1.7786 0.85865 0.90781 0.13319 1.6142-0.35292 2.2383-0.83881 0.61895-0.48189 0.89767-1.4589 0.89767-1.4589-0.69028-0.33479-1.0542 0.49326-2.7623 0.46561-0.77155-0.0125-1.6068-0.46391-2.1485-1.2027-0.86461-1.1791-1.624-2.2307-1.9836-3.7255-0.35964-1.4948-0.67122-3.0752-1.4765-4.5447-0.56169-1.0249-1.5376-1.8716-2.2444-2.380 [...]
+ </g>
+ <g id="g14467-1-3-5" transform="matrix(-1 0 0 1 -852.67 .13155)" stroke-width="1.8817">
+ <path id="path14394-4-7-8-4-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-458.5 637.45c-0.18367 0.52581-0.35275 1.3912-0.25156 1.9589 0.161 0.90329 0.84569 1.4195 1.5042 1.8578 0.65302 0.4346 1.668 0.38975 1.668 0.38975 0.0991-0.76076-0.80157-0.8439-1.316-2.4729-0.23237-0.73584-0.0685-1.671 0.46082-2.4187 0.84481-1.1934 1.602-2.2465 2.9061-3.0608 1.3041-0.81427 2.7046-1.6101 3.8437-2.8391 0.79446-0.85722 1.2887-2.051 1.5473-2.8823 0.25862 [...]
+ <path id="path14394-4-7-4-5-0-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-434.37 666.55c0.44064 0.34065 1.208 0.77495 1.7786 0.85865 0.90781 0.13319 1.6142-0.35292 2.2383-0.83881 0.61895-0.48189 0.89767-1.4589 0.89767-1.4589-0.69028-0.33479-1.0542 0.49326-2.7623 0.46561-0.77155-0.0125-1.6068-0.46391-2.1485-1.2027-0.86461-1.1791-1.624-2.2307-1.9836-3.7255-0.35964-1.4948-0.67122-3.0752-1.4765-4.5447-0.56169-1.0249-1.5376-1.8716-2.2444-2.3 [...]
+ </g>
+ </g>
+ <path id="path14533-6-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-205 1250.8c-1.8151 0.01-3.0507 0.7502-4.7232 1.4688-1.6725 0.7185-3.7712 1.409-5.3081 1.4374-1.7045 0.032-3.8613-0.6321-5.6524-1.3754-1.7911-0.7434-3.2258-1.5628-5.2226-1.4058-1.6583 0.1303-2.9979 0.8161-4.2812 1.7812-0.87703 0.6597-1.5 1.8125-1.5 1.8126 1.1728-0.1215 1.9417-2.3784 5.8438-2.5938 1.6931-0.093 3.4044 0.5412 5.1875 1.2812 1.7831 0.7401 3.6313 1.227 5.625 1.190 [...]
+ <path id="path14533-8-0-09" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-243.91 1264.7c-0.50457 1.7437-0.14467 3.1383 0.0708 4.9457 0.21532 1.8076 0.28304 4.0159-0.12506 5.4979-0.45214 1.6438-1.7 3.5241-2.9202 5.0313-1.2203 1.5072-2.4125 2.651-2.8276 4.6105-0.34478 1.6273-0.0665 3.1063 0.49553 4.6105 0.38425 1.028 1.3134 1.952 1.3135 1.952 0.21568-1.1592-1.731-2.5359-0.83226-6.3392 0.39041-1.6501 1.4834-3.1116 2.6981-4.612 1.2149-1.5005 2.205 [...]
+ <path id="path14561-4-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-244.35 1302.6c1.0394 0.9562 2.208 1.1126 3.4848 1.3708 2.7091 0.5477 5.1728-0.5562 7.5272-0.2589 0.95589 0.1206 2.396 0.3752 3.2446 0.9449 0.75734 0.5088 1.5485 1.7 1.9254 2.4196 0.56793 1.0766 0.61946 2.0272 0.85129 3.3721 0.23185 1.345 0.3844 2.5872 1.0539 3.8659 0.72259 1.38 2.214 3.3416 5.1605 3.3104l1.6147-0.6705s-0.50296 0.087-1.1141 0.1395c-0.61094 0.055-1.341 0.036- [...]
+ <path id="path14561-9-0-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-186.1 1302.3c-1.0394 0.9562-2.208 1.1126-3.4848 1.3708-2.7091 0.5477-5.1728-0.5562-7.5272-0.2589-0.95589 0.1206-2.396 0.3752-3.2446 0.9449-0.75734 0.5088-1.5485 1.7-1.9254 2.4196-0.56793 1.0766-0.61946 2.0272-0.85129 3.3721-0.23185 1.345-0.3844 2.5872-1.0539 3.8659-0.72259 1.38-2.214 3.3416-5.1605 3.3104l-1.6147-0.6705s0.50296 0.087 1.1141 0.1395c0.61094 0.055 1.341 0.036 [...]
+ <path id="path14561-93-5-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-181.01 1286.7c-0.22701-1.394-1.0495-2.2387-1.8944-3.2303-1.7926-2.1037-4.412-2.757-6.0803-4.4448-0.67736-0.6852-1.6528-1.7748-1.9684-2.7469-0.28146-0.8678-0.16812-2.2934-0.0201-3.0921 0.21821-1.1975 0.76469-1.977 1.4129-3.178 0.64825-1.201 1.2954-2.2723 1.5584-3.6914 0.28388-1.5318 0.32223-3.9956-2.0145-5.7907l-1.684-0.4697s0.44932 0.2421 0.96245 0.5783c0.51449 0.334 1.0 [...]
+ </g>
+ </g>
+ <g id="g14911-8">
+ <path id="path14863-3" d="m-208.51 1284.2c0 3.731-3.1881 6.7557-7.1209 6.7557s-7.1209-3.0247-7.1209-6.7557c0-3.7311 3.1881-6.7558 7.1209-6.7558s7.1209 3.0247 7.1209 6.7558z" transform="matrix(1.0532 0 0 1.1102 11.129 -141.13)" stroke="#a80" stroke-width=".92479" fill="#f3c702"/>
+ <path id="path14909-8" d="m-215.62 1279.5c-2.8613 0-5.0312 2.1194-5.0312 4.6563s2.181 4.6875 5.0312 4.6875 5.0312-2.1506 5.0312-4.6875-2.1699-4.6563-5.0312-4.6563z" transform="matrix(1.0532 0 0 1.1102 11.129 -141.13)" fill="#fee46e"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g17751-0" transform="matrix(.76465 -.64445 .64445 .76465 61.527 -63.005)">
+ <g id="g17731-8">
+ <path id="path17468-6-1" d="m-314.33 677.22c-2.0099 1.1368-3.4054 2.1027-4.1121 4.8023-0.70671 2.6996-0.43194 3.1947-1.0135 6.4338-0.4873 2.7138-1.3814 4.1059-3.1006 6.2345-1.4594 1.8069-2.5261 2.369-4.7843 2.8439-2.3736 0.49864-5.0516 0.3544-7.2133-0.78125-1.9748-1.0376-3.5918-2.9219-4.5494-4.959-1.1784-2.5062-1.0914-5.2437-1.8156-7.9185-0.46768-1.7274-0.5715-1.8979-1.5621-3.3781-1.5365-2.296-3.7007-3.9687-4.8471-6.49-0.93204-2.0492-1.3245-4.5105-0.84424-6.705 0.5257-2.402 1.4739- [...]
+ <path id="path17628-4" d="m-324.12 640.22c-1.845 0.0117-3.8676 0.64219-5.2188 1.6875-1.7052 1.3192-2.3692 2.3125-2.8438 4.3438-0.42275 1.8094-0.20289 3.9924 0.59375 5.6562 0.95025 1.9846 2.3684 2.9283 4.6562 4.5625 2.4289 1.7349 4.2822 2.1062 7.2812 4.0625 1.1816 0.77079 1.6595 1.8938 1.9688 2.875 0.30923 0.98118 0.42188 1.9215 0.46875 2.6875a2.0069 2.0069 0 0 1 -0.65625 1.5938c-1.1158 1.0207-2.4203 1.734-3.8125 1.8438-1.3922 0.10978-2.6453-0.27581-3.9688-0.8125a2.0069 2.0069 0 0 1 [...]
+ <path id="path17628-7-8" d="m-324.09 642.28c-1.4293 0.009-3.0881 0.54453-4 1.25-1.4552 1.1259-1.7386 1.5336-2.125 3.1875-0.30952 1.3248-0.10704 3.1099 0.46875 4.3125 0.70213 1.4664 1.6722 2.0873 4 3.75 2.1687 1.549 3.9781 1.9174 7.2188 4.0312 1.8301 1.1938 2.3977 2.7518 2.7812 3.9688 0.38354 1.217 0.53921 2.2961 0.59375 3.1875a4.0552 4.0552 0 0 1 -1.3125 3.25c-1.325 1.212-3.16 2.1937-5.0625 2.3438-1.9024 0.15001-3.4644-0.38404-4.9062-0.96875a4.0552 4.0552 0 0 1 -0.375 -0.15625c-1.8 [...]
+ <path id="path17628-7-0-4-8" d="m-324.09 644.66c-0.94508 0.006-2.131 0.44032-2.5312 0.75-1.1642 0.90069-0.96624 0.62923-1.25 1.8438-0.17765 0.76039-0.0373 2.0846 0.28125 2.75 0.41315 0.86288 0.87565 1.1478 3.25 2.8438 1.8657 1.3326 3.6031 1.6714 7.125 3.9688 1.5485 1.0101 2.3195 2.1416 2.875 3.2188 0.48135-0.89896 1.1246-1.8477 2.5-2.9062 3.7404-2.8785 5.9377-3.143 7.5312-4.2812 2.3744-1.696 2.8368-1.9809 3.25-2.8438 0.31858-0.66538 0.4589-1.9896 0.28125-2.75-0.28376-1.2145-0.0858- [...]
+ <path id="path17628-7-0-4-1-4" d="m-324.06 646.97c-0.47863 0.003-1.2488 0.3216-1.1562 0.25-0.88377 0.68375-0.25264-0.22872-0.4375 0.5625-0.0506 0.21667 0.0542 1.0709 0.125 1.2188 0.13477 0.28147 0.11205 0.24072 2.5312 1.9688 1.5738 1.1241 3.2384 1.4634 7.0312 3.9375 0.70293 0.45853 1.2489 0.92332 1.75 1.4062 0.35713-0.34835 0.49165-0.66406 0.96875-1.0312 4.1424-3.1878 6.3892-3.4521 7.5938-4.3125 2.4192-1.728 2.3965-1.6873 2.5312-1.9688 0.0708-0.14787 0.17562-1.0021 0.125-1.2188-0.1 [...]
+ </g>
+ <path id="path17739-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-314.52 671.25c-8.3096-0.0845-18.815 6.6476-24.431 9.2657 6.8324-0.97776 17.352-8.0723 24.431-7.8497 8.7308 0.10203 17.956 3.2918 24.569 7.0882-2.6079-5.0439-15.77-7.8553-24.569-8.5041z" fill="#76ab31"/>
+ <path id="path17745-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-315.34 672.44h1.7668c0.0885-8.9791 0.002-19.997-0.88339-28.977-0.88972 8.9791-0.96456 19.997-0.88339 28.977z" fill="#76ab31"/>
+ </g>
+ <g id="g17406-6" transform="matrix(.40724 .70018 .70018 -.40724 92.857 1317.7)" stroke-width="1.2346">
+ <g id="g17390-1" stroke-width="1.2346">
+ <path id="path15211-4-0-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-504.82 597.7c-3.7085 2.9037-11.769 10.21-16.796 12.723-0.33303 1.2529 0.34893 1.0545 0.69909 1.3304 4.7004-3.1229 11.133-7.8406 16.097-14.054z" fill="#782e51"/>
+ <path id="path15211-0-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-511.52 592.93c-3.9065 3.28-10.599 10.257-14.516 13.593-0.15101 1.2875 0.49569 0.99391 0.88165 1.2172 4.2288-4.4298 9.6441-9.0976 13.634-14.81z" fill="#782e51"/>
+ <path id="path15211-4-9-5-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-502.16 605.82c-4.0993 2.3196-13.157 8.3456-18.502 10.082-0.51574 1.1894 0.18814 1.0947 0.49335 1.4197 5.1128-2.3888 12.176-6.0967 18.009-11.502z" fill="#782e51"/>
+ <path id="path15211-4-7-7-89" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-503.17 615.46c-4.4503 1.5426-14.446 5.8371-20.017 6.5818-0.72172 1.0769-0.012 1.1106 0.22932 1.4854 5.4597-1.4279 13.075-3.8019 19.787-8.0671z" fill="#782e51"/>
+ <path id="path15211-4-7-3-0-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-505.06 625.04c-4.7099 0.0341-15.555 0.8969-21.07-0.18398-1.0289 0.7887-0.36775 1.0481-0.25903 1.4805 5.6292 0.39802 13.604 0.59136 21.329-1.2965z" fill="#782e51"/>
+ <path id="path15211-4-7-3-1-0-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-509.67 633.46c-4.6989-0.32406-15.578-0.28864-20.995-1.7858-1.0859 0.70813-0.44636 1.0171-0.37087 1.4565 5.5827 0.82496 13.52 1.6242 21.366 0.32932z" fill="#782e51"/>
+ <path id="path15211-4-7-3-2-5-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-515.56 639.45c-4.591-1.052-15.343-2.7117-20.461-5.0344-1.183 0.53035-0.59937 0.93511-0.59322 1.381 5.386 1.6845 13.102 3.7104 21.054 3.6535z" fill="#782e51"/>
+ <path id="path15211-4-0-3-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-566.82 597.7c3.7085 2.9037 11.769 10.21 16.796 12.723 0.33303 1.2529-0.34893 1.0545-0.69909 1.3304-4.7004-3.1229-11.133-7.8406-16.097-14.054z" fill="#782e51"/>
+ <path id="path15211-0-3-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-560.12 592.93c3.9065 3.28 10.599 10.257 14.516 13.593 0.15101 1.2875-0.49569 0.99391-0.88165 1.2172-4.2288-4.4298-9.6441-9.0976-13.634-14.81z" fill="#782e51"/>
+ <path id="path15211-4-9-5-3-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-569.48 605.82c4.0993 2.3196 13.157 8.3456 18.502 10.082 0.51574 1.1894-0.18814 1.0947-0.49335 1.4197-5.1128-2.3888-12.176-6.0967-18.009-11.502z" fill="#782e51"/>
+ <path id="path15211-4-7-7-8-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-568.47 615.46c4.4503 1.5426 14.446 5.8371 20.017 6.5818 0.72172 1.0769 0.012 1.1106-0.22932 1.4854-5.4597-1.4279-13.075-3.8019-19.787-8.0671z" fill="#782e51"/>
+ <path id="path15211-4-7-3-0-5-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-566.58 625.04c4.7099 0.0341 15.555 0.8969 21.07-0.18398 1.0289 0.7887 0.36775 1.0481 0.25903 1.4805-5.6292 0.39802-13.604 0.59136-21.329-1.2965z" fill="#782e51"/>
+ <path id="path15211-4-7-3-1-0-8-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-561.97 633.46c4.6989-0.32406 15.578-0.28864 20.995-1.7858 1.0859 0.70813 0.44636 1.0171 0.37087 1.4565-5.5827 0.82496-13.52 1.6242-21.366 0.32932z" fill="#782e51"/>
+ <path id="path15211-4-7-3-2-5-9-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-556.07 639.45c4.591-1.052 15.343-2.7117 20.461-5.0344 1.183 0.53035 0.59937 0.93511 0.59322 1.381-5.386 1.6845-13.102 3.7104-21.054 3.6535z" fill="#782e51"/>
+ </g>
+ <g id="g15989-5" transform="matrix(1.2467 0 0 1.2467 -83.806 -189.55)">
+ <g id="g15918-5" stroke-width=".99030">
+ <path id="path15465-5-3-2-7-6" d="m-355.71 641.62c2.5085-10.253 15.973-24.665 15.973-24.665s-0.15142-1.01-0.73781-1.4738c-0.58639-0.46384-1.6078-0.38151-2.0852-0.72161-0.47746-0.34011-0.3901-1.2354-0.87375-1.5499-0.48365-0.31447-1.5383-0.0481-2.0275-0.33702-0.48918-0.28897-0.60223-1.3226-1.0963-1.5862-0.49404-0.26361-1.3691 0.24287-1.8673 0.004-0.49825-0.23839-0.68284-1.3479-1.1846-1.5612-0.5018-0.21331-1.3208 0.46958-1.8255 0.2812-0.50469-0.18837-0.63193-1.1218-1.1388-1.2853-0.50 [...]
+ <path id="path15465-5-3-2-7-3-1" d="m-366.14 608.18c-0.49724 0.0532-1.4843-0.80324-1.9772-0.72664-0.49286 0.0766-0.98338 0.92228-1.4712 1.0221-0.48783 0.0998-1.2255-0.54619-1.7076-0.42325-0.48214 0.12294-0.70878 1.0148-1.1846 1.1607-0.47578 0.14589-1.1376-0.39109-1.6063-0.22238-0.46877 0.16871-0.7445 1.0431-1.2056 1.2345-0.46109 0.19138-1.2969-0.42649-1.7496-0.21257-0.45275 0.21392-0.52245 1.2596-0.96621 1.496-0.44376 0.23631-1.2616-0.21053-1.6957 0.048-0.4341 0.25857-2.802 2.8326 [...]
+ <path id="path15465-5-3-2-7-3-9-5" d="m-368.12 607.46c-0.49286 0.0766-0.98338 0.92228-1.4712 1.0221-0.48783 0.0998-1.2255-0.54619-1.7076-0.42325-0.48214 0.12294-0.70878 1.0148-1.1846 1.1607-0.47578 0.14589-1.1376-0.39109-1.6063-0.22238-0.46877 0.16871-0.7445 1.0431-1.2056 1.2345-0.46109 0.19138-1.2969-0.42649-1.7496-0.21257-0.45275 0.21392-0.52245 1.2596-0.96621 1.496-0.44376 0.23631-1.2616-0.21053-1.6957 0.048 5.5364 5.1793 11.692 18.599 14.15 30.098h2.288c-0.0589-8.658-1.98-25.9 [...]
+ <path id="path15769-9" d="m-362.04 643.37 5.0254-1.533c3.4371-9.7583 9.395-17.992 15.084-26.561l-1.8035-2.2954h-1.9675l-1.1477-1.8035-1.9675 0.3279-1.3117-1.8036-1.4756 0.328-1.3117-1.3117-1.6396 0.4919-1.1477-1.3117-1.9675 0.8198c-3.4095 10.708-3.1056 23.516-4.3696 34.652z" stroke-width=".99030" fill="#923e66"/>
+ <path id="path15767-1" d="m-357.99 641.67c4.1898-9.127 7.4328-18.254 14.92-27.381l-0.65583-1.3117h-1.4756c-7.8669 9.5642-10.52 19.128-14.756 28.693l-0.4249 0.1639c1.6534-7.0958 2.0358-15.883 11.902-30.332l-1.3117-1.8036-1.4756 0.164c-4.9278 5.3507-10.505 28.848-10.918 31.972l4.1959-0.1639z" fill="#782e51"/>
+ <path id="path15773-3" d="m-377.83 611.17 0.65583-1.4757 1.3117 0.4919c3.7361 5.8061 3.5037 7.517 4.4429 10.11-1.4153-1.4792-1.6487-5.2842-6.4104-9.1258z" fill="#c2779e"/>
+ <path id="path15773-9-8" d="m-382.61 614.61 0.65583-1.4757 1.3117 0.4919c6.6869 6.9849 7.0558 10.138 7.63 12.457-1.215-2.2805-4.7754-7.8728-9.5975-11.473z" fill="#c2779e"/>
+ <path id="path15773-7-8" d="m-366.24 608.24 1.1769-1.1058 1.0182 0.96218c1.7912 7.9048 0.73015 15.154 0.38562 17.531-0.35754-2.7567-0.20534-13.208-2.5806-17.388h-0.00003z" fill="#c2779e"/>
+ <path id="path15771-9" d="m-365.21 641.67c0.48195-11.461-1.253-22.368-4.2629-32.956l-1.9675-0.8198-0.81979 1.4756c4.2475 10.821 6.1909 21.642 6.0664 32.464l0.98375-0.1639z" fill="#9b3b6d"/>
+ <path id="path15465-5-3-2-4" d="m-355.71 641.62c2.5085-10.253 15.973-24.665 15.973-24.665s-0.15142-1.01-0.73781-1.4738c-0.58639-0.46384-1.6078-0.38151-2.0852-0.72161-0.47746-0.34011-0.3901-1.2354-0.87375-1.5499-0.48365-0.31447-1.5383-0.0481-2.0275-0.33702-0.48918-0.28897-0.60223-1.3226-1.0963-1.5862-0.49404-0.26361-1.3691 0.24287-1.8673 0.004-0.49825-0.23839-0.68284-1.3479-1.1846-1.5612-0.5018-0.21331-1.3208 0.46958-1.8255 0.2812-0.50469-0.18837-0.63193-1.1218-1.1388-1.2853-0.5069 [...]
+ </g>
+ <g id="g15201-3-3" transform="matrix(.70457 .70963 -.70963 .70457 471.87 533.93)" stroke-width=".99030">
+ <path id="path15011-4-9" d="m-281.39 1320.4c0 8.8457-7.2412 16.016-16.174 16.016-8.9324 0-16.174-7.1708-16.174-16.016 0-8.8457 7.2412-16.016 16.174-16.016 8.9324 0 16.174 7.1708 16.174 16.016z" transform="matrix(.98945 0 0 .99915 -212.57 -646.73)" fill="#218b4d"/>
+ <path id="path15155-3-5" d="m-297.56 1307c-7.5313 0-13.562 5.9891-13.562 13.406 0 7.4171 6.0251 13.375 13.562 13.375 7.5374 0 13.562-5.9579 13.562-13.375s-6.0312-13.406-13.562-13.406z" transform="matrix(.98945 0 0 .99915 -214.27 -648.42)" fill="#219d56"/>
+ <path id="path15155-1-0-1" d="m-297.56 1309.7c-6.0557 0-10.812 4.7435-10.812 10.656 0 5.9127 4.7443 10.625 10.812 10.625 6.0682 0 10.812-4.7123 10.812-10.625s-4.7568-10.656-10.812-10.656z" transform="matrix(.98945 0 0 .99915 -215.97 -649.64)" fill="#21ad5e"/>
+ <path id="path15155-1-8-4-74" d="m-297.56 1312.8c-4.4122 0-7.75 3.3568-7.75 7.5938s3.3181 7.5625 7.75 7.5625 7.75-3.3255 7.75-7.5625-3.3378-7.5937-7.75-7.5938z" transform="matrix(.98945 0 0 .99915 -215.97 -649.64)" fill="#21cb6d"/>
+ <g id="g15107-8-5" stroke-width=".99030">
+ <path id="path15013-7-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-295.34 1305.3-0.75384 0.2051c4.4798 13.373 2.6156 22.723 2.3438 31.75l1.5373-0.3986c0.26826-8.9085 1.424-17.97-3.1272-31.556zm-4.9337 0.4863-0.53892 0.2188c2.4313 10.404 2.9132 20.81 1.9238 31.219l1.506 0.094c0.99884-10.509-0.43414-21.018-2.8909-31.531zm10.09 0.5899-0.75384 0.098c4.4338 12.602 3.028 20.807 2.455 29.041l1.5373-1.012c0.56872-8.1728 1.2595-15.342-3.2385-28.127z [...]
+ <path id="path15013-8-5-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-522.82 674.03 0.14941-0.76682c13.665 3.4897 22.853 0.94658 31.836 0.0152l-0.28509 1.5623c-8.865 0.91912-17.818 2.7345-31.701-0.81072v0.00002zm0.12414-4.956 0.1788-0.55348c10.554 1.6638 20.692 1.5497 31.001-0.1984l0.2039 1.4951c-10.408 1.7648-20.718 0.93793-31.383-0.74328l-0.0003 0.00003zm1.3263 10.02 0.0426-0.75898c12.893 3.5002 20.973 1.498 29.143 0.32434l-0.89685 1.6072c [...]
+ </g>
+ <path id="path15011-6-9-6" d="m-281.39 1320.4c0 8.8457-7.2412 16.016-16.174 16.016-8.9324 0-16.174-7.1708-16.174-16.016 0-8.8457 7.2412-16.016 16.174-16.016 8.9324 0 16.174 7.1708 16.174 16.016z" transform="matrix(.98945 0 0 .99915 -212.57 -646.73)" stroke="#16502d" stroke-width=".99599" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g17751-03" transform="matrix(.21146 -.78191 .78191 .21146 -409.3 379.5)" stroke-width="1.2346">
+ <g id="g17731-2" stroke-width="1.2346">
+ <path id="path17468-6-2" d="m-314.33 677.22c-2.0099 1.1368-3.4054 2.1027-4.1121 4.8023-0.70671 2.6996-0.43194 3.1947-1.0135 6.4338-0.4873 2.7138-1.3814 4.1059-3.1006 6.2345-1.4594 1.8069-2.5261 2.369-4.7843 2.8439-2.3736 0.49864-5.0516 0.3544-7.2133-0.78125-1.9748-1.0376-3.5918-2.9219-4.5494-4.959-1.1784-2.5062-1.0914-5.2437-1.8156-7.9185-0.46768-1.7274-0.5715-1.8979-1.5621-3.3781-1.5365-2.296-3.7007-3.9687-4.8471-6.49-0.93204-2.0492-1.3245-4.5105-0.84424-6.705 0.5257-2.402 1.4739- [...]
+ <path id="path17628-1" d="m-324.12 640.22c-1.845 0.0117-3.8676 0.64219-5.2188 1.6875-1.7052 1.3192-2.3692 2.3125-2.8438 4.3438-0.42275 1.8094-0.20289 3.9924 0.59375 5.6562 0.95025 1.9846 2.3684 2.9283 4.6562 4.5625 2.4289 1.7349 4.2822 2.1062 7.2812 4.0625 1.1816 0.77079 1.6595 1.8938 1.9688 2.875 0.30923 0.98118 0.42188 1.9215 0.46875 2.6875a2.0069 2.0069 0 0 1 -0.65625 1.5938c-1.1158 1.0207-2.4203 1.734-3.8125 1.8438-1.3922 0.10978-2.6453-0.27581-3.9688-0.8125a2.0069 2.0069 0 0 1 [...]
+ <path id="path17628-7-4" d="m-324.09 642.28c-1.4293 0.009-3.0881 0.54453-4 1.25-1.4552 1.1259-1.7386 1.5336-2.125 3.1875-0.30952 1.3248-0.10704 3.1099 0.46875 4.3125 0.70213 1.4664 1.6722 2.0873 4 3.75 2.1687 1.549 3.9781 1.9174 7.2188 4.0312 1.8301 1.1938 2.3977 2.7518 2.7812 3.9688 0.38354 1.217 0.53921 2.2961 0.59375 3.1875a4.0552 4.0552 0 0 1 -1.3125 3.25c-1.325 1.212-3.16 2.1937-5.0625 2.3438-1.9024 0.15001-3.4644-0.38404-4.9062-0.96875a4.0552 4.0552 0 0 1 -0.375 -0.15625c-1.8 [...]
+ <path id="path17628-7-0-4-7" d="m-324.09 644.66c-0.94508 0.006-2.131 0.44032-2.5312 0.75-1.1642 0.90069-0.96624 0.62923-1.25 1.8438-0.17765 0.76039-0.0373 2.0846 0.28125 2.75 0.41315 0.86288 0.87565 1.1478 3.25 2.8438 1.8657 1.3326 3.6031 1.6714 7.125 3.9688 1.5485 1.0101 2.3195 2.1416 2.875 3.2188 0.48135-0.89896 1.1246-1.8477 2.5-2.9062 3.7404-2.8785 5.9377-3.143 7.5312-4.2812 2.3744-1.696 2.8368-1.9809 3.25-2.8438 0.31858-0.66538 0.4589-1.9896 0.28125-2.75-0.28376-1.2145-0.0858- [...]
+ <path id="path17628-7-0-4-1-7" d="m-324.06 646.97c-0.47863 0.003-1.2488 0.3216-1.1562 0.25-0.88377 0.68375-0.25264-0.22872-0.4375 0.5625-0.0506 0.21667 0.0542 1.0709 0.125 1.2188 0.13477 0.28147 0.11205 0.24072 2.5312 1.9688 1.5738 1.1241 3.2384 1.4634 7.0312 3.9375 0.70293 0.45853 1.2489 0.92332 1.75 1.4062 0.35713-0.34835 0.49165-0.66406 0.96875-1.0312 4.1424-3.1878 6.3892-3.4521 7.5938-4.3125 2.4192-1.728 2.3965-1.6873 2.5312-1.9688 0.0708-0.14787 0.17562-1.0021 0.125-1.2188-0.1 [...]
+ </g>
+ <path id="path17739-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-314.52 671.25c-8.3096-0.0845-18.815 6.6476-24.431 9.2657 6.8324-0.97776 17.352-8.0723 24.431-7.8497 8.7308 0.10203 17.956 3.2918 24.569 7.0882-2.6079-5.0439-15.77-7.8553-24.569-8.5041z" fill="#76ab31"/>
+ <path id="path17745-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-315.34 672.44h1.7668c0.0885-8.9791 0.002-19.997-0.88339-28.977-0.88972 8.9791-0.96456 19.997-0.88339 28.977z" fill="#76ab31"/>
+ </g>
+ </g>
+ <g id="g25668">
+ <g id="g12958" transform="translate(-129.89 -681.95)">
+ <g id="g12880">
+ <path id="path10163-3-8-1" d="m445.6 736.66c-4.2824 12.328 3.8599 16.026-4.817 26.511 17.008-3.1464 25.128-13.05 30.997-28.498 4.994 8.3678 3.1198 15.037-0.50925 23.363 17.63-4.0842 24.667-16.038 30.488-31.921 3.6751 7.4832 1.739 14.02-0.92558 21.374 18.849-5.4278 22.998-20.345 26.37-37.704 2.4616 17.634 10.442 16.392 4.1632 28.822 18.44-10.732 23.857-21.567 25.214-42.238 6.8796 6.1334 7.4754 11.772 5.9213 20.356 5.4604-1.554 9.717-4.3966 13.284-7.9805 4.3068-4.3268 6.1276-10.327 9 [...]
+ <path id="path10163-3-8-1-8-7" d="m367.99 761.59-0.0882 19.785s24.475-11.464 39.815-16.874c11.027-3.8893 37.887-27.837 37.887-27.837-4.2824 12.328 3.8599 16.026-4.817 26.511 17.008-3.1464 25.128-13.05 30.997-28.498 4.994 8.3678 3.1198 15.037-0.50925 23.363 17.63-4.0842 24.667-16.038 30.488-31.921 3.6751 7.4832 1.739 14.02-0.92558 21.374 18.849-5.4278 22.998-20.345 26.37-37.704 2.4616 17.634 10.442 16.392 4.1632 28.822 18.44-10.732 23.857-21.567 25.214-42.238 6.8796 6.1334 7.4754 11 [...]
+ <path id="path10163-3-8-1-8-6" d="m474.08 663.07c-35.375 8.89-70.516 18.849-105.78 28.214l-0.40169 90.088s24.475-11.464 39.815-16.874c11.027-3.8893 43.029-42.641 37.887-27.837-4.2824 12.328 3.8599 16.026-4.817 26.511 12.621-2.3348 20.347-8.39 25.892-17.67 2.7414-6.4083 1.4285-10.604-0.006-14.136-4.1442-10.205-11.477-8.7789-20.525-8.6755-1.5844-0.63033-3.4697-3.7588-3.4697-3.7588 17.353 1.0597 25.737-12.804 29.203-28.047l-8.0959-0.28914s6.8851-7.3091 8.6742-13.011c1.3346-4.2538 1.62 [...]
+ <path id="path10163-3-8-1-8-62" d="m367.97 765.3-0.0717 16.075s24.475-11.464 39.815-16.874c11.027-3.8893 37.887-27.837 37.887-27.837-4.2824 12.328 3.8599 16.026-4.817 26.511 17.008-3.1464 25.128-13.05 30.997-28.498 4.994 8.3678 3.1198 15.037-0.50925 23.363 17.63-4.0842 24.667-16.038 30.488-31.921 3.6751 7.4832 1.739 14.02-0.92558 21.374 18.849-5.4278 22.998-20.345 26.37-37.704 2.4616 17.634 10.442 16.392 4.1632 28.822 18.44-10.732 23.857-21.567 25.214-42.238 6.8796 6.1334 7.4754 11 [...]
+ <path id="path10163-3-8-1-8" d="m445.6 736.66c-4.2824 12.328 3.8599 16.026-4.817 26.511 17.008-3.1464 25.128-13.05 30.997-28.498 4.994 8.3678 3.1198 15.037-0.50925 23.363 17.63-4.0842 24.667-16.038 30.488-31.921 3.6751 7.4832 1.739 14.02-0.92558 21.374 18.849-5.4278 22.998-20.345 26.37-37.704 2.4616 17.634 10.442 16.392 4.1632 28.822 18.44-10.732 23.857-21.567 25.214-42.238 6.8796 6.1334 7.4754 11.772 5.9213 20.356 5.4604-1.554 9.717-4.3966 13.284-7.9805 4.3068-4.3268 6.1276-10.327 [...]
+ <path id="path12863" d="m476.7 694.35 2.8008-17.925s17.395-6.9028 25.767-7.8422c12.989-1.4574 28.731 1.8826 41.452-1.1203 9.346-2.2063 19.681-10.039 29.128-11.763 12.557-2.2918 22.578-1.1034 34.73 2.8008 5.7329 1.8419 11.579 4.5574 15.684 8.9626 3.8148 4.0934 7.2821 15.124 7.2821 15.124s-12.628-12.604-20.726-15.684c-11.029-4.1956-23.746-5.2447-35.29-2.8008-9.9719 2.111-17.065 11.843-26.888 14.564-12.248 3.3931-25.656-0.94707-38.091 1.6805-12.552 2.6524-35.85 14.004-35.85 14.004z" f [...]
+ <path id="path12865" d="m627.22 662.03s18.025 5.3674 21.481 5.1045c3.4566-0.26292 5.3259-0.62723 7.2314-2.7649s2.3396-9.1456 2.3396-9.1456-7.2514 4.2504-11.06 5.7426c-3.8083 1.4922-19.993 1.0634-19.993 1.0634z" fill="#f8ec9c"/>
+ <path id="path12867" d="m663.16 700.1s0.0112-5.9771-1.9142-7.8694c-4.1461-4.075-11.301-2.7584-17.015-3.8284-2.8186-0.52777-8.5075-1.2761-8.5075-1.2761s3.2035 4.4582 5.5299 5.7426c3.3596 1.8548 7.9816 0.36538 11.272 2.3396 2.849 1.7091 6.3806 7.6568 6.3806 7.6568l4.2538-2.7649z" fill="#f8ec9c"/>
+ <path id="path12869" d="m601.69 676.49c-4.8849 6.5261 5.3977 15.516 6.3806 23.608 0.38478 3.1678-1.7426 6.7705-0.21269 9.5709 1.434 2.6249 4.8654 5.7537 7.6568 4.6791 3.0356-1.1686 2.3872-6.1275 2.7649-9.3582 0.4535-3.8786 0.14207-7.8715-0.63807-11.698-1.2052-5.9112-1.191-13.605-6.1679-17.015-2.691-1.8436-7.8289-2.3988-9.7836 0.21269z" fill="#f8ec9c"/>
+ <path id="path9984-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m665.33 685.79s-2.6835-2.8609-8.7353-4.2204c-6.7154-1.5085-12.324-2.327-17.955-7.3726-2.7329-2.4486-6.9494-9.1004-6.9494-9.1004 2.2355 6.927 5.9847 11.244 10.716 14.538 4.2021 2.9246 10.185 2.6418 14.383 4.02 5.899 1.9363 6.8374 3.111 6.8374 3.111l1.7025-0.97523z" fill="#806600"/>
+ <path id="path9986-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m630.2 712.74s-2.9813-6.1882-3.6454-8.6479l-4.0227-14.898s0.60249 10.992 2.197 15.833c0.88032 2.6723 3.8727 8.8442 3.8727 8.8442l1.5984-1.131z" fill="#806600"/>
+ </g>
+ <g id="g12849">
+ <g id="g10008-9-8" transform="matrix(.29716 .95483 -.95483 .29716 1215.1 -49.579)">
+ <path id="path10002-0-5" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-5-4" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-2-7" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ <g id="g10008-9-8-9" transform="matrix(-.56881 .82247 -.82247 -.56881 1565 702.98)">
+ <path id="path10002-0-5-6" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-5-4-6" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-2-7-6" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ <g id="g10008-9-8-7" transform="matrix(-.87584 .48260 -.48260 -.87584 1424.7 1122.3)">
+ <path id="path10002-0-5-0" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-5-4-4" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-2-7-1" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ </g>
+ </g>
+ <g id="g10576" transform="translate(-129.89 -681.95)">
+ <g id="g10559">
+ <g id="g10544">
+ <path id="path12570" d="m441.01 1219.6s0.39576 4.5376 1.4899 6.4562c2.3783 4.1703 6.0317 8.0072 10.429 9.9328 4.7108 2.0627 10.139 1.4501 14.899-0.4966 3.9065-1.5977 8.9395-7.9462 8.9395-7.9462s6.5535 9.5699 11.919 11.919c5.4593 2.3903 11.773 2.5092 17.382 0.4967 6.8632-2.4623 12.577-6.4972 14.899-13.409 1.1379-3.3876 0-10.429 0-10.429s6.7664 2.0942 10.429 1.9866c4.4555-0.1309 9.5056-1.5902 12.416-4.9664 4.2209-4.8966 5.1254-10.635 3.4765-16.886-0.80669-3.0581-5.463-7.4495-5.463-7 [...]
+ <path id="path10280" d="m344.02 1063.3s19.872-9.9038 26.877-20.158c3.7156-5.4393 6.5018-20.293 6.7192-26.877 0.27431-8.3067-4.2207-16.819-8.063-24.189-1.4108-2.706-5.2572-9.4834-9.1248-13.652-4.5728-4.9284-9.1753-7.2791-9.8165-10.27-1.6659-7.771 8.1905-7.6582 8.1905-7.6582l-51.066 4.0315 7.3911 101.46 27.549-14.782 1.3438 12.094z" fill="#ebd25d"/>
+ <path id="path12570-9-0" d="m452.23 1204.3s-8.68 1.9599-12.27 0c-4.2676-2.3299-7.8878-12.27-7.8878-12.27s-2.8736 1.4675-6.82 3.3836c-2.4724 1.2004-3.4035 5.5114-6.2752 3.5919-4.1326-2.7623-10.677-22.533-15.81-25.902-2.033-1.3344-4.2766 19.975-4.7958 17.538-2.5231-11.842-4.2251-23.745-6.7377-25.352-4.0165-2.5684-5.9927 23.265-9.6475 21.02-1.5785-0.9696-3.2074-8.1537-4.9819-17.942-1.259-6.9448-3.5716-14.344-4.5287-14.901-7.1154-4.1395-17.638-4.3568-21.91-11.393-2.1226-3.4961-1.6989- [...]
+ <path id="path12570-9-03" d="m421.91 1046.3s8.187 5.1125 9.7789 8.1701c2.3474 4.5087 0.82619 12.55 2.7715 17.246 1.6812 4.0587 4.0847 5.7654 8.0979 7.5527 4.9083 2.186 9.2451-0.5626 14.087 1.7666 3.0644 1.4741 6.7776 7.6248 6.7776 7.6248s1.1888-6.4493 0-9.3192c-2.5982-6.2726-11.573-8.901-12.938-15.552-1.103-5.3735 2.6411-9.3118 4.3358-14.28 1.1242-3.296 0.80422-6.4108 0.13009-9.9869-1.1473-6.0864-12.708-13.555-12.708-13.555s1.9437-2.3882 3.5412-2.9423c2.6425-0.9166 8.3196 0.4007 8 [...]
+ <path id="path12570-9-8" d="m272.9 966.71 1.5921-17.8c27.049 9.1087 51.368 3.1195 77.096-0.84721 7.656-1.1804 13.367-0.0181 20.333 3.3888 6.1096 2.9881 10.769 7.351 13.555 13.555 1.1569 2.5762 2.7545 6.1433 5.0832 8.472s6.0817 3.5532 8.472 5.0832c4.6911 3.0027 6.7427 9.1079 8.472 14.402 1.7623 5.3957 2.5416 11.861 2.5416 11.861 6.8478 13.615 11.569 27.443 11.94 41.706-0.0789-0.1927-1.0951 16.312-2.6206 22.682-3.349 13.985-10.528 24.322-11.555 38.666-0.61716 8.6177 1.3266 17.636 5. [...]
+ <path id="path12570-7" d="m274.49 948.9-12.029 134.49c17.195-4.0226 37.386-3.053 53.722-8.5074 5.9962-2.002 17.659-11.056 22.278-15.353 0 0 2.8695-5.8566 9.711-13.198 4.7147-5.0593 5.5592-10.824 7.5529-15.863 1.6767-4.2378 0.7992-20.378-1.5483-24.284-6.7608-11.25-12.679-11.197-17.077-21.638-2.317-5.5005-0.59867-10.066-3.9411-16.377-8.6747-16.378-58.669-19.267-58.669-19.267z" fill="#d1b948"/>
+ <path id="path10229" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m535 1185.8c-2.8504-0.016-6.1384 0.762-9.4062 1.5625s-6.5129 1.6413-9.0938 1.7813c-4.4924 0.2436-11.75-1.6875-11.75-1.6876 2.7526 3.3701 9.6546 3.2098 11.844 3.1876 2.8255-0.029 6.0874-1.0147 9.3438-1.8126 3.2564-0.7977 6.4992-1.5458 9.0625-1.5312 1.2671 0.01 2.9448 0.5127 4.2812 1.0312 1.3365 0.5188 2.3125 1.0313 2.3125 1.0313l3.304-5.1042s-2.9467 2.5276-4.3646 1.9773-3.9028-0.426 [...]
+ <path id="path10534" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m422.48 1033.9s2.8887 2.4135 5.142 3.7443 4.9069 3.1178 6.3438 4.7188c2.2565 2.514 4.0718 5.8341 4.9062 9.0937 0.48227 1.8839 0.38403 4.3758 0.25 6.9063-0.13403 2.5304-0.31145 5.1141 0.25 7.3437 0.84194 3.3435 2.1039 6.5455 5.1562 8.5625 1.387 0.9166 3.0354 1.0551 4.5938 1.125 1.5584 0.07 3.062 0.092 4.2188 0.5 2.2167 0.7822 4.1262 1.4937 5.5312 3.0938 0.99621 1.1344 2.0334 3.5103 [...]
+ <path id="path10256" d="m399.31 1006.1c22.023 30.424 12.429 60.236-7.5118 103.19 11.515-38.132 15.82-64.851 7.5118-103.19z" fill="#d1b948"/>
+ <path id="path10282" d="m368.56 1055.1s-2.1021 17.786-1.1832 26.621c0.73723 7.0881 2.3149 14.246 5.3242 20.705 2.149 4.613 8.8737 12.423 8.8737 12.423s7.2656-16.645 10.057-27.213c2.7913-10.568 2.9731-24.509 3.9158-36.086 0.94271-11.578 1.3077-24.304 0-33.129-1.3077-8.8249-5.4607-16.748-9.2401-21.889-3.7793-5.1409-13.015-8.8737-13.015-8.8737s11.381 14.719 13.015 23.072c1.6342 8.3527 0.41155 19.322-2.9579 27.213-3.3695 7.8909-14.79 17.156-14.79 17.156z" fill="#f8ec9c"/>
+ <path id="path10284" d="m387.49 1112.4c12.183 40.376 34.788 65.736 67.234 73.631 12.539 3.051 27.305 3.41 45.166 1.4998-51.176 26.64-119.99-14.316-112.4-75.131z" fill="#f8ec9c"/>
+ <path id="path10540" d="m419.54 1017.7s16.012 6.4043 22.532 11.918c2.5245 2.1348 5.5549 4.8037 7.2624 7.6348 1.4228 2.3592 2.0665 4.8849 2.2346 7.6348 0.14151 2.3149-1.0056 4.5485-1.8622 6.7037-0.93318 2.3481-3.2852 4.1898-3.5381 6.7038-0.37547 3.7328 3.1656 10.8 3.1656 10.8s-5.5129-5.5141-6.3313-9.1245c-1.0288-4.5382 3.0186-9.1931 2.2346-13.78-0.91728-5.3664-4.4-10.103-7.821-14.338-4.8397-5.9916-17.877-14.152-17.877-14.152z" fill="#f6e078"/>
+ <path id="path10542" d="m447.24 1019.9c-6.243-14.446-24.565-16.079-36.407-8.3871 0 0 13.559-1.6061 19.993-0.078 6.123 1.454 16.414 8.4655 16.414 8.4655z" fill="#f6e078"/>
+ </g>
+ <path id="path12570-9" d="m441.01 1219.6s0.39576 4.5376 1.4899 6.4562c2.3783 4.1703 6.0317 8.0072 10.429 9.9328 4.7108 2.0627 10.139 1.4501 14.899-0.4966 3.9065-1.5977 8.9395-7.9462 8.9395-7.9462s6.5535 9.5699 11.919 11.919c5.4593 2.3903 11.773 2.5092 17.382 0.4967 6.8632-2.4623 12.577-6.4972 14.899-13.409 1.1379-3.3876 0-10.429 0-10.429s6.7664 2.0942 10.429 1.9866c4.4555-0.1309 9.5056-1.5902 12.416-4.9664 4.2209-4.8966 5.1254-10.635 3.4765-16.886-0.80669-3.0581-5.463-7.4495-5.463- [...]
+ </g>
+ <g id="g10479">
+ <g id="g10330-8" transform="matrix(.37043 .92886 -.92886 .37043 1030.9 424.27)">
+ <path id="path10002-0-3" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-5-9" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-2-05" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ <g id="g10330-8-2" transform="matrix(.13204 .99124 -.99124 .13204 1204.5 595.32)">
+ <path id="path10002-0-3-2" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-5-9-7" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-2-05-3" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ <g id="g10330-8-2-7" transform="matrix(-.54970 .83536 -.83536 -.54970 1409.4 1201.2)">
+ <path id="path10002-0-3-2-9" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-5-9-7-0" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-2-05-3-2" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ <g id="g10330-8-2-7-3" transform="matrix(.84940 .52775 .52775 -.84940 -369.84 1580.9)">
+ <path id="path10002-0-3-2-9-9" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-5-9-7-0-9" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-2-05-3-2-7" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g26852">
+ <g id="g11758" transform="translate(-129.89 -681.95)">
+ <g id="g11353-9-0" transform="matrix(0.928 .029161 -.045644 .89245 -205.27 -578.85)" stroke-width="1.6469">
+ <path id="path11317-0-2" d="m1287.2 1335.4c-8.022 11.731-12.809 26.276-32.926 40.408 7.2388 1.5148 15.237 2.3593 22.459-1.7528-1.3111 6.0019-9.3714 14.781-13.78 20.008 15.951-0.318 24.909-3.401 33.878-10.993 9.8057-8.3003 17.972-21.922 24.55-42.996l-34.18-4.6742z" fill="#ebd25d"/>
+ <path id="path11319-5-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1282 1352.6c-0.5457 7.5146-3.3774 14.426-7.4053 20.662-0.2015 0.3119-0.8829 0.9921-1.5889 1.4349-0.7732 0.4849-1.5758 0.7333-1.8095 1.0671l4.9138-0.4927-0.1553 2.8043c4.3228-7.5824 7.4572-16.67 6.0451-25.475v-0.0002h0.0001z" fill="#806600"/>
+ <path id="path11351-22-9" d="m1258.9 1372.6c14.625 0.9679 21.861-10.906 20.267-24.102-5.2679 10.177-13.09 18.708-20.267 24.102z" fill="#f6e078"/>
+ <path id="path11317-9-7-9" d="m1287.2 1335.4c-8.022 11.731-12.809 26.276-32.926 40.408 7.2388 1.5148 15.237 2.3593 22.459-1.7528-1.3111 6.0019-9.3714 14.781-13.78 20.008 15.951-0.318 24.909-3.401 33.878-10.993 9.8057-8.3003 17.972-21.922 24.55-42.996l-34.18-4.6742z" stroke="#806600" stroke-width="1.6469" fill="none"/>
+ <path id="path11347-3-7" d="m1286.8 1348.4c1.1657 18.695-5.7718 31.331-15.425 41.177 25.085-5.6209 32.369-22.884 37.54-33.304 1.0807-2.569-7.1543-14.581-22.115-7.8732z" fill="#f6e078"/>
+ <path id="path11349-7-0" d="m1290.7 1352.1c-0.5346 11.28-4.8197 21.094-10.344 30.727 11.729-6.6524 17.383-17.126 21.905-29.358-3.7469-4.038-7.0131-3.8147-11.561-1.3691z" fill="#f8ec9c"/>
+ </g>
+ <g id="g11262">
+ <path id="path10826-9-7" d="m1005.3 661.19c14.662 0.37645 27.574 0.98464 39.18 7.2473 6.247 3.371 9.2296 6.9038 11.263 13.705 9.9676 33.34 7.8689 103.6 7.8689 103.6l63.598 26.458 35.844-30.802s-42.964-61.864-58.49-96.66c-8.4773-19-11.738-45.625-34.941-50.161-34.677-6.7792-105.94-2.2125-105.94-2.2125s-16.736 0.89623-23.966 3.6646c-12.239 4.6863-19.965 22.279-18.247 22.326 11.399-3.1666 22.269-1.5512 31.841 11.763l13.614-7.1165c1.961-1.0251 6.3474 0.294 7.7021 2.4753 0.74299 1.1963 2 [...]
+ <path id="path11254" d="m1019.1 656.1c7.906 0.78285 14.155 0.43336 21.539 3.3654 6.8306 2.7124 11.149 3.2107 15.191 9.3484 12.681 19.254 13.798 74.315 13.798 74.315 14.914 2.742 29.828 6.2962 44.742 16.36-1.2349-9.8876 2.4771-19.775 8.6519-29.663 0 0-18.276-31.795-25.708-49.079-4.1609-9.6766-5.8856-23.757-12.27-32.135-3.3073-4.3402-7.6816-7.0261-12.854-8.7642-27.346-9.1885-64.481-6.3316-93.485-4.6742 0 0-25.531-0.27189-38.396 4.3066-6.5697 2.3381-12.436 12.053-12.436 12.053s11.007- [...]
+ <path id="path11256" d="m1029.1 652.75c14.101 2.6302 20.435 3.8925 26.482 9.6099 6.0469 5.7175 7.5887 9.1635 11.422 21.576 3.8339 12.412 9.5187 54.891 9.5187 54.891 11.932-0.48204 22.92 6.5915 33.95 13.326-1.5005-8.8891 2.3562-16.439 8.2495-23.479 0 0-18.052-34.078-24.114-47.594-6.0621-13.516-5.7109-24.308-11.422-31.094-5.7115-6.7868-9.7547-7.9062-20.307-11.105-10.552-3.199-27.879-2.3278-45.372-2.5383-17.493-0.21054-47.394-0.15013-66.631 4.1248 0 0-5.4575 0.12669-10.788 2.5383-3.10 [...]
+ <path id="path11258" d="m1005.5 649.03c11.76-1.9931 22.978-0.98849 32.307 1.7366 7.3777 2.155 15.203 4.5862 20.895 9.7509 4.3936 3.9866 6.9561 9.7736 9.0544 15.323 6.9813 18.462 11.144 58.157 11.144 58.157 8.6566 0.76416 17.582 3.6777 27.163 11.84 1.6694-6.2684 2.7112-12.537 9.7509-18.805 0 0-19.72-35.389-26.815-53.63-2.7052-6.9552-1.9642-13.87-5.9202-20.198-2.7034-4.3242-7.0158-5.6558-11.492-8.0991-5.1925-2.8342-11.201-4.091-17.064-4.8754-28.076-3.7564-57.788-2.0002-86.017 0.34825 [...]
+ </g>
+ </g>
+ <g id="g15096" transform="translate(-129.89 -681.95)">
+ <g id="g15091">
+ <path id="path12088" d="m1099.6 996.96s-9.5057 11.557-16.097 14.766c-3.1998 1.5581-7.6172 1.8639-10.546 3.8855-3.683 2.542-5.0432 6.6265-4.9956 11.101 0.046 4.3152 2.1785 6.9425 3.3304 11.101 1.1359 4.1011 0.1464 7.3464 1.6652 11.322 1.6836 4.4065 8.326 8.3259 8.326 8.3259s-2.1671-6.2125-0.5551-9.9911c0.9875-2.3147 3.1757-3.6081 5.5506-4.4405 3.8454-1.3478 7.3958-0.8605 11.101-2.5551 4.4038-2.0139 11.656-10.546 11.656-10.546l-9.4361-32.969z" stroke="#806600" stroke-width="1.5" fill [...]
+ <path id="path15087" d="m1073.8 1039.4c-0.1058 2.0853 0.5963 3.8744 0.772 5.1916 0.096 0.7195 0.988 3.357 1.5405 4.5665 1.1341 2.4824 2.1351 2.8854 2.1351 2.8854s-0.067-7.155 1.5875-9.5152c1.8717-2.6702 3.1273-3.2646 6.2147-4.3142 2.6744-0.9092 6.9956 0.3533 9.5662-0.8176 4.1851-1.9063 9.9414-10.437 9.9414-10.437l-6.5651-23.259s-5.8819 6.5582-9.3786 9.1912c-1.7223 1.2969-3.6348 2.3651-5.6273 3.1887-2.3971 0.9908-7.4117 0.8041-9.6794 2.0633-1.9342 1.074-4.3478 5.1339-3.7487 7.2635l1 [...]
+ <path id="path15089" d="m1076.8 1048.3s0.6905-6.7601 2.6949-9.2827c1.7792-2.2392 2.4425-2.611 5.2414-3.1988 3.0423-0.6389 7.6428 0.4079 10.512-0.7892 3.2082-1.3387 6.8279-6.0021 7.6035-9.3908 0.9614-4.2008-2.9944-12.577-2.9944-12.577s-3.1828 10.4-7.4861 12.876c-2.4225 1.3937-7.2662 1.2586-9.881 2.2453-3.1099 1.1735-4.6533 3.2988-5.9895 6.3424-1.8462 4.2051 0.2995 13.774 0.2995 13.774z" fill="#f6e078"/>
+ </g>
+ <g id="g11401">
+ <g id="g11353-3" transform="matrix(.92199 .38722 -.38722 .92199 334.02 -568.85)">
+ <path id="path11317-8" d="m1287.2 1335.4c-8.022 11.731-12.809 26.276-32.926 40.408 7.2388 1.5148 15.237 2.3593 22.459-1.7528-1.3111 6.0019-9.3714 14.781-13.78 20.008 15.951-0.318 24.909-3.401 33.878-10.993 9.8057-8.3003 17.972-21.922 24.55-42.996l-34.18-4.6742z" fill="#ebd25d"/>
+ <path id="path11319-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1282 1352.6c-0.5457 7.5146-3.3774 14.426-7.4053 20.662-0.2015 0.3119-0.8829 0.9921-1.5889 1.4349-0.7732 0.4849-1.5758 0.7333-1.8095 1.0671l4.9138-0.4927-0.1553 2.8043c4.3228-7.5824 7.4572-16.67 6.0451-25.475v-0.0002h0.0001z" fill="#806600"/>
+ <path id="path11351-2" d="m1258.9 1372.6c14.625 0.9679 21.861-10.906 20.267-24.102-5.2679 10.177-13.09 18.708-20.267 24.102z" fill="#f6e078"/>
+ <path id="path11317-9-4" d="m1287.2 1335.4c-8.022 11.731-12.809 26.276-32.926 40.408 7.2388 1.5148 15.237 2.3593 22.459-1.7528-1.3111 6.0019-9.3714 14.781-13.78 20.008 15.951-0.318 24.909-3.401 33.878-10.993 9.8057-8.3003 17.972-21.922 24.55-42.996l-34.18-4.6742z" stroke="#806600" stroke-width="1.5" fill="none"/>
+ <path id="path11347-8" d="m1286.8 1348.4c1.1657 18.695-5.7718 31.331-15.425 41.177 25.085-5.6209 32.369-22.884 37.54-33.304 1.0807-2.569-7.1543-14.581-22.115-7.8732z" fill="#f6e078"/>
+ <path id="path11349-3" d="m1290.7 1352.1c-0.5346 11.28-4.8197 21.094-10.344 30.727 11.729-6.6524 17.383-17.126 21.905-29.358-3.7469-4.038-7.0131-3.8147-11.561-1.3691z" fill="#f8ec9c"/>
+ </g>
+ <g id="g11309">
+ <path id="path13457" d="m1188 1106.7c5.4006-5.2636 8.3353-15.038 5.5214-22.086-1.8482-4.6289-12.62-8.0192-12.62-8.0192s-1.9883-19.516-4.6012-28.922c-2.9731-10.702-12.489-30.894-12.489-30.894s30.1-1.0263 44.434-5.127c23.03-6.588 58.501-26.161 58.501-26.161l-10.6-79.51s-48.284 3.7575-71.779 8.2822c-30.124 5.8014-85.451 34.18-85.451 34.18s-6.279 1.0351-8.5451 2.7607c-6.5341 4.9757-6.8452 10.166-9.4702 18.841-2.8525 9.427-4.8445 16.949-1.4412 25.199 1.7514 4.2458 9.2024 9.5967 9.2024 [...]
+ <path id="path11297" d="m1143.1 1122.7c9.8853-4.2987 33.709-10.063 41.147-21.503 1.9757-3.0387 3.2322-10.063 3.0888-13.759-1.6864-5.1535-16.798-8.8372-16.798-8.8372s-0.1493-21.828-4.017-32.939c-4.7247-13.572-19.281-38.562-19.281-38.562s22.362 1.7557 31.203 1.6715c8.0378-0.077 29.357-4.9362 29.357-4.9362s-18.856-9.8545-16.594-14.928c4.1294-9.2596 0.728-7.0253 7.0332-14.965 4.7457-5.9759 14.077-14.031 17.484-20.859 4.3171-8.651 3.8138-22.019 9.1806-30.061 2.0131-3.0166 5.7697-9.217 [...]
+ <path id="path11299" d="m1124.3 1126.5c22.974-8.3386 41.144-15.602 41.144-15.602s7.1552-4.2518 10.05-6.9091c2.8944-2.6573 6.2221-5.8026 7.2232-8.7934s1.9576-4.3775-0.3141-7.5372-14.76-5.6529-14.76-5.6529-0.78-19.372-2.8264-28.578c-1.0082-4.5356-1.7635-8.3707-3.7686-12.562-6.2265-13.016-20.727-38-20.727-38 18.602-1.0606 42.84 1.8836 54.645-2.1983 0 0-11.349-2.8199-13.19-7.5372-2.5159-6.4458 2.4362-14.032 6.281-19.785 2.8897-4.3238 8.266-6.3628 11.934-10.05 3.4598-3.4777 7.1814-6.94 [...]
+ <path id="path11303" d="m1173.4 990.61c-1.2959-1.8929 0.489-12.87 3.6809-18.405 3.6984-6.4133 11.878-8.9422 17.024-14.264 3.1142-3.2198 6.403-6.5165 8.2822-10.583 2.8896-6.2527 1.6431-8.7647 4.141-15.184 0.6486-1.6669 5.5215-8.7423 5.5215-8.7423s-25.085 4.6344-39.711 9.3619c-14.507 4.6888-32.503 12.718-46.012 19.785-4.9412 2.585-14.264 8.7423-14.264 8.7423s6.5186 8.9801 7.3619 14.264c0.7591 4.7558-0.4609 9.8129-2.3006 14.264-1.8049 4.3664-5.1366 7.9775-8.2821 11.503-1.518 1.7013-5 [...]
+ <path id="path11305" d="m1099.2 996.29c2.104-0.33629 5.1389-0.61456 6.4416-2.3006 4.8692-6.3016 7.6381-16.249 5.5215-23.926-1.1245-4.0788-5.273-7.1734-9.2024-8.7423-2.7064-1.0806-6.2634-1.532-8.7423 0-3.7925 2.3439-4.9573 7.624-5.9816 11.963-0.9514 4.0303-1.1054 8.4324 0 12.423 0.9549 3.4474 2.6116 7.1218 5.5215 9.2024 1.7863 1.2772 4.2732 1.727 6.4417 1.3804z" fill="#f8f8f6"/>
+ <path id="path11307" d="m1114.7 1127.8c7.0661-4.0784 12.647-6.9361 19.77-10.237 0 0 15.34-4.3714 21.304-11.43 4.5145-5.343 4.7582-13.292 5.5215-20.245 0.9383-8.5473 0.9471-17.448-1.227-25.767-3.006-11.503-10.404-21.386-15.951-31.902-3.9291-7.449-12.27-22.086-12.27-22.086s-12.335-0.5626-17.791 1.8405c-2.2536 0.9925-5.5214 4.908-5.5214 4.908s4.7395 12.554 7.9754 18.405c6.1218 11.069 17.004 19.454 21.472 31.288 2.4013 6.3595 2.7373 13.453 2.4539 20.245-0.2524 6.0508-0.7075 12.516-3.6 [...]
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g13390" transform="translate(77.998 -33.134)">
+ <g id="g13306">
+ <path id="path11952" d="m675.26 567.42c7.5625 1.209 15.601 3.071 22.957 0.937 4.7428-1.376 9.4506-4.3181 12.181-8.433 25.132-37.876-35.464-94.583-68.87-89.015-9.37 1.5617-19.607 0.4498-28.11 4.685-7.5148 3.743-14.139 10.027-18.272 17.335-8.188 14.479-10.776 48.724-10.776 48.724s59.794 20.796 90.889 25.768z" stroke="#806600" stroke-width="1px" fill="#025"/>
+ <g id="g38078">
+ <g id="g38073" transform="translate(-.00593 .0026957)">
+ <path id="path15826-93" fill="#134495" d="m548.39-74.926c-176.96 0-320.41 143.43-320.41 320.33s143.44 320.29 320.41 320.29c176.96 0 320.44-143.39 320.44-320.29s-143.48-320.33-320.44-320.33zm0.0348 61.996c142.19 0 257.27 114.31 257.27 258.33s-115.07 258.33-257.27 258.33c-142.19-0.00011-257.3-114.32-257.3-258.33 0.00012-144.01 115.12-258.33 257.3-258.33z"/>
+ <path id="path38037" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m548.4-63.66c-170.13 0-308.74 138.41-308.74 309.06s138.61 309.03 308.74 309.03 308.71-138.38 308.71-309.03c0-170.64-138.58-309.06-308.71-309.06zm0 40.384c149.13 0 269.09 120.26 269.09 268.67s-119.95 268.64-269.09 268.64-269.12-120.24-269.12-268.64c0-148.41 119.99-268.67 269.12-268.67z" fill="#134da7"/>
+ <path id="path38037-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m548.4-58.596c-167.51 0-303.78 136.13-303.78 303.99 0 167.87 136.27 303.96 303.78 303.96s303.75-136.1 303.75-303.96-136.24-303.99-303.75-303.99zm0 30.256c151.76 0 274.06 122.55 274.06 273.74s-122.3 273.71-274.06 273.71-274.09-122.52-274.09-273.71 122.33-273.74 274.09-273.74z" fill="#1356bb"/>
+ </g>
+ <g id="g33724" transform="matrix(1 0 0 1.0202 0 -7.8935)" stroke-width=".99006">
+ <path id="path15826-9-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m548.38-71.212c-179.87 0-325.91 143.06-325.91 319.5 0 176.43 146.04 319.46 325.91 319.46s325.95-143.03 325.95-319.46c0-176.44-146.07-319.5-325.95-319.5zm0 11.017c174.05 0 314.93 138.11 314.93 308.48s-140.88 308.45-314.93 308.45-314.9-138.08-314.9-308.45 140.85-308.48 314.9-308.48zm0.0348 49.752c-145.08 0-262.81 114.58-262.81 258.73s117.73 258.73 262.81 258.73 262.77-114.57 262. [...]
+ <path id="path15826-9-8-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m548.38-68.219c-178.29 0-322.91 141.72-322.91 316.5s144.62 316.47 322.91 316.47 322.97-141.69 322.97-316.47-144.68-316.5-322.97-316.5zm0 5c175.64 0 317.97 139.48 317.97 311.5s-142.33 311.47-317.97 311.47-317.91-139.45-317.91-311.47 142.27-311.5 317.91-311.5zm0.0625 55.781c-143.5 0-259.81 113.2-259.81 255.72s116.3 255.72 259.81 255.72 259.75-113.19 259.75-255.72-116.25-255.72- [...]
+ </g>
+ </g>
+ <g id="g13232">
+ <g id="g12673">
+ <g id="g12545">
+ <g id="g12056">
+ <path id="rect11854" d="m558.02 466.87 85.458 4.8159-38.572 8.798-19.428 31.26v199.18c-3.7227 21.755-1.8144 40.074-36.907 68-33.269-22.667-34.513-45.333-36.907-68v-132.05-67.14l20.416-31.82 25.94-13.053z" fill="#134495"/>
+ <path id="path12024" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m552.56 467.19c-15.317 15.554-26.124 37.57-27.531 64.312v0.6875 0.65625l-0.41338 223.48 10.983 12.126 12.636 10.472 12.085-10.472 10.983-12.126-1.3-222.76c0.95358-17.011 5.7662-25.786 14.625-34.781 8.9192-9.0566 23.271-17.543 41.312-26.938l-25.95-2.8391-47.425-1.8172z" fill="#134da7"/>
+ <path id="path12024-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m562.96 467.65c-1.7306 1.5464-3.4182 3.1487-5.0587 4.8144-14.251 14.471-24.051 34.278-25.375 59.438v0.4375 0.4375 232.66l7.3707 7 8.4731 6.4488 7.9219-6.7244 7.9219-7.2756-1.7188-231.42c0.001-0.0218-0.001-0.0407 0-0.0625 1.0005-18.785 8.3474-32.345 18.321-42.473 8.3544-8.4831 18.705-13.402 33.004-21.161l-8.7044-0.25455-42.156-1.8637z" fill="#1356bb"/>
+ <path id="rect11854-3" d="m558.02 466.87 85.458 4.8159-38.572 8.798-19.428 31.26v199.18c-3.7227 21.755-1.8144 40.074-36.907 68-33.269-22.667-34.513-45.333-36.907-68v-132.05-67.14l20.416-31.82 25.94-13.053z" stroke="#003380" fill="none"/>
+ <g id="g11948">
+ <path id="rect11854-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m549.85 463.6c-8.5764 2.989-16.257 7.5738-22.592 13.568-9.2264 8.7302-15.599 20.45-17.73 34.583l-0.0312 0.28125-0.0312 0.28125-3.3125 67.125v0.125 0.15625 103.22h11v-102.97-0.25l3.2812-66.5c5.6272-32.449 34.384-44.68 64.218-45.197-11.134-6.4108-21.547-7.6342-34.803-4.4226zm90.085 2.6825c-20.662-0.81657-35.535 6.9171-44.594 19.406-10.353 14.273-13.451 33.89-13.531 54.719-0.2981 [...]
+ <path id="rect11854-7-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m566.16 464.2c-29.417 1.3995-46.081 19.139-54.026 47.254l-2.9761 68.141v0.0625 0.0625 101.22h5v-101.09-0.125l3.3125-66.875c3.849-25.249 21.942-41.672 46.781-44.531l12.317-1.4176c-2.9897-0.89892-4.9599-2.956-10.409-2.6968zm73.717 5.0832c-19.911-0.56041-33.611 6.418-42.125 18.156-9.7308 13.415-12.858 32.446-12.938 52.969-0.29824 70.651-1.8438 140.47-1.8438 140.47l5 0.0937s1.54 [...]
+ </g>
+ </g>
+ <g id="g11736-4-3" transform="translate(-125.81 -642.42)">
+ <path id="path11734-6-5" d="m683.36 1280.5c0 5.2985-4.5155 9.5937-10.086 9.5937-5.5701 0-10.086-4.2952-10.086-9.5937 0-5.2984 4.5155-9.5936 10.086-9.5936 5.5701 0 10.086 4.2952 10.086 9.5936z" transform="translate(1.0944 .17020)" fill="#025"/>
+ <g id="g11483-4-0-4" transform="translate(-23.894 63.672)">
+ <path id="path11472-7-3-3" d="m698.26 1202.5c-7.2466 0-14.594 5.5968-14.594 14.594 0 8.997 7.3471 14.594 14.594 14.594 7.2466 0 14.594-5.5968 14.594-14.594 0-8.997-7.3471-14.594-14.594-14.594zm0 7.75c3.7862 0 6.8438 3.0576 6.8438 6.8438s-3.0575 6.8438-6.8438 6.8438c-3.7862 0-6.8438-3.0576-6.8438-6.8438s3.0575-6.8438 6.8438-6.8438z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path11477-1-2-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m698.28 1204.7c-6.9434 0-12.464 5.6333-12.464 12.309 0 6.677 5.532 12.278 12.464 12.278 6.9334 0 12.43-5.6105 12.43-12.278 0-6.6659-5.4861-12.309-12.43-12.309zm0 2.9415c5.1743 0 9.3144 4.1931 9.3144 9.3679 0 5.1738-4.1414 9.336-9.3144 9.336-5.174 0-9.3483-4.1611-9.3483-9.336 0-5.1758 4.1729-9.3679 9.3483-9.3679z" fill="#f6e078"/>
+ </g>
+ </g>
+ <g id="g11736-4-3-5" transform="translate(-117.56 -782.8)">
+ <path id="path11734-6-5-9" d="m683.36 1280.5c0 5.2985-4.5155 9.5937-10.086 9.5937-5.5701 0-10.086-4.2952-10.086-9.5937 0-5.2984 4.5155-9.5936 10.086-9.5936 5.5701 0 10.086 4.2952 10.086 9.5936z" transform="translate(1.0944 .17020)" fill="#025"/>
+ <g id="g11483-4-0-4-5" transform="translate(-23.894 63.672)">
+ <path id="path11472-7-3-3-4" d="m698.26 1202.5c-7.2466 0-14.594 5.5968-14.594 14.594 0 8.997 7.3471 14.594 14.594 14.594 7.2466 0 14.594-5.5968 14.594-14.594 0-8.997-7.3471-14.594-14.594-14.594zm0 7.75c3.7862 0 6.8438 3.0576 6.8438 6.8438s-3.0575 6.8438-6.8438 6.8438c-3.7862 0-6.8438-3.0576-6.8438-6.8438s3.0575-6.8438 6.8438-6.8438z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path11477-1-2-6-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m698.28 1204.7c-6.9434 0-12.464 5.6333-12.464 12.309 0 6.677 5.532 12.278 12.464 12.278 6.9334 0 12.43-5.6105 12.43-12.278 0-6.6659-5.4861-12.309-12.43-12.309zm0 2.9415c5.1743 0 9.3144 4.1931 9.3144 9.3679 0 5.1738-4.1414 9.336-9.3144 9.336-5.174 0-9.3483-4.1611-9.3483-9.336 0-5.1758 4.1729-9.3679 9.3483-9.3679z" fill="#f6e078"/>
+ </g>
+ </g>
+ </g>
+ <g id="g12658" transform="translate(-211.14 -648.81)">
+ <path id="path12334-5" d="m759.36 1429.6c-13.826-5.0617-24.32-12.778-32.281-23.515-8.254-11.132-11.807-20.44-13.295-40.302-0.55117-7.3573 1.7717-21.596-0.37374-33.355-1.5228-8.3461-4.825-14.448-11.744-19.471 9.0874-7.9144 22.97-4.4209 25.169 7.607 3.58-2.8755 6.8604-3.7984 9.6537-3.3455 5.2566 0.8525 8.7882 6.5775 9.3455 13.332-3.0405-2.0098-5.6938-3.3221-7.838-2.4745-16.99 6.7164-15.508 46.188-6.7802 58.104 8.6977 11.875 15 3.5265 18.74-2.5227 1.9089-3.0877 0-9.6946 0-9.6946-5.7 [...]
+ <path id="path12334-5-1-7-5" d="m759.43 1429.6c-13.826-5.0617-24.39-12.778-32.35-23.515-8.254-11.132-11.807-20.44-13.295-40.302-0.55117-7.3573 1.7717-21.596-0.37374-33.355-0.76141-4.1731-1.9677-7.7851-3.8484-10.982 0 0 3.4129 0.9174 4.7706 2.4763 3.4686 3.9826 5.0378 7.5896 5.7977 12.816 1.8588 12.785-1.5608 28.578 1.2206 41.194 1.5097 6.8479 4.2458 10.998 8.2388 16.75 7.5848 10.925 18.917 15.855 29.84 22.342 11.782-5.74 21.511-12.141 29.84-22.342 4.4349-5.4318 6.7292-9.9017 8.23 [...]
+ <path id="path12632" d="m701.67 1312.8 6.3404-3.5766 5.8526-0.6503 6.1778 2.1134 3.5766 2.6012 1.9509 4.2269 1.4632 2.9263 4.8772-2.7637 5.2024-0.4877 4.3895 2.4386 2.4386 3.9017 1.6257 4.2269v2.7638s-4.2761-5.2571-7.3158-6.3404c-1.7363-0.6188-3.7453-0.308-5.5275 0.1626-3.0235 0.7984-8.2912 4.3895-8.2912 4.3895s-3.4074-8.5219-6.6655-11.543c-2.2928-2.1259-5.4207-3.305-8.4538-4.0644-2.473-0.6192-7.641-0.3251-7.641-0.3251z" fill="#f8eca8"/>
+ <path id="path12632-5" d="m816.8 1312.8-6.3404-3.5766-5.8526-0.6503-6.1778 2.1134-3.5766 2.6012-1.9509 4.2269-1.4632 2.9263-4.8772-2.7637-5.2024-0.4877-4.3895 2.4386-2.4386 3.9017-1.6257 4.2269v2.7638s4.2761-5.2571 7.3158-6.3404c1.7363-0.6188 3.7453-0.308 5.5275 0.1626 3.0235 0.7984 8.2912 4.3895 8.2912 4.3895s3.4074-8.5219 6.6655-11.543c2.2928-2.1259 5.4207-3.305 8.4538-4.0644 2.473-0.6192 7.641-0.3251 7.641-0.3251z" fill="#f8eca8"/>
+ <path id="path12656" d="m734.71 1376.3s-1.0015-5.4349 0.15797-7.7405c1.1972-2.3807 2.522-4.0695 5.055-4.897 1.8026-0.5889 5.1727-0.5018 6.9506 0.1579 4.7726 1.7708 12.322 9.6361 12.322 9.6361s7.5895-8.0901 12.795-9.952c2.2829-0.8165 5.0553-1.3101 7.2666-0.3159 1.9802 0.8903 3.3612 3.0161 4.1072 5.055 0.94105 2.5718 0.15797 8.2143 0.15797 8.2143l0.15797 0.158 1.4217-1.5797 1.7377-4.4231-0.94781-6.3188-3.0014-5.055-6.3188-2.6854-5.3709 1.2637-5.055 3.4753 1.4217-8.2143-0.4739-5.371 [...]
+ <path id="path12334-5-1" d="m759.36 1429.6c-13.826-5.0617-24.32-12.778-32.281-23.515-8.254-11.132-11.807-20.44-13.295-40.302-0.55117-7.3573 1.7717-21.596-0.37374-33.355-1.5228-8.3461-4.825-14.448-11.744-19.471 9.0874-7.9144 22.97-4.4209 25.169 7.607 3.58-2.8755 6.8604-3.7984 9.6537-3.3455 5.2566 0.8525 8.7882 6.5775 9.3455 13.332-3.0405-2.0098-5.6938-3.3221-7.838-2.4745-16.99 6.7164-15.508 46.188-6.7802 58.104 8.6977 11.875 15 3.5265 18.74-2.5227 1.9089-3.0877 0-9.6946 0-9.6946-5 [...]
+ </g>
+ </g>
+ <g id="g13186">
+ <g id="g11724" transform="translate(-211.14 -648.81)">
+ <g id="g11718">
+ <path id="path11534-3-4" d="m585.25 1162c37.007 22.132 131.86 67.896 230.61 101.66 4.2321-3.1294 8.2678-8.0262 14.151-11.415 1.3293-0.7657 1.2308-1.4544 2.9731-2.0283 20.017-6.5938 49.857-10.617 67.722-18.541 11.799-5.2333 15.942-11.678 19.284-19.561-98.369 2.4173-214.6-59.448-303.25-100.12" fill="#134495"/>
+ <path id="path11664" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m907.59 1227.2c-1.3178 1.3178-29.939 0.3641-52.141-7.0983-35.569-11.955-88.371-29.254-121.54-42.935-60.727-25.049-115.99-52.738-133.94-65.781l-23.5 32.375c26.216 19.049 80.022 44.733 142.19 70.375 35.642 14.702 107.81 39.911 107.81 39.911l9.6602-4.8186 19.852-4.7048 16.23-3.5427 16.582-4.9206 10.444-4.192 8.3538-4.6678z" fill="#134da7"/>
+ <path id="path11664-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m896.05 1233.4c-10.504 2.3516-31.348-2.6149-42.277-7.2025-37.193-15.612-81.708-27.876-121.77-44.401-60.907-25.123-115.99-52.55-134.97-66.344l-17.625 24.25c25.183 18.298 79.171 44.244 141.16 69.812 36.362 14.999 75.017 29.527 111.17 41.211l40.096-9.7808 24.219-7.5455z" fill="#1356bb"/>
+ <path id="path11534-3-4-0" d="m585.25 1162c37.007 22.132 132.08 67.468 230.82 101.24 7.0467-7.0523 13.806-12.692 23.407-14.979 31.827-7.5834 74.334-13.261 80.509-36.138-98.369 2.4173-214.6-59.448-303.25-100.12" stroke="#003380" fill="none"/>
+ </g>
+ <g id="g11660">
+ <path id="path11656" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m619.03 1105.3-4.5938 10c64.979 29.813 149.01 74.894 228.75 94.709 17.727 4.4051 37.242 8.3967 54.289 10.007 8.3976 0.7932 25.525-0.093 24.669-13.205-15.849 8.843-50.174-0.8911-76.303-7.1851-77.674-18.711-160.11-63.726-226.81-94.326zm-30.969 53.989-5.625 9.4374c37.631 22.505 126.23 63.415 225.38 97.319 8.8902 0.9967 11.463-2.4284 12.158-7.1684-79.58-27.657-157.96-59.064-231.91-99 [...]
+ <path id="path11534-3-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m617.16 1107.2-2.0625 4.5624c44.28 20.31 98.488 48.729 152.76 70.519 54.46 21.865 122.83 38.178 143.32 34.489l6.7934-4.6954c-25.343 6.3378-93.638-12.593-148.24-34.419-54.038-21.601-108.15-50.082-152.57-70.456zm-30.625 54.437-2.5625 4.2813c37.343 22.333 125.92 63.492 224.81 97.312 2.1722-0.4341 4.9562 0.05 5.2299-3.2321-98.586-33.714-190.81-76.43-227.48-98.362z" fill="#f6e078"/>
+ </g>
+ </g>
+ <g id="g13182" transform="translate(8.796 4.5108)">
+ <path id="path12220-1" d="m399.24 513.69-9.3706-4.226-3.1236-22.784 18.925-11.576 12.494 5.8796-17.639 11.943-1.2862 20.762z" fill="#134da7"/>
+ <path id="path12220" d="m393.54 516.63-9.3706-4.226-2.0211-28.112 21.865-14.332 12.494 5.8796-22.6 14.332-0.36748 26.458z" fill="#134495"/>
+ </g>
+ <g id="g11736" transform="translate(-171.61 -739.31)">
+ <path id="path11734" d="m683.36 1280.5c0 5.2985-4.5155 9.5937-10.086 9.5937-5.5701 0-10.086-4.2952-10.086-9.5937 0-5.2984 4.5155-9.5936 10.086-9.5936 5.5701 0 10.086 4.2952 10.086 9.5936z" transform="translate(1.0944 .17020)" fill="#025"/>
+ <g id="g11483-4" transform="translate(-23.894 63.672)">
+ <path id="path11472-7" d="m698.26 1202.5c-7.2466 0-14.594 5.5968-14.594 14.594 0 8.997 7.3471 14.594 14.594 14.594 7.2466 0 14.594-5.5968 14.594-14.594 0-8.997-7.3471-14.594-14.594-14.594zm0 7.75c3.7862 0 6.8438 3.0576 6.8438 6.8438s-3.0575 6.8438-6.8438 6.8438c-3.7862 0-6.8438-3.0576-6.8438-6.8438s3.0575-6.8438 6.8438-6.8438z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path11477-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m698.28 1204.7c-6.9434 0-12.464 5.6333-12.464 12.309 0 6.677 5.532 12.278 12.464 12.278 6.9334 0 12.43-5.6105 12.43-12.278 0-6.6659-5.4861-12.309-12.43-12.309zm0 2.9415c5.1743 0 9.3144 4.1931 9.3144 9.3679 0 5.1738-4.1414 9.336-9.3144 9.336-5.174 0-9.3483-4.1611-9.3483-9.336 0-5.1758 4.1729-9.3679 9.3483-9.3679z" fill="#f6e078"/>
+ </g>
+ </g>
+ <g id="g11736-4" transform="translate(-59.399 -697.34)">
+ <path id="path11734-6" d="m683.36 1280.5c0 5.2985-4.5155 9.5937-10.086 9.5937-5.5701 0-10.086-4.2952-10.086-9.5937 0-5.2984 4.5155-9.5936 10.086-9.5936 5.5701 0 10.086 4.2952 10.086 9.5936z" transform="translate(1.0944 .17020)" fill="#025"/>
+ <g id="g11483-4-0" transform="translate(-23.894 63.672)">
+ <path id="path11472-7-3" d="m698.26 1202.5c-7.2466 0-14.594 5.5968-14.594 14.594 0 8.997 7.3471 14.594 14.594 14.594 7.2466 0 14.594-5.5968 14.594-14.594 0-8.997-7.3471-14.594-14.594-14.594zm0 7.75c3.7862 0 6.8438 3.0576 6.8438 6.8438s-3.0575 6.8438-6.8438 6.8438c-3.7862 0-6.8438-3.0576-6.8438-6.8438s3.0575-6.8438 6.8438-6.8438z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path11477-1-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m698.28 1204.7c-6.9434 0-12.464 5.6333-12.464 12.309 0 6.677 5.532 12.278 12.464 12.278 6.9334 0 12.43-5.6105 12.43-12.278 0-6.6659-5.4861-12.309-12.43-12.309zm0 2.9415c5.1743 0 9.3144 4.1931 9.3144 9.3679 0 5.1738-4.1414 9.336-9.3144 9.336-5.174 0-9.3483-4.1611-9.3483-9.336 0-5.1758 4.1729-9.3679 9.3483-9.3679z" fill="#f6e078"/>
+ </g>
+ </g>
+ <g id="g11736-6" transform="translate(-115.23 -716.54)">
+ <path id="path11734-9" d="m683.36 1280.5c0 5.2985-4.5155 9.5937-10.086 9.5937-5.5701 0-10.086-4.2952-10.086-9.5937 0-5.2984 4.5155-9.5936 10.086-9.5936 5.5701 0 10.086 4.2952 10.086 9.5936z" transform="translate(1.0944 .17020)" fill="#025"/>
+ <g id="g11483-4-4" transform="translate(-23.894 63.672)">
+ <path id="path11472-7-1" d="m698.26 1202.5c-7.2466 0-14.594 5.5968-14.594 14.594 0 8.997 7.3471 14.594 14.594 14.594 7.2466 0 14.594-5.5968 14.594-14.594 0-8.997-7.3471-14.594-14.594-14.594zm0 7.75c3.7862 0 6.8438 3.0576 6.8438 6.8438s-3.0575 6.8438-6.8438 6.8438c-3.7862 0-6.8438-3.0576-6.8438-6.8438s3.0575-6.8438 6.8438-6.8438z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path11477-1-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m698.28 1204.7c-6.9434 0-12.464 5.6333-12.464 12.309 0 6.677 5.532 12.278 12.464 12.278 6.9334 0 12.43-5.6105 12.43-12.278 0-6.6659-5.4861-12.309-12.43-12.309zm0 2.9415c5.1743 0 9.3144 4.1931 9.3144 9.3679 0 5.1738-4.1414 9.336-9.3144 9.336-5.174 0-9.3483-4.1611-9.3483-9.336 0-5.1758 4.1729-9.3679 9.3483-9.3679z" fill="#f6e078"/>
+ </g>
+ </g>
+ <g id="g11149-7" transform="matrix(.44531 -.89538 .89538 .44531 -1036.2 1246.6)">
+ <path id="path10641-7-3-0-2-8-3-0-3-0" d="m1374.6 973.67c3.1081-27.061-26.817-42.98-60.571-54.882-33.723 11.892-63.625 27.793-60.579 54.809l22.682-11.398c6.3838-7.5095 19.209-12.001 37.897-21.623 18.688 9.6227 31.513 14.114 37.986 21.792l22.585 11.303z" stroke="#806600" fill="#e7cd54"/>
+ <g id="g11031-9-3" transform="translate(666.72 -174.12)">
+ <g id="g10991-23-9" transform="translate(-313.84 600.91)">
+ <path id="path10641-7-3-0-2-8-9-9" d="m961.12 517.91c-18.688 9.6227-31.513 14.114-37.986 21.792-6.4729 7.6778-6.5936 18.542 0.1277 40.911 0.313 2.7591 0.7016 5.912-0.675 8.3044-1.4428 2.5072-4.3036 4.7231-7.088 4.1522s-4.5666-2.9772-4.3877-5.8823c0.1407-2.2848 4.0502-5.8823 4.0502-5.8823-36.844-46.544 1.1901-69.396 45.959-85.183 44.768 15.787 82.803 38.639 45.959 85.183 0 0 3.9095 3.5975 4.0502 5.8823 0.1789 2.9051-1.6033 5.3114-4.3877 5.8823-2.7843 0.5709-5.6451-1.645-7.0879-4 [...]
+ <path id="path10641-7-3-0-2-8-0-9-9" d="m915.16 581.31c-36.844-46.544 1.1901-69.396 45.959-85.183 44.768 15.787 82.803 38.639 45.959 85.183-0.9898-2.5044-0.9973-5.3144-0.498-7.9187 0.7884-4.1121 4.2336-7.3848 5.103-11.482 1.0593-4.9919 2.1211-10.596 1.2822-15.63-0.8622-5.1734-2.9031-8.515-6.3852-12.437-11.491-12.943-46.778-27.216-46.778-27.216s-29.947 13.841-42.1 23.814c-3.2003 2.6264-6.2101 5.901-7.6546 9.7808-2.0301 5.4531-1.7639 11.689-0.85051 17.435 1 6.292 6.1048 11.528 6. [...]
+ <path id="path10641-7-3-0-2-8-0-5-7-1" d="m1021.2 553.35c-0.8622-5.1734-7.3053-18.993-10.787-22.915-11.491-12.943-50.605-28.917-50.605-28.917-0.18374 0.41342-31.549 16.511-38.657 13.795 10.243-6.2515 26.866-14.569 39.975-19.191 34.698 12.236 65.195 28.764 60.075 57.229z" fill="#f8eca8"/>
+ <path id="path10641-7-3-0-2-8-3-0-7" d="m961.12 517.91c-18.688 9.6227-31.513 14.114-37.986 21.792-6.4729 7.6778-6.5936 18.542 0.1277 40.911 0.313 2.7591 0.7016 5.912-0.675 8.3044-1.4428 2.5072-4.3036 4.7231-7.088 4.1522s-4.5666-2.9772-4.3877-5.8823c0.1407-2.2848 4.0502-5.8823 4.0502-5.8823-36.844-46.544 1.1901-69.396 45.959-85.183 44.768 15.787 82.803 38.639 45.959 85.183 0 0 3.9095 3.5975 4.0502 5.8823 0.1789 2.9051-1.6033 5.3114-4.3877 5.8823-2.7843 0.5709-5.6451-1.645-7.0879 [...]
+ </g>
+ </g>
+ </g>
+ <g id="g13146">
+ <g id="g11483" transform="matrix(.99942 .033970 -.033970 .99942 -207.55 -722.49)">
+ <path id="path11472" d="m698.26 1202.5c-7.2466 0-14.594 5.5968-14.594 14.594 0 8.997 7.3471 14.594 14.594 14.594 7.2466 0 14.594-5.5968 14.594-14.594 0-8.997-7.3471-14.594-14.594-14.594zm0 7.75c3.7862 0 6.8438 3.0576 6.8438 6.8438s-3.0575 6.8438-6.8438 6.8438c-3.7862 0-6.8438-3.0576-6.8438-6.8438s3.0575-6.8438 6.8438-6.8438z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path11477" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m698.28 1204.7c-6.9434 0-12.464 5.6333-12.464 12.309 0 6.677 5.532 12.278 12.464 12.278 6.9334 0 12.43-5.6105 12.43-12.278 0-6.6659-5.4861-12.309-12.43-12.309zm0 2.9415c5.1743 0 9.3144 4.1931 9.3144 9.3679 0 5.1738-4.1414 9.336-9.3144 9.336-5.174 0-9.3483-4.1611-9.3483-9.336 0-5.1758 4.1729-9.3679 9.3483-9.3679z" fill="#f6e078"/>
+ </g>
+ <g id="g11315-2" transform="matrix(.44531 -.89538 .89538 .44531 -1043.1 1242.9)">
+ <path id="rect11158-9-3" d="m1314 912.64c-8.6701 6.5984-5.4922 62.033-6.7187 99.469-0.0003 0.01 0.0003 0.021 0 0.031-0.069 0.3892-0.125 0.7785-0.125 1.1874 0 3.7863 3.0575 6.8438 6.8437 6.8438 3.7863 0 6.875-3.0575 6.875-6.8438 0-0.4089-0.056-0.7982-0.125-1.1874-0.0003-0.01 0.0004-0.021 0-0.031-1.2265-37.436 1.9201-92.87-6.75-99.469z" fill="#e7cd54"/>
+ <path id="rect11158-9-5-7-65" d="m1314 912.64c-4.6387 6.5984-2.9385 58.033-3.5947 95.469-0.0002 0.01 0.0002 0.021 0 0.031-0.038 0.3892-0.067 0.7785-0.067 1.1874 0 3.7863 1.6359 6.8438 3.6616 6.8438 2.0258 0 3.6784-3.0575 3.6784-6.8438 0-0.4089-0.03-0.7982-0.067-1.1874-0.0003-0.01 0.0002-0.021 0-0.031-0.6563-37.436 1.0272-88.87-3.6115-95.469h0.0002z" fill="#f6e078"/>
+ <path id="rect11158-9-5-5" d="m1314 912.64c-8.6701 6.5984-5.4922 62.033-6.7187 99.469-0.0003 0.01 0.0003 0.021 0 0.031-0.069 0.3892-0.125 0.7785-0.125 1.1874 0 3.7863 3.0575 6.8438 6.8437 6.8438 3.7863 0 6.875-3.0575 6.875-6.8438 0-0.4089-0.056-0.7982-0.125-1.1874-0.0003-0.01 0.0004-0.021 0-0.031-1.2265-37.436 1.9201-92.87-6.75-99.469z" stroke="#806600" fill="none"/>
+ <path id="rect11158-9-5-7-6-8" d="m1314 912.64c-2.5446 6.5984-1.612 54.033-1.9719 91.469-0.0001 0.01 0 0.021 0 0.031-0.021 0.3892-0.037 0.7785-0.037 1.1874 0 3.7863 0.8976 6.8438 2.0088 6.8438 1.1113 0 2.0179-3.0575 2.0179-6.8438 0-0.4089-0.017-0.7982-0.037-1.1874-0.0001-0.01 0.0002-0.021 0-0.031-0.36-37.436 0.5635-84.87-1.9811-91.469h0.0003z" fill="#f8eca8"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g38457" transform="translate(-211.14 -648.81)">
+ <g id="g38384">
+ <path id="path38243-5" d="m761.97 595.12c-5.4 0-7.26 0.94-4.97 2.5 0.54 0.37 0.9 6.61 0.91 15.32 0.01 9.67 0.42 15.54 1.15 17.12 2.01 4.32 5.61 6.4 12.19 7.03 7.72 0.75 15.88-0.39 18.97-2.62 4.01-2.9 4.84-6.84 4.84-22.81 0-9.03 0.35-14.54 0.91-14.54 0.5 0 0.91-0.44 0.91-1 0-0.55-2.36-0.99-5.22-1h-5.22l0.28 15.38 0.31 15.41-2.47 2.12c-4.44 3.87-16.31 2.25-17.94-2.44-0.95-2.76-0.64-28.47 0.35-28.47 0.5 0 0.91-0.44 0.91-1s-2.59-1-5.91-1zm-72.06 10.26c-2.5-0.08-4.47 0.66-9.57 3.09-1.66 [...]
+ </g>
+ </g>
+ </g>
+ <use id="use9714" xlink:href="#g12450" transform="matrix(-1 0 0 1 1252.8 0)" height="1500" width="1550" y="0" x="0"/>
+ <g id="g12450" transform="translate(-.5356 -.029569)">
+ <g id="g12422">
+ <g id="g12622" transform="translate(77.129 -33.026)">
+ <path id="path13572-7" d="m598.45 655.78c72.785-7.8379 99.206-73.497 109.34-137.3 5.2701-33.188 4.5664-40.189 1.4444-78.787-4.6236 3.096-30.078 34.479-42.858 40.802-21.203 10.49-32.962 23.824-47.39 26.275-13.872 2.3564-27.663 1.881-37.856-6.8475-8.8332-7.5634-19.839-37.594-0.16619-45.36 13.423-5.299 22.674-11.991 27.952-21.008 5.1526-8.8032 6.5184-19.823 4.2828-33.926-5.092-1.2673-9.8514-1.2038-14.327-0.006-4.6293 1.2393-8.9552 3.6925-13.032 7.1427 9.9222-22.035 11.257-39.412 5.665 [...]
+ <path id="path12618" d="m490.03 623.95c-2.7804-11.062-3.8911-22.125 1.5556-33.187l16.594 3.1113c-1.0577-15.902 1.1568-31.804 30.076-47.706 0 0 4.1106 10.779 7.2597 15.556 3.5705 5.4174 10.651 8.4572 12.964 14.519 0.86248 2.261 0 7.2597 0 7.2597 5.0546-3.7468 10.562-6.8897 19.705-5.1855 6.1621 7.9511 10.314 15.902 9.8524 23.853l-32.15 1.0371-49.781 15.556-16.075 5.1855z" transform="translate(-211.14 -648.81)" fill="#e0e0e0"/>
+ <path id="path13572-7-0-5" d="m304.46-108.06c-7.888 1.9665-19.741-0.95713-28.565-3.8508-14.473-4.7465-22.639-14.437-34.205-15.294-17.464-1.2942-37.418 8.3001-53.022-4.0173-12.571-9.9229-13.838-20.078-13.848-19.784 5.7666-0.26507 8.2259-7.256 16.501-9.2567-7.806-3.2457-15.995-6.0921-20.612-14.193-2.5432-4.4616-4.2996-10.582-4.6398-17.142-0.23362-4.5049 0.20062-9.2169 1.5066-13.741 5.5919-2.1435 10.639-1.5622 15.053-0.46634 4.7454 1.1781 7.974 3.489 11.768 7.2826 0 0 1.2836-12.592 4. [...]
+ <path id="path12620" d="m589.59 615.65-23.853 9.3338v19.705l32.15 12.964 28.52-8.2968 14.001-6.7411 16.075-10.371 15.038-16.594 21.779-35.261c-27.046 30.01-46.512 45.334-62.329 48.383-14.055 2.7095-24.989 1.8404-32.084-1.1045-6.4363-2.6714-9.7137-7.051-9.2963-12.017z" transform="translate(-211.14 -648.81)" fill="#e0e0e0"/>
+ <path id="path12612" d="m628.32 587.05s16.528-0.44 22.541-2.4151c9.2695-3.0448 20.916-8.4482 26.968-16.101 6.1329-7.7537 9.2578-28.176 9.2578-28.176h0.80502l-9.6603-49.912-41.861 14.893-45.887 2.0126-19.321-16.101v-25.358l8.0503-11.27c-34.281 11.015-31.952 47.967-15.924 64.22 5.2827 5.3566 13.325 9.145 19.144 9.8426 0 0-3.7553 3.5404-5.2327 5.6352-4.1852 5.9339-10.063 19.321-10.063 19.321s9.6718 4.6804 14.893 5.6352c2.3757 0.43443 7.2452 0 7.2452 0s-5.3556 9.0246-6.0377 14.088c-0.5 [...]
+ <path id="path12614" d="m549.84 352.96c7.9434-1.1974 14.168-0.54428 19.171 1.4068 8.7139 3.3978 14.419 10.474 17.722 19.338 2.3149 6.213 3.4494 13.304 3.6118 20.622l3.8782-15.082-2.1545-20.253-13.789-23.269-19.822-9.4799-24.562 4.309s10.766 7.3992 13.789 12.927c1.8922 3.4605 2.1545 9.4799 2.1545 9.4799z" transform="translate(-211.14 -648.81)" fill="#e0e0e0"/>
+ <path id="path12616" d="m401.02 407.16 0.38709 17.032v5.0321s11.063-8.8117 14.709-14.709c11.344-18.346 2.3055-22.879 1.3365-38.088-0.22945-3.6015 2.8339-7.5676 6.1934-8.903 5.2676-2.0938 12.015 0.21254 16.645 3.4838 5.6746 4.0099 7.2279 8.831 9.8889 15.25 4.1707 10.06 6.1934 30.967 6.1934 30.967l3.4838-14.322-1.1613-17.806-2.7096-17.419-18.193-17.419-26.322-0.77417-12.774 13.935 2.3225 43.741z" transform="translate(-211.14 -648.81)" fill="#e0e0e0"/>
+ <path id="path13572-7-0" d="m387.31 6.9681c72.785-7.8379 99.206-73.497 109.34-137.3 5.2701-33.188 4.5664-40.189 1.4444-78.787-4.6236 3.096-30.078 34.479-42.858 40.802-21.203 10.49-32.962 23.824-47.39 26.275-13.872 2.3564-27.663 1.881-37.856-6.8475-8.8332-7.5634-19.839-37.594-0.16619-45.36 13.423-5.299 22.674-11.991 27.952-21.008 5.1526-8.8032 6.5184-19.823 4.2828-33.926-5.092-1.2673-9.8514-1.2038-14.327-0.006-4.6293 1.2393-8.9552 3.6925-13.032 7.1427 9.9222-22.035 11.257-39.412 5.6 [...]
+ </g>
+ <g id="g12404">
+ <path id="path13625-3-6-46-4-6-79-3" d="m308.43-279.27c-1.7563-5.1627-3.1299-10.133-4.1745-14.936-0.91981-4.2288-1.5846-8.3278-2.0309-12.314-1.3963 1.9652-2.5015 4.472-1.9415 8.7106-1.5528-2.8227-4.9242-5.7525-6.3573-6.6833 0.10122 1.7373 0.99266 6.1689 2.6499 8.9283-3.345-2.552-6.0397-2.7577-8.3911-2.4535 3.0093 2.1998 6.0102 4.6235 9.0001 7.3057 3.7677 3.38 7.5179 7.1707 11.245 11.442z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-8" d="m298.99-229.02c-0.94395-5.3709-1.5392-10.493-1.8351-15.399-0.26054-4.3199-0.28898-8.4723-0.1189-12.48-1.6811 1.7279-3.1576 4.0356-3.2541 8.3099-1.1017-3.0274-3.984-6.4395-5.2574-7.579-0.16635 1.7322 0.0351 6.2481 1.2496 9.2291-2.9142-3.0347-5.5454-3.6512-7.9157-3.7111 2.6364 2.6352 5.2302 5.4903 7.7735 8.5993 3.2049 3.9178 6.3296 8.2386 9.3581 13.031z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-2" d="m334.44-182.23c-2.534-4.8287-4.6601-9.5265-6.4353-14.11-1.5631-4.0356-2.8542-7.9823-3.912-11.851-1.0754 2.1576-1.7793 4.8053-0.57024 8.9061-1.9709-2.5484-5.755-4.9212-7.3149-5.619 0.36883 1.7007 1.9353 5.941 3.9996 8.4107-3.6996-2.0037-6.3937-1.7899-8.6697-1.1255 3.3135 1.7077 6.6532 3.6378 10.022 5.825 4.2453 2.7563 8.537 5.921 12.88 9.5637z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-83" d="m386.48-158.39c-4.3627-3.2719-8.3007-6.6007-11.873-9.9768-3.1452-2.9727-6.0065-5.9821-8.6239-9.0216-0.0442 2.4103 0.45752 5.1036 3.311 8.2874-2.8746-1.4546-7.3111-1.9717-9.0194-1.9317 1.0637 1.3773 4.2998 4.5335 7.2249 5.8769-4.2016-0.22005-6.5426 1.1303-8.3124 2.708 3.7257 0.11862 7.5708 0.4268 11.553 0.95469 5.0177 0.66525 10.253 1.6794 15.74 3.103z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-2-9" d="m301.73-171.08c-4.7015-2.7629-8.9875-5.6299-12.915-8.5849-3.4582-2.6019-6.6385-5.2721-9.5797-7.9994 0.22593 2.4001 1.026 5.0203 4.218 7.8646-3.0193-1.1236-7.4858-1.1408-9.179-0.90979 1.2112 1.2496 4.7803 4.0236 7.8374 5.0311-4.1998 0.25173-6.3749 1.8557-7.957 3.6216 3.7156-0.29921 7.571-0.42345 11.587-0.34464 5.0607 0.0993 10.376 0.52102 15.988 1.3214z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-2-5" d="m284.11-204.56c-3.8858-3.826-7.3432-7.6516-10.432-11.475-2.7193-3.3667-5.1524-6.7318-7.3397-10.094-0.36617 2.3828-0.22923 5.119 2.1728 8.6558-2.6542-1.826-6.9816-2.9319-8.68-3.1207 0.86987 1.5072 3.6548 5.0678 6.3739 6.7905-4.1344-0.78005-6.635 0.24504-8.6 1.5719 3.6764 0.61591 7.4457 1.4356 11.321 2.4914 4.8837 1.3304 9.9359 3.0357 15.183 5.1804z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-2-5-2" d="m338.25-217.84c-0.20231-5.4495-0.69339-10.583-1.432-15.442-0.65031-4.2786-1.4925-8.3448-2.4985-12.228 2.0058 1.3373 3.933 3.2845 4.923 7.4436 0.44292-3.191 2.5464-7.1313 3.5528-8.5123 0.5256 1.6589 1.2748 6.1168 0.71178 9.286 2.2136-3.5779 4.6574-4.732 6.9624-5.2872-2.0258 3.1291-3.9638 6.4643-5.7993 10.037-2.3129 4.5023-4.463 9.3819-6.4202 14.702z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-83-2" d="m436.48-119.82c-2.775-4.6944-5.1359-9.2786-7.1406-13.766-1.7652-3.9514-3.2542-7.8278-4.5063-11.638-0.9649 2.2092-1.5341 4.8891-0.11915 8.9235-2.0972-2.4455-5.9965-4.6239-7.5897-5.2419 0.45436 1.6798 2.2332 5.8355 4.4198 8.1978-3.7962-1.814-6.476-1.4643-8.7155-0.68567 3.3956 1.5379 6.8287 3.2967 10.304 5.3108 4.3793 2.5381 8.8254 5.4817 13.348 8.9002z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-83-2-7" d="m335.38-98.246c-5.0252-2.1178-9.6523-4.3937-13.936-6.8042-3.7715-2.1224-7.2765-4.3492-10.552-6.6642 0.5409 2.3493 1.68 4.8409 5.2197 7.2387-3.1413-0.71506-7.5709-0.14222-9.2187 0.31034 1.3656 1.0787 5.2698 3.3571 8.4332 3.9521-4.1298 0.80413-6.074 2.6813-7.409 4.6407 3.6435-0.78728 7.4488-1.4196 11.44-1.8718 5.0294-0.56987 10.354-0.85382 16.023-0.80161z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-83-2-79" d="m374.24-89.498c-3.464-4.2117-6.502-8.3783-9.173-12.504-2.3519-3.6328-4.4194-7.2341-6.2428-10.807-0.61361 2.3313-0.76381 5.0669 1.2548 8.8357-2.4484-2.0938-6.6364-3.6466-8.3056-4.0122 0.70732 1.59 3.1042 5.4226 5.628 7.4204-4.03-1.2085-6.6242-0.45083-8.7172 0.66303 3.5917 0.99735 7.2545 2.2071 10.998 3.6627 4.7176 1.8343 9.5636 4.059 14.558 6.7413z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-83-2-0" d="m492.35-57.957c-5.4509 0.15831-10.605 0.0075-15.503-0.40825-4.3122-0.36611-8.4252-0.93774-12.366-1.6849 1.467 1.913 3.5372 3.7073 7.7528 4.4202-3.1548 0.65286-6.9474 3.0121-8.2588 4.1076 1.69 0.41481 6.1877 0.86775 9.3128 0.09649-3.4238 2.4453-4.4138 4.9599-4.8154 7.2967 2.9884-2.2282 6.1882-4.3824 9.6319-6.45 4.3396-2.6054 9.0664-5.0733 14.246-7.3779z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-83-2-0-2" d="m514.65-96.503c-5.0754 1.9947-9.9762 3.5981-14.725 4.8651-4.1814 1.1157-8.245 1.9705-12.206 2.6019 2.0281 1.3033 4.5836 2.2906 8.7915 1.534-2.7474 1.6825-5.5171 5.1866-6.3801 6.6615 1.7307-0.18196 6.116-1.2787 8.7953-3.0626-2.3936 3.4601-2.4736 6.1615-2.0603 8.4962 2.0574-3.1084 4.3387-6.2189 6.8789-9.3304 3.201-3.9209 6.813-7.8435 10.906-11.766z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-2-3" d="m426.52-279.98c1.5964-5.2144 3.3904-10.049 5.3532-14.555 1.7283-3.9676 3.5875-7.6807 5.5578-11.175-2.2822 0.77678-4.6452 2.1631-6.671 5.928 0.39223-3.1976-0.62765-7.5462-1.2453-9.1395-0.93438 1.4681-2.8043 5.5836-3.0749 8.791-1.2195-4.0267-3.2844-5.7702-5.3694-6.8993 1.1534 3.5447 2.1689 7.266 3.0243 11.191 1.0779 4.9455 1.9013 10.214 2.4252 15.858z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-2-3-9" d="m409.2-197.49c0.0913-5.4525 0.47766-10.594 1.1171-15.468 0.56302-4.2909 1.3222-8.3735 2.2489-12.276-1.9781 1.3779-3.8653 3.3639-4.7703 7.5424-0.50783-3.1814-2.6911-7.0779-3.7255-8.4381-0.49171 1.6693-1.1499 6.1415-0.52247 9.2986-2.2861-3.5321-4.7528-4.6361-7.0687-5.1442 2.0891 3.0872 4.0947 6.3822 6.0026 9.9169 2.4042 4.4542 4.6532 9.289 6.7184 14.568z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-2-3-9-9" d="m434.16-237.72c4.1202-3.5723 8.2064-6.7176 12.261-9.495 3.5705-2.4456 7.1168-4.606 10.641-6.5217-2.3465-0.55276-5.085-0.6318-8.8 1.4841 2.0294-2.5021 3.4728-6.729 3.7949-8.4071-1.5711 0.74842-5.34 3.2442-7.2716 5.8191 1.1033-4.0601 0.27845-6.6336-0.88945-8.697-0.90363 3.6164-2.0178 7.3094-3.3756 11.09-1.711 4.7637-3.809 9.6659-6.3605 14.728z" fill="#6e6e6e"/>
+ <path id="path13625-3-6-46-4-6-79-3-2-3-9-0" d="m396.89-243.84c-0.90058-5.3784-1.4545-10.505-1.7108-15.413-0.22567-4.3218-0.22057-8.4744-0.0181-12.48-1.695 1.7143-3.19 4.01-3.3211 8.2834-1.0772-3.0362-3.9319-6.4714-5.1961-7.6211-0.18032 1.7309-0.0153 6.2482 1.1751 9.2388-2.8896-3.0581-5.5158-3.6958-7.8854-3.7748 2.6151 2.6564 5.1857 5.5324 7.7039 8.6618 3.1732 3.9435 6.2629 8.2894 9.2526 13.106z" fill="#6e6e6e"/>
+ </g>
+ </g>
+ <g id="g12536" transform="translate(77.129 -33.026)">
+ <g id="g12200">
+ <path id="path13572" d="m575.73 457.24c-6.8168 17.704-2.6888 28.616 5.3943 36.68 9.501 9.4779 23.985 9.2039 37.856 6.8475 14.428-2.451 28.699-11.775 47.39-26.275 13.277-10.3 27.584-22.912 42.858-36.802-0.1613 10.932-1.0716 31.52-6.9436 54.771-5.773 22.859-16.899 52.747-36.267 74.107-8.7894 9.6936-17.335 14.521-31.338 13.572-2.0618-2.5031-0.83909-7.5892-0.49853-9.6119 0.45385-2.6955 0.59127-4.5027 2.2072-6.9658-8.4288 5.0583-9.528 11.164-19.057 14.755-6.0431 2.2778-19.139 3.8774-27. [...]
+ <path id="path13572-3" d="m575.73 457.24c-6.8168 17.704-2.6888 28.616 5.3943 36.68 9.501 9.4779 23.985 9.2039 37.856 6.8475 14.428-2.451 28.699-11.775 47.39-26.275 13.277-10.3 27.584-22.912 42.858-36.802-0.1613 10.932-1.0716 31.52-6.9436 54.771-5.773 22.859-16.899 52.747-36.267 74.107-8.7894 9.6936-17.335 14.521-31.338 13.572-2.0618-2.5031-0.83909-7.5892-0.49853-9.6119 0.45385-2.6955 0.59127-4.5027 2.2072-6.9658-8.4288 5.0583-9.528 11.164-19.057 14.755-6.0431 2.2778-19.139 3.8774-2 [...]
+ <path id="path11422" d="m684.95 463.62c-11.108 13.664-36.143 35.561-59.847 40.8-17.276 3.8183-35.131 3.8288-47.059-7.2043-6.422-5.9403-12.168-15.763-8.981-31.092-12.818 24.216-4.8776 43.642 11.315 52.145 7.4931 3.9349 17.392 4.3301 26.956 3.6522-11.158 8.2275-21.927 15.089-25.753 27.899 8.465 2.8175 15.499 1.8786 23.964 1.073-5.4183 8.6371-13.531 15.119-14.665 27.183 0 0 15.52-0.51849 22.74-3.0392 5.0614-1.7671 12.031-8.8431 17.57-12.492 5.142-3.3876 9.0497-3.426 9.0497-3.426-1.308 [...]
+ <path id="path11424" d="m565.61 480.33c3.522 14.786 11.068 22.985 20.736 27 13.382 5.5566 27.069 5.3567 40.127 2.046 25.247-6.4011 48.451-27.859 62.231-38.395-15.471 33.145-11.473 92.533-46.433 99.41l2.8047-17.763c-16.707 2.4469-21.447 12.425-31.904 18.091-4.7641 2.581-10.663 3.0092-17.334 3.5604-1.4529-2.6947 9.6376-17.504 15.27-26.949-8.6218 1.6546-14.87 1.1556-23.492-0.48929 3.3998-7.0891 6.2822-13.072 28.166-26.311-30.569-1.1574-51.559-6.7949-50.173-40.2z" transform="translate( [...]
+ <path id="path12198" d="m609.56 517.68s20.592 0.65477 30.499-1.6944c6.8915-1.6341 19.486-8.472 19.486-8.472l21.604-22.027s-12.887 44.698-22.027 63.54c-3.9998 8.2449-12.708 19.062-12.708 19.062s7.1383-12.531 11.014-21.18c3.0683-6.8476 7.5372-15.79 7.5372-15.79s-12.557 10.564-24.394 17.426c-5.6046 3.2492-15.016 2.5614-20.786 5.5068-7.6219 3.8908-20.815 17.426-20.815 17.426s11.064-15.173 19.062-19.486c5.1917-2.7996 13.027-2.3892 18.244-5.1417 12.451-6.5697 28.323-22.641 28.323-22.641s [...]
+ </g>
+ <g id="g12291" transform="translate(-.22432)">
+ <path id="path13624" d="m571.43 321.49c16.951 17.807 28.701 37.407 22.487 62.169 0 0-0.35503-14.148-3.5273-21.164-3.3434-7.3948-9.6186-15.977-16.755-19.841-6.4671-3.5021-14.912-6.0319-21.164-2.2046-10.044 6.1482-20.137 12.516-30.985 15.932-9.1382 2.8774-18.812 3.6598-29.442 0.45107-3.9677-1.1976-8.0688-2.9513-12.325-5.3597 0.47875-4.493 2.6468-8.5033 5.7716-12.24 3.4222-4.0926 7.9919-7.8574 12.747-11.569-10.923 0.14656-20.163-2.4495-27.321-7.2898-11.287-7.6325-17.399-20.845-16.771- [...]
+ <path id="path13624-7-9" d="m360.29-327.32c16.951 17.807 28.701 37.407 22.487 62.169 2.4482-24.606-13.306-50.16-35.048-49.948-19.147 0.18643-29.618 16.217-50.67 19.893-6.9271 1.2095-24.397-3.7533-24.397-3.7533s3.7618-6.6684 6.2704-9.5238c5.2647-5.9925 18.126-15.623 18.126-15.623-28.045-1.3193-45.75-7.9149-49.544-35.656 6.3384 0.69461 9.2981 3.4036 13.896 3.2453 7.1576-0.24643 13.254-3.4496 19.85-4.0143 8.5477-0.73178 17.936 1.692 31.562 7.525 0 0-7.3841-9.0584-8.7173-14.554-0.56815 [...]
+ <path id="path13624-7-3" d="m360.29-327.32c14.92 15.674 25.81 32.736 23.969 53.486-7.2392-37.665-22.509-46.026-40.355-44.232-10.745 1.0802-28.805 12.973-40.226 17.236-11.358 4.2391-16.081 0.85351-25.76-0.006 6.0413-7.0456 10.626-13.508 26.273-24.397-18.428-7.3504-41.653 1.4886-52.922-30.027 4.9113-0.0657 9.5076 1.9353 14.245 1.7676 6.068-0.21479 12.368-2.5449 19.86-1.9221 8.9216 0.74164 18.782 2.4773 32.703 6.1599-4.8109-7.5066-8.9922-15.013-10.885-22.52 32.688 3.8698 38.627 18.134 [...]
+ <path id="path12273" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m256.89-350.94c13.932 11.101 31.661 11.395 49.938 11.812 18.276 0.41711 37.127 0.97347 53.531 12.281l-0.37052-3.8294c-20.038-10.837-35.142-10.534-52.197-10.695-29.737-0.27982-41.538-4.5066-50.901-9.5694z" fill="#c4af00"/>
+ <path id="path13624-7" d="m360.29-327.32c16.951 17.807 28.701 37.407 22.487 62.169 0 0-0.35503-14.148-3.5273-21.164-3.3434-7.3948-9.6186-15.977-16.755-19.841-6.4671-3.5021-14.912-6.0319-21.164-2.2046-10.044 6.1482-20.137 12.516-30.985 15.932-9.1382 2.8774-18.812 3.6598-29.442 0.45107-3.9677-1.1976-8.0688-2.9513-12.325-5.3597 0.47875-4.493 2.6468-8.5033 5.7716-12.24 3.4222-4.0926 7.9919-7.8574 12.747-11.569-10.923 0.14656-20.163-2.4495-27.321-7.2898-11.287-7.6325-17.399-20.845-16.77 [...]
+ <path id="path12279" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m310.85-367.89c12.768 8.5756 28.384 22.773 40.26 34.674l5.6225 1.7487c-13.546-13.351-29.044-27.13-45.883-36.423z" fill="#c4af00"/>
+ <path id="path12285" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m342.03-335.56c-3.3773 0.26025-6.8934 1.5085-9.7611 2.7299-5.7355 2.4428-9.7401 7.3563-14.54 11.585-9.6002 8.457-19.73 18.212-34.71 18.136 12.161 2.3882 23.861-6.0201 33.571-14.47 4.7827-4.2132 11.391-11.048 16.951-13.416 5.5601-2.3682 14.558-2.0818 22.473-0.0659l-8.947-3.6606c-4.0517-1.0319-1.6598-1.0984-5.0372-0.83818z" fill="#c4af00"/>
+ </g>
+ <g id="g12384">
+ <path id="path13626" d="m458.85 405.49c20.905-86.532-111.49-112.62-124.37-21.102 6.1238 0.51396 11.496 0.94265 18.857-4.4897 0 0-7.4941 10.714-8.9795 16.163-1.4963 5.4887-0.60607 11.613-2.2449 17.061-1.5787 5.2481-6.7346 11.673-6.7346 11.673s22.516 2.1995 31.877-1.7959c8.0836-3.4502 16.612-17.061 16.612-17.061 3.9946 4.2134 2.4764 6.0642 13.918 13.469 0 0 11.027-6.0483 13.469-13.469 1.4034-4.2648 1.6996-10.055 0.44897-14.367-1.4803-5.1041-4.8812-10.935-5.8367-16.163-0.93397-5.1104- [...]
+ <path id="path13626-8-0" d="m247.71-243.32c12.503-51.751-29.827-81.883-68.629-78.168-20.886 5.9452-38.276 13.723-51.262 51.585 3.4282 2.2913 10.946 0.30717 22.3-6.3184-4.7628 7.1123-8.8436 16.076-10.93 22.998-1.8231 6.0483-2.6911 11.673-2.7205 16.259-0.0286 4.4713-2.732 7.296-6.0479 10.546 26.946 0.41699 36.772-9.8938 41.998-25.273 0 0 3.5132 6.3194 6.1503 9.6349 2.4317 3.0573 8.7164 7.4618 8.7164 7.4618s9.2484-6.267 9.2917-13.752c0.0461-7.9876-6.6588-18.81-7.4334-26.76-0.60332-6.1 [...]
+ <path id="path13626-8-2" d="m249.94-261.36c-0.0506-36.903-30.434-59.099-61.535-60.382-32.816 8.4206-46.363 26.785-56.129 48.86 0 0 5.2603-1.0356 7.805-1.8583 5.8669-1.8969 17.097-7.0617 17.097-7.0617s-10 20.802-13.008 30.105c-1.9599 6.0614-0.23777 9.6945-2.6017 15.61-1.0093 2.5257-4.0883 7.0617-4.0883 7.0617s9.759-2.5661 13.38-4.46c4.6679-2.4415 7.0619-4.8503 10.407-8.92 4.0882-4.9742 11.15-16.725 11.15-16.725 2.1306 7.6564 6.7925 13.033 14.867 19.698 0 0 4.5181-6.5665 4.46-11.15-0 [...]
+ <path id="path12366" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m205.87-315.83c-18.39 0.1499-29.551 8.077-36.789 19.486s-10.616 27.39-14.618 43.873c-0.80272 3.3064-2.5128 7.8113-5.1727 11.438-2.6599 3.6262-5.803 7.9884-5.803 7.9884 2.0985-0.66372 5.4213-3.8869 6.5843-5.3508 2.8238-3.5543 6.4068-9.456 7.2862-13.078 4.0028-16.488 6.8333-32.588 13.933-43.778 7.0992-11.19 18.719-17.386 36.849-17.533 7.9524-0.0648 16.716 5.0097 23.801 8.7551l-4.5036- [...]
+ <path id="path13626-8" d="m247.71-243.32c20.905-86.532-111.49-112.62-124.37-21.102 6.1238 0.51396 11.496 0.94265 18.857-4.4897 0 0-7.4941 10.714-8.9795 16.163-1.4963 5.4887-0.60607 11.613-2.2449 17.061-1.5787 5.2481-6.7346 11.673-6.7346 11.673s22.516 2.1995 31.877-1.7959c8.0836-3.4502 16.612-17.061 16.612-17.061 3.9946 4.2134 2.4764 6.0642 13.918 13.469 0 0 11.027-6.0483 13.469-13.469 1.4034-4.2648 1.6996-10.055 0.44897-14.367-1.4803-5.1041-4.8812-10.935-5.8367-16.163-0.93397-5.110 [...]
+ <path id="path12372" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m184.76-310.28c-12.402 22.425-17.025 43.458 0.875 66.031-5.1794-10.295-8.3649-20.887-8.7092-29.929-0.34761-9.1284 2.9971-20.425 7.3822-29.495 1.704-3.5243 4.5326-5.019 5.9173-8.4493l-5.4653 1.842z" fill="#c4af00"/>
+ <path id="path12378" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m162.83-305.11c-8.8525 6.6278-17.172 18.848-25.015 28.353 7.0972-6.2171 16.773-19.051 25.324-26.147 8.7083-6.5198 18.955-10.532 33.156-10.062l7.7246-2.4247c-19.474-0.83991-34.098 3.703-41.19 10.281z" fill="#c4af00"/>
+ </g>
+ <g id="g12527">
+ <path id="path13628" d="m494.93 599.54c-0.68896 4.9934-0.5828 9.6446 0.18962 13.967 4.8546 27.163 39.969 41.96 72.243 45.171 18.697 1.8601 33.875-0.16855 48.324-5.9348-19.862-1.8749-31.323-5.4718-35.625-12.037-4.5196-6.8962-3.8911-13.593-1.9546-19.745 1.8944-6.0177 5.0404-11.514 5.8439-16.165 1.1358-6.5752-1.8543-13.616-9.9162-20.657-9.4269 0.15215-15.418 5.4583-19.251 14.001 1.5306-7.4005 1.0339-12.79-0.55909-17.073-4.4212-11.889-17.287-15.26-18.692-29.479-19.834 13.142-28.883 28. [...]
+ <path id="path13628-4-3" d="m302.51-8.3749c14.245 10.303 34.481 16.329 53.709 18.242 18.697 1.8601 33.875-0.16855 48.324-5.9348-27.295 3.3625-39.273-2.8009-43.535-13.62-4.0765-10.348 7.6718-24.838 6.6076-38.775-0.35475-4.646-2.1333-9.2307-6.3964-13.58-2.711 0.72273-5.036 2.2174-7.1518 4.1304-4.4848 4.0548-9.3884 10.895-13.678 15.341 0 0 0.64622-14.989-2.2573-21.942-2.0638-4.9418-8.0654-10.437-11.74-16.056-3.6743-5.6183-4.1157-10.001-4.1157-10.001s-13.332 11.59-15.539 20.152c-2.7363 [...]
+ <path id="path13628-4-9" d="m309.38-3.9787c13.489 7.6413 30.524 12.223 46.834 13.846 12.13 1.2068 22.779 0.77678 32.709-1.2488 0 0-13.613-0.19348-19.886-2.6711-4.7405-1.8724-9.2774-5.224-11.912-9.5874-2.346-3.886-2.9377-8.8365-2.6147-13.364 0.62762-8.7983 7.5217-15.049 8.4253-23.823 0.61032-5.9266-2.3242-16.56-2.3242-16.56-9.2287 3.8349-16.309 15.887-23.242 27.891 0 0 0.26545-23.707-3.4863-32.249-2.7011-6.1494-7.3703-7.9812-10.459-13.945-1.2753-2.4625-3.4863-9.0063-3.4863-9.0063s-7 [...]
+ <path id="path12509" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m322.78-24.529c5.1744 14.001 16.655 26.466 33.112 34.436l8.4913 0.6838c-20.203-6.7413-34.369-20.878-39.366-34.684-5.0079-13.834-6.3211-29.587-5-46.031-4.7377 15.158 0.69367 39.995 2.7635 45.596z" fill="#beaa00"/>
+ <path id="path13628-4" d="m283.78-49.271c-0.68896 4.9934-0.5828 9.6446 0.18962 13.967 4.8546 27.163 39.969 41.96 72.243 45.171 18.697 1.8601 33.875-0.16855 48.324-5.9348-19.862-1.8749-31.323-5.4718-35.625-12.037-4.5196-6.8962-3.8911-13.593-1.9546-19.745 1.8944-6.0177 5.0404-11.514 5.8439-16.165 1.1358-6.5752-1.8543-13.616-9.9162-20.657-9.4269 0.15215-15.418 5.4583-19.251 14.001 1.5306-7.4005 1.0339-12.79-0.55909-17.073-4.4212-11.889-17.287-15.26-18.692-29.479-19.834 13.142-28.883 2 [...]
+ <path id="path12515" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m357.58-50.625c-1.8735 11.151-6.3308 17.557-10.219 24.25-3.888 6.6928-7.1698 13.688-6.4062 25.75l2.8186 1.4963c-0.75076-11.86 1.8712-20.623 5.7304-27.266 6.9401-11.553 8.7342-18.895 8.076-24.23z" fill="#beaa00"/>
+ <path id="path12521" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m294.79-33.625c14.025 19.73 24.943 23.254 40.781 28.75l-2.5453-3.0159c-20.62-6.9611-27.68-15.413-38.23-25.734z" fill="#beaa00"/>
+ </g>
+ </g>
+ </g>
+ <g id="g27736">
+ <g id="g5937" transform="matrix(.7695 0 0 .7695 379.73 -605.84)" stroke-width="1.2995">
+ <path id="path5824" d="m417.93 772.01 31.301-17.692 21.094-10.207 12.929 4.0828 10.207 16.331-0.68046 26.198-101.73 0.68047-141.01-0.66799-101.7-0.0125-0.68046-26.198 10.207-16.331 12.929-4.0828 21.094 10.207 31.301 17.692 27.559-6.4644 139.93 0.45447 27.244 6.01z" stroke="#2b2200" fill="#453600"/>
+ <path id="path5822-3" d="m161.16 743.85s-9.4298 5.8519-12.063 10.087c-1.7574 2.8264-2.7569 6.1302-3.3438 9.4062-1.7173 9.5866-0.34375 29.219-0.34375 29.219h7.375s-2.8205-21.999 1.3438-31.906c1.7176-4.0862 5.9795-7.4197 9.75-9.75 3.0111-1.861 10.062-3.3438 10.062-3.3438l-12.781-3.7122zm318.48 0-12.48 3.7122s7.0826 1.4828 10.094 3.3438c3.7705 2.3303 8.0012 5.6638 9.7188 9.75 4.1642 9.907 1.3438 31.906 1.3438 31.906h7.4062s1.3736-19.632-0.34375-29.219c-0.58686-3.276-1.5864-6.5799-3.343 [...]
+ </g>
+ <g id="g24305" transform="translate(-1054.5 -478.1)">
+ <g id="g24277">
+ <path id="path7014-6-7-2-6" d="m1478.5 691.27c1.4066 57.536 6.0843 102.99 32.854 139.45 35.255 48.019 93.988 82.671 169.54 116.72v-256.17h-202.39z" fill="#1353b4"/>
+ <g id="g20994" transform="translate(-2.0008)">
+ <g id="g20985">
+ <path id="path15551" d="m1622.7 880.74 4.266 2.3912 17.392-2.7193 3.9379-135.53-13.454 1.6408-12.142 134.22z" stroke="#786721" stroke-width="1px" fill="#e4c900"/>
+ <path id="path15551-9" d="m1645.7 753.65-10.809 1.0676-10.829 124.25c17.792-19.658 19.003-129.21 21.638-125.32z" fill="#fee46e"/>
+ <path id="path15542" d="m1609.9 882.49 17.022 0.38847 10.49-136.92h-7.1775l-20.334 136.54z" fill="#fee46e"/>
+ <path id="path15542-9" d="m1626.9 882.88-17.116-0.67067 20.428-136.25h7.1775l-0.6189 7.1962h-4.8091l-0.916 6.4439 1.832 3.4351-10.305 70.075s-1.8723 1.1229-2.2901 2.0611c-0.2484 0.55784 0 1.832 0 1.832s3.9976-0.58526 5.7252 0.22902c1.7604 0.82972 3.893 4.3511 3.893 4.3511l-1.145 13.969s-3.9428 2.5147-6.1831 2.9771c-1.7958 0.37064-5.4961-0.2291-5.4961-0.2291l-2.883 20.128 12.501 0.71167 0.2049 3.7444z" fill="#e4c900"/>
+ <path id="path15542-2" d="m1609.9 882.49 16.739 0.67067 10.772-137.21h-7.1775l-20.334 136.54z" stroke="#806600" stroke-width="1px" fill="none"/>
+ <path id="path15555" d="m1619.6 855.69s2.7431 0.4619 4.4178-0.3487c1.4441-0.6991 2.0685-1.4947 2.5577-3.0227 0.9606-3.0005 1.2334-6.509 0.465-9.5332-0.5516-2.1709-1.3634-3.1261-3.4878-3.8365-1.4892-0.498-3.2551-0.1163-3.2551-0.1163l-0.6976 16.857z" stroke="#806600" stroke-width="1px" fill="#fee46e"/>
+ <path id="path15553" d="m2358.2 1467.6c0 5.0082-2.4464 9.0681-5.4641 9.0681-3.0178 0-5.4642-4.0599-5.4642-9.0681s2.4464-9.0682 5.4642-9.0682c3.0177 0 5.4641 4.06 5.4641 9.0682z" transform="matrix(.79738 .085728 -.072793 .93907 -148.88 -732.7)" stroke="#806600" fill="#ffec96"/>
+ </g>
+ <path id="path17947" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1608 716.63-2.4687 1.7812 22.812 47.625c1.2571 0.4308 2.2883 0.3254 2.6876-1.2812l-23.031-48.125zm-6.0313 4.0624-2.5312 1.625 26.438 55.281c1.2571 0.4308 2.2883 0.3254 2.6875-1.2813l-26.594-55.625zm-6.625 2.4376-2.5312 1.625 31.688 66.156c1.2571 0.4308 2.2883 0.3254 2.6875-1.2812l-31.844-66.5zm-5.8124 4.125-2.7813 1.0624 36.344 75.906c1.2571 0.4308 2.2883 0.3254 2.6876-1.2813l-36. [...]
+ <g id="g20968">
+ <path id="path15546" d="m1634.5 746.2s1.6518-13.062 0.3282-18.048c-0.9885-3.7245-3.1515-6.4125-6.5632-8.204-3.6801-1.9324-8.7704-1.6834-12.798-0.6563-6.6405 1.6933-12.959 7.3273-19.033 10.501-6.7203 3.5115-11.405 6.5348-18.377 9.5165-4.1674 1.7823-11.614 3.8169-16.08 4.5941-4.3106 0.7503-10.501 1.969-10.501 1.969l-4.9223-10.829s5.7018 0.2803 8.532 0.0001c3.3303-0.3298 6.6913-0.8486 9.8447-1.969 10.604-3.7678 20.022-8.9771 29.862-14.439 5.3147-2.95 11.555-7.8199 17.392-9.5166 5.57 [...]
+ <path id="path15546-1-6" d="m1549.4 741.9-2.8222-6.8543s5.7018 0.2803 8.532 0.0001c3.3303-0.3298 6.6913-0.84859 9.8447-1.969 10.604-3.7678 20.022-8.9771 29.862-14.439 5.3147-2.95 11.555-7.8199 17.392-9.5166 5.571-1.6194 10.102-1.6497 15.752-0.3281 4.2417 0.99233 8.4232 3.1367 11.485 6.235 3.13 3.1669 5.1266 7.5011 6.235 11.814 0.8175 3.1807 0.865 8.1989 0.7268 12.237l0.5484-0.23565s-2.918-0.69849-4.0281-2.6826c-1.7723-3.1678-1.9387-8.8742-3.447-12.176-1.4089-3.0839-3.0718-4.9672- [...]
+ <path id="path15546-1-6-0" d="m1549 739.56-2.4636-4.5234s5.7018 0.2803 8.532 0.0001c3.3303-0.3298 6.6913-0.84859 9.8447-1.969 10.604-3.7678 20.022-8.9771 29.862-14.439 5.3147-2.95 11.555-7.8199 17.392-9.5166 5.571-1.6194 10.102-1.6497 15.752-0.3281 4.2417 0.99233 8.4232 3.1367 11.485 6.235 3.13 3.1669 5.1266 7.5011 6.235 11.814 0.8175 3.1807 0.865 8.1989 0.7268 12.237l0.5484-0.23565s-0.9457-2.4915-2.0558-4.4756c-1.7723-3.1678-1.9387-7.7984-3.447-11.1-1.4089-3.0839-4.3269-6.5809-7 [...]
+ <path id="path15546-1" d="m1634.5 746.2s1.6518-13.062 0.3282-18.048c-0.9885-3.7245-3.1515-6.4125-6.5632-8.204-3.6801-1.9324-8.7704-1.6834-12.798-0.6563-6.6405 1.6933-12.959 7.3273-19.033 10.501-6.7203 3.5115-11.405 6.5348-18.377 9.5165-4.1674 1.7823-11.614 3.8169-16.08 4.5941-4.3106 0.7503-10.501 1.969-10.501 1.969l-4.9223-10.829s5.7018 0.2803 8.532 0.0001c3.3303-0.3298 6.6913-0.8486 9.8447-1.969 10.604-3.7678 20.022-8.9771 29.862-14.439 5.3147-2.95 11.555-7.8199 17.392-9.5166 5. [...]
+ <path id="rect15548" fill="#fee46e" d="m1627.6 742.92h23.627v6.5631h-23.627v-6.5631z"/>
+ <path id="path18269" fill="#e4c900" d="m1637.3 742.64v6.9372h13.651v-6.4896l-13.651-0.4476z"/>
+ <path id="rect15548-0" d="m1627.6 742.92h23.627v6.5631h-23.627v-6.5631z" stroke="#806600" fill="none"/>
+ </g>
+ <g id="g20977">
+ <path id="path15544-6" d="m1618.4 841.84c-4.945-1.214-9.4247-2.6643-13.492-4.332-10.874-4.4585-18.799-10.47-24.787-17.672-9.5015-11.427-15.108-27.49-18.885-43.453-3.1004-13.104-4.6466-25.606-8.8394-39.983-1.711-5.8671-4.8593-10.305-9.2084-12.688-10.145-5.5587-19.814-3.8576-25.596 2.2497-3.8498 4.0664-5.9766 10.086-5.3736 17.217 0.4167 4.9283 2.7533 7.1549 3.9819 11.946 1.3788 5.3763-0.8726 9.5291-3.9819 13.715 0 0 7.4007 0.3096 10.176-1.6408 3.2059-2.2532 3.9818-9.4198 3.9818-9.4 [...]
+ <path id="path15544" d="m1620.9 844.66c-0.4095-1.2154-1.2482-2.2624-2.4776-2.8164-4.945-1.214-9.4247-2.6643-13.492-4.332-10.874-4.4585-18.799-10.47-24.787-17.672-9.5015-11.427-15.108-27.49-18.885-43.453-3.1004-13.104-4.6466-25.606-8.8394-39.983-1.711-5.8671-4.8593-10.305-9.2084-12.688-10.145-5.5587-19.814-3.8576-25.596 2.2497-3.8498 4.0664-5.9766 10.086-5.3736 17.217 0.4167 4.9283 2.7533 7.1549 3.9819 11.946 1.3788 5.3763-0.8726 9.5291-3.9819 13.715 0 0 6.3602-2.8708 8.3847-5.539 [...]
+ <path id="path18190" d="m1526.8 774.94-1.2394 10.209c15.001-6.6718 24.11-20.61 15.538-36.507l-0.9718 7.6535-1.6546 4.3822-4.669 8.1709-7.0037 6.0913z" fill="#fee46e"/>
+ <path id="path15544-1" d="m1515.2 764.09c1.729-2.2793 5.1176-4.9555 5.0529-7.8156-0.1009-4.4618-3.9446-9.6243-4.2877-14.074-0.2977-3.8612 0.039-9.089 2.3346-12.208 1.9097-2.5948 5.6636-5.6172 8.8442-6.1308 4.2001-0.67829 11.458 0.10515 14.818 2.716 5.6699 4.4068 6.9819 9.5313 9.1113 16.389 3.95 12.722 5.7498 32.477 10.76 44.82 0 0 5.2686 18.112 11.304 26.83 4.8975 7.0749 9.1004 12.412 16.298 17.128 6.6671 4.3677 13.724 8.285 21.505 10.011 3.3836 0.7508 10.014 2.9009 10.014 2.9009 [...]
+ <path id="path20931" d="m1791.8 1570.4-0.538 5.9189c12.439-5.2005 17.304-19.527 14.707-25.828l-2.8697 7.8918-2.8698 5.2014-4.8427 4.484-3.5872 2.3317z" transform="translate(-265.27 -795.88)" fill="#ffefa7"/>
+ <path id="path15544-6-9" d="m1618.4 841.84c-4.945-1.214-9.4247-2.6643-13.492-4.332-10.874-4.4585-18.799-10.47-24.787-17.672-9.5015-11.427-15.108-27.49-18.885-43.453-3.1004-13.104-4.6466-25.606-8.8394-39.983-1.711-5.8671-4.8593-10.305-9.2084-12.688-10.145-5.5587-19.814-3.8576-25.596 2.2497-3.8498 4.0664-5.9766 10.086-5.3736 17.217 0.4167 4.9283 2.7533 7.1549 3.9819 11.946 1.3788 5.3763-0.8726 9.5291-3.9819 13.715 0 0 7.4007 0.3096 10.176-1.6408 3.2059-2.2532 3.9818-9.4198 3.9818-9 [...]
+ </g>
+ </g>
+ </g>
+ <g id="g44183-7" transform="translate(32.414 507.38)">
+ <path id="path7014-6-7-0-18" d="m1445.3-36.259c-0.6676 73.546-0.7227 147.11 0.2154 220.65l202.83-0.16578-0.0001-220.49h-203.04z" fill="#ce0f25"/>
+ <g id="g17478-4-4" transform="translate(1030.8 210.48)">
+ <g id="g5924-10-9" transform="translate(-2.6111 -.48345)">
+ <g id="g5915-8-73">
+ <g id="g5810-14-1">
+ <path id="path13429-8-0-88-0" d="m469.89-189.44s-3.2133-0.0251-4.5-0.77844c-1.3993-0.81931-2.8976-3.7155-2.8976-3.7155s-3.5428 0.5752-5.1716 0.2223c-1.7019-0.36873-4.1377-2.3153-4.1377-2.3153 1.627-0.24015 2.8421-0.48567 4.4175-1.7601 0 0-3.1362-0.16604-4.9224-0.8537-1.5552-0.5987-4.0928-2.5827-4.0928-2.5827 1.4501-0.35994 3.0179-0.31529 4.1601-1.7326 0 0-3.0716 0.0277-4.4633-0.48078-1.3892-0.50759-3.5951-2.4616-3.5951-2.4616 1.688-0.14653 3.2936-0.45961 4.379-1.8238 0 0-3.1111 [...]
+ <path id="path5784-45-2" d="m728.67 600.09s2.1432 3.009 3.3436 3.5824c1.1493 0.5491 3.3436 0 3.3436 0l-0.71649-1.5524h-0.95532c-2.4926-2.9952-4.6214-6.5155-3.9407-10.509 0 0-2.8306-3.1395-4.5378-4.6572-2.2446-1.9955-8.2396-6.4484-8.2396-6.4484s-1.3723-3.3274-1.5524-5.6125c-0.0797-1.0117 0.13035-2.0842 0.59708-2.9854 0.47913-0.92508 1.885-1.2612 2.1495-2.2689 0.0833-0.31749-0.0277-0.70401-0.23883-0.95532-0.25219-0.30015-0.68338-0.5007-1.0747-0.47766-1.4788 0.087-3.8213 2.2689-3. [...]
+ <path id="path4316-0-8-79-3" d="m463.96-201.37c-3.5701-7.4161-9.7625-11.437-16.381-15.396 3.9692 7.4369 9.2548 11.964 16.381 15.396z" fill="#ffefa7"/>
+ </g>
+ <path id="path4318-6-3-4-84-71" d="m453.42-228.71c0.26597 1.262-0.26713 2.173-1.4104 2.5208-0.56821 0.17286-1.2252 0.00058-1.9105-0.71256 0.32966-2.0963 0.16478-2.9193-1.2819-4.7137 3.6173 0.77133 3.7546 2.3731 4.6028 2.9055z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-0-58-8" d="m443.34-229.69c0.76473 1.0385 0.65682 2.0886-0.23976 2.8785-0.4456 0.39266-1.1149 0.50793-2.0341 0.14266-0.56811-2.0446-1.059-2.7254-3.119-3.7595 3.6119-0.79601 4.4003 0.60505 5.3928 0.73838z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-8-93" d="m437.61-222.55c1.1281 0.62511 1.4678 1.6245 0.98223 2.7163-0.24131 0.54269-0.80162 0.92653-1.7894 0.97776-1.3688-1.6215-2.0989-2.0357-4.4024-2.1168 2.9511-2.2295 4.2518-1.2847 5.2096-1.5773z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <g id="g5750-94-7">
+ <path id="path13429-0-9-7-48" d="m513.51-183.58c-1.3343-0.38955-2.963-2.1437-4.3783-2.1357-1.4905 0.009-2.5414 0.84042-3.2912 1.9584-0.35783 0.53347 0.20388 2.5294 0.76142 2.9126l2.5674 1.7649s-1.6071 1.8464-1.7289 2.8858c-0.1058 0.90301 0.34775 1.628 0.99501 2.341 0.84401 0.92951 1.0511 1.2888 2.3959 1.4847 0.80306 0.11697 2.7034-0.23377 2.7034-0.23377s-0.0444 1.4813 0.4251 2.165c0.85068 1.239 2.2951 2.3313 3.9452 2.157 1.2886-0.13595 1.7067-0.33111 2.3878-1.2902 0.54003-0.7605 [...]
+ <path id="path5660-0-0" d="m783.74 615s3.5466-1.8658 5.43-2.7966c2.9696-1.4676 8.1605-1.8548 9.4654-4.8993 0 0 0.36901-0.67607 0.24826-1.6137-0.18076-1.4037-2.628-2.5641-1.8619-4.0962l0.62064-1.2413s2.6031 1.1202 3.3514 1.986c0.60801 0.70347 0.69545 1.8747 1.4895 2.3584 0.8158 0.49693 2.8549 0.24826 2.8549 0.24826l1.2413 3.5997s1.89-0.0156 2.6067 0.8689c0.21 0.25918 0.24967 0.68396 0.12413 0.99302-0.19942 0.49091-1.3474 0.61558-1.8474 0.79097-0.97609 0.34239-2.4826-0.76199-2.482 [...]
+ <path id="path4316-5-4-4" d="m535.02-185.57c-6.2504-0.32088-11.135 2.7033-16.128 6.072 6.4046 0.0294 11.312-2.1084 16.128-6.072z" fill="#ffefa7"/>
+ <path id="path4318-6-06-057" d="m506.63-185.27c1.1706 0.54134 1.5821 1.5134 1.1772 2.6377-0.20123 0.55879-0.7321 0.98239-1.7135 1.1053-1.4832-1.5177-2.2414-1.8776-4.5448-1.7909 2.7811-2.4383 4.1471-1.5906 5.081-1.9521z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-53-00" d="m507.77-176.49c1.2891-0.0398 2.0922 0.64527 2.2333 1.8318 0.0702 0.58976-0.21497 1.2062-1.0376 1.7554-2.0056-0.69331-2.8448-0.6758-4.8657 0.43264 1.3956-3.4252 2.9966-3.2785 3.67-4.0198z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-30-8-56" d="m514.68-170.36c1.0805-0.70409 2.1227-0.53622 2.86 0.40409 0.36649 0.46736 0.44329 1.1422 0.026 2.0389-2.0737 0.45018-2.7815 0.90132-3.9319 2.8987-0.58806-3.6516 0.85587-4.3584 1.0458-5.3417z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <path id="path5636-51-7" d="m808.69 595.02s-0.24352 4.5664-2.1508 5.7354c-0.82133 0.50342-1.9716 0.71207-2.8677 0.35846-0.86808-0.34255-1.4746-1.2733-1.7923-2.1508-0.20338-0.56175-0.53769-1.9715-0.53769-1.9715s-2.9158-1.3339-4.4808-1.4338c-2.3038-0.1471-6.8108 1.2546-6.8108 1.2546 0.76944-2.3922 2.8398-4.3507 5.0185-6.2731l7.5277-0.53769 6.0938 5.0185z" transform="translate(-265.27 -795.88)" stroke="#806600" stroke-width="1px" fill="#efd300"/>
+ <g id="g5837-24-8">
+ <path id="path13429-5-67-06" d="m563.76-231.22c2.1572-0.23696 6.5861-1.1163 8.0732-2.5693 0.69312-0.67726 2.6361-2.5693 2.6361-2.5693-0.41182 4.2716-2.6018 7.0405-7.2494 8.9171-3.7084 1.4974-7.9892 1.8438-12.027 1.5114-2.5428-0.20932-7.2494-1.5114-7.2494-1.5114 2.5819 2.7676 1.2698 4.7211-1.9771 6.0455 0 0 0.4811-2.6505-0.49427-3.0228-2.1035-0.80273-4.475 0.24322-6.7088 1.4717-1.6499 0.90739-4.1482 1.3305-5.8309 1.312-2.8032-0.0308-4.3568-0.0632-6.9785-0.97435-1.581-0.54947-4.32 [...]
+ <path id="path13429-5-2-4-55-5" d="m602.58-173.56c0.37815 1.0728 1.2322 3.4261 0.5537 4.3662-0.86862 1.204-2.6627 1.4499-4.214 1.208-0.85597-0.13346-2.0588-1.1243-2.0588-1.1243s-0.87586 1.484-1.4662 1.939c-0.98853 0.76189-1.4141 0.93925-2.7043 0.89386-0.98952-0.0349-1.8701-0.47932-2.5549-1.1355-0.78831-0.75526-1.3345-3.0162-1.3345-3.0162l-3.0423 0.55168c-0.66066 0.11981-2.663-0.80445-2.8862-1.3873-0.46783-1.2215-0.51317-2.4561 0.39506-3.4471 0.86236-0.9409 3.2472-0.98993 4.4623- [...]
+ <path id="path5808-0-73" d="m737.88 606.58s1.4082 2.6514 3.2165 3.7289c0.81128 0.48338 2.5551 1.2354 2.5551 1.2354l0.35668-2.7756s1.619-0.61945 2.6264-1.1673c1.0075-0.54785 3.356-2.1887 3.356-2.1887l0.43774 2.4805s5.4081-2.6518 7.5874-4.6692c1.4564-1.3482 2.8681-2.9344 3.5019-4.8151 0.73017-2.1668 0.14591-6.8579 0.14591-6.8579l-14.764 0.51863-3.3579 12.792-5.662 1.7182h-0.00004z" transform="translate(-265.27 -795.88)" fill="#e4c900"/>
+ <path id="path13429-5-2-7-52-4" d="m600.9-179.22s1.1259-0.033 1.6229 0.1712c0.79473 0.32651 2.0882 1.2157 2.0882 1.2157s-0.19141-2.1781-0.96212-3.1521c-0.9648-1.2192-3.1613-2.2695-3.1613-2.2695s0.93205-0.56214 1.46-0.70152c0.81159-0.21426 2.5259-0.18106 2.5259-0.18106s-1.1026-1.3756-2.0617-2.1434c-1.0834-0.86729-4.2608-0.63041-4.2608-0.63041s0.97703-0.94937 1.5725-1.2942c0.77897-0.45107 2.4134-0.34488 2.4134-0.34488s-1.122-1.3971-2.3366-1.8912c-1.1339-0.46135-3.8485-0.50435-3.84 [...]
+ <path id="path4414-07-30" d="m557.48-204.79 10.97 0.56546 9.1605 0.11309h5.7677c6.6327-1.3371 14.359-2.7989 17.529-9.4998l0.1131-4.9761c-0.28789 2.9589-1.5285 5.2798-3.4758 7.0343-9.2315 8.3176-29.839 5.5392-39.726 2.6917l-6.8987-0.90475 6.5594 4.9761z" fill="#e4c900"/>
+ <path id="path5188-7-4" d="m571.18-221.21c-7.2623 0.59556-25.522 5.6139-39.555 6.7817-7.4968 0.62388-15.682 0.21212-20.405-2.5725-2.0815-1.227-3.4909-2.9149-3.8732-5.1778l-0.69517 2.6416 2.2245 3.4758 5.0052 2.3636 9.4543 1.8074 10.289-0.8342 5.8394-0.55614 30.726-5.8394 0.9903-2.0902z" fill="#e4c900"/>
+ <path id="path5190-97-8" d="m571.16-221.39c0.16289 2.8742 0.80056 4.0867 1.4527 5.2485 0.83126-1.812 1.5143-3.9988 4.1238-5.8108 0.77354 1.9994 1.3557 4.3737 2.6242 6.3732 0.62029-2.2648 0.74038-5.0218 2.9991-6.9355 0.81886 1.8884 1.5539 4.196 2.4836 5.5296-0.0201-1.4371-0.17314-3.1553 1.6402-4.5924 7.0913-3.79 16.558 3.2005 9.7003 8.0133l0.0937 0.0469 0.6092-2.1088-0.65606-2.6242-2.1556-1.687-2.7648-0.89037-3.5615 0.70292-1.5464 1.5933 0.46862 1.9682 2.3431 2.2025-3.7958-0.2811 [...]
+ <path id="path5192-53-7" d="m520.82-225.43 6.3005 3.0518 6.3005 0.78756 3.9378-0.68912 4.3316-2.1658 3.4456-0.19689 0.98445 1.2798 0.0985 2.2642 2.2642-1.8705 0.59067-1.5751-0.68912-2.7565 4.627 1.1814 5.9067 0.39378 6.1036-0.98445 5.4145-2.1658 2.658-2.7565 1.3782-4.7254s-2.9123 4.0932-5.0207 5.3161c-2.6576 1.5414-5.9079 2.393-8.9586 2.7565-2.9652 0.35335-5.9904-0.2633-8.9586-0.59067-3.4423-0.37966-8.5648-2.2642-8.5648-2.2642 1.0391 1.5095 2.091 3.019 2.3627 4.5285 0 0-3.24-0.7 [...]
+ <path id="path5194-9-5" d="m515.53-228.62s3.2333 0.48514 4.8553 0.40461c4.8284-0.2397 9.4701-1.9947 14.263-2.63 2.8841-0.38229 5.7912-0.79816 8.6992-0.70807 3.7795 0.11709 7.4493 1.4758 11.228 1.6184 1.9925 0.0752 4.1703 0.45794 5.968-0.40461 1.0327-0.49549 2.0624-1.4143 2.3265-2.5288 0.28307-1.1942-1.0115-3.5404-1.0115-3.5404l0.10115 0.10115-0.50576 1.8208-2.3265 1.9219-2.7311 0.70807-4.5519-0.40461-6.8784-0.80923h-7.6876l-8.598 1.0115-8.3957 1.7196-4.7542 1.7196z" fill="#fff1a1"/>
+ <path id="path5196-9-9" d="m564.29-222.7c13.687 2.0155 30.165-6.5438 36.335 5.128l-0.14651-0.14652 0.43954-1.9047-3.0768-3.3698-4.1024-2.1977-7.6187-0.87908-9.9629 1.0256-11.868 2.3442z" fill="#fff1a1"/>
+ <path id="path5465-4-5" d="m444.79-187.75s0.52172 3.7286 1.8071 4.905c1.5784 1.4446 6.1958 1.678 6.1958 1.678s6.7077-3.9263 10.326-5.2922c2.9484-1.113 6.0969-1.6013 9.1646-2.3234 0.98578-0.23204 2.9688-0.6454 2.9688-0.6454s0.52861-3.357 0.38723-5.0341c-0.13412-1.591-1.1617-4.6468-1.1617-4.6468l-0.77447 8.132-8.132 1.678-7.2284 2.7107-5.6795 3.356-5.6795-1.2908-2.1943-3.227z" fill="#e4c900"/>
+ <path id="path13429-5-2-91-32" d="m563.76-231.22c2.1572-0.23696 6.5861-1.1163 8.0732-2.5694 0.69312-0.67726 2.6361-2.5693 2.6361-2.5693-0.41182 4.2716-2.6018 7.0405-7.2494 8.9171-3.7084 1.4974-7.9892 1.8438-12.027 1.5114-2.5428-0.20931-7.2494-1.5114-7.2494-1.5114 2.5819 2.7676 1.2698 4.7211-1.9771 6.0455 0 0 0.4811-2.6505-0.49427-3.0227-2.1035-0.80273-4.475 0.24321-6.7088 1.4717-1.6499 0.90739-4.1482 1.3305-5.8309 1.312-2.8032-0.0308-4.3568-0.0632-6.9785-0.97436-1.581-0.54946-4. [...]
+ <path id="path4312-59-73" d="m492.12-190.69c12.449-0.2103 22.272-11.103 30.73-14.417-17.608 5.7618-22.127 5.5427-24.357 7.6214-0.94342 0.87918-0.97782 2.0496-1.84 3.267-0.8571 1.2101-2.5388 2.4665-4.5325 3.529z" fill="#ffefa7"/>
+ <path id="path4314-83-9" d="m575.07-192.04c-17.912 1.167-19.031-13.258-36.915-14.993 15.167 8.1156 16.991 20.439 36.915 14.993z" fill="#fff1a1"/>
+ <path id="path4316-09-7" d="m583-193.17c1.795 5.9957 6.2828 9.5823 11.132 13.155-2.1213-6.0432-5.7817-9.9485-11.132-13.155z" fill="#fff1a1"/>
+ <g id="g4351-07-79" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8">
+ <path id="path4318-68-5" d="m582.91-173.1c1.206-0.45712 2.1883-0.0706 2.7078 1.0055 0.25823 0.53484 0.18919 1.2105-0.40993 1.9974-2.122-0.003-2.9098 0.28661-4.4602 1.9923 0.20521-3.6929 1.7668-4.0752 2.1623-4.9952z"/>
+ <path id="path4318-1-3-33" d="m589.89-168.72c0.89979-0.92394 1.9534-0.98877 2.879-0.23307 0.46006 0.37559 0.68302 1.0171 0.47261 1.9836-1.9245 0.89407-2.5161 1.4895-3.2003 3.6906-1.3747-3.4336-0.12095-4.44-0.15134-5.441z"/>
+ <path id="path4318-8-8-38" d="m598.52-169.35c0.62765-1.1266 1.6279-1.464 2.7186-0.97596 0.54211 0.24259 0.92468 0.80375 0.97364 1.7916-1.6247 1.3651-2.0405 2.0942-2.1269 4.3976-2.2227-2.9562-1.2749-4.2548-1.5653-5.2132z"/>
+ </g>
+ <path id="path4318-80-61-58" d="m440.98-188.39c1.1687 0.54532 1.5769 1.5188 1.1681 2.6417-0.20314 0.5581-0.73545 0.9799-1.7173 1.0995-1.478-1.5227-2.235-1.8852-4.5386-1.8064 2.7894-2.4288 4.1525-1.5764 5.0877-1.9348z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-1-4-9-9" d="m436.15-181.66c1.2891 0.0387 2.049 0.77138 2.1177 1.9644 0.0342 0.59291-0.28797 1.1908-1.1424 1.689-1.9597-0.81407-2.7984-0.84765-4.883 0.13576 1.6015-3.3339 3.1906-3.0901 3.9078-3.7891z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-8-6-6-6" d="m439.99-173.38c1.1489-0.58595 2.1675-0.30892 2.8014 0.70405 0.315 0.50349 0.32012 1.1826-0.18956 2.0302-2.1097 0.22855-2.8612 0.60238-4.2162 2.467-0.19892-3.6933 1.3116-4.2436 1.6044-5.2013z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4316-0-7-04" d="m473.17-186.89c-8.2126-0.54642-13.083 2.9419-19.789 6.7508 8.4272 0.20931 13.292-2.2404 19.789-6.7508z" fill="#ffefa7"/>
+ </g>
+ <g id="g4338-8-89-2" transform="matrix(.96160 .27445 -.27445 .96160 -204.64 -191)">
+ <path id="path14997-8-0-1-79-2-8-3-77-7-33" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864-0.7 [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-0-4-5-7" d="m644.79-216.04c-0.28315 0.81131-1.5511 5.1996-2.249 6.0725-1.0381 1.2984-2.1027 1.6494-2.1027 1.6494 1.1459 1.523 1.525 2.1719 4.1235 1.788-4.5382 5.7247-3.3209 12.444 2.6495 16.759 0.0948-0.74991 0.63997-2.5469 1.0516-3.2948-0.0753-0.0307 0.9917 3.1956 3.0952 4.3932 0.68254 0.38858 1.7964 3.317 2.8296 4.0431 0.94251 0.66246 2.1886 1.3199 2.1886 1.3199s0.08-2.5975 1.0879-3.2864c1.015-0.6938 2.9388-1.8908 3.5677-2.306 1.2656-0.8356 [...]
+ <g id="g4307-4-5-0" transform="translate(0 -.75004)">
+ <path id="path5211-9-2-0" fill="#504416" d="m650.46-210.73c0.94 2.0538 1.1251 6.5986 0.64531 7.9898l5.4395 0.56423 4.9754-0.81907c-0.95614-1.8603-0.12607-6.2653 0.46147-7.8504l-3.5184 1.0866-2.0313-1.1285-2.7083 1.467-3.2636-1.3097z"/>
+ <g id="g4139-1-49-1" fill="#fff">
+ <path id="path5213-9-7-5-4-0" d="m652.03-201.5c0.0211-2.4912 0.50919-2.8128 0.88867-3.6914l0.54687 3.4179-1.4355 0.27343z"/>
+ <path id="path5213-9-7-9-5-47-3" d="m660.45-201.5c-0.0211-2.4912-0.50919-2.8128-0.88867-3.6914l-0.54687 3.4179 1.4355 0.27343z"/>
+ </g>
+ <path id="path5160-2-5-95-0" d="m651.36-202.73c-0.81165 7.0872 10.243 7.3994 9.7355 0-2.7762 0.58616-5.7673 0.90381-9.7355 0z" fill="#e4c900"/>
+ <path id="path5160-2-3-8-56-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m650.93-203.3-0.0625 0.5625c-0.21756 1.8997 0.38656 3.4223 1.4062 4.4375 1.0197 1.0152 2.4282 1.51 3.8438 1.5312 1.4155 0.0213 2.8459-0.43482 3.9062-1.4375s1.6979-2.558 1.5625-4.5312l-0.0312-0.5625-0.5625 0.125c-2.741 0.57871-5.6408 0.8861-9.5312 0l-0.53125-0.125h-0.00005zm0.96875 1.1562c3.3974 0.66907 6.1564 0.50399 8.625 0.0312-0.0319 1.4052-0.44577 2.4861-1.1875 3.1 [...]
+ <path id="path5010-2-2-15-3" d="m653.95-209.47c-0.0725 4.5313 0.1742 9.5588 2.2688 13.657 2.0946-4.0979 2.3412-9.082 2.2688-13.613-0.0432-0.17139-0.98524-0.30903-1.1301-0.41285-0.35601-0.25521-1.0222-0.90865-1.0222-0.90865s-0.69131 0.7735-1.1358 1.0222c-0.37899 0.21208-1.2494 0.25591-1.2494 0.25591z" stroke="#2c5aa0" fill="#377bc8"/>
+ <g id="g5237-9-91-8" transform="translate(-14.216 -5.3362)" fill="#fff">
+ <path id="path5213-8-3-36" d="m665.98-204.45c0.0211 2.4912 0.50919 2.8128 0.88867 3.6914l0.54687-3.4179-1.4355-0.27343z"/>
+ <path id="path5213-9-2-88-0" d="m674.88-204.45c-0.0211 2.4912-0.50919 2.8128-0.88867 3.6914l-0.54687-3.4179 1.4355-0.27343z"/>
+ </g>
+ <g id="g5011-07-943-40" transform="translate(-14.133 -5.3362)">
+ <path id="path4962-4-95-92" d="m668.94-212.14s0.8411 0.79935 1.375 0.825c0.53241 0.0256 1.4437-0.6875 1.4437-0.6875l-1.5125-4.0562-1.3062 3.9187z" fill="#ffefa7"/>
+ <g id="g4892-8-1-4" transform="translate(-.11475)">
+ <g id="g4855-5-74-9" transform="translate(0 .064716)">
+ <path id="path4045-83-5-2" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-06-1-9" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-2-46-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0.38334 0.625 [...]
+ </g>
+ <g id="g4855-3-2-03-0" transform="matrix(-1 0 0 1 1340.9 .064716)">
+ <path id="path4045-9-52-2-9" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-0-2-21-3" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-5-7-4-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0.38334 0.62 [...]
+ </g>
+ </g>
+ <path id="path4902-1-77-03" d="m661.12-211.22 0.2189 1.9505 0.63079 0.57371c-1.4494-0.21083 1.916 0.48806 2.6167 0.63557l0.11062 2.2124 1.4934 1.8252 2.3783 0.22124 1.8805-1.2168 1.604 1.2721 2.1571-0.11062 2.2124-1.9911v-2.323l2.0193-0.1559 1.1334-1.0056v-1.7699c-0.97175 1.2236-1.9336 2.4242-4.7013 2.1018 0.30303 1.3307 0.21514 2.2357-0.10593 2.8294-0.38328 0.70879-1.0988 0.97406-1.8783 0.99065-0.97223 0.0207-2.0383-0.78084-2.5511-1.2205-0.74162 0.79142-1.3904 1.4166-1.9952 1 [...]
+ <path id="path4402-2-5-0-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m661.06-211.69c-0.48492 1.2877-0.28378 2.4598 0.42441 3.2089 0.59079 0.6249 1.4921 0.86991 2.474 0.91092-0.0108 0.15882-0.018 0.18577-0.0207 0.41406-0.006 0.49673 0.005 1.0718 0.20702 1.5734 0.41453 1.0274 1.2478 1.7102 2.1945 2.1427 0.82617 0.37748 1.7898 0.3611 2.6086 0.0828 0.50449-0.17148 0.90215-0.49664 1.2111-0.78671 0.11015-0.10341 0.11986-0.12422 0.20703-0.21738 [...]
+ <g id="g4958-2-9-1" transform="translate(-.0084986)" fill="#ffefa7">
+ <path id="path4904-1-57-9" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-265.65 -796.35)"/>
+ <path id="path4904-2-1-2-8" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-260.64 -796.35)"/>
+ </g>
+ <path id="path4928-0-9-6" d="m667.32-209.87s1.8744-0.9079 2.8875-0.9625c1.0772-0.0581 3.1625 0.6875 3.1625 0.6875v1.0312l-2.6125 1.5125-2.4062-1.2375-0.61875-0.1375-0.4125-0.89374z" fill="#e4c900"/>
+ <path id="path4930-1-76-90" d="m663.05-216.43c-0.68077 0.0986-1.4372 0.43559-1.7812 1.0312-0.20631 0.3572 0 1.25 0 1.25l1.0312-0.28125h1.25l2.8125 0.40625 2.6875-0.9375s-1.6672-0.18486-2.5155-0.38981c-1.1454-0.27675-2.3184-1.2479-3.4845-1.0789zm14.156 0c-1.0124 0.0279-1.9507 0.83678-2.953 1.0789-0.84823 0.20495-2.5783 0.38981-2.5783 0.38981l2.6875 0.9375 2.8125-0.40625h1.2188l1.0312 0.28125s0.20631-0.8928 0-1.25c-0.34403-0.59566-1.1005-0.93263-1.7812-1.0312-0.14577-0.0211-0.29 [...]
+ <path id="path3477-9-0-5-8-82-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m669.17-215.78-0.50722 0.23808s-1.7236 0.79174-3.2814 0.78671c-0.63267-0.002-1.5924-0.38405-2.4947-0.46582-0.45115-0.0409-0.94895 0.004-1.3353 0.35195-0.38639 0.34805-0.55842 0.90541-0.55898 1.6252 0.52653-0.24596 0.82663-0.54771 1.2215-0.87987 0.0934-0.0842 0.25887-0.13259 0.57969-0.10351 0.64162 0.0581 1.6283 0.47305 2.5878 0.47616 1.3739 0.004 2.4581-0.38749 3.08 [...]
+ </g>
+ </g>
+ <path id="path14997-8-0-1-79-2-8-3-7-7-76-99-6" d="m665.95-223.26s-0.49091-1.4887-1.2937-2.7471c-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864-0.70266-1.2864-0.70266 0.20494 0.78744-0.2941 1.7027-0.49785 2.3509 0 0-1.1545-2.9101-2.2123-3.7701-0.81594-0.66339-2.7302-1.3104-2.7174-1.3103 0.0129 0.00039-1.7876 0.62325-2.612 1.2761-1.0688 0.84639-2.2606 3.7414-2.2606 3.7414-0.19541-0.65083-0.6826-1.5724-0.46754-2.3572 0 0-0.59719 0.15772-1.2953 0.68607-0.67922 0 [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-00-83-4" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864-0 [...]
+ <g id="g5134-9-71-4" transform="translate(-14.275 -5.3362)" fill="#806600">
+ <path id="path5110-5-2-8" d="m657.2-218.43s1.8048 0.59598 2.1668 1.4196c0.49367 1.123 0.37359 4.5578 0.37359 4.5578s-2.2734-1.6935-2.6898-2.6151c-0.52396-1.1595 0.14943-3.3623 0.14943-3.3623z"/>
+ <path id="path5110-9-6-61-6" d="m683.59-218.43s-1.8048 0.59598-2.1668 1.4196c-0.49367 1.123-0.37359 4.5578-0.37359 4.5578s2.2734-1.6935 2.6898-2.6151c0.52396-1.1595-0.14943-3.3623-0.14943-3.3623z"/>
+ </g>
+ <path id="path5269-2-7-14" d="m650.51-207.52c-3.467 0.6834-6.1184 6.1246-4.6204 11.221 1.4267-3.9078 5.3052-9.0696 4.6204-11.221z" fill="#fff1a1"/>
+ <path id="path5269-9-85-6-08" d="m662.74-206.29c2.4916 0.19567 4.4704 4.4054 3.6724 9.8517-0.58652-3.9078-3.5124-7.7004-3.6724-9.8517z" fill="#fff1a1"/>
+ <path id="path5293-9-5-10" d="m650.99-199.18s-0.36334 2.0037-0.00035 3.4397c0.2429 0.9609 0.55598 1.9515 1.1586 2.7384 0.62338 0.8141 3.4062 1.8958 3.4062 1.8958l-0.003 2.3214s2.1544-1.7637 2.4258-2.7394c0.20719-0.74489 0.63526-3.6925 0.63526-3.6925l-2.0045 2.7412s-3.187-1.3138-3.9329-2.3171c-1.1474-1.5434-1.6848-4.3876-1.6848-4.3876z" fill="#fff1a1"/>
+ <path id="path5295-43-04-3" d="m647.59-222.28s-0.13419-0.75608 1.549-1.5407c1.7741-0.82701 5.4036-1.6857 6.7715-1.7243 1.6398-0.0462 5.2361 0.84692 7.1211 1.7688 1.5851 0.77521 1.6207 1.6016 1.6207 1.6016-2.9139-0.49181-5.8279-0.17447-8.7418 0.73726-2.4153-1.1166-5.0664-1.6831-8.3205-0.84258z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g5924-3-51-11" transform="translate(-2.6111 63.536)">
+ <g id="g5915-7-2-50">
+ <g id="g5810-48-3-8">
+ <path id="path13429-8-0-0-7-4" d="m469.89-189.44s-3.2133-0.0251-4.5-0.77844c-1.3993-0.81931-2.8976-3.7155-2.8976-3.7155s-3.5428 0.5752-5.1716 0.2223c-1.7019-0.36873-4.1377-2.3153-4.1377-2.3153 1.627-0.24015 2.8421-0.48567 4.4175-1.7601 0 0-3.1362-0.16604-4.9224-0.8537-1.5552-0.5987-4.0928-2.5827-4.0928-2.5827 1.4501-0.35994 3.0179-0.31529 4.1601-1.7326 0 0-3.0716 0.0277-4.4633-0.48078-1.3892-0.50759-3.5951-2.4616-3.5951-2.4616 1.688-0.14653 3.2936-0.45961 4.379-1.8238 0 0-3.111 [...]
+ <path id="path5784-4-2-93" d="m728.67 600.09s2.1432 3.009 3.3436 3.5824c1.1493 0.5491 3.3436 0 3.3436 0l-0.71649-1.5524h-0.95532c-2.4926-2.9952-4.6214-6.5155-3.9407-10.509 0 0-2.8306-3.1395-4.5378-4.6572-2.2446-1.9955-8.2396-6.4484-8.2396-6.4484s-1.3723-3.3274-1.5524-5.6125c-0.0797-1.0117 0.13035-2.0842 0.59708-2.9854 0.47913-0.92508 1.885-1.2612 2.1495-2.2689 0.0833-0.31749-0.0277-0.70401-0.23883-0.95532-0.25219-0.30015-0.68338-0.5007-1.0747-0.47766-1.4788 0.087-3.8213 2.2689- [...]
+ <path id="path4316-0-8-0-4-05" d="m463.96-201.37c-3.5701-7.4161-9.7625-11.437-16.381-15.396 3.9692 7.4369 9.2548 11.964 16.381 15.396z" fill="#ffefa7"/>
+ </g>
+ <path id="path4318-6-3-4-57-1-2" d="m453.42-228.71c0.26597 1.262-0.26713 2.173-1.4104 2.5208-0.56821 0.17286-1.2252 0.00058-1.9105-0.71256 0.32966-2.0963 0.16478-2.9193-1.2819-4.7137 3.6173 0.77133 3.7546 2.3731 4.6028 2.9055z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-0-0-82-3" d="m443.34-229.69c0.76473 1.0385 0.65682 2.0886-0.23976 2.8785-0.4456 0.39266-1.1149 0.50793-2.0341 0.14266-0.56811-2.0446-1.059-2.7254-3.119-3.7595 3.6119-0.79601 4.4003 0.60505 5.3928 0.73838z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-0-6-8" d="m437.61-222.55c1.1281 0.62511 1.4678 1.6245 0.98223 2.7163-0.24131 0.54269-0.80162 0.92653-1.7894 0.97776-1.3688-1.6215-2.0989-2.0357-4.4024-2.1168 2.9511-2.2295 4.2518-1.2847 5.2096-1.5773z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <g id="g5750-5-0-7">
+ <path id="path13429-0-9-6-3-80" d="m513.51-183.58c-1.3343-0.38955-2.963-2.1437-4.3783-2.1357-1.4905 0.009-2.5414 0.84042-3.2912 1.9584-0.35783 0.53347 0.20388 2.5294 0.76142 2.9126l2.5674 1.7649s-1.6071 1.8464-1.7289 2.8858c-0.1058 0.90301 0.34775 1.628 0.99501 2.341 0.84401 0.92951 1.0511 1.2888 2.3959 1.4847 0.80306 0.11697 2.7034-0.23377 2.7034-0.23377s-0.0444 1.4813 0.4251 2.165c0.85068 1.239 2.2951 2.3313 3.9452 2.157 1.2886-0.13595 1.7067-0.33111 2.3878-1.2902 0.54003-0.76 [...]
+ <path id="path5660-7-9-4" d="m783.74 615s3.5466-1.8658 5.43-2.7966c2.9696-1.4676 8.1605-1.8548 9.4654-4.8993 0 0 0.36901-0.67607 0.24826-1.6137-0.18076-1.4037-2.628-2.5641-1.8619-4.0962l0.62064-1.2413s2.6031 1.1202 3.3514 1.986c0.60801 0.70347 0.69545 1.8747 1.4895 2.3584 0.8158 0.49693 2.8549 0.24826 2.8549 0.24826l1.2413 3.5997s1.89-0.0156 2.6067 0.8689c0.21 0.25918 0.24967 0.68396 0.12413 0.99302-0.19942 0.49091-1.3474 0.61558-1.8474 0.79097-0.97609 0.34239-2.4826-0.76199-2.4 [...]
+ <path id="path4316-5-8-4-5" d="m535.02-185.57c-6.2504-0.32088-11.135 2.7033-16.128 6.072 6.4046 0.0294 11.312-2.1084 16.128-6.072z" fill="#ffefa7"/>
+ <path id="path4318-6-0-9-7" d="m506.63-185.27c1.1706 0.54134 1.5821 1.5134 1.1772 2.6377-0.20123 0.55879-0.7321 0.98239-1.7135 1.1053-1.4832-1.5177-2.2414-1.8776-4.5448-1.7909 2.7811-2.4383 4.1471-1.5906 5.081-1.9521z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-6-65-1" d="m507.77-176.49c1.2891-0.0398 2.0922 0.64527 2.2333 1.8318 0.0702 0.58976-0.21497 1.2062-1.0376 1.7554-2.0056-0.69331-2.8448-0.6758-4.8657 0.43264 1.3956-3.4252 2.9966-3.2785 3.67-4.0198z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-30-57-13-06" d="m514.68-170.36c1.0805-0.70409 2.1227-0.53622 2.86 0.40409 0.36649 0.46736 0.44329 1.1422 0.026 2.0389-2.0737 0.45018-2.7815 0.90132-3.9319 2.8987-0.58806-3.6516 0.85587-4.3584 1.0458-5.3417z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <path id="path5636-3-2-03" d="m808.69 595.02s-0.24352 4.5664-2.1508 5.7354c-0.82133 0.50342-1.9716 0.71207-2.8677 0.35846-0.86808-0.34255-1.4746-1.2733-1.7923-2.1508-0.20338-0.56175-0.53769-1.9715-0.53769-1.9715s-2.9158-1.3339-4.4808-1.4338c-2.3038-0.1471-6.8108 1.2546-6.8108 1.2546 0.76944-2.3922 2.8398-4.3507 5.0185-6.2731l7.5277-0.53769 6.0938 5.0185z" transform="translate(-265.27 -795.88)" stroke="#806600" stroke-width="1px" fill="#efd300"/>
+ <g id="g5837-4-69-3">
+ <path id="path13429-5-30-00-50" d="m563.76-231.22c2.1572-0.23696 6.5861-1.1163 8.0732-2.5693 0.69312-0.67726 2.6361-2.5693 2.6361-2.5693-0.41182 4.2716-2.6018 7.0405-7.2494 8.9171-3.7084 1.4974-7.9892 1.8438-12.027 1.5114-2.5428-0.20932-7.2494-1.5114-7.2494-1.5114 2.5819 2.7676 1.2698 4.7211-1.9771 6.0455 0 0 0.4811-2.6505-0.49427-3.0228-2.1035-0.80273-4.475 0.24322-6.7088 1.4717-1.6499 0.90739-4.1482 1.3305-5.8309 1.312-2.8032-0.0308-4.3568-0.0632-6.9785-0.97435-1.581-0.54947-4 [...]
+ <path id="path13429-5-2-4-4-39-2" d="m602.58-173.56c0.37815 1.0728 1.2322 3.4261 0.5537 4.3662-0.86862 1.204-2.6627 1.4499-4.214 1.208-0.85597-0.13346-2.0588-1.1243-2.0588-1.1243s-0.87586 1.484-1.4662 1.939c-0.98853 0.76189-1.4141 0.93925-2.7043 0.89386-0.98952-0.0349-1.8701-0.47932-2.5549-1.1355-0.78831-0.75526-1.3345-3.0162-1.3345-3.0162l-3.0423 0.55168c-0.66066 0.11981-2.663-0.80445-2.8862-1.3873-0.46783-1.2215-0.51317-2.4561 0.39506-3.4471 0.86236-0.9409 3.2472-0.98993 4.462 [...]
+ <path id="path5808-8-5-3" d="m737.88 606.58s1.4082 2.6514 3.2165 3.7289c0.81128 0.48338 2.5551 1.2354 2.5551 1.2354l0.35668-2.7756s1.619-0.61945 2.6264-1.1673c1.0075-0.54785 3.356-2.1887 3.356-2.1887l0.43774 2.4805s5.4081-2.6518 7.5874-4.6692c1.4564-1.3482 2.8681-2.9344 3.5019-4.8151 0.73017-2.1668 0.14591-6.8579 0.14591-6.8579l-14.764 0.51863-3.3579 12.792-5.662 1.7182h-0.00004z" transform="translate(-265.27 -795.88)" fill="#e4c900"/>
+ <path id="path13429-5-2-7-75-31-2" d="m600.9-179.22s1.1259-0.033 1.6229 0.1712c0.79473 0.32651 2.0882 1.2157 2.0882 1.2157s-0.19141-2.1781-0.96212-3.1521c-0.9648-1.2192-3.1613-2.2695-3.1613-2.2695s0.93205-0.56214 1.46-0.70152c0.81159-0.21426 2.5259-0.18106 2.5259-0.18106s-1.1026-1.3756-2.0617-2.1434c-1.0834-0.86729-4.2608-0.63041-4.2608-0.63041s0.97703-0.94937 1.5725-1.2942c0.77897-0.45107 2.4134-0.34488 2.4134-0.34488s-1.122-1.3971-2.3366-1.8912c-1.1339-0.46135-3.8485-0.50435-3 [...]
+ <path id="path4414-9-1-7" d="m557.48-204.79 10.97 0.56546 9.1605 0.11309h5.7677c6.6327-1.3371 14.359-2.7989 17.529-9.4998l0.1131-4.9761c-0.28789 2.9589-1.5285 5.2798-3.4758 7.0343-9.2315 8.3176-29.839 5.5392-39.726 2.6917l-6.8987-0.90475 6.5594 4.9761z" fill="#e4c900"/>
+ <path id="path5188-5-2-10" d="m571.18-221.21c-7.2623 0.59556-25.522 5.6139-39.555 6.7817-7.4968 0.62388-15.682 0.21212-20.405-2.5725-2.0815-1.227-3.4909-2.9149-3.8732-5.1778l-0.69517 2.6416 2.2245 3.4758 5.0052 2.3636 9.4543 1.8074 10.289-0.8342 5.8394-0.55614 30.726-5.8394 0.9903-2.0902z" fill="#e4c900"/>
+ <path id="path5190-3-69-09" d="m571.16-221.39c0.16289 2.8742 0.80056 4.0867 1.4527 5.2485 0.83126-1.812 1.5143-3.9988 4.1238-5.8108 0.77354 1.9994 1.3557 4.3737 2.6242 6.3732 0.62029-2.2648 0.74038-5.0218 2.9991-6.9355 0.81886 1.8884 1.5539 4.196 2.4836 5.5296-0.0201-1.4371-0.17314-3.1553 1.6402-4.5924 7.0913-3.79 16.558 3.2005 9.7003 8.0133l0.0937 0.0469 0.6092-2.1088-0.65606-2.6242-2.1556-1.687-2.7648-0.89037-3.5615 0.70292-1.5464 1.5933 0.46862 1.9682 2.3431 2.2025-3.7958-0.2 [...]
+ <path id="path5192-2-1-71" d="m520.82-225.43 6.3005 3.0518 6.3005 0.78756 3.9378-0.68912 4.3316-2.1658 3.4456-0.19689 0.98445 1.2798 0.0985 2.2642 2.2642-1.8705 0.59067-1.5751-0.68912-2.7565 4.627 1.1814 5.9067 0.39378 6.1036-0.98445 5.4145-2.1658 2.658-2.7565 1.3782-4.7254s-2.9123 4.0932-5.0207 5.3161c-2.6576 1.5414-5.9079 2.393-8.9586 2.7565-2.9652 0.35335-5.9904-0.2633-8.9586-0.59067-3.4423-0.37966-8.5648-2.2642-8.5648-2.2642 1.0391 1.5095 2.091 3.019 2.3627 4.5285 0 0-3.24-0 [...]
+ <path id="path5194-7-9-74" d="m515.53-228.62s3.2333 0.48514 4.8553 0.40461c4.8284-0.2397 9.4701-1.9947 14.263-2.63 2.8841-0.38229 5.7912-0.79816 8.6992-0.70807 3.7795 0.11709 7.4493 1.4758 11.228 1.6184 1.9925 0.0752 4.1703 0.45794 5.968-0.40461 1.0327-0.49549 2.0624-1.4143 2.3265-2.5288 0.28307-1.1942-1.0115-3.5404-1.0115-3.5404l0.10115 0.10115-0.50576 1.8208-2.3265 1.9219-2.7311 0.70807-4.5519-0.40461-6.8784-0.80923h-7.6876l-8.598 1.0115-8.3957 1.7196-4.7542 1.7196z" fill="#fff1a1"/>
+ <path id="path5196-39-0-51" d="m564.29-222.7c13.687 2.0155 30.165-6.5438 36.335 5.128l-0.14651-0.14652 0.43954-1.9047-3.0768-3.3698-4.1024-2.1977-7.6187-0.87908-9.9629 1.0256-11.868 2.3442z" fill="#fff1a1"/>
+ <path id="path5465-77-6-7" d="m444.79-187.75s0.52172 3.7286 1.8071 4.905c1.5784 1.4446 6.1958 1.678 6.1958 1.678s6.7077-3.9263 10.326-5.2922c2.9484-1.113 6.0969-1.6013 9.1646-2.3234 0.98578-0.23204 2.9688-0.6454 2.9688-0.6454s0.52861-3.357 0.38723-5.0341c-0.13412-1.591-1.1617-4.6468-1.1617-4.6468l-0.77447 8.132-8.132 1.678-7.2284 2.7107-5.6795 3.356-5.6795-1.2908-2.1943-3.227z" fill="#e4c900"/>
+ <path id="path13429-5-2-95-17-82" d="m563.76-231.22c2.1572-0.23696 6.5861-1.1163 8.0732-2.5694 0.69312-0.67726 2.6361-2.5693 2.6361-2.5693-0.41182 4.2716-2.6018 7.0405-7.2494 8.9171-3.7084 1.4974-7.9892 1.8438-12.027 1.5114-2.5428-0.20931-7.2494-1.5114-7.2494-1.5114 2.5819 2.7676 1.2698 4.7211-1.9771 6.0455 0 0 0.4811-2.6505-0.49427-3.0227-2.1035-0.80273-4.475 0.24321-6.7088 1.4717-1.6499 0.90739-4.1482 1.3305-5.8309 1.312-2.8032-0.0308-4.3568-0.0632-6.9785-0.97436-1.581-0.54946 [...]
+ <path id="path4312-3-38-5" d="m492.12-190.69c12.449-0.2103 22.272-11.103 30.73-14.417-17.608 5.7618-22.127 5.5427-24.357 7.6214-0.94342 0.87918-0.97782 2.0496-1.84 3.267-0.8571 1.2101-2.5388 2.4665-4.5325 3.529z" fill="#ffefa7"/>
+ <path id="path4314-33-7-4" d="m575.07-192.04c-17.912 1.167-19.031-13.258-36.915-14.993 15.167 8.1156 16.991 20.439 36.915 14.993z" fill="#fff1a1"/>
+ <path id="path4316-8-03-5" d="m583-193.17c1.795 5.9957 6.2828 9.5823 11.132 13.155-2.1213-6.0432-5.7817-9.9485-11.132-13.155z" fill="#fff1a1"/>
+ <g id="g4351-5-6-3" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8">
+ <path id="path4318-89-91-01" d="m582.91-173.1c1.206-0.45712 2.1883-0.0706 2.7078 1.0055 0.25823 0.53484 0.18919 1.2105-0.40993 1.9974-2.122-0.003-2.9098 0.28661-4.4602 1.9923 0.20521-3.6929 1.7668-4.0752 2.1623-4.9952z"/>
+ <path id="path4318-1-6-4-9" d="m589.89-168.72c0.89979-0.92394 1.9534-0.98877 2.879-0.23307 0.46006 0.37559 0.68302 1.0171 0.47261 1.9836-1.9245 0.89407-2.5161 1.4895-3.2003 3.6906-1.3747-3.4336-0.12095-4.44-0.15134-5.441z"/>
+ <path id="path4318-8-04-1-4" d="m598.52-169.35c0.62765-1.1266 1.6279-1.464 2.7186-0.97596 0.54211 0.24259 0.92468 0.80375 0.97364 1.7916-1.6247 1.3651-2.0405 2.0942-2.1269 4.3976-2.2227-2.9562-1.2749-4.2548-1.5653-5.2132z"/>
+ </g>
+ <path id="path4318-80-23-4-5" d="m440.98-188.39c1.1687 0.54532 1.5769 1.5188 1.1681 2.6417-0.20314 0.5581-0.73545 0.9799-1.7173 1.0995-1.478-1.5227-2.235-1.8852-4.5386-1.8064 2.7894-2.4288 4.1525-1.5764 5.0877-1.9348z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-1-4-37-6-9" d="m436.15-181.66c1.2891 0.0387 2.049 0.77138 2.1177 1.9644 0.0342 0.59291-0.28797 1.1908-1.1424 1.689-1.9597-0.81407-2.7984-0.84765-4.883 0.13576 1.6015-3.3339 3.1906-3.0901 3.9078-3.7891z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-8-6-0-1-3" d="m439.99-173.38c1.1489-0.58595 2.1675-0.30892 2.8014 0.70405 0.315 0.50349 0.32012 1.1826-0.18956 2.0302-2.1097 0.22855-2.8612 0.60238-4.2162 2.467-0.19892-3.6933 1.3116-4.2436 1.6044-5.2013z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4316-0-0-0-9" d="m473.17-186.89c-8.2126-0.54642-13.083 2.9419-19.789 6.7508 8.4272 0.20931 13.292-2.2404 19.789-6.7508z" fill="#ffefa7"/>
+ </g>
+ <g id="g4338-8-1-2-66" transform="matrix(.96160 .27445 -.27445 .96160 -204.64 -191)">
+ <path id="path14997-8-0-1-79-2-8-3-77-0-4-4" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864-0. [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-0-4-3-0-0" d="m644.79-216.04c-0.28315 0.81131-1.5511 5.1996-2.249 6.0725-1.0381 1.2984-2.1027 1.6494-2.1027 1.6494 1.1459 1.523 1.525 2.1719 4.1235 1.788-4.5382 5.7247-3.3209 12.444 2.6495 16.759 0.0948-0.74991 0.63997-2.5469 1.0516-3.2948-0.0753-0.0307 0.9917 3.1956 3.0952 4.3932 0.68254 0.38858 1.7964 3.317 2.8296 4.0431 0.94251 0.66246 2.1886 1.3199 2.1886 1.3199s0.08-2.5975 1.0879-3.2864c1.015-0.6938 2.9388-1.8908 3.5677-2.306 1.2656-0.83 [...]
+ <g id="g4307-4-0-431-8" transform="translate(0 -.75004)">
+ <path id="path5211-9-03-7-2" fill="#504416" d="m650.46-210.73c0.94 2.0538 1.1251 6.5986 0.64531 7.9898l5.4395 0.56423 4.9754-0.81907c-0.95614-1.8603-0.12607-6.2653 0.46147-7.8504l-3.5184 1.0866-2.0313-1.1285-2.7083 1.467-3.2636-1.3097z"/>
+ <g id="g4139-1-8-94-06" fill="#fff">
+ <path id="path5213-9-7-5-3-7-0" d="m652.03-201.5c0.0211-2.4912 0.50919-2.8128 0.88867-3.6914l0.54687 3.4179-1.4355 0.27343z"/>
+ <path id="path5213-9-7-9-5-60-01-7" d="m660.45-201.5c-0.0211-2.4912-0.50919-2.8128-0.88867-3.6914l-0.54687 3.4179 1.4355 0.27343z"/>
+ </g>
+ <path id="path5160-2-5-4-1-2" d="m651.36-202.73c-0.81165 7.0872 10.243 7.3994 9.7355 0-2.7762 0.58616-5.7673 0.90381-9.7355 0z" fill="#e4c900"/>
+ <path id="path5160-2-3-8-0-5-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m650.93-203.3-0.0625 0.5625c-0.21756 1.8997 0.38656 3.4223 1.4062 4.4375 1.0197 1.0152 2.4282 1.51 3.8438 1.5312 1.4155 0.0213 2.8459-0.43482 3.9062-1.4375s1.6979-2.558 1.5625-4.5312l-0.0312-0.5625-0.5625 0.125c-2.741 0.57871-5.6408 0.8861-9.5312 0l-0.53125-0.125h-0.00005zm0.96875 1.1562c3.3974 0.66907 6.1564 0.50399 8.625 0.0312-0.0319 1.4052-0.44577 2.4861-1.1875 3. [...]
+ <path id="path5010-2-2-9-22-8" d="m653.95-209.47c-0.0725 4.5313 0.1742 9.5588 2.2688 13.657 2.0946-4.0979 2.3412-9.082 2.2688-13.613-0.0432-0.17139-0.98524-0.30903-1.1301-0.41285-0.35601-0.25521-1.0222-0.90865-1.0222-0.90865s-0.69131 0.7735-1.1358 1.0222c-0.37899 0.21208-1.2494 0.25591-1.2494 0.25591z" stroke="#2c5aa0" fill="#377bc8"/>
+ <g id="g5237-9-2-2-1" transform="translate(-14.216 -5.3362)" fill="#fff">
+ <path id="path5213-8-49-4-1" d="m665.98-204.45c0.0211 2.4912 0.50919 2.8128 0.88867 3.6914l0.54687-3.4179-1.4355-0.27343z"/>
+ <path id="path5213-9-2-2-9-61" d="m674.88-204.45c-0.0211 2.4912-0.50919 2.8128-0.88867 3.6914l-0.54687-3.4179 1.4355-0.27343z"/>
+ </g>
+ <g id="g5011-07-9-77-1" transform="translate(-14.133 -5.3362)">
+ <path id="path4962-4-1-2-8" d="m668.94-212.14s0.8411 0.79935 1.375 0.825c0.53241 0.0256 1.4437-0.6875 1.4437-0.6875l-1.5125-4.0562-1.3062 3.9187z" fill="#ffefa7"/>
+ <g id="g4892-8-0-09-1" transform="translate(-.11475)">
+ <g id="g4855-5-9-0-1" transform="translate(0 .064716)">
+ <path id="path4045-83-3-7-500" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-06-00-1-8" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-2-3-6-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0.38334 0.62 [...]
+ </g>
+ <g id="g4855-3-2-01-0-7" transform="matrix(-1 0 0 1 1340.9 .064716)">
+ <path id="path4045-9-52-9-9-0" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-0-2-86-2-1" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-5-7-9-9-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0.38334 0. [...]
+ </g>
+ </g>
+ <path id="path4902-1-0-6-43" d="m661.12-211.22 0.2189 1.9505 0.63079 0.57371c-1.4494-0.21083 1.916 0.48806 2.6167 0.63557l0.11062 2.2124 1.4934 1.8252 2.3783 0.22124 1.8805-1.2168 1.604 1.2721 2.1571-0.11062 2.2124-1.9911v-2.323l2.0193-0.1559 1.1334-1.0056v-1.7699c-0.97175 1.2236-1.9336 2.4242-4.7013 2.1018 0.30303 1.3307 0.21514 2.2357-0.10593 2.8294-0.38328 0.70879-1.0988 0.97406-1.8783 0.99065-0.97223 0.0207-2.0383-0.78084-2.5511-1.2205-0.74162 0.79142-1.3904 1.4166-1.9952 [...]
+ <path id="path4402-2-5-1-0-77" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m661.06-211.69c-0.48492 1.2877-0.28378 2.4598 0.42441 3.2089 0.59079 0.6249 1.4921 0.86991 2.474 0.91092-0.0108 0.15882-0.018 0.18577-0.0207 0.41406-0.006 0.49673 0.005 1.0718 0.20702 1.5734 0.41453 1.0274 1.2478 1.7102 2.1945 2.1427 0.82617 0.37748 1.7898 0.3611 2.6086 0.0828 0.50449-0.17148 0.90215-0.49664 1.2111-0.78671 0.11015-0.10341 0.11986-0.12422 0.20703-0.217 [...]
+ <g id="g4958-2-64-2-5" transform="translate(-.0084986)" fill="#ffefa7">
+ <path id="path4904-1-4-8-1" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-265.65 -796.35)"/>
+ <path id="path4904-2-1-8-44-2" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-260.64 -796.35)"/>
+ </g>
+ <path id="path4928-0-6-8-6" d="m667.32-209.87s1.8744-0.9079 2.8875-0.9625c1.0772-0.0581 3.1625 0.6875 3.1625 0.6875v1.0312l-2.6125 1.5125-2.4062-1.2375-0.61875-0.1375-0.4125-0.89374z" fill="#e4c900"/>
+ <path id="path4930-1-14-01-6" d="m663.05-216.43c-0.68077 0.0986-1.4372 0.43559-1.7812 1.0312-0.20631 0.3572 0 1.25 0 1.25l1.0312-0.28125h1.25l2.8125 0.40625 2.6875-0.9375s-1.6672-0.18486-2.5155-0.38981c-1.1454-0.27675-2.3184-1.2479-3.4845-1.0789zm14.156 0c-1.0124 0.0279-1.9507 0.83678-2.953 1.0789-0.84823 0.20495-2.5783 0.38981-2.5783 0.38981l2.6875 0.9375 2.8125-0.40625h1.2188l1.0312 0.28125s0.20631-0.8928 0-1.25c-0.34403-0.59566-1.1005-0.93263-1.7812-1.0312-0.14577-0.0211-0. [...]
+ <path id="path3477-9-0-5-8-0-5-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m669.17-215.78-0.50722 0.23808s-1.7236 0.79174-3.2814 0.78671c-0.63267-0.002-1.5924-0.38405-2.4947-0.46582-0.45115-0.0409-0.94895 0.004-1.3353 0.35195-0.38639 0.34805-0.55842 0.90541-0.55898 1.6252 0.52653-0.24596 0.82663-0.54771 1.2215-0.87987 0.0934-0.0842 0.25887-0.13259 0.57969-0.10351 0.64162 0.0581 1.6283 0.47305 2.5878 0.47616 1.3739 0.004 2.4581-0.38749 3.0 [...]
+ </g>
+ </g>
+ <path id="path14997-8-0-1-79-2-8-3-7-7-76-8-1-41" d="m665.95-223.26s-0.49091-1.4887-1.2937-2.7471c-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864-0.70266-1.2864-0.70266 0.20494 0.78744-0.2941 1.7027-0.49785 2.3509 0 0-1.1545-2.9101-2.2123-3.7701-0.81594-0.66339-2.7302-1.3104-2.7174-1.3103 0.0129 0.00039-1.7876 0.62325-2.612 1.2761-1.0688 0.84639-2.2606 3.7414-2.2606 3.7414-0.19541-0.65083-0.6826-1.5724-0.46754-2.3572 0 0-0.59719 0.15772-1.2953 0.68607-0.67922 [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-00-1-1-7" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864- [...]
+ <g id="g5134-9-0-15-1" transform="translate(-14.275 -5.3362)" fill="#806600">
+ <path id="path5110-5-3-17-3" d="m657.2-218.43s1.8048 0.59598 2.1668 1.4196c0.49367 1.123 0.37359 4.5578 0.37359 4.5578s-2.2734-1.6935-2.6898-2.6151c-0.52396-1.1595 0.14943-3.3623 0.14943-3.3623z"/>
+ <path id="path5110-9-6-11-08-4" d="m683.59-218.43s-1.8048 0.59598-2.1668 1.4196c-0.49367 1.123-0.37359 4.5578-0.37359 4.5578s2.2734-1.6935 2.6898-2.6151c0.52396-1.1595-0.14943-3.3623-0.14943-3.3623z"/>
+ </g>
+ <path id="path5269-2-50-53-8" d="m650.51-207.52c-3.467 0.6834-6.1184 6.1246-4.6204 11.221 1.4267-3.9078 5.3052-9.0696 4.6204-11.221z" fill="#fff1a1"/>
+ <path id="path5269-9-85-8-7-6" d="m662.74-206.29c2.4916 0.19567 4.4704 4.4054 3.6724 9.8517-0.58652-3.9078-3.5124-7.7004-3.6724-9.8517z" fill="#fff1a1"/>
+ <path id="path5293-9-4-9-1" d="m650.99-199.18s-0.36334 2.0037-0.00035 3.4397c0.2429 0.9609 0.55598 1.9515 1.1586 2.7384 0.62338 0.8141 3.4062 1.8958 3.4062 1.8958l-0.003 2.3214s2.1544-1.7637 2.4258-2.7394c0.20719-0.74489 0.63526-3.6925 0.63526-3.6925l-2.0045 2.7412s-3.187-1.3138-3.9329-2.3171c-1.1474-1.5434-1.6848-4.3876-1.6848-4.3876z" fill="#fff1a1"/>
+ <path id="path5295-43-9-6-5" d="m647.59-222.28s-0.13419-0.75608 1.549-1.5407c1.7741-0.82701 5.4036-1.6857 6.7715-1.7243 1.6398-0.0462 5.2361 0.84692 7.1211 1.7688 1.5851 0.77521 1.6207 1.6016 1.6207 1.6016-2.9139-0.49181-5.8279-0.17447-8.7418 0.73726-2.4153-1.1166-5.0664-1.6831-8.3205-0.84258z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g5924-3-3-3-0" transform="translate(-2.6111 127.58)">
+ <g id="g5915-7-0-1-6">
+ <g id="g5810-48-5-5-5">
+ <path id="path13429-8-0-0-2-8-3" d="m469.89-189.44s-3.2133-0.0251-4.5-0.77844c-1.3993-0.81931-2.8976-3.7155-2.8976-3.7155s-3.5428 0.5752-5.1716 0.2223c-1.7019-0.36873-4.1377-2.3153-4.1377-2.3153 1.627-0.24015 2.8421-0.48567 4.4175-1.7601 0 0-3.1362-0.16604-4.9224-0.8537-1.5552-0.5987-4.0928-2.5827-4.0928-2.5827 1.4501-0.35994 3.0179-0.31529 4.1601-1.7326 0 0-3.0716 0.0277-4.4633-0.48078-1.3892-0.50759-3.5951-2.4616-3.5951-2.4616 1.688-0.14653 3.2936-0.45961 4.379-1.8238 0 0-3.1 [...]
+ <path id="path5784-4-3-0-1" d="m728.67 600.09s2.1432 3.009 3.3436 3.5824c1.1493 0.5491 3.3436 0 3.3436 0l-0.71649-1.5524h-0.95532c-2.4926-2.9952-4.6214-6.5155-3.9407-10.509 0 0-2.8306-3.1395-4.5378-4.6572-2.2446-1.9955-8.2396-6.4484-8.2396-6.4484s-1.3723-3.3274-1.5524-5.6125c-0.0797-1.0117 0.13035-2.0842 0.59708-2.9854 0.47913-0.92508 1.885-1.2612 2.1495-2.2689 0.0833-0.31749-0.0277-0.70401-0.23883-0.95532-0.25219-0.30015-0.68338-0.5007-1.0747-0.47766-1.4788 0.087-3.8213 2.2689 [...]
+ <path id="path4316-0-8-0-8-9-01" d="m463.96-201.37c-3.5701-7.4161-9.7625-11.437-16.381-15.396 3.9692 7.4369 9.2548 11.964 16.381 15.396z" fill="#ffefa7"/>
+ </g>
+ <path id="path4318-6-3-4-57-7-2-9" d="m453.42-228.71c0.26597 1.262-0.26713 2.173-1.4104 2.5208-0.56821 0.17286-1.2252 0.00058-1.9105-0.71256 0.32966-2.0963 0.16478-2.9193-1.2819-4.7137 3.6173 0.77133 3.7546 2.3731 4.6028 2.9055z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-0-0-8-4-5" d="m443.34-229.69c0.76473 1.0385 0.65682 2.0886-0.23976 2.8785-0.4456 0.39266-1.1149 0.50793-2.0341 0.14266-0.56811-2.0446-1.059-2.7254-3.119-3.7595 3.6119-0.79601 4.4003 0.60505 5.3928 0.73838z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-0-0-3-7" d="m437.61-222.55c1.1281 0.62511 1.4678 1.6245 0.98223 2.7163-0.24131 0.54269-0.80162 0.92653-1.7894 0.97776-1.3688-1.6215-2.0989-2.0357-4.4024-2.1168 2.9511-2.2295 4.2518-1.2847 5.2096-1.5773z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <g id="g5750-5-4-3-6">
+ <path id="path13429-0-9-6-5-9-85" d="m513.51-183.58c-1.3343-0.38955-2.963-2.1437-4.3783-2.1357-1.4905 0.009-2.5414 0.84042-3.2912 1.9584-0.35783 0.53347 0.20388 2.5294 0.76142 2.9126l2.5674 1.7649s-1.6071 1.8464-1.7289 2.8858c-0.1058 0.90301 0.34775 1.628 0.99501 2.341 0.84401 0.92951 1.0511 1.2888 2.3959 1.4847 0.80306 0.11697 2.7034-0.23377 2.7034-0.23377s-0.0444 1.4813 0.4251 2.165c0.85068 1.239 2.2951 2.3313 3.9452 2.157 1.2886-0.13595 1.7067-0.33111 2.3878-1.2902 0.54003-0. [...]
+ <path id="path5660-7-7-05-4" d="m783.74 615s3.5466-1.8658 5.43-2.7966c2.9696-1.4676 8.1605-1.8548 9.4654-4.8993 0 0 0.36901-0.67607 0.24826-1.6137-0.18076-1.4037-2.628-2.5641-1.8619-4.0962l0.62064-1.2413s2.6031 1.1202 3.3514 1.986c0.60801 0.70347 0.69545 1.8747 1.4895 2.3584 0.8158 0.49693 2.8549 0.24826 2.8549 0.24826l1.2413 3.5997s1.89-0.0156 2.6067 0.8689c0.21 0.25918 0.24967 0.68396 0.12413 0.99302-0.19942 0.49091-1.3474 0.61558-1.8474 0.79097-0.97609 0.34239-2.4826-0.76199- [...]
+ <path id="path4316-5-8-1-5-7" d="m535.02-185.57c-6.2504-0.32088-11.135 2.7033-16.128 6.072 6.4046 0.0294 11.312-2.1084 16.128-6.072z" fill="#ffefa7"/>
+ <path id="path4318-6-0-0-44-9" d="m506.63-185.27c1.1706 0.54134 1.5821 1.5134 1.1772 2.6377-0.20123 0.55879-0.7321 0.98239-1.7135 1.1053-1.4832-1.5177-2.2414-1.8776-4.5448-1.7909 2.7811-2.4383 4.1471-1.5906 5.081-1.9521z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-6-6-3-6" d="m507.77-176.49c1.2891-0.0398 2.0922 0.64527 2.2333 1.8318 0.0702 0.58976-0.21497 1.2062-1.0376 1.7554-2.0056-0.69331-2.8448-0.6758-4.8657 0.43264 1.3956-3.4252 2.9966-3.2785 3.67-4.0198z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-30-57-0-8-6" d="m514.68-170.36c1.0805-0.70409 2.1227-0.53622 2.86 0.40409 0.36649 0.46736 0.44329 1.1422 0.026 2.0389-2.0737 0.45018-2.7815 0.90132-3.9319 2.8987-0.58806-3.6516 0.85587-4.3584 1.0458-5.3417z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <path id="path5636-3-3-2-6" d="m808.69 595.02s-0.24352 4.5664-2.1508 5.7354c-0.82133 0.50342-1.9716 0.71207-2.8677 0.35846-0.86808-0.34255-1.4746-1.2733-1.7923-2.1508-0.20338-0.56175-0.53769-1.9715-0.53769-1.9715s-2.9158-1.3339-4.4808-1.4338c-2.3038-0.1471-6.8108 1.2546-6.8108 1.2546 0.76944-2.3922 2.8398-4.3507 5.0185-6.2731l7.5277-0.53769 6.0938 5.0185z" transform="translate(-265.27 -795.88)" stroke="#806600" stroke-width="1px" fill="#efd300"/>
+ <g id="g5837-4-3-2-67">
+ <path id="path13429-5-30-5-6-0" d="m563.76-231.22c2.1572-0.23696 6.5861-1.1163 8.0732-2.5693 0.69312-0.67726 2.6361-2.5693 2.6361-2.5693-0.41182 4.2716-2.6018 7.0405-7.2494 8.9171-3.7084 1.4974-7.9892 1.8438-12.027 1.5114-2.5428-0.20932-7.2494-1.5114-7.2494-1.5114 2.5819 2.7676 1.2698 4.7211-1.9771 6.0455 0 0 0.4811-2.6505-0.49427-3.0228-2.1035-0.80273-4.475 0.24322-6.7088 1.4717-1.6499 0.90739-4.1482 1.3305-5.8309 1.312-2.8032-0.0308-4.3568-0.0632-6.9785-0.97435-1.581-0.54947-4 [...]
+ <path id="path13429-5-2-4-4-0-4-4" d="m602.58-173.56c0.37815 1.0728 1.2322 3.4261 0.5537 4.3662-0.86862 1.204-2.6627 1.4499-4.214 1.208-0.85597-0.13346-2.0588-1.1243-2.0588-1.1243s-0.87586 1.484-1.4662 1.939c-0.98853 0.76189-1.4141 0.93925-2.7043 0.89386-0.98952-0.0349-1.8701-0.47932-2.5549-1.1355-0.78831-0.75526-1.3345-3.0162-1.3345-3.0162l-3.0423 0.55168c-0.66066 0.11981-2.663-0.80445-2.8862-1.3873-0.46783-1.2215-0.51317-2.4561 0.39506-3.4471 0.86236-0.9409 3.2472-0.98993 4.46 [...]
+ <path id="path5808-8-2-0-1" d="m737.88 606.58s1.4082 2.6514 3.2165 3.7289c0.81128 0.48338 2.5551 1.2354 2.5551 1.2354l0.35668-2.7756s1.619-0.61945 2.6264-1.1673c1.0075-0.54785 3.356-2.1887 3.356-2.1887l0.43774 2.4805s5.4081-2.6518 7.5874-4.6692c1.4564-1.3482 2.8681-2.9344 3.5019-4.8151 0.73017-2.1668 0.14591-6.8579 0.14591-6.8579l-14.764 0.51863-3.3579 12.792-5.662 1.7182h-0.00004z" transform="translate(-265.27 -795.88)" fill="#e4c900"/>
+ <path id="path13429-5-2-7-75-3-0-0" d="m600.9-179.22s1.1259-0.033 1.6229 0.1712c0.79473 0.32651 2.0882 1.2157 2.0882 1.2157s-0.19141-2.1781-0.96212-3.1521c-0.9648-1.2192-3.1613-2.2695-3.1613-2.2695s0.93205-0.56214 1.46-0.70152c0.81159-0.21426 2.5259-0.18106 2.5259-0.18106s-1.1026-1.3756-2.0617-2.1434c-1.0834-0.86729-4.2608-0.63041-4.2608-0.63041s0.97703-0.94937 1.5725-1.2942c0.77897-0.45107 2.4134-0.34488 2.4134-0.34488s-1.122-1.3971-2.3366-1.8912c-1.1339-0.46135-3.8485-0.50435- [...]
+ <path id="path4414-9-2-08-8" d="m557.48-204.79 10.97 0.56546 9.1605 0.11309h5.7677c6.6327-1.3371 14.359-2.7989 17.529-9.4998l0.1131-4.9761c-0.28789 2.9589-1.5285 5.2798-3.4758 7.0343-9.2315 8.3176-29.839 5.5392-39.726 2.6917l-6.8987-0.90475 6.5594 4.9761z" fill="#e4c900"/>
+ <path id="path5188-5-7-17-1" d="m571.18-221.21c-7.2623 0.59556-25.522 5.6139-39.555 6.7817-7.4968 0.62388-15.682 0.21212-20.405-2.5725-2.0815-1.227-3.4909-2.9149-3.8732-5.1778l-0.69517 2.6416 2.2245 3.4758 5.0052 2.3636 9.4543 1.8074 10.289-0.8342 5.8394-0.55614 30.726-5.8394 0.9903-2.0902z" fill="#e4c900"/>
+ <path id="path5190-3-1-6-48" d="m571.16-221.39c0.16289 2.8742 0.80056 4.0867 1.4527 5.2485 0.83126-1.812 1.5143-3.9988 4.1238-5.8108 0.77354 1.9994 1.3557 4.3737 2.6242 6.3732 0.62029-2.2648 0.74038-5.0218 2.9991-6.9355 0.81886 1.8884 1.5539 4.196 2.4836 5.5296-0.0201-1.4371-0.17314-3.1553 1.6402-4.5924 7.0913-3.79 16.558 3.2005 9.7003 8.0133l0.0937 0.0469 0.6092-2.1088-0.65606-2.6242-2.1556-1.687-2.7648-0.89037-3.5615 0.70292-1.5464 1.5933 0.46862 1.9682 2.3431 2.2025-3.7958-0. [...]
+ <path id="path5192-2-0-7-84" d="m520.82-225.43 6.3005 3.0518 6.3005 0.78756 3.9378-0.68912 4.3316-2.1658 3.4456-0.19689 0.98445 1.2798 0.0985 2.2642 2.2642-1.8705 0.59067-1.5751-0.68912-2.7565 4.627 1.1814 5.9067 0.39378 6.1036-0.98445 5.4145-2.1658 2.658-2.7565 1.3782-4.7254s-2.9123 4.0932-5.0207 5.3161c-2.6576 1.5414-5.9079 2.393-8.9586 2.7565-2.9652 0.35335-5.9904-0.2633-8.9586-0.59067-3.4423-0.37966-8.5648-2.2642-8.5648-2.2642 1.0391 1.5095 2.091 3.019 2.3627 4.5285 0 0-3.24 [...]
+ <path id="path5194-7-0-1-5" d="m515.53-228.62s3.2333 0.48514 4.8553 0.40461c4.8284-0.2397 9.4701-1.9947 14.263-2.63 2.8841-0.38229 5.7912-0.79816 8.6992-0.70807 3.7795 0.11709 7.4493 1.4758 11.228 1.6184 1.9925 0.0752 4.1703 0.45794 5.968-0.40461 1.0327-0.49549 2.0624-1.4143 2.3265-2.5288 0.28307-1.1942-1.0115-3.5404-1.0115-3.5404l0.10115 0.10115-0.50576 1.8208-2.3265 1.9219-2.7311 0.70807-4.5519-0.40461-6.8784-0.80923h-7.6876l-8.598 1.0115-8.3957 1.7196-4.7542 1.7196z" fill="#f [...]
+ <path id="path5196-39-9-4-7" d="m564.29-222.7c13.687 2.0155 30.165-6.5438 36.335 5.128l-0.14651-0.14652 0.43954-1.9047-3.0768-3.3698-4.1024-2.1977-7.6187-0.87908-9.9629 1.0256-11.868 2.3442z" fill="#fff1a1"/>
+ <path id="path5465-77-7-81-98" d="m444.79-187.75s0.52172 3.7286 1.8071 4.905c1.5784 1.4446 6.1958 1.678 6.1958 1.678s6.7077-3.9263 10.326-5.2922c2.9484-1.113 6.0969-1.6013 9.1646-2.3234 0.98578-0.23204 2.9688-0.6454 2.9688-0.6454s0.52861-3.357 0.38723-5.0341c-0.13412-1.591-1.1617-4.6468-1.1617-4.6468l-0.77447 8.132-8.132 1.678-7.2284 2.7107-5.6795 3.356-5.6795-1.2908-2.1943-3.227z" fill="#e4c900"/>
+ <path id="path13429-5-2-95-1-8-4" d="m563.76-231.22c2.1572-0.23696 6.5861-1.1163 8.0732-2.5694 0.69312-0.67726 2.6361-2.5693 2.6361-2.5693-0.41182 4.2716-2.6018 7.0405-7.2494 8.9171-3.7084 1.4974-7.9892 1.8438-12.027 1.5114-2.5428-0.20931-7.2494-1.5114-7.2494-1.5114 2.5819 2.7676 1.2698 4.7211-1.9771 6.0455 0 0 0.4811-2.6505-0.49427-3.0227-2.1035-0.80273-4.475 0.24321-6.7088 1.4717-1.6499 0.90739-4.1482 1.3305-5.8309 1.312-2.8032-0.0308-4.3568-0.0632-6.9785-0.97436-1.581-0.54946 [...]
+ <path id="path4312-3-7-5-5" d="m492.12-190.69c12.449-0.2103 22.272-11.103 30.73-14.417-17.608 5.7618-22.127 5.5427-24.357 7.6214-0.94342 0.87918-0.97782 2.0496-1.84 3.267-0.8571 1.2101-2.5388 2.4665-4.5325 3.529z" fill="#ffefa7"/>
+ <path id="path4314-33-4-3-8" d="m575.07-192.04c-17.912 1.167-19.031-13.258-36.915-14.993 15.167 8.1156 16.991 20.439 36.915 14.993z" fill="#fff1a1"/>
+ <path id="path4316-8-5-1-8" d="m583-193.17c1.795 5.9957 6.2828 9.5823 11.132 13.155-2.1213-6.0432-5.7817-9.9485-11.132-13.155z" fill="#fff1a1"/>
+ <g id="g4351-5-1-9-9" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8">
+ <path id="path4318-89-7-3-4" d="m582.91-173.1c1.206-0.45712 2.1883-0.0706 2.7078 1.0055 0.25823 0.53484 0.18919 1.2105-0.40993 1.9974-2.122-0.003-2.9098 0.28661-4.4602 1.9923 0.20521-3.6929 1.7668-4.0752 2.1623-4.9952z"/>
+ <path id="path4318-1-6-8-91-70" d="m589.89-168.72c0.89979-0.92394 1.9534-0.98877 2.879-0.23307 0.46006 0.37559 0.68302 1.0171 0.47261 1.9836-1.9245 0.89407-2.5161 1.4895-3.2003 3.6906-1.3747-3.4336-0.12095-4.44-0.15134-5.441z"/>
+ <path id="path4318-8-04-2-04-4" d="m598.52-169.35c0.62765-1.1266 1.6279-1.464 2.7186-0.97596 0.54211 0.24259 0.92468 0.80375 0.97364 1.7916-1.6247 1.3651-2.0405 2.0942-2.1269 4.3976-2.2227-2.9562-1.2749-4.2548-1.5653-5.2132z"/>
+ </g>
+ <path id="path4318-80-23-5-9-06" d="m440.98-188.39c1.1687 0.54532 1.5769 1.5188 1.1681 2.6417-0.20314 0.5581-0.73545 0.9799-1.7173 1.0995-1.478-1.5227-2.235-1.8852-4.5386-1.8064 2.7894-2.4288 4.1525-1.5764 5.0877-1.9348z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-1-4-37-4-0-53" d="m436.15-181.66c1.2891 0.0387 2.049 0.77138 2.1177 1.9644 0.0342 0.59291-0.28797 1.1908-1.1424 1.689-1.9597-0.81407-2.7984-0.84765-4.883 0.13576 1.6015-3.3339 3.1906-3.0901 3.9078-3.7891z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-8-6-0-5-0-8" d="m439.99-173.38c1.1489-0.58595 2.1675-0.30892 2.8014 0.70405 0.315 0.50349 0.32012 1.1826-0.18956 2.0302-2.1097 0.22855-2.8612 0.60238-4.2162 2.467-0.19892-3.6933 1.3116-4.2436 1.6044-5.2013z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4316-0-0-3-03-5" d="m473.17-186.89c-8.2126-0.54642-13.083 2.9419-19.789 6.7508 8.4272 0.20931 13.292-2.2404 19.789-6.7508z" fill="#ffefa7"/>
+ </g>
+ <g id="g4338-8-1-0-2-1" transform="matrix(.96160 .27445 -.27445 .96160 -204.64 -191)">
+ <path id="path14997-8-0-1-79-2-8-3-77-0-1-8-2" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864- [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-0-4-3-9-2-4" d="m644.79-216.04c-0.28315 0.81131-1.5511 5.1996-2.249 6.0725-1.0381 1.2984-2.1027 1.6494-2.1027 1.6494 1.1459 1.523 1.525 2.1719 4.1235 1.788-4.5382 5.7247-3.3209 12.444 2.6495 16.759 0.0948-0.74991 0.63997-2.5469 1.0516-3.2948-0.0753-0.0307 0.9917 3.1956 3.0952 4.3932 0.68254 0.38858 1.7964 3.317 2.8296 4.0431 0.94251 0.66246 2.1886 1.3199 2.1886 1.3199s0.08-2.5975 1.0879-3.2864c1.015-0.6938 2.9388-1.8908 3.5677-2.306 1.2656-0. [...]
+ <g id="g4307-4-0-4-4-6" transform="translate(0 -.75004)">
+ <path id="path5211-9-03-5-8-7" fill="#504416" d="m650.46-210.73c0.94 2.0538 1.1251 6.5986 0.64531 7.9898l5.4395 0.56423 4.9754-0.81907c-0.95614-1.8603-0.12607-6.2653 0.46147-7.8504l-3.5184 1.0866-2.0313-1.1285-2.7083 1.467-3.2636-1.3097z"/>
+ <g id="g4139-1-8-9-3-5" fill="#fff">
+ <path id="path5213-9-7-5-3-3-5-5" d="m652.03-201.5c0.0211-2.4912 0.50919-2.8128 0.88867-3.6914l0.54687 3.4179-1.4355 0.27343z"/>
+ <path id="path5213-9-7-9-5-60-9-0-0" d="m660.45-201.5c-0.0211-2.4912-0.50919-2.8128-0.88867-3.6914l-0.54687 3.4179 1.4355 0.27343z"/>
+ </g>
+ <path id="path5160-2-5-4-6-0-5" d="m651.36-202.73c-0.81165 7.0872 10.243 7.3994 9.7355 0-2.7762 0.58616-5.7673 0.90381-9.7355 0z" fill="#e4c900"/>
+ <path id="path5160-2-3-8-0-6-6-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m650.93-203.3-0.0625 0.5625c-0.21756 1.8997 0.38656 3.4223 1.4062 4.4375 1.0197 1.0152 2.4282 1.51 3.8438 1.5312 1.4155 0.0213 2.8459-0.43482 3.9062-1.4375s1.6979-2.558 1.5625-4.5312l-0.0312-0.5625-0.5625 0.125c-2.741 0.57871-5.6408 0.8861-9.5312 0l-0.53125-0.125h-0.00005zm0.96875 1.1562c3.3974 0.66907 6.1564 0.50399 8.625 0.0312-0.0319 1.4052-0.44577 2.4861-1.1875 [...]
+ <path id="path5010-2-2-9-4-7-0" d="m653.95-209.47c-0.0725 4.5313 0.1742 9.5588 2.2688 13.657 2.0946-4.0979 2.3412-9.082 2.2688-13.613-0.0432-0.17139-0.98524-0.30903-1.1301-0.41285-0.35601-0.25521-1.0222-0.90865-1.0222-0.90865s-0.69131 0.7735-1.1358 1.0222c-0.37899 0.21208-1.2494 0.25591-1.2494 0.25591z" stroke="#2c5aa0" fill="#377bc8"/>
+ <g id="g5237-9-2-0-07-77" transform="translate(-14.216 -5.3362)" fill="#fff">
+ <path id="path5213-8-49-8-3-9" d="m665.98-204.45c0.0211 2.4912 0.50919 2.8128 0.88867 3.6914l0.54687-3.4179-1.4355-0.27343z"/>
+ <path id="path5213-9-2-2-2-3-7" d="m674.88-204.45c-0.0211 2.4912-0.50919 2.8128-0.88867 3.6914l-0.54687-3.4179 1.4355-0.27343z"/>
+ </g>
+ <g id="g5011-07-9-0-2-5" transform="translate(-14.133 -5.3362)">
+ <path id="path4962-4-1-6-14-3" d="m668.94-212.14s0.8411 0.79935 1.375 0.825c0.53241 0.0256 1.4437-0.6875 1.4437-0.6875l-1.5125-4.0562-1.3062 3.9187z" fill="#ffefa7"/>
+ <g id="g4892-8-0-0-0-9" transform="translate(-.11475)">
+ <g id="g4855-5-9-7-08-9" transform="translate(0 .064716)">
+ <path id="path4045-83-3-2-73-4" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-06-00-9-8-9" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-2-3-8-4-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0.38334 0. [...]
+ </g>
+ <g id="g4855-3-2-01-1-52-5" transform="matrix(-1 0 0 1 1340.9 .064716)">
+ <path id="path4045-9-52-9-1-9-9" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-0-2-86-6-0-8" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-5-7-9-1-98-30" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0.3833 [...]
+ </g>
+ </g>
+ <path id="path4902-1-0-1-0-90" d="m661.12-211.22 0.2189 1.9505 0.63079 0.57371c-1.4494-0.21083 1.916 0.48806 2.6167 0.63557l0.11062 2.2124 1.4934 1.8252 2.3783 0.22124 1.8805-1.2168 1.604 1.2721 2.1571-0.11062 2.2124-1.9911v-2.323l2.0193-0.1559 1.1334-1.0056v-1.7699c-0.97175 1.2236-1.9336 2.4242-4.7013 2.1018 0.30303 1.3307 0.21514 2.2357-0.10593 2.8294-0.38328 0.70879-1.0988 0.97406-1.8783 0.99065-0.97223 0.0207-2.0383-0.78084-2.5511-1.2205-0.74162 0.79142-1.3904 1.4166-1.995 [...]
+ <path id="path4402-2-5-1-8-53-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m661.06-211.69c-0.48492 1.2877-0.28378 2.4598 0.42441 3.2089 0.59079 0.6249 1.4921 0.86991 2.474 0.91092-0.0108 0.15882-0.018 0.18577-0.0207 0.41406-0.006 0.49673 0.005 1.0718 0.20702 1.5734 0.41453 1.0274 1.2478 1.7102 2.1945 2.1427 0.82617 0.37748 1.7898 0.3611 2.6086 0.0828 0.50449-0.17148 0.90215-0.49664 1.2111-0.78671 0.11015-0.10341 0.11986-0.12422 0.20703-0.2 [...]
+ <g id="g4958-2-64-1-5-6" transform="translate(-.0084986)" fill="#ffefa7">
+ <path id="path4904-1-4-1-54-8" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-265.65 -796.35)"/>
+ <path id="path4904-2-1-8-5-5-3" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-260.64 -796.35)"/>
+ </g>
+ <path id="path4928-0-6-0-1-8" d="m667.32-209.87s1.8744-0.9079 2.8875-0.9625c1.0772-0.0581 3.1625 0.6875 3.1625 0.6875v1.0312l-2.6125 1.5125-2.4062-1.2375-0.61875-0.1375-0.4125-0.89374z" fill="#e4c900"/>
+ <path id="path4930-1-14-0-1-6" d="m663.05-216.43c-0.68077 0.0986-1.4372 0.43559-1.7812 1.0312-0.20631 0.3572 0 1.25 0 1.25l1.0312-0.28125h1.25l2.8125 0.40625 2.6875-0.9375s-1.6672-0.18486-2.5155-0.38981c-1.1454-0.27675-2.3184-1.2479-3.4845-1.0789zm14.156 0c-1.0124 0.0279-1.9507 0.83678-2.953 1.0789-0.84823 0.20495-2.5783 0.38981-2.5783 0.38981l2.6875 0.9375 2.8125-0.40625h1.2188l1.0312 0.28125s0.20631-0.8928 0-1.25c-0.34403-0.59566-1.1005-0.93263-1.7812-1.0312-0.14577-0.0211-0 [...]
+ <path id="path3477-9-0-5-8-0-8-6-19" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m669.17-215.78-0.50722 0.23808s-1.7236 0.79174-3.2814 0.78671c-0.63267-0.002-1.5924-0.38405-2.4947-0.46582-0.45115-0.0409-0.94895 0.004-1.3353 0.35195-0.38639 0.34805-0.55842 0.90541-0.55898 1.6252 0.52653-0.24596 0.82663-0.54771 1.2215-0.87987 0.0934-0.0842 0.25887-0.13259 0.57969-0.10351 0.64162 0.0581 1.6283 0.47305 2.5878 0.47616 1.3739 0.004 2.4581-0.38749 [...]
+ </g>
+ </g>
+ <path id="path14997-8-0-1-79-2-8-3-7-7-76-8-3-1-6" d="m665.95-223.26s-0.49091-1.4887-1.2937-2.7471c-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864-0.70266-1.2864-0.70266 0.20494 0.78744-0.2941 1.7027-0.49785 2.3509 0 0-1.1545-2.9101-2.2123-3.7701-0.81594-0.66339-2.7302-1.3104-2.7174-1.3103 0.0129 0.00039-1.7876 0.62325-2.612 1.2761-1.0688 0.84639-2.2606 3.7414-2.2606 3.7414-0.19541-0.65083-0.6826-1.5724-0.46754-2.3572 0 0-0.59719 0.15772-1.2953 0.68607-0.6792 [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-00-1-7-9-78" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.28 [...]
+ <g id="g5134-9-0-0-34-9" transform="translate(-14.275 -5.3362)" fill="#806600">
+ <path id="path5110-5-3-1-7-7" d="m657.2-218.43s1.8048 0.59598 2.1668 1.4196c0.49367 1.123 0.37359 4.5578 0.37359 4.5578s-2.2734-1.6935-2.6898-2.6151c-0.52396-1.1595 0.14943-3.3623 0.14943-3.3623z"/>
+ <path id="path5110-9-6-11-3-9-5" d="m683.59-218.43s-1.8048 0.59598-2.1668 1.4196c-0.49367 1.123-0.37359 4.5578-0.37359 4.5578s2.2734-1.6935 2.6898-2.6151c0.52396-1.1595-0.14943-3.3623-0.14943-3.3623z"/>
+ </g>
+ <path id="path5269-2-50-4-8-5" d="m650.51-207.52c-3.467 0.6834-6.1184 6.1246-4.6204 11.221 1.4267-3.9078 5.3052-9.0696 4.6204-11.221z" fill="#fff1a1"/>
+ <path id="path5269-9-85-8-3-0-2" d="m662.74-206.29c2.4916 0.19567 4.4704 4.4054 3.6724 9.8517-0.58652-3.9078-3.5124-7.7004-3.6724-9.8517z" fill="#fff1a1"/>
+ <path id="path5293-9-4-7-7-4" d="m650.99-199.18s-0.36334 2.0037-0.00035 3.4397c0.2429 0.9609 0.55598 1.9515 1.1586 2.7384 0.62338 0.8141 3.4062 1.8958 3.4062 1.8958l-0.003 2.3214s2.1544-1.7637 2.4258-2.7394c0.20719-0.74489 0.63526-3.6925 0.63526-3.6925l-2.0045 2.7412s-3.187-1.3138-3.9329-2.3171c-1.1474-1.5434-1.6848-4.3876-1.6848-4.3876z" fill="#fff1a1"/>
+ <path id="path5295-43-9-7-5-94" d="m647.59-222.28s-0.13419-0.75608 1.549-1.5407c1.7741-0.82701 5.4036-1.6857 6.7715-1.7243 1.6398-0.0462 5.2361 0.84692 7.1211 1.7688 1.5851 0.77521 1.6207 1.6016 1.6207 1.6016-2.9139-0.49181-5.8279-0.17447-8.7418 0.73726-2.4153-1.1166-5.0664-1.6831-8.3205-0.84258z" fill="#ffefa7"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g44436-4" transform="translate(32.414 507.38)">
+ <path id="path7014-6-7-7" d="m1648.5 440.06c75.551-34.045 134.28-68.698 169.54-116.72 26.717-36.389 31.76-82.044 33.178-139.42l-202.72 0.004 0.0001 256.13z" fill="#ce0f25"/>
+ <g id="g18460-95" transform="translate(0,-2)">
+ <g id="g5924-10-0-5" transform="translate(1227.8 427.84)">
+ <g id="g5915-8-7-6">
+ <g id="g5810-14-0-1">
+ <path id="path13429-8-0-88-7-5" d="m469.89-189.44s-3.2133-0.0251-4.5-0.77844c-1.3993-0.81931-2.8976-3.7155-2.8976-3.7155s-3.5428 0.5752-5.1716 0.2223c-1.7019-0.36873-4.1377-2.3153-4.1377-2.3153 1.627-0.24015 2.8421-0.48567 4.4175-1.7601 0 0-3.1362-0.16604-4.9224-0.8537-1.5552-0.5987-4.0928-2.5827-4.0928-2.5827 1.4501-0.35994 3.0179-0.31529 4.1601-1.7326 0 0-3.0716 0.0277-4.4633-0.48078-1.3892-0.50759-3.5951-2.4616-3.5951-2.4616 1.688-0.14653 3.2936-0.45961 4.379-1.8238 0 0-3.11 [...]
+ <path id="path5784-45-6-91" d="m728.67 600.09s2.1432 3.009 3.3436 3.5824c1.1493 0.5491 3.3436 0 3.3436 0l-0.71649-1.5524h-0.95532c-2.4926-2.9952-4.6214-6.5155-3.9407-10.509 0 0-2.8306-3.1395-4.5378-4.6572-2.2446-1.9955-8.2396-6.4484-8.2396-6.4484s-1.3723-3.3274-1.5524-5.6125c-0.0797-1.0117 0.13035-2.0842 0.59708-2.9854 0.47913-0.92508 1.885-1.2612 2.1495-2.2689 0.0833-0.31749-0.0277-0.70401-0.23883-0.95532-0.25219-0.30015-0.68338-0.5007-1.0747-0.47766-1.4788 0.087-3.8213 2.2689 [...]
+ <path id="path4316-0-8-79-8-3" d="m463.96-201.37c-3.5701-7.4161-9.7625-11.437-16.381-15.396 3.9692 7.4369 9.2548 11.964 16.381 15.396z" fill="#ffefa7"/>
+ </g>
+ <path id="path4318-6-3-4-84-2-8" d="m453.42-228.71c0.26597 1.262-0.26713 2.173-1.4104 2.5208-0.56821 0.17286-1.2252 0.00058-1.9105-0.71256 0.32966-2.0963 0.16478-2.9193-1.2819-4.7137 3.6173 0.77133 3.7546 2.3731 4.6028 2.9055z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-0-58-3-89" d="m443.34-229.69c0.76473 1.0385 0.65682 2.0886-0.23976 2.8785-0.4456 0.39266-1.1149 0.50793-2.0341 0.14266-0.56811-2.0446-1.059-2.7254-3.119-3.7595 3.6119-0.79601 4.4003 0.60505 5.3928 0.73838z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-8-9-43" d="m437.61-222.55c1.1281 0.62511 1.4678 1.6245 0.98223 2.7163-0.24131 0.54269-0.80162 0.92653-1.7894 0.97776-1.3688-1.6215-2.0989-2.0357-4.4024-2.1168 2.9511-2.2295 4.2518-1.2847 5.2096-1.5773z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <g id="g5750-94-0-9">
+ <path id="path13429-0-9-7-3-5" d="m513.51-183.58c-1.3343-0.38955-2.963-2.1437-4.3783-2.1357-1.4905 0.009-2.5414 0.84042-3.2912 1.9584-0.35783 0.53347 0.20388 2.5294 0.76142 2.9126l2.5674 1.7649s-1.6071 1.8464-1.7289 2.8858c-0.1058 0.90301 0.34775 1.628 0.99501 2.341 0.84401 0.92951 1.0511 1.2888 2.3959 1.4847 0.80306 0.11697 2.7034-0.23377 2.7034-0.23377s-0.0444 1.4813 0.4251 2.165c0.85068 1.239 2.2951 2.3313 3.9452 2.157 1.2886-0.13595 1.7067-0.33111 2.3878-1.2902 0.54003-0.760 [...]
+ <path id="path5660-0-8-17" d="m783.74 615s3.5466-1.8658 5.43-2.7966c2.9696-1.4676 8.1605-1.8548 9.4654-4.8993 0 0 0.36901-0.67607 0.24826-1.6137-0.18076-1.4037-2.628-2.5641-1.8619-4.0962l0.62064-1.2413s2.6031 1.1202 3.3514 1.986c0.60801 0.70347 0.69545 1.8747 1.4895 2.3584 0.8158 0.49693 2.8549 0.24826 2.8549 0.24826l1.2413 3.5997s1.89-0.0156 2.6067 0.8689c0.21 0.25918 0.24967 0.68396 0.12413 0.99302-0.19942 0.49091-1.3474 0.61558-1.8474 0.79097-0.97609 0.34239-2.4826-0.76199-2. [...]
+ <path id="path4316-5-4-3-4" d="m535.02-185.57c-6.2504-0.32088-11.135 2.7033-16.128 6.072 6.4046 0.0294 11.312-2.1084 16.128-6.072z" fill="#ffefa7"/>
+ <path id="path4318-6-06-1-5" d="m506.63-185.27c1.1706 0.54134 1.5821 1.5134 1.1772 2.6377-0.20123 0.55879-0.7321 0.98239-1.7135 1.1053-1.4832-1.5177-2.2414-1.8776-4.5448-1.7909 2.7811-2.4383 4.1471-1.5906 5.081-1.9521z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-53-0-14" d="m507.77-176.49c1.2891-0.0398 2.0922 0.64527 2.2333 1.8318 0.0702 0.58976-0.21497 1.2062-1.0376 1.7554-2.0056-0.69331-2.8448-0.6758-4.8657 0.43264 1.3956-3.4252 2.9966-3.2785 3.67-4.0198z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-30-8-0-60" d="m514.68-170.36c1.0805-0.70409 2.1227-0.53622 2.86 0.40409 0.36649 0.46736 0.44329 1.1422 0.026 2.0389-2.0737 0.45018-2.7815 0.90132-3.9319 2.8987-0.58806-3.6516 0.85587-4.3584 1.0458-5.3417z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <path id="path5636-51-8-3" d="m808.69 595.02s-0.24352 4.5664-2.1508 5.7354c-0.82133 0.50342-1.9716 0.71207-2.8677 0.35846-0.86808-0.34255-1.4746-1.2733-1.7923-2.1508-0.20338-0.56175-0.53769-1.9715-0.53769-1.9715s-2.9158-1.3339-4.4808-1.4338c-2.3038-0.1471-6.8108 1.2546-6.8108 1.2546 0.76944-2.3922 2.8398-4.3507 5.0185-6.2731l7.5277-0.53769 6.0938 5.0185z" transform="translate(-265.27 -795.88)" stroke="#806600" stroke-width="1px" fill="#efd300"/>
+ <g id="g5837-24-0-2">
+ <path id="path13429-5-67-4-2" d="m563.76-231.22c2.1572-0.23696 6.5861-1.1163 8.0732-2.5693 0.69312-0.67726 2.6361-2.5693 2.6361-2.5693-0.41182 4.2716-2.6018 7.0405-7.2494 8.9171-3.7084 1.4974-7.9892 1.8438-12.027 1.5114-2.5428-0.20932-7.2494-1.5114-7.2494-1.5114 2.5819 2.7676 1.2698 4.7211-1.9771 6.0455 0 0 0.4811-2.6505-0.49427-3.0228-2.1035-0.80273-4.475 0.24322-6.7088 1.4717-1.6499 0.90739-4.1482 1.3305-5.8309 1.312-2.8032-0.0308-4.3568-0.0632-6.9785-0.97435-1.581-0.54947-4.3 [...]
+ <path id="path13429-5-2-4-55-7-1" d="m602.58-173.56c0.37815 1.0728 1.2322 3.4261 0.5537 4.3662-0.86862 1.204-2.6627 1.4499-4.214 1.208-0.85597-0.13346-2.0588-1.1243-2.0588-1.1243s-0.87586 1.484-1.4662 1.939c-0.98853 0.76189-1.4141 0.93925-2.7043 0.89386-0.98952-0.0349-1.8701-0.47932-2.5549-1.1355-0.78831-0.75526-1.3345-3.0162-1.3345-3.0162l-3.0423 0.55168c-0.66066 0.11981-2.663-0.80445-2.8862-1.3873-0.46783-1.2215-0.51317-2.4561 0.39506-3.4471 0.86236-0.9409 3.2472-0.98993 4.462 [...]
+ <path id="path5808-0-6-4" d="m737.88 606.58s1.4082 2.6514 3.2165 3.7289c0.81128 0.48338 2.5551 1.2354 2.5551 1.2354l0.35668-2.7756s1.619-0.61945 2.6264-1.1673c1.0075-0.54785 3.356-2.1887 3.356-2.1887l0.43774 2.4805s5.4081-2.6518 7.5874-4.6692c1.4564-1.3482 2.8681-2.9344 3.5019-4.8151 0.73017-2.1668 0.14591-6.8579 0.14591-6.8579l-14.764 0.51863-3.3579 12.792-5.662 1.7182h-0.00004z" transform="translate(-265.27 -795.88)" fill="#e4c900"/>
+ <path id="path13429-5-2-7-52-1-7" d="m600.9-179.22s1.1259-0.033 1.6229 0.1712c0.79473 0.32651 2.0882 1.2157 2.0882 1.2157s-0.19141-2.1781-0.96212-3.1521c-0.9648-1.2192-3.1613-2.2695-3.1613-2.2695s0.93205-0.56214 1.46-0.70152c0.81159-0.21426 2.5259-0.18106 2.5259-0.18106s-1.1026-1.3756-2.0617-2.1434c-1.0834-0.86729-4.2608-0.63041-4.2608-0.63041s0.97703-0.94937 1.5725-1.2942c0.77897-0.45107 2.4134-0.34488 2.4134-0.34488s-1.122-1.3971-2.3366-1.8912c-1.1339-0.46135-3.8485-0.50435-3. [...]
+ <path id="path4414-07-6-7" d="m557.48-204.79 10.97 0.56546 9.1605 0.11309h5.7677c6.6327-1.3371 14.359-2.7989 17.529-9.4998l0.1131-4.9761c-0.28789 2.9589-1.5285 5.2798-3.4758 7.0343-9.2315 8.3176-29.839 5.5392-39.726 2.6917l-6.8987-0.90475 6.5594 4.9761z" fill="#e4c900"/>
+ <path id="path5188-7-1-0" d="m571.18-221.21c-7.2623 0.59556-25.522 5.6139-39.555 6.7817-7.4968 0.62388-15.682 0.21212-20.405-2.5725-2.0815-1.227-3.4909-2.9149-3.8732-5.1778l-0.69517 2.6416 2.2245 3.4758 5.0052 2.3636 9.4543 1.8074 10.289-0.8342 5.8394-0.55614 30.726-5.8394 0.9903-2.0902z" fill="#e4c900"/>
+ <path id="path5190-97-4-9" d="m571.16-221.39c0.16289 2.8742 0.80056 4.0867 1.4527 5.2485 0.83126-1.812 1.5143-3.9988 4.1238-5.8108 0.77354 1.9994 1.3557 4.3737 2.6242 6.3732 0.62029-2.2648 0.74038-5.0218 2.9991-6.9355 0.81886 1.8884 1.5539 4.196 2.4836 5.5296-0.0201-1.4371-0.17314-3.1553 1.6402-4.5924 7.0913-3.79 16.558 3.2005 9.7003 8.0133l0.0937 0.0469 0.6092-2.1088-0.65606-2.6242-2.1556-1.687-2.7648-0.89037-3.5615 0.70292-1.5464 1.5933 0.46862 1.9682 2.3431 2.2025-3.7958-0.28 [...]
+ <path id="path5192-53-9-5" d="m520.82-225.43 6.3005 3.0518 6.3005 0.78756 3.9378-0.68912 4.3316-2.1658 3.4456-0.19689 0.98445 1.2798 0.0985 2.2642 2.2642-1.8705 0.59067-1.5751-0.68912-2.7565 4.627 1.1814 5.9067 0.39378 6.1036-0.98445 5.4145-2.1658 2.658-2.7565 1.3782-4.7254s-2.9123 4.0932-5.0207 5.3161c-2.6576 1.5414-5.9079 2.393-8.9586 2.7565-2.9652 0.35335-5.9904-0.2633-8.9586-0.59067-3.4423-0.37966-8.5648-2.2642-8.5648-2.2642 1.0391 1.5095 2.091 3.019 2.3627 4.5285 0 0-3.24-0 [...]
+ <path id="path5194-9-6-7" d="m515.53-228.62s3.2333 0.48514 4.8553 0.40461c4.8284-0.2397 9.4701-1.9947 14.263-2.63 2.8841-0.38229 5.7912-0.79816 8.6992-0.70807 3.7795 0.11709 7.4493 1.4758 11.228 1.6184 1.9925 0.0752 4.1703 0.45794 5.968-0.40461 1.0327-0.49549 2.0624-1.4143 2.3265-2.5288 0.28307-1.1942-1.0115-3.5404-1.0115-3.5404l0.10115 0.10115-0.50576 1.8208-2.3265 1.9219-2.7311 0.70807-4.5519-0.40461-6.8784-0.80923h-7.6876l-8.598 1.0115-8.3957 1.7196-4.7542 1.7196z" fill="#fff1a1"/>
+ <path id="path5196-9-4-2" d="m564.29-222.7c13.687 2.0155 30.165-6.5438 36.335 5.128l-0.14651-0.14652 0.43954-1.9047-3.0768-3.3698-4.1024-2.1977-7.6187-0.87908-9.9629 1.0256-11.868 2.3442z" fill="#fff1a1"/>
+ <path id="path5465-4-2-9" d="m444.79-187.75s0.52172 3.7286 1.8071 4.905c1.5784 1.4446 6.1958 1.678 6.1958 1.678s6.7077-3.9263 10.326-5.2922c2.9484-1.113 6.0969-1.6013 9.1646-2.3234 0.98578-0.23204 2.9688-0.6454 2.9688-0.6454s0.52861-3.357 0.38723-5.0341c-0.13412-1.591-1.1617-4.6468-1.1617-4.6468l-0.77447 8.132-8.132 1.678-7.2284 2.7107-5.6795 3.356-5.6795-1.2908-2.1943-3.227z" fill="#e4c900"/>
+ <path id="path13429-5-2-91-8-7" d="m563.76-231.22c2.1572-0.23696 6.5861-1.1163 8.0732-2.5694 0.69312-0.67726 2.6361-2.5693 2.6361-2.5693-0.41182 4.2716-2.6018 7.0405-7.2494 8.9171-3.7084 1.4974-7.9892 1.8438-12.027 1.5114-2.5428-0.20931-7.2494-1.5114-7.2494-1.5114 2.5819 2.7676 1.2698 4.7211-1.9771 6.0455 0 0 0.4811-2.6505-0.49427-3.0227-2.1035-0.80273-4.475 0.24321-6.7088 1.4717-1.6499 0.90739-4.1482 1.3305-5.8309 1.312-2.8032-0.0308-4.3568-0.0632-6.9785-0.97436-1.581-0.54946-4 [...]
+ <path id="path4312-59-4-6" d="m492.12-190.69c12.449-0.2103 22.272-11.103 30.73-14.417-17.608 5.7618-22.127 5.5427-24.357 7.6214-0.94342 0.87918-0.97782 2.0496-1.84 3.267-0.8571 1.2101-2.5388 2.4665-4.5325 3.529z" fill="#ffefa7"/>
+ <path id="path4314-83-4-8" d="m575.07-192.04c-17.912 1.167-19.031-13.258-36.915-14.993 15.167 8.1156 16.991 20.439 36.915 14.993z" fill="#fff1a1"/>
+ <path id="path4316-09-9-2" d="m583-193.17c1.795 5.9957 6.2828 9.5823 11.132 13.155-2.1213-6.0432-5.7817-9.9485-11.132-13.155z" fill="#fff1a1"/>
+ <g id="g4351-07-8-9" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8">
+ <path id="path4318-68-1-9" d="m582.91-173.1c1.206-0.45712 2.1883-0.0706 2.7078 1.0055 0.25823 0.53484 0.18919 1.2105-0.40993 1.9974-2.122-0.003-2.9098 0.28661-4.4602 1.9923 0.20521-3.6929 1.7668-4.0752 2.1623-4.9952z"/>
+ <path id="path4318-1-3-0-8" d="m589.89-168.72c0.89979-0.92394 1.9534-0.98877 2.879-0.23307 0.46006 0.37559 0.68302 1.0171 0.47261 1.9836-1.9245 0.89407-2.5161 1.4895-3.2003 3.6906-1.3747-3.4336-0.12095-4.44-0.15134-5.441z"/>
+ <path id="path4318-8-8-3-3" d="m598.52-169.35c0.62765-1.1266 1.6279-1.464 2.7186-0.97596 0.54211 0.24259 0.92468 0.80375 0.97364 1.7916-1.6247 1.3651-2.0405 2.0942-2.1269 4.3976-2.2227-2.9562-1.2749-4.2548-1.5653-5.2132z"/>
+ </g>
+ <path id="path4318-80-61-7-7" d="m440.98-188.39c1.1687 0.54532 1.5769 1.5188 1.1681 2.6417-0.20314 0.5581-0.73545 0.9799-1.7173 1.0995-1.478-1.5227-2.235-1.8852-4.5386-1.8064 2.7894-2.4288 4.1525-1.5764 5.0877-1.9348z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-1-4-9-4-1" d="m436.15-181.66c1.2891 0.0387 2.049 0.77138 2.1177 1.9644 0.0342 0.59291-0.28797 1.1908-1.1424 1.689-1.9597-0.81407-2.7984-0.84765-4.883 0.13576 1.6015-3.3339 3.1906-3.0901 3.9078-3.7891z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-8-6-6-3-2" d="m439.99-173.38c1.1489-0.58595 2.1675-0.30892 2.8014 0.70405 0.315 0.50349 0.32012 1.1826-0.18956 2.0302-2.1097 0.22855-2.8612 0.60238-4.2162 2.467-0.19892-3.6933 1.3116-4.2436 1.6044-5.2013z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4316-0-7-4-6" d="m473.17-186.89c-8.2126-0.54642-13.083 2.9419-19.789 6.7508 8.4272 0.20931 13.292-2.2404 19.789-6.7508z" fill="#ffefa7"/>
+ </g>
+ <g id="g4338-8-89-8-1" transform="matrix(.96160 .27445 -.27445 .96160 -204.64 -191)">
+ <path id="path14997-8-0-1-79-2-8-3-77-7-1-7" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864-0. [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-0-4-5-2-6" d="m644.79-216.04c-0.28315 0.81131-1.5511 5.1996-2.249 6.0725-1.0381 1.2984-2.1027 1.6494-2.1027 1.6494 1.1459 1.523 1.525 2.1719 4.1235 1.788-4.5382 5.7247-3.3209 12.444 2.6495 16.759 0.0948-0.74991 0.63997-2.5469 1.0516-3.2948-0.0753-0.0307 0.9917 3.1956 3.0952 4.3932 0.68254 0.38858 1.7964 3.317 2.8296 4.0431 0.94251 0.66246 2.1886 1.3199 2.1886 1.3199s0.08-2.5975 1.0879-3.2864c1.015-0.6938 2.9388-1.8908 3.5677-2.306 1.2656-0.83 [...]
+ <g id="g4307-4-5-8-5" transform="translate(0 -.75004)">
+ <path id="path5211-9-2-3-0" fill="#504416" d="m650.46-210.73c0.94 2.0538 1.1251 6.5986 0.64531 7.9898l5.4395 0.56423 4.9754-0.81907c-0.95614-1.8603-0.12607-6.2653 0.46147-7.8504l-3.5184 1.0866-2.0313-1.1285-2.7083 1.467-3.2636-1.3097z"/>
+ <g id="g4139-1-49-9-4" fill="#fff">
+ <path id="path5213-9-7-5-4-9-5" d="m652.03-201.5c0.0211-2.4912 0.50919-2.8128 0.88867-3.6914l0.54687 3.4179-1.4355 0.27343z"/>
+ <path id="path5213-9-7-9-5-47-9-1" d="m660.45-201.5c-0.0211-2.4912-0.50919-2.8128-0.88867-3.6914l-0.54687 3.4179 1.4355 0.27343z"/>
+ </g>
+ <path id="path5160-2-5-95-6-23" d="m651.36-202.73c-0.81165 7.0872 10.243 7.3994 9.7355 0-2.7762 0.58616-5.7673 0.90381-9.7355 0z" fill="#e4c900"/>
+ <path id="path5160-2-3-8-56-1-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m650.93-203.3-0.0625 0.5625c-0.21756 1.8997 0.38656 3.4223 1.4062 4.4375 1.0197 1.0152 2.4282 1.51 3.8438 1.5312 1.4155 0.0213 2.8459-0.43482 3.9062-1.4375s1.6979-2.558 1.5625-4.5312l-0.0312-0.5625-0.5625 0.125c-2.741 0.57871-5.6408 0.8861-9.5312 0l-0.53125-0.125h-0.00005zm0.96875 1.1562c3.3974 0.66907 6.1564 0.50399 8.625 0.0312-0.0319 1.4052-0.44577 2.4861-1.1875 3 [...]
+ <path id="path5010-2-2-15-7-2" d="m653.95-209.47c-0.0725 4.5313 0.1742 9.5588 2.2688 13.657 2.0946-4.0979 2.3412-9.082 2.2688-13.613-0.0432-0.17139-0.98524-0.30903-1.1301-0.41285-0.35601-0.25521-1.0222-0.90865-1.0222-0.90865s-0.69131 0.7735-1.1358 1.0222c-0.37899 0.21208-1.2494 0.25591-1.2494 0.25591z" stroke="#2c5aa0" fill="#377bc8"/>
+ <g id="g5237-9-91-3-41" transform="translate(-14.216 -5.3362)" fill="#fff">
+ <path id="path5213-8-3-9-8" d="m665.98-204.45c0.0211 2.4912 0.50919 2.8128 0.88867 3.6914l0.54687-3.4179-1.4355-0.27343z"/>
+ <path id="path5213-9-2-88-8-2" d="m674.88-204.45c-0.0211 2.4912-0.50919 2.8128-0.88867 3.6914l-0.54687-3.4179 1.4355-0.27343z"/>
+ </g>
+ <g id="g5011-07-943-4-6" transform="translate(-14.133 -5.3362)">
+ <path id="path4962-4-95-0-0" d="m668.94-212.14s0.8411 0.79935 1.375 0.825c0.53241 0.0256 1.4437-0.6875 1.4437-0.6875l-1.5125-4.0562-1.3062 3.9187z" fill="#ffefa7"/>
+ <g id="g4892-8-1-6-3" transform="translate(-.11475)">
+ <g id="g4855-5-74-3-9" transform="translate(0 .064716)">
+ <path id="path4045-83-5-4-49" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-06-1-6-6" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-2-46-9-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0.38334 0.6 [...]
+ </g>
+ <g id="g4855-3-2-03-7-1" transform="matrix(-1 0 0 1 1340.9 .064716)">
+ <path id="path4045-9-52-2-4-3" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-0-2-21-9-2" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-5-7-4-4-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0.38334 0. [...]
+ </g>
+ </g>
+ <path id="path4902-1-77-1-9" d="m661.12-211.22 0.2189 1.9505 0.63079 0.57371c-1.4494-0.21083 1.916 0.48806 2.6167 0.63557l0.11062 2.2124 1.4934 1.8252 2.3783 0.22124 1.8805-1.2168 1.604 1.2721 2.1571-0.11062 2.2124-1.9911v-2.323l2.0193-0.1559 1.1334-1.0056v-1.7699c-0.97175 1.2236-1.9336 2.4242-4.7013 2.1018 0.30303 1.3307 0.21514 2.2357-0.10593 2.8294-0.38328 0.70879-1.0988 0.97406-1.8783 0.99065-0.97223 0.0207-2.0383-0.78084-2.5511-1.2205-0.74162 0.79142-1.3904 1.4166-1.9952 [...]
+ <path id="path4402-2-5-0-9-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m661.06-211.69c-0.48492 1.2877-0.28378 2.4598 0.42441 3.2089 0.59079 0.6249 1.4921 0.86991 2.474 0.91092-0.0108 0.15882-0.018 0.18577-0.0207 0.41406-0.006 0.49673 0.005 1.0718 0.20702 1.5734 0.41453 1.0274 1.2478 1.7102 2.1945 2.1427 0.82617 0.37748 1.7898 0.3611 2.6086 0.0828 0.50449-0.17148 0.90215-0.49664 1.2111-0.78671 0.11015-0.10341 0.11986-0.12422 0.20703-0.2173 [...]
+ <g id="g4958-2-9-6-0" transform="translate(-.0084986)" fill="#ffefa7">
+ <path id="path4904-1-57-7-3" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-265.65 -796.35)"/>
+ <path id="path4904-2-1-2-0-9" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-260.64 -796.35)"/>
+ </g>
+ <path id="path4928-0-9-9-5" d="m667.32-209.87s1.8744-0.9079 2.8875-0.9625c1.0772-0.0581 3.1625 0.6875 3.1625 0.6875v1.0312l-2.6125 1.5125-2.4062-1.2375-0.61875-0.1375-0.4125-0.89374z" fill="#e4c900"/>
+ <path id="path4930-1-76-7-3" d="m663.05-216.43c-0.68077 0.0986-1.4372 0.43559-1.7812 1.0312-0.20631 0.3572 0 1.25 0 1.25l1.0312-0.28125h1.25l2.8125 0.40625 2.6875-0.9375s-1.6672-0.18486-2.5155-0.38981c-1.1454-0.27675-2.3184-1.2479-3.4845-1.0789zm14.156 0c-1.0124 0.0279-1.9507 0.83678-2.953 1.0789-0.84823 0.20495-2.5783 0.38981-2.5783 0.38981l2.6875 0.9375 2.8125-0.40625h1.2188l1.0312 0.28125s0.20631-0.8928 0-1.25c-0.34403-0.59566-1.1005-0.93263-1.7812-1.0312-0.14577-0.0211-0.2 [...]
+ <path id="path3477-9-0-5-8-82-3-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m669.17-215.78-0.50722 0.23808s-1.7236 0.79174-3.2814 0.78671c-0.63267-0.002-1.5924-0.38405-2.4947-0.46582-0.45115-0.0409-0.94895 0.004-1.3353 0.35195-0.38639 0.34805-0.55842 0.90541-0.55898 1.6252 0.52653-0.24596 0.82663-0.54771 1.2215-0.87987 0.0934-0.0842 0.25887-0.13259 0.57969-0.10351 0.64162 0.0581 1.6283 0.47305 2.5878 0.47616 1.3739 0.004 2.4581-0.38749 3. [...]
+ </g>
+ </g>
+ <path id="path14997-8-0-1-79-2-8-3-7-7-76-99-1-1" d="m665.95-223.26s-0.49091-1.4887-1.2937-2.7471c-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864-0.70266-1.2864-0.70266 0.20494 0.78744-0.2941 1.7027-0.49785 2.3509 0 0-1.1545-2.9101-2.2123-3.7701-0.81594-0.66339-2.7302-1.3104-2.7174-1.3103 0.0129 0.00039-1.7876 0.62325-2.612 1.2761-1.0688 0.84639-2.2606 3.7414-2.2606 3.7414-0.19541-0.65083-0.6826-1.5724-0.46754-2.3572 0 0-0.59719 0.15772-1.2953 0.68607-0.67922 [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-00-83-5-26" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.286 [...]
+ <g id="g5134-9-71-6-9" transform="translate(-14.275 -5.3362)" fill="#806600">
+ <path id="path5110-5-2-4-1" d="m657.2-218.43s1.8048 0.59598 2.1668 1.4196c0.49367 1.123 0.37359 4.5578 0.37359 4.5578s-2.2734-1.6935-2.6898-2.6151c-0.52396-1.1595 0.14943-3.3623 0.14943-3.3623z"/>
+ <path id="path5110-9-6-61-5-9" d="m683.59-218.43s-1.8048 0.59598-2.1668 1.4196c-0.49367 1.123-0.37359 4.5578-0.37359 4.5578s2.2734-1.6935 2.6898-2.6151c0.52396-1.1595-0.14943-3.3623-0.14943-3.3623z"/>
+ </g>
+ <path id="path5269-2-7-1-0" d="m650.51-207.52c-3.467 0.6834-6.1184 6.1246-4.6204 11.221 1.4267-3.9078 5.3052-9.0696 4.6204-11.221z" fill="#fff1a1"/>
+ <path id="path5269-9-85-6-2-6" d="m662.74-206.29c2.4916 0.19567 4.4704 4.4054 3.6724 9.8517-0.58652-3.9078-3.5124-7.7004-3.6724-9.8517z" fill="#fff1a1"/>
+ <path id="path5293-9-5-8-1" d="m650.99-199.18s-0.36334 2.0037-0.00035 3.4397c0.2429 0.9609 0.55598 1.9515 1.1586 2.7384 0.62338 0.8141 3.4062 1.8958 3.4062 1.8958l-0.003 2.3214s2.1544-1.7637 2.4258-2.7394c0.20719-0.74489 0.63526-3.6925 0.63526-3.6925l-2.0045 2.7412s-3.187-1.3138-3.9329-2.3171c-1.1474-1.5434-1.6848-4.3876-1.6848-4.3876z" fill="#fff1a1"/>
+ <path id="path5295-43-04-8-7" d="m647.59-222.28s-0.13419-0.75608 1.549-1.5407c1.7741-0.82701 5.4036-1.6857 6.7715-1.7243 1.6398-0.0462 5.2361 0.84692 7.1211 1.7688 1.5851 0.77521 1.6207 1.6016 1.6207 1.6016-2.9139-0.49181-5.8279-0.17447-8.7418 0.73726-2.4153-1.1166-5.0664-1.6831-8.3205-0.84258z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g17814-38">
+ <g id="g5915-7-2-7-7" transform="translate(1227.8 491.86)">
+ <g id="g5810-48-3-7-0">
+ <path id="path13429-8-0-0-7-9-3" d="m469.89-189.44s-3.2133-0.0251-4.5-0.77844c-1.3993-0.81931-2.8976-3.7155-2.8976-3.7155s-3.5428 0.5752-5.1716 0.2223c-1.7019-0.36873-4.1377-2.3153-4.1377-2.3153 1.627-0.24015 2.8421-0.48567 4.4175-1.7601 0 0-3.1362-0.16604-4.9224-0.8537-1.5552-0.5987-4.0928-2.5827-4.0928-2.5827 1.4501-0.35994 3.0179-0.31529 4.1601-1.7326 0 0-3.0716 0.0277-4.4633-0.48078-1.3892-0.50759-3.5951-2.4616-3.5951-2.4616 1.688-0.14653 3.2936-0.45961 4.379-1.8238 0 0-3.1 [...]
+ <path id="path5784-4-2-6-6" d="m728.67 600.09s2.1432 3.009 3.3436 3.5824c1.1493 0.5491 3.3436 0 3.3436 0l-0.71649-1.5524h-0.95532c-2.4926-2.9952-4.6214-6.5155-3.9407-10.509 0 0-2.8306-3.1395-4.5378-4.6572-2.2446-1.9955-8.2396-6.4484-8.2396-6.4484s-1.3723-3.3274-1.5524-5.6125c-0.0797-1.0117 0.13035-2.0842 0.59708-2.9854 0.47913-0.92508 1.885-1.2612 2.1495-2.2689 0.0833-0.31749-0.0277-0.70401-0.23883-0.95532-0.25219-0.30015-0.68338-0.5007-1.0747-0.47766-1.4788 0.087-3.8213 2.2689 [...]
+ <path id="path4316-0-8-0-4-0-9" d="m463.96-201.37c-3.5701-7.4161-9.7625-11.437-16.381-15.396 3.9692 7.4369 9.2548 11.964 16.381 15.396z" fill="#ffefa7"/>
+ </g>
+ <path id="path4318-6-3-4-57-1-1-14" d="m453.42-228.71c0.26597 1.262-0.26713 2.173-1.4104 2.5208-0.56821 0.17286-1.2252 0.00058-1.9105-0.71256 0.32966-2.0963 0.16478-2.9193-1.2819-4.7137 3.6173 0.77133 3.7546 2.3731 4.6028 2.9055z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-0-0-82-2-14" d="m443.34-229.69c0.76473 1.0385 0.65682 2.0886-0.23976 2.8785-0.4456 0.39266-1.1149 0.50793-2.0341 0.14266-0.56811-2.0446-1.059-2.7254-3.119-3.7595 3.6119-0.79601 4.4003 0.60505 5.3928 0.73838z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-0-6-3-6" d="m437.61-222.55c1.1281 0.62511 1.4678 1.6245 0.98223 2.7163-0.24131 0.54269-0.80162 0.92653-1.7894 0.97776-1.3688-1.6215-2.0989-2.0357-4.4024-2.1168 2.9511-2.2295 4.2518-1.2847 5.2096-1.5773z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <g id="g17805-1" transform="translate(1.7354 .43385)">
+ <g id="g17800-02" transform="matrix(.85146 0 0 .85895 264.02 40.328)">
+ <path id="path13429-0-9-6-3-1-4" d="m1740.4 304.66c-1.2752-0.55305-2.6722-2.4968-4.0774-2.6655-1.48-0.17712-2.6264 0.51663-3.51 1.5323-0.4216 0.48464-0.1134 2.5351 0.3919 2.9849l2.3271 2.0716s-1.8251 1.6313-2.0756 2.6474c-0.2177 0.88274 0.1418 1.6587 0.695 2.4468 0.7214 1.0276 0.882 1.4099 2.1918 1.7721 0.7822 0.2163 2.7115 0.10551 2.7115 0.10551s-0.229 1.4642 0.1515 2.2011c0.6894 1.3355 1.9862 2.5996 3.6451 2.6326 1.2955 0.026 1.7347-0.11548 2.5301-0.98204 0.6307-0.6872 0.7663 [...]
+ <path id="path5660-7-9-1-0" d="m1745 307.95s3.7518-1.4085 5.7366-2.0969c3.1295-1.0854 8.3282-0.82163 10.003-3.6795 0 0 0.4505-0.62472 0.4477-1.57 0-1.4153-0.6902-5.8806-1.336-4.2966l-0.3881 0.95188s1.4772 0.28768 2.1116 1.2401c0.5155 0.77386 0.456 1.9469 1.1835 2.5259 0.7474 0.59487 4.9262-0.35458 4.9262-0.35458l0.7822 3.7265s1.8772 0.22044 2.4778 1.1875c0.176 0.28336 0.1624 0.70977-0.0008 1.0007-0.2591 0.46218-1.4137 0.44258-1.9317 0.55419-1.0112 0.21787-2.368-1.0659-2.368-1.0 [...]
+ <path id="path4316-5-8-4-0-4" d="m1762 305.37c-6.1614-1.0986-11.385 1.2923-16.76 4.0114 6.3508 0.82861 11.486-0.67995 16.76-4.0114z" fill="#ffefa7"/>
+ </g>
+ <path id="path4318-6-0-9-1-3" d="m1741.7 300.81c1.0939 0.68322 1.3808 1.6991 0.8388 2.764-0.2694 0.5293-0.849 0.88332-1.8381 0.8828-1.2821-1.6909-1.9895-2.1427-4.2857-2.3442 3.0637-2.072 4.3133-1.0605 5.285-1.3026z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-6-65-3-17" d="m1740.9 307.19c1.284 0.12142 1.9953 0.90137 1.9872 2.0963 0 0.59391-0.3638 1.1699-1.2486 1.6121-1.9033-0.93823-2.7381-1.0256-4.8816-0.17809 1.8123-3.2242 3.3824-2.8788 4.143-3.5303z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-30-57-13-8-9" d="m1745.8 312.99c1.16-0.56371 2.1731-0.26707 2.7873 0.75793 0.3053 0.50945 0.2972 1.1886-0.2287 2.0262-2.1137 0.1878-2.8723 0.54707-4.263 2.3853-0.1276-3.6964 1.3932-4.2175 1.7044-5.1694z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <g id="g6568-47" transform="translate(176.15 -50.076)">
+ <path id="path5636-3-2-0-0" d="m1595.1 341.07s-0.2435 4.5664-2.1508 5.7354c-0.8213 0.50342-1.9716 0.71207-2.8676 0.35846-0.8681-0.34255-1.4747-1.2733-1.7924-2.1508-0.2033-0.56175-0.5376-1.9715-0.5376-1.9715s-2.9158-1.3339-4.4808-1.4338c-2.3038-0.1471-6.8108 1.2546-6.8108 1.2546 0.7695-2.3922 2.8398-4.3507 5.0185-6.2731l7.5277-0.53769 6.0938 5.0185z" stroke="#806600" stroke-width="1px" fill="#efd300"/>
+ <path id="path13429-5-30-00-9-1" d="m1615.4 310.72c2.1571-0.23696 6.5861-1.1163 8.0731-2.5693 0.6932-0.67726 2.6362-2.5693 2.6362-2.5693-0.4118 4.2716-2.6018 7.0405-7.2494 8.9171-3.7084 1.4974-7.9892 1.8438-12.027 1.5114-2.5428-0.20932-7.2494-1.5114-7.2494-1.5114 2.582 2.7676 1.2698 4.7211-1.9771 6.0455 0 0 0.4811-2.6505-0.4942-3.0228-2.1036-0.80273-4.4751 0.24322-6.7088 1.4717-1.65 0.90739-4.1482 1.3305-5.8309 1.312-2.8032-0.0308-4.3568-0.0632-6.9784-0.97435-1.5811-0.54947-4.32 [...]
+ <path id="path13429-5-2-4-4-39-4-1" d="m1623.6 361.91s-2.0197 2.2864-3.5766 2.9503c-1.2152 0.51817-3.6 0.5672-4.4624 1.5081-0.9082 0.99096-0.8629 2.2256-0.395 3.4471 0.2232 0.58285 2.2255 1.5071 2.8862 1.3873l3.0423-0.55168s0.5462 2.261 1.3345 3.0162c0.6848 0.65614 1.5654 1.1006 2.5549 1.1355 1.2902 0.0454 1.7158-0.13197 2.7043-0.89386 0.5903-0.455 1.4662-1.939 1.4662-1.939s1.2028 0.99083 2.0588 1.1243c1.5512 0.24189 3.3453-0.004 4.2139-1.208 0.6785-0.94012-0.1755-3.2935-0.5537- [...]
+ <path id="path5808-8-5-2-52" d="m1524.2 352.64s1.4083 2.6514 3.2166 3.7289c0.8112 0.48338 2.5551 1.2354 2.5551 1.2354l0.3566-2.7756s1.619-0.61945 2.6265-1.1673c1.0074-0.54785 3.3559-2.1887 3.3559-2.1887l0.4378 2.4805s5.4081-2.6518 7.5874-4.6692c1.4564-1.3482 2.8681-2.9344 3.5019-4.8151 0.7302-2.1668 0.1459-6.8579 0.1459-6.8579l-14.764 0.51863-3.358 12.792-5.6619 1.7182h-0.0001z" fill="#e4c900"/>
+ <path id="path13429-5-2-7-75-31-4-2" d="m1618.1 345.17c1.9901-2.3186 3.0079-2.3651 3.5796-2.07 1.2592 0.64989 1.4305 2.0873 0.2964 3.5434 1.252 0.78767 2.0522 2.0811 5.8626 1.8971-1.6776 1.2206-2.1846 1.8294-2.8744 3.3322 1.4303-0.43081 2.9298-0.0205 5.0706 0.54342-1.5146 1.1845-1.9324 2.3623-2.456 3.4052 1.4219-0.1695 2.485 0.11417 5.0397 0.51111-1.4577 0.69779-2.5537 1.0295-2.7986 1.9968 1.6646 0.86764 1.5103 0.52568 3.9318 2.4026-1.5387 0.18281-2.4781 0.18501-3.078 1.1725l2.9 [...]
+ <path id="path4414-9-1-0-24" d="m1609.1 337.15 10.97 0.56546 9.1605 0.11309h5.7677c6.6327-1.3371 14.359-2.7989 17.529-9.4998l0.1131-4.9761c-0.2878 2.9589-1.5284 5.2798-3.4757 7.0343-9.2315 8.3176-29.838 5.5392-39.726 2.6917l-6.8987-0.90475 6.5594 4.9761z" fill="#e4c900"/>
+ <path id="path5188-5-2-2-9" d="m1622.8 320.73c-7.2623 0.59556-25.522 5.6139-39.555 6.7817-7.4968 0.62388-15.682 0.21212-20.405-2.5725-2.0815-1.227-3.4909-2.9149-3.8732-5.1778l-0.6951 2.6416 2.2245 3.4758 5.0052 2.3636 9.4543 1.8074 10.289-0.8342 5.8394-0.55614 30.726-5.8394 0.9903-2.0902z" fill="#e4c900"/>
+ <path id="path5190-3-69-9-7" d="m1622.8 320.54c0.1629 2.8742 0.8005 4.0867 1.4527 5.2485 0.8312-1.812 1.5142-3.9988 4.1238-5.8108 0.7735 1.9994 1.3557 4.3737 2.6242 6.3732 0.6203-2.2648 0.7404-5.0218 2.9992-6.9355 0.8188 1.8884 1.5538 4.196 2.4836 5.5296-0.02-1.4371-0.1731-3.1553 1.6402-4.5924 7.0913-3.79 16.558 3.2005 9.7003 8.0133l0.094 0.0469 0.6092-2.1088-0.656-2.6242-2.1557-1.687-2.7648-0.89037-3.5615 0.70292-1.5464 1.5933 0.4686 1.9682 2.3431 2.2025-3.7958-0.28117-1.687-1. [...]
+ <path id="path5192-2-1-7-7" d="m1572.5 316.51 6.3005 3.0518 6.3005 0.78756 3.9378-0.68912 4.3316-2.1658 3.4456-0.19689 0.9845 1.2798 0.099 2.2642 2.2642-1.8705 0.5907-1.5751-0.6891-2.7565 4.6269 1.1814 5.9068 0.39378 6.1036-0.98445 5.4145-2.1658 2.6581-2.7565 1.3782-4.7254s-2.9123 4.0932-5.0207 5.3161c-2.6576 1.5414-5.9079 2.393-8.9586 2.7565-2.9652 0.35335-5.9904-0.2633-8.9585-0.59067-3.4424-0.37966-8.5648-2.2642-8.5648-2.2642 1.0391 1.5095 2.091 3.019 2.3627 4.5285 0 0-3.24-0. [...]
+ <path id="path5194-7-9-9-2" d="m1567.2 313.32s3.2333 0.48514 4.8553 0.40461c4.8284-0.2397 9.4701-1.9947 14.263-2.63 2.884-0.38229 5.7912-0.79816 8.6991-0.70807 3.7795 0.11709 7.4493 1.4758 11.228 1.6184 1.9925 0.0752 4.1703 0.45794 5.968-0.40461 1.0327-0.49549 2.0623-1.4143 2.3265-2.5288 0.2831-1.1942-1.0115-3.5404-1.0115-3.5404l0.1011 0.10115-0.5057 1.8208-2.3265 1.9219-2.7312 0.70807-4.5518-0.40461-6.8785-0.80923h-7.6876l-8.598 1.0115-8.3956 1.7196-4.7542 1.7196z" fill="#fff1a1"/>
+ <path id="path5196-39-0-2-09" d="m1615.9 319.24c13.687 2.0155 30.165-6.5438 36.335 5.128l-0.1465-0.14652 0.4395-1.9047-3.0768-3.3698-4.1023-2.1977-7.6187-0.87908-9.9629 1.0256-11.868 2.3442z" fill="#fff1a1"/>
+ <path id="path5465-77-6-2-0" d="m1496.4 354.18s0.5217 3.7286 1.8071 4.905c1.5784 1.4446 6.1958 1.678 6.1958 1.678s6.7077-3.9263 10.326-5.2922c2.9484-1.113 6.0969-1.6013 9.1646-2.3234 0.9857-0.23204 2.9688-0.6454 2.9688-0.6454s0.5286-3.357 0.3872-5.0341c-0.1341-1.591-1.1617-4.6468-1.1617-4.6468l-0.7745 8.132-8.1319 1.678-7.2284 2.7107-5.6795 3.356-5.6795-1.2908-2.1943-3.227z" fill="#e4c900"/>
+ <path id="path13429-5-2-95-17-3-7" d="m1615.4 310.72c2.1571-0.23696 6.5861-1.1163 8.0731-2.5694 0.6932-0.67726 2.6362-2.5693 2.6362-2.5693-0.4118 4.2716-2.6018 7.0405-7.2494 8.9171-3.7084 1.4974-7.9892 1.8438-12.027 1.5114-2.5428-0.20931-7.2494-1.5114-7.2494-1.5114 2.582 2.7676 1.2698 4.7211-1.9771 6.0455 0 0 0.4811-2.6505-0.4942-3.0227-2.1036-0.80273-4.4751 0.24321-6.7088 1.4717-1.65 0.90739-4.1482 1.3305-5.8309 1.312-2.8032-0.0308-4.3568-0.0632-6.9784-0.97436-1.5811-0.54946-4. [...]
+ <path id="path4312-3-38-1-1" d="m1543.8 351.25c12.45-0.2103 22.272-11.103 30.73-14.417-17.608 5.7618-22.127 5.5427-24.357 7.6214-0.9435 0.87918-0.9779 2.0496-1.8401 3.267-0.8571 1.2101-2.5388 2.4665-4.5325 3.529z" fill="#ffefa7"/>
+ <path id="path4314-33-7-3-6" d="m1619.2 347.5c-14.754 1.167-10.911-10.86-29.378-12.595 15.307 8.0924 14.235 17.244 29.378 12.595z" fill="#fff1a1"/>
+ <path id="path4316-8-03-2-0" d="m1616 350.67c2.7969 5.5989 7.8334 8.3625 13.223 11.051-3.1265-5.5897-7.4025-8.8092-13.223-11.051z" fill="#fff1a1"/>
+ <g id="g4351-5-6-1-9" transform="translate(1032.5 540.91)" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8">
+ <path id="path4318-89-91-6-2" d="m582.91-173.1c1.206-0.45712 2.1883-0.0706 2.7078 1.0055 0.25823 0.53484 0.18919 1.2105-0.40993 1.9974-2.122-0.003-2.9098 0.28661-4.4602 1.9923 0.20521-3.6929 1.7668-4.0752 2.1623-4.9952z"/>
+ <path id="path4318-1-6-4-8-9" d="m589.89-168.72c0.89979-0.92394 1.9534-0.98877 2.879-0.23307 0.46006 0.37559 0.68302 1.0171 0.47261 1.9836-1.9245 0.89407-2.5161 1.4895-3.2003 3.6906-1.3747-3.4336-0.12095-4.44-0.15134-5.441z"/>
+ <path id="path4318-8-04-1-1-6" d="m598.52-169.35c0.62765-1.1266 1.6279-1.464 2.7186-0.97596 0.54211 0.24259 0.92468 0.80375 0.97364 1.7916-1.6247 1.3651-2.0405 2.0942-2.1269 4.3976-2.2227-2.9562-1.2749-4.2548-1.5653-5.2132z"/>
+ </g>
+ <path id="path4318-80-23-4-0-0" d="m1492.6 353.55c1.1687 0.54532 1.5769 1.5188 1.1681 2.6417-0.2031 0.5581-0.7355 0.9799-1.7173 1.0995-1.478-1.5227-2.235-1.8852-4.5386-1.8064 2.7894-2.4288 4.1525-1.5764 5.0877-1.9348z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-1-4-37-6-6-2" d="m1487.8 360.27c1.2891 0.0387 2.049 0.77138 2.1177 1.9644 0.034 0.59291-0.288 1.1908-1.1425 1.689-1.9597-0.81407-2.7983-0.84765-4.883 0.13576 1.6015-3.3339 3.1906-3.0901 3.9078-3.7891z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-8-6-0-1-0-8" d="m1491.6 368.56c1.1489-0.58595 2.1675-0.30892 2.8014 0.70405 0.315 0.50349 0.3201 1.1826-0.1896 2.0302-2.1097 0.22855-2.8612 0.60238-4.2161 2.467-0.1989-3.6933 1.3116-4.2436 1.6043-5.2013z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4316-0-0-0-4-4" d="m1524.8 355.04c-8.2126-0.54642-13.083 2.9419-19.789 6.7508 8.4272 0.20931 13.292-2.2404 19.789-6.7508z" fill="#ffefa7"/>
+ </g>
+ <g id="g4338-8-1-2-9-4" transform="matrix(.96160 .27445 -.27445 .96160 1023.1 300.86)">
+ <path id="path14997-8-0-1-79-2-8-3-77-0-4-9-8" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864- [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-0-4-3-0-4-0" d="m644.79-216.04c-0.28315 0.81131-1.5511 5.1996-2.249 6.0725-1.0381 1.2984-2.1027 1.6494-2.1027 1.6494 1.1459 1.523 1.525 2.1719 4.1235 1.788-4.5382 5.7247-3.3209 12.444 2.6495 16.759 0.0948-0.74991 0.63997-2.5469 1.0516-3.2948-0.0753-0.0307 0.9917 3.1956 3.0952 4.3932 0.68254 0.38858 1.7964 3.317 2.8296 4.0431 0.94251 0.66246 2.1886 1.3199 2.1886 1.3199s0.08-2.5975 1.0879-3.2864c1.015-0.6938 2.9388-1.8908 3.5677-2.306 1.2656-0. [...]
+ <g id="g4307-4-0-431-5-15" transform="translate(0 -.75004)">
+ <path id="path5211-9-03-7-0-1" fill="#504416" d="m650.46-210.73c0.94 2.0538 1.1251 6.5986 0.64531 7.9898l5.4395 0.56423 4.9754-0.81907c-0.95614-1.8603-0.12607-6.2653 0.46147-7.8504l-3.5184 1.0866-2.0313-1.1285-2.7083 1.467-3.2636-1.3097z"/>
+ <g id="g4139-1-8-94-6-1" fill="#fff">
+ <path id="path5213-9-7-5-3-7-9-1" d="m652.03-201.5c0.0211-2.4912 0.50919-2.8128 0.88867-3.6914l0.54687 3.4179-1.4355 0.27343z"/>
+ <path id="path5213-9-7-9-5-60-01-0-51" d="m660.45-201.5c-0.0211-2.4912-0.50919-2.8128-0.88867-3.6914l-0.54687 3.4179 1.4355 0.27343z"/>
+ </g>
+ <path id="path5160-2-5-4-1-8-7" d="m651.36-202.73c-0.81165 7.0872 10.243 7.3994 9.7355 0-2.7762 0.58616-5.7673 0.90381-9.7355 0z" fill="#e4c900"/>
+ <path id="path5160-2-3-8-0-5-8-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m650.93-203.3-0.0625 0.5625c-0.21756 1.8997 0.38656 3.4223 1.4062 4.4375 1.0197 1.0152 2.4282 1.51 3.8438 1.5312 1.4155 0.0213 2.8459-0.43482 3.9062-1.4375s1.6979-2.558 1.5625-4.5312l-0.0312-0.5625-0.5625 0.125c-2.741 0.57871-5.6408 0.8861-9.5312 0l-0.53125-0.125h-0.00005zm0.96875 1.1562c3.3974 0.66907 6.1564 0.50399 8.625 0.0312-0.0319 1.4052-0.44577 2.4861-1.1875 [...]
+ <path id="path5010-2-2-9-22-2-8" d="m653.95-209.47c-0.0725 4.5313 0.1742 9.5588 2.2688 13.657 2.0946-4.0979 2.3412-9.082 2.2688-13.613-0.0432-0.17139-0.98524-0.30903-1.1301-0.41285-0.35601-0.25521-1.0222-0.90865-1.0222-0.90865s-0.69131 0.7735-1.1358 1.0222c-0.37899 0.21208-1.2494 0.25591-1.2494 0.25591z" stroke="#2c5aa0" fill="#377bc8"/>
+ <g id="g5237-9-2-2-8-5" transform="translate(-14.216 -5.3362)" fill="#fff">
+ <path id="path5213-8-49-4-0-3" d="m665.98-204.45c0.0211 2.4912 0.50919 2.8128 0.88867 3.6914l0.54687-3.4179-1.4355-0.27343z"/>
+ <path id="path5213-9-2-2-9-2-7" d="m674.88-204.45c-0.0211 2.4912-0.50919 2.8128-0.88867 3.6914l-0.54687-3.4179 1.4355-0.27343z"/>
+ </g>
+ <g id="g5011-07-9-77-0-9" transform="translate(-14.133 -5.3362)">
+ <path id="path4962-4-1-2-9-6" d="m668.94-212.14s0.8411 0.79935 1.375 0.825c0.53241 0.0256 1.4437-0.6875 1.4437-0.6875l-1.5125-4.0562-1.3062 3.9187z" fill="#ffefa7"/>
+ <g id="g4892-8-0-09-5-3" transform="translate(-.11475)">
+ <g id="g4855-5-9-0-3-1" transform="translate(0 .064716)">
+ <path id="path4045-83-3-7-5-5" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-06-00-1-9-80" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-2-3-6-8-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0.38334 0. [...]
+ </g>
+ <g id="g4855-3-2-01-0-9-2" transform="matrix(-1 0 0 1 1340.9 .064716)">
+ <path id="path4045-9-52-9-9-1-43" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-0-2-86-2-2-3" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-5-7-9-9-8-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0.38334 [...]
+ </g>
+ </g>
+ <path id="path4902-1-0-6-4-05" d="m661.12-211.22 0.2189 1.9505 0.63079 0.57371c-1.4494-0.21083 1.916 0.48806 2.6167 0.63557l0.11062 2.2124 1.4934 1.8252 2.3783 0.22124 1.8805-1.2168 1.604 1.2721 2.1571-0.11062 2.2124-1.9911v-2.323l2.0193-0.1559 1.1334-1.0056v-1.7699c-0.97175 1.2236-1.9336 2.4242-4.7013 2.1018 0.30303 1.3307 0.21514 2.2357-0.10593 2.8294-0.38328 0.70879-1.0988 0.97406-1.8783 0.99065-0.97223 0.0207-2.0383-0.78084-2.5511-1.2205-0.74162 0.79142-1.3904 1.4166-1.995 [...]
+ <path id="path4402-2-5-1-0-0-54" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m661.06-211.69c-0.48492 1.2877-0.28378 2.4598 0.42441 3.2089 0.59079 0.6249 1.4921 0.86991 2.474 0.91092-0.0108 0.15882-0.018 0.18577-0.0207 0.41406-0.006 0.49673 0.005 1.0718 0.20702 1.5734 0.41453 1.0274 1.2478 1.7102 2.1945 2.1427 0.82617 0.37748 1.7898 0.3611 2.6086 0.0828 0.50449-0.17148 0.90215-0.49664 1.2111-0.78671 0.11015-0.10341 0.11986-0.12422 0.20703-0.2 [...]
+ <g id="g4958-2-64-2-1-4" transform="translate(-.0084986)" fill="#ffefa7">
+ <path id="path4904-1-4-8-0-3" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-265.65 -796.35)"/>
+ <path id="path4904-2-1-8-44-8-82" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-260.64 -796.35)"/>
+ </g>
+ <path id="path4928-0-6-8-1-26" d="m667.32-209.87s1.8744-0.9079 2.8875-0.9625c1.0772-0.0581 3.1625 0.6875 3.1625 0.6875v1.0312l-2.6125 1.5125-2.4062-1.2375-0.61875-0.1375-0.4125-0.89374z" fill="#e4c900"/>
+ <path id="path4930-1-14-01-4-4" d="m663.05-216.43c-0.68077 0.0986-1.4372 0.43559-1.7812 1.0312-0.20631 0.3572 0 1.25 0 1.25l1.0312-0.28125h1.25l2.8125 0.40625 2.6875-0.9375s-1.6672-0.18486-2.5155-0.38981c-1.1454-0.27675-2.3184-1.2479-3.4845-1.0789zm14.156 0c-1.0124 0.0279-1.9507 0.83678-2.953 1.0789-0.84823 0.20495-2.5783 0.38981-2.5783 0.38981l2.6875 0.9375 2.8125-0.40625h1.2188l1.0312 0.28125s0.20631-0.8928 0-1.25c-0.34403-0.59566-1.1005-0.93263-1.7812-1.0312-0.14577-0.0211- [...]
+ <path id="path3477-9-0-5-8-0-5-9-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m669.17-215.78-0.50722 0.23808s-1.7236 0.79174-3.2814 0.78671c-0.63267-0.002-1.5924-0.38405-2.4947-0.46582-0.45115-0.0409-0.94895 0.004-1.3353 0.35195-0.38639 0.34805-0.55842 0.90541-0.55898 1.6252 0.52653-0.24596 0.82663-0.54771 1.2215-0.87987 0.0934-0.0842 0.25887-0.13259 0.57969-0.10351 0.64162 0.0581 1.6283 0.47305 2.5878 0.47616 1.3739 0.004 2.4581-0.38749 3 [...]
+ </g>
+ </g>
+ <path id="path14997-8-0-1-79-2-8-3-7-7-76-8-1-5-0" d="m665.95-223.26s-0.49091-1.4887-1.2937-2.7471c-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864-0.70266-1.2864-0.70266 0.20494 0.78744-0.2941 1.7027-0.49785 2.3509 0 0-1.1545-2.9101-2.2123-3.7701-0.81594-0.66339-2.7302-1.3104-2.7174-1.3103 0.0129 0.00039-1.7876 0.62325-2.612 1.2761-1.0688 0.84639-2.2606 3.7414-2.2606 3.7414-0.19541-0.65083-0.6826-1.5724-0.46754-2.3572 0 0-0.59719 0.15772-1.2953 0.68607-0.6792 [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-00-1-1-9-0" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.286 [...]
+ <g id="g5134-9-0-15-0-8" transform="translate(-14.275 -5.3362)" fill="#806600">
+ <path id="path5110-5-3-17-2-1" d="m657.2-218.43s1.8048 0.59598 2.1668 1.4196c0.49367 1.123 0.37359 4.5578 0.37359 4.5578s-2.2734-1.6935-2.6898-2.6151c-0.52396-1.1595 0.14943-3.3623 0.14943-3.3623z"/>
+ <path id="path5110-9-6-11-08-3-7" d="m683.59-218.43s-1.8048 0.59598-2.1668 1.4196c-0.49367 1.123-0.37359 4.5578-0.37359 4.5578s2.2734-1.6935 2.6898-2.6151c0.52396-1.1595-0.14943-3.3623-0.14943-3.3623z"/>
+ </g>
+ <path id="path5269-2-50-53-5-6" d="m650.51-207.52c-3.467 0.6834-6.1184 6.1246-4.6204 11.221 1.4267-3.9078 5.3052-9.0696 4.6204-11.221z" fill="#fff1a1"/>
+ <path id="path5269-9-85-8-7-9-7" d="m662.74-206.29c2.4916 0.19567 4.4704 4.4054 3.6724 9.8517-0.58652-3.9078-3.5124-7.7004-3.6724-9.8517z" fill="#fff1a1"/>
+ <path id="path5293-9-4-9-0-1" d="m650.99-199.18s-0.36334 2.0037-0.00035 3.4397c0.2429 0.9609 0.55598 1.9515 1.1586 2.7384 0.62338 0.8141 3.4062 1.8958 3.4062 1.8958l-0.003 2.3214s2.1544-1.7637 2.4258-2.7394c0.20719-0.74489 0.63526-3.6925 0.63526-3.6925l-2.0045 2.7412s-3.187-1.3138-3.9329-2.3171c-1.1474-1.5434-1.6848-4.3876-1.6848-4.3876z" fill="#fff1a1"/>
+ <path id="path5295-43-9-6-1-4" d="m647.59-222.28s-0.13419-0.75608 1.549-1.5407c1.7741-0.82701 5.4036-1.6857 6.7715-1.7243 1.6398-0.0462 5.2361 0.84692 7.1211 1.7688 1.5851 0.77521 1.6207 1.6016 1.6207 1.6016-2.9139-0.49181-5.8279-0.17447-8.7418 0.73726-2.4153-1.1166-5.0664-1.6831-8.3205-0.84258z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g18382-8">
+ <g id="g5915-7-2-7-8-8-1" transform="matrix(.97193 .23527 -.23527 .97193 1185.8 448.34)">
+ <g id="g5810-48-3-7-7-0-8">
+ <path id="path13429-8-0-0-7-9-7-4-5" d="m469.89-189.44s-3.2133-0.0251-4.5-0.77844c-1.3993-0.81931-2.8976-3.7155-2.8976-3.7155s-3.5428 0.5752-5.1716 0.2223c-1.7019-0.36873-4.1377-2.3153-4.1377-2.3153 1.627-0.24015 2.8421-0.48567 4.4175-1.7601 0 0-3.1362-0.16604-4.9224-0.8537-1.5552-0.5987-4.0928-2.5827-4.0928-2.5827 1.4501-0.35994 3.0179-0.31529 4.1601-1.7326 0 0-3.0716 0.0277-4.4633-0.48078-1.3892-0.50759-3.5951-2.4616-3.5951-2.4616 1.688-0.14653 3.2936-0.45961 4.379-1.8238 0 0 [...]
+ <path id="path5784-4-2-6-1-4-3" d="m728.67 600.09s2.1432 3.009 3.3436 3.5824c1.1493 0.5491 3.3436 0 3.3436 0l-0.71649-1.5524h-0.95532c-2.4926-2.9952-4.6214-6.5155-3.9407-10.509 0 0-2.8306-3.1395-4.5378-4.6572-2.2446-1.9955-8.2396-6.4484-8.2396-6.4484s-1.3723-3.3274-1.5524-5.6125c-0.0797-1.0117 0.13035-2.0842 0.59708-2.9854 0.47913-0.92508 1.885-1.2612 2.1495-2.2689 0.0833-0.31749-0.0277-0.70401-0.23883-0.95532-0.25219-0.30015-0.68338-0.5007-1.0747-0.47766-1.4788 0.087-3.8213 2. [...]
+ <path id="path4316-0-8-0-4-0-6-5-1" d="m463.96-201.37c-3.5701-7.4161-9.7625-11.437-16.381-15.396 3.9692 7.4369 9.2548 11.964 16.381 15.396z" fill="#ffefa7"/>
+ </g>
+ <path id="path4318-6-3-4-57-1-1-1-3-9" d="m453.42-228.71c0.26597 1.262-0.26713 2.173-1.4104 2.5208-0.56821 0.17286-1.2252 0.00058-1.9105-0.71256 0.32966-2.0963 0.16478-2.9193-1.2819-4.7137 3.6173 0.77133 3.7546 2.3731 4.6028 2.9055z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-0-0-82-2-3-9-39" d="m443.34-229.69c0.76473 1.0385 0.65682 2.0886-0.23976 2.8785-0.4456 0.39266-1.1149 0.50793-2.0341 0.14266-0.56811-2.0446-1.059-2.7254-3.119-3.7595 3.6119-0.79601 4.4003 0.60505 5.3928 0.73838z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-0-6-3-4-6-1" d="m437.61-222.55c1.1281 0.62511 1.4678 1.6245 0.98223 2.7163-0.24131 0.54269-0.80162 0.92653-1.7894 0.97776-1.3688-1.6215-2.0989-2.0357-4.4024-2.1168 2.9511-2.2295 4.2518-1.2847 5.2096-1.5773z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <g id="g5750-5-0-2-3-5-0" transform="matrix(.84832 -.52948 .52948 .84832 1384.4 801.03)">
+ <path id="path13429-0-9-6-3-1-2-3-4" d="m513.51-183.58c-1.3343-0.38955-2.963-2.1437-4.3783-2.1357-1.4905 0.009-2.5414 0.84042-3.2912 1.9584-0.35783 0.53347 0.20388 2.5294 0.76142 2.9126l2.5674 1.7649s-1.6071 1.8464-1.7289 2.8858c-0.1058 0.90301 0.34775 1.628 0.99501 2.341 0.84401 0.92951 1.0511 1.2888 2.3959 1.4847 0.80306 0.11697 2.7034-0.23377 2.7034-0.23377s-0.0444 1.4813 0.4251 2.165c0.85068 1.239 2.2951 2.3313 3.9452 2.157 1.2886-0.13595 1.7067-0.33111 2.3878-1.2902 0.54003 [...]
+ <path id="path5660-7-9-1-2-7-9" d="m783.74 615s3.5466-1.8658 5.43-2.7966c2.9696-1.4676 8.1605-1.8548 9.4654-4.8993 0 0 0.36901-0.67607 0.24826-1.6137-0.18076-1.4037-2.628-2.5641-1.8619-4.0962l0.62064-1.2413s2.6031 1.1202 3.3514 1.986c0.60801 0.70347 0.69545 1.8747 1.4895 2.3584 0.8158 0.49693 2.8549 0.24826 2.8549 0.24826l1.2413 3.5997s1.89-0.0156 2.6067 0.8689c0.21 0.25918 0.24967 0.68396 0.12413 0.99302-0.19942 0.49091-1.3474 0.61558-1.8474 0.79097-0.97609 0.34239-2.4826-0.761 [...]
+ <path id="path4316-5-8-4-0-11-2-0" d="m535.02-185.57c-6.2504-0.32088-11.135 2.7033-16.128 6.072 6.4046 0.0294 11.312-2.1084 16.128-6.072z" fill="#ffefa7"/>
+ <path id="path4318-6-0-9-1-1-1-00" d="m506.63-185.27c1.1706 0.54134 1.5821 1.5134 1.1772 2.6377-0.20123 0.55879-0.7321 0.98239-1.7135 1.1053-1.4832-1.5177-2.2414-1.8776-4.5448-1.7909 2.7811-2.4383 4.1471-1.5906 5.081-1.9521z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-3-6-65-3-2-8-3" d="m507.77-176.49c1.2891-0.0398 2.0922 0.64527 2.2333 1.8318 0.0702 0.58976-0.21497 1.2062-1.0376 1.7554-2.0056-0.69331-2.8448-0.6758-4.8657 0.43264 1.3956-3.4252 2.9966-3.2785 3.67-4.0198z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-6-30-57-13-8-3-4-28" d="m514.68-170.36c1.0805-0.70409 2.1227-0.53622 2.86 0.40409 0.36649 0.46736 0.44329 1.1422 0.026 2.0389-2.0737 0.45018-2.7815 0.90132-3.9319 2.8987-0.58806-3.6516 0.85587-4.3584 1.0458-5.3417z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <g id="g18362-2">
+ <path id="path5636-3-2-0-0-1-4" d="m1737.8 340.17s2.3785 3.9056 1.465 5.9476c-0.3933 0.87935-1.2247 1.7013-2.1638 1.9156-0.9098 0.20772-1.9361-0.21764-2.6939-0.76225-0.4851-0.3487-1.5573-1.3232-1.5573-1.3232s-3.1596 0.54638-4.5074 1.348c-1.9841 1.18-4.9114 4.8826-4.9114 4.8826-0.7163-2.4086-0.1143-5.1942 0.5976-8.0112l5.9079-4.696 7.8633 0.6988z" stroke="#806600" stroke-width="1px" fill="#efd300"/>
+ <path id="path13429-5-30-00-9-0-0-8" d="m1742.5 330.1c10.555 1.8725 3.0538 0.90405 14.414-1.4618 1.0637-0.22151 1.8836-0.86441 3.3163-1.1013 0.2756-1.2377 0.4316-2.0728 1.0799-2.8306 0.4646-0.54368 1.3559-1.1659 1.923-1.3188 1.122-0.30253 2.3995 0.25729 3.2644 2.3351 0 0 1.1788 0.37639 2.263-0.0932 1.1481-0.4968 2.2125-1.4805 2.9043-1.7088 1.1413-0.37656 3.2786-0.56366 3.2786-0.56366s-1.3098 1.5945-1.7298 2.4404c-0.2875 0.57902-0.3194 1.8655-0.3194 1.8655s2.2643-1.498 3.4605-1.7 [...]
+ <path id="path13429-5-2-4-4-39-4-4-6-35" d="m1775.7 340.05s-0.375 3.0276-1.2847 4.4549c-0.71 1.114-2.6502 2.5016-2.8303 3.7652-0.1897 1.3307 0.5451 2.324 1.6212 3.0676 0.5134 0.35486 2.6878-0.0135 3.1653-0.48561l2.1988-2.1738s1.7279 1.5571 2.805 1.7351c0.9357 0.15459 1.9134 0.0239 2.7496-0.50628 1.0903-0.69134 1.3413-1.0781 1.7266-2.2652 0.2301-0.7089 0.1146-2.4282 0.1146-2.4282s1.5522 0.13817 2.3339-0.23525c1.4167-0.67664 2.7582-1.893 2.7948-3.3772 0.029-1.159-2.0052-2.6185-2.9 [...]
+ <path id="path13429-5-2-7-75-31-4-7-3-0" d="m1718.9 345.3c4.9664-4.2807 12.049-12.234 18.047-12.323l1.9985-0.0296c5.3694-0.0796 16.155-0.67013 20.849-2.7336l1.793-0.78809c0.3324-3.0374 1.2286-3.981 1.867-4.0604 1.4062-0.17503 1.9467 0.50157 1.8334 2.3437 1.4781-0.0573 3.0341 0.97076 6.0744-1.3335-0.6949 1.9548-0.7693 2.7436-0.4896 4.3733 0.9369-1.1634 2.406-1.6719 4.4911-2.4159-0.5807 1.833-0.2601 3.0409-0.1031 4.1972 1.0776-0.94307 2.1151-1.3095 4.4473-2.4251-0.8086 1.3992-1.52 [...]
+ <path id="path5465-77-6-2-2-3-0" d="m1661.3 403.61s4.7028 2.7585 6.428 3.0031c2.1185 0.3004 6.0605-2.1152 6.0605-2.1152s3.3171-7.0289 5.5315-10.2c1.8042-2.5839 4.1264-4.7654 6.2499-7.0942 0.6823-0.74828 2.0852-2.2096 2.0852-2.2096s1.8872-3.854 0.8232-5.158c-1.0093-1.2371 0.3046-2.0339 0.3046-2.0339l-3.281 6.7888-5.7623 5.9782-4.4335 6.32-2.7908 5.9776-5.4223 1.5242-3.6019-1.6764-2.1911 0.89557z" fill="#e4c900"/>
+ <path id="path4314-33-7-3-6-0-6" d="m1758.1 333.57c-11.516 9.2974-15.138-2.7981-31.357 6.2022 17.202-1.9688 21.487 6.188 31.357-6.2022z" fill="#fff1a1"/>
+ <path id="path4316-8-03-2-6-8-70" d="m1762.7 333.66c6.2669 2.4714 10.45 2.5121 15.336 2.4574-5.7375-2.8464-9.2664-3.8956-15.336-2.4574z" fill="#fff1a1"/>
+ <path id="path4316-0-0-0-4-7-7-7" d="m1687.7 391.38c-7.0854 4.1883-9.1338 9.8179-12.516 16.749 7.0721-4.5877 9.7024-9.3569 12.516-16.749z" fill="#ffefa7"/>
+ <path id="path17980-3" d="m1737.5 329.84 3.443-2.7388 1.3303-2.1128-0.2348-1.9562-1.7215-1.7215-2.2692-0.313-4.8515 1.3302-1.6433 2.0345v1.4085l2.8953 2.191-1.9563 0.7825-2.4258-0.313-2.8952-2.9735v2.4258l1.878 2.9735h-3.0518l-2.6605-1.7998-1.565-1.7997-0.4695 2.504 1.565 3.13-3.5212-0.7825-3.1301-3.0518-2.817 0.8608-2.2692 0.1565-2.5823-1.1738-1.0172-1.878 0.313-4.069 1.878-2.4257s-1.113 3.2808-0.8608 4.9297c0.1376 0.8995 0.5058 1.905 1.252 2.4258 0.6898 0.4814 1.6629 0.5531 2. [...]
+ <path id="path17982-3" d="m1717.2 321.41h2.5109l3.4908-3.7971h0.6737l0.7349 2.0823 0.9187-1.9598-0.3675-1.8373-0.8574-0.6736h2.6334l2.8172-0.7349s2.2171-1.0851 3.1846-1.8373c0.8776-0.6823 2.3273-2.3885 2.3273-2.3885l0.3062-2.3272-1.2861-2.8172s0.508 2.7819-0.061 3.9808c-0.6522 1.3743-2.1656 2.1927-3.4908 2.9396-1.1642 0.6561-2.4979 0.9733-3.7971 1.2861-2.0461 0.4927-6.2467 0.9187-6.2467 0.9187l2.1435 1.5311s-1.8066-0.1253-2.511 0.6736c-0.6233 0.7071-0.34 1.8189-0.9799 2.511-0.42 [...]
+ <path id="path17984-2" d="m1709.4 321.77s4.0068-2.918 6.0419-4.332c1.9561-1.3591 3.7561-2.556 5.928-3.5339 1.9329-0.8703 4.1876-1.265 6.1559-2.052 1.0898-0.4358 3.078-1.71 3.078-1.71v-2.052l-1.71-1.026 0.228 1.824-1.368 2.052-3.534 0.456-4.5599 1.596-5.928 3.8759-4.3319 4.902z" fill="#fff1a1"/>
+ <path id="path13429-5-2-95-17-3-3-2-1" d="m1733.9 322.21c1.175-0.46383 2.1981-0.78907 2.9417-0.91827 1.5621-0.27142 3.0512-0.39449 4.2543 0.63814 0.8253 0.70828 1.1505 2.0003 1.0635 3.0844-0.09 1.1225-1.6546 2.5962-2.4636 3.3796-1.0551 1.0216-3.9489 1.9542-3.9489 1.9542-1.8007 0.48236-1.7691 0.22315-5.1253 2.273-3.3562 2.0499-3.6126 3.0879-6.6215 5.6162-5.9728 5.0189-18.053 16.263-18.053 16.263l-7.6962 6.0773c-3.5412 4.2362-8.0986 0.83488-12.217 22.99 0 0-5.2018 5.0858-6.8135 7. [...]
+ <path id="path4318-89-91-6-5-7-4" d="m1771.8 349.96c0.7369-1.0584 1.7658-1.2944 2.8024-0.69992 0.5152 0.29547 0.8399 0.89199 0.7901 1.8798-1.7528 1.1962-2.2392 1.8802-2.555 4.1635-1.9167-3.1632-0.8441-4.3607-1.0375-5.3434z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-1-6-4-8-17-4-0" d="m1780.8 349.47c0.2205-1.2707 1.0533-1.9194 2.244-1.8186 0.5918 0.05 1.1382 0.45347 1.5105 1.3698-1.083 1.8249-1.2349 2.6504-0.5561 4.8531-3.074-2.0568-2.6079-3.5955-3.1984-4.4043z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-8-04-1-1-1-5-08" d="m1787.4 344.17c-0.1185-1.2842 0.5163-2.1277 1.692-2.341 0.5844-0.10605 1.217 0.14089 1.8155 0.92839-0.5695 2.0442-0.5008 2.8807 0.729 4.8302-3.504-1.1838-3.4554-2.7908-4.2365-3.4176z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-80-23-4-0-8-9-73" d="m1660.1 403.69c1.2724-0.2102 2.1592 0.36252 2.4561 1.52 0.1477 0.57525-0.053 1.224-0.7959 1.8773-2.0798-0.4216-2.9092-0.29312-4.7656 1.0732 0.9298-3.5798 2.5361-3.6465 3.1053-4.4705l0.0001-0.0001z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-1-4-37-6-6-4-7-8" d="m1659.6 413.05c1.0856-0.69625 2.1266-0.52092 2.8571 0.42467 0.363 0.47005 0.4351 1.1453 0.011 2.0391-2.077 0.43526-2.7879 0.88126-3.9527 2.8704-0.5617-3.6557 0.8873-4.3522 1.0842-5.3341z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ <path id="path4318-8-6-0-1-0-0-5-45" d="m1668.4 418.02c0.617-1.1325 1.6141-1.4793 2.7093-1.0015 0.5444 0.23753 0.9322 0.79504 0.9904 1.7824-1.6117 1.3803-2.0207 2.1133-2.0854 4.4173-2.2504-2.9352-1.3148-4.2426-1.6143-5.1982z" stroke="#2c5aa0" stroke-width="1px" fill="#377bc8"/>
+ </g>
+ <g id="g4338-8-1-0-2-2-5-4-4-29" transform="matrix(.96160 .27445 -.27445 .96160 1012.6 372.95)">
+ <path id="path14997-8-0-1-79-2-8-3-77-0-1-8-2-2-8-5-0" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725 [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-0-4-3-9-2-6-0-3-8-9" d="m644.79-216.04c-0.28315 0.81131-1.5511 5.1996-2.249 6.0725-1.0381 1.2984-2.1027 1.6494-2.1027 1.6494 1.1459 1.523 1.525 2.1719 4.1235 1.788-4.5382 5.7247-3.3209 12.444 2.6495 16.759 0.0948-0.74991 0.63997-2.5469 1.0516-3.2948-0.0753-0.0307 0.9917 3.1956 3.0952 4.3932 0.68254 0.38858 1.7964 3.317 2.8296 4.0431 0.94251 0.66246 2.1886 1.3199 2.1886 1.3199s0.08-2.5975 1.0879-3.2864c1.015-0.6938 2.9388-1.8908 3.5677-2.306 1 [...]
+ <g id="g4307-4-0-4-4-7-1-9-7-8" transform="translate(0 -.75004)">
+ <path id="path5211-9-03-5-8-6-1-2-9-0" fill="#504416" d="m650.46-210.73c0.94 2.0538 1.1251 6.5986 0.64531 7.9898l5.4395 0.56423 4.9754-0.81907c-0.95614-1.8603-0.12607-6.2653 0.46147-7.8504l-3.5184 1.0866-2.0313-1.1285-2.7083 1.467-3.2636-1.3097z"/>
+ <g id="g4139-1-8-9-3-1-2-3-5-5" fill="#fff">
+ <path id="path5213-9-7-5-3-3-5-2-4-0-9-3" d="m652.03-201.5c0.0211-2.4912 0.50919-2.8128 0.88867-3.6914l0.54687 3.4179-1.4355 0.27343z"/>
+ <path id="path5213-9-7-9-5-60-9-0-1-5-9-6-5" d="m660.45-201.5c-0.0211-2.4912-0.50919-2.8128-0.88867-3.6914l-0.54687 3.4179 1.4355 0.27343z"/>
+ </g>
+ <path id="path5160-2-5-4-6-0-3-5-2-6-5" d="m651.36-202.73c-0.81165 7.0872 10.243 7.3994 9.7355 0-2.7762 0.58616-5.7673 0.90381-9.7355 0z" fill="#e4c900"/>
+ <path id="path5160-2-3-8-0-6-6-6-2-7-8-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m650.93-203.3-0.0625 0.5625c-0.21756 1.8997 0.38656 3.4223 1.4062 4.4375 1.0197 1.0152 2.4282 1.51 3.8438 1.5312 1.4155 0.0213 2.8459-0.43482 3.9062-1.4375s1.6979-2.558 1.5625-4.5312l-0.0312-0.5625-0.5625 0.125c-2.741 0.57871-5.6408 0.8861-9.5312 0l-0.53125-0.125h-0.00005zm0.96875 1.1562c3.3974 0.66907 6.1564 0.50399 8.625 0.0312-0.0319 1.4052-0.44577 2.4861 [...]
+ <path id="path5010-2-2-9-4-7-5-3-2-5-51" d="m653.95-209.47c-0.0725 4.5313 0.1742 9.5588 2.2688 13.657 2.0946-4.0979 2.3412-9.082 2.2688-13.613-0.0432-0.17139-0.98524-0.30903-1.1301-0.41285-0.35601-0.25521-1.0222-0.90865-1.0222-0.90865s-0.69131 0.7735-1.1358 1.0222c-0.37899 0.21208-1.2494 0.25591-1.2494 0.25591z" stroke="#2c5aa0" fill="#377bc8"/>
+ <g id="g5237-9-2-0-07-7-2-2-2-16" transform="translate(-14.216 -5.3362)" fill="#fff">
+ <path id="path5213-8-49-8-3-3-3-7-8-1" d="m665.98-204.45c0.0211 2.4912 0.50919 2.8128 0.88867 3.6914l0.54687-3.4179-1.4355-0.27343z"/>
+ <path id="path5213-9-2-2-2-3-6-1-9-3-9" d="m674.88-204.45c-0.0211 2.4912-0.50919 2.8128-0.88867 3.6914l-0.54687-3.4179 1.4355-0.27343z"/>
+ </g>
+ <g id="g5011-07-9-0-2-3-1-3-9-3" transform="translate(-14.133 -5.3362)">
+ <path id="path4962-4-1-6-14-2-9-0-3-47" d="m668.94-212.14s0.8411 0.79935 1.375 0.825c0.53241 0.0256 1.4437-0.6875 1.4437-0.6875l-1.5125-4.0562-1.3062 3.9187z" fill="#ffefa7"/>
+ <g id="g4892-8-0-0-0-5-8-9-3-9" transform="translate(-.11475)">
+ <g id="g4855-5-9-7-08-0-0-0-3-8" transform="translate(0 .064716)">
+ <path id="path4045-83-3-2-73-3-9-1-9-0" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-06-00-9-8-7-5-5-1-7" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-2-3-8-4-3-2-8-4-58" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0 [...]
+ </g>
+ <g id="g4855-3-2-01-1-52-5-4-2-4-4" transform="matrix(-1 0 0 1 1340.9 .064716)">
+ <path id="path4045-9-52-9-1-9-9-2-5-5-2" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-0-2-86-6-0-1-3-0-2-50" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-5-7-9-1-98-8-5-2-6-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 [...]
+ </g>
+ </g>
+ <path id="path4902-1-0-1-0-4-8-8-9-0" d="m661.12-211.22 0.2189 1.9505 0.63079 0.57371c-1.4494-0.21083 1.916 0.48806 2.6167 0.63557l0.11062 2.2124 1.4934 1.8252 2.3783 0.22124 1.8805-1.2168 1.604 1.2721 2.1571-0.11062 2.2124-1.9911v-2.323l2.0193-0.1559 1.1334-1.0056v-1.7699c-0.97175 1.2236-1.9336 2.4242-4.7013 2.1018 0.30303 1.3307 0.21514 2.2357-0.10593 2.8294-0.38328 0.70879-1.0988 0.97406-1.8783 0.99065-0.97223 0.0207-2.0383-0.78084-2.5511-1.2205-0.74162 0.79142-1.3904 1.416 [...]
+ <path id="path4402-2-5-1-8-53-0-4-3-5-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m661.06-211.69c-0.48492 1.2877-0.28378 2.4598 0.42441 3.2089 0.59079 0.6249 1.4921 0.86991 2.474 0.91092-0.0108 0.15882-0.018 0.18577-0.0207 0.41406-0.006 0.49673 0.005 1.0718 0.20702 1.5734 0.41453 1.0274 1.2478 1.7102 2.1945 2.1427 0.82617 0.37748 1.7898 0.3611 2.6086 0.0828 0.50449-0.17148 0.90215-0.49664 1.2111-0.78671 0.11015-0.10341 0.11986-0.12422 0.2 [...]
+ <g id="g4958-2-64-1-5-8-5-9-0-6" transform="translate(-.0084986)" fill="#ffefa7">
+ <path id="path4904-1-4-1-54-9-1-9-3-82" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-265.65 -796.35)"/>
+ <path id="path4904-2-1-8-5-5-5-1-3-0-3" d="m935.11 589.08c0 0.87094-0.72045 1.577-1.6092 1.577-0.88872 0-1.6092-0.70603-1.6092-1.577 0-0.87094 0.72044-1.577 1.6092-1.577 0.88871 0 1.6092 0.70604 1.6092 1.577z" transform="translate(-260.64 -796.35)"/>
+ </g>
+ <path id="path4928-0-6-0-1-8-0-0-2-9" d="m667.32-209.87s1.8744-0.9079 2.8875-0.9625c1.0772-0.0581 3.1625 0.6875 3.1625 0.6875v1.0312l-2.6125 1.5125-2.4062-1.2375-0.61875-0.1375-0.4125-0.89374z" fill="#e4c900"/>
+ <path id="path4930-1-14-0-1-2-4-1-8-0" d="m663.05-216.43c-0.68077 0.0986-1.4372 0.43559-1.7812 1.0312-0.20631 0.3572 0 1.25 0 1.25l1.0312-0.28125h1.25l2.8125 0.40625 2.6875-0.9375s-1.6672-0.18486-2.5155-0.38981c-1.1454-0.27675-2.3184-1.2479-3.4845-1.0789zm14.156 0c-1.0124 0.0279-1.9507 0.83678-2.953 1.0789-0.84823 0.20495-2.5783 0.38981-2.5783 0.38981l2.6875 0.9375 2.8125-0.40625h1.2188l1.0312 0.28125s0.20631-0.8928 0-1.25c-0.34403-0.59566-1.1005-0.93263-1.7812-1.0312-0.14577- [...]
+ <path id="path3477-9-0-5-8-0-8-6-3-1-5-3-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m669.17-215.78-0.50722 0.23808s-1.7236 0.79174-3.2814 0.78671c-0.63267-0.002-1.5924-0.38405-2.4947-0.46582-0.45115-0.0409-0.94895 0.004-1.3353 0.35195-0.38639 0.34805-0.55842 0.90541-0.55898 1.6252 0.52653-0.24596 0.82663-0.54771 1.2215-0.87987 0.0934-0.0842 0.25887-0.13259 0.57969-0.10351 0.64162 0.0581 1.6283 0.47305 2.5878 0.47616 1.3739 0.004 2.4581-0 [...]
+ </g>
+ </g>
+ <path id="path14997-8-0-1-79-2-8-3-7-7-76-8-3-1-2-6-2-1-8" d="m665.95-223.26s-0.49091-1.4887-1.2937-2.7471c-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.53725-1.2864-0.70266-1.2864-0.70266 0.20494 0.78744-0.2941 1.7027-0.49785 2.3509 0 0-1.1545-2.9101-2.2123-3.7701-0.81594-0.66339-2.7302-1.3104-2.7174-1.3103 0.0129 0.00039-1.7876 0.62325-2.612 1.2761-1.0688 0.84639-2.2606 3.7414-2.2606 3.7414-0.19541-0.65083-0.6826-1.5724-0.46754-2.3572 0 0-0.59719 0.15772-1.2953 0.6860 [...]
+ <path id="path14997-8-0-1-79-2-8-3-7-00-1-7-9-6-1-7-7-3" d="m667.65-206.38c2.1742 0.62169 3.7723-1.4622 4.1461-1.7349 0 0-1.06-0.36458-2.0813-1.6762-0.6866-0.8818-1.3284-2.6031-1.6011-3.418-1.0131-3.0268 0.0744-3.8515 0.18043-3.6308 0 0 1.8327-1.2762 2.49-2.1656 0.62328-0.84221 0.68772-2.0142 0.62753-3.0596-0.0903-1.5681-1.2892-3.5677-1.2892-3.5677-3.0005 0.67188-3.6395 1.2768-4.073 2.3777 0 0-0.49091-1.4887-1.2937-2.7471-0.40014-0.62724-1.1636-1.5132-1.8362-2.0359-0.69126-0.537 [...]
+ <g id="g5134-9-0-0-34-6-4-3-8-1" transform="translate(-14.275 -5.3362)" fill="#806600">
+ <path id="path5110-5-3-1-7-6-5-9-6-0" d="m657.2-218.43s1.8048 0.59598 2.1668 1.4196c0.49367 1.123 0.37359 4.5578 0.37359 4.5578s-2.2734-1.6935-2.6898-2.6151c-0.52396-1.1595 0.14943-3.3623 0.14943-3.3623z"/>
+ <path id="path5110-9-6-11-3-9-3-2-6-8-0" d="m683.59-218.43s-1.8048 0.59598-2.1668 1.4196c-0.49367 1.123-0.37359 4.5578-0.37359 4.5578s2.2734-1.6935 2.6898-2.6151c0.52396-1.1595-0.14943-3.3623-0.14943-3.3623z"/>
+ </g>
+ <path id="path5269-2-50-4-8-4-3-4-6-8" d="m650.51-207.52c-3.467 0.6834-6.1184 6.1246-4.6204 11.221 1.4267-3.9078 5.3052-9.0696 4.6204-11.221z" fill="#fff1a1"/>
+ <path id="path5269-9-85-8-3-0-4-3-9-7-0" d="m662.74-206.29c2.4916 0.19567 4.4704 4.4054 3.6724 9.8517-0.58652-3.9078-3.5124-7.7004-3.6724-9.8517z" fill="#fff1a1"/>
+ <path id="path5293-9-4-7-7-2-6-2-4-4" d="m650.99-199.18s-0.36334 2.0037-0.00035 3.4397c0.2429 0.9609 0.55598 1.9515 1.1586 2.7384 0.62338 0.8141 3.4062 1.8958 3.4062 1.8958l-0.003 2.3214s2.1544-1.7637 2.4258-2.7394c0.20719-0.74489 0.63526-3.6925 0.63526-3.6925l-2.0045 2.7412s-3.187-1.3138-3.9329-2.3171c-1.1474-1.5434-1.6848-4.3876-1.6848-4.3876z" fill="#fff1a1"/>
+ <path id="path5295-43-9-7-5-9-8-3-0-7" d="m647.59-222.28s-0.13419-0.75608 1.549-1.5407c1.7741-0.82701 5.4036-1.6857 6.7715-1.7243 1.6398-0.0462 5.2361 0.84692 7.1211 1.7688 1.5851 0.77521 1.6207 1.6016 1.6207 1.6016-2.9139-0.49181-5.8279-0.17447-8.7418 0.73726-2.4153-1.1166-5.0664-1.6831-8.3205-0.84258z" fill="#ffefa7"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g44060-6" transform="translate(32.414 507.38)">
+ <path id="path7014-6-7-0-4-1" d="m1851.5-36.259c0.6676 73.546 0.7227 147.11-0.2154 220.65l-202.83-0.16578 0.0001-220.49h203.04z" fill="#fee46e"/>
+ <g id="g42670-9-6" transform="translate(1659.3 -342)">
+ <g id="g40782-4-14" transform="translate(.042043 -.49650)" stroke="#800000" fill="#e94545">
+ <g id="g40778-3-9" transform="translate(-1.5888e-8 1.4618)">
+ <path id="path39862-0-2-32-3-6" d="m5.2723 409.86c-2.0633-0.86423-5.3536-2.5883-5.3536-2.5883 0.5906 2.3237 0.8218 3.7301 2.7545 5.2151-3.1986-0.28639-5.0219 1.8859-6.2543 2.6208 1.2324 0.7348 3.0557 2.9071 6.2543 2.6207-1.9327 1.4849-2.1639 2.8914-2.7545 5.2151 0 0 3.3006-1.699 5.3536-2.5883 1.1512-0.49865 3.2687-1.2218 3.2687-1.2218v-8.0514c-1.1064-0.36196-2.1959-0.77245-3.2687-1.2218z"/>
+ <path id="path39862-0-2-32-5-0-4" d="m176.5 409.86c2.0633-0.86423 5.3536-2.5883 5.3536-2.5883-0.5906 2.3237-0.8218 3.7301-2.7545 5.2151 3.1986-0.28639 5.0219 1.8859 6.2543 2.6208-1.2324 0.7348-3.0557 2.9071-6.2543 2.6207 1.9327 1.4849 2.1639 2.8914 2.7545 5.2151 0 0-3.3006-1.699-5.3536-2.5883-1.1512-0.49865-3.2687-1.2218-3.2687-1.2218v-8.0514c1.1064-0.36196 2.1959-0.77245 3.2687-1.2218z"/>
+ </g>
+ <g id="g40694-9-2">
+ <g id="g40690-5-8" transform="translate(-4.7e-7 -.0000024663)">
+ <path id="path39862-0-2-4-4" d="m96.136 322.93c0.86423-2.0633 2.5883-5.3536 2.5883-5.3536-2.3237 0.5906-3.7301 0.8218-5.2151 2.7545 0.28639-3.1986-1.8859-5.0219-2.6208-6.2543-0.7348 1.2324-2.9071 3.0557-2.6207 6.2543-1.4849-1.9327-2.8914-2.1639-5.2151-2.7545 0 0 1.699 3.3006 2.5883 5.3536 0.49865 1.1512 1.2218 3.2687 1.2218 3.2687h8.0514c0.36196-1.1064 0.77245-2.1959 1.2218-3.2687z"/>
+ <path id="path39862-0-2-3-4-49" d="m96.136 510.21c0.86423 2.0633 2.5883 5.3536 2.5883 5.3536-2.3237-0.5906-3.7301-0.8218-5.2151-2.7545 0.28639 3.1986-1.8859 5.0219-2.6208 6.2543-0.7348-1.2324-2.9071-3.0557-2.6207-6.2543-1.4849 1.9327-2.8914 2.1639-5.2151 2.7545 0 0 1.699-3.3006 2.5883-5.3536 0.49865-1.1512 1.2218-3.2687 1.2218-3.2687h8.0514c0.36196 1.1064 0.77245 2.1959 1.2218 3.2687z"/>
+ </g>
+ <g id="g40085-4-8" transform="translate(0 .30165)">
+ <g id="g39963-5-1" transform="translate(0 .24112)">
+ <g id="g39931-8-0" transform="translate(-.41743)">
+ <path id="path39862-0-3-37" d="m24.195 348.15c0.84789 2.0701 1.9554 5.6158 1.9554 5.6158 1.2255-2.0607 2.0565-3.2187 1.7399-5.6353 2.0592 2.4643 4.8846 2.2175 6.2756 2.5693-0.35186-1.391-0.10505-4.2164-2.5693-6.2756 2.4166 0.31663 3.5746-0.51439 5.6353-1.7399 0 0-3.5353-1.1325-5.6158-1.9554-1.1666-0.46142-3.1753-1.4474-3.1753-1.4474l-5.828-0.35803 0.13478 6.0512c0.52638 1.0383 1.0066 2.099 1.4474 3.1752z"/>
+ <path id="path39862-0-6-0-4" d="m158.42 348.15c-0.8479 2.0701-1.9554 5.6158-1.9554 5.6158-1.2255-2.0607-2.0565-3.2187-1.7399-5.6353-2.0592 2.4643-4.8846 2.2175-6.2756 2.5693 0.35186-1.391 0.10505-4.2164 2.5693-6.2756-2.4166 0.31663-3.5746-0.51439-5.6353-1.7399 0 0 3.5352-1.1325 5.6158-1.9554 1.1666-0.46142 3.1753-1.4474 3.1753-1.4474l5.828-0.35803-0.13478 6.0512c-0.52639 1.0383-1.0066 2.099-1.4474 3.1752z"/>
+ </g>
+ <g id="g39931-4-5-3" transform="matrix(1 0 0 -1 -.41743 832.05)">
+ <path id="path39862-0-64-5-4" d="m24.195 348.15c0.84789 2.0701 1.9554 5.6158 1.9554 5.6158 1.2255-2.0607 2.0565-3.2187 1.7399-5.6353 2.0592 2.4643 4.8846 2.2175 6.2756 2.5693-0.35186-1.391-0.10505-4.2164-2.5693-6.2756 2.4166 0.31663 3.5746-0.51439 5.6353-1.7399 0 0-3.5353-1.1325-5.6158-1.9554-1.1666-0.46142-3.1753-1.4474-3.1753-1.4474l-5.828-0.35803 0.13478 6.0512c0.52638 1.0383 1.0066 2.099 1.4474 3.1752z"/>
+ <path id="path39862-0-6-4-9-81" d="m158.42 348.15c-0.8479 2.0701-1.9554 5.6158-1.9554 5.6158-1.2255-2.0607-2.0565-3.2187-1.7399-5.6353-2.0592 2.4643-4.8846 2.2175-6.2756 2.5693 0.35186-1.391 0.10505-4.2164 2.5693-6.2756-2.4166 0.31663-3.5746-0.51439-5.6353-1.7399 0 0 3.5352-1.1325 5.6158-1.9554 1.1666-0.46142 3.1753-1.4474 3.1753-1.4474l5.828-0.35803-0.13478 6.0512c-0.52639 1.0383-1.0066 2.099-1.4474 3.1752z"/>
+ </g>
+ </g>
+ <g id="g39812-4-2">
+ <g id="g39644-8-8">
+ <g id="g39580-9-3" transform="translate(-.014509)">
+ <g id="g39422-3-9" transform="matrix(.70711 -.70711 .70711 .70711 -429.6 247.23)">
+ <g id="g39418-36-9">
+ <path id="path39273-3-2-0-96" d="m255.08 367.78c6.1862-2.1012 9.0908-1.6185 10.692-0.17615 0.99953 0.90078 2.0563 2.4172 2.2175 3.97 0.32888 3.1712-0.38587 4.3755 0.92453 6.8579 0.79195 1.5004 2.3125 2.4568 5.2245 2.3649-5.613-3.7927-1.4715-8.1624-2.1997-12.942-0.42253-2.7732-3.3044-5.9876-6.8089-6.1999-2.5521-0.15453-6.503 1.5604-10.05 6.1254z"/>
+ <path id="path39273-3-2-3-26-1" d="m253.32 367.78c-6.1862-2.1012-9.0908-1.6185-10.692-0.17615-0.99953 0.90078-2.0563 2.4172-2.2175 3.97-0.32888 3.1712 0.38587 4.3755-0.92453 6.8579-0.79195 1.5004-2.3125 2.4568-5.2245 2.3649 5.613-3.7927 1.4715-8.1624 2.1997-12.942 0.42253-2.7732 3.3044-5.9876 6.8089-6.1999 2.5521-0.15453 6.503 1.5604 10.05 6.1254z"/>
+ </g>
+ <path id="path34853-2-6-7" d="m253.9 368.4c-3.7027-5.29-4.9245-13.874 0.29815-18.729 5.2227 4.8554 4.0009 13.439 0.29815 18.729h-0.29815l-0.29815 0.00001z"/>
+ </g>
+ <g id="g39422-5-8-3" transform="matrix(-.70711 -.70711 -.70711 .70711 611.41 247.23)">
+ <g id="g39418-9-4-98">
+ <path id="path39273-3-2-4-6-40" d="m255.08 367.78c6.1862-2.1012 9.0908-1.6185 10.692-0.17615 0.99953 0.90078 2.0563 2.4172 2.2175 3.97 0.32888 3.1712-0.38587 4.3755 0.92453 6.8579 0.79195 1.5004 2.3125 2.4568 5.2245 2.3649-5.613-3.7927-1.4715-8.1624-2.1997-12.942-0.42253-2.7732-3.3044-5.9876-6.8089-6.1999-2.5521-0.15453-6.503 1.5604-10.05 6.1254z"/>
+ <path id="path39273-3-2-3-5-4-63" d="m253.32 367.78c-6.1862-2.1012-9.0908-1.6185-10.692-0.17615-0.99953 0.90078-2.0563 2.4172-2.2175 3.97-0.32888 3.1712 0.38587 4.3755-0.92453 6.8579-0.79195 1.5004-2.3125 2.4568-5.2245 2.3649 5.613-3.7927 1.4715-8.1624 2.1997-12.942 0.42253-2.7732 3.3044-5.9876 6.8089-6.1999 2.5521-0.15453 6.503 1.5604 10.05 6.1254z"/>
+ </g>
+ <path id="path34853-2-3-7-4" d="m253.9 368.4c-3.7027-5.29-4.9245-13.874 0.29815-18.729 5.2227 4.8554 4.0009 13.439 0.29815 18.729h-0.29815l-0.29815 0.00001z"/>
+ </g>
+ </g>
+ <g id="g39580-4-4-6" transform="matrix(1 0 0 -1 -.014509 832.53)">
+ <g id="g39422-1-3-97" transform="matrix(.70711 -.70711 .70711 .70711 -429.6 247.23)">
+ <g id="g39418-3-4-4">
+ <path id="path39273-3-2-1-9-94" d="m255.08 367.78c6.1862-2.1012 9.0908-1.6185 10.692-0.17615 0.99953 0.90078 2.0563 2.4172 2.2175 3.97 0.32888 3.1712-0.38587 4.3755 0.92453 6.8579 0.79195 1.5004 2.3125 2.4568 5.2245 2.3649-5.613-3.7927-1.4715-8.1624-2.1997-12.942-0.42253-2.7732-3.3044-5.9876-6.8089-6.1999-2.5521-0.15453-6.503 1.5604-10.05 6.1254z"/>
+ <path id="path39273-3-2-3-2-1-19" d="m253.32 367.78c-6.1862-2.1012-9.0908-1.6185-10.692-0.17615-0.99953 0.90078-2.0563 2.4172-2.2175 3.97-0.32888 3.1712 0.38587 4.3755-0.92453 6.8579-0.79195 1.5004-2.3125 2.4568-5.2245 2.3649 5.613-3.7927 1.4715-8.1624 2.1997-12.942 0.42253-2.7732 3.3044-5.9876 6.8089-6.1999 2.5521-0.15453 6.503 1.5604 10.05 6.1254z"/>
+ </g>
+ <path id="path34853-2-1-6-67" d="m253.9 368.4c-3.7027-5.29-4.9245-13.874 0.29815-18.729 5.2227 4.8554 4.0009 13.439 0.29815 18.729h-0.29815l-0.29815 0.00001z"/>
+ </g>
+ <g id="g39422-5-1-8-09" transform="matrix(-.70711 -.70711 -.70711 .70711 611.41 247.23)">
+ <g id="g39418-9-2-9-7">
+ <path id="path39273-3-2-4-2-2-31" d="m255.08 367.78c6.1862-2.1012 9.0908-1.6185 10.692-0.17615 0.99953 0.90078 2.0563 2.4172 2.2175 3.97 0.32888 3.1712-0.38587 4.3755 0.92453 6.8579 0.79195 1.5004 2.3125 2.4568 5.2245 2.3649-5.613-3.7927-1.4715-8.1624-2.1997-12.942-0.42253-2.7732-3.3044-5.9876-6.8089-6.1999-2.5521-0.15453-6.503 1.5604-10.05 6.1254z"/>
+ <path id="path39273-3-2-3-5-8-7-5" d="m253.32 367.78c-6.1862-2.1012-9.0908-1.6185-10.692-0.17615-0.99953 0.90078-2.0563 2.4172-2.2175 3.97-0.32888 3.1712 0.38587 4.3755-0.92453 6.8579-0.79195 1.5004-2.3125 2.4568-5.2245 2.3649 5.613-3.7927 1.4715-8.1624 2.1997-12.942 0.42253-2.7732 3.3044-5.9876 6.8089-6.1999 2.5521-0.15453 6.503 1.5604 10.05 6.1254z"/>
+ </g>
+ <path id="path34853-2-3-5-2-64" d="m253.9 368.4c-3.7027-5.29-4.9245-13.874 0.29815-18.729 5.2227 4.8554 4.0009 13.439 0.29815 18.729h-0.29815l-0.29815 0.00001z"/>
+ </g>
+ </g>
+ <g id="g33224-2-512" transform="translate(-.049253 .15046)">
+ <path id="rect40980-4-0-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m8.8125 325.94v2.375 175.5 2.375h2.375 159.5 2.375v-2.375-175.5-2.375h-2.375-159.5-2.375zm4.75 4.75h154.75v170.75h-154.75v-170.75z"/>
+ <path id="rect40980-3-8-0-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m18.219 334.97v2.125 157.94 2.1562h2.1562 141.13 2.125v-2.1562-157.94-2.125h-2.125-141.13-2.1562zm4.2812 4.25h136.84v153.69h-136.84v-153.69z"/>
+ </g>
+ </g>
+ <g id="g39754-1-07" transform="translate(5.3e-7 .0848)">
+ <g id="g39507-2-7" transform="matrix(1 0 0 -1 -218.17 720.98)">
+ <g id="g39503-6-9">
+ <path id="path39273-3-2-3-6-1-6" d="m308.45 379.92c-3.641-5.4247-6.2424-6.8041-8.3903-6.6296-1.3411 0.1092-3.1014 0.67287-4.172 1.8092-2.1862 2.3206-2.3491 3.7115-4.8973 4.889-1.5401 0.71171-3.329 0.54892-5.5874-1.2916 6.7628 0.39272 6.1237-5.5938 9.6036-8.9504 2.019-1.9475 6.2604-2.7529 9.1743-0.79443 2.122 1.4262 4.221 5.1872 4.269 10.968z"/>
+ <path id="path39273-3-2-3-6-3-3-01" d="m309.67 379.92c3.641-5.4247 6.2424-6.8041 8.3903-6.6296 1.3411 0.1092 3.1014 0.67287 4.172 1.8092 2.1862 2.3206 2.3491 3.7115 4.8973 4.889 1.5401 0.71171 3.329 0.54892 5.5874-1.2916-6.7628 0.39272-6.1237-5.5938-9.6036-8.9504-2.019-1.9475-6.2604-2.7529-9.1743-0.79443-2.122 1.4262-4.221 5.1872-4.269 10.968z"/>
+ </g>
+ <path id="path34853-2-9-8-2" d="m308.76 380.07c-3.7027-5.29-4.9245-13.874 0.29815-18.729 5.2227 4.8554 4.0009 13.439 0.29815 18.729h-0.29815l-0.29815 0.00001z"/>
+ </g>
+ <g id="g39507-3-3-32" transform="translate(-218.17 111.38)">
+ <g id="g39503-4-4-11">
+ <path id="path39273-3-2-3-6-8-7-01" d="m308.45 379.92c-3.641-5.4247-6.2424-6.8041-8.3903-6.6296-1.3411 0.1092-3.1014 0.67287-4.172 1.8092-2.1862 2.3206-2.3491 3.7115-4.8973 4.889-1.5401 0.71171-3.329 0.54892-5.5874-1.2916 6.7628 0.39272 6.1237-5.5938 9.6036-8.9504 2.019-1.9475 6.2604-2.7529 9.1743-0.79443 2.122 1.4262 4.221 5.1872 4.269 10.968z"/>
+ <path id="path39273-3-2-3-6-3-6-9-3" d="m309.67 379.92c3.641-5.4247 6.2424-6.8041 8.3903-6.6296 1.3411 0.1092 3.1014 0.67287 4.172 1.8092 2.1862 2.3206 2.3491 3.7115 4.8973 4.889 1.5401 0.71171 3.329 0.54892 5.5874-1.2916-6.7628 0.39272-6.1237-5.5938-9.6036-8.9504-2.019-1.9475-6.2604-2.7529-9.1743-0.79443-2.122 1.4262-4.221 5.1872-4.269 10.968z"/>
+ </g>
+ <path id="path34853-2-9-6-9-8" d="m308.76 380.07c-3.7027-5.29-4.9245-13.874 0.29815-18.729 5.2227 4.8554 4.0009 13.439 0.29815 18.729h-0.29815l-0.29815 0.00001z"/>
+ </g>
+ </g>
+ <g id="g39800-1-0" transform="translate(.10214 2.3405)">
+ <g id="g39507-8-5-0" transform="matrix(0 -1 -1 0 403.83 722.98)">
+ <g id="g39503-1-4-94">
+ <path id="path39273-3-2-3-6-7-9-2" d="m308.45 379.92c-3.641-5.4247-6.2424-6.8041-8.3903-6.6296-1.3411 0.1092-3.1014 0.67287-4.172 1.8092-2.1862 2.3206-2.3491 3.7115-4.8973 4.889-1.5401 0.71171-3.329 0.54892-5.5874-1.2916 6.7628 0.39272 6.1237-5.5938 9.6036-8.9504 2.019-1.9475 6.2604-2.7529 9.1743-0.79443 2.122 1.4262 4.221 5.1872 4.269 10.968z"/>
+ <path id="path39273-3-2-3-6-3-69-7-4" d="m309.67 379.92c3.641-5.4247 6.2424-6.8041 8.3903-6.6296 1.3411 0.1092 3.1014 0.67287 4.172 1.8092 2.1862 2.3206 2.3491 3.7115 4.8973 4.889 1.5401 0.71171 3.329 0.54892 5.5874-1.2916-6.7628 0.39272-6.1237-5.5938-9.6036-8.9504-2.019-1.9475-6.2604-2.7529-9.1743-0.79443-2.122 1.4262-4.221 5.1872-4.269 10.968z"/>
+ </g>
+ <path id="path34853-2-9-0-7-0" d="m308.76 380.07c-3.7027-5.29-4.9245-13.874 0.29815-18.729 5.2227 4.8554 4.0009 13.439 0.29815 18.729h-0.29815l-0.29815 0.00001z"/>
+ </g>
+ <g id="g39507-8-0-8-2" transform="matrix(0 -1 1 0 -222.26 722.98)">
+ <g id="g39503-1-8-6-9">
+ <path id="path39273-3-2-3-6-7-5-1-79" d="m308.45 379.92c-3.641-5.4247-6.2424-6.8041-8.3903-6.6296-1.3411 0.1092-3.1014 0.67287-4.172 1.8092-2.1862 2.3206-2.3491 3.7115-4.8973 4.889-1.5401 0.71171-3.329 0.54892-5.5874-1.2916 6.7628 0.39272 6.1237-5.5938 9.6036-8.9504 2.019-1.9475 6.2604-2.7529 9.1743-0.79443 2.122 1.4262 4.221 5.1872 4.269 10.968z"/>
+ <path id="path39273-3-2-3-6-3-69-2-3-22" d="m309.67 379.92c3.641-5.4247 6.2424-6.8041 8.3903-6.6296 1.3411 0.1092 3.1014 0.67287 4.172 1.8092 2.1862 2.3206 2.3491 3.7115 4.8973 4.889 1.5401 0.71171 3.329 0.54892 5.5874-1.2916-6.7628 0.39272-6.1237-5.5938-9.6036-8.9504-2.019-1.9475-6.2604-2.7529-9.1743-0.79443-2.122 1.4262-4.221 5.1872-4.269 10.968z"/>
+ </g>
+ <path id="path34853-2-9-0-3-1-31" d="m308.76 380.07c-3.7027-5.29-4.9245-13.874 0.29815-18.729 5.2227 4.8554 4.0009 13.439 0.29815 18.729h-0.29815l-0.29815 0.00001z"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g42615-3-32" transform="translate(.0000046180 .0000012058)">
+ <g id="g42259-2-16" transform="matrix(.98934 -.14561 .14561 .98934 -621.96 106.05)">
+ <path id="path42187-6-8" d="m889.96 1223.9 1.4502 5.5549s3.6261 0.092 5.4594-0.1852c2.5065-0.3797 6.5624-2.0582 6.5624-2.0582 1.8178-0.6703-1.5383-3.9206-2.6398-5.5583-0.84957-1.2632-1.3275-2.8067-1.3275-2.8067-0.76045-1.7824 3.1292-3.776 5.9232-5.0903 3.5793-1.6838 7.6578-3.1834 11.166-3.3049 5.9754-0.2069 20.031 0.1611 20.031 0.1611l0.64022 5.3497-4.2991 7.0608-5.2625 2.6313c0.75502 1.1899-6.984-0.5737-12.971-1.6587-1.9179-0.3475-0.47759 5.7518-0.47759 5.7518s1.3316 1.3591 1.7 [...]
+ <path id="path42189-8-10" d="m927.45 1223-0.82074-3.5566c-0.27069-1.173 2.133-1.6701 2.1886-2.8726 0.0597-1.2891-0.44306-2.6705-1.4968-3.4155-1.373-0.9708-8.0413-0.5119-9.7228-0.5151-2.5668 0-5.1093 0.7696-7.5235 1.6415-2.6086 0.9421-7.3867 3.8301-7.3867 3.8301s0.0917 1.5702 0.39546 2.2788c1.0588 2.4701 3.7869 3.8282 3.326 6.4759-0.28193 1.6197-1.463 2.1087-2.6271 2.7358-2.4882 1.3403-4.8386 1.6183-7.6603 1.7783-2.0986 0.119-5.6084-0.5472-5.6084-0.5472s-0.6941-4.059-1.7783-5.745 [...]
+ <path id="path42191-5-6" d="m918.68 1213.9s-4.2811 0.1967-6.2902 0.8116c-3.0726 0.9404-8.3194 4.4641-8.3194 4.4641l3.0437 5.783-0.81164-5.3772s3.7509-1.4189 5.4786-2.232c2.5867-1.2174 6.899-3.4495 6.899-3.4495z" transform="translate(-265.27 -795.88)" fill="#ee6c6c"/>
+ <path id="path4318-6-3-4-6-98-1-7-3-5-9-04" d="m615.11 428.41c1.0544 0.41742 1.5109 1.2758 1.29 2.3254-0.10976 0.52169-0.51462 0.94153-1.3354 1.1167-1.4272-1.286-2.1113-1.5648-4.0598-1.3375 2.0968-2.399 3.351-1.7153 4.1052-2.1046z" stroke="#2c5aa0" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-98-1-7-3-5-1-96-9" d="m613.76 436.41c1.128-0.11743 1.9296 0.43267 2.219 1.4654 0.14389 0.51333-0.021 1.0728-0.66776 1.6076-1.8602-0.4804-2.5956-0.41131-4.2182 0.69123 0.75-3.0966 2.1782-3.0703 2.6669-3.7643z" stroke="#2c5aa0" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-98-1-7-3-5-1-9-9-9" d="m623.19 426.01c0.51979 1.0079 0.29905 1.9547-0.5576 2.6001-0.4258 0.3208-1.0069 0.37077-1.7404-0.0371-0.22934-1.9074-0.56128-2.5673-2.1786-3.6776 3.1573-0.4281 3.6524 0.91173 4.4766 1.1145z" stroke="#2c5aa0" fill="#377bc8"/>
+ </g>
+ <g id="g5915-74-6-4-4" transform="matrix(.83003 .18283 -.16789 .90389 -336.85 485.37)" stroke-width="1.1316">
+ <g id="g5810-4-2-0-5">
+ <path id="path13429-8-0-9-5-5-0" d="m469.89-189.44s-3.2133-0.0251-4.5-0.77844c-1.3993-0.81931-2.8976-3.7155-2.8976-3.7155s-3.5428 0.5752-5.1716 0.2223c-1.7019-0.36873-4.1377-2.3153-4.1377-2.3153 1.627-0.24015 2.8421-0.48567 4.4175-1.7601 0 0-3.1362-0.16604-4.9224-0.8537-1.5552-0.5987-4.0928-2.5827-4.0928-2.5827 1.4501-0.35994 3.0179-0.31529 4.1601-1.7326 0 0-3.0716 0.0277-4.4633-0.48078-1.3892-0.50759-3.5951-2.4616-3.5951-2.4616 1.688-0.14653 3.2936-0.45961 4.379-1.8238 0 0-3.1 [...]
+ <path id="path5784-15-1-2-6" d="m728.67 600.09s2.1432 3.009 3.3436 3.5824c1.1493 0.5491 3.3436 0 3.3436 0l-0.71649-1.5524h-0.95532c-2.4926-2.9952-4.6214-6.5155-3.9407-10.509 0 0-2.8306-3.1395-4.5378-4.6572-2.2446-1.9955-8.2396-6.4484-8.2396-6.4484s-1.3723-3.3274-1.5524-5.6125c-0.0797-1.0117 0.13035-2.0842 0.59708-2.9854 0.47913-0.92508 1.885-1.2612 2.1495-2.2689 0.0833-0.31749-0.0277-0.70401-0.23883-0.95532-0.25219-0.30015-0.68338-0.5007-1.0747-0.47766-1.4788 0.087-3.8213 2.268 [...]
+ <path id="path4316-0-8-5-4-4-9" d="m463.96-201.37c-3.5701-7.4161-9.7625-11.437-16.381-15.396 5.1619 7.1956 10.969 11.617 16.381 15.396z" fill="#ee6c6c"/>
+ </g>
+ <path id="path4318-6-3-4-5-9-8-08" d="m453.42-228.71c0.26597 1.262-0.26713 2.173-1.4104 2.5208-0.56821 0.17286-1.2252 0.00058-1.9105-0.71256 0.32966-2.0963 0.16478-2.9193-1.2819-4.7137 3.6173 0.77133 3.7546 2.3731 4.6028 2.9055z" stroke="#2c5aa0" fill="#377bc8"/>
+ <path id="path4318-6-3-4-0-82-1-1-8" d="m443.34-229.69c0.76473 1.0385 0.65682 2.0886-0.23976 2.8785-0.4456 0.39266-1.1149 0.50793-2.0341 0.14266-0.56811-2.0446-1.059-2.7254-3.119-3.7595 3.6119-0.79601 4.4003 0.60505 5.3928 0.73838z" stroke="#2c5aa0" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-98-1-6-2" d="m437.61-222.55c1.1281 0.62511 1.4678 1.6245 0.98223 2.7163-0.24131 0.54269-0.80162 0.92653-1.7894 0.97776-1.3688-1.6215-2.0989-2.0357-4.4024-2.1168 2.9511-2.2295 4.2518-1.2847 5.2096-1.5773z" stroke="#2c5aa0" fill="#377bc8"/>
+ </g>
+ <g id="g42169-4-8" transform="translate(-561.88 2.1085)">
+ <path id="path5636-6-8-0-0" d="m667.08 427.24s-3.2166 1.8764-5.272 0.99331c-0.8851-0.38027-1.7193-1.1993-1.9476-2.1352-0.22118-0.90663 0.18892-1.9391 0.72223-2.7049 0.34141-0.49028 2.8863-2.0434 2.8863-2.0434s-0.68653-2.3112-1.508-3.647c-1.2093-1.9664-7.1013-3.9984-7.1013-3.9984 2.3977-0.75205 5.1919-0.84469 8.0192-0.17473l4.7832 5.8375-0.58196 7.8728z" stroke="#800000" fill="#e94545"/>
+ <path id="path41368-3-2" d="m667.44 465.62s1.0381-0.2511 1.4518 0c1.0596 0.6433 2.7716 2.2436 2.7716 2.2436s0.41958-1.9701-0.0496-3.5386c-0.27762-0.9282-1.8558-2.2188-1.8558-2.2188s2.033-0.538 2.9612 0.1319c0.91432 0.66 2.0621 2.9531 2.0621 2.9531s0.43407-2.5187 0.13198-4.0913c-0.23075-1.2012-2.2436-2.9036-2.2436-2.9036s1.6585-0.3359 2.3756 0c1.2446 0.583 2.6396 3.1675 2.6396 3.1675s1.0476-3.3947 0.26396-5.2791c-0.36153-0.8693-2.2436-1.7158-2.2436-1.7158s2.5932-0.6852 3.5634 0c1 [...]
+ <path id="path41979-4-09" d="m916.72 1200.8s0.77257-2.3241 0.42747-3.4198c-0.44703-1.4194-2.3317-1.9796-2.9923-3.313-0.25741-0.5196-0.3206-1.7098-0.3206-1.7098s-1.4192 0.9918-2.2442 1.0686c-1.2475 0.1161-2.382-0.9032-3.6335-0.9618-1.0822-0.051-3.2061 0.5344-3.2061 0.5344s-6.9496-1.2768-9.725-1.6031c-4.2492-0.4995-11.969 0-11.969 0l-2.0305-5.5571s-0.0101-0.9115-0.53434-1.2825c-0.37805-0.2674-1.0677-0.3332-1.3893 0-0.69303 0.7183 0 3.0992 0 3.0992s-2.6438-0.9658-3.9541-0.3206c-0.5 [...]
+ <path id="path4316-0-8-5-4-3-4-5" d="m640.98 398.36c-6.8831-2.1753-13.382-2.7929-20.121-2.2811 7.7824 2.0904 14.278 2.6622 20.121 2.2811z" fill="#ee6c6c"/>
+ <path id="path42069-3-3" d="m936.71 1247.4s-0.90764-2.6311-1.7656-3.6916c-2.5913-3.2031-7.8117-4.4889-9.6303-8.1858-0.66122-1.3442-0.58558-2.4156-0.1605-3.8521 0.66954-2.2626 2.4452-4.0445 3.8521-5.9387 1.6298-2.1942 4.4712-3.654 5.2966-6.2596 0.73-2.3042 0.31359-5.0026-0.64202-7.2228-0.73425-1.7059-2.1989-3.0681-3.6916-4.1731-2.694-1.9943-6.663-1.9245-9.1488-4.1731-0.55122-0.4986-1.1235-1.9261-1.1235-1.9261s7.0186-1.7283 9.4698-4.0126c0.68355-0.637 1.1235-1.926 1.1235-1.926l3.6 [...]
+ <path id="path42097-9-5" d="m966.9 1198.1s-1.5875-2.6469-2.9138-3.2376c-1.2816-0.5708-1.917-0.3119-3.2376 0.1619-1.1185 0.4013-2.2286 1.1994-2.7519 2.2663-0.78462 1.5994-0.66021 3.4625-1.1332 5.1801-0.58994 2.1425-3.2376 5.8277-3.2376 5.8277l-2.2663-3.3995 0.27123 0.3084-2.0583-5.6032v-4.0023l1.4866-5.9463 1.4866-5.4889v-2.8588l-1.2579-3.5449-2.9731-3.2018 4.5741 0.9148 3.3162 2.8588-1.1435-4.1167-2.0583-4.4597 4.6884 2.7445 4.231 5.7175 0.91481 5.2602-1.7153 6.175-2.5157 3.5449 [...]
+ <path id="path42114-7-9" d="m950.72 1174.5s2.5622 1.7788 3.3162 3.0875c1.1124 1.9309 1.5554 4.2906 1.4866 6.518-0.0417 1.3502-0.68797 2.6162-1.1435 3.888-0.55866 1.5596-1.5488 2.9652-1.944 4.574-0.45606 1.8568-0.65934 3.8163-0.45741 5.7176 0.12609 1.1872 1.0292 3.4306 1.0292 3.4306-1.1816-0.5575-2.3633-1.4674-3.5449-5.0315v-2.287l1.944-5.7176 1.4866-5.4889-0.2287-3.3162-2.1727-3.4305-1.7153-1.8297 1.944-0.1143z" transform="translate(-265.27 -795.88)" fill="#ee6c6c"/>
+ <path id="path41368-8-1-8" d="m667.44 465.62s1.0381-0.2511 1.4518 0c1.0596 0.6433 2.7716 2.2436 2.7716 2.2436s0.41958-1.9701-0.0496-3.5386c-0.27762-0.9282-1.8558-2.2188-1.8558-2.2188s2.033-0.538 2.9612 0.1319c0.91432 0.66 2.0621 2.9531 2.0621 2.9531s0.43407-2.5187 0.13198-4.0913c-0.23075-1.2012-2.2436-2.9036-2.2436-2.9036s1.6585-0.3359 2.3756 0c1.2446 0.583 2.6396 3.1675 2.6396 3.1675s1.0476-3.3947 0.26396-5.2791c-0.36153-0.8693-2.2436-1.7158-2.2436-1.7158s2.5932-0.6852 3.5634 0 [...]
+ <path id="path4318-6-3-4-6-98-1-7-5-9" d="m614.59 386.03c0.72851 0.86913 0.72116 1.8413 0.0272 2.6591-0.34491 0.4065-0.90083 0.58293-1.706 0.34618-0.64276-1.8105-1.1116-2.3813-2.9333-3.1091 2.9861-1.1112 3.7635 0.0871 4.6121 0.10385z" stroke="#2c5aa0" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-98-1-7-3-6-1" d="m607.56 390.07c1.0544 0.41742 1.5109 1.2758 1.29 2.3254-0.10976 0.52169-0.51462 0.94153-1.3354 1.1167-1.4272-1.286-2.1113-1.5648-4.0598-1.3375 2.0968-2.399 3.351-1.7153 4.1052-2.1046z" stroke="#2c5aa0" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-98-1-7-3-8-5-28" d="m609.87 399.08c1.1197-0.17983 1.9506 0.32496 2.2969 1.3401 0.17215 0.50455 0.0386 1.0723-0.57755 1.6422-1.8839-0.37643-2.6144-0.2667-4.1733 0.92415 0.57708-3.1335 2.0045-3.1864 2.454-3.9064z" stroke="#2c5aa0" fill="#377bc8"/>
+ <path id="path42093-7-4" d="m921.84 1202.8s1.0363 0.9845 1.6559 1.3247c1.9431 1.067 4.519 0.8226 6.2924 2.1527l3.9742 2.9806-5.4645-8.9418s-1.4734 1.1297-2.3183 1.4903c-1.3052 0.5571-4.1398 0.9935-4.1398 0.9935z" transform="translate(-265.27 -795.88)" fill="#ee6c6c"/>
+ <path id="path42095-1-01" d="m932.94 1224.3s-4.4093 3.1056-5.6301 6.1268c-0.68524 1.6958-0.70253 3.4446 0 5.1333 1.7618 4.2348 8.4451 6.4581 8.4451 6.4581s-4.7755-2.8394-5.9612-6.6237c-0.44561-1.4222-0.26241-3.0039 0-4.4709 0.47662-2.6647 3.1462-6.6236 3.1462-6.6236z" transform="translate(-265.27 -795.88)" fill="#ee6c6c"/>
+ <path id="path4318-6-3-4-6-98-1-7-0-64-0" d="m655.18 457.59c0.923 0.65892 1.1594 1.6019 0.69245 2.5675-0.23209 0.47994-0.72608 0.79-1.5649 0.76251-1.0758-1.5917-1.6726-2.027-3.6186-2.2752 2.6125-1.8238 3.6653-0.85844 4.4911-1.0548z" stroke="#2c5aa0" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-98-1-7-0-0-8-8" d="m654.62 464.65c1.1199-0.17876 1.9503 0.32681 2.2956 1.3422 0.17167 0.50472 0.0376 1.0723-0.5791 1.6417-1.8836-0.37825-2.6142-0.26917-4.1742 0.92021 0.58003-3.1329 2.0075-3.1845 2.4577-3.9041z" stroke="#2c5aa0" fill="#377bc8"/>
+ <path id="path4318-6-3-4-6-98-1-7-0-6-3-14" d="m661.39 468.83c1.1065-0.24864 1.967 0.20386 2.3753 1.1956 0.20299 0.49295 0.10474 1.0679-0.47497 1.6747-1.9036-0.25936-2.6259-0.10468-4.1083 1.1802 0.38238-3.1631 1.8038-3.3042 2.208-4.0506z" stroke="#2c5aa0" fill="#377bc8"/>
+ </g>
+ <g id="g41846-5-95" transform="translate(-561.78 3.1667)">
+ <path id="path41257-7-9" d="m665.66 370.84s-5.2653-1.1296-7.3946-1.6224c-2.4936-0.5773-6.1091 0.5805-8.5476-0.1972-1.4346-0.4575-1.7874-0.7814-2.4884-2.1141-0.43326-0.8236-0.64739-2.2255-0.64739-2.2255s-1.1829 1.4931-0.99639 2.7919c0.16208 1.1289 0.97104 2.2557 1.9776 2.7919 2.8072 1.4953 7.7044 0.50173 10.802 1.222 2.1631 0.5028 4.7856 3.5566 4.7856 3.5566l2.5088-4.2032z" stroke="#2c5aa0" fill="#377bc8"/>
+ <g id="g41341-5-0" fill="#fff">
+ <path id="path5213-8-7-1-6-8-2" d="m651.57 373.61c0.39819-2.4593 0.92936-2.7032 1.4375-3.5142l0.0228 3.4613-1.4604 0.0528 0.00005 0.00004z"/>
+ <path id="path5213-8-7-1-9-3" d="m651.57 366.31c0.39819 2.4593 0.92936 2.7032 1.4375 3.5142l0.0228-3.4613-1.4604-0.0528 0.00005-0.00004z"/>
+ </g>
+ <path id="path40887-4-5" d="m643.05 393.62 2.5343-1.1071c0.71709-0.3133 0.45955-1.5392 0.73477-2.2297 0.31415-0.7881 1.7199-1.8763 1.7199-1.8763l-3.3328-0.1075s2.4166-1.1546 2.5802-2.7953c0.0415-0.4159-0.1105-1.7323-0.1075-2.1502 0.009-1.4321 1.2812-2.6458 2.4728-3.4403 0.7549-0.5034 2.7952-0.7064 3.2253-1.5052l0.75258-1.3976s-1.0349 0.7229-2.025 0.8506c-0.96556 0.1245-2.4728-0.3226-2.4728-0.3226l2.1502-2.0426c0.3378-0.3209-0.23201-1.7014-0.10751-2.1503 0.22601-0.815 1.9352-1.18 [...]
+ <g id="g4855-3-2-5-7-9" transform="matrix(-.99963 .027341 .027341 .99963 1332 556.11)">
+ <path id="path4045-9-52-54-4-01" d="m932.79 583.07c0 0.91155-1.0391 1.895-2.3967 1.895s-2.2124-0.73895-2.2124-1.6505 0.85475-1.406 2.2124-1.406 2.3967 0.24991 2.3967 1.1615z" transform="matrix(1.1429 0 0 1.1489 -398.53 -883.01)" fill="#fff"/>
+ <path id="path4827-0-2-2-3-3" d="m931.09 582.83c0 0.52366-0.42451 0.94816-0.94816 0.94816-0.52366 0-0.94816-0.4245-0.94816-0.94816 0-0.52365 0.4245-0.94816 0.94816-0.94816 0.52365 0 0.94816 0.42451 0.94816 0.94816z" transform="matrix(1.1111 0 0 1.1111 -368.51 -860.47)" fill="#2b2200"/>
+ <path id="path4045-8-5-7-1-1-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m664.78-214.69c-0.8063 0-1.5033 0.15935-2 0.46875-0.49671 0.3094-0.78125 0.80487-0.78125 1.4062 0 0.60138 0.2906 1.147 0.78125 1.5312 0.49065 0.38428 1.1786 0.625 2 0.625 1.673 0 2.9688-1.2012 2.9688-2.4375 0-0.61815-0.39009-1.0552-0.9375-1.2812-0.54741-0.22606-1.24-0.3125-2.0312-0.3125zm0 0.5c0.76036 0 1.4095 0.10192 1.8438 0.28125 0.43426 0.17933 0.625 0.38334 0.625 [...]
+ </g>
+ <path id="path40887-7-4-3-9" d="m673.87 366.54s2.4056 1.4733 3.0695 2.651c1.2278 2.178-0.21175 4.637 0.97667 6.8367 0.42233 0.7817 1.3952 1.2557 1.3952 1.2557s-1.0954 0.9437-2.0929 0.6977c-0.91432-0.2255-1.9533-0.5582-1.9533-0.5582s1.8384 2.1749 1.9533 4.0462c0.13294 2.1639-2.3154 3.8405-2.5114 5.9996-0.13774 1.5172 0.97667 4.4647 0.97667 4.4647s-1.4015-0.4423-2.0929-0.9766c-0.57483-0.4442-1.6743-1.8138-1.6743-1.8138l0.5581 3.0695c0.26792 1.4735-2.6779 2.4267-2.93 4.1858-0.1623 [...]
+ <path id="path40954-5-04" d="m651.32 373.91s1.1888 1.005 1.9209 1.1154c1.09 0.1643 2.127-0.6189 3.2222-0.7436 1.6623-0.1893 3.3921 0.3894 5.0192 0 1.4643-0.3504 3.0834-0.872 4.0277-2.0448 1.285-1.596 1.5491-5.9487 1.5491-5.9487l0.61966 0.6816 0.24786 3.0363-0.68162 3.2842-2.4166 2.1687-2.8504 0.9295-3.594-0.3098h-2.2927l-2.0448 1.0534-2.4166 0.9295-2.2308-0.6816 1.9209-1.859v-1.6111z" fill="#cd0707"/>
+ <path id="path40948-4-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m666.29 365.4s0.27347 0.5374 0.5625 1.2188 0.5674 1.5174 0.625 2c0.16435 1.3769 0.14397 2.8716-0.4375 4-0.7477 1.4509-2.0905 2.1891-3.75 2.7812-1.0449 0.3729-2.2213 0.3195-3.4688 0.2188s-2.5586-0.2625-3.875 0c-0.59782 0.1192-1.2553 0.4506-1.8125 0.75-0.55722 0.2994-1 0.5625-1 0.5625l0.53125 0.8437s0.41432-0.2501 0.9375-0.5312 1.1738-0.585 1.5312-0.6562c1.1099-0.2214 2.3552-0. [...]
+ <path id="path41163-0-2" d="m650.15 360.25-0.33526 2.5703s2.1252-0.1785 2.953-0.5181c1.2565-0.5154 1.9334-2.3316 1.9334-2.3316l-4.5512 0.2794z" fill="#9c0000"/>
+ <path id="path41167-6-4" d="m659.14 358.62 2.2765-0.75395 2.1681-0.4795 5.2574 0.47062 4.0549 0.71541 3.7941-1.5761c-1.6157-0.0576-0.41381-0.0923-0.39781 0.6 0.013 0.56338-1.0533 2.1386-2.6773 2.5233-1.8007 0.42655-6.1542-0.77076-10.087-0.81279-2.5684-0.0274-4.9576 0.80209-6.3398 0.86025l1.9513-1.5472z" fill="#ee6c6c"/>
+ <path id="path40887-7-1-4" d="m673.87 366.54s2.4056 1.4733 3.0695 2.651c1.2278 2.178-0.21175 4.637 0.97667 6.8367 0.42233 0.7817 1.3952 1.2557 1.3952 1.2557s-1.0954 0.9437-2.0929 0.6977c-0.91432-0.2255-1.9533-0.5582-1.9533-0.5582s1.8384 2.1749 1.9533 4.0462c0.13294 2.1639-2.3154 3.8405-2.5114 5.9996-0.13774 1.5172 0.97667 4.4647 0.97667 4.4647s-1.4015-0.4423-2.0929-0.9766c-0.57483-0.4442-1.6743-1.8138-1.6743-1.8138l0.5581 3.0695c0.26792 1.4735-2.6779 2.4267-2.93 4.1858-0.1623 1. [...]
+ <path id="path41165-9-1" d="m672.21 364.75c1.5541-2.7869 3.383-3.057 6.2888-2.6314-0.98149 2.0678-2.3548 4.3846-6.2888 2.6314z" fill="#800000"/>
+ <path id="path41169-0-90" d="m662.26 380.41s-5.7259 6.1513-5.7455 9.6482c-0.006 1.1341 1.1749 2.0167 1.3009 3.1438 0.1425 1.2752-0.65043 3.7942-0.65043 3.7942s2.5182-2.559 2.6018-4.011c0.0728-1.2668-0.94483-2.4173-0.97566-3.6858-0.0772-3.1765 3.469-8.8894 3.469-8.8894z" fill="#ee6c6c"/>
+ <path id="path41171-9-21" d="m653.37 385.5s2.2097-1.0925 2.6018-1.8429c0.38626-0.7394 0.2931-2.1264 0.75884-2.8185 0.97442-1.4481 3.2522-2.3849 3.2522-2.3849s-3.0598 0.1531-4.2278 1.7345c-0.45083 0.6104-0.37417 1.8617-0.54203 2.6017-0.2038 0.8984-1.8429 2.7101-1.8429 2.7101z" fill="#ee6c6c"/>
+ <path id="path41171-1-1-5" d="m667.79 391.7s-1.579-1.8929-1.634-2.7378c-0.0542-0.83245 0.59204-2.0632 0.44604-2.8846-0.30542-1.7185-2.0096-3.4966-2.0096-3.4966s2.7364 1.3777 3.165 3.2964c0.1654 0.74059-0.41083 1.854-0.55664 2.5986-0.177 0.90407 0.58924 3.2239 0.58924 3.2239z" fill="#ee6c6c"/>
+ <path id="path41171-1-2-2-49" d="m672.71 383.49s-1.8524-1.6263-2.0373-2.4525c-0.18213-0.81409 0.26625-2.1299-0.005-2.9189-0.56719-1.6507-2.5256-3.1442-2.5256-3.1442s2.9164 0.93847 3.6362 2.768c0.27781 0.70615-0.11954 1.8952-0.14858 2.6534-0.0352 0.92056 1.0801 3.0942 1.0801 3.0942z" fill="#ee6c6c"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <path id="path7014-6-7-2-0-3-0" d="m1478 691.58 405.86-0.00008m-202.93 255.85-0.0001-476.32" stroke="#540" stroke-width="2" fill="none"/>
+ <path id="path7014-6-7-28-2" d="m1477.9 471.12c-1.0759 67.808-1.0124 135.63 0 203.43 0.9754 65.329 4.2342 116.31 33.501 156.17 35.255 48.019 93.988 82.671 169.54 116.72 75.551-34.045 134.28-68.698 169.54-116.72 29.267-39.863 32.526-90.843 33.501-156.17 1.0124-67.806 1.0759-135.62 0-203.43h-406.08z" stroke="#540" stroke-width="2" fill="none"/>
+ </g>
+ <g id="g26887">
+ <g id="g6326" transform="matrix(.7695 0 0 .7695 379.73 -608.92)" stroke-width="1.2995">
+ <g id="g16008" transform="translate(3.9674 -2.0016)">
+ <g id="g15508">
+ <path id="path14321-8" d="m316.59 846.48c-38.704-39.412-79.324-17.207-75.569-83.533-33.407 15.702-47.237-5.4412-80.409-11.501 24.972-7.5739 42.399-16.723 55.959-29.391 16.663-15.567 27.486-36.448 39.295-66.249l121.34 0.43963c11.918 29.361 22.74 50.242 39.403 65.809 13.56 12.668 30.986 21.817 55.959 29.391-33.172 6.0597-47.002 27.203-80.409 11.501 3.7544 66.326-36.865 44.122-75.569 83.533z" fill="#d1b948"/>
+ <path id="path14321-8-8" d="m316.59 846.48c-38.704-39.412-79.324-17.207-75.569-83.533-33.407 15.702-43.237-5.4412-76.409-11.501 24.972-7.5739 44.399-16.723 57.959-29.391 16.663-15.567 27.486-36.448 39.295-66.249l109.34 0.43963c11.918 29.361 22.74 50.242 39.403 65.809 13.56 12.668 32.986 21.817 57.959 29.391-33.172 6.0597-43.002 27.203-76.409 11.501 3.7544 66.326-36.865 44.122-75.569 83.533z" fill="#e7cd54"/>
+ <path id="path14321-8-8-3" d="m316.59 846.48c-38.704-39.412-79.324-17.207-75.569-83.533-33.407 15.702-39.237-5.4412-72.409-11.501 24.972-7.5739 44.399-16.723 57.959-29.391 16.663-15.567 25.486-36.448 37.295-66.249l105.34 0.43963c11.918 29.361 20.74 50.242 37.403 65.809 13.56 12.668 32.986 21.817 57.959 29.391-33.172 6.0597-39.002 27.203-72.409 11.501 3.7544 66.326-36.865 44.122-75.569 83.533z" fill="#f6e078"/>
+ <path id="path14448" d="m328.28 827.73 46.515-21.921 21.868-35.504 32.715-6.0977-78.108-103.82-29.406 0.53465 6.4158 166.81z" fill="#d1b948"/>
+ <path id="path14450" d="m353.4 813.83-24.59-106.4v-1.0693l12.832-3.7426 45.98 88.752-10.693 11.228-36.891-88.752-3.2079 2.1386 32.079 90.356-15.505 7.4851z" fill="#e7cd54"/>
+ <path id="path14454" d="m192.47 759.83c33.856-19.745 53.896-47.166 75.386-73.782l17.644 12.832-49.723 51.861 1.604 8.0198-15.505 12.297-29.406-11.228z" fill="#e7cd54"/>
+ <path id="path14456" d="m275.35 680.16c-23.771 30.905-46.667 62.393-82.871 85.01l8.5544 3.7426c34.81-28.023 57.462-57.782 82.871-87.148l-8.5544-1.604z" fill="#d1b948"/>
+ <path id="path14458" fill="#e7cd54" d="m318.65 688.18-8.0198 151.84-5.8812-9.0891 6.9505-145.43 6.9505 2.6733z"/>
+ <path id="path14494" d="m286.11 819.88c8.5956-52.277 16.674-104.81 21.96-158.74h-11.921c-3.8683 36.597-56.761 89.052-24.481 109.79 11.499 12.952-1.8196 27.829-4.2661 42.049l18.708 6.9019z" fill="#f8eca8"/>
+ <path id="path14321-8-0-6" d="m234.79 700.13c1.6554-2.5074 1.682-3.1472 3.2482-5.87 6.2647-10.891 11.923-23.562 17.827-38.462l60.67 0.21982 60.67 0.21981c5.9588 14.681 11.644 27.241 17.922 38.077 1.5696 2.7091 0.80997 1.3666 2.4672 3.8663 0.0804 1.3551-2.6884 8.0399-11.689 13.471-15.426 9.3093-42.208 23.707-73.547 23.477-17.464-0.12829-36.346-7.652-53.399-16.543-9.3019-4.8497-16.482-10.981-24.17-18.457z" fill="#d1b948"/>
+ <path id="path14570-2" d="m175.46 746.56 12.204-5.1984s9.0349 2.5772 13.123 4.8119c4.6574 2.5457 8.3359 6.5824 12.686 9.6237 1.9889 1.3906 4.259 3.0238 6.721 3.7381 2.2313 0.64729 4.0686 0.78916 6.9585 0.39786 0.82524-0.11175 2.9518-0.34291 3.6019-0.86331 0.88004-0.70441 1.6466-1.858 1.5914-2.9839-0.0703-1.4328-1.2734-2.4054-2.586-2.9839-1.5962-0.7034-3.5761-0.10713-5.172 0.59677-2.8046 1.237-6.9624 5.371-6.9624 5.371s-2.4868-5.6621-2.586-9.1506c-0.51631-18.167 25.686-22.308 32.0 [...]
+ <path id="path14452" d="m355.54 681.23 55.237 73.698 11.267 11.572 30.202-13.488s-31.029-13.977-40.634-21.526c-19.617-15.417-38.429-55.604-38.429-55.604l-17.644 5.3465z" fill="#baa440"/>
+ <path id="path14570-2-8" d="m175.46 746.56 12.204-5.1984s9.0349 2.5772 13.123 4.8119c4.6574 2.5457 8.3359 6.5824 12.686 9.6237 1.9889 1.3906 4.259 3.0238 6.721 3.7381 2.2313 0.64729 4.0686 0.78916 6.9585 0.39786 0.82524-0.11175 2.9518-0.34291 3.6019-0.86331 0.88004-0.70441 1.6466-1.858 1.5914-2.9839-0.0703-1.4328-1.2734-2.4054-2.586-2.9839-1.5962-0.7034-3.5761-0.10713-5.172 0.59677-2.8046 1.237-6.9624 5.371-6.9624 5.371s-2.4868-5.6621-2.586-9.1506c-0.51631-18.167 25.686-22.308 32 [...]
+ <path id="path14321-8-0-6-7" d="m238.04 694.26c6.2647-10.891 11.923-23.562 17.827-38.462l60.67 0.21982 60.67 0.21981c5.9588 14.681 11.644 27.241 17.922 38.077-5.7123 8.8823-12.666 14.125-20.996 18.943-19.828 11.469-41.886 17.268-61.832 16.565-24.76-0.87283-46.268-10.683-56.219-19.373-8.2823-7.2319-15.435-10.809-18.043-16.189v-0.00005z" fill="#baa440"/>
+ <path id="path14321-8-0" d="m316.59 846.48c-38.704-39.412-79.324-17.207-75.569-83.533-33.407 15.702-47.237-5.4412-80.409-11.501 24.972-7.5739 42.399-16.723 55.959-29.391 16.663-15.567 27.486-36.448 39.295-66.249l121.34 0.43963c11.918 29.361 22.74 50.242 39.403 65.809 13.56 12.668 30.986 21.817 55.959 29.391-33.172 6.0597-47.002 27.203-80.409 11.501 3.7544 66.326-36.865 44.122-75.569 83.533z" stroke="#806600" stroke-width="1.2995" fill="none"/>
+ </g>
+ <g id="g14899" transform="translate(0,6)">
+ <path id="path13007-7-4" d="m316.59 828.35-12.648-10.216c-7.3805-5.9614-24.063-11.841-31.232-18.054-4.772-4.1354-9.0014-9.6299-10.508-15.762-0.7749-3.154-0.99107-6.7937 0.44863-9.6884 1.9331-3.8868 6.3078-4.5095 10.074-2.7478 2.0914 0.97817 3.0447 4.934 3.2195 7.2383 0.1814 2.3907-1.8672 6.9463-1.8672 6.9463s7.3019-1.1764 10.235-3.8419c3.1077-2.8242 4.8192-6.811 4.5797-11.003-0.254-4.4467-2.585-8.4149-5.8167-11.48-2.0775-1.9702-5.0818-2.9584-7.9221-3.3195-3.2606-0.41454-7.8726 0. [...]
+ <path id="path13007-7-4-2" d="m433.33 742.61c-6.0138 3.7146-12.646 10.255-17.329 11.721-4.924 1.541-12.341 2.9693-15.213-0.49047-2.6598-3.4307-2.3844-5.4335 0.83953-8.0595 1.7901-1.4581 5.767-0.5969 7.9181 0.24744 2.2319 0.87601 5.4437 4.7014 5.4437 4.7014s2.115-7.0872 0.98977-10.887c-1.1922-4.0264-4.0386-7.301-7.9181-8.9079-4.1149-1.7045-8.7019-1.3304-12.867 0.24744-2.6775 1.0143-4.8735 3.2903-6.4335 5.6912-1.7908 2.7561-2.9693 6.413-2.9693 6.413s-1.5628-5.2762-4.5247-8.3219c-2. [...]
+ <path id="path13007-7-4-2-5" d="m359.68 724.8c0.19095 0.0109-1.9121 5.5386-2.1889 11.947-0.18332 4.2443 1.0063 9.1507 2.0814 12.1 1.4551 3.9914 6.4269 8.3367 6.4269 8.3367s-4.7053-1.1727-7.9659-0.75817c-2.8403 0.3611-5.8447 1.3493-7.9221 3.3195-3.2317 3.0649-5.5627 7.0331-5.8167 11.48-0.23946 4.1924 1.472 8.1792 4.5797 11.003 2.9331 2.6655 10.235 3.8419 10.235 3.8419s-2.0486-4.5555-1.8672-6.9463c0.17482-2.3043 1.1282-6.2601 3.2195-7.2383 3.7665-1.7617 8.1412-1.139 10.074 2.7478 1 [...]
+ <path id="path13007-7-4-2-0" d="m362.61 824.09c13.838-6.8912 26.434-13.177 32.66-23.171 4.2801-6.87 5.6316-15.373 2.7549-26.61 7.4461 2.4294 14.034 3.3041 19.904 2.6505 11.519-1.2826 20.424-7.628 28.157-13.811 0 0 2.5802-6.9394 0.75623-9.5677-4.0655-5.8585-20.568-5.8833-20.568-5.8833-3.7641 2.9077-7.3889 5.7367-10.274 6.6397-4.924 1.541-12.341 2.9693-15.213-0.49047-2.6598-3.4307-2.3844-5.4335 0.83953-8.0595 1.7901-1.4581 5.767-0.5969 7.9181 0.24744 2.2319 0.87601 5.4437 4.7014 5. [...]
+ <path id="path13007-7-4-2-2" d="m392.55 804.82c4.4891-7.5222 8.8333-17.668 5.8161-29.973 7.8097 2.66 11.932 0.55168 18.089-0.16398 13.133-1.5266 27.347-9.6036 35.943-16.882 0 0-8.9316 0.11193-11.595 0.70198-5.9581 1.32-10.631 5.6748-16.943 7.7101-5.7334 1.8487-13.571 3.2513-19.55 2.7212-6.5252-0.57853-18.681-6.3495-18.681-6.3495s5.3133 13.041 6.5166 19.956c1.0494 6.03 0.40465 22.28 0.40465 22.28z" fill="#d1b948"/>
+ <path id="path13007-7-4-27" d="m273.51 724.8c0.19095-0.0109-5.7014 0.49833-11.592 3.0349-3.9019 1.6801-7.8032 4.8845-9.9915 7.1347-2.9619 3.0457-4.5247 8.3219-4.5247 8.3219s-1.1785-3.6569-2.9693-6.413c-1.56-2.4009-3.756-4.6768-6.4335-5.6912-4.1651-1.5779-8.7521-1.9519-12.867-0.24744-3.8796 1.607-6.7259 4.8815-7.9181 8.9079-1.1253 3.8003 0.98977 10.887 0.98977 10.887s3.2119-3.8254 5.4437-4.7014c2.1512-0.84434 6.128-1.7056 7.9181-0.24744 3.224 2.6261 3.4994 4.6289 0.83953 8.0595-2. [...]
+ <path id="path14755" d="m252.67 767.15c-0.98476 7.3364 0.40751 13.98 1.8077 19.848 1.0004 4.1933 5.3331 12.247 11.361 18.774 5.4918 5.9468 14.013 10.702 17.323 13.047-5.9016 0.509-22.583-4.5584-30.381-9.6752-10.298-6.7569-12.696-14.894-13.846-20.6-1.6628-8.2548 2.1061-17.13 13.736-21.395z" fill="#f6e078"/>
+ <path id="path14807" d="m251.22 755.46c10.72-10.19 15.156-20.38 22.143-30.57l0.9798 5.8788 1.1758 5.2909-0.19596 6.0748-1.1758 5.6828-2.9394 5.4869-4.1152 2.9394 8.2303 0.39192 7.4465 2.3515 4.5071 6.2707 1.7636 6.4667-0.58788 3.7232s-3.278-8.0488-6.6626-10.386c-3.9006-2.6933-9.2137-2.3204-13.913-2.9394-6.0314-0.79442-19.792-0.9798-19.792-0.9798l3.1354-5.6828z" fill="#f6e078"/>
+ <path id="path14757" d="m251.36 758.75s5.2141 0.57672 10.711-1.7423c3.4941-1.4741 7.6738-5.5464 8.863-7.0847 2.2196-2.8712 3.1593-11.051 2.4298-15.698-0.46879-2.9864-2.471-3.5297-2.471-3.5297-4.3523 8.1462-9.8975 19.909-19.533 28.055z" fill="#f8eca8"/>
+ <path id="path14805" d="m316.69 858.95 3.7212-5.8756 4.3088-4.5046c-8.5341-25.094-42.846-33.3-67.616-31.835l31.971 17.146 12.143 8.2258 10.772 9.9885 4.7005 6.8548z" fill="#f6e078"/>
+ <path id="path14759" d="m316.88 852.48c-6.2632-12.357-17.282-18.055-28.995-22.782 17.482-2.3041 31 4.0928 28.995 22.782z" fill="#f8eca8"/>
+ <path id="path14809" d="m217.18 745.97c7.9858-16.371 20.077-11.089 30.117-3.1814l0.2121-0.21209-4.2419-7.8474-5.0902-4.0298-9.3321-1.2726-6.3628 2.5451-4.0298 4.2419-1.6967 5.5144 0.42418 4.2419z" fill="#f8eca8"/>
+ <path id="path13007-7-4-2-5-1" d="m357.49 736.74c-0.18332 4.2443 1.0063 9.1507 2.0814 12.1 1.4551 3.9914 6.4269 8.3367 6.4269 8.3367s-4.7053-1.1727-7.9659-0.75817c-2.8403 0.3611-5.8447 1.3493-7.9221 3.3195-3.2317 3.0649-5.5627 7.0331-5.8167 11.48-0.23946 4.1924 1.472 8.1792 4.5797 11.003 2.9331 2.6655 10.235 3.8419 10.235 3.8419s-2.0486-4.5555-1.8672-6.9463c0.17482-2.3043 1.1282-6.2601 3.2195-7.2383 3.7665-1.7617 8.1412-1.139 10.074 2.7478l-2.0961-3.5025c-1.8453-3.0834-7.1175-3.2 [...]
+ <path id="path13007-7-4-2-2-1" d="m395.27 800.91c4.2801-6.87 5.6316-15.373 2.7549-26.61 7.4461 2.4294 14.034 3.3041 19.904 2.6505 12.522-1.3942 21.954-8.771 30.15-15.419 0 0-2.258 0.29665-4.7973 0.83554-5.6807 1.2056-10.331 7.127-16.349 8.9858-5.4664 1.6884-12.939 2.9694-18.64 2.4853-6.2214-0.52837-14.639-3.2388-14.639-3.2388s2.227 5.3998 3.3743 11.715c1.0006 5.5072-1.7593 18.596-1.7593 18.596z" fill="#e7cd54"/>
+ <path id="path13007-7-4-5" d="m316.59 828.35-12.648-10.216c-7.3805-5.9614-24.063-11.841-31.232-18.054-4.772-4.1354-9.0014-9.6299-10.508-15.762-0.7749-3.154-0.99107-6.7937 0.44863-9.6884 1.9331-3.8868 6.3078-4.5095 10.074-2.7478 2.0914 0.97817 3.0447 4.934 3.2195 7.2383 0.1814 2.3907-1.8672 6.9463-1.8672 6.9463s7.3019-1.1764 10.235-3.8419c3.1077-2.8242 4.8192-6.811 4.5797-11.003-0.254-4.4467-2.585-8.4149-5.8167-11.48-2.0775-1.9702-5.0818-2.9584-7.9221-3.3195-3.2606-0.41454-7.8726 [...]
+ <path id="path14755-2" d="m259.51 804.24c-14.804 1.4144-26.251-27.677-9.1047-33.212-1.5882 12.726 0.69063 23.694 9.1047 33.212z" fill="#f8eca8"/>
+ </g>
+ </g>
+ <g id="g6769" transform="translate(3.9674 -2.0016)">
+ <g id="g6757" stroke-width="1.2995">
+ <g id="g12858" transform="matrix(.97208 0 0 1 9.5177 -10.469)" stroke-width="1.3181">
+ <g id="g12848" stroke-width="1.3181">
+ <path id="path18323-9" d="m447.98 595.85c0 36.656-10.842 67.842-34.746 91.864s-60.869 46.88-97.344 46.88c-36.476 0-73.441-22.858-97.344-46.88-23.904-24.022-34.746-55.208-34.746-91.864s14.785-67.842 38.688-91.864c23.904-24.022 56.926-38.88 93.402-38.88s69.498 14.858 93.401 38.88c23.904 24.022 38.688 55.208 38.688 91.864z" stroke="#806600" stroke-width="1.3181" fill="#baa440"/>
+ <path id="path12752-9" d="m315.89 521.16c-2.3388 0-4.7806 0.34767-6.8722 1.4157-1.7104 0.87343-3.1882 2.2911-4.2472 3.8932-1.1728 1.7743-1.965 3.8959-2.1236 6.0168-0.11648 1.5574 0.88483 4.6011 0.88483 4.6011s-3.0178-0.2707-4.4241 0.17697c-1.3408 0.4268-2.626 1.2301-3.5393 2.3006-1.1312 1.3259-2.1236 4.7781-2.1236 4.7781s-1.3686-2.3317-2.4775-3.0084c-1.1851-0.7233-4.0702-0.88482-4.0702-0.88482s0.84191-3.6038 0.35394-5.309c-0.49997-1.7471-1.8729-3.8751-3.1854-5.132-1.6307-1.5616 [...]
+ <path id="path12752-9-8" d="m316.21 699.64c2.3388 0 4.7806-0.34767 6.8722-1.4157 1.7104-0.87343 3.1882-2.2911 4.2472-3.8932 1.1728-1.7743 1.965-3.8959 2.1236-6.0168 0.11648-1.5574-0.88483-4.6011-0.88483-4.6011s3.0178 0.2707 4.4241-0.17697c1.3408-0.4268 2.626-1.2301 3.5393-2.3006 1.1312-1.3259 2.1236-2.7781 2.1236-2.7781s1.3686 2.3317 2.4775 3.0084c1.1851 0.7233 4.0702-1.1152 4.0702-1.1152s-0.84191 3.6038-0.35394 5.309c0.49997 1.7471 1.8729 3.8751 3.1854 5.132 1.6307 1.5616 3.50 [...]
+ <path id="path12799-2" d="m203.26 538.06s4.3224-0.0707 5.3677 0.8234c1.1137 0.9526 6.2641 4.1916 6.2641 4.1916s1.7995 0.0295 3.9324-1.1836c1.7616-1.002 5.7198-1.0725 5.7198-1.0725s3.5122-6.3327 6.4348-8.2223c3.1431-2.0321 7.2271-3.3831 10.903-2.6812 3.735 0.71311 7.0464 3.547 9.2948 6.6136 1.2589 1.7171 1.6344 3.9742 1.9662 6.0774 0.1114 0.70625 0.35749 3.3962 0.35749 3.3962 1.1916-1.4597 2.1558-3.0332 5.1836-3.5749 0 0-0.98481-3.1436-0.53624-5.1836 0.65256-2.9678 2.0637-5.9753 [...]
+ <path id="path12799-2-0" d="m229.31 689.91c3.1431 2.0321 8.8984 3.3326 12.575 2.6307 3.735-0.71311 7.0464-3.222 9.2948-6.2886 1.2589-1.7171 1.6344-1.9742 1.9662-4.0774 0.1114-0.70625 0.35749-3.3962 0.35749-3.3962 1.1916 1.4597 2.1558 3.0332 5.1836 3.5749 0 0-0.98481 1.1436-0.53624 3.1836 0.65256 2.9678 2.0637 5.9753 4.2899 8.0436 2.482 2.3059 5.9382 3.6518 9.2948 4.1111 3.2809 0.44897 6.7897-0.11987 9.831-1.43 2.9997-1.2922 5.8556-3.3723 7.6861-6.0774 0.94031-1.3896 1.3392-3.15 [...]
+ <path id="path12846" d="m389.15 517.9 2.4227 8.2397s-5.3916 0.91569-7.571 2.4227c-3.0732 2.1251-6.9653 8.7824-6.9653 8.7824s-4.1407-7.1515-7.4962-9.9656c-3.9416-3.3057-8.0609-4.5706-13.203-4.4078-4.8188 0.1526-8.4209 2.4779-11.958 5.754-2.1883 2.0267-3.5284 7.591-3.5284 7.591l-7.4237-1.2114s-1.379-7.5424-3.0386-10.125c-2.6334-4.0986-4.6276-5.64-9.3284-6.9191-3.123-0.84977-7.6584-0.81803-10.718 0.23611-4.0504 1.3953-7.409 4.5118-9.592 8.1979-1.5509 2.6187-1.055 7.9826-1.055 7.98 [...]
+ </g>
+ <path id="path12856" d="m357.44 718.09c-49.241 6.1115-63.551-7.7889-79.634-14.401 0 0-8.0442-1.4131-12.109-3.9237-2.9716-1.8353-6.2167-3.3162-7.4001-6.5396-1.0559-2.8761-1.3455-9.8093-1.3455-9.8093l-2.0182-0.98093s-2.0344 7.1939-5.0455 10.136c-1.9832 1.9379-10.764 4.9047-10.764 4.9047 45.364 33.159 85.547 28.685 118.32 20.613z" fill="#f6e07d"/>
+ </g>
+ <path id="path6445" d="m242.88 517.21c6.9216 0.96408 10.535 5.2361 14.184 9.4732 0 0 4.0218-7.0529 6.9476-9.778 1.69-1.5741 5.9183-3.6024 5.9183-3.6024s0.53421-3.5834 1.2866-5.1463c0.71076-1.4765 2.8305-3.6024 2.8305-3.6024l-27.307 1.3341c-2.4651 3.3811-3.4433 7.2579-3.8598 11.322z" fill="#f8ecb0"/>
+ </g>
+ <g id="g8769" transform="matrix(.97208 0 0 .89396 7.5719 62.546)">
+ <g id="g8762" stroke-width="1.3941">
+ <g id="g8734" stroke="#806600" stroke-width="1.3941">
+ <path id="path8461" d="m458.49 600.49c0 19.598-13.719 41.341-39.134 54.185-25.414 12.843-62.524 10.787-101.31 10.787-38.781 0-75.891 2.0563-101.31-10.787-25.414-12.843-39.134-34.586-39.134-54.185 0-19.598 9.7192-41.341 35.134-54.185 25.414-12.843 66.524-10.787 105.31-10.787 38.781 0 79.891-2.0562 105.31 10.787 25.414 12.843 35.134 34.586 35.134 54.185z" fill="#baa440"/>
+ <path id="path8461-1" d="m458.52 600.68c0 18.492-13.721 37.209-39.14 49.327s-62.535 11.054-101.32 11.054c-38.788 0-75.904 1.0649-101.32-11.054-25.419-12.118-39.14-30.835-39.14-49.327s9.7208-38.381 35.139-50.499c25.419-12.118 66.535-10.363 105.32-10.363 38.788 0 79.904-1.7556 105.32 10.363 25.419 12.118 35.139 32.007 35.139 50.499z" fill="#453600"/>
+ </g>
+ <path id="path6007" d="m325.69 570.78c-36.079 0-68.727 2.5266-92.531 6.625-11.902 2.0492-21.593 4.4575-28.531 7.2812-3.4693 1.4119-6.2578 2.9068-8.375 4.6875s-3.7188 4.0926-3.7188 6.8125 1.6016 5.0318 3.7188 6.8125 4.9057 3.2756 8.375 4.6875c6.9386 2.8237 16.629 5.232 28.531 7.2812 23.805 4.0984 56.452 6.625 92.531 6.625s68.734-2.5265 92.531-6.625c11.898-2.0492 21.564-4.4574 28.5-7.2812 3.4679-1.4119 6.2587-2.9067 8.375-4.6875s3.7188-4.0932 3.7188-6.8125-1.6024-5.0317-3.7188-6.8 [...]
+ <path id="path8738-5" d="m455.83 596.19c0 12.37-58.27 22.398-130.15 22.398s-130.15-10.028-130.15-22.398 58.27-22.398 130.15-22.398 130.15 10.028 130.15 22.398z" transform="matrix(1.0651 0 0 1 -28.831 4.2958)" fill="#540"/>
+ </g>
+ <g id="g6899" transform="matrix(1.1758 0 0 1.0901 -58.525 -45.4)" stroke-width="1.2313">
+ <g id="g5928" transform="translate(.16040)">
+ <path id="path7273" d="m314.1 666.3c-1.5416 1.5176-2.5 3.7637-2.5 6.0938 0 4.628 3.7782 8.375 8.4062 8.375s8.375-3.747 8.375-8.375c0-2.0568-0.77143-3.949-2-5.6719 0.98814 0.21898 2.1045 0.51563 3.2812 0.51563 4.1138 0 7.4688-3.3237 7.4688-7.4375s-3.3549-7.4375-7.4688-7.4375c-0.93462 0-1.8329 0.15535-2.6562 0.46875 1.4976-13.096 5.2812-47.938 5.2812-66.469 0-15.16-2.6287-39.271-4.4062-53.969 0.57028 0.13961 1.1674 0.21875 1.7812 0.21875 4.1138 0 7.4688-3.3237 7.4688-7.4375s-3.35 [...]
+ <path id="path5613" d="m315.14 532.27s0.66842-1.3684 1.856-2.0689c1.1876-0.70043 2.8945-0.73281 3.6341-0.73512 0.75852-0.002 2.6792 0.20173 3.9925 0.90805 1.3132 0.70632 2.019 1.9147 2.019 1.9147l0.81579 7.7895c1.8182 7.3095-5.7653 12.841-14.765 13.053-0.73611-6.9537 1.5307-13.907 2.4474-20.861z" fill="#d1b948"/>
+ <path id="path5615" d="m326.11 541.81c0.73421-3.1079 1.2215-7.2428-1.0029-9.5277-0.37408-0.38427-0.80905-0.68944-1.2853-0.92194-2.464-1.2029-6.0328-0.46036-7.9917 1.3398l-1.8387 7.7726s3.2834 0.10152 5.0982 0.91934c1.061 0.47814 1.9689 1.3565 2.5909 2.3401 0.62177 0.98334 2.4237 1.8387 2.4237 1.8387s1.5421-1.7979 2.0058-3.7609z" fill="#baa440"/>
+ <path id="path5617" d="m327.36 530.66c-2.1435-0.33556-3.8135-1.7285-5.9735-1.9326-2.2242-0.21019-4.5212 0.5533-6.6763 1.142-1.3225 0.36126-2.4982 0.95049-3.8652 1.0542-1.0422 0.079-2.1576-0.1134-3.0746-0.61492-0.99928-0.54654-1.8062-1.4711-2.3718-2.4597-0.64918-1.1346-0.61655-2.2187-0.43923-3.5138 0.17643-1.2886 0.62918-2.469 1.6691-3.2503 0.9938-0.74661 2.4503-1.1322 3.6895-1.2298 1.1154-0.0879 1.8978 0.006 2.9867 0.26353 1.7044 0.40236 4.568 1.3177 4.568 1.3177s-2.2193-3.1596 [...]
+ <path id="path5619" d="m317.97 518.04c0.35311-1.8553-0.17107-3.2243 0.59412-4.951 0.48678-1.0984 1.6736-2.0874 2.8716-2.1784 1.3107-0.0996 3.8618 1.7824 3.8618 1.7824s0.0774-3.0146-0.9902-4.2578c-0.83639-0.97405-2.578-1.6724-3.8618-1.6833-1.2424-0.0106-2.535 0.39387-3.5647 1.0892-0.91419 0.61737-1.7118 1.5344-2.0794 2.5745-0.35194 0.99585-0.23676 2.1393 0 3.1686 0.57576 2.5032 3.3667 6.9314 3.3667 6.9314s-0.32224-1.823-0.19805-2.4755z" fill="#f8eca8"/>
+ <path id="path5619-9" d="m310.8 520.13s-3.0146-0.0774-4.2578 0.9902c-0.97405 0.83639-1.6724 2.578-1.6833 3.8618-0.0106 1.2424 0.39387 2.535 1.0892 3.5647 0.61737 0.91419 1.5344 1.7118 2.5745 2.0794 0.99585 0.35194 2.1393 0.23676 3.1686 0 2.5032-0.57576 5.05-2.1784 5.05-2.1784-4.135 0.0647-7.6933-3.6376-5.9412-8.3177z" fill="#f8eca8"/>
+ <path id="path5643" d="m310.25 590.07c4.7883 8.9004 14.866 9.404 20.001-0.274 0 0 0.29267-13.175-0.27399-19.727-0.39848-4.6074-2.192-13.7-2.192-13.7s-2.9671 4.2585-5.4798 5.7538c-3.1098 1.8507-10.686 3.0139-10.686 3.0139s-1.3914 5.437-1.644 8.2198c-0.50358 5.5491 0.27399 16.714 0.27399 16.714z" fill="#f6e078"/>
+ <path id="path5645" d="m327.43 581.68c0 3.7606-3.3136 6.8091-7.4012 6.8091s-7.4012-3.0485-7.4012-6.8091 3.3136-6.8091 7.4012-6.8091 7.4012 3.0485 7.4012 6.8091z" transform="matrix(1.24 0 0 1.2391 -76.806 -134.26)" fill="#f8eca8"/>
+ <path id="path5647" d="m310.11 592.67c6.9472 7.841 13.64 7.7894 20.396 0l-0.36421 8.0126c-0.15222 3.3489-0.42867 6.8066-0.91052 10.016-0.92314 6.1482-1.1684 12.482-3.0958 18.393-1.3465 4.1295-5.8274 11.655-5.8274 11.655s-4.5433-8.905-6.0095-13.658c-1.5653-5.074-2.2536-10.392-2.9137-15.661-0.80915-6.4585-1.2747-18.757-1.2747-18.757z" fill="#d1b948"/>
+ <path id="path5673" d="m315.32 652.84s2.6926 1.8756 4.2507 1.9619c1.7207 0.0953 4.9047-1.6349 4.9047-1.6349l1.3079-28.447-5.2316-1.3079-8.7844-10.096s2.0879 14.785 2.2448 19.578c0.2181 6.6592 1.3079 19.946 1.3079 19.946z" fill="#d1b948"/>
+ <path id="path5649" d="m316.85 599.59s4.0734 0.51414 6.0094 0c2.365-0.62806 6.3737-3.6421 6.3737-3.6421s-0.14659 6.6574-1.0926 9.6516c-0.94604 2.9941-1.5128 16.467-2.2528 18.684-1.4493 4.3427-5.7598 10.246-5.7598 9.1317 0 1.1703-4.1976-4.7568-5.4279-10.447-0.54101-2.5022-2.575-16.243-2.8868-18.644-0.31177-2.4007-0.8291-8.7796-0.8291-8.7796l5.8659 4.0448z" fill="#baa440"/>
+ <path id="path5649-3" d="m327.85 598.28s-0.38434 4.7681-1.2366 7.1962-2.6316 4.2534-3.9373 5.741c-1.3056 1.4876-2.7765 2.6582-2.7765 2.6582s-3.0185-3.0528-4.1269-4.8734-1.6878-2.6127-1.9686-4.5596c-0.28086-1.9469-1.1228-6.2025-1.1228-6.2025 5.4328 4.0051 10.34 4.7144 15.169 0.04z" fill="#a39038"/>
+ <path id="path5617-0" d="m327.06 654.38c-2.1435 0.33556-3.8135 1.7285-5.9735 1.9326-2.2242 0.21019-4.5212-0.5533-6.6763-1.142-1.3225-0.36126-2.4982-0.95049-3.8652-1.0542-1.0422-0.079-2.1576 0.1134-3.0746 0.61492-0.99928 0.54654-1.8062 1.4711-2.3718 2.4597-0.64918 1.1346-0.61655 2.2187-0.43923 3.5138 0.17643 1.2886 0.62918 2.469 1.6691 3.2503 0.9938 0.74661 2.4503 1.1322 3.6895 1.2298 1.1154 0.0879 1.8978-0.006 2.9867-0.26353 1.7044-0.40236 4.568-1.3177 4.568-1.3177s-2.2193 3.15 [...]
+ <path id="path5619-2" d="m317.67 666.99c0.35311 1.8553-0.17107 3.2243 0.59412 4.951 0.48678 1.0984 1.6736 2.0874 2.8716 2.1784 1.3107 0.0996 3.8618-1.7824 3.8618-1.7824s0.0774 3.0146-0.9902 4.2578c-0.83639 0.97405-2.578 1.6724-3.8618 1.6833-1.2424 0.0106-2.535-0.39387-3.5647-1.0892-0.91419-0.61737-1.7118-1.5344-2.0794-2.5745-0.35194-0.99585-0.23676-2.1393 0-3.1686 0.57576-2.5032 3.3667-6.9314 3.3667-6.9314s-0.32224 1.823-0.19805 2.4755z" fill="#f8eca8"/>
+ </g>
+ <g id="g6793">
+ <g id="g6565">
+ <g id="g6547" transform="translate(-1.8439 .25406)">
+ <path id="path7273-1-7-9-4" d="m287.42 508.65c4.628 0 8.375 3.747 8.375 8.375 0 1.4715-0.39635 2.8606-1.0625 4.0625 0.37937-0.0595 0.76016-0.0937 1.1562-0.0937 4.1138 0 7.4688 3.3237 7.4688 7.4375 0 3.9855-3.1566 7.2684-7.0938 7.4688-2.6045 17.872-5.6264 35.252-5.8438 52.719-0.2433 19.556 2.5407 39.254 4.9062 59.969 0.18921-0.0145 0.36955-0.0312 0.5625-0.0312 4.1138 0 7.4688 3.3549 7.4688 7.4688 0 4.1138-3.3549 7.4375-7.4688 7.4375-0.39609 0-0.77688-0.0342-1.1562-0.0937 0.666 [...]
+ <g id="g6429" transform="translate(0 -.25406)">
+ <path id="path7273-1-7-9" d="m285.7 508.9c4.628 0 8.375 3.747 8.375 8.375 0 1.4715-0.39635 2.8606-1.0625 4.0625 0.37937-0.0595 0.76016-0.0937 1.1562-0.0937 4.1138 0 7.4688 3.3237 7.4688 7.4375 0 3.9855-3.1566 7.2684-7.0938 7.4688-2.6045 17.872-5.6264 35.252-5.8438 52.719-0.2433 19.556 2.5407 39.254 4.9062 59.969 0.18921-0.0145 0.36955-0.0312 0.5625-0.0312 4.1138 0 7.4688 3.3549 7.4688 7.4688 0 4.1138-3.3549 7.4375-7.4688 7.4375-0.39609 0-0.77688-0.0342-1.1562-0.0937 0.66615 [...]
+ <path id="path5617-8" d="m292.6 534.3c-2.1435-0.33556-3.8135-0.60145-5.9735-0.80557-2.2242-0.21019-2.6139 0.29321-4.769 0.8819-1.3225 0.36126-2.4982 0.95049-3.8652 1.0542-1.0422 0.079-2.1576-0.1134-3.0746-0.61492-0.99928-0.54654-1.8062-1.4711-2.3718-2.4597-0.64918-1.1346-0.61655-2.2187-0.43923-3.5138 0.17643-1.2886 0.62918-2.469 1.6691-3.2503 0.9938-0.74661 2.4503-1.1322 3.6895-1.2298 1.1154-0.0879 1.8978 0.006 2.9867 0.26353 1.7044 0.40236 2.6607 0.45074 2.6607 0.45074s-2.6 [...]
+ <path id="path5619-3" d="m283.21 521.69c0.35311-1.8553-0.17107-3.2243 0.59412-4.951 0.48678-1.0984 1.6736-2.0874 2.8716-2.1784 1.3107-0.0996 3.8618 1.7824 3.8618 1.7824s0.0774-3.0146-0.9902-4.2578c-0.83639-0.97405-2.578-1.6724-3.8618-1.6833-1.2424-0.0106-2.535 0.39387-3.5647 1.0892-0.91419 0.61737-2.1453 1.7945-2.5129 2.8346-0.35194 0.99585-0.23676 3.2663 0 4.2957 0.57576 2.5032 3.8001 5.5443 3.8001 5.5443s-0.32224-1.823-0.19805-2.4755z" fill="#f8eca8"/>
+ <path id="path5619-9-9" d="m278.29 524.73s-3.0146-0.0774-4.2578 0.9902c-0.97405 0.83639-1.6724 2.578-1.6833 3.8618-0.0106 1.2424 0.39387 2.535 1.0892 3.5647 0.61737 0.91419 1.5344 1.7118 2.5745 2.0794 0.99585 0.35194 2.1393 0.23676 3.1686 0 2.5032-0.57576 5.05-2.1784 5.05-2.1784-4.135 0.0647-7.6933-3.6376-5.9412-8.3177z" fill="#f8eca8"/>
+ <path id="path5617-8-5" d="m292.85 650.72c-2.1435 0.33556-3.8135 0.60145-5.9735 0.80557-2.2242 0.21019-2.6139-0.29321-4.769-0.8819-1.3225-0.36126-2.4982-0.95049-3.8652-1.0542-1.0422-0.079-2.1576 0.1134-3.0746 0.61492-0.99928 0.54654-1.8062 1.4711-2.3718 2.4597-0.64918 1.1346-0.61655 2.2187-0.43923 3.5138 0.17643 1.2886 0.62918 2.469 1.6691 3.2503 0.9938 0.74661 2.4503 1.1322 3.6895 1.2298 1.1154 0.0879 1.8978-0.006 2.9867-0.26353 1.7044-0.40236 2.6607-0.45074 2.6607-0.45074s [...]
+ <path id="path5619-3-2" d="m283.46 663.34c0.35311 1.8553-0.17107 3.2243 0.59412 4.951 0.48678 1.0984 1.6736 2.0874 2.8716 2.1784 1.3107 0.0996 3.8618-1.7824 3.8618-1.7824s0.0774 3.0146-0.9902 4.2578c-0.83639 0.97405-2.578 1.6724-3.8618 1.6833-1.2424 0.0106-2.535-0.39387-3.5647-1.0892-0.91419-0.61737-2.1453-1.7945-2.5129-2.8346-0.35194-0.99585-0.23676-3.2663 0-4.2957 0.57576-2.5032 3.8001-5.5443 3.8001-5.5443s-0.32224 1.823-0.19805 2.4755z" fill="#f8eca8"/>
+ <path id="path5619-9-9-2" d="m278.54 660.3s-3.0146 0.0774-4.2578-0.9902c-0.97405-0.83639-1.6724-2.578-1.6833-3.8618-0.0106-1.2424 0.39387-2.535 1.0892-3.5647 0.61737-0.91419 1.5344-1.7118 2.5745-2.0794 0.99585-0.35194 2.1393-0.23676 3.1686 0 2.5032 0.57576 5.05 2.1784 5.05 2.1784-4.135-0.0647-7.6933 3.6376-5.9412 8.3177z" fill="#f8eca8"/>
+ <path id="path5613-7" d="m279.65 536.8s0.97507-1.2398 2.3936-1.7353c1.4185-0.49549 3.2805-0.2466 4.0852-0.12719 0.8252 0.12283 2.8769 0.6398 4.1768 1.5526 1.2999 0.91276 1.8482 2.2208 1.8482 2.2208l-0.52579 7.8176c0.65129 7.509-8.5984 11.717-18.423 10.446 0.46084-6.98 4.1871-13.466 6.4453-20.174z" fill="#d1b948"/>
+ <path id="path5615-3" d="m289.85 548.02c1.3621-2.9448 2.642-6.9431 0.63759-9.5629-0.33708-0.44058-0.75473-0.81315-1.2304-1.1208-2.4612-1.5919-6.4768-1.4467-8.9334 0.007l-3.4093 7.3642s3.5521 0.64036 5.3771 1.7456c1.067 0.64618 1.895 1.662 2.3929 2.7345 0.49777 1.0722 2.3021 2.2124 2.3021 2.2124s2.003-1.5197 2.8634-3.3797z" fill="#baa440"/>
+ <path id="path5643-7" d="m268.03 590.46c4.7883 8.9004 14.378 10.379 19.514 0.70141-0.54618-12.247-1.092-24.414 2.533-32.817 0 0-7.6003 3.1612-10.113 4.6565-3.1098 1.8507-8.9788 2.1604-8.9788 2.1604s-1.5133 6.0467-1.7659 8.8294c-0.50358 5.5491-1.1891 16.47-1.1891 16.47z" fill="#f6e078"/>
+ <path id="path5645-9" d="m327.43 581.68c0 3.7606-3.3136 6.8091-7.4012 6.8091s-7.4012-3.0485-7.4012-6.8091 3.3136-6.8091 7.4012-6.8091 7.4012 3.0485 7.4012 6.8091z" transform="matrix(1.24 0 0 1.2391 -119.03 -133.87)" fill="#f8eca8"/>
+ <path id="path5647-0" d="m268.15 593.39c6.9472 7.841 13.016 7.9455 19.771 0.15614-1.4647 15.983 1.3865 31.711 2.798 47.571 0.15048 3.2018 0.90397 6.2744-0.2982 7.2749-3.8388 3.1949-8.2849 1.1303-7.7011 1.3492 0 0-6.7293-17.025-8.1955-21.777-1.5653-5.074-4.4396-15.233-5.0997-20.501-0.80915-6.4585-1.2747-14.072-1.2747-14.072z" fill="#d1b948"/>
+ <path id="path5649-2" d="m274.88 600.31s4.0734 0.51414 6.0094 0c2.365-0.62806 6.0614-3.7982 6.0614-3.7982-1.3259 9.4517 0.0704 19.062-0.69104 28.492-1.4493 4.3427-3.1053 10.402-3.1053 9.2878 0 1.1703-6.852-4.913-8.0823-10.603-0.54101-2.5022-3.9803-13.901-4.2921-16.302-0.31177-2.4007-1.766-11.122-1.766-11.122l5.8659 4.0448z" fill="#baa440"/>
+ <path id="path5649-3-3" d="m285.88 598.99s-0.38434 4.7681-1.2366 7.1962-0.60177 2.3797-1.9074 3.8673-1.9958 5.1565-1.9958 5.1565-5.0484-3.209-6.1568-5.0295c-1.1084-1.8206-2.4685-3.0812-2.7494-5.028-0.28086-1.9469-1.1228-6.2025-1.1228-6.2025 5.4328 4.0051 10.34 4.7144 15.169 0.04v-0.00002z" fill="#a39038"/>
+ </g>
+ </g>
+ <g id="g6507" transform="translate(-4.1487 -.36747)">
+ <path id="path7273-1-5-8" d="m259.85 513.89c-3.3969 0.14447-6.5102 3.0085-7.2812 7-0.10156 0.52572-0.17226 1.0484-0.1875 1.5625-0.27271-0.093-0.52259-0.16275-0.8125-0.21875-3.7109-0.71688-7.3746 1.9848-8.1562 6.0312-0.69619 3.6038 1.1275 7.063 4.1562 8.2812-5.2017 8.8412-14.205 28.754-14.875 49.188-0.93402 28.488 13.938 51.556 18.25 63.062-0.72152-0.11705-1.4676-0.11385-2.2188 0.0312-3.7109 0.71688-6.0942 4.5786-5.3125 8.625 0.78169 4.0464 4.4453 6.7481 8.1562 6.0312 0.28991- [...]
+ <g id="g6413" transform="translate(0 .97283)">
+ <path id="path7273-1-5" d="m257.92 512.92c-3.3969 0.14447-6.5102 3.0085-7.2812 7-0.10156 0.52572-0.17226 1.0484-0.1875 1.5625-0.27271-0.093-0.52259-0.16275-0.8125-0.21875-3.7109-0.71688-7.3746 1.9848-8.1562 6.0312-0.69619 3.6038 1.1275 7.063 4.1562 8.2812-5.2017 8.8412-14.205 28.754-14.875 49.188-0.93402 28.488 13.938 51.556 18.25 63.062-0.72152-0.11705-1.4676-0.11385-2.2188 0.0312-3.7109 0.71688-6.0942 4.5786-5.3125 8.625 0.78169 4.0464 4.4453 6.7481 8.1562 6.0312 0.28991-0 [...]
+ <path id="path5617-8-9" d="m255.54 534.5c-1.9702-0.61421-2.7593-0.68696-4.844-0.63673-1.2793 0.0308-2.4761 0.27657-3.7386 0.0887-0.96253-0.14324-1.9313-0.52213-2.6516-1.1133-0.78493-0.64419-1.3116-1.5579-1.6053-2.4758-0.33705-1.0535-0.0671-3.0643 0.3809-4.0838 0.44574-1.0144 1.4421-2.615 2.5583-3.0441 1.0667-0.41016 2.473-0.43411 3.6182-0.2668 1.0309 0.15057 1.7196 0.38289 2.6499 0.80955 1.4563 0.66721 0.93521 0.41093 0.93521 0.41093s-0.82449-0.11657-1.0133-2.132c-0.0988-1.0 [...]
+ <path id="path5619-3-9" d="m256.47 520.27c0.73378-0.95135 2.1215-1.6301 3.3069-1.4339 1.2968 0.21461 3.3278 2.6487 3.3278 2.6487s0.79129-2.9099 0.0496-4.3712c-0.58106-1.1449-2.1069-2.2369-3.3514-2.5525-1.2043-0.30543-2.556-0.2196-3.7214 0.21125-1.0347 0.38254-2.5102 1.2335-3.1143 2.1565-0.57843 0.88374-1.0059 3.1166-1.0204 4.1727 2.3175 7.0112 2.4493 0.74951 4.5232-0.83154z" fill="#f8eca8"/>
+ <path id="path5619-9-9-7" d="m249.86 523.4s-2.9099-0.79129-4.3712-0.0496c-1.1448 0.58106-2.2369 2.1069-2.5525 3.3514-0.30542 1.2043-0.21959 2.556 0.21126 3.7214 0.38254 1.0347 1.0839 2.0273 2.0069 2.6315 0.88374 0.57842 2.0218 0.73816 3.0779 0.75269 2.5683 0.0354 5.4229-0.91645 5.4229-0.91645-4.032-0.91941-6.609-5.361-3.7953-9.4909z" fill="#f8eca8"/>
+ <path id="path5617-8-9-0" d="m255.14 649.11c-1.9702 0.61421-2.7593 0.68696-4.844 0.63673-1.2793-0.0308-2.4761-0.27657-3.7386-0.0887-0.96253 0.14324-1.9313 0.52213-2.6516 1.1133-0.78493 0.64419-1.3116 1.5579-1.6053 2.4758-0.33705 1.0535-0.0671 3.0643 0.3809 4.0838 0.44574 1.0144 1.4421 2.615 2.5583 3.0441 1.0667 0.41016 2.473 0.43411 3.6182 0.2668 1.0309-0.15057 1.7196-0.38289 2.6499-0.80955 1.4563-0.66721 0.9352-0.41093 0.9352-0.41093s-0.82448 0.11657-1.0133 2.132c-0.0988 1. [...]
+ <path id="path5619-3-9-3" d="m256.06 663.34c0.73378 0.95135 2.1215 1.6301 3.3069 1.4339 1.2968-0.21461 3.3278-2.6487 3.3278-2.6487s0.79129 2.9099 0.0496 4.3712c-0.58106 1.1449-2.1069 2.2369-3.3514 2.5525-1.2043 0.30543-2.556 0.2196-3.7214-0.21125-1.0347-0.38254-2.5102-1.2335-3.1143-2.1565-0.57842-0.88374-1.0059-3.1166-1.0204-4.1727 2.3175-7.0112 2.4493-0.74951 4.5232 0.83154z" fill="#f8eca8"/>
+ <path id="path5619-9-9-7-9" d="m249.45 660.21s-2.9099 0.79129-4.3712 0.0496c-1.1448-0.58106-2.2369-2.1069-2.5525-3.3514-0.30542-1.2043-0.21959-2.556 0.21126-3.7214 0.38254-1.0347 1.0839-2.0273 2.0069-2.6315 0.88374-0.57842 2.0218-0.73816 3.0779-0.75269 2.5683-0.0354 5.4229 0.91645 5.4229 0.91645-4.032 0.91941-6.609 5.361-3.7953 9.4909z" fill="#f8eca8"/>
+ <path id="path5613-7-8" d="m247.91 535.86s1.1729-1.0547 2.6553-1.3001c1.4824-0.24541 3.2743 0.31846 4.0467 0.57382 0.792 0.26224 2.725 1.1227 3.8495 2.2445 1.1246 1.1218 1.4408 2.5043 1.4408 2.5043l-1.8559 7.6123c-0.64341 7.5097-10.477 10.073-19.939 7.1385 1.6486-6.7982 6.4299-12.551 9.8028-18.773z" fill="#d1b948"/>
+ <path id="path5615-3-6" d="m256.04 548.67c1.846-2.6682 3.7913-6.3886 2.2648-9.3127-0.25671-0.49177-0.60443-0.93032-1.0205-1.3149-2.1524-1.9896-6.1336-2.5338-8.8028-1.522l-4.6193 6.6721s3.3901 1.2388 4.9991 2.6401c0.9407 0.81926 1.5826 1.9618 1.8896 3.1037 0.30693 1.1416 1.8895 2.5737 1.8895 2.5737s2.2336-1.1545 3.3996-2.8398z" fill="#baa440"/>
+ <path id="path5643-7-5" d="m231.82 592.08c3.9293 8.147 12.082 8.8234 18.106 1.2803 0.61459-12.226-0.77728-14.21 1.7419-28.146-3.7734-1.9904-7.9965 4.2404-14.63-4.8394 0 0-3.3305 11.628-3.8439 14.375-1.0237 5.4771-1.3747 17.33-1.3747 17.33z" fill="#f6e078"/>
+ <path id="path5645-9-7" d="m327.43 581.68c0 3.7606-3.3136 6.8091-7.4012 6.8091s-7.4012-3.0485-7.4012-6.8091 3.3136-6.8091 7.4012-6.8091 7.4012 3.0485 7.4012 6.8091z" transform="matrix(1.2345 .11672 -.11663 1.2336 -86.596 -166.73)" fill="#f8eca8"/>
+ <path id="path6114" d="m251.73 647.74s2.3226 0.22324 3.4511 0c1.9759-0.39088 5.5875-2.3007 5.5875-2.3007s-7.1438-20.127-9.2029-30.567c-1.2035-6.1017-1.8077-18.57-1.8077-18.57-6.9257 4.7212-12.158 5.4042-17.584-1.3147 0 0 2.4663 13.101 4.6014 19.392 3.9166 11.54 14.955 33.36 14.955 33.36z" fill="#d1b948"/>
+ <path id="path5649-2-2-0" d="m248.96 597.36c-0.206 9.542 2.9673 18.921 3.3193 28.376-0.92894 4.4829-1.0397 9.0515-1.1706 7.945 0.13752 1.1622-7.3819-4.5667-9.2724-10.073-0.8313-2.4213-5.2576-11.529-5.8493-13.876-0.59173-2.3474-2.732-12.152-2.732-12.152 5.211 4.3754 10.734 4.4631 15.705-0.21958z" fill="#baa440"/>
+ <path id="path5649-3-3-7-3" d="m248.98 597.95s-0.068 4.7831-0.75782 7.2623c-0.68975 2.4792-0.44302 2.4143-1.6474 3.985s-1.6503 5.2772-1.6503 5.2772-5.2496-2.8679-6.476-4.6112c-1.2264-1.7432-2.6669-2.9111-3.076-4.8351-0.40905-1.924-1.5307-6.1146-1.5307-6.1146 5.6858 3.6369 10.629 4.0201 15.138-0.96363v-0.00002z" fill="#a39038"/>
+ </g>
+ </g>
+ <g id="g6467" transform="translate(-3.2268 -.25785)">
+ <path id="path7273-5-9-8-3" d="m228.83 522.6c-4.1138 0-7.4688 3.3237-7.4688 7.4375 0 1.2331 0.0617 5.9728-0.65625 8.4688-0.22233 0.77292-0.51937 1.5324-0.84375 2.25-1.7293-0.38414-17.848 22.711-18.938 43.5-1.6049 30.627 12.169 48.69 20.312 59.156 0.55464 1.0976 1.1001 2.2808 1.4688 3.5625 0.71796 2.496 0.65625 7.2357 0.65625 8.4688 0 4.1138 3.3549 7.4375 7.4688 7.4375 4.1138 0 7.4375-3.3237 7.4375-7.4375 0-0.49253-0.0651-0.97168-0.15625-1.4375 2.7841-1.0788 4.7812-3.7724 4.78 [...]
+ <g id="g6396" transform="translate(34.566 .86320)">
+ <path id="path7273-5-9-8" d="m192.07 521.74c-4.1138 0-7.4688 3.3237-7.4688 7.4375 0 1.2331 0.0617 5.9728-0.65625 8.4688-0.22233 0.77292-0.51937 1.5324-0.84375 2.25-1.7293-0.38414-17.848 22.711-18.938 43.5-1.6049 30.627 12.169 48.69 20.312 59.156 0.55464 1.0976 1.1001 2.2808 1.4688 3.5625 0.71796 2.496 0.65625 7.2357 0.65625 8.4688 0 4.1138 3.3549 7.4375 7.4688 7.4375 4.1138 0 7.4375-3.3237 7.4375-7.4375 0-0.49253-0.0651-0.97168-0.15625-1.4375 2.7841-1.0788 4.7812-3.7724 4.78 [...]
+ <path id="path5617-8-9-9" d="m185.86 529.83c-0.0966-0.94831-0.14188-2.0841 0.2177-2.9882 0.29944-0.75307 1.3531-2.208 2.0535-2.7498 0.85054-0.65802 1.7017-0.84065 2.8526-0.99203 1.0154-0.13357 2.1261-0.11733 3.074 0.21186 1.19 0.41329 1.9794 1.0901 2.6132 2.0191 0.52895 0.77533 0.98308 1.757 0.94457 2.6464-0.0278 0.63985-0.3229 2.3542-0.70346 2.912-0.35334 0.51787-0.40861 0.96101-0.90003 1.3953-1.2326 1.0892-1.3479 1.1564-1.3479 1.1564s1.5038-0.69383 3.5658-0.22229c1.1818 0. [...]
+ <path id="path5619-9-9-7-99" d="m195.35 532.71s2.9099-0.79129 4.3712-0.0496c1.1448 0.58106 2.2369 2.1069 2.5525 3.3514 0.30542 1.2043 0.21959 2.556-0.21126 3.7214-0.38254 1.0347-1.0839 2.0273-2.0069 2.6315-0.88374 0.57842-2.0218 0.73816-3.0779 0.75269-2.5683 0.0354-5.4229-0.91645-5.4229-0.91645 4.032-0.91941 6.609-5.361 3.7953-9.4909z" fill="#f8eca8"/>
+ <path id="path5619-3-9-7" d="m190.36 529.08c0.73378-0.95135 2.1215-1.6301 3.3069-1.4339 1.2968 0.21461 3.3278 2.6487 3.3278 2.6487s0.79129-2.9099 0.0496-4.3712c-0.58106-1.1449-2.1069-2.2369-3.3514-2.5525-1.2043-0.30543-2.556-0.2196-3.7214 0.21125-1.0347 0.38254-2.5102 1.2335-3.1143 2.1565-0.57843 0.88374-1.0059 3.1166-1.0204 4.1727 2.3175 7.0112 2.4493 0.74951 4.5232-0.83154z" fill="#f8eca8"/>
+ <path id="path5613-7-8-2" d="m182.24 542s0.95074-0.80113 2.0182-0.86756c1.0675-0.0665 1.4907 0.60184 1.9997 0.9006 0.52182 0.3067 1.7682 1.247 2.4167 2.3344 0.64849 1.0874 0.69928 2.3215 0.69928 2.3215l-2.2374 5.5249c-1.3764 6.4691-7.5075 8.9409-13.766 5.4498 1.992-5.7504 5.7425-10.585 8.8699-15.664z" fill="#d1b948"/>
+ <path id="path5615-3-6-3" d="m188.32 546.07c-0.11894-0.45328-0.30819-0.86928-0.55187-1.2451-1.2607-1.9444-3.3704-2.8126-5.3628-2.1972l-3.4462 6.2593s1.0017 0.50076 1.9546 1.8794c0.55717 0.80601 0.86543 1.8636 0.93939 2.8875 0.074 1.0236 1.6135 2.4264 1.6135 2.4264 2.411-2.2229 4.3194-6.0641 4.8534-10.01z" fill="#baa440"/>
+ <path id="path5643-7-5-5" d="m165.05 592.72c5.114 5.9751 11.252 3.5428 15.359-0.48565 0.61459-12.226-1.5621-12.444 0.95703-26.38-3.7734-1.9904-3.2874 4.6328-9.9205-4.4469 0 0-4.5078 11.236-5.0211 13.983-1.0237 5.4771-1.3747 17.33-1.3747 17.33z" fill="#f6e078"/>
+ <path id="path5645-9-7-6" d="m327.43 581.68c0 3.7606-3.3136 6.8091-7.4012 6.8091s-7.4012-3.0485-7.4012-6.8091 3.3136-6.8091 7.4012-6.8091 7.4012 3.0485 7.4012 6.8091z" transform="matrix(1.0388 .11385 -.098147 1.2033 -103.09 -149.22)" fill="#f8eca8"/>
+ <path id="path6114-5" d="m185.14 641.15s2.2355-0.37935 3.3118-0.63458c1.8846-0.44687 5.9376-0.31262 5.9376-0.31262-0.44903 0.67355-9.9223-16.151-10.994-28.347-0.54376-6.1863-2.2845-18.511-2.2845-18.511-3.2286 2.4394-5.4515 3.4224-7.9698 3.6484-2.5567 0.22941-5.4046-0.34156-8.128-3.6474-1.1394 10.877 9.5755 33.243 20.127 47.804v0.00001 0.00029z" fill="#d1b948"/>
+ <path id="path5649-2-2-0-8" d="m180.37 594.42c0.0848 9.5437 3.4077 18.829 4.0254 28.269-0.75873 4.5073-0.72979 9.0771-0.88819 7.9748 0.16638 1.1577-7.2192-4.3549-9.1964-9.8051-0.86943-2.3966-5.3867-11.375-6.0241-13.704-0.63735-2.3296-2.9815-12.069-2.9815-12.069 5.1303 4.2254 10.433 4.1561 15.065-0.66585z" fill="#baa440"/>
+ <path id="path5649-3-3-7-3-1" d="m179.9 595.73s0.0763 4.783-0.51224 7.2806c-0.58852 2.4977-0.64319 2.1363-1.7525 3.7406-1.1093 1.6042-0.63129 4.8875-0.63129 4.8875s-5.1227-2.7175-6.3512-4.4251-2.1171-2.3056-2.5666-4.2172-1.65-6.0684-1.65-6.0684c5.564 3.4737 9.2839 3.9117 13.464-1.198v-0.00002z" fill="#a39038"/>
+ <path id="path5617-8-9-9-4" d="m188.29 653.62c-0.0966 0.94831-0.14188 2.0841 0.2177 2.9882 0.29944 0.75307 1.3531 2.208 2.0535 2.7498 0.85054 0.65802 1.7017 0.84065 2.8526 0.99203 1.0154 0.13357 2.1261 0.11733 3.074-0.21186 1.19-0.41329 1.9794-1.0901 2.6132-2.0191 0.52895-0.77533 0.98308-1.757 0.94457-2.6464-0.0278-0.63985-0.3229-2.3542-0.70346-2.912-0.35334-0.51787-0.40861-0.96101-0.90003-1.3953-1.2326-1.0892-1.3479-1.1564-1.3479-1.1564s1.5038 0.69383 3.5658 0.22229c1.1818- [...]
+ <path id="path5619-9-9-7-99-7" d="m197.78 650.74s2.9099 0.79129 4.3712 0.0496c1.1448-0.58106 2.2369-2.1069 2.5525-3.3514 0.30542-1.2043 0.21959-2.556-0.21126-3.7214-0.38254-1.0347-1.0839-2.0273-2.0069-2.6315-0.88374-0.57842-2.0218-0.73816-3.0779-0.75269-2.5683-0.0354-5.4229 0.91645-5.4229 0.91645 4.032 0.91941 6.609 5.361 3.7953 9.4909z" fill="#f8eca8"/>
+ <path id="path5619-3-9-7-1" d="m192.8 654.37c0.73378 0.95135 2.1215 1.6301 3.3069 1.4339 1.2968-0.21461 3.3278-2.6487 3.3278-2.6487s0.79129 2.9099 0.0496 4.3712c-0.58106 1.1449-2.1069 2.2369-3.3514 2.5525-1.2043 0.30543-2.556 0.2196-3.7214-0.21125-1.0347-0.38254-2.5102-1.2335-3.1143-2.1565-0.57843-0.88374-1.0059-3.1166-1.0204-4.1727 2.3175-7.0112 2.4493-0.74951 4.5232 0.83154z" fill="#f8eca8"/>
+ </g>
+ </g>
+ </g>
+ <g id="g6565-8" transform="matrix(-1 0 0 1 640.29 0)">
+ <g id="g6547-0" transform="translate(-1.8439 .25406)">
+ <path id="path7273-1-7-9-4-4" d="m287.42 508.65c4.628 0 8.375 3.747 8.375 8.375 0 1.4715-0.39635 2.8606-1.0625 4.0625 0.37937-0.0595 0.76016-0.0937 1.1562-0.0937 4.1138 0 7.4688 3.3237 7.4688 7.4375 0 3.9855-3.1566 7.2684-7.0938 7.4688-2.6045 17.872-5.6264 35.252-5.8438 52.719-0.2433 19.556 2.5407 39.254 4.9062 59.969 0.18921-0.0145 0.36955-0.0312 0.5625-0.0312 4.1138 0 7.4688 3.3549 7.4688 7.4688 0 4.1138-3.3549 7.4375-7.4688 7.4375-0.39609 0-0.77688-0.0342-1.1562-0.0937 0.6 [...]
+ <g id="g6429-6" transform="translate(0 -.25406)">
+ <path id="path7273-1-7-9-0" d="m285.7 508.9c4.628 0 8.375 3.747 8.375 8.375 0 1.4715-0.39635 2.8606-1.0625 4.0625 0.37937-0.0595 0.76016-0.0937 1.1562-0.0937 4.1138 0 7.4688 3.3237 7.4688 7.4375 0 3.9855-3.1566 7.2684-7.0938 7.4688-2.6045 17.872-5.6264 35.252-5.8438 52.719-0.2433 19.556 2.5407 39.254 4.9062 59.969 0.18921-0.0145 0.36955-0.0312 0.5625-0.0312 4.1138 0 7.4688 3.3549 7.4688 7.4688 0 4.1138-3.3549 7.4375-7.4688 7.4375-0.39609 0-0.77688-0.0342-1.1562-0.0937 0.6661 [...]
+ <path id="path5617-8-3" d="m292.6 534.3c-2.1435-0.33556-3.8135-0.60145-5.9735-0.80557-2.2242-0.21019-2.6139 0.29321-4.769 0.8819-1.3225 0.36126-2.4982 0.95049-3.8652 1.0542-1.0422 0.079-2.1576-0.1134-3.0746-0.61492-0.99928-0.54654-1.8062-1.4711-2.3718-2.4597-0.64918-1.1346-0.61655-2.2187-0.43923-3.5138 0.17643-1.2886 0.62918-2.469 1.6691-3.2503 0.9938-0.74661 2.4503-1.1322 3.6895-1.2298 1.1154-0.0879 1.8978 0.006 2.9867 0.26353 1.7044 0.40236 2.6607 0.45074 2.6607 0.45074s-2 [...]
+ <path id="path5619-3-26" d="m283.21 521.69c0.35311-1.8553-0.17107-3.2243 0.59412-4.951 0.48678-1.0984 1.6736-2.0874 2.8716-2.1784 1.3107-0.0996 3.8618 1.7824 3.8618 1.7824s0.0774-3.0146-0.9902-4.2578c-0.83639-0.97405-2.578-1.6724-3.8618-1.6833-1.2424-0.0106-2.535 0.39387-3.5647 1.0892-0.91419 0.61737-2.1453 1.7945-2.5129 2.8346-0.35194 0.99585-0.23676 3.2663 0 4.2957 0.57576 2.5032 3.8001 5.5443 3.8001 5.5443s-0.32224-1.823-0.19805-2.4755z" fill="#f8eca8"/>
+ <path id="path5619-9-9-9" d="m278.29 524.73s-3.0146-0.0774-4.2578 0.9902c-0.97405 0.83639-1.6724 2.578-1.6833 3.8618-0.0106 1.2424 0.39387 2.535 1.0892 3.5647 0.61737 0.91419 1.5344 1.7118 2.5745 2.0794 0.99585 0.35194 2.1393 0.23676 3.1686 0 2.5032-0.57576 5.05-2.1784 5.05-2.1784-4.135 0.0647-7.6933-3.6376-5.9412-8.3177z" fill="#f8eca8"/>
+ <path id="path5617-8-5-4" d="m292.85 650.72c-2.1435 0.33556-3.8135 0.60145-5.9735 0.80557-2.2242 0.21019-2.6139-0.29321-4.769-0.8819-1.3225-0.36126-2.4982-0.95049-3.8652-1.0542-1.0422-0.079-2.1576 0.1134-3.0746 0.61492-0.99928 0.54654-1.8062 1.4711-2.3718 2.4597-0.64918 1.1346-0.61655 2.2187-0.43923 3.5138 0.17643 1.2886 0.62918 2.469 1.6691 3.2503 0.9938 0.74661 2.4503 1.1322 3.6895 1.2298 1.1154 0.0879 1.8978-0.006 2.9867-0.26353 1.7044-0.40236 2.6607-0.45074 2.6607-0.4507 [...]
+ <path id="path5619-3-2-1" d="m283.46 663.34c0.35311 1.8553-0.17107 3.2243 0.59412 4.951 0.48678 1.0984 1.6736 2.0874 2.8716 2.1784 1.3107 0.0996 3.8618-1.7824 3.8618-1.7824s0.0774 3.0146-0.9902 4.2578c-0.83639 0.97405-2.578 1.6724-3.8618 1.6833-1.2424 0.0106-2.535-0.39387-3.5647-1.0892-0.91419-0.61737-2.1453-1.7945-2.5129-2.8346-0.35194-0.99585-0.23676-3.2663 0-4.2957 0.57576-2.5032 3.8001-5.5443 3.8001-5.5443s-0.32224 1.823-0.19805 2.4755z" fill="#f8eca8"/>
+ <path id="path5619-9-9-2-3" d="m278.54 660.3s-3.0146 0.0774-4.2578-0.9902c-0.97405-0.83639-1.6724-2.578-1.6833-3.8618-0.0106-1.2424 0.39387-2.535 1.0892-3.5647 0.61737-0.91419 1.5344-1.7118 2.5745-2.0794 0.99585-0.35194 2.1393-0.23676 3.1686 0 2.5032 0.57576 5.05 2.1784 5.05 2.1784-4.135-0.0647-7.6933 3.6376-5.9412 8.3177z" fill="#f8eca8"/>
+ <path id="path5613-7-7" d="m279.65 536.8s0.97507-1.2398 2.3936-1.7353c1.4185-0.49549 3.2805-0.2466 4.0852-0.12719 0.8252 0.12283 2.8769 0.6398 4.1768 1.5526 1.2999 0.91276 1.8482 2.2208 1.8482 2.2208l-0.52579 7.8176c0.65129 7.509-8.5984 11.717-18.423 10.446 0.46084-6.98 4.1871-13.466 6.4453-20.174z" fill="#d1b948"/>
+ <path id="path5615-3-8" d="m289.85 548.02c1.3621-2.9448 2.642-6.9431 0.63759-9.5629-0.33708-0.44058-0.75473-0.81315-1.2304-1.1208-2.4612-1.5919-6.4768-1.4467-8.9334 0.007l-3.4093 7.3642s3.5521 0.64036 5.3771 1.7456c1.067 0.64618 1.895 1.662 2.3929 2.7345 0.49777 1.0722 2.3021 2.2124 2.3021 2.2124s2.003-1.5197 2.8634-3.3797z" fill="#baa440"/>
+ <path id="path5643-7-8" d="m268.03 590.46c4.7883 8.9004 14.378 10.379 19.514 0.70141-0.54618-12.247-1.092-24.414 2.533-32.817 0 0-7.6003 3.1612-10.113 4.6565-3.1098 1.8507-8.9788 2.1604-8.9788 2.1604s-1.5133 6.0467-1.7659 8.8294c-0.50358 5.5491-1.1891 16.47-1.1891 16.47z" fill="#f6e078"/>
+ <path id="path5645-9-3" d="m327.43 581.68c0 3.7606-3.3136 6.8091-7.4012 6.8091s-7.4012-3.0485-7.4012-6.8091 3.3136-6.8091 7.4012-6.8091 7.4012 3.0485 7.4012 6.8091z" transform="matrix(1.24 0 0 1.2391 -119.03 -133.87)" fill="#f8eca8"/>
+ <path id="path5647-0-8" d="m268.15 593.39c6.9472 7.841 13.016 7.9455 19.771 0.15614-1.4647 15.983 1.3865 31.711 2.798 47.571 0.15048 3.2018 0.90397 6.2744-0.2982 7.2749-3.8388 3.1949-8.2849 1.1303-7.7011 1.3492 0 0-6.7293-17.025-8.1955-21.777-1.5653-5.074-4.4396-15.233-5.0997-20.501-0.80915-6.4585-1.2747-14.072-1.2747-14.072z" fill="#d1b948"/>
+ <path id="path5649-2-1" d="m274.88 600.31s4.0734 0.51414 6.0094 0c2.365-0.62806 6.0614-3.7982 6.0614-3.7982-1.3259 9.4517 0.0704 19.062-0.69104 28.492-1.4493 4.3427-3.1053 10.402-3.1053 9.2878 0 1.1703-6.852-4.913-8.0823-10.603-0.54101-2.5022-3.9803-13.901-4.2921-16.302-0.31177-2.4007-1.766-11.122-1.766-11.122l5.8659 4.0448z" fill="#baa440"/>
+ <path id="path5649-3-3-5" d="m285.88 598.99s-0.38434 4.7681-1.2366 7.1962-0.60177 2.3797-1.9074 3.8673-1.9958 5.1565-1.9958 5.1565-5.0484-3.209-6.1568-5.0295c-1.1084-1.8206-2.4685-3.0812-2.7494-5.028-0.28086-1.9469-1.1228-6.2025-1.1228-6.2025 5.4328 4.0051 10.34 4.7144 15.169 0.04v-0.00002z" fill="#a39038"/>
+ </g>
+ </g>
+ <g id="g6507-3" transform="translate(-4.1487 -.36747)">
+ <path id="path7273-1-5-8-5" d="m259.85 513.89c-3.3969 0.14447-6.5102 3.0085-7.2812 7-0.10156 0.52572-0.17226 1.0484-0.1875 1.5625-0.27271-0.093-0.52259-0.16275-0.8125-0.21875-3.7109-0.71688-7.3746 1.9848-8.1562 6.0312-0.69619 3.6038 1.1275 7.063 4.1562 8.2812-5.2017 8.8412-14.205 28.754-14.875 49.188-0.93402 28.488 13.938 51.556 18.25 63.062-0.72152-0.11705-1.4676-0.11385-2.2188 0.0312-3.7109 0.71688-6.0942 4.5786-5.3125 8.625 0.78169 4.0464 4.4453 6.7481 8.1562 6.0312 0.2899 [...]
+ <g id="g6413-4" transform="translate(0 .97283)">
+ <path id="path7273-1-5-3" d="m257.92 512.92c-3.3969 0.14447-6.5102 3.0085-7.2812 7-0.10156 0.52572-0.17226 1.0484-0.1875 1.5625-0.27271-0.093-0.52259-0.16275-0.8125-0.21875-3.7109-0.71688-7.3746 1.9848-8.1562 6.0312-0.69619 3.6038 1.1275 7.063 4.1562 8.2812-5.2017 8.8412-14.205 28.754-14.875 49.188-0.93402 28.488 13.938 51.556 18.25 63.062-0.72152-0.11705-1.4676-0.11385-2.2188 0.0312-3.7109 0.71688-6.0942 4.5786-5.3125 8.625 0.78169 4.0464 4.4453 6.7481 8.1562 6.0312 0.28991 [...]
+ <path id="path5617-8-9-6" d="m255.54 534.5c-1.9702-0.61421-2.7593-0.68696-4.844-0.63673-1.2793 0.0308-2.4761 0.27657-3.7386 0.0887-0.96253-0.14324-1.9313-0.52213-2.6516-1.1133-0.78493-0.64419-1.3116-1.5579-1.6053-2.4758-0.33705-1.0535-0.0671-3.0643 0.3809-4.0838 0.44574-1.0144 1.4421-2.615 2.5583-3.0441 1.0667-0.41016 2.473-0.43411 3.6182-0.2668 1.0309 0.15057 1.7196 0.38289 2.6499 0.80955 1.4563 0.66721 0.93521 0.41093 0.93521 0.41093s-0.82449-0.11657-1.0133-2.132c-0.0988-1 [...]
+ <path id="path5619-3-9-5" d="m256.47 520.27c0.73378-0.95135 2.1215-1.6301 3.3069-1.4339 1.2968 0.21461 3.3278 2.6487 3.3278 2.6487s0.79129-2.9099 0.0496-4.3712c-0.58106-1.1449-2.1069-2.2369-3.3514-2.5525-1.2043-0.30543-2.556-0.2196-3.7214 0.21125-1.0347 0.38254-2.5102 1.2335-3.1143 2.1565-0.57843 0.88374-1.0059 3.1166-1.0204 4.1727 2.3175 7.0112 2.4493 0.74951 4.5232-0.83154z" fill="#f8eca8"/>
+ <path id="path5619-9-9-7-95" d="m249.86 523.4s-2.9099-0.79129-4.3712-0.0496c-1.1448 0.58106-2.2369 2.1069-2.5525 3.3514-0.30542 1.2043-0.21959 2.556 0.21126 3.7214 0.38254 1.0347 1.0839 2.0273 2.0069 2.6315 0.88374 0.57842 2.0218 0.73816 3.0779 0.75269 2.5683 0.0354 5.4229-0.91645 5.4229-0.91645-4.032-0.91941-6.609-5.361-3.7953-9.4909z" fill="#f8eca8"/>
+ <path id="path5617-8-9-0-4" d="m255.14 649.11c-1.9702 0.61421-2.7593 0.68696-4.844 0.63673-1.2793-0.0308-2.4761-0.27657-3.7386-0.0887-0.96253 0.14324-1.9313 0.52213-2.6516 1.1133-0.78493 0.64419-1.3116 1.5579-1.6053 2.4758-0.33705 1.0535-0.0671 3.0643 0.3809 4.0838 0.44574 1.0144 1.4421 2.615 2.5583 3.0441 1.0667 0.41016 2.473 0.43411 3.6182 0.2668 1.0309-0.15057 1.7196-0.38289 2.6499-0.80955 1.4563-0.66721 0.9352-0.41093 0.9352-0.41093s-0.82448 0.11657-1.0133 2.132c-0.0988 [...]
+ <path id="path5619-3-9-3-9" d="m256.06 663.34c0.73378 0.95135 2.1215 1.6301 3.3069 1.4339 1.2968-0.21461 3.3278-2.6487 3.3278-2.6487s0.79129 2.9099 0.0496 4.3712c-0.58106 1.1449-2.1069 2.2369-3.3514 2.5525-1.2043 0.30543-2.556 0.2196-3.7214-0.21125-1.0347-0.38254-2.5102-1.2335-3.1143-2.1565-0.57842-0.88374-1.0059-3.1166-1.0204-4.1727 2.3175-7.0112 2.4493-0.74951 4.5232 0.83154z" fill="#f8eca8"/>
+ <path id="path5619-9-9-7-9-1" d="m249.45 660.21s-2.9099 0.79129-4.3712 0.0496c-1.1448-0.58106-2.2369-2.1069-2.5525-3.3514-0.30542-1.2043-0.21959-2.556 0.21126-3.7214 0.38254-1.0347 1.0839-2.0273 2.0069-2.6315 0.88374-0.57842 2.0218-0.73816 3.0779-0.75269 2.5683-0.0354 5.4229 0.91645 5.4229 0.91645-4.032 0.91941-6.609 5.361-3.7953 9.4909z" fill="#f8eca8"/>
+ <path id="path5613-7-8-7" d="m247.91 535.86s1.1729-1.0547 2.6553-1.3001c1.4824-0.24541 3.2743 0.31846 4.0467 0.57382 0.792 0.26224 2.725 1.1227 3.8495 2.2445 1.1246 1.1218 1.4408 2.5043 1.4408 2.5043l-1.8559 7.6123c-0.64341 7.5097-10.477 10.073-19.939 7.1385 1.6486-6.7982 6.4299-12.551 9.8028-18.773z" fill="#d1b948"/>
+ <path id="path5615-3-6-5" d="m256.04 548.67c1.846-2.6682 3.7913-6.3886 2.2648-9.3127-0.25671-0.49177-0.60443-0.93032-1.0205-1.3149-2.1524-1.9896-6.1336-2.5338-8.8028-1.522l-4.6193 6.6721s3.3901 1.2388 4.9991 2.6401c0.9407 0.81926 1.5826 1.9618 1.8896 3.1037 0.30693 1.1416 1.8895 2.5737 1.8895 2.5737s2.2336-1.1545 3.3996-2.8398z" fill="#baa440"/>
+ <path id="path5643-7-5-54" d="m231.82 592.08c3.9293 8.147 12.082 8.8234 18.106 1.2803 0.61459-12.226-0.77728-14.21 1.7419-28.146-3.7734-1.9904-7.9965 4.2404-14.63-4.8394 0 0-3.3305 11.628-3.8439 14.375-1.0237 5.4771-1.3747 17.33-1.3747 17.33z" fill="#f6e078"/>
+ <path id="path5645-9-7-1" d="m327.43 581.68c0 3.7606-3.3136 6.8091-7.4012 6.8091s-7.4012-3.0485-7.4012-6.8091 3.3136-6.8091 7.4012-6.8091 7.4012 3.0485 7.4012 6.8091z" transform="matrix(1.2345 .11672 -.11663 1.2336 -86.596 -166.73)" fill="#f8eca8"/>
+ <path id="path6114-8" d="m251.73 647.74s2.3226 0.22324 3.4511 0c1.9759-0.39088 5.5875-2.3007 5.5875-2.3007s-7.1438-20.127-9.2029-30.567c-1.2035-6.1017-1.8077-18.57-1.8077-18.57-6.9257 4.7212-12.158 5.4042-17.584-1.3147 0 0 2.4663 13.101 4.6014 19.392 3.9166 11.54 14.955 33.36 14.955 33.36z" fill="#d1b948"/>
+ <path id="path5649-2-2-0-83" d="m248.96 597.36c-0.206 9.542 2.9673 18.921 3.3193 28.376-0.92894 4.4829-1.0397 9.0515-1.1706 7.945 0.13752 1.1622-7.3819-4.5667-9.2724-10.073-0.8313-2.4213-5.2576-11.529-5.8493-13.876-0.59173-2.3474-2.732-12.152-2.732-12.152 5.211 4.3754 10.734 4.4631 15.705-0.21958z" fill="#baa440"/>
+ <path id="path5649-3-3-7-3-5" d="m248.98 597.95s-0.068 4.7831-0.75782 7.2623c-0.68975 2.4792-0.44302 2.4143-1.6474 3.985s-1.6503 5.2772-1.6503 5.2772-5.2496-2.8679-6.476-4.6112c-1.2264-1.7432-2.6669-2.9111-3.076-4.8351-0.40905-1.924-1.5307-6.1146-1.5307-6.1146 5.6858 3.6369 10.629 4.0201 15.138-0.96363v-0.00002z" fill="#a39038"/>
+ </g>
+ </g>
+ <g id="g6467-2" transform="translate(-3.2268 -.25785)">
+ <path id="path7273-5-9-8-3-2" d="m228.83 522.6c-4.1138 0-7.4688 3.3237-7.4688 7.4375 0 1.2331 0.0617 5.9728-0.65625 8.4688-0.22233 0.77292-0.51937 1.5324-0.84375 2.25-1.7293-0.38414-17.848 22.711-18.938 43.5-1.6049 30.627 12.169 48.69 20.312 59.156 0.55464 1.0976 1.1001 2.2808 1.4688 3.5625 0.71796 2.496 0.65625 7.2357 0.65625 8.4688 0 4.1138 3.3549 7.4375 7.4688 7.4375 4.1138 0 7.4375-3.3237 7.4375-7.4375 0-0.49253-0.0651-0.97168-0.15625-1.4375 2.7841-1.0788 4.7812-3.7724 4. [...]
+ <g id="g6396-6" transform="translate(34.566 .86320)">
+ <path id="path7273-5-9-8-6" d="m192.07 521.74c-4.1138 0-7.4688 3.3237-7.4688 7.4375 0 1.2331 0.0617 5.9728-0.65625 8.4688-0.22233 0.77292-0.51937 1.5324-0.84375 2.25-1.7293-0.38414-17.848 22.711-18.938 43.5-1.6049 30.627 12.169 48.69 20.312 59.156 0.55464 1.0976 1.1001 2.2808 1.4688 3.5625 0.71796 2.496 0.65625 7.2357 0.65625 8.4688 0 4.1138 3.3549 7.4375 7.4688 7.4375 4.1138 0 7.4375-3.3237 7.4375-7.4375 0-0.49253-0.0651-0.97168-0.15625-1.4375 2.7841-1.0788 4.7812-3.7724 4. [...]
+ <path id="path5617-8-9-9-7" d="m185.86 529.83c-0.0966-0.94831-0.14188-2.0841 0.2177-2.9882 0.29944-0.75307 1.3531-2.208 2.0535-2.7498 0.85054-0.65802 1.7017-0.84065 2.8526-0.99203 1.0154-0.13357 2.1261-0.11733 3.074 0.21186 1.19 0.41329 1.9794 1.0901 2.6132 2.0191 0.52895 0.77533 0.98308 1.757 0.94457 2.6464-0.0278 0.63985-0.3229 2.3542-0.70346 2.912-0.35334 0.51787-0.40861 0.96101-0.90003 1.3953-1.2326 1.0892-1.3479 1.1564-1.3479 1.1564s1.5038-0.69383 3.5658-0.22229c1.1818 [...]
+ <path id="path5619-9-9-7-99-8" d="m195.35 532.71s2.9099-0.79129 4.3712-0.0496c1.1448 0.58106 2.2369 2.1069 2.5525 3.3514 0.30542 1.2043 0.21959 2.556-0.21126 3.7214-0.38254 1.0347-1.0839 2.0273-2.0069 2.6315-0.88374 0.57842-2.0218 0.73816-3.0779 0.75269-2.5683 0.0354-5.4229-0.91645-5.4229-0.91645 4.032-0.91941 6.609-5.361 3.7953-9.4909z" fill="#f8eca8"/>
+ <path id="path5619-3-9-7-4" d="m190.36 529.08c0.73378-0.95135 2.1215-1.6301 3.3069-1.4339 1.2968 0.21461 3.3278 2.6487 3.3278 2.6487s0.79129-2.9099 0.0496-4.3712c-0.58106-1.1449-2.1069-2.2369-3.3514-2.5525-1.2043-0.30543-2.556-0.2196-3.7214 0.21125-1.0347 0.38254-2.5102 1.2335-3.1143 2.1565-0.57843 0.88374-1.0059 3.1166-1.0204 4.1727 2.3175 7.0112 2.4493 0.74951 4.5232-0.83154z" fill="#f8eca8"/>
+ <path id="path5613-7-8-2-1" d="m182.24 542s0.95074-0.80113 2.0182-0.86756c1.0675-0.0665 1.4907 0.60184 1.9997 0.9006 0.52182 0.3067 1.7682 1.247 2.4167 2.3344 0.64849 1.0874 0.69928 2.3215 0.69928 2.3215l-2.2374 5.5249c-1.3764 6.4691-7.5075 8.9409-13.766 5.4498 1.992-5.7504 5.7425-10.585 8.8699-15.664z" fill="#d1b948"/>
+ <path id="path5615-3-6-3-7" d="m188.32 546.07c-0.11894-0.45328-0.30819-0.86928-0.55187-1.2451-1.2607-1.9444-3.3704-2.8126-5.3628-2.1972l-3.4462 6.2593s1.0017 0.50076 1.9546 1.8794c0.55717 0.80601 0.86543 1.8636 0.93939 2.8875 0.074 1.0236 1.6135 2.4264 1.6135 2.4264 2.411-2.2229 4.3194-6.0641 4.8534-10.01z" fill="#baa440"/>
+ <path id="path5643-7-5-5-1" d="m165.05 592.72c5.114 5.9751 11.252 3.5428 15.359-0.48565 0.61459-12.226-1.5621-12.444 0.95703-26.38-3.7734-1.9904-3.2874 4.6328-9.9205-4.4469 0 0-4.5078 11.236-5.0211 13.983-1.0237 5.4771-1.3747 17.33-1.3747 17.33z" fill="#f6e078"/>
+ <path id="path5645-9-7-6-8" d="m327.43 581.68c0 3.7606-3.3136 6.8091-7.4012 6.8091s-7.4012-3.0485-7.4012-6.8091 3.3136-6.8091 7.4012-6.8091 7.4012 3.0485 7.4012 6.8091z" transform="matrix(1.0388 .11385 -.098147 1.2033 -103.09 -149.22)" fill="#f8eca8"/>
+ <path id="path6114-5-7" d="m185.14 641.15s2.2355-0.37935 3.3118-0.63458c1.8846-0.44687 5.9376-0.31262 5.9376-0.31262-0.44903 0.67355-9.9223-16.151-10.994-28.347-0.54376-6.1863-2.2845-18.511-2.2845-18.511-3.2286 2.4394-5.4515 3.4224-7.9698 3.6484-2.5567 0.22941-5.4046-0.34156-8.128-3.6474-1.1394 10.877 9.5755 33.243 20.127 47.804v0.00001 0.00029z" fill="#d1b948"/>
+ <path id="path5649-2-2-0-8-8" d="m180.37 594.42c0.0848 9.5437 3.4077 18.829 4.0254 28.269-0.75873 4.5073-0.72979 9.0771-0.88819 7.9748 0.16638 1.1577-7.2192-4.3549-9.1964-9.8051-0.86943-2.3966-5.3867-11.375-6.0241-13.704-0.63735-2.3296-2.9815-12.069-2.9815-12.069 5.1303 4.2254 10.433 4.1561 15.065-0.66585z" fill="#baa440"/>
+ <path id="path5649-3-3-7-3-1-7" d="m179.9 595.73s0.0763 4.783-0.51224 7.2806c-0.58852 2.4977-0.64319 2.1363-1.7525 3.7406-1.1093 1.6042-0.63129 4.8875-0.63129 4.8875s-5.1227-2.7175-6.3512-4.4251-2.1171-2.3056-2.5666-4.2172-1.65-6.0684-1.65-6.0684c5.564 3.4737 9.2839 3.9117 13.464-1.198v-0.00002z" fill="#a39038"/>
+ <path id="path5617-8-9-9-4-7" d="m188.29 653.62c-0.0966 0.94831-0.14188 2.0841 0.2177 2.9882 0.29944 0.75307 1.3531 2.208 2.0535 2.7498 0.85054 0.65802 1.7017 0.84065 2.8526 0.99203 1.0154 0.13357 2.1261 0.11733 3.074-0.21186 1.19-0.41329 1.9794-1.0901 2.6132-2.0191 0.52895-0.77533 0.98308-1.757 0.94457-2.6464-0.0278-0.63985-0.3229-2.3542-0.70346-2.912-0.35334-0.51787-0.40861-0.96101-0.90003-1.3953-1.2326-1.0892-1.3479-1.1564-1.3479-1.1564s1.5038 0.69383 3.5658 0.22229c1.181 [...]
+ <path id="path5619-9-9-7-99-7-4" d="m197.78 650.74s2.9099 0.79129 4.3712 0.0496c1.1448-0.58106 2.2369-2.1069 2.5525-3.3514 0.30542-1.2043 0.21959-2.556-0.21126-3.7214-0.38254-1.0347-1.0839-2.0273-2.0069-2.6315-0.88374-0.57842-2.0218-0.73816-3.0779-0.75269-2.5683-0.0354-5.4229 0.91645-5.4229 0.91645 4.032 0.91941 6.609 5.361 3.7953 9.4909z" fill="#f8eca8"/>
+ <path id="path5619-3-9-7-1-4" d="m192.8 654.37c0.73378 0.95135 2.1215 1.6301 3.3069 1.4339 1.2968-0.21461 3.3278-2.6487 3.3278-2.6487s0.79129 2.9099 0.0496 4.3712c-0.58106 1.1449-2.1069 2.2369-3.3514 2.5525-1.2043 0.30543-2.556 0.2196-3.7214-0.21125-1.0347-0.38254-2.5102-1.2335-3.1143-2.1565-0.57843-0.88374-1.0059-3.1166-1.0204-4.1727 2.3175-7.0112 2.4493-0.74951 4.5232 0.83154z" fill="#f8eca8"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g17561">
+ <g id="g8302" transform="matrix(.85001 0 0 .85001 364.28 -645.05)" stroke-width="1.1765">
+ <g id="g7969">
+ <path id="path3457-9-9-7-3" d="m329.15 285.3c2.6436 1.8307 3.8756 4.199 4.8809 7.7383 1.6199-2.3194 3.773 0.75905 3.2185-12.375 1.9784 1.0166 5.2994 3.4204 5.9584 6.7444 1.4791-2.0812 3.6039-6.1435 2.7559-15.061 1.8671 1.1322 3.4142 2.5978 3.5133 5.5737 3.1069-4.6238 4.5594-10.032 2.159-17.266 1.5026-1.3811 3.8283-0.45564 6.7841 2.2358 0 0-0.0464-8.9053-1.5321-13.59-5.1693-9.92-5.29-26.58-1.9564-37.218 3.7369-11.925 20.778-34.093 20.778-34.093l-22.636-3.2261s-27.614 22.456-36.124 [...]
+ <path id="path6803" d="m331.91 199.01c-3.7007 3.3993-13.512 13.639-14.905 18.467-0.98107 3.4023-0.48524 4.8016-0.0389 8.3143 0.76094 5.9888 8.5098 15.391 8.9712 21.41 0.29551 3.8546 0.0817 7.9649-1.4748 11.504-2.3316 5.3008-7.3255 5.3193-12.16 8.507-6.1813 4.0755-14.628 3.4707-20.774 7.2989-1.9608 1.2213-3.9389 2.6962-5.3444 4.5947h-0.00002c-1.287 1.7385-1.2032 6.2944 0.22832 7.916 0.89794 1.0172 2.0758-2.6688 3.5582-2.7504 6.3266 6.6525 9.8717 2.6038 14.232-0.83673 2.4476 1.321 [...]
+ <path id="path7870" d="m329.08 260.52c1.7486-4.5865 2.3987-8.8215 2.1697-13.018-0.229-4.1969-7.0438-10.083-8.1195-14.901-1.0756-4.8178-3.1228-8.5446-2.2304-12.823 0.89233-4.2785 3.9073-8.3499 5.8309-10.487l11.074-12.304 6.6917-6.3511c6.1331 5.208 4.7801 11.356 1.4388 17.959-2.058 3.7906-3.649 8.9707-3.792 10.972-0.42891 6.0044 1.6809 19.063 2.1248 23.957 0.44392 4.8944 0.70476 4.4714 0.36162 6.8708s-1.0206 4.554-2.5314 7.2325-3.316 5.3486-6.8708 8.3173-14.827 8.3173-14.827 8.3173 [...]
+ <path id="path3773-9-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m311.47 276.06c-0.34679 0.28774-1.5835 0.83635-2.888 1.5192-2.7664 1.5159-4.8252 3.7596-5.5851 6.6029-0.75996 2.8434-0.23758 5.6906 2.045 8.9123l4.1289 1.8031c-4.0522-1.1432-5.3968-7.8842-4.718-10.131 0.64321-2.1293 2.2407-4.1178 4.7498-5.4927v0.0292c1.22-0.63867 2.3406-1.0423 3.1267-1.6946 0.77013-0.63899 1.7757-1.4516 2.4325-2.3983 0.65678-0.94672 0.93293-2.0134 0.93293-2.013 [...]
+ <path id="path3773-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m298.04 275.38c-0.36019 0.28626-1.6447 0.83204-2.9997 1.5114-2.8734 1.5081-5.0117 3.7402-5.8011 6.5689-0.78934 2.8287-0.24676 5.6613 2.1241 8.8664l3.564 0.30723c-4.2088-1.1374-4.8809-6.357-4.1759-8.5923 0.66807-2.1184 2.3273-4.0966 4.9334-5.4644v0.029c1.2672-0.63538 2.4311-1.0369 3.2476-1.6858 0.7999-0.6357 1.8444-1.4441 2.5265-2.3859 0.68218-0.94184 0.969-2.003 0.969-2.003-2.641 [...]
+ <path id="path3457-9-9-7-3-4" d="m329.15 285.3c2.6436 1.8307 3.8756 4.199 4.8809 7.7383 1.6199-2.3194 3.773 0.75905 3.2185-12.375 1.9784 1.0166 5.2994 3.4204 5.9584 6.7444 1.4791-2.0812 3.6039-6.1435 2.7559-15.061 1.8671 1.1322 3.4142 2.5978 3.5133 5.5737 3.1069-4.6238 4.5594-10.032 2.159-17.266 1.5026-1.3811 3.8283-0.45564 6.7841 2.2358 0 0-0.0464-8.9053-1.5321-13.59-5.1693-9.92-5.29-26.58-1.9564-37.218 3.7369-11.925 20.778-34.093 20.778-34.093l-22.636-3.2261s-27.614 22.456-36.1 [...]
+ </g>
+ <g id="g6044-2-9-50" transform="matrix(.99771 -.067590 .067590 .99771 -116.96 8.5933)">
+ <path id="path5744-98-7-9-6" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" fill="#fff"/>
+ <path id="path6042-0-9-4" d="m381.41 307.04 1.7674-3.3581s-3.2636-0.16484-4.7721 0.35349c-2.0089 0.69028-5.3023 3.5349-5.3023 3.5349l0.92898 3.6168 1.4889-2.9777 2.316-1.3234 3.5731 0.15411z" fill="#ececec"/>
+ <path id="path5744-98-6-3-1-7" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" stroke="#999" stroke-width="1.1765" fill="none"/>
+ </g>
+ <g id="g6044-2-9-4" transform="matrix(.99771 -.067590 .067590 .99771 -103.87 9.6003)">
+ <path id="path5744-98-7-9-00" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" fill="#fff"/>
+ <path id="path6042-0-9-6" d="m381.41 307.04 1.7674-3.3581s-3.2636-0.16484-4.7721 0.35349c-2.0089 0.69028-5.3023 3.5349-5.3023 3.5349l0.92898 3.6168 1.4889-2.9777 2.316-1.3234 3.5731 0.15411z" fill="#ececec"/>
+ <path id="path5744-98-6-3-1-2" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" stroke="#999" stroke-width="1.1765" fill="none"/>
+ </g>
+ <g id="g6044-2-9-74" transform="matrix(.99771 -.067590 .067590 .99771 -90.277 10.607)">
+ <path id="path5744-98-7-9-1" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" fill="#fff"/>
+ <path id="path6042-0-9-8" d="m381.41 307.04 1.7674-3.3581s-3.2636-0.16484-4.7721 0.35349c-2.0089 0.69028-5.3023 3.5349-5.3023 3.5349l0.92898 3.6168 1.4889-2.9777 2.316-1.3234 3.5731 0.15411z" fill="#ececec"/>
+ <path id="path5744-98-6-3-1-58" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" stroke="#999" stroke-width="1.1765" fill="none"/>
+ </g>
+ </g>
+ <g id="g17141">
+ <g id="g17126" transform="translate(-.0000024770)">
+ <g id="g11106" transform="matrix(.85001 0 0 .85001 357.75 -645.43)" stroke-width="1.1765">
+ <path id="path8995-2-0-7-2-4-3-8-3-1-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m247.5 479.16s-0.0398 0.0259-0.0625 0.0312c-0.0203 0.005-0.0417-0.002-0.0625 0-12.483 0.9658-28.931 8.0187-41.812 9.9062-2.5301 1.092-4.2383 2.5398-5.2874 4.1516-1.3465 2.0686-1.8544 4.3758-1.5541 6.6104 0.29753 2.214 0.68966 4.3286 3.2015 6.2212 1.3282 1.0008 3.3685 1.9395 6.5463 2.7981 53.99-8.7602 134.87-13.278 215.41 0.0625 2.6882-0.68331 4.7243-1.5794 6.21 [...]
+ <path id="path8995-2-0-7-2-4-3-8-3-1-5-5-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m198.72 499.86c0.29753 2.214 0.68966 4.3286 3.2015 6.2212 1.3282 1.0008 3.3685 1.9395 6.5463 2.7981 53.99-8.7602 134.87-13.278 215.41 0.0625 2.6882-0.68331 4.7243-1.5794 6.2126-2.643 2.2931-1.6388 3.2852-3.6752 3.3566-5.9432 3.6891-15.776-238.82-12.957-234.72-0.49551z" fill="#ececec"/>
+ <path id="path8995-2-0-7-2-4-3-8-3-1-5-5-8-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m201.93 506.08c1.3282 1.0008 3.3685 1.9395 6.5463 2.7981 53.99-8.7602 134.87-13.278 215.41 0.0625 2.6882-0.68331 4.7243-1.5794 6.2126-2.643-35.648-8.0634-80.61-10.845-115.15-10.665-40.175 0.20895-83.898 3.4-113.02 10.447z" fill="#c5c5c5"/>
+ <path id="path8995-2-0-7-2-4-3-8-3-1-5-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m247.5 479.16s-0.0398 0.0259-0.0625 0.0312c-0.0203 0.005-0.0417-0.002-0.0625 0-12.483 0.9658-28.931 8.0187-41.812 9.9062-2.5301 1.092-4.2383 2.5398-5.2874 4.1516-1.3465 2.0686-1.8544 4.3758-1.5541 6.6104 0.29753 2.214 0.68966 4.3286 3.2015 6.2212 1.3282 1.0008 3.3685 1.9395 6.5463 2.7981 53.99-8.7602 134.87-13.278 215.41 0.0625 2.6882-0.68331 4.7243-1.5794 6. [...]
+ </g>
+ <g id="g17117" fill="#696969" transform="translate(-1.5218)">
+ <path id="path13625-3-6-46-4-6-79-39-8-6" d="m637.66-228.06c-3.6079-0.48355-6.9826-1.1036-10.156-1.8404-2.7939-0.64877-5.4314-1.3881-7.9342-2.2045 0.73097 1.1897 1.8737 2.3782 4.5613 3.2047-2.157 0.0242-4.9433 0.90639-5.9411 1.363 1.0617 0.40128 3.967 1.1164 6.119 1.025-2.554 0.96729-3.5144 2.2264-4.0656 3.4505 2.2408-0.89515 4.6117-1.7282 7.1325-2.4887 3.1766-0.95844 6.5913-1.8018 10.284-2.5096z"/>
+ <g id="g17109">
+ <path id="path13625-3-6-46-4-6-79-39" d="m561.45-224.52c-3.629-0.28535-7.0325-0.71973-10.241-1.2818-2.8252-0.49487-5.4993-1.0887-8.0429-1.7669 0.79499 1.1479 2.001 2.272 4.7299 2.9502-2.1524 0.14223-4.8863 1.1756-5.8576 1.6861 1.0821 0.34257 4.0222 0.89764 6.1659 0.68851-2.4973 1.1056-3.3873 2.4154-3.8707 3.6679 2.1884-1.0164 4.5102-1.978 6.9856-2.8754 3.1194-1.1309 6.4828-2.1599 10.131-3.0687z"/>
+ <path id="path13625-3-6-46-4-6-79-39-8-7" d="m713.81-220.99c-3.5006-0.99828-6.7508-2.098-9.7845-3.2842-2.6713-1.0445-5.1748-2.1561-7.5338-3.3245 0.55194 1.2826 1.5115 2.6233 4.0521 3.8284-2.138-0.2868-5.0223 0.18478-6.0755 0.49285 0.99282 0.55005 3.7648 1.6763 5.9075 1.8958-2.6668 0.58926-3.7985 1.6968-4.5203 2.8288 2.3463-0.563 4.8125-1.0458 7.4166-1.4352 3.2816-0.4908 6.7821-0.83348 10.538-1.0019z"/>
+ </g>
+ <g id="g17113" transform="translate(1.7086)">
+ <path id="path13625-3-6-46-4-6-79-39-8" d="m597.87-226.77c-3.6079-0.48355-6.9826-1.1036-10.156-1.8404-2.7939-0.64877-5.4314-1.3881-7.9342-2.2045 0.73097 1.1897 1.8737 2.3782 4.5613 3.2047-2.157 0.0242-4.9433 0.90639-5.9411 1.363 1.0617 0.40128 3.967 1.1164 6.119 1.025-2.554 0.96729-3.5144 2.2264-4.0656 3.4505 2.2408-0.89515 4.6117-1.7282 7.1325-2.4887 3.1766-0.95844 6.5913-1.8018 10.284-2.5096z"/>
+ <path id="path13625-3-6-46-4-6-79-39-8-7-6" d="m674.02-226.09c-3.5865-0.62263-6.9347-1.3726-10.077-2.2315-2.7668-0.75627-5.3737-1.597-7.843-2.5095 0.68444 1.2171 1.7803 2.4488 4.4341 3.3786-2.1563-0.0592-4.9746 0.71466-5.9893 1.1323 1.0454 0.44202 3.9209 1.2689 6.0748 1.2607-2.5895 0.86787-3.5979 2.0889-4.1959 3.2908 2.2737-0.80789 4.675-1.5486 7.2233-2.2112 3.2113-0.83495 6.656-1.5458 10.373-2.1103z"/>
+ </g>
+ </g>
+ </g>
+ <g id="g10594" transform="matrix(.85001 0 0 .85001 357.89 -645.43)">
+ <g id="g28169-4-3" transform="matrix(.47385 0 0 .5 -169.17 117.35)" stroke-width="2.417">
+ <path id="path25053-5-4" d="m1219.6 702.3 17.558-48.601 7.0916-20.121 17.575-10.352 17.8-38.344 8.3852-10.028 1.2943-35.329s-12.298-25.061-31.33-34.06c-27.225-12.874-64.179-11.103-64.179-11.103s-8.5364-21.396-24.193-29.722c-15.657-8.3261-33.042-10.333-51.289-10.333s-50.995 15.463-68.704 20.008c-9.2065 2.363-29.998 10.333-29.998 10.333s-20.792-7.9701-29.998-10.333c-17.709-4.5453-50.457-20.008-68.704-20.008s-35.064 1.7049-51.289 10.333c-15.089 8.0241-35.803 29.722-35.803 29.722s-2 [...]
+ <path id="path28147-1-7" d="m1288.2 573.44-7.5765 10.332-19.285 40.637-18.597 8.954-22.729 68.877-400.17-1.3775-28.239-70.254-18.597-30.306-10.332-10.332-2.7551-9.6427v-6.8877l-1.3775-22.041s14.201-17.858 22.729-22.041c7.871-3.8601 28.928-4.1326 28.928-4.1326s-17.07 8.0197-21.352 14.464c-5.8302 8.776-6.8877 46.836-6.8877 46.836s14.838-32.035 23.418-37.882c8.0544-5.4886 30.306-11.709 30.306-11.709s-15.256 14.463-17.908 22.729c-2.7169 8.4696-2.9688 21.857 1.3775 29.617 10.25 18.30 [...]
+ <path id="path28149-1-9" d="m822.29 700.43-33.063-79.557s-18.944-23.447-22.73-36.162c-2.3953-8.0428-0.75063-19.992 2.0664-27.897 2.5402-7.128 14.465-20.664 14.465-20.664s-9.0667 16.094-10.332 23.764c-1.215 7.3653-1.0744 18.025 2.0664 24.797 4.242 9.1462 19.631 24.797 19.631 24.797s-2.4213-24.872 0-35.129c1.1147-4.7219 4.1565-10.713 7.2324-14.465 2.2406-2.7331 9.2988-7.2324 9.2988-7.2324s-5.1294 7.6317-6.1992 11.365c-1.4539 5.0743-2.0724 12.389-1.0332 17.564 3.1932 15.902 23.764 [...]
+ <path id="path28151-6-8" d="m776.46 514.28s4.2989 2.258 9.8244 0.0621c6.5632-2.6083 15.064-9.8457 23.047-11.408 11.874-2.3236 20.673 0.5749 22.178 2.2662 4.6058 5.173 6.6223 15.083 11.455 20.045 4.9083 5.0402 20.045 12.17 20.045 12.17s-9.6916-15.948-11.455-23.625c-1.2017-5.2331-4.9737-19.921 0-17.898 51.897 21.108 29.807-19.158 39.837-24.575 8.5707-4.6289 9.8535-8.6173 19.584-9.0731 12.804-0.59969 19.048 4.6572 31.426 7.9878 18.717 5.0365 40.815 35.596 60.136 37.141 12.052 0.963 [...]
+ <path id="path28162-1-0" d="m784.24 609.07s7.7214-0.84811 19.682-2.1692c7.2117-0.79655 19.663 3.8423 29.193 2.7841 15.13-1.68 34.44-15.502 50.438-17.305 15.998-1.8032 56.023 17.319 66.805 16.256 43.982-4.3366 35.204-23.758 58.227-23.636 10.05 0.0531 26.602-13.793 35.472-3.3832 29.69 34.844 87.384 28.834 119.38 13.954 16.046-7.4623 49.179 27.294 73.066 8.6459 13.99-10.921 31.672 3.1317 31.672 3.1317l-53.742 64.142-404.81 2.675-25.381-65.096z" fill-rule="evenodd" fill="#920000"/>
+ <path id="path28153-9-7" d="m1219.6 702.3 17.558-48.601 7.0916-20.121 17.575-10.352 17.8-38.344 8.3852-10.028 1.2943-35.329s-12.298-25.061-31.33-34.06c-27.225-12.874-64.179-11.103-64.179-11.103s-8.5364-21.396-24.193-29.722c-15.657-8.3261-33.042-10.333-51.289-10.333s-50.995 15.463-68.704 20.008c-9.2065 2.363-29.998 10.333-29.998 10.333s-20.792-7.9701-29.998-10.333c-17.709-4.5453-50.457-20.008-68.704-20.008s-35.064 1.7049-51.289 10.333c-15.089 8.0241-35.803 29.722-35.803 29.722s-2 [...]
+ </g>
+ <g id="g10197" stroke-width="1.1765">
+ <g id="g15463" transform="translate(-139.77 75.518)">
+ <g id="g10024" transform="translate(-6.2835 10.459)">
+ <g id="g9716-6" transform="matrix(-1 0 0 1 923.9 0)">
+ <g id="g9502-7" stroke-width="1.1765">
+ <path id="path13193-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m358.41 213.62c-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23.83 8.75 23.83l12.611-2.25s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 5.1768-5.1254 12.469-8.3005 19.938-10.031 6.6614-1.5437 14.188-2.2045 20.031-1 [...]
+ <path id="path13193-7-9-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m462.42 228.08-1.6406-6.2969s-4.6615 1.2344-10.156 2.4062c-5.4947 1.1719-12.358 2.1227-13.969 2.0312-8.297-0.47093-13.168-1.1633-20.969-3.625-11.169-3.5243-19.074-7.4316-31.688-10.062-8.4994-1.7728-17.217-0.76456-25.594 1.0938-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23.83 [...]
+ <path id="path13193-7-8-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m334.71 298.25 3.1527-0.5625s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 2.0694-2.0489 4.477-3.7862 7.0987-5.2441 3.9365-2.1891 8.3559-3.7483 12.839-4.7872 3.3688-0.78067 6.9589-1.3356 10.441-1.5376 3.403-0.19744 6.7025-0.0578 9.5906 0.53756 1.5147 0.31224 2.957 0.64935 4.349 1.0084 3.8285 0.98747 7.2 [...]
+ <path id="path13193-7-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m358.41 213.62c-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23.83 8.75 23.83l12.611-2.25s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 5.1768-5.1254 12.469-8.3005 19.938-10.031 6.6614-1.5437 14.188-2.2045 20.031 [...]
+ </g>
+ <g id="g7602-71-8-8-2-78-3-1" transform="matrix(1.331 0 0 1.331 679.36 -1151.1)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-87" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-87" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-74" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-49" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-15" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-0-5" transform="matrix(1.331 0 0 1.331 676 -1167.8)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-2-5" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-4-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-8-2" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-3-9" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-9-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-5-2" transform="matrix(1.331 0 0 1.331 677.01 -1185.6)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-22-0" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-7-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-3-4" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-7-8" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-90-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-3-8" transform="matrix(1.331 0 0 1.331 683.83 -1202.4)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-9-3" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-9-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-7-6" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-0-2" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-3-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-8-5" transform="matrix(1.331 0 0 1.331 696.57 -1215.6)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-6-2" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-5-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-76-7" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-2-1" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-7-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-9-2" transform="matrix(1.331 0 0 1.331 712.48 -1224.2)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-99-1" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-1-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-72-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-36-1" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-5-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-81-7" transform="matrix(1.331 0 0 1.331 730.67 -1228.8)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-4-6" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-71-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-38-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-4-9" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-8-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-6-6" transform="matrix(1.331 0 0 1.331 749.32 -1227.9)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-0-2" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-3-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-2-5" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-6-9" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-94-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-37-3" transform="matrix(1.331 0 0 1.331 799.8 -1214.7)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-8-9" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-8-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-381-5" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-5-6" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-35-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-36-6" transform="matrix(1.331 0 0 1.331 767.06 -1222.9)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-5-3" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-95-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-4-8" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-9-4" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-1-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-55-4" transform="matrix(1.331 0 0 1.331 783.43 -1217.9)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-41-6" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-88-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-35-6" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-22-4" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-6-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g9716">
+ <g id="g9502" stroke-width="1.1765">
+ <path id="path13193" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m358.41 213.62c-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23.83 8.75 23.83l12.611-2.25s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 5.1768-5.1254 12.469-8.3005 19.938-10.031 6.6614-1.5437 14.188-2.2045 20.031-1 1 [...]
+ <path id="path13193-7-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m462.42 228.08-1.6406-6.2969s-4.6615 1.2344-10.156 2.4062c-5.4947 1.1719-12.358 2.1227-13.969 2.0312-8.297-0.47093-13.168-1.1633-20.969-3.625-11.169-3.5243-19.074-7.4316-31.688-10.062-8.4994-1.7728-17.217-0.76456-25.594 1.0938-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23.83 8. [...]
+ <path id="path13193-7-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m334.71 298.25 3.1527-0.5625s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 2.0694-2.0489 4.477-3.7862 7.0987-5.2441 3.9365-2.1891 8.3559-3.7483 12.839-4.7872 3.3688-0.78067 6.9589-1.3356 10.441-1.5376 3.403-0.19744 6.7025-0.0578 9.5906 0.53756 1.5147 0.31224 2.957 0.64935 4.349 1.0084 3.8285 0.98747 7.277 [...]
+ <path id="path13193-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m358.41 213.62c-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23.83 8.75 23.83l12.611-2.25s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 5.1768-5.1254 12.469-8.3005 19.938-10.031 6.6614-1.5437 14.188-2.2045 20.031-1 [...]
+ </g>
+ <g id="g7602-71-8-8-2-78-3" transform="matrix(1.331 0 0 1.331 679.36 -1151.1)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-0" transform="matrix(1.331 0 0 1.331 676 -1167.8)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-2" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-8" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-3" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-9" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-5" transform="matrix(1.331 0 0 1.331 677.01 -1185.6)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-22" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-3" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-7" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-90" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-3" transform="matrix(1.331 0 0 1.331 683.83 -1202.4)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-9" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-9" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-7" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-0" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-8" transform="matrix(1.331 0 0 1.331 696.57 -1215.6)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-6" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-76" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-2" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-9" transform="matrix(1.331 0 0 1.331 712.48 -1224.2)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-99" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-72" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-36" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-81" transform="matrix(1.331 0 0 1.331 730.67 -1228.8)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-4" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-71" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-38" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-4" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-6" transform="matrix(1.331 0 0 1.331 749.32 -1227.9)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-0" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-2" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-6" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-94" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-37" transform="matrix(1.331 0 0 1.331 799.8 -1214.7)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-8" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-381" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-5" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-35" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-36" transform="matrix(1.331 0 0 1.331 767.06 -1222.9)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-5" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-95" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-4" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-9" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-55" transform="matrix(1.331 0 0 1.331 783.43 -1217.9)" stroke-width=".88389">
+ <g id="g9013-8-9-4-38-3-1-6-41" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-7-6-88" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-35" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-22" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g15390" transform="translate(-3.4e-6,0)">
+ <g id="g9189-31" transform="matrix(1.21 0 0 1.21 213.62 155.72)">
+ <g id="g9185-7" stroke-width=".97228">
+ <path id="rect8245-8-0-2-4-8-4" d="m185.96 37.047c1.5672-1.9839 3.4392-3.4577 4.9565-5.4749 1.5941-2.1194 2.8103-4.7978 3.4354-7.503-2.771 0.69088-5.4494 1.9071-7.5688 3.5011-2.0172 1.5172-3.491 3.3892-5.4749 4.9565v-25.411c1.9839 1.5672 3.4577 3.4392 5.4749 4.9565 2.1194 1.5941 4.7978 2.8103 7.5688 3.5011-0.62508-2.7052-1.8413-5.3836-3.4354-7.503-1.5172-2.0173-3.3892-3.491-4.9565-5.4749l28.152 9e-7c-1.5672 1.9839-3.4392 3.4577-4.9565 5.4749-1.5941 2.1194-2.8103 4.7978-3.435 [...]
+ <path id="rect8245-8-0-2-4-8-3-9" d="m192.57 33.851c2.0468-4.0155 3.7826-8.1375 4.8352-12.571-4.2402 1.2249-8.865 2.5218-12.624 4.8888v-12.697c4.0325 2.0619 8.1856 3.7777 12.624 4.8888-1.1683-4.2295-2.4815-8.8326-4.8352-12.571l14.93 9e-7c-2.0468 4.0155-3.7826 8.1375-4.8352 12.571 4.2402-1.2249 8.865-2.5218 12.624-4.8888v12.697c-4.0325-2.0619-8.1856-3.7777-12.624-4.8888 1.1683 4.2295 2.4815 8.8326 4.8352 12.571l-14.93 0.000001z" fill="#f6e078"/>
+ </g>
+ <g id="g7602-71-8-8-2-7-0-6" transform="matrix(1.331 0 0 1.331 562.93 -1417.2)" stroke-width=".73049">
+ <g id="g9013-8-9-4-38-3-4-7-9" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.461">
+ <path id="path9015-6-3-7-0-0-8-2-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-0-3-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-6-5-3" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-0-8-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.461" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g7966-6" transform="matrix(.94311 0 0 .94311 266.87 172.35)">
+ <g id="g12979-91-7-9-9-7-5" transform="matrix(1.8635 0 0 1.8334 97.192 -1597.7)" stroke-width=".67487">
+ <path id="path9021-6-8-7-3-0-6-90-7-5-5-3-42" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="matrix(1.04 0 0 1.04 -2741.9 82.476)" fill="#d1b948"/>
+ <path id="path12933-6-20-9-2-3-3" d="m2689.7 776.41c-4.67 0-8.4375 3.8205-8.4375 8.625s3.7675 8.625 8.4375 8.625 8.4687-3.8277 8.4687-8.625-3.7987-8.625-8.4687-8.625z" transform="matrix(1.1016 0 0 1.0954 -2908.7 37.898)" fill="#e7cd54"/>
+ <path id="path12933-0-17-9-1-4-8-1" d="m2689.7 776.41c-4.67 0-8.4375 3.8205-8.4375 8.625s3.7675 8.625 8.4375 8.625 8.4687-3.8277 8.4687-8.625-3.7987-8.625-8.4687-8.625z" transform="matrix(.97315 0 0 .97449 -2564.3 131.75)" fill="#f6e078"/>
+ <path id="path12933-0-3-3-07-0-2-4-2" d="m2689.7 776.41c-4.0731 0.66389-7.7184 4.6204-8.4375 8.625-0.8487 4.726 3.7675 8.625 8.4375 8.625s8.4687-3.8277 8.4687-8.625-3.7987-8.625-8.4687-8.625z" transform="matrix(.83440 0 0 .81835 -2192.2 252.97)" fill="#f8eca8"/>
+ <path id="path9021-6-8-7-3-0-6-9-8-1-8-3-6-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="matrix(1.04 0 0 1.04 -2741.9 82.476)" stroke="#806600" stroke-width=".64894" fill="none"/>
+ </g>
+ <g id="g7960-25" stroke-width="1.2474">
+ <path id="rect4875-6" fill="#f6e078" d="m195.84 28.438v17.062h-17.062v8.6875h42.812v-8.6875h-17.094v-17.062h-8.6562z"/>
+ <path id="path7956-4" d="m178.71 45.543-0.10818 4.3271h21.528v-21.636l-4.219 0.10818-0.10818 17.2h-17.092z" fill="#f8eca8"/>
+ <path id="path7958-8" d="m178.67 54.045h43.145v-1.8475h-43.037l-0.10867 1.8475z" fill="#e7cd54"/>
+ <path id="rect4875-93-0" d="m195.84 28.437v17.062h-17.062v8.6875h42.812v-8.6875h-17.094v-17.062h-8.6562z" stroke="#806600" stroke-width="1.2474" fill="none"/>
+ </g>
+ </g>
+ <g id="g16905-1" transform="translate(299.98 6.6836)">
+ <g id="g14096-0" transform="translate(-39.304 193.4)" stroke-width="1.1765">
+ <g id="g14089-5">
+ <rect id="rect8897-4" fill-rule="evenodd" ry="6.386" height="71.72" width="25.322" y="34.934" x="182.33" fill="#f6d900"/>
+ <path id="rect8897-9-4-2" d="m188.71 34.934h12.55c3.5379 0 6.386 2.8482 6.386 6.386v35.584l-25.322 7.3685v-42.952c0-3.5379 2.8482-6.386 6.386-6.386z" fill-rule="evenodd" fill="#e7cd54"/>
+ <path id="rect8897-9-67" d="m188.71 34.934h12.55c3.5379 0 6.386 2.8482 6.386 6.386v21.105l-25.322 7.3685v-28.473c0-3.5379 2.8482-6.386 6.386-6.386z" fill-rule="evenodd" fill="#f6e078"/>
+ <path id="rect8897-9-6-9" d="m188.71 34.934h12.55c3.5379 0 6.386 2.8482 6.386 6.386v7.3685l-25.322 7.3685v-14.737c0-3.5379 2.8482-6.386 6.386-6.386z" fill-rule="evenodd" fill="#f8eca8"/>
+ <rect id="rect8897-3-5" ry="6.386" height="71.72" width="25.322" stroke="#806600" y="34.934" x="182.33" stroke-width="1.1765" fill="none"/>
+ </g>
+ <g id="g9547-9" transform="translate(-303.37 -281.42)">
+ <g id="g9537-1" stroke-width="1.1536">
+ <g id="g9532-0" transform="matrix(1.147 0 0 .90673 226.84 -537.15)">
+ <rect id="rect8899-8" fill-rule="evenodd" ry="3.7999" height="79.256" width="7.0406" y="941.22" x="221.33" fill="#f6e078"/>
+ <path id="path8903-9" d="m221.75 986.97s1.3234-2.7096 2.7564-9.9086c0.7863-3.9502 3.8064-9.5906 3.8064-9.5906v-23.369l-2.0571-2.3913-3.1648-0.17081-1.5824 1.8789 0.24165 43.551z" fill-rule="evenodd" fill="#f8eca8"/>
+ <path id="rect8907-9" d="m224.85 941.22c1.9502 0 3.5203 1.6948 3.5203 3.7999v71.656c0 2.1051-1.57 3.7999-3.5203 3.7999-1.9502 0-3.5203-1.6948-3.5203-3.7999v-71.656c0-2.1052 1.57-3.7999 3.5203-3.7999z" stroke="#806600" stroke-width="1.1536" fill="none"/>
+ </g>
+ <g id="g9527-7" transform="matrix(1.147 0 0 .90673 232.09 -537.15)">
+ <rect id="rect8901-9" fill-rule="evenodd" ry="3.7999" height="79.256" width="7.0406" y="941.22" x="240.49" fill="#f6e078"/>
+ <path id="path8905-6" d="m240.56 983.37s0.84005-7.9265 2.273-15.126c0.7863-3.9502 4.5313-8.808 4.5313-8.808v-15.544l-2.0571-2.3913-3.1648-0.17081-1.5824 1.8789v40.16z" fill-rule="evenodd" fill="#f8eca8"/>
+ <rect id="rect8909-9" ry="3.7999" height="79.256" width="7.0406" stroke="#806600" y="941.22" x="240.49" stroke-width="1.1536" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g13677-0" transform="translate(-25.575 194.49)" stroke-width=".88389">
+ <g id="g7602-71-8-8-2-45-4-57" transform="matrix(1.331 0 0 1.331 544.15 -1401.7)">
+ <g id="g9013-8-9-4-38-3-8-9-22" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-21-6-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-6-9-15" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-0-8-05" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-8-0-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-45-4-1-4" transform="matrix(1.331 0 0 1.331 544.15 -1387.6)">
+ <g id="g9013-8-9-4-38-3-8-9-9-5" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-21-6-8-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-6-9-0-3" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-0-8-9-0" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-8-0-5-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-45-4-4-4" transform="matrix(1.331 0 0 1.331 544.15 -1373.5)">
+ <g id="g9013-8-9-4-38-3-8-9-2-7" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-21-6-3-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-6-9-5-1" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-0-8-8-8" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-8-0-4-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-45-4-11-2" transform="matrix(1.331 0 0 1.331 544.15 -1359.3)">
+ <g id="g9013-8-9-4-38-3-8-9-0-0" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-21-6-4-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-6-9-1-1" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-0-8-6-2" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-8-0-1-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-45-4-5-5" transform="matrix(1.331 0 0 1.331 544.15 -1345.2)">
+ <g id="g9013-8-9-4-38-3-8-9-23-5" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7678">
+ <path id="path9015-6-3-7-0-0-21-6-36-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-6-9-8-3" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-0-8-4-2" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-8-0-8-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7678" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g6103-1" transform="translate(120.94 241.14)">
+ <g id="g7330-9" transform="translate(467.6 -914.69)" stroke-width="1.1765">
+ <g id="g6917-80" transform="translate(-0.000005)">
+ <g id="g6826-9" stroke-width="1.1765">
+ <path id="path9304-5-2-7-8-5" d="m-147.29 1086.9c-6.7196 15.023-12.101 29.69-17.375 44.782h-108.31-108.31c-5.0982-14.589-10.297-30.282-16.708-44.782 0 0 13.482 18.865 23.578 23.427 5.6081 2.5339 12.623 3.2894 18.421 1.228 7.6415-2.7166 17.807-16.579 17.807-16.579s9.1411 10.698 15.351 13.509c5.8285 2.6378 12.644 2.745 19.035 2.4561 5.6554-0.2556 11.92-0.4688 16.579-3.6842 7.0552-4.8687 14.123-21.491 14.123-21.491s6.8378 13.078 12.281 17.807c4.4913 3.9023 10.131 6.8156 15.965 [...]
+ <path id="path6816-24" d="m-323.12 1068.9v20.64l131.31 0.3558 1.0676-17.793-17.081-13.167-14.946 10.32-21.352 3.5586-10.676-2.491-19.572-19.928-8.1848 13.879-16.014 7.4731-17.081 0.7117-7.4731-3.5586z" transform="translate(1.7031 40.705)" fill="#f6e078"/>
+ <path id="path6814-2" d="m-362.62 1089.6-1.0676-16.014 11.743-3.5586 12.099-10.676 13.523 10.32 4.6262 1.7793 0.71172 18.861-41.636-0.7117z" transform="translate(1.7031 40.705)" fill="#f6e078"/>
+ <path id="path9304-5-2-7-8-3-9-35" d="m-355.23 1131.7h-26.066c-5.0982-14.589-10.297-30.282-16.708-44.782 0 0 13.482 18.865 23.578 23.427 5.6081 2.5339 12.623 3.2894 18.421 1.228l0.77398 20.127zm161.95-22.583c5.6351 2.5153 12.414 3.2557 18.421 1.8421 6.3568-1.496 11.698-6.1001 16.579-10.439 4.3566-3.8723 10.988-13.602 10.988-13.602-6.7196 15.023-12.101 29.69-17.375 44.782h-28.998v-0.3943l0.38462-22.189z" fill="#d1b948"/>
+ <path id="path6818-8" d="m-274.73 1052.2 1.7793 39.145 47.685 0.3559v-21.352l-11.032 3.5586-15.302-1.7793-16.014-11.032-7.1172-8.8965z" transform="translate(1.7031 40.705)" fill="#e7cd54"/>
+ <path id="path6820-4" d="m-226.33 1087.2 0.35586-16.178 18.149-11.032 13.879 10.676v19.736h-32.739l0.35586-3.2028z" transform="translate(1.7031 40.705)" fill="#d0b500"/>
+ <path id="path6822-5" d="m-368.32 1071.4 1.7353 19.784h13.523l-1.3794-20.496-4.6262 1.7793-9.2524-1.0676z" transform="translate(1.7031 40.705)" fill="#e7cd54"/>
+ <path id="path6824-1" d="m-346.25 1091 0.35587-25.266 5.6938-7.473 7.1172 7.8289 0.35586 25.622-13.523-0.7118z" transform="translate(1.7031 40.705)" fill="#f8eca8"/>
+ </g>
+ <path id="path9304-5-2-7-8-3-7-0-1" d="m-273.08 1085.9s-7.0907 16.623-14.146 21.491c-4.6594 3.2154-10.924 3.4286-16.579 3.6842-6.3911 0.2889-13.207 0.1817-19.035-2.4561-6.2098-2.8104-15.351-13.509-15.351-13.509s-10.166 13.862-17.807 16.579c-5.7985 2.0614-12.813 1.3059-18.421-1.228-10.097-4.5619-23.578-23.427-23.578-23.427 2.5084 5.6735 4.8312 11.53 7.0351 17.431 0 0 5.1958 5.5032 8.6917 7.9379 3.6114 2.5151 7.8706 4.2357 12.193 5.0647 4.1762 0.801 8.603 0.7287 12.755-0.1876 4 [...]
+ <path id="path9304-5-2-7-8-3-0" d="m-147.29 1086.9c-6.7196 15.023-12.101 29.69-17.375 44.782h-28.286-80.026-82.603-25.71c-5.0982-14.589-10.297-30.282-16.708-44.782 0 0 13.482 18.865 23.578 23.427 5.6081 2.5339 12.623 3.2894 18.421 1.228 7.6415-2.7166 17.807-16.579 17.807-16.579s9.1411 10.698 15.351 13.509c5.8285 2.6378 12.644 2.745 19.035 2.4561 5.6554-0.2556 11.92-0.4688 16.579-3.6842 7.0552-4.8687 14.123-21.491 14.123-21.491s6.8378 13.078 12.281 17.807c4.4913 3.9023 10.131 [...]
+ </g>
+ <g id="g6994-4">
+ <path id="path9304-5-2-7-9-3-16" d="m-272.65 1095.5s-4.9394 7.6033-7.9767 10.201c-4.2181 3.6078-6.9924 5.7811-12.411 7.4891-5.4087 1.7051-12.953 2.664-18.616 2.3538-5.4768-0.3001-11.112-1.888-16.048-4.2795-4.2906-2.0787-11.127-8.1311-11.127-8.1311-3.3232 4.3118-7.5549 7.3405-11.583 9.5786-5.1507 2.8622-10.24 3.1201-15.586 2.832-10.867-0.5858-21.005-7.3742-29.137-21.138-5.2727-12.47-11.338-25.099-18.912-38.342 8.7295-3.0896 18.903-4.7355 30.187-5.2706-4.5894 12.931-9.3504 25.5 [...]
+ <path id="path9304-5-2-7-9-3-3-3-14" d="m-365.99 1115.5c-10.867-0.5858-21.005-7.3742-29.137-21.138-5.2727-12.47-11.338-25.099-18.912-38.342 8.7295-3.0896 18.903-4.7355 30.187-5.2706-4.5894 12.931-9.3504 25.528-7.6664 35.936 9.4806-7.1005 12.547-16.767 15.812-26.354l11.021 38.812c-6.6889-1.1728-3.1317-2.555-20.698-5.8849 3.5198 6.6368 11.578 14.832 20.462 15.639l-1.0681 6.6014zm185.62-6.6014c8.8838-0.8067 16.942-9.0022 20.462-15.639-17.566 3.3299-14.009 4.7121-20.698 5.8849l11 [...]
+ <path id="path9304-5-2-7-9-3-3-9-5" d="m-311.65 1115.5c-5.4768-0.3001-11.112-1.888-16.048-4.2795-4.2906-2.0787-11.127-8.1311-11.127-8.1311-3.3232 4.3118-7.5549 7.3405-11.583 9.5786-5.1507 2.8622-10.24 3.1201-15.586 2.832l-0.18752 1.8729 1.2556-8.4743c5.9737 0.5425 10.31-1.3029 14.107-4.5963 2.7277-2.3659 5.2149-5.4949 5.1822-9.0197-0.0187-2.0187-0.0375-4.0374-0.0562-6.0561-0.012-1.2969-1.6125-3.1325-2.9094-3.1507-1.2358-0.017-1.5777 1.9883-1.9076 3.1793-0.66009 2.3832 0.66538 [...]
+ <path id="path6670-7-2" d="m-272.67 1079.3 6.7927 8.052 3.2702 13.197 9.6181 6.7327 14.042 3.0778 14.042-1.7312 10.772-6.9251 1.5389-7.5021 10.965 0.3847 2.116 8.0792 11.157 7.5022 10.003 0.577 12.311-6.5403 6.7327-8.8486 7.3098 2.3083-7.3098 8.4639-8.0792 6.348-6.1556 2.116-4.6167 0.7694h-5.9632l-4.8091-0.5771-4.6167-1.1541-5.5785-3.4625-7.3098-6.7327-6.7327 4.809-6.5403 3.8473-8.4639 2.8854-8.4639 0.5771-10.003-0.9618-8.6563-2.5007-8.2716-5.3862-6.5403-7.5021-2.5607-3.8472- [...]
+ <path id="path5631-9-3" d="m-272.65 1048.6c-7.8954 0-12.863 0.8304-18.977 1.464 14.156 19.128 12.553 20.926 13.999 27.449-4.7861-0.5401-10.118-3.0623-12.842-4.9285-4.0116-2.749-6.5313-6.4571-9.7578-9.7109l0.54897 32.206c3.5309-2.8088 6.583-5.7772 10.883-8.3296 2.9496-1.7509 6.4863-3.306 11.167-4.4797 0.17574 9.8408-1.4256 18.75-10.156 24.155-3.0719 1.9018-6.1944 3.5102-9.6985 4.3918-3.6908 0.9286-6.991 1.228-10.796 1.281-3.6114 0.05-7.5026-0.3034-10.979-1.281-3.0199-0.8491-5. [...]
+ <path id="path5631-9-7-9-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-203.85 1095.1-0.12597-0.2106c-0.15092-2.5694 0.71875-6.9687 0.71875-6.9687 0.48416-2.19 2.3616-4.533 4.6875-5.375 1.2538-0.4542 2.7761-0.6286 4.125 0.031 0.82261 0.4023 1.4858 0.7143 2.0312 1.2812 0.54546 0.567 0.88412 1.3124 1.25 2.375 0.53493 1.5537 0.30202 3.1738 0.0312 4.5626-0.44672 2.2906-0.39733 4.2935 0.25 5.8437 0.45703 1.0945 1.3768 1.9155 2.5625 2.625-0.220 [...]
+ <path id="path6497-3-9-6" d="m-272.99 1051.4c-3.7858 0.1318-8.997 0.5737-12.14 0.9303 0 0 5.5922 9.6667 7.9264 14.723 1.6682 3.6138 4.4617 11.298 4.5603 11.298l-0.3465-26.951z" fill="#ffefa7"/>
+ <path id="path6497-3-9-0-84" d="m-297.08 1079.6c0.10498-3.0908-0.68906-7.3455-0.40502-9.9117 0 0 4.576 4.8236 8.6035 6.7293 2.8784 1.362 11.52 3.3848 11.52 3.4653l-19.719-0.2829z" fill="#ffefa7"/>
+ <path id="path6497-3-9-0-5-8" d="m-248.35 1079.6c-0.10498-3.0908 0.68906-7.3455 0.40502-9.9117 0 0-4.576 4.8236-8.6035 6.7293-2.8784 1.362-11.52 3.3848-11.52 3.4653l19.719-0.2829z" fill="#ffefa7"/>
+ <path id="path6497-3-9-0-2-3" d="m-297.26 1080.3c0.10498 3.0908-0.68906 7.3455-0.40502 9.9117 0 0 4.576-4.8236 8.6035-6.7293 2.8784-1.362 11.52-3.3848 11.52-3.4653l-19.719 0.2829z" fill="#e7cd54"/>
+ <path id="path6497-3-9-0-5-7-9" d="m-248.54 1080.3c-0.10498 3.0908 0.68906 7.3455 0.40502 9.9117 0 0-4.576-4.8236-8.6035-6.7293-2.8784-1.362-11.52-3.3848-11.52-3.4653l19.719 0.2829z" fill="#e7cd54"/>
+ <path id="path6646-2" d="m-339.89 1054.2 1.0207 36.235-4.4231-6.2943c-1.5895-2.2621-5.1821-3.9906-7.8254-3.7426-2.1011 0.197-4.0619 0.824-5.2736 2.5518-1.3921 1.985-1.1908 7.315-1.1908 7.315s-1.4657-1.7216-1.8713-3.062c-0.49296-1.6292-0.56959-3.449-0.17012-5.1036 0.27402-1.1351 0.85779-2.2546 1.7012-3.0621 0.82428-0.7893 1.9273-1.4107 3.0621-1.5311 3.8431-0.4081 10.207 3.0621 10.207 3.0621s-1.5081-8.4751-1.1908-12.078c0.48324-5.4888 5.9541-14.29 5.9541-14.29z" fill="#ffefa7"/>
+ <path id="path6646-3-30" d="m-205.17 1054.1-1.0207 36.235 4.4231-6.2943c1.5895-2.2621 5.1821-3.9906 7.8254-3.7426 2.1011 0.197 4.0619 0.824 5.2736 2.5518 1.3921 1.985 1.1908 7.315 1.1908 7.315s1.4657-1.7216 1.8713-3.062c0.49296-1.6292 0.56959-3.449 0.17012-5.1036-0.27402-1.1351-0.85779-2.2546-1.7012-3.0621-0.82428-0.7893-1.9273-1.4107-3.0621-1.5311-3.8431-0.4081-10.207 3.0621-10.207 3.0621s1.5081-8.4751 1.1908-12.078c-0.48324-5.4888-5.9541-14.29-5.9541-14.29z" fill="#e7cd54"/>
+ <path id="path6497-3-9-9-9" d="m-407.13 1061.5c3.5314-1.3705 8.4951-3.0178 11.524-3.9285 0 0-2.2905 10.364-2.4433 15.93-0.10928 3.9789 0.89946 11.907 0.80883 11.946l-9.89-23.948z" fill="#f8eca8"/>
+ <path id="path6497-3-9-9-2-2" d="m-138.16 1061.8c-3.5314-1.3705-8.4951-3.0178-11.524-3.9285 0 0 2.2905 10.364 2.4433 15.93 0.10928 3.9789-0.89946 11.907-0.80883 11.946l9.89-23.948z" fill="#e7cd54"/>
+ <path id="path9304-5-2-7-9-3-3-72" d="m-272.65 1095.5s-4.9394 7.6033-7.9767 10.201c-4.2181 3.6078-6.9924 5.7811-12.411 7.4891-5.4087 1.7051-12.953 2.664-18.616 2.3538-5.4768-0.3001-11.112-1.888-16.048-4.2795-4.2906-2.0787-11.127-8.1311-11.127-8.1311-3.3232 4.3118-7.5549 7.3405-11.583 9.5786-5.1507 2.8622-10.24 3.1201-15.586 2.832-10.867-0.5858-21.005-7.3742-29.137-21.138-5.2727-12.47-11.338-25.099-18.912-38.342 8.7295-3.0896 18.903-4.7355 30.187-5.2706-4.5894 12.931-9.3504 25 [...]
+ </g>
+ </g>
+ <g id="g6083-27" transform="translate(0.000009)" stroke-width=".80354">
+ <g id="g7602-9" transform="matrix(1.4641 0 0 1.4641 594.14 -1415.8)">
+ <g id="g9013-8-30" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.6071">
+ <path id="path9015-6-90" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-1" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-5" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.6071" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-7-2" transform="matrix(1.4641 0 0 1.4641 472.65 -1405)">
+ <g id="g9013-8-3-5" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.6071">
+ <path id="path9015-6-9-02" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-9-8" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-9-3" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-1-9" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.6071" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-7-7-9" transform="matrix(-1.4641 0 0 1.4641 -82.739 -1405)">
+ <g id="g9013-8-3-3-3" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.6071">
+ <path id="path9015-6-9-6-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-9-5-1" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-9-5-5" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-1-8-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.6071" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g7885-7" transform="translate(467.6 -914.69)" stroke-width="1.1765">
+ <g id="g7849-3" transform="matrix(.99853 -.054185 .054185 .99853 -59.74 -16.657)">
+ <path id="rect7802-9" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" fill="#f6e078"/>
+ <path id="rect7802-4-6" d="m-346.46 1090.7h16.902l2.1993 3.8065h-21.808l2.7068-3.8065z" fill="#f8eca8"/>
+ <path id="rect7802-1-49" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" stroke="#806600" stroke-width="1.1765" fill="none"/>
+ </g>
+ <g id="g7849-7-2" transform="matrix(-.99853 -.054185 -.054185 .99853 -485.55 -16.657)">
+ <path id="rect7802-13-3" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" fill="#f6e078"/>
+ <path id="rect7802-4-8-5" d="m-346.46 1090.7h16.902l2.1993 3.8065h-21.808l2.7068-3.8065z" fill="#ffe9a7"/>
+ <path id="rect7802-1-4-97" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" stroke="#806600" stroke-width="1.1765" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g7932-5" transform="translate(120.73 275.6)">
+ <g id="g11746-2-0-7-0-1" transform="translate(-301.8 -173.48)" stroke-width="1.1765">
+ <path id="path8971-7-4-4-6-7" d="m390.39 381.08s12.056-0.88424 33.297-2.0834c21.242-1.1992 44-1.8289 55.609-1.8289h35.387c11.245 0 34.538 0.62974 55.609 1.8289s33.055 2.2045 33.055 2.2045l7.3876-33.005s-75.7-6.8309-113.75-6.8309c-38.046 0.00001-113.75 6.8309-113.75 6.8309l7.1454 32.884z" fill-rule="evenodd" fill="#d1b948"/>
+ <path id="path8973-3-6-4-47-1" d="m482.92 341.44 29.641 0.14614 0.0643 35.396h-28.107l-1.5987-35.542z" fill-rule="evenodd" fill="#c5a941"/>
+ <path id="path8979-9-0-9-8-8" d="m399.02 346.47 85.628-5.2802-0.0547 34.195-83.535 3.8807-2.0386-32.795z" fill-rule="evenodd" fill="#e7cd54"/>
+ <path id="path8981-7-3-1-4-4" d="m405.94 345.53 57.768-3.8534 1.5287 34.637-57.258 2.6756-2.0384-33.459z" fill-rule="evenodd" fill="#f6e078"/>
+ <path id="path8983-7-2-5-0-0" d="m413.79 344.77 32.903-2.1182 1.5287 34.7-16.197 0.58798-16.197 0.58798-2.0384-33.758z" fill-rule="evenodd" fill="#f8eca8"/>
+ <path id="path8991-9-6-5-0-7" d="m478.97 373c-11.723 0-34.477 0.62611-55.783 1.8289-13.345 0.76851-20.741 2.0497-34.044 3.3554l1.3309 2.8063c13.389-1.2191 19.657-1.4181 33.076-2.2262 21.178-1.1956 43.924-1.8289 55.419-1.8289h35.387c11.128 0 34.433 0.63364 55.435 1.8289 20.937 1.1916 33.698 2.3473 33.698 2.3473l0.64144-2.6573s-12.772-2.4188-33.976-3.6256c-21.139-1.2031-44.436-1.8289-55.798-1.8289h-35.387z" fill-rule="evenodd" fill="#d1b948"/>
+ <path id="path8993-5-9-5-62-7" d="m423.19 344.46c-21.376 1.2068-39.864 3.6462-39.864 3.6462l1.3372 5.8374s17.782-2.3174 38.889-3.509c21.178-1.1956 43.924-1.671 55.419-1.671h35.387c11.128 0 34.784 0.72957 55.786 1.9248 20.937 1.1916 39.16 3.2552 39.16 3.2552l1.0163-5.8374s-18.96-2.4394-40.164-3.6462c-21.139-1.2031-44.436-2.6863-55.798-2.6863h-35.387c-18.632 0.32121-37.21 1.6156-55.782 2.6863h0.00005z" fill-rule="evenodd" fill="#d0b500"/>
+ <path id="path8995-7-3-4-8-4-12" d="m496.5 341.73c38.012-0.0193 76.02 2.041 113.86 6.2343l-6.9279 33.312c-37.64-3.3788-68.451-4.2827-106.51-4.5808m0.5045-34.966c-38.012-0.0193-76.02 2.041-113.86 6.2343l6.9279 33.312c37.64-3.3788 68.451-4.2827 106.51-4.5808" stroke="#806600" stroke-width="1.1765" fill="none"/>
+ </g>
+ <g id="g8876-0-1-2-7-2" transform="matrix(1.0111 0 0 .77383 772.99 -265.67)" stroke-width="1.33">
+ <path id="path8995-2-0-3-3-9-4-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-644.32 561.77-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-1.9091 2.9817-2.0675 5.7008 1.4062 7.875 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-2.2332 54.688-2.4688h35c10.916 0 33.968 0.8703 54.688 2.5 20.625 1.6223 41.688 4.9375 41.688 4.9375 3.5944-2.398 3.2039-5.0807 1.25-7.875 0 0-21.258-3.4064-42.312-5.0625-20.96-1.6487- [...]
+ <path id="path8995-2-0-4-0-7-8-1-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-454.93 569.96c0.10745-1.3197-0.47864-1.7281-1.4556-3.1253 0 0-21.258-3.4064-42.312-5.0625-20.96-1.6487-43.984-2.5-55.312-2.5h-35c-18.464 0.0721-36.901 1.21-55.313 2.5001l-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-0.95457 1.4908-1.4714 1.6349-1.3154 2.9592 15.614-1.897 28.807-4.0506 43.915-5.2316 23.98-1.8745 49.508-2.2351 72.356-2.3283 22 [...]
+ <path id="path8995-2-0-7-8-0-8-2-8-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-687.27 572.98c0.44377 0.60668 1.0848 1.1838 1.9525 1.7269 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-2.2332 54.688-2.4688h35c10.916 0 33.968 0.8703 54.688 2.5 20.625 1.6223 41.688 4.9375 41.688 4.9375 1.1271-0.75199 1.4529-1.1907 1.871-1.9933-39.889-7.1136-76.13-7.8257-114.39-8.1801-37.267-0.34515-79.257 1.8974-117.12 8.4466h0.00005z" fill= [...]
+ <path id="path8995-2-0-7-3-8-0-5-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-644.32 561.77-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-1.9091 2.9817-2.0675 5.7008 1.4062 7.875 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-2.2332 54.688-2.4688h35c10.916 0 33.968 0.8703 54.688 2.5 20.625 1.6223 41.688 4.9375 41.688 4.9375 3.5944-2.398 3.2039-5.0807 1.25-7.875 0 0-21.258-3.4064-42.312-5.0625-20.96-1.648 [...]
+ </g>
+ <g id="g8876-3-8-3-7-8-7" transform="matrix(.94011 0 0 .77383 732.44 -231.28)" stroke-width="1.3793">
+ <path id="path8995-2-0-0-3-8-4-9-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-644.32 561.77-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-1.9091 2.9817-2.0675 5.7008 1.4062 7.875 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-2.2332 54.688-2.4688h35c10.916 0 33.968 0.8703 54.688 2.5 20.625 1.6223 41.688 4.9375 41.688 4.9375 3.5944-2.398 3.2039-5.0807 1.25-7.875 0 0-21.258-3.4064-42.312-5.0625-20.96-1.648 [...]
+ <path id="path8995-2-0-4-6-6-1-8-9-89" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-454.93 569.96c0.10745-1.3197-0.47864-1.7281-1.4556-3.1253 0 0-21.258-3.4064-42.312-5.0625-20.96-1.6487-43.984-2.5-55.312-2.5h-35c-18.464 0.0721-36.901 1.21-55.313 2.5001l-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-0.95457 1.4908-1.4714 1.6349-1.3154 2.9592 15.614-1.897 28.807-4.0506 43.915-5.2316 23.98-1.8745 49.508-2.2351 72.356-2.3283 [...]
+ <path id="path8995-2-0-7-8-2-0-5-5-9-37" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-687.27 572.98c0.44377 0.60668 1.0848 1.1838 1.9525 1.7269 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-2.2332 54.688-2.4688h35c10.916 0 33.968 0.8703 54.688 2.5 20.625 1.6223 41.688 4.9375 41.688 4.9375 1.1271-0.75199 1.4529-1.1907 1.871-1.9933-39.889-7.1136-76.13-7.8257-114.39-8.1801-37.267-0.34515-79.257 1.8974-117.12 8.4466h0.00005z" fi [...]
+ <path id="path8995-2-0-7-2-4-3-8-3-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-644.32 561.77-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-1.9091 2.9817-2.0675 5.7008 1.4062 7.875 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-1.7781 54.688-2.0138h35c10.916 0 33.968 0.41526 54.688 2.045 20.625 1.6223 41.688 4.9375 41.688 4.9375 3.5944-2.398 3.2039-5.0807 1.25-7.875 0 0-21.258-3.4064-42.312-5.0625-20.96- [...]
+ </g>
+ <g id="g7430-5" transform="translate(.20976 .68990)">
+ <g id="g11952-75" transform="translate(-302.32 -173.09)" stroke-width="2.6601">
+ <g id="g9188-7" transform="matrix(.50554 0 0 .38692 -961.11 29.491)">
+ <rect id="rect9190-24" fill-rule="evenodd" height="59.169" width="89.493" y="823.57" x="2840.1" fill="#f6e078"/>
+ <path id="path9192-49" d="m2840.1 823.57h89.493l-89.493 59.169v-59.169z" fill-rule="evenodd" fill="#f8eca8"/>
+ <path id="path9194-9" d="m2929.6 836.05v46.683h-71.619l71.619-46.683z" fill-rule="evenodd" fill="#e7cd54"/>
+ <rect id="rect9196-6" ry="3.0061" height="59.169" width="89.493" stroke="#806600" y="823.57" x="2840.1" stroke-width="2.6601" fill="none"/>
+ </g>
+ <g id="g9198-0" transform="matrix(.50554 0 0 .38692 -961.11 29.491)">
+ <g id="g9200-1" stroke-width="2.6601">
+ <g id="g9202-6">
+ <rect id="rect9204-2" fill-rule="evenodd" ry="5.1773" height="43.637" width="70.263" stroke="#a0892c" y="831.33" x="2849.7" fill="#2d6afa"/>
+ <path id="path9206-3" d="m2918.5 873.46c-0.9358 0.93579-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57727-3.6642-1.5131-0.9357-0.93579-1.513-2.2301-1.513-3.6642v-33.282c0-1.4341 0.5773-2.7284 1.513-3.6642 0.9358-0.93579 68.172 39.675 67.237 40.611z" fill-rule="evenodd" stroke="#a0892c" fill="#2b96f6"/>
+ <path id="path9208-5" d="m2918.5 873.46c-0.9358 0.93581-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57727-3.6642-1.5131-0.9357-0.93579-1.513-2.2301-1.513-3.6642v-33.282c0-1.4341 0.5773-2.7284 1.513-3.6642 0.4751-0.47512 18.04 9.7588 35.096 20.073 16.539 10.001 32.601 20.077 32.14 20.538z" fill-rule="evenodd" stroke="#d7e3f4" fill="#5183fb"/>
+ <path id="path9210-9" d="m2918.5 832.84c0.9357 0.93579 1.513 2.2301 1.513 3.6642v33.282c0 1.4341-0.5773 2.7284-1.513 3.6642-0.9358 0.93579-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57727-3.6642-1.5131-0.9357-0.93579 66.301-41.547 67.237-40.611z" fill-rule="evenodd" stroke="#afc6e9" fill="#1353b4"/>
+ <path id="path9212-1" d="m2918.5 873.46c-0.9358 0.93579-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57725-3.6642-1.5131-0.4748-0.47478 16.6-11.163 33.661-21.457 0 0 34.512 20.521 33.576 21.457z" fill-rule="evenodd" stroke="#afc6e9" fill="#134fab"/>
+ <rect id="rect9214-9" ry="5.1773" height="43.637" width="70.263" stroke="#a0892c" y="831.33" x="2849.7" fill="none"/>
+ </g>
+ <rect id="rect9216-1" fill-rule="evenodd" ry="0" height="22.304" width="39.367" stroke="#afc6e9" y="841.29" x="2865.2" fill="#135ecb"/>
+ </g>
+ </g>
+ </g>
+ <g id="g11969-6" transform="translate(-302.24 -173.09)" stroke-width="1.1765">
+ <g id="g11756-36">
+ <g id="g14606-9-6-40" transform="matrix(.87076 -.013950 .015580 .77968 -53.131 133.63)" stroke-width="1.4276">
+ <rect id="rect9196-0-6-81" ry="10.771" stroke="#806600" stroke-width="1.4284" fill="#f6e078" fill-rule="evenodd" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" width="35.829" height="22.674" y="340.21" x="494.63"/>
+ <rect id="rect8641-5-6-9" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" fill-rule="evenodd" ry="8.271" height="16.542" width="29.954" y="343.28" x="497.57" fill="#306947"/>
+ <path id="path8643-2-3-5" d="m565.02 299.34c0.16428 1.1753-0.61499 3.213-1.9202 4.2858-2.2356 1.8375-6.0141 2.4602-9.2376 2.7557-5.1056 0.46803-8.7752-2.1575-9.2208-5.3458-0.26654-1.907 0.5917-4.4462 2.7286-5.7076 1.4358-0.84752 3.6705-1.3512 5.7223-1.5393 3.4341-0.3148 8.07 0.0272 10.463 1.8022 1.1645 0.86395 1.3193 2.7051 1.4652 3.7489z" fill-rule="evenodd" fill="#36a464"/>
+ <rect id="rect8646-7-4-5" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" ry="8.271" height="16.542" width="29.954" stroke="#a0892c" y="343.28" x="497.57" stroke-width="1.4284" fill="none"/>
+ <path id="path8648-3-4-1" d="m816.44 431.48c0 1.6327-2.5369 2.9563-5.6663 2.9563s-5.6663-1.3236-5.6663-2.9563 2.5369-2.9563 5.6663-2.9563 5.6663 1.3236 5.6663 2.9563z" fill-rule="evenodd" transform="matrix(.77012 -.070597 .13944 .99765 -131.26 -73.481)" fill="#abe8c4"/>
+ </g>
+ <g id="g14768-2-7" transform="matrix(-.81814 .14282 .15467 .88602 852.1 11.28)" stroke-width="1.3612">
+ <path id="path14614-9-9-7" d="m626.17 310.88-23.701-12.771 23.701-12.082 2.8814 13.147-2.8814 11.706z" stroke="#806600" stroke-width="1.3612" fill="#f6e078"/>
+ <path id="path14614-9-3-8-2-8" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.657 8.5789-5.657 9.4386z" fill="#ff0a3e"/>
+ <path id="path14614-9-3-2-8-0" d="m626.17 307.47-17.183-9.2586 22.66-0.18009-5.4769 9.4386z" fill="#bc0028"/>
+ <path id="path14766-9-4" d="m452.4 250.56 22.953-0.0249" transform="translate(156.53 47.58)" stroke="#f4d7d7" stroke-width="1.3612" fill="none"/>
+ <path id="path14614-9-3-8-3-2-4" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.8371 8.3988-5.8371 9.6187z" stroke="#a48d2f" stroke-width="1.3612" fill="none"/>
+ </g>
+ <g id="g10214-5" transform="translate(.77786 -117.02)" stroke-width="1.4524">
+ <g id="g8305-3" transform="matrix(.9 0 0 .9 292.52 -504.08)">
+ <g id="g8172-96" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-53" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="3.2276">
+ <path id="path9015-4-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-2" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-1" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-84" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="3.2276" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-2" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-10" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="3.2276">
+ <path id="path9015-4-3-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-3" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="3.2276" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g8305-1-8" transform="matrix(.9 0 0 .9 241.08 -501.27)">
+ <g id="g8172-5-47" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-8-9" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="3.2276">
+ <path id="path9015-4-2-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-9-3" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-8-3" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-2-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="3.2276" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-0-0" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-4-89" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="3.2276">
+ <path id="path9015-4-3-8-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-5-4" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-8-59" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-3-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="3.2276" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g11756-9-5" transform="matrix(-1 0 0 1 994.39 0)">
+ <g id="g14606-9-6-4-74" transform="matrix(.87076 -.013950 .015580 .77968 -53.131 133.63)" stroke-width="1.4276">
+ <rect id="rect9196-0-6-1-5" ry="10.771" stroke="#806600" stroke-width="1.4284" fill="#f6e078" fill-rule="evenodd" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" width="35.829" height="22.674" y="340.21" x="494.63"/>
+ <rect id="rect8641-5-6-6-87" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" fill-rule="evenodd" ry="8.271" height="16.542" width="29.954" y="343.28" x="497.57" fill="#306947"/>
+ <path id="path8643-2-3-1-95" d="m565.02 299.34c0.16428 1.1753-0.61499 3.213-1.9202 4.2858-2.2356 1.8375-6.0141 2.4602-9.2376 2.7557-5.1056 0.46803-8.7752-2.1575-9.2208-5.3458-0.26654-1.907 0.5917-4.4462 2.7286-5.7076 1.4358-0.84752 3.6705-1.3512 5.7223-1.5393 3.4341-0.3148 8.07 0.0272 10.463 1.8022 1.1645 0.86395 1.3193 2.7051 1.4652 3.7489z" fill-rule="evenodd" fill="#36a464"/>
+ <rect id="rect8646-7-4-2-9" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" ry="8.271" height="16.542" width="29.954" stroke="#a0892c" y="343.28" x="497.57" stroke-width="1.4284" fill="none"/>
+ <path id="path8648-3-4-0-6" d="m816.44 431.48c0 1.6327-2.5369 2.9563-5.6663 2.9563s-5.6663-1.3236-5.6663-2.9563 2.5369-2.9563 5.6663-2.9563 5.6663 1.3236 5.6663 2.9563z" fill-rule="evenodd" transform="matrix(.77012 -.070597 .13944 .99765 -131.26 -73.481)" fill="#abe8c4"/>
+ </g>
+ <g id="g14768-2-4-6" transform="matrix(-.81814 .14282 .15467 .88602 852.1 11.28)" stroke-width="1.3612">
+ <path id="path14614-9-9-4-8" d="m626.17 310.88-23.701-12.771 23.701-12.082 2.8814 13.147-2.8814 11.706z" stroke="#806600" stroke-width="1.3612" fill="#f6e078"/>
+ <path id="path14614-9-3-8-2-5-5" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.657 8.5789-5.657 9.4386z" fill="#ff0a3e"/>
+ <path id="path14614-9-3-2-8-9-28" d="m626.17 307.47-17.183-9.2586 22.66-0.18009-5.4769 9.4386z" fill="#bc0028"/>
+ <path id="path14766-9-7-3" d="m452.4 250.56 22.953-0.0249" transform="translate(156.53 47.58)" stroke="#f4d7d7" stroke-width="1.3612" fill="none"/>
+ <path id="path14614-9-3-8-3-2-5-9" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.8371 8.3988-5.8371 9.6187z" stroke="#a48d2f" stroke-width="1.3612" fill="none"/>
+ </g>
+ <g id="g10214-3-33" transform="translate(.77786 -117.02)" stroke-width="1.4524">
+ <g id="g8305-9-3" transform="matrix(.9 0 0 .9 292.52 -504.08)">
+ <g id="g8172-0-9" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-3-1" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="3.2276">
+ <path id="path9015-4-26-44" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-8-5" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-9-2" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-1-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="3.2276" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-4-9" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-8-5" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="3.2276">
+ <path id="path9015-4-3-7-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-1-3" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-9-0" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-31-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="3.2276" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g8305-1-1-8" transform="matrix(.9 0 0 .9 241.08 -501.27)">
+ <g id="g8172-5-4-3" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-8-5-1" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="3.2276">
+ <path id="path9015-4-2-9-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-9-0-8" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-8-9-6" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-2-3-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="3.2276" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-0-4-67" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-4-7-4" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="3.2276">
+ <path id="path9015-4-3-8-5-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-5-7-08" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-8-5-7" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-3-0-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="3.2276" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g17534" transform="matrix(.85001 0 0 .85001 354.73 -681.16)" stroke-width="1.1765">
+ <g id="g17452">
+ <g id="g6412" transform="translate(11.236 28.472)">
+ <g id="g6403">
+ <g id="g4862" stroke-width="1.1765">
+ <path id="path3457-7-3" d="m218.6 283.4c0.91947-1.7882 2.198-4.5815 2.3134-7.624 0.10759-2.8381-0.91828-5.9957-0.91828-5.9957 3.2388-0.4122 5.3582 3.4773 7.8237 6.0369 0.90204-4.6771 1.731-10.009-1.9138-14.3 6.568-0.10123 7.0147 0.97098 9.1218 2.4866 0.63016-2.3637 2.8576-7.1802-3.2128-13.455 3.3396-1.1804 6.1109 1.0712 8.5759 1.5354 0.71825-4.1914-1.313-7.6827-5.7411-13.478 3.6507-2.9536 6.9658-0.0434 10.416 0.50281 1.8386-5.5554-3.6312-12.821-7.4349-16.093 3.2111-1.3555 6.35 [...]
+ <path id="path4860" d="m194.15 286.28s5.0098-5.4542 6.9485-8.5835c2.7613-4.4572 4.9939-9.2956 6.5398-14.306 1.4264-4.6231 1.8349-9.5072 2.4524-14.306 1.4139-10.986 2.8612-33.108 2.8612-33.108l-4.4961-4.9048-1.2262 2.0437-1.2262-0.81747s0.53952 24.325-0.81747 36.377c-0.68459 6.0805-1.9861 12.104-3.6786 17.984-1.932 6.712-7.3572 19.619-7.3572 19.619z" fill="#f8eca8"/>
+ </g>
+ <g id="g6044-2-9-5" transform="matrix(.71142 -.52991 .47969 .78590 -238.36 282.87)" stroke-width="1.3045">
+ <path id="path5744-98-7-9-8" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" fill="#fff"/>
+ <path id="path6042-0-9-1" d="m381.41 307.04 1.7674-3.3581s-3.2636-0.16484-4.7721 0.35349c-2.0089 0.69028-5.3023 3.5349-5.3023 3.5349l0.92898 3.6168 1.4889-2.9777 2.316-1.3234 3.5731 0.15411z" fill="#ececec"/>
+ <path id="path5744-98-6-3-1-4" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" stroke="#999" stroke-width="1.3045" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g8323" transform="translate(11.236 28.472)">
+ <path id="path3942-8-8" d="m330.34 196.73c1.6804-0.11533 5.499 0.29576 7.1004-0.4215 6.9557-3.1154 11.328-2.3094 16.248 2.6021 0 0-2.3359 2.3618-1.4257 5.439 0.62922 2.1272 2.0604 4.845 3.9264 6.0446 1.3846 0.89007 3.098 1.644 4.7288 1.4216 3.5506-0.48405 6.633-5.972 6.633-5.972l2.8101-10.573c-9.4456-7.4912-24.886-12.908-34.59-8.2921-4.7842 3.6277-5.1912 8.771-5.4309 9.7508z" stroke="#806600" stroke-width="1.1765" fill="#e7cd54"/>
+ <g id="g5698" stroke-width="1.1765">
+ <path id="path3457-0" d="m404.14 172.42c-12.548-5.348-19.453-10.052-32.678-13.399-8.2984-2.1001-21.841-3.987-30.399-4.1449-16.93-0.31237-32.48 3.3746-49.026-0.22429-8.5359-1.8566-22.515-14.051-32.346-19.126-12.87-6.6439-23.223-5.8959-23.223-5.8959l-17.003 18.213 6.5751 29.978s-6.7832 8.7652-7.921 14.791c-3.5732 18.923-1.8586 43.314-5.0969 62.298-1.5022 8.8062-6.6591 22.167-13.559 30.565-4.4616 5.43-3.7185 3.7042-9.9951 9.5395-3.6662 3.4084-6.6653 6.1546-8.5718 10.783-1.1329 2.7 [...]
+ <path id="path3457-0-7-79" d="m376.34 102.65c0.21783-3.1808 5.0196-8.8482 6.0609-11.862 1.5667-4.5336 1.7499-5.8652 1.2575-10.634-0.3337-3.2317-3.0974-9.2413-3.0974-9.2413-0.5782 1.9175 0.27727 3.8773-6.8558 7.0216 0 0 3.8074-9.2827 2.6659-13.645-1.1746-4.4884-3.6913-9.1996-7.1724-12.267-3.7457-3.3002-8.5424-2.6315-12.349-5.8619-3.1857-2.7038-6.6924-10.599-6.6924-10.599s-2.8095 7.2373-3.1567 11.424c-0.28579 3.4463 0.46846 7.5207 1.8334 10.698 1.6023 3.7298 3.736 5.2851 4.9969 9 [...]
+ <path id="path4924" d="m483.3 176.34s-6.5342 4.5243-9.4645 5.4545c-3.0029 0.95331-6.2179 1.6086-9.3567 1.3367-2.8677-0.24847-6.9574-2.6733-6.9574-2.6733-3.323 2.9774-7.8815 7.0373-12.044 8.7321-3.6983 1.5056-7.6706 2.6549-12.358 2.2752-5.1349-0.41592-10.98-2.481-14.678-3.4413-8.5278-2.2143-19.259-12.022-24.461-20.716l-5.9653-2.2344 12.412 23.105 8.4019 1.9095 11.266 2.6733 8.7838 0.95476h9.1657l7.0653-1.1457 12.794-6.4924 7.0653 0.76381 5.9195-0.95476 6.3014-3.4372 6.1105-6.110 [...]
+ <g id="g4891" stroke-width="1.1765">
+ <g id="g4831">
+ <path id="path3673" d="m272.14 155.06c4.9097 2.4498 12.12 7.1087 18.615 8.3418 6.4949 1.2332 9.9965 0.95609 17.587 0.56184 7.5902-0.39425 33.531-2.5702 40.228-2.4797 6.6969 0.0905 10.998 0.71191 17.278 2.503 6.2799 1.7911 11.578 4.3357 16.976 8.2833 5.3982 3.9476 4.4144 12.217 7.785 16.431 3.3706 4.2148 11.604 22.572 14.043 26.829 2.4387 4.2569-2.1624 6.556-0.331 11.982 1.8314 5.4263-1.4626 0.90218 1.7669 6.2833 3.2294 5.3811 10.89 5.2468 14.387 9.4943 3.4968 4.2474 5.2742 7. [...]
+ <path id="path3703" d="m364.31 207.58-0.74016 9.178 1.1843 5.3292s2.5512 4.5982 4.1459 6.661c1.302 1.6841 2.3972 2.8859 3.9949 4.2925 1.1857 1.0439 3.9979 3.2577 3.9979 3.2577l10.066 3.7008 4.441 1.6284s6.8554-0.3761 9.1718-2.0401c2.6126-1.8768 4.1563-5.6879 5.4834-8.6183 1.6286-3.5959 1.5265-7.9434 0.91094-11.843-0.84924-5.3794-2.9478-12.763-2.9478-12.763l-8.2126-15.054s6.3715 18.831 7.0388 27.304c2.8505 13.979-15.274 16.785-27.87 9.2434-2.2494-1.7702-5.518-5.5142-6.2174-8.2 [...]
+ <path id="path3705" d="m398.54 232.59s-6.9948 13.063 0.2596 4.5968c1.2363-1.4427 8.8392 0.007 9.897 0.61167 4.6486 2.6577 15.105 5.4689 15.105 5.4689l-7.8128-8.0732-8.0732-9.3753-9.3753 6.771z" fill="#e7cd54"/>
+ <path id="path3457-0-7-9" d="m230.84 135.66 5.6303-6.0308s10.353-0.74803 23.223 5.8959c9.8307 5.0748 23.81 17.269 32.346 19.126 16.546 3.5988 32.096-0.0881 49.026 0.22429 8.5585 0.15792 22.101 2.0448 30.399 4.1449 8.321 2.1058 14.14 4.749 20.437 7.7519 6.2972 3.0029 11.146 22.129 11.146 22.129s-0.49926 2.0938 1.7647 6.4181c2.141 4.0895 4.9765 8.1725 6.09 11.344 1.3548 4.5095 2.7516 9.7014 4.4934 13.625 2.8072 6.3242 6.5104 10.958 12.378 16.152 3.0094 3.4641 8.4393 4.348 11.64 [...]
+ <path id="path3697" d="m365.34 219.07s2.6499 4.9374 3.3256 2.8553c0.0979-14.84-2.6742-37.268-11.745-42.87-3.9981-2.4692-4.9643-2.5783-9.6408-3.0694-4.1233-0.43303-7.1532 0.66326-11.113 1.8914-5.7963 1.7977-17.254 10.801-21.702 14.031-16.092 11.687-28.167 13.908-46.041 15.234-3.6908 0.84738-0.64512-0.92363-3.9562 0.89712-3.3404 1.8369-8.451 7.7053-8.451 7.7053l9.1966 2.237 20.842-2.3699s17.791-6.4122 26.979-12.313c7.593-4.8766 17.501-17.061 24.261-18.623 5.5847-1.2905 12.162-1 [...]
+ <path id="path4829" d="m219.54 215.2-3.8972 38.972-3.7909 13.397-6.5496 13.528s8.6692-3.6945 11.077-7.7252c2.3183-3.8813 5.205-8.5658 6.1316-12.991 2.4437-11.671 9.5437-44.073 9.5437-44.073l-12.514-1.1086z" fill="#f8eca8"/>
+ <path id="path4721" d="m219.41 223.18 12.094 6.3209 0.69106-4.8374 6.2195-3.4553 6.5651-1.7276 8.2927-3.1098-3.4553 20.386-9.3293 19.004-10.366 19.695-1.3821 12.785-10.02 10.02-10.366 5.5285-8.9307 10.58-6.2726 0.82197-7.2561 3.4553-4.3689-2.7371-0.53187-8.6382 1.7108-4.8824 4.2977-5.3695s9.0324-7.2635 12.585-11.78c4.1443-5.2682 7.27-11.338 9.8982-17.504 1.1294-2.6498 1.7905-5.4811 2.4806-8.2777 0.67796-2.7474 1.2088-5.5334 1.6258-8.3323 0.58205-3.9069 0.91901-7.8486 1.2194-1 [...]
+ <path id="path3699" d="m270.63 207.29c1.5984-1.4573 3.0453-3.22 3.8374-5.2328 1.4578-3.7044 2.1775-11.6 2.1775-11.6s6.5569-6.0186 8.1962-9.0626c1.7857-3.316 1.4866-9.7433 1.4836-13.51-0.002-2.2368-7.2669-18.58-7.2669-18.58l-10.071-4.7394-15.718 49.119-13.954 7.6748-23.024 10.466-0.6977 7.3259s3.3842 7.1987 6.2794 9.7679c3.3843 3.0032 12.21 5.9305 12.21 5.9305s-0.93156-5.2922 0-7.6748c0.74914-1.916 2.3884-3.5349 4.1862-4.5351 2.6905-1.4968 6.1421-0.79285 9.0702-1.7443 3.9085-1 [...]
+ <path id="path3457-0-7-7" d="m257.28 216.6s11.164 1.9528 16.231 1.9445c5.7169-0.009 11.625-1.4957 16.992-3.4634 19.127-7.0116 34.44-20.437 47.804-26.299 4.214-1.8485 10.478-2.6476 14.107 0.18151 2.0302 1.5826 3.9169 2.5334 5.7113 5.4616 3.4656 5.6553 6.1944 13.792 6.1944 13.792l-0.61411-10.728c-0.33176-5.7959-4.8799-10.225-7.805-12.68-5.1313-4.3057-10.52-3.7017-16.997-2.0958-5.4492 1.3511-13.084 7.5456-17.789 10.8-20.268 14.018-30.434 17.688-43.184 19.325-15.149 1.9446-17.356 [...]
+ <path id="path3711" d="m391.15 294.76s5.3908 3.0392 8.3725 3.663c3.0732 0.64284 5.7762 1.4018 8.8957 1.0466 1.1561-0.13167 2.9888-1.14 3.9246-1.8315 3.0798-2.2758 5.7561-9.9423 5.7561-9.9423s1.853-2.1401 2.3548-3.663c2.2076-6.7008-1.0466-18.838-1.0466-18.838-0.67124-4.475-4.2315-10.565-7.3259-13.867-1.9536-2.0844-4.5748-3.6781-7.3259-4.4479-2.9396-0.8225-9.1574 0-9.1574 0l11.25 12.82 3.4013 5.4944 1.8315 5.2328-0.52327 15.175-13.344 5.7561-3.9246 1.5698-3.1397 1.8315z" fill=" [...]
+ <path id="path3707" d="m375.07 231.14c-3.065-1.3404-5.606-5.35-7.1366-8.3338-0.91005-1.7741-1.2424-3.7983-1.6433-5.7515-0.61063-2.975-1.9719-8.5451-1.9719-8.5451l-0.49298 11.174s1.9621 5.2544 3.4509 7.5591c1.5831 2.4507 3.5615 4.6454 5.7515 6.5731 1.9961 1.7571 6.7374 4.2725 6.7374 4.2725s4.0515 1.2116 6.0801 1.8076c1.6965 0.49843 3.6113 0.51591 5.0942 1.479 1.5668 1.0175 2.4158 2.8504 3.6166 4.2816 1.8661 2.2242 3.6384 4.5289 5.5759 6.6911 1.8597 2.0754 7.8063 8.4754 7.8063 [...]
+ <path id="path3713" d="m447.76 254.85-4.6949 0.22277-1.824 1.4535c-3.0468-4.6322-7.4117-11.29-5.751-11.428 5.3447-0.4458 9.3329 5.68 12.27 9.7521z" fill="#f6e07c"/>
+ <path id="path3713-9" d="m449.68 271.48-4.6268-1.0542-2.3883 0.32102c-1.6908-4.3967-4.1068-10.165-2.4043-9.8884 5.4793 0.8914 7.6742 6.6962 9.4194 10.622z" fill="#f6e07c"/>
+ <path id="path3773" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m402.97 297.19c-0.45404 0.30777-2.0732 0.89456-3.7812 1.625-3.622 1.6214-6.3175 4.0212-7.3125 7.0625s-0.31106 6.0867 2.6775 9.5326l5.4059 1.9286c-5.3054-1.2228-7.0659-8.4329-6.1772-10.836 0.84214-2.2775 2.9337-4.4044 6.2188-5.875v0.0312c1.5974-0.68312 3.0645-1.1148 4.0938-1.8125 1.0083-0.68347 2.3249-1.5526 3.1848-2.5652 0.85991-1.0126 1.2215-2.1535 1.2215-2.1535-3.3294 1.2439- [...]
+ <path id="path3773-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m417.56 298.12s-3.9726 2.8388-4.5624 3.2812c-0.5899 0.4424-1.6382 0.9989-3.25 1.7812-3.6469 1.8464-6.0229 4.4977-6.5938 7.625-0.57085 3.1273-0.13278 5.7021 2.8564 8.9502l8.034 1.3987c-0.9871-1.0726-5.155-1.7115-6.6534-3.0503-2.6168-2.338-2.5435-5.4476-2.2684-6.9549 0.43155-2.3641 2.2414-4.5311 5.5-6.1875 0.0109-0.005 0.0204 0.005 0.0312 0 1.6045-0.77883 2.6932-1.3403 3.5312-1 [...]
+ <path id="path3713-9-8-3" d="m441.52 292.21-2.3391-1.4054c-0.78071-3.796-1.6773-6.9004-0.29185-6.4301 4.4588 1.5134 5.0186 6.3733 5.913 9.7966l-3.282-1.961z" fill="#f6e07c"/>
+ <path id="path3713-9-8" d="m443.86 282.44-2.1646-0.23224c-0.56087-4.4517-1.4702-9.7504-0.0334-9.1159 4.6239 2.0422 5.3316 7.4718 6.0392 11.499l-3.8412-2.1505z" fill="#f6e07c"/>
+ <path id="path3457-0-7-90" d="m180.89 305.8c-1.1329 2.7504-1.3727 7.1574-0.62133 10.035 0.83086 3.1824 5.3094 7.365 5.3094 7.365 8.946-1.5581 15.751-9.54 22.79-16.818 2.5973-2.6852 6.6703-2.5668 10.113-4.8298 4.7641-3.1313 9.036-7.3382 11.943-12.242 1.0253-1.7296 2.4695-4.441 2.7676-7.4711 0.27809-2.8265-0.55614-6.04-0.55614-6.04 3.2577-0.21672 5.1394 3.7932 7.4466 6.4964 1.1816-4.6145 2.3297-9.887-1.0506-14.389 6.5622 0.29385 6.9436 1.391 8.9558 3.0305 0.77113-2.3215 3.2841- [...]
+ <g id="g4786" stroke-width="1.1765" fill="#f6e07c">
+ <path id="path3713-5" d="m262.52 230.36-4.5434-1.204-2.1776 0.83553c-1.5074-5.3355-3.6603-13-2.0352-12.631 5.2302 1.1874 7.1844 8.231 8.7561 12.999z"/>
+ <path id="path3713-9-2" d="m259.59 246.83-4.227-2.1566-2.3941-0.27445c-0.56105-4.677-1.4886-10.862 0.094-10.176 5.0934 2.2078 5.7979 8.3737 6.5272 12.607z"/>
+ <path id="path3713-9-8-3-2" d="m245.36 268.79-2.851-0.54408c0.174-3.8716 0.83935-9.1117 2.0672-8.3161 3.9516 2.5606 3.3025 7.4094 3.3301 10.947l-2.5462-2.0873z"/>
+ <path id="path3713-9-8-7" d="m250.37 257.54-2.1599-0.2725c-0.47787-4.4614-1.2883-9.7761 0.13637-9.1149 4.5851 2.128 5.1915 7.5698 5.824 11.609l-3.8005-2.2217z"/>
+ <path id="path3713-9-8-3-2-3" d="m237.41 278.86-2.622-2.3921c0.58637-3.8309 1.9621-7.114 3.098-6.1918 3.6556 2.9679 2.4926 7.7197 2.1422 11.24l-2.6182-2.6566z"/>
+ </g>
+ <path id="path3701" d="m279.37 202.2s2.5668-6.9956 3.6482-9.2336c1.0813-2.2381 3.8463-3.0853 5.6125-5.804 1.7663-2.7187 2.245-8.9698 2.245-8.9698 11.46 4.9332 32.676-3.4376 43.04-6.1834 0 0-12.523 8.7205-17.784 12.779-5.2611 4.0584-16.136 9.957-21.889 12.399-5.7524 2.4424-14.873 5.0126-14.873 5.0126z" fill="#f8eca8"/>
+ <path id="path3709" d="m370.9 202.79c-0.46231 4.3847-0.88556 8.9292 0.59854 13.187 0.80497 2.3094 2.446 4.4717 4.3892 6.3712 2.0784 2.0318 4.4408 4.1513 7.5814 5.1859 2.6858 0.88477 5.9451 1.1706 8.7784 0.59268 2.2961-0.46833 4.237-1.8593 5.3868-3.4079 1.5123-2.0369 1.8871-3.898 1.7956-6.2231-0.11155-2.8351-1.0237-6.1903-2.1946-8.8901-0.97634-2.2511-2.9083-4.2141-4.5887-6.2231-2.1418-2.5605-4.2398-5.1866-6.9828-7.4084-2.1694-1.7572-4.5913-3.4148-7.3818-4.5932-2.45-1.0346-7.98 [...]
+ </g>
+ <g id="g4887" fill="#9c8200">
+ <path id="path4875" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m184.5 311.72c0.32192 3.454 1.8439 6.7283 4.2812 10.25l1.6562-1.125c-2.3276-3.3632-3.6588-6.3217-3.9375-9.3125-0.27875-2.9908 1.3482-7.8914 3.4003-11.613-3.633 1.4712-5.4438 9.2335-5.4003 11.801z"/>
+ <path id="path4877" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m192.28 306.59c-0.55429 3.8386 0.49372 7.9841 3.9375 11.5l1.4375-1.4062c-3.0473-3.1111-3.8831-6.5101-3.4062-9.8125 0.47687-3.3024 2.1318-7.63 4.5562-10-4.2347 0.67149-6.1509 8.1705-6.5249 9.7191z"/>
+ </g>
+ </g>
+ <path id="path3457-0-7-79-0" d="m376.34 102.65c0.21783-3.1808 5.0196-8.8482 6.0609-11.862 1.5667-4.5336 1.7499-5.8652 1.2575-10.634-0.3337-3.2317-3.0974-9.2413-3.0974-9.2413 2.508 5.4064 0.68223 8.715-1.7467 12.693-2.4873 4.0738-8.6005 6.8178-2.4744 19.044z" fill="#d1b948"/>
+ <path id="path5045-3" d="m451.06 129.05c2.7446 16.77-0.97081 23.643-15.449 12.522l11.89 20.206 6.7742-10.995 1.5569-4.8339-0.12432-5.344-1.498-5.4302-3.1495-6.1254z" fill="#e7cd54"/>
+ <path id="path5045-3-9" d="m462.3 142.49c-0.0314 16.409-4.8058 23.023-17.536 9.3779l16.757 24.196-0.8723-10.688 3.1446-5.3894 0.8875-5.2712-0.44518-5.6154-1.9355-6.6101z" fill="#e7cd54"/>
+ <path id="path3457-0-7-79-2" d="m432.97 147.06c-5.9892-3.8737-9.3805-4.4832-16.291-6.2516-8.625-2.2072-17.336-3.3668-26.121-4.8069l-16.748-2.7453 11.111 4.0461c5.7116 2.0341 18.818 5.9396 24.839 6.6475 4.0022 0.47047 11.586 2.7903 15.389 4.1231 5.4843 1.9219 8.6036 3.6051 13.187 7.1782 3.8298 2.9858 4.7018 3.7647 6.5412 8.259 0 0-1.4191-4.8855-2.4798-7.1871-1.4992-3.2529-6.4202-7.3178-9.4277-9.263z" fill="#d1b948"/>
+ <path id="path5033" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m350.32 76.566s-1.1405 2.9936-1.4375 5.125c-0.33739 2.4215 0.79736 7.8924 2.4576 9.5826l1.7299 1.7611s-1.2564-2.2321-1.7812-3.75c-0.68001-1.9665-1.0747-6.1783-0.79796-8.1643 0.24832-1.7822 1.7769-4.8895 1.7769-4.8895l-1.9477 0.33507z" fill="#9c8200"/>
+ <path id="path5039" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m379.86 73.173s-0.15888 3.9292-0.5 5.5938c-0.44434 2.1682-1.0324 4.7795-2 6.6582-0.72763 1.4128-3.4237 4.2306-3.7008 6.557-0.30776 2.5839 0.45644 3.0239 0.88828 4.1285 0 0-0.11588-1.5053 0.0805-2.7207 0.19634-1.2154 0.21983-1.1783 0.54258-1.9004 0.6342-1.419 2.914-3.5771 3.9707-5.6289 1.098-2.1321 1.7261-4.4674 2.1875-6.7188 0.43046-2.1004 0.53125-5.9062 0.53125-5.9062l-1.181-1.6 [...]
+ <path id="path5045" d="m431.37 118.47s5.1895 5.5289 6.7914 8.8991c0.86157 1.8126 1.1693 3.8616 1.4051 5.8547 0.15593 1.3179-0.98407 3.1357-1.1709 4.4495-0.35482 2.4947-12.178 2.3419-12.178 2.3419l17.096 9.1333 0.93674-12.88-0.23418-5.8547-2.576-4.6837-4.4495-3.2786-5.6205-3.9812z" fill="#e7cd54"/>
+ <path id="path5696" d="m401.99 171.35c5.5065 6.9355 15.186 11.93 24.503 14.145 9.9771 2.3719 21.457 0.46137 25.039-4.5692 1.8074-2.5388 2.0914-5.8775 0.13635-10.696-1.1354-2.7986-4.9438-5.1821-7.7298-8.8202l-0.19881-0.19881 1.7893 4.9702-0.19881 7.1571-3.3797 4.3738-7.1571 1.9881h-5.9642l-6.3619-1.1928-8.9464-2.7833-11.531-4.3738z" fill="#f8eca8"/>
+ <path id="path3457-0-7" d="m404.14 172.42c-12.548-5.348-19.453-10.052-32.678-13.399-8.2984-2.1001-21.841-3.987-30.399-4.1449-16.93-0.31237-32.48 3.3746-49.026-0.22429-8.5359-1.8566-22.515-14.051-32.346-19.126-12.87-6.6439-23.223-5.8959-23.223-5.8959l-17.003 18.213 6.5751 29.978s-6.7832 8.7652-7.921 14.791c-3.5732 18.923-1.8586 43.314-5.0969 62.298-1.5022 8.8062-6.6591 22.167-13.559 30.565-4.4616 5.43-3.7185 3.7042-9.9951 9.5395-3.6662 3.4084-6.6653 6.1546-8.5718 10.783-1.1329 2 [...]
+ <path id="path5179" d="m354.42 52.658s7.3279 9.941 6.9922 12.424c-0.28166 2.0831 0.58878 5.0858-0.40954 8.5917-1.4262 5.0087-4.8451 10.741-5.3614 13.699-0.59458 3.407-0.70811 5.2609 0 8.6461 0.68703 3.2844 1.0326 5.3877 2.5938 8.3579 1.5257 2.9024 4.4001 6.8173 6.6287 9.2225 3.3172 3.58 7.5801 6.2225 11.816 8.6461 3.9964 2.2864 8.3019 4.0535 12.681 5.4759 10.862 3.528 33.432 7.4933 33.432 7.4933s-5.439-2.3001-13.804-4.6746c-6.2777-1.782-15.081-3.355-19.628-5.4126-5.4644-2.4729- [...]
+ </g>
+ <g id="g6044-2-9-5-0" transform="matrix(.71142 -.52991 .47969 .78590 -232.75 282.19)" stroke-width="1.3045">
+ <path id="path5744-98-7-9-8-3" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" fill="#fff"/>
+ <path id="path6042-0-9-1-2" d="m381.41 307.04 1.7674-3.3581s-3.2636-0.16484-4.7721 0.35349c-2.0089 0.69028-5.3023 3.5349-5.3023 3.5349l0.92898 3.6168 1.4889-2.9777 2.316-1.3234 3.5731 0.15411z" fill="#ececec"/>
+ <path id="path5744-98-6-3-1-4-6" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" stroke="#999" stroke-width="1.3045" fill="none"/>
+ </g>
+ <g id="g6044-2-9-5-4" transform="matrix(.71142 -.52991 .47969 .78590 -226.2 278.92)" stroke-width="1.3045">
+ <path id="path5744-98-7-9-8-1" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" fill="#fff"/>
+ <path id="path6042-0-9-1-3" d="m381.41 307.04 1.7674-3.3581s-3.2636-0.16484-4.7721 0.35349c-2.0089 0.69028-5.3023 3.5349-5.3023 3.5349l0.92898 3.6168 1.4889-2.9777 2.316-1.3234 3.5731 0.15411z" fill="#ececec"/>
+ <path id="path5744-98-6-3-1-4-7" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" stroke="#999" stroke-width="1.3045" fill="none"/>
+ </g>
+ <g id="g6044-2-9-5-8" transform="matrix(.71142 -.52991 .47969 .78590 -218.14 273.88)" stroke-width="1.3045">
+ <path id="path5744-98-7-9-8-38" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" fill="#fff"/>
+ <path id="path6042-0-9-1-1" d="m381.41 307.04 1.7674-3.3581s-3.2636-0.16484-4.7721 0.35349c-2.0089 0.69028-5.3023 3.5349-5.3023 3.5349l0.92898 3.6168 1.4889-2.9777 2.316-1.3234 3.5731 0.15411z" fill="#ececec"/>
+ <path id="path5744-98-6-3-1-4-5" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" stroke="#999" stroke-width="1.3045" fill="none"/>
+ </g>
+ <g id="g6044-2-9" transform="matrix(.99771 -.067590 .067590 .99771 -2.1892 33.801)" stroke-width="1.1765">
+ <path id="path5744-98-7-9" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" fill="#fff"/>
+ <path id="path6042-0-9" d="m381.41 307.04 1.7674-3.3581s-3.2636-0.16484-4.7721 0.35349c-2.0089 0.69028-5.3023 3.5349-5.3023 3.5349l0.92898 3.6168 1.4889-2.9777 2.316-1.3234 3.5731 0.15411z" fill="#ececec"/>
+ <path id="path5744-98-6-3-1" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" stroke="#999" stroke-width="1.1765" fill="none"/>
+ </g>
+ <g id="g6044-2-9-7" transform="matrix(.99771 -.067590 .067590 .99771 9.5784 37.555)" stroke-width="1.1765">
+ <path id="path5744-98-7-9-2" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" fill="#fff"/>
+ <path id="path6042-0-9-3" d="m381.41 307.04 1.7674-3.3581s-3.2636-0.16484-4.7721 0.35349c-2.0089 0.69028-5.3023 3.5349-5.3023 3.5349l0.92898 3.6168 1.4889-2.9777 2.316-1.3234 3.5731 0.15411z" fill="#ececec"/>
+ <path id="path5744-98-6-3-1-6" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" stroke="#999" stroke-width="1.1765" fill="none"/>
+ </g>
+ <g id="g6044-2-9-3" transform="matrix(.99771 -.067590 .067590 .99771 -12.234 29.237)" stroke-width="1.1765">
+ <path id="path5744-98-7-9-4" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" fill="#fff"/>
+ <path id="path6042-0-9-07" d="m381.41 307.04 1.7674-3.3581s-3.2636-0.16484-4.7721 0.35349c-2.0089 0.69028-5.3023 3.5349-5.3023 3.5349l0.92898 3.6168 1.4889-2.9777 2.316-1.3234 3.5731 0.15411z" fill="#ececec"/>
+ <path id="path5744-98-6-3-1-5" d="m380.7 299.37s2.6448 2.623 2.4797 4.3056c-0.16507 1.6826-1.8119 3.7627-1.8119 3.7627-3.8509-1.8162-6.1819 0.82747-7.3575 3.6918 0 0-1.421-2.9584-0.9743-4.8219 0.93653-3.9068 7.664-6.9382 7.664-6.9382z" stroke="#999" stroke-width="1.1765" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g16442-4" transform="matrix(.99312 .11707 -.11707 .99312 -641.63 -76.193)">
+ <path id="path12755-6" d="m880.61 80.408 1.8205-5.986 31.114-2.8135 33.265 2.4825 1.986 7.641-5.7925 4.303-57.263-0.331-5.1305-5.296z" fill="#9c8200"/>
+ <g id="g4334-6" transform="translate(161.01 -418.7)" stroke-width="1.1765">
+ <path id="path14997-8-0-2" d="m755.31 646.71s-5.2948-1.5169-8.0902-3.455c-3.0643-2.1245-6.4089-8.0502-8.4314-9.1846-6.2337-3.4963-9.4455-13.002-9.2224-12.913l-1.4395 6.6479s-10.531-6.8942-13-12.04c-2.2859-4.7661-0.81265-13.773-0.81265-13.773s-6.8407-6.9265-7.8451-10.948c-1.2309-4.928 0.0338-8.6813 1.4873-13.548 0.83814-2.8065 4.906-7.8614 7.019-11.446 3.2197-5.4622 4.6302-9.1486 4.6302-9.1486s-5.0108 2.4793-7.485 1.7989c-1.372-0.37727-4.7238-3.794-4.7238-3.794s3.1366-1.0564 6.17 [...]
+ <path id="path3837-9-5" d="m783.28 562.17s0.4802 6.4754-0.4993 9.4868c-1.228 3.7754-5.8518 15.006-8.4881 17.975-2.5896 2.9158-5.4521 5.8436-8.9874 7.4895-4.2916 1.998-13.98 2.4965-13.98 2.4965s9.8021 3.0737 15.478 1.9972c4.4901-0.85156 10.574-3.4638 13.481-6.9902 3.6565-4.4358 7.7728-11.734 7.4895-17.476-0.17609-3.5692-4.4937-14.979-4.4937-14.979z" fill="#f8eca8"/>
+ <path id="path14997-8-0-1-7-1" d="m787.78 556.9s1.4104 3.6865 4.6302 9.1486c2.113 3.5847 6.1809 8.6395 7.019 11.446 1.4535 4.867 2.7182 8.6203 1.4873 13.548-1.0044 4.0214-7.8451 10.948-7.8451 10.948s1.4733 9.0069-0.81265 13.773c-2.4682 5.1461-13 12.04-13 12.04l-1.4395-6.6479s-4.3458 9.2659-8.0668 11.757c-1.8489 1.2378-8.3082 2.0034-11.292 4.0712-2.9627 2.0532-3.1497 9.724-3.1497 9.724s-5.2948-1.5169-8.0902-3.455c-3.0643-2.1245-6.4089-8.0502-8.4314-9.1846-6.2337-3.4963-9.4455-13. [...]
+ <path id="path4496-2-7" d="m753.69 575.08c-16.326 0-23.398-10.504-16.632-26.31 0.87433-2.0424 0.32452-4.5632-0.40406-6.6671-1.0056-2.9038-4.1382-4.7125-5.2528-7.5762-0.89991-2.312-1.0102-4.6078-1.0102-4.6078-6.3183-0.62809-6.5458-5.8553-4.7502-10.881l3.5889 5.9295 7.958 0.7802 0.93623 10.611 7.1778 3.1208 6.0855-1.7164 2.3023-2.9648 2.3023 2.9648 6.0855 1.7164 7.1778-3.1208 0.93623-10.611 7.958-0.7802 3.5889-5.9295c1.7957 5.0261 1.5681 10.253-4.7502 10.881 0 0-0.11024 2.2957-1.0 [...]
+ <path id="path4494-1" d="m737.78 560.69 15.806 6.2678 16.085-9.3685-1.1677-4.5024c-2.1991-6.6155 1.6771-12.141 2.0171-18.117l-9.3667 4.5955-7.7838-3.731-8.879 4.0972-6.8988-4.5294c0.61204 5.7952 3.9174 11.995 0.97964 17.889l-0.79212 7.3984z" fill="#806600"/>
+ <g id="g4683-7-8" transform="matrix(1 0 0 -1 9.9837 903.21)" stroke="#e6e6e6" stroke-width="1.1765" fill="#fff">
+ <path id="path4659-3-4" d="m730.58 342.35c0.47408 3.0335 0.0283 1.9644 2.1918 8.8595 0.70208-3.2921 1.4464-6.1923 2.8892-9.9629l-5.0811 1.1033z"/>
+ <path id="path4659-2-7-0" d="m756.84 342.35c-0.47408 3.0335-0.0283 1.9644-2.1918 8.8595-0.70208-3.2921-1.4464-6.1923-2.8892-9.9629l5.0811 1.1033z"/>
+ </g>
+ <path id="path4434-0-7" style="color:#000000" d="m753.69 571.84c-6.6863-0.00001-13.629-4.0449-15.605-9.2587-1.5325-4.0445 1.1034-8.8656 1.1034-8.8656 9.6452 7.9685 19.844 6.7657 29.003 0.00001 0 0 2.6359 4.821 1.1034 8.8656-1.9755 5.2138-8.9186 9.2586-15.605 9.2586z" fill="#f6e078"/>
+ <path id="path3916-3-7" d="m739.25 554.12s0.36357 5.3473 1.2907 7.0178c0.94428 1.7014 2.1483 2.5058 3.6863 3.6978 1.4458 1.1205 4.6453 2.9216 4.6453 2.9216s-1.8811-2.1693-2.4669-3.4585c-0.90662-1.9951-1.5209-6.396-1.5209-6.396l8.02 1.7316 7.1157-1.0777 2.9406-1.0679s-0.7374 3.3526-1.3994 4.9261c-0.65168 1.549-2.5037 4.3758-2.5037 4.3758s2.8278-0.3534 3.9803-1.1072c1.945-1.2719 3.1564-3.1111 3.815-5.3398 0.51825-1.7536-0.008-5.5177-0.008-5.5177l1.3275-0.81659 1.304 3.735s0.32508 [...]
+ <path id="path4434-0-0-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m738.98 552.58-0.4375 0.78125s-2.8254 4.9811-1.125 9.4688c2.1334 5.6305 9.2978 9.75 16.281 9.75 6.9834 0 14.148-4.1195 16.281-9.75 1.7004-4.4877-1.125-9.4688-1.125-9.4688l-0.40625-0.75-0.6875 0.5c-4.4913 3.3176-9.1906 5.2616-13.906 5.4062-4.7157 0.14469-9.4772-1.4835-14.188-5.375l-0.6875-0.5625zm28.844 2.25c0.46741 0.99341 1.9623 4.3831 0.78125 7.5-1.8176 4.797-8.5171 8.7812 [...]
+ <g id="g4427-22" transform="translate(-100.87 202.08)" stroke-width="1.1765">
+ <g id="g4420-7">
+ <path id="path4371-3-4" d="m845.45 338.84c-0.48365 11.487 1.3721 21.306 9.1133 29.543 7.7412-8.2371 9.5969-18.056 9.1133-29.543l0.0548 0.37112-3.6898-0.50748-2.5357-1.6092-2.9883-2.7392-2.8638 3.3618-3.9844 1.2451-2.2193-0.1221h-0.00004z" fill="#e9001a"/>
+ <path id="path4371-3-9-7" d="m845.45 338.84c-0.48365 11.487 1.3721 21.306 9.1133 29.543 7.7412-8.2371 9.5969-18.056 9.1133-29.543l0.0548 0.37112-3.6898-0.50748-2.5357-1.6092-2.9883-2.7392-2.8638 3.3618-3.9844 1.2451-2.2193-0.1221h-0.00004z" stroke="#800000" stroke-width="1.1765" fill="none"/>
+ <path id="path4418-5" d="m845.39 338.11 5.9704-0.37076 3.4988-3.3692 4.665 4.1467 3.6823 0.29936c-0.70534 3.9882-1.6324 9.7965-2.8868 13.66-1.0633 3.2751-5.4605 10.121-5.4605 10.121s-4.7951-6.8306-5.7778-9.9245c-1.2748-4.0136-3.6913-14.563-3.6913-14.563z" fill="#d40000"/>
+ </g>
+ <path id="path4425-7" d="m852.65 336.78s0.59405 5.1587 0.87996 8.1463c0.14235 9.9868 0.81422 15.363 1.4356 14.202 0.45535-0.85074 0.88359-5.2118 1.0564-13.841-0.0559-2.6228 0.61643-8.4238 0.61643-8.4238l-1.8617-2.0327-2.1268 1.9495z" fill="#800000"/>
+ </g>
+ <g id="g4683-3" transform="translate(9.9837 195.84)" stroke="#e6e6e6" stroke-width="1.1765" fill="#fff">
+ <path id="path4659-8" d="m730.58 342.35c0.47408 3.0335 0.0283 1.9644 2.1918 8.8595 0.70208-3.2921 1.4464-6.1923 2.8892-9.9629l-5.0811 1.1033z"/>
+ <path id="path4659-2-9" d="m756.84 342.35c-0.47408 3.0335-0.0283 1.9644-2.1918 8.8595-0.70208-3.2921-1.4464-6.1923-2.8892-9.9629l5.0811 1.1033z"/>
+ </g>
+ <g id="g4268-3" transform="translate(12.897 198.18)" stroke-width="1.1765">
+ <g id="g4217-7" transform="translate(.064828)">
+ <g id="g3876-1" transform="translate(-.24937)" stroke-width="1.1765" fill="#d1b948">
+ <path id="path3808-575" d="m714.19 312.08 1.902 1.1412c1.1935 0.71612 1.1336 2.6045 2.0922 3.6137 1.0414 1.0966 2.3822 2.1472 3.8039 2.6628 1.5007 0.54424 3.1686 0.55849 4.7549 0.38039 2.8098-0.31545 7.9883-2.853 7.9883-2.853l2.0922-5.8961v-3.4235l-5.1353 2.4726-5.8961 1.1412-6.6569-1.902h-3.0432l-1.902 2.6628z"/>
+ <path id="path3808-5-72" d="m767.77 312.08-1.902 1.1412c-1.1935 0.71612-1.1336 2.6045-2.0922 3.6137-1.0414 1.0966-2.3822 2.1472-3.8039 2.6628-1.5007 0.54424-3.1686 0.55849-4.7549 0.38039-2.8098-0.31545-7.9883-2.853-7.9883-2.853l-2.0922-5.8961v-3.4235l5.1353 2.4726 5.8961 1.1412 6.6569-1.902h3.0432l1.902 2.6628z"/>
+ </g>
+ <g id="g3790-4" transform="translate(.000011767)" stroke-width="1.1765">
+ <g id="g3671-4">
+ <path id="path4096-99" d="m731.53 313.06c-0.24199 2.2783-3.7124 5.6431-7.5085 5.2299-3.7962-0.4132-6.4806-4.448-6.2386-6.7262 0.24199-2.2783 3.3188-1.4262 7.1149-1.013 3.7962 0.4132 6.8742 0.23146 6.6322 2.5093z" fill="#fff"/>
+ <path id="path4178-6" d="m718.15 313.3 1.0591-0.1412c1.1328-0.23076 1.5266 1.083 2.3656 1.9271 1.3479 1.3559 3.5035 2.8382 7.2014-0.51498 0.40694-0.36899 1.6945 0.63546 1.6945 0.63546l-2.2594 2.1888-2.7889 0.98848-2.5065-0.14121-2.5418-1.4121-1.9417-2.6124-0.28242-0.91788z" fill="#ececec"/>
+ <path id="path4096-7-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m719.96 309.34c-0.68224 0.0792-1.3052 0.22919-1.7834 0.58236s-0.79121 0.92635-0.86293 1.6015c-0.14342 1.3503 0.54968 2.9784 1.7258 4.3968 1.1762 1.4184 2.8737 2.6019 4.9187 2.8244 2.0449 0.22259 3.9892-0.55594 5.4364-1.6888s2.4454-2.6098 2.5888-3.96c0.0717-0.67506-0.12465-1.27-0.51775-1.718-0.3931-0.44797-0.93203-0.73665-1.582-0.96089-1.3-0.44849-3.2515-0.12671-5.1494-0.33 [...]
+ <g id="g4173-1" transform="translate(-.082778)" stroke-width="1.1765">
+ <path id="path4125-6" d="m728.1 314.31c0 1.7212-1.3363 3.1164-2.9848 3.1164-1.6484 0-2.9848-1.3953-2.9848-3.1164 0-1.7212 1.3363-3.1164 2.9848-3.1164 1.6484 0 2.9848 1.3953 2.9848 3.1164z" fill="#806600"/>
+ <path id="path4149-3-2" d="m725.12 313.12c-0.55544 0-1.0625 0.47416-1.0625 1.1875s0.50706 1.1875 1.0625 1.1875 1.0312-0.45086 1.0312-1.1875-0.47581-1.1875-1.0312-1.1875z" transform="matrix(1.4583 0 0 1.2531 -332.36 -79.576)" fill="#540"/>
+ <path id="path4149-35" d="m725.12 313.12c-0.55544 0-1.0625 0.47416-1.0625 1.1875s0.50706 1.1875 1.0625 1.1875 1.0312-0.45086 1.0312-1.1875-0.47581-1.1875-1.0312-1.1875z" transform="matrix(1 0 0 .89401 0.923 32.601)" fill="#fff"/>
+ </g>
+ </g>
+ <g id="g3649-91">
+ <path id="path4096-2-9" d="m749.94 313.06c0.24199 2.2783 3.7124 5.6431 7.5085 5.2299 3.7962-0.4132 6.4806-4.448 6.2386-6.7262-0.24199-2.2783-3.3188-1.4262-7.1149-1.013-3.7962 0.4132-6.8742 0.23146-6.6322 2.5093z" fill="#fff"/>
+ <path id="path4178-2-1" d="m763.31 313.3-1.0591-0.1412c-1.1328-0.23076-1.5266 1.083-2.3656 1.9271-1.3479 1.3559-3.5035 2.8382-7.2014-0.51498-0.40694-0.36899-1.6945 0.63546-1.6945 0.63546l2.2594 2.1888 2.7889 0.98848 2.5065-0.14121 2.5418-1.4121 1.9417-2.6124 0.28242-0.91788z" fill="#ececec"/>
+ <path id="path4096-7-7-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m761.5 309.34c0.68224 0.0792 1.3052 0.22919 1.7834 0.58236s0.79121 0.92635 0.86293 1.6015c0.14342 1.3503-0.54968 2.9784-1.7258 4.3968-1.1762 1.4184-2.8737 2.6019-4.9187 2.8244-2.0449 0.22259-3.9892-0.55594-5.4364-1.6888s-2.4454-2.6098-2.5888-3.96c-0.0717-0.67506 0.12465-1.27 0.51775-1.718 0.3931-0.44797 0.93203-0.73665 1.582-0.96089 1.3-0.44849 3.2515-0.12671 5.1494-0.33 [...]
+ <g id="g4173-3-3" transform="matrix(-1 0 0 1 1481.5 0)" stroke-width="1.1765">
+ <path id="path4125-7-64" d="m728.1 314.31c0 1.7212-1.3363 3.1164-2.9848 3.1164-1.6484 0-2.9848-1.3953-2.9848-3.1164 0-1.7212 1.3363-3.1164 2.9848-3.1164 1.6484 0 2.9848 1.3953 2.9848 3.1164z" fill="#806600"/>
+ <path id="path4149-3-9-0" d="m725.12 313.12c-0.55544 0-1.0625 0.47416-1.0625 1.1875s0.50706 1.1875 1.0625 1.1875 1.0312-0.45086 1.0312-1.1875-0.47581-1.1875-1.0312-1.1875z" transform="matrix(1.4583 0 0 1.2531 -332.36 -79.576)" fill="#540"/>
+ <path id="path4149-0-8" d="m725.12 313.12c-0.55544 0-1.0625 0.47416-1.0625 1.1875s0.50706 1.1875 1.0625 1.1875 1.0312-0.45086 1.0312-1.1875-0.47581-1.1875-1.0312-1.1875z" transform="matrix(1 0 0 .89401 0.923 32.601)" fill="#fff"/>
+ </g>
+ </g>
+ </g>
+ <path id="path3761-5-1" d="m713.44 318.43c2.2848 4.1269 3.5351 9.0062 13.007 7.9062-0.95243 4.9036-0.45213 8.2039 1.2117 9.7327 1.8453 1.6955 5.2535 2.7771 8.3033 1.2418 1.751-0.88142 3.4258-2.6112 4.6957-5.6188 1.2699 3.0075 2.8098 4.6556 4.5608 5.537 3.0498 1.5352 6.5929 0.53545 8.4382-1.1601 1.6638-1.5288 2.1642-4.8291 1.2117-9.7327 9.4718 1.1 10.722-3.7792 13.007-7.9062l0.65271 0.70244v4.0806l-1.2752 4.3356-4.5907 2.0403h-4.3356l0.76511 6.1209-4.0806 5.6108-5.3558 1.2752-4 [...]
+ <path id="path3882-9" d="m736.88 307.94s1.2323 3.8281 0.973 5.7569c-0.33346 2.4808-3.625 8.4305-3.625 8.4305s2.9222-0.75318 4.065-0.4865c0.79573 0.1857 2.0271 1.3784 2.0271 1.3784s1.5766-1.3209 2.5946-1.4595c1.025-0.13957 4.3893 0.8919 4.3893 0.8919s-3.5859-6.6557-3.613-9.3224c-0.0183-1.8043 1.0541-5.2704 1.0541-5.2704l0.89191 5.838 4.2974 8.3515 0.64866 2.3514-0.81083 1.7838-18.487 0.16217v-3.5676l4.2163-8.0272 1.3784-6.811z" fill="#d1b948"/>
+ <path id="path3880-5" d="m731.03 324.32s4.4663-1.2162 6.7239-1.1125c1.0423 0.0479 2.9227 1.8599 2.9227 1.8599s1.8152-1.8849 2.9227-1.9485c2.675-0.15345 7.2698 1.3782 7.2698 1.3782l-0.79711 2.1256h-4.0741l-3.897 4.4284-1.6828 0.70854-1.5942-0.97424-2.5685-3.5427-4.6941-0.7971-0.61997-1.7714 0.0886-0.35427h-0.00004z" fill="#b8a22b"/>
+ <g id="g3925-51" stroke-width="1.1765" fill="#e7cd54">
+ <path id="path3901-77" d="m736.31 307.15s-4.5382 0.66064-6.7813 0.35692c-3.3554-0.45432-6.9717-3.2544-10.35-3.0338-2.3097 0.1508-4.304 0.89341-5.5321 2.8553-0.85222 1.3614 0 4.8183 0 4.8183l2.3199-3.0338h3.7476l5.3537 1.6061 3.926 0.17846 7.3167-3.7476z"/>
+ <path id="path3901-7-8" d="m744.67 307.15s4.5382 0.66064 6.7813 0.35692c3.3554-0.45432 6.9717-3.2544 10.35-3.0338 2.3097 0.1508 4.304 0.89341 5.5321 2.8553 0.85222 1.3614 0 4.8183 0 4.8183l-2.3199-3.0338h-3.7476l-5.3537 1.6061-3.926 0.17846-7.3167-3.7476z"/>
+ </g>
+ <g id="g3786-0" stroke-width="1.1765" fill="#9c8200">
+ <path id="path3477-9-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m736.89 306.81-1.0312 0.46875s-5.0178 2.8981-9.8869 2.8824c-2.0765-0.007-5.2094-1.6476-7.8006-1.8824-1.2956-0.11741-2.6703 0.0525-3.6875 0.96875-1.0172 0.9163-1.4671 2.4024-1.4688 4.5 1.2763-0.55551 0.88411-1.2422 2.8125-3.0312 0.43135-0.38855 1.1213-0.53129 2.1562-0.4375 2.0698 0.18757 5.0197 1.3974 7.75 1.4062 4.5558 0.0147 8.3416-1.5015 9.7812-2.125 0.12342 0.89303 0.143 [...]
+ <path id="path3502-3-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m765.75 327.01c-1.3467 1.6379-3.664 2.0379-7 1.5551l-1.2812-0.1875 0.125 1.3125s0.13996 1.1003 0.15625 2.4688c0.0163 1.3685-0.1227 3.7152-0.4375 4.4954-0.96628 2.395-2.8728 3.7579-5.3438 4.8869-1.754 0.80144-4.1229 0.80491-6.0312 0.15625-1.9408-0.65967-4.0781-3.6222-4.3125-3.9449l-0.71875-0.96875-0.8125 0.84375c-0.34029 0.35868-0.8647 1.0381-1.6562 1.7812-0.79155 0.74316-1. [...]
+ </g>
+ <g id="g3868-5" transform="translate(.18167)" stroke-width="1.1765" fill="#f8eca8">
+ <g id="g3836-3" transform="translate(0 .10741)">
+ <path id="path3832-9" d="m730.65 335.8c1.0825 0.58186 2.5157 0.66333 3.6776 0.26269 1.1721-0.40418 2.0478-0.94527 2.4955-2.1014 0.49236-1.2715 0.42143-2.322-0.39402-3.4149-2.8739-2.383-6.088-2.2782-7.6611-0.94676-1.5289 1.294-1.5078 3.7468 1.8821 6.2004z"/>
+ <path id="path3834-6" d="m729.16 321.59s-2.8863 2.2625-4.6191 2.6395c-1.7805 0.3874-3.8232 0.33769-5.444-0.49491-1.4218-0.73041-2.392-2.2137-3.1344-3.6293-0.71238-1.3583-1.1548-4.4542-1.1548-4.4542s2.8611 3.0425 4.6191 4.1242c1.4089 0.86691 2.9938 1.5068 4.6191 1.8147 1.6749 0.3172 5.114 0 5.114 0z"/>
+ </g>
+ <g id="g3836-8-53" transform="matrix(-1 0 0 1 1481.1 .10741)">
+ <path id="path3832-1-72" d="m730.65 335.8c1.0825 0.58186 2.5157 0.66333 3.6776 0.26269 1.1721-0.40418 2.0478-0.94527 2.4955-2.1014 0.49236-1.2715 0.42143-2.322-0.39402-3.4149-2.8739-2.383-6.088-2.2782-7.6611-0.94676-1.5289 1.294-1.5078 3.7468 1.8821 6.2004z"/>
+ <path id="path3834-4-1" d="m729.16 321.59s-2.8863 2.2625-4.6191 2.6395c-1.7805 0.3874-3.8232 0.33769-5.444-0.49491-1.4218-0.73041-2.392-2.2137-3.1344-3.6293-0.71238-1.3583-1.1548-4.4542-1.1548-4.4542s2.8611 3.0425 4.6191 4.1242c1.4089 0.86691 2.9938 1.5068 4.6191 1.8147 1.6749 0.3172 5.114 0 5.114 0z"/>
+ </g>
+ </g>
+ <path id="path3899-84" d="m740.56 322.09-2.6893-1.7949-1.1526 0.19944s1.7203-7.5113 4.0724-7.4789c2.3796 0.0327 3.9955 7.6784 3.9955 7.6784l-1.5368-0.0997-2.6893 1.4958v-0.00005z" fill="#f8eca8"/>
+ <path id="path3929-2" d="m718.5 302.69s3.7281-0.28019 5.0057-0.004c2.1688 0.4695 3.9185 1.5996 6.1171 1.971 3.5796 0.60473 7.1547 1.0154 10.814 0.98369 4.0246-0.0349 6.0645-0.49072 10.041-0.9837 2.5174-0.31207 4.4171-1.5156 6.9517-1.7215 1.2305-0.0999 5.4069 0.61481 5.4069 0.61481s-5.1108-4.9238-8.4966-6.517c-4.038-1.9-9.059-3.0051-13.749-3.074-3.9466-0.058-8.1909 0.83934-11.741 2.2133-4.103 1.5881-10.35 6.517-10.35 6.517z" fill="#f8eca8"/>
+ <path id="path3953-3-1" d="m712.37 303.74c0.53766 1.2545 3.5161-4.2682 4.9876-8.2651 0.81262-2.2073 5.4151-5.1301 5.4151-5.1301l3.135 3.8476s6.4816-6.4502 8.8351-8.4076c2.737-2.2765 5.7001-2.9925 5.9018-2.9925 0.20169 0 3.1647 0.71607 5.9018 2.9925 2.3535 1.9574 8.8351 8.4076 8.8351 8.4076l3.135-3.8476s4.6025 2.9228 5.4151 5.1301c1.4715 3.9969 4.4499 9.5197 4.9876 8.2651l0.0241-0.075-0.85501-4.8451-1.995-5.1301-3.9901-4.7026-4.8451-3.2776v0.99751l-1.2825 2.4225-1.14 0.71251-4. [...]
+ </g>
+ <g id="g4258-06">
+ <g id="g4181-0" transform="translate(0 .069768)">
+ <path id="path4179-3" d="m698.21 319.21s-0.56528-8.6316 0.30874-10.806c0.73857-1.8374 2.7787-5.866 2.7787-5.866s3.2228 0.068 5.2486 0.92622c1.5643 0.66268 4.7855 2.7786 4.7855 2.7786l-1.5437-3.5505-4.0975-1.992-6.2453-1.8672-3.0874 7.7185-0.61748 4.0136 0.2534 4.8233 2.2165 3.8214z" fill="#f8eca8"/>
+ <path id="path4176-7" d="m700.38 316.01 2.426 2.3047 3.1538 2.1834 1.3343-2.3047 1.4556-4.4881-1.4556-5.701-4.852-4.2454c-0.3248 4.2771 2.5721 10.272-2.0621 12.251z" fill="#d1b948"/>
+ <path id="path3398-84" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m702.34 303.25c-0.33324 2.0019 3.3477 3.4403 4.1562 5.5 1.0332 1.7689 1.2635 4.1411 1 6.2812-0.0888 0.72136-0.60677 2.0017-1.125 3.0312-0.32475 0.64514-0.43613 0.83105-0.625 1.1562-0.61865-0.38122-1.8262-0.7467-2.8943-1.5327-0.37586-0.27659-1.364-1.2863-2.067-1.6875l-1.6949-0.96732s0.37304 0.63009 0.875 1.3438c0.50196 0.71366 1.0827 1.5172 1.7812 2.0312 1.4166 1.0424 4.3736 [...]
+ </g>
+ <g id="g4181-7-79" transform="matrix(-1 0 0 1 1481.6 .069768)">
+ <path id="path4179-9-5" d="m698.21 319.21s-0.56528-8.6316 0.30874-10.806c0.73857-1.8374 2.7787-5.866 2.7787-5.866s3.2228 0.068 5.2486 0.92622c1.5643 0.66268 4.7855 2.7786 4.7855 2.7786l-1.5437-3.5505-4.0975-1.992-6.2453-1.8672-3.0874 7.7185-0.61748 4.0136 0.2534 4.8233 2.2165 3.8214z" fill="#f8eca8"/>
+ <path id="path4176-3-3" d="m700.38 316.01 2.426 2.3047 3.1538 2.1834 1.3343-2.3047 1.4556-4.4881-1.4556-5.701-4.852-4.2454c-0.3248 4.2771 2.5721 10.272-2.0621 12.251z" fill="#d1b948"/>
+ <path id="path3398-8-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m702.34 303.25c-0.33324 2.0019 3.3477 3.4403 4.1562 5.5 1.0332 1.7689 1.2635 4.1411 1 6.2812-0.0888 0.72136-0.60677 2.0017-1.125 3.0312-0.32475 0.64514-0.43613 0.83105-0.625 1.1562-0.61865-0.38122-1.8262-0.7467-2.8943-1.5327-0.37586-0.27659-1.364-1.2863-2.067-1.6875l-1.6949-0.96732s0.37304 0.63009 0.875 1.3438c0.50196 0.71366 1.0827 1.5172 1.7812 2.0312 1.4166 1.0424 4.3736 [...]
+ </g>
+ </g>
+ </g>
+ <g id="g4361-6" transform="translate(13.047 198.18)" stroke-width="1.1765">
+ <g id="g4325-08" transform="translate(0 .10409)">
+ <path id="path4319-9" d="m702.88 367s3.8784-3.0918 5.1932-3.7482c3.2567-1.6258 5.9646-8.6258 7.8014-12.294 0.26498-0.52918 0.58748-1.766 0.65244-3.8247 0.066-2.0908-0.12768-5.0051-0.12768-5.7293 0 0-3.8649 8.0309-6.1315 10.567-1.4383 1.6095-4.7054 4.106-6.6692 5.0019-2.0172 0.92029-4.4461-0.11115-4.4461-0.11115s3.9015-3.4456 5.6688-6.1134c1.8638-2.8134 3.8173-7.1328 4.4461-10.448 0.35235-1.8579 0.51874-4.9127 0.22231-6.7803-0.56964-3.5891-3.8904-8.2253-3.8904-8.2253l1.2227 7.2 [...]
+ <path id="path4323-7" d="m706.37 358.8s3.2385-3.0848 4.2485-4.3645c2.1385-2.7095 4.7513-7.6754 4.7513-7.6754s-0.0536 1.5638-1.0311 4.06c-0.54871 1.4012-1.847 3.6858-2.4731 4.7159-3.3731 5.5501-7.82 8.6576-7.1108 7.4129l1.6152-4.1489z" fill="#9c8200"/>
+ <path id="path4321-4" d="m711.23 336.04s-0.60272 7.0812-1.8808 10.345c-0.6388 1.631-1.714 3.0761-2.8213 4.4334-1.2211 1.497-4.1647 5.1051-4.1647 5.1051s3.2387-2.0884 4.5678-3.09c1.9553-1.4734 3.9104-3.3258 4.7021-5.6425 1.2028-3.5195-0.40304-11.151-0.40304-11.151z" fill="#f8eca8"/>
+ </g>
+ <g id="g4325-0-5" transform="matrix(-1 0 0 1 1481.3 .10409)">
+ <path id="path4319-2-9" d="m702.88 367s3.8784-3.0918 5.1932-3.7482c3.2567-1.6258 5.9646-8.6258 7.8014-12.294 0.26498-0.52918 0.58748-1.766 0.65244-3.8247 0.066-2.0908-0.12768-5.0051-0.12768-5.7293 0 0-3.8649 8.0309-6.1315 10.567-1.4383 1.6095-4.7054 4.106-6.6692 5.0019-2.0172 0.92029-4.4461-0.11115-4.4461-0.11115s3.9015-3.4456 5.6688-6.1134c1.8638-2.8134 3.8173-7.1328 4.4461-10.448 0.35235-1.8579 0.51874-4.9127 0.22231-6.7803-0.56964-3.5891-3.8904-8.2253-3.8904-8.2253l1.2227 7 [...]
+ <path id="path4323-4-7" d="m706.73 358.43s2.8763-2.7227 3.8863-4.0023c2.1385-2.7095 4.7513-7.6754 4.7513-7.6754s-0.0536 1.5638-1.0311 4.06c-0.54871 1.4012-1.847 3.6858-2.4731 4.7159-3.3731 5.5501-8.5574 9.5425-7.8482 8.2978l2.7148-5.396z" fill="#9c8200"/>
+ <path id="path4321-8-5" d="m711.23 336.04s-0.60272 7.0812-1.8808 10.345c-0.6388 1.631-1.714 3.0761-2.8213 4.4334-1.2211 1.497-4.1647 5.1051-4.1647 5.1051s3.2387-2.0884 4.5678-3.09c1.9553-1.4734 3.9104-3.3258 4.7021-5.6425 1.2028-3.5195-0.40304-11.151-0.40304-11.151z" fill="#f8eca8"/>
+ </g>
+ </g>
+ <path id="path4217-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m775.32 565.43c0.0492 3.7372 0.10148 8.2959 1.6749 10.854 2.0639 3.3554 5.1769 4.8943 7.2763 6.4688 4.9418 3.706 8.9552 9.057 8.3128 19.312l1.5688-1.2824c0.6701-10.697-4.2894-14.786-8.8503-19.124-2.2805-2.1689-4.5345-4.0743-6.2188-6.2812-2.6368-2.6875-2.346-7.2601-3.7637-9.9476zm-46.518 6.3852c-0.70348 1.2557-0.75266 3.0646-1.0625 5.0625s-0.80203 3.2924-1.9062 4.789c-0.60256 0.8 [...]
+ <path id="path14997-8-0-1-4" d="m755.31 646.71s-5.2948-1.5169-8.0902-3.455c-3.0643-2.1245-6.4089-8.0502-8.4314-9.1846-6.2337-3.4963-9.4455-13.002-9.2224-12.913-1.2013 2.216-1.1738 4.4319-1.4395 6.6479 0 0-10.531-6.8942-13-12.04-2.2859-4.7661-0.81265-13.773-0.81265-13.773s-6.8407-6.9265-7.8451-10.948c-1.2309-4.928 0.0338-8.6813 1.4873-13.548 0.83814-2.8065 4.906-7.8614 7.019-11.446 3.2197-5.4622 4.6302-9.1486 4.6302-9.1486s-5.0108 2.4793-7.485 1.7989c-1.372-0.37727-4.7238-3.794-4 [...]
+ <path id="path3839-7-5" d="m713.1 592.17s-0.98843-4.557 0.033-7.1248c1.388-3.4892 5.7224-4.0651 7.7853-7.2029 2.7142-4.1285 3.2201-18.367 3.2201-18.367s-2.6866 10.706-5.5665 14.253c-2.3358 2.8763-6.3098 5.5606-7.4521 9.0854-1.121 3.459 1.9801 9.3571 1.9801 9.3571z" fill="#f8eca8"/>
+ </g>
+ <g id="g16376-8" stroke-width="1.1765">
+ <path id="path28153-9-7-8-7" d="m943.81 72.174 2.6077-7.7065 1.0532-3.1905 2.6102-1.6416 2.6436-6.0801 1.2453-1.5901 0.19222-5.602s-1.8264-3.9738-4.653-5.4008c-4.0432-2.0413-9.5315-1.7606-9.5315-1.7606s-1.2678-3.3927-3.593-4.713c-2.3252-1.3202-4.9072-1.6385-7.6171-1.6385-2.71 0-7.5734 2.4519-10.203 3.1726-1.3673 0.37469-4.4552 1.6385-4.4552 1.6385s-3.0878-1.2638-4.4552-1.6385c-2.63-0.72073-7.4935-3.1726-10.203-3.1726-2.7099 0-5.2075 0.27033-7.6171 1.6385-2.2409 1.2724-5.3173 4.7 [...]
+ <g id="g13698-95">
+ <g id="g12487-1-9" transform="translate(699.99 -620.24)">
+ <g id="g12443-6-6">
+ <g id="g12294-9-6">
+ <g id="g10541-9-0-85" transform="translate(-288.69 435.84)" stroke-width="1.1765">
+ <path id="path11707-3-5-4-4-28" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m503.42 215.66c6.2612-1.0204 11.521-1.5378 15.891-3.7506 4.3698-2.2129 7.9902-3.9324 11.188-4.0312 5.1445-0.15905 9.096 1.9554 10.906 5.4375 2.1164 4.071 2.5141 6.184-1.2188 15l5.5 2.3125c4.1068-9.6993 3.915-14.516 1.0312-20.062-3.0072-5.7843-9.4291-8.9032-16.406-8.6875-5.0313 0.15554-9.3497 2.4438-13.719 4.6562-4.1451 2.0991-8.3612 2.1959-13.188 3.125-4.8137-0.93 [...]
+ <path id="path11707-3-5-1-2-3-2-0-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m503.53 215.67c-6.2612-1.0204-11.636-1.5378-16.006-3.7506-4.3698-2.2129-7.9902-3.9324-11.188-4.0312-5.1445-0.15902-9.096 1.9554-10.906 5.4375-2.1164 4.071-2.5141 6.184 1.2188 15l-3.2589 1.5084s-2.3366-5.8534-2.5628-8.97c-0.20719-2.8544 0.0987-5.8834 1.2814-8.4894 1.1273-2.4839 2.6498-4.325 4.9655-5.7664 2.2427-1.396 4.7273-2.1741 7.3682-2.2425 2.5018-0.0648 4 [...]
+ <path id="path11707-3-5-1-4-2-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m503.42 215.66c6.2612-1.0204 11.521-1.5378 15.891-3.7506 4.3698-2.2129 7.9902-3.9324 11.188-4.0312 5.1445-0.15905 9.096 1.9554 10.906 5.4375 2.1164 4.071 2.5141 6.184-1.2188 15l5.5 2.3125c4.1068-9.6993 3.915-14.516 1.0312-20.062-3.0072-5.7843-9.4291-8.9032-16.406-8.6875-5.0313 0.15554-9.3497 2.4438-13.719 4.6562-4.1451 2.0991-8.3612 2.1959-13.188 3.125-4.8137-0.9 [...]
+ </g>
+ <g id="g12274-4-3" stroke="#b3b3b3" stroke-width="1.4524" fill="#fff">
+ <g id="g12218-4-3" transform="translate(0 -.055601)">
+ <path id="path11942-7-9-1-3-8-9-2-1-3" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 139.44 500.29)"/>
+ <path id="path11942-7-9-1-3-8-9-2-8-9-9" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 138.66 492.32)"/>
+ <path id="path11942-7-9-1-3-8-9-2-2-0-1" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 140.79 484.9)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-2-4" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 146.07 478.73)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-3-1-4" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 153.26 476.03)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-3-5-5-5" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 161.12 476.48)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-3-8-4-2" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 168.3 479.4)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-3-2-9-69" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 175.38 481.98)"/>
+ </g>
+ <g id="g12218-8-0-5" transform="matrix(-1 0 0 1 429.44 -.055601)">
+ <path id="path11942-7-9-1-3-8-9-2-4-2-0" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 139.44 500.29)"/>
+ <path id="path11942-7-9-1-3-8-9-2-8-0-0-30" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 138.66 492.32)"/>
+ <path id="path11942-7-9-1-3-8-9-2-2-1-3-28" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 140.79 484.9)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-0-8-3" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 146.07 478.73)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-3-81-2-1" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 153.26 476.03)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-3-5-4-1-7" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 161.12 476.48)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-3-8-9-6-8" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 168.3 479.4)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-3-2-5-8-68" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 175.38 481.98)"/>
+ </g>
+ </g>
+ </g>
+ <g id="g12424-3-6">
+ <g id="g12206-2-7" transform="translate(-.048746)" stroke-width="1.1765">
+ <g id="g12026-1-0-9-4" transform="translate(122.42 482.58)">
+ <g id="g11921-7-6-7-0" transform="translate(-27.869 37.781)" stroke-width="1.1765">
+ <path id="path9021-6-8-7-3-0-6-9-8-1-8-3-6-1-8-4-5-9-3-0" d="m113.72 96.015c0.72324 0.9023 1.5881 1.5727 2.2882 2.4902 0.73564 0.96392 1.2966 2.176 1.5851 3.4063-1.2787-0.3142-2.5139-0.8607-3.492-1.5857-0.93089-0.69005-1.6111-1.5424-2.5266-2.2552v11.558c0.91548-0.71279 1.5957-1.5652 2.5266-2.2552 0.97805-0.72501 2.2132-1.2832 3.492-1.5975-0.28846 1.2304-0.84946 2.4542-1.5851 3.4181-0.70013 0.91747-1.565 1.5879-2.2882 2.4902h3.3251c-2.4477 1.1646-4.1355 3.6255-4.1355 6.483 [...]
+ <path id="path11919-5-0-4-87" opacity="0.99" d="m125.55 118.05c0 2.8548-2.47 5.1691-5.517 5.1691s-5.517-2.3143-5.517-5.1691 2.47-5.1691 5.517-5.1691 5.517 2.3143 5.517 5.1691z" transform="matrix(1.3333 0 0 1.4135 -39.862 -48.661)" fill="#f6e078"/>
+ <path id="path9021-6-8-7-3-0-6-9-8-1-8-3-6-1-8-4-9-4-8-8-6" d="m116.01 98.505c0.69609 1.0411 1.2966 2.176 1.5851 3.4063-1.2787-0.3142-2.5139-0.8607-3.492-1.5857-0.93089-0.69005-1.6111-1.5424-2.5266-2.2552v11.558c0.91548-0.71279 1.5957-1.5652 2.5266-2.2552 0.97805-0.72501 2.2132-1.2832 3.492-1.5975-0.28846 1.2304-0.84946 2.4542-1.5851 3.4181-0.70013 0.91747-1.565 1.5879-2.2882 2.4902h3.3251c-2.4477 1.1646-4.1355 3.6255-4.1355 6.4838 0 3.9794 3.268 7.2121 7.3057 7.2121s7.30 [...]
+ </g>
+ <path id="path11942-7-9-1-8-6-4" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.9 0 0 .9 58.772 -37.28)" stroke="#b3b3b3" stroke-width="1.3072" fill="#fff"/>
+ </g>
+ <g id="g10469-0-1-6" transform="translate(-288.64 435.84)">
+ <path id="rect8733-2-1-3" d="m497.73 205.91h11.373v19.988h-11.373v-19.988z" fill="#f0d95c"/>
+ <path id="rect8733-6-0-9-5-7" d="m500.44 205.91h5.9476v19.988h-5.9476v-19.988z" fill="#f8eca8"/>
+ <path id="rect8733-6-7-6-8" d="m497.73 205.91h11.373v19.988h-11.373v-19.988z" stroke="#806600" stroke-width="1.1765" fill="none"/>
+ </g>
+ </g>
+ <path id="path12422-9-4" opacity="0.99" d="m120.03 115.25c-1.8332 0-3.1562 1.3373-3.1562 2.8125s1.3068 2.7812 3.1562 2.7812 3.1562-1.3061 3.1562-2.7812c0-1.4752-1.3231-2.8125-3.1562-2.8125z" transform="matrix(1.3333 0 0 1.4135 54.677 470.06)" fill="#f8eca8"/>
+ <g id="g12394-8-6" transform="translate(-.020765)" stroke="#b3b3b3" stroke-width="1.4524" fill="#fff">
+ <path id="path11942-7-9-1-3-8-9-2-5-3-8-90-0-8" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 184.52 482.19)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-3-8-90-2-2-2" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 184.52 487.04)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-3-8-90-2-3-2-3" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 184.52 491.7)"/>
+ <path id="path11942-7-9-1-3-8-9-2-5-3-8-90-2-9-6-0" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.81 0 0 .81 184.52 496.63)"/>
+ </g>
+ </g>
+ </g>
+ <g id="g11622-9-7-4" transform="translate(110.99 26.213)">
+ <g id="g10395-2-6-4" transform="translate(-399.68 409.62)" stroke-width="1.1765">
+ <path id="path9304-5-2-7-9-7-9-11-8-2-1-3" d="m537.66 228.07c1.4114 3.7452 2.8753 5.3646 2.3575 8.3793-2.9154-2.0565-3.8583-2.8271-4.8624-5.6037l-3.3889 11.108c2.0569-0.33966 0.96295-0.60701 6.3648-1.5715-1.205 4.3974-5.9444 8.4208-10.092 6.9383-1.562-0.55826-2.8252-2.6378-3.3109-6.3524 0.005-0.58467 0.009-1.1694 0.0177-1.754 0.004-0.37564 0.62689-0.90646 1.0257-0.91254 0.38002-0.005 0.48518 0.57587 0.58669 0.92084 0.20293 0.69021-0.2047 1.4588 0 2.1486 0.22548 0.7605 0.6582 [...]
+ <path id="path9304-5-2-7-9-7-9-11-8-7-3-2-3" d="m527.7 261.46c3.2219 0.3547 6.3828 0.76301 9.458 1.2154l0.51493-13.044 9.2663-20.028c-2.9959-1.0223-6.1452-1.323-9.2825-1.5266 1.4114 3.7452 2.8753 5.3646 2.3575 8.3793-2.9154-2.0565-3.8583-2.8271-4.8624-5.6037l-3.3889 11.108c2.0569-0.33966 0.96295-0.60701 6.3648-1.5715-1.205 4.3974-4.8205 8.5814-8.9683 7.0989l-1.4594 13.972zm-52.801-14.183c-2.8471-0.98782-5.368-3.8483-6.2008-6.8873 5.4018 0.96446 4.3078 1.2318 6.3648 1.5715l-3 [...]
+ <path id="path9304-5-2-7-9-7-9-11-8-9-1-1-2" d="m521.88 261.14 1.3356-34.229c-0.12759 0.12084-1.3899 1.2274-2.2147 2.4536-0.49671 0.73843-1.0062 1.8055-1.1497 2.6692-0.1184 0.7122-0.0754 2.2182-0.0754 2.2182s-1.3428-0.51918-1.7991-0.58008c-0.3226-0.043-0.6792-0.049-0.98442 0.0584-0.83667 0.29437-1.5255 1.0178-1.8962 1.7832-0.3426 0.70749-0.30246 1.5593-0.17223 2.3271 0.2023 1.1929 0.94645 2.1158 0.539 3.2613l-0.5776 1.6236s1.4311 0.0133 2.0474-0.29629c0.73965-0.37169 1.2158- [...]
+ <path id="path10393-3-3-9" fill="#f8eca8" d="m503.2 224.43 0.63236 35.886-9.6434-0.47427-0.94853-14.386 2.8456-1.2647 3.0037-2.5294 1.2647-2.6875 0.31617-3.0037-4.1103 2.2132-2.3713 2.8456-0.31618-14.228 3.9522 4.2684 2.6875 1.739-1.739-3.9522-3.1618-4.2684 5.2169-0.15809h2.3713z"/>
+ <path id="path9304-5-2-7-9-7-9-11-8-8-2-6-7" d="m537.66 228.07c1.4114 3.7452 2.8753 5.3646 2.3575 8.3793-2.9154-2.0565-3.8583-2.8271-4.8624-5.6037l-3.3889 11.108c2.0569-0.33966 0.96295-0.60701 6.3648-1.5715-1.205 4.3974-5.9444 8.4208-10.092 6.9383-1.562-0.55826-2.8252-2.6378-3.3109-6.3524 0.005-0.58467 0.009-1.1694 0.0177-1.754 0.004-0.37564 0.62689-0.90646 1.0257-0.91254 0.38002-0.005 0.48518 0.57587 0.58669 0.92084 0.20293 0.69021-0.2047 1.4588 0 2.1486 0.22548 0.7605 0.65 [...]
+ </g>
+ <g id="g11558-1-5-9" transform="translate(2.3195 73.115)">
+ <rect id="rect9214-9-2-2-6-7-7" ry=".62861" height="5.2983" width="11.147" stroke="#a0892c" y="584.87" x="95.838" stroke-width="1.1765" fill="#1a60fa"/>
+ <rect id="rect8646-7-4-5-2-1-8-3-1" transform="matrix(.99521 -.097792 .17384 .98477 0 0)" ry="2.4564" height="4.9128" width="9.8939" stroke="#a0892c" y="594.51" x="-25.864" stroke-width="1.1782" fill="#36a464"/>
+ <rect id="rect8646-7-4-2-9-9-1-1-6-3" transform="matrix(-.99521 -.097792 -.17384 .98477 0 0)" ry="2.4564" height="4.9128" width="9.8939" stroke="#a0892c" y="574.61" x="-226.19" stroke-width="1.1782" fill="#36a464"/>
+ <path id="path14614-9-3-8-3-2-4-1-0-0-3-3" d="m66.737 594.29 4.7941-4.0467-5.8523-2.015-1.3201 3.1422 2.3782 2.9195z" stroke="#a48d2f" stroke-width="1.1765" fill="#ff0a3e"/>
+ <path id="path14614-9-3-8-3-2-5-9-9-1-6-2-9" d="m136.09 594.29-4.7941-4.0467 5.8523-2.015 1.3201 3.1422-2.3782 2.9195z" stroke="#a48d2f" stroke-width="1.1765" fill="#ff0a3e"/>
+ </g>
+ <path id="path11942-7-9-1-3-04-5-0" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.9 0 0 .9 70.152 465.28)" stroke="#b3b3b3" stroke-width="1.3072" fill="#fff"/>
+ <g id="g11618-9-0-4" transform="translate(-.18510)" stroke="#b3b3b3" stroke-width="1.3072" fill="#fff">
+ <path id="path11942-7-9-1-3-8-9-3-7" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.9 0 0 .9 32.104 470.12)"/>
+ <path id="path11942-7-9-1-3-0-4-7-4" opacity="0.99" d="m40.92 198.75c0 1.9941-1.6165 3.6106-3.6106 3.6106s-3.6106-1.6165-3.6106-3.6106 1.6165-3.6106 3.6106-3.6106 3.6106 1.6165 3.6106 3.6106z" transform="matrix(.9 0 0 .9 108.57 470.12)"/>
+ </g>
+ </g>
+ </g>
+ <path id="path9304-5-2-7-9-7-9-11-8-8-2-6-8-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m917.79 73.094c-10.658-0.26299-21.399 0.20952-31.531 1.7188-2.0078 0.29908-3.9845 0.64746-5.9375 1.0312-1.523 1.8023-1.8657 3.4973 0.9375 4.9062 1.873-0.36807 3.7828-0.68037 5.7188-0.96875 19.539-2.9105 41.973-1.8346 61.031 0.96875 1.1329-1.2096 3.9906-1.5568 0.71875-4.9688-9.715-1.4291-20.28-2.4245-30.938-2.6875z" stroke="#999" fill="#ececec"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g8488">
+ <g id="g10073" transform="translate(168.62 -460.87)">
+ <path id="path9294" d="m862.03 434.69c4.4927-11.704 14.842-9.5146 24.136-14.097 6.2643-3.089 10.866-10.708 8.7046-21.412h-14.883c2.2055 5.9016-1.4822 13.287-6.1988 13.924-14.022 1.8942-17.566 10.27-11.758 21.585z" stroke="#806600" stroke-width="1.5" fill="#d1b948"/>
+ <path id="path10069" d="m1104.1 1050.4c-0.1558 3.8463-0.7902 6.8058-1.7905 9.127-1.3275 3.0803-4.0993 5.9934-6.9914 7.5076-4.3021 2.2524-9.2935 2.4671-13.611 4.0762-3.8008 1.4164-4.7911 2.8591-7.9621 6.6786-0.5073-2.7365-0.6424-5.2164-0.064-6.8339 0.8247-2.3048 2.4024-3.6103 4.3348-4.5221 4.8187-2.2739 11.843-2.1003 14.894-8.8724 0.8187-1.8168 1.375-4.1492 1.5945-7.161h9.595z" transform="translate(-211.14 -648.81)" fill="#ebd25d"/>
+ <path id="path10071" d="m1074.8 1074.3c5.8292-10.273 25.702-5.4514 21.109-21.109 0.9773 14.996-24.645 7.7383-21.109 21.109z" transform="translate(-211.14 -648.81)" fill="#f6e078"/>
+ </g>
+ <g id="g14930-4" transform="matrix(.88526 -.46509 .46509 .88526 -341.39 151.36)">
+ <path id="path12082-3-8-0-4-8-3-7-6-2-71" d="m1464.6 234.09c-0.4523 0-1.2307 5.2815-1.56 6.4337-1.4478 0.85699-2.2591 2.0428-0.9655 4.4058-2.0151 1.6838-2.7931 3.6334-0.9193 6.1561-3.5576 3.6857-1.5741 5.702-0.8718 7.6846-2.6221 2.5227-3.7609 5.1492-0.8227 8.9914-4.3993 4.2976-2.4887 7.0981-0.7724 10.076-3.0286 3.515-3.5961 7.1738-0.7206 10.94-3.3187 3.8998-3.1088 7.787-0.6673 11.581-3.1797 3.9426-2.6575 7.9552-0.6127 12.001-2.4042 3.5573-4.1057 7.004-0.5567 12.199-4.8331 6.317-1.49 [...]
+ <path id="path12082-3-8-0-4-8-3-7-6-2-7-3" d="m1464.6 234.09c-0.4523 0-1.2307 5.2815-1.56 6.4337-1.4478 0.85699-2.2591 2.0428-0.9655 4.4058-2.0151 1.6838-2.7931 3.6334-0.9193 6.1561-3.5576 3.6857-1.5741 5.702-0.8718 7.6846-2.6221 2.5227-3.7609 5.1492-0.8227 8.9914-4.3993 4.2976-2.4887 7.0981-0.7724 10.076-3.0286 3.515-3.5961 7.1738-0.7206 10.94-3.3187 3.8998-3.1088 7.787-0.6673 11.581-3.1797 3.9426-2.6575 7.9552-0.6127 12.001-2.4042 3.5573-4.1057 7.004-0.5567 12.199-4.8331 6.317-1.4 [...]
+ <path id="path12082-3-8-0-4-8-3-7-6-2-0-8" d="m1464.6 234.09 5.2768 155.4h5.2767c1.1316 0.21005 7.3803-4.4888-0.1909-8.7288 1.9362-2.563 5.675-5.1774-0.2554-9.8615 1.4017-2.9251 5.0021-5.6182-0.3185-10.772 1.5251-2.887 5.5616-5.6651-0.3801-11.462 0.9233-3.2686 5.0029-5.3307-0.4404-11.929 0.9955-3.4323 4.3338-5.8577-0.4993-12.175 3.549-5.1946 1.8475-8.6413-0.5567-12.199 2.0448-4.0455 2.567-8.0581-0.6127-12.001 2.4415-3.794 2.6514-7.6812-0.6673-11.581 2.8755-3.7658 2.308-7.4246-0.7206 [...]
+ <g id="g14619-4" fill="#fff1a1" transform="matrix(-1 0 0 1 2929.1 0)">
+ <path id="path14463-8" d="m1460.3 258.39 7.5893-7.2686 0.5345-3.3137-1.6034-2.8861-5.986 6.8411-1.9163 3.5274 1.3819 3.0999z"/>
+ <path id="path14463-9-04" d="m1458.8 277.05 10.963-9.9568 1.4783-4.5392-3.0223-3.9534-8.647 9.3711-3.3801 4.832 2.6081 4.2463z"/>
+ <path id="path14463-9-0-6" d="m1456.6 301.05 15.402-13.202 0.9538-5.3747-2.8611-4.6812-13.388 12.508-1.3426 5.2977 1.2363 5.4516z"/>
+ <path id="path14463-9-0-5-0" d="m1456.1 324.49 16.52-12.889s0.6749-3.92 0.4843-5.876c-0.172-1.7649-1.4524-5.1178-1.4524-5.1178l-15.294 12.584s-1.3897 3.8113-1.4212 5.8023c-0.03 1.8727 1.1634 5.4969 1.1634 5.4969z"/>
+ <path id="path14463-9-0-5-2-3" d="m1455.3 348.73 18.369-13.134s2.1627-3.9943 1.9508-5.9874c-0.1913-1.7984-3.0273-5.2148-3.0273-5.2148l-17.006 12.823s-2.6752 3.8835-2.7102 5.9123c-0.033 1.9082 2.4235 5.6012 2.4235 5.6012z"/>
+ <path id="path14463-9-0-5-2-2-2" d="m1454.6 370.92 19.808-12.156s2.6451-3.1321 2.4166-4.9769c-0.2062-1.6645-3.5774-5.3916-3.5774-5.3916l-18.338 11.868s-2.6549 3.5945-2.6926 5.4723c-0.036 1.7661 2.3835 5.1843 2.3835 5.1843z"/>
+ <path id="path14463-9-0-5-2-2-7-6" d="m1453.9 390.16 21.451-10.69s2.1474-2.5449 1.8999-4.1672c-0.2233-1.4638-3.157-4.9507-3.157-4.9507l-19.86 10.437s-4.0643 3.4434-4.1051 5.0947c-0.039 1.5531 3.7704 4.2765 3.7704 4.2765z"/>
+ </g>
+ <path id="path12082-3-8-0-4-8-3-7-6-9" d="m1464.6 234.09c-0.4523 0-1.2307 5.2815-1.56 6.4337-1.4478 0.85699-2.2591 2.0428-0.9655 4.4058-2.0151 1.6838-2.7931 3.6334-0.9193 6.1561-3.5576 3.6857-1.5741 5.702-0.8718 7.6846-2.6221 2.5227-3.7609 5.1492-0.8227 8.9914-4.3993 4.2976-2.4887 7.0981-0.7724 10.076-3.0286 3.515-3.5961 7.1738-0.7206 10.94-3.3187 3.8998-3.1088 7.787-0.6673 11.581-3.1797 3.9426-2.6575 7.9552-0.6127 12.001-2.4042 3.5573-4.1057 7.004-0.5567 12.199-4.8331 6.317-1.4948 [...]
+ </g>
+ <g id="g16060" transform="translate(-129.89 -681.95)">
+ <path id="path12065" d="m1353.6 787.68c-2.4234-19.855 7.6178-36.491 19.398-51.526 9.9259-12.668 24.744-20.606 37.584-30.309 8.0958-6.118 15.188-12.326 21.823-20.004 9.0404-10.461 12.051-26.023 22.429-35.159 4.6901-4.1286 11.335-5.6294 17.389-8.0553 2.6773-1.0728 7.8377-2.1246 9.8896-4.0685l11.517-10.911s-1.7137 7.3787-4.8495 13.942c-2.9112 6.0936-8.0002 7.2426-10.911 13.336-2.5261 5.2874-1.1299 8.465-3.2123 13.942-1.7295 4.5487-8.4867 12.73-8.4867 12.73 6.9785-2.3669 13.41-3.3657 20 [...]
+ <path id="path16058" d="m1377.7 769.18s9.7879-19.647 17.382-27.315c5.5576-5.6114 12.795-9.3931 19.866-12.913 9.1416-4.5506 20.878-6.971 28.805-13.409 11.482-9.3266 15.239-22.388 23.342-34.765 2.8676-4.3798 6.608-8.0096 8.4428-12.913 1.5763-4.212 0.1137-9.3204 1.9865-13.409 1.3171-2.8755 4.2617-4.6755 6.4563-6.9529 1.787-1.8544 5.463-5.463 5.463-5.463h-0.4966s-11.96 3.7138-15.892 10.429c-1.7568 2.9999-3.5013 8.0838-4.4697 11.423-1.6375 5.646-9.2028 13.453-12.416 18.376-6.3241 9.6892- [...]
+ <path id="path16054" d="m1391.4 777.27s6.9702-5.8954 10.782-8.3858c2.2811-1.4904 4.6211-2.9787 7.1878-3.8934 2.0103-0.71638 4.1831-0.85401 6.2893-1.198 4.3752-0.71449 8.8415-0.87428 13.178-1.797 2.4411-0.51944 4.9654-0.96077 7.1878-2.0964 4.0543-2.0718 7.4095-5.3267 10.782-8.3858 1.9352-1.7555 3.5601-4.1722 5.0913-6.2893 2.5914-3.583 3.6563-7.7715 6.5888-11.081 1.3776-1.5548 3.2068-2.72 5.0914-3.5939 2.5262-1.1713 5.3241-1.7442 8.0862-2.0964 1.7825-0.22731 5.3909 0 5.3909 0l0.5989 0 [...]
+ <path id="path12065-6" d="m1353.6 787.68c-2.4234-19.855 7.6178-36.492 19.398-51.526 9.9259-12.668 24.744-20.606 37.584-30.309 8.0958-6.118 15.188-12.326 21.823-20.004 9.0404-10.461 12.051-26.023 22.429-35.159 4.6901-4.1286 11.335-5.6294 17.389-8.0553 2.6773-1.0728 7.8377-2.1246 9.8896-4.0685l11.517-10.911s-1.2289 10.965-7.8658 13.942c0 0-2.0844 1.8486-8.4345 4.2159-5.9619 2.2226-14.369 4.8514-17.873 8.3607-10.449 10.465-12.918 28.816-21.976 40.505-6.0733 7.8373-13.031 12.787-21.114 [...]
+ <path id="path16038" d="m1487.7 679.07s-8.7768 0.0258-11.861 0.4236c-4.0101 0.5172-5.8224 0.51154-9.3192 2.5416-3.1133 1.8074-5.2571 5.0186-7.2012 8.0484-3.2442 5.056-3.9852 7.4466-7.2013 12.52-3.2143 5.071-9.4491 10.944-14.826 13.555-11.889 5.7744-23.069 8.6796-35.456 16.486-6.1411 3.8703-11.947 9.7474-17.071 19.284l-2.5416 14.826s10.911-18.41 19.062-24.993c14.202-11.469 34.7-12.772 47.867-25.416 8.3818-8.0488 11.745-22.247 20.333-30.076 5.5227-5.0344 18.215-7.2012 18.215-7.2012z" [...]
+ <path id="path16056" d="m1390.2 764.16s8.7213-10.552 14.874-13.674c8.8548-4.4931 20.15-0.83024 29.028-5.2778 8.2408-4.1285 11.249-12.937 18.233-18.952 4.7261-4.0714 11.862-7.3849 16.313-11.755 2.0771-2.0394 4.0587-4.314 5.2779-6.9572 1.0972-2.3786 1.2774-5.0884 1.6793-7.6769 0.5299-3.4126-0.2082-7.0658 0.9596-10.316 0.8176-2.2752 2.3126-4.3462 4.0784-5.9976 1.9634-1.8361 6.9571-4.0783 6.9571-4.0783l-0.2399 0.2399s-6.2339 1.238-8.8764 2.8788c-3.8914 2.4163-5.4218 3.8033-7.437 7.9168- [...]
+ <path id="path16040" d="m1476.9 728.26s-5.5201-3.4301-8.545-4.5574c-2.0072-0.74801-4.1377-1.1853-6.2664-1.4242-1.604-0.17998-3.2867-0.43085-4.8422 0-4.8018 1.33-7.9172 2.9984-11.678 6.2664-3.2247 2.8019-3.8104 5.5477-6.4225 8.4648-2.0935 2.338-4.9606 3.5595-8.1041 4.9163-2.5356 1.0944-7.4273 1.7176-11.108 1.7337-3.0452 0.0133-7.4659 0.85983-9.6845 1.4056-11.845 2.9139-25.635 23.926-25.635 23.926s14.354-13.36 23.072-17.09c9.1759-3.926 20.444-0.93274 29.053-5.9816 7.0268-4.1208 9.7191 [...]
+ <path id="path12065-3" d="m1353.6 787.68c-2.4234-19.855 7.6178-36.491 19.398-51.526 9.9259-12.668 24.744-20.606 37.584-30.309 8.0958-6.118 15.188-12.326 21.823-20.004 9.0404-10.461 12.051-26.023 22.429-35.159 4.6901-4.1286 11.335-5.6294 17.389-8.0553 2.6773-1.0728 7.8377-2.1246 9.8896-4.0685l11.517-10.911s-1.7137 7.3787-4.8495 13.942c-2.9112 6.0936-8.0002 7.2426-10.911 13.336-2.5261 5.2874-1.1299 8.465-3.2123 13.942-1.7295 4.5487-8.4867 12.73-8.4867 12.73 6.9785-2.3669 13.41-3.3657 [...]
+ </g>
+ <g id="g15982" transform="translate(-129.89 -681.95)">
+ <path id="path12084" d="m1460.5 1022.4s3.1615-23.776 8.4355-34.304c3.0423-6.0732 6.858-12.711 12.934-15.746 3.8607-1.9286 6.9568-2.1508 11.247-1.6871 6.5548 0.70843 11.995 5.6845 18.558 5.0613 10.499-0.99683 14.531-7.8731 13.497-7.8731 0 0-9.5671 4.0629-12.934-2.2495-2.3665-4.4362-4.9143-8.0373-7.6184-10.947-5.1077-5.4967-11.125-7.244-18.767-6.9274-6.0153 0.24925-13.038 1.2996-21.416 6.0649 0 0 7.4192-7.0028 9.2735-11.59 1.3308-3.2923 1.8128-9.14 0.9944-12.596-1.4414-6.0857-4.309-11 [...]
+ <path id="path15941" d="m1397.2 919.89s5.4561-4.5982 8.3424-7.7736c2.0196-2.2218 4.7573-5.0719 6.0673-7.7736 1.0113-2.0856 1.4184-5.0946 1.7064-7.3944 0.5505-4.3969 0.6551-8.9673 1.7064-13.272 0.8054-3.2977 1.9403-6.7319 4.1712-9.2904 1.5674-1.7976 2.5855-2.5798 4.74-3.6024 3.0152-1.4312 6.6336-2.5551 9.8592-3.4128 2.24-0.59563 6.8256-1.3272 6.8256-1.3272-5.8464 3.3904-11.403 5.4132-15.737 10.807-2.1282 2.649-3.8949 7.6946-4.1658 11.093-0.3668 4.6008 0.394 9.2163-0.4767 13.749-0.753 [...]
+ <path id="path15943" d="m1441.1 866.29s-4.7259 4.7117-6.3903 7.3032c-0.7797 1.214-1.2984 2.4332-1.6431 3.8342-0.2908 1.1819-0.1605 2.445 0 3.6516 0.399 3.0001 1.2179 5.8423 2.0083 8.7638 0.6092 2.2516 1.528 4.4257 1.6432 6.7554 0.091 1.8487-0.2047 3.7026-0.7303 5.4774-1.1687 3.9462-2.8613 7.7618-4.9297 11.32-5.7687 9.9232-20.631 27.569-20.631 27.569h-0.3651l-3.2865-5.1122s5.2815-7.9654 11.92-16.882c3.7869-5.0865 9.3541-10.483 11.268-14.887 1.2321-2.8358 1.7372-4.5779 1.6432-7.6683-0 [...]
+ <path id="path15955" d="m1423.2 921.54c2.4481-3.1977 6.1411-6.359 9.3555-8.7884 3.0325-2.292 6.8318-3.6779 9.3554-6.5204 1.0666-1.2014 1.8097-2.7128 2.268-4.2525 1.218-4.0918-0.078-8.6637 1.134-12.757 0.516-1.7429 1.5009-3.336 2.5514-4.8195 1.9324-2.7288 6.804-7.3709 6.804-7.3709v0.2835s-4.6183 6.5279-5.3865 10.773c-0.8162 4.5107 1.2811 9.5933 1.134 14.175-0.1023 3.1862-0.2569 6.6762-1.9845 9.3554-3.3698 5.2261-11.011 6.3078-15.025 11.056-7.449 8.8104-15.592 30.901-15.592 30.901l-7. [...]
+ <path id="path15972" d="m1454.9 876.98s-1.036 6.8857-0.6579 10.308c0.2007 1.8166 0.7501 3.6132 1.5352 5.2635 1.6029 3.3694 4.456 6.3522 5.7022 9.8691 0.955 2.6953 1.2064 5.0379 1.3158 7.8953 0.078 2.0454 0.3705 3.0311 0 5.0442-0.2973 1.6157-0.8152 3.2577-1.7545 4.6056-3.0511 4.3784-8.4028 7.7392-12.062 11.624-1.3937 1.4794-2.9708 3.8161-3.7284 5.7022-1.2879 3.2063-0.5447 7.3782-1.3159 10.746-0.9187 4.0122-1.696 6.8622-3.9476 10.308-3.0269 4.632-12.062 11.404-12.062 11.404l-5.9215-9. [...]
+ <path id="path15976" d="m1525.6 967.82s-4.1462 1.1569-6.2781 1.2556c-1.3313 0.0616-2.7077-0.009-3.9761-0.41854-1.0704-0.34547-2.1708-0.84409-2.9298-1.6742-1.2428-1.3591-1.3672-3.4357-2.302-5.0225-1.6713-2.8369-3.4945-5.6613-5.8595-7.9522-2.7379-2.6522-5.8491-4.3093-9.4172-5.6503-2.8267-1.0624-5.979-1.0799-8.9986-1.0464-2.5352 0.0282-5.0807 0.40561-7.5337 1.0464-3.3339 0.87084-6.5114 1.4567-9.6264 2.9298-1.8069 0.85448-4.1223 2.4783-5.6502 3.7669-4.6639 3.933-7.8083 8.2511-11.091 13. [...]
+ <path id="path15974" d="m1427.6 969.19s7.2567-5.5952 9.8966-9.2256c3.3218-4.5682 3.7835-10.265 6.7095-15.096 2.2997-3.7972 5.0169-6.9486 8.7224-9.3933 2.4501-1.6165 5.3068-1.2783 7.8837-2.6838 2.162-1.1792 4.7848-3.3566 6.2063-5.3676 1.8888-2.6721 3.3548-9.2256 3.3548-9.2256l-0.1677-0.16774s0.3498 5.9378-0.5032 8.7224c-0.8005 2.613-2.2645 5.1092-4.1935 7.045-2.7616 2.7712-7.3015 3.2686-10.064 6.0386-2.6206 2.6274-4.2406 6.1505-5.7031 9.5611-2.5395 5.9223-2.1708 12.931-5.1999 18.619- [...]
+ <path id="path15978" d="m1471.8 921.37s2.793 7.1227 3.139 10.882c0.2634 2.8615-0.06 5.8136-0.8371 8.5801-0.6499 2.3127-1.7097 4.5566-3.139 6.4874-1.5272 2.063-3.7732 3.4811-5.6503 5.2318-2.3097 2.1542-4.9909 5.2314-6.9059 7.743-3.3488 4.392-5.3786 8.4018-7.743 13.393-3.0781 6.4982-8.3708 19.881-8.3708 19.881l-5.0224-7.5337s10.225-20.909 18.206-30.344c3.6114-4.2688 10.518-7.6836 13.603-12.347 2.0572-3.1097 2.8862-6.973 3.3483-10.673 0.4676-3.7436-0.6278-11.301-0.6278-11.301z" fill="# [...]
+ <path id="path15980" d="m1460.4 1022.4s2.2975-16.112 4.8203-24.321c1.5857-5.1594 3.5819-10.276 6.427-14.863 2.4038-3.8754 4.8765-7.487 8.714-9.951 2.9251-1.8781 6.5665-2.8603 10.042-2.8118 4.0653 0.0567 7.6045 1.8017 11.526 2.8757 2.7878 0.76354 5.5552 2.1369 8.4355 2.3782 2.0059 0.16806 4.0626 0.0445 6.0254-0.40169 2.1093-0.47951 4.2969-1.4792 6.0253-2.7799 1.2199-0.91799 2.8119-3.6152 2.8119-3.6152s-5.7799 3.6387-9.0465 4.3894c-1.6818 0.38645-3.4921 0.37343-5.1768 0-6.55-1.4518-11 [...]
+ <path id="path12084-5" d="m1460.5 1022.4s3.1615-23.776 8.4355-34.304c3.0423-6.0732 6.858-12.711 12.934-15.746 3.8607-1.9286 6.9568-2.1508 11.247-1.6871 6.5548 0.70843 11.965 5.0305 18.558 5.0613 9.9772 0.0466 13.425-5.6611 13.497-7.8731 0 0-9.5671 4.0629-12.934-2.2495-2.3665-4.4362-4.9143-8.0373-7.6184-10.947-5.1077-5.4967-13.223-7.567-20.859-7.1367-6.0154 0.33899-13.62 4.489-18.486 5.0186 0 0 6.5821-5.7472 8.4364-10.334 1.3308-3.2923 1.8128-9.14 0.9944-12.596-1.4414-6.0857-4.309-11 [...]
+ </g>
+ <g id="g15898" transform="translate(-129.89 -681.95)">
+ <path id="path12086" d="m1415.7 1120.4s17.44 14.103 20.83 24.189c1.1439 3.4035 0.4879 10.04-0.6719 13.438-2.7089 7.9367-14.11 18.142-14.11 18.142s9.1849 1.674 15.229 0c2.4071-0.6667 8.404-2.3393 12.134-4.8401 4.0717-2.7296 6.6839-6.2741 6.6839-6.2741s4.9988 1.03 7.6121 0.3634c6.547-1.67 8.7791-5.3557 11.423-12.316 1.6701-4.397 1.3151-11.389 0-15.905-1.6329-5.6076-3.5244-10.405-7.3911-14.782-4.4236-5.0078-15.454-12.766-15.454-12.766l-36.284 10.751z" stroke="#806600" stroke-width="1.5 [...]
+ <path id="path15872" d="m1428.3 1124.9c15.622 16.226 19.473 33.604 1.3623 48.459 0 0 8.0773 0.1865 11.677-1.3623 17.287-8.2438 19.883-27.435 8.7577-38.728 11.653 4.6929 11.886 17.336 8.9523 28.414 0 0 3.5728-0.7611 5.0599-1.5569 3.5058-1.8762 5.4646-6.1197 6.6169-9.9253 1.0903-3.6011 0.5538-7.5661 0-11.288-0.4591-3.0853-1.2263-6.2164-2.7246-8.9523-3.3594-6.1345-13.623-15.958-13.623-15.958-7.0009 8.2651-15.67 10.37-26.078 10.898z" fill="#ebd25d"/>
+ <path id="path15874" d="m1433.1 1172.7c15.281-2.9489 23.177-14.54 22.163-25.27-0.83-8.7823-7.6288-16.988-21.232-19.408 7.8487 6.5152 12.254 12.708 13.558 18.67 1.9907 9.1-3.2443 17.661-14.489 26.008z" fill="#f6e078"/>
+ <path id="path15874-0" d="m1460.3 1160.6c12.126-2.6796 16.358-29.373-7.6014-39.093 15.95 15.851 13.754 27.794 7.6014 39.093z" fill="#f6e078"/>
+ </g>
+ <g id="g15867" transform="translate(-129.89 -681.95)">
+ <path id="path12090" d="m1285.3 1130.2s-15.11 8.3436-18.624 16.141c-1.6669 3.6984-1.8193 6.8035 0 10.429 1.5967 3.182 6.3705 4.7326 7.2012 8.1945 0.598 2.4919-1.17 5.7109-2.1779 8.8786-0.8267 2.5984-0.8984 5.1623-0.8019 7.2621 0.3161 6.8808 7.9462 11.174 7.9462 11.174s-2.5258-4.646-0.4966-8.4428c0.8557-1.6011 4.4361-2.7885 6.6084-5.2854 1.5605-1.7937 3.3243-6.8821 3.3243-6.8821 3.0648 4.6045 4.7375 8.2925 3.2281 13.657 10.627-4.6017 16.341-14.514 15.892-25.825-0.3662-9.2275-9.6844-2 [...]
+ <path id="path15863" d="m1282.6 1174.5c-1.4952 1.5832-4.3773 3.2811-5.7282 4.9891-1.1495 1.4533-2.4021 4.6195-2.4021 4.6195s-1.4293-2.3757-1.2935-4.6195c0.2637-4.3578 4.4178-9.4928 4.4347-13.858 0.01-2.242-0.4694-4.6991-1.8478-6.4673-1.6628-2.1329-5.486-1.5374-6.8368-3.8803-1.2306-2.1344-1.0629-5.1686 0-7.3912 3.1747-6.6388 17-14.043 17-14.043l8.6846 3.8804c7.4257 12.317 14.965 25.004 0.6043 42.16 0 0-2.5099-6.225-2.1423-8.7573 1.3996-9.6409-0.831-17.062-5.161-25.408 0 0 1.9333 8.17 [...]
+ <path id="path15865" d="m1274.5 1179.9s2.7623-3.6662 4.2347-5.4256c2.2053-2.6351 5.1318-4.718 6.8813-7.6754 1.3567-2.2934 2.3281-4.8975 2.6467-7.543 0.2703-2.2442-0.1369-4.5503-0.6617-6.749-0.5934-2.4859-2.347-4.627-2.779-7.146-0.2387-1.3919-0.4695-2.957 0.1323-4.2346 0.626-1.329 3.3084-2.9114 3.3084-2.9114-8.0836 1.1664-12.898 3.0106-13.498 11.91-0.1305 1.9353 0.7849 3.6582 1.588 5.4257 0.9467 2.0837 3.297 3.8353 3.7053 6.0873 0.4519 2.4926-0.1313 5.1377-0.9263 7.543-0.5889 1.7819- [...]
+ </g>
+ <g id="g10165" transform="translate(-129.89 -681.95)">
+ <path id="path12041-3" d="m1300.1 757.7s1.118 11.169 5.4319 14.195c6.4847 4.5491 10.237 11.6 11.894 19.269 0.9434 4.3652-2.164 8.0997-3.1138 11.273-0.9485 3.1688 0.2599 5.7784 2.0811 7.898 3.6028 4.1934 12.731 3.4169 12.731 3.4169s-3.74 3.642-9.6325 5.3188c-4.0832 1.1619-9.9289 0.89415-13.271-0.17716-8.9922-2.8822-12.804-10.764-18.144-18.552-9.9252-14.474-7.0221-23.965-7.0221-23.965l7.5007-39.001c53.126-48.86 112.27-176.5 36.329-222.1l-24.447 11.238c-9.5962 4.4113-18.274-12.093-28.7 [...]
+ <path id="path12041-3-7-9" d="m1288.6 737.37c53.126-48.86 112.27-176.5 36.329-222.1-20.747-9.2962-20.054-4.7331-29.754-11.759 13.551-13.859 26.251-15.724 37.098-12.31 14.396 4.5314 25.523 14.328 33.846 26.147 12.997 18.458 19.156 41.847 20.249 57.813 1.8989 27.744-2.9697 48.405-11.858 68.187-10.256 22.826-22.61 43.126-36.453 61.768-11.078 14.917-21.472 29.975-32.278 40.497l-17.178-8.2456z" fill="#dec657"/>
+ <path id="path10046" d="m1365.8 515.4s14.636 2.7002 21.604 5.2147c4.4222 1.5958 8.8607 3.4447 12.664 6.208 3.0783 2.2363 5.6868 5.1332 7.9462 8.1945 3.4756 4.7092 5.8878 10.13 8.4428 15.396 1.5704 3.2366 2.3462 6.8626 4.2214 9.9327 1.0109 1.6551 2.3472 3.1045 3.7248 4.4697 1.6712 1.6562 5.463 4.4697 5.463 4.4697l0.4966 0.74495s-7.4928-2.4909-11.174-5.7113c-2.853-2.4956-6.2037-6.7072-8.1945-9.9327-3.2212-5.219-5.299-11.357-9.6844-15.644-3.502-3.4238-7.9823-6.0122-12.664-7.4496-2.8012 [...]
+ <path id="path10042" d="m1323.2 500.86s11.202-15.267 15.634-18.431c3.9301-2.8048 8.1075-5.3588 12.576-7.1866 1.8151-0.74237 3.7368-1.3168 5.6895-1.4972 4.0859-0.37755 7.977-0.31323 11.978 0.59889 3.4517 0.78695 6.8734 2.0262 9.8816 3.8928 2.4019 1.4904 4.4153 3.5723 6.2883 5.6894 2.1835 2.4682 3.5303 5.5955 5.6894 8.085 1.5268 1.7604 3.2063 3.4202 5.0906 4.7911 1.8423 1.3403 3.9014 2.3809 5.9888 3.2939 1.1568 0.50593 3.5933 1.1978 3.5933 1.1978s-5.4365 0.92707-8.6838 0.29944c-4.9527 [...]
+ <path id="path10038" d="m1317.6 442.54s7.4328 8.3891 10.36 13.135c2.2159 3.5926 4.0625 7.4554 5.3652 11.47 1.0078 3.1061 1.4802 6.3758 1.85 9.6203 0.1887 1.6555 0.3268 3.335 0.185 4.9951-0.1019 1.193-0.3649 2.378-0.74 3.5151-1.5301 4.6384-7.0244 17.32-7.0244 17.32l-15.176-4.6251c15.579-5.6562 23.002-20.764 13.858-42.116-2.5196-4.5789-6.4771-8.0298-8.6776-13.315z" fill="#cdb544"/>
+ <path id="path10040" d="m1295.4 503.04s1.7022-10.334 3.1451-15.355c1.6544-5.7578 3.2756-10.63 6.1051-15.91 1.6896-3.1532 4.1332-6.9162 6.4752-9.6203 1.7988-2.0769 4.5951-4.1799 6.1052-6.4752 1.0513-1.5979 1.1928-11.856 1.1928-11.856l4.6583 7.5284c1.0609 1.7146 0.5653 9.623-0.4527 11.364-2.2655 3.876-6.5537 9.1377-8.8802 12.977-2.4732 4.0816-3.6694 6.4246-4.9136 11.032-2.7759 10.279-4.775 29.821-4.775 29.821l-8.6602-13.505z" fill="#f6e078"/>
+ <path id="path10044" d="m1402 504.59s-4.1703 1.6001-6.7192 2.045c-6.2354 1.0882-13.291-0.1891-19.573 0.58428-1.1955 0.14717-1.6307 0.20276-2.6293 0.87642-5.49 3.7037-12.562 16.068-12.562 16.068l-4.5842 3.7079s-4.7091-8.042-7.8878-11.393c-4.4904-4.7344-15.483-11.978-15.483-11.978s12.822 6.6275 19.259 3.9963c7.1004-2.9024 10.34-6.1257 13.725-7.7092 2.3398-1.0947 5.3971-1.0169 7.1916-1.1009 3.8833-0.18176 6.1029 1.5483 16.293 4.0274 3.5005 0.85158 12.971 0.87642 12.971 0.87642z" fill=" [...]
+ <path id="path10048" d="m1423.2 569.77s-5.914-0.014-7.4622-0.52063c-5.1487-1.6848-9.6842-6.0666-14.751-7.983-1.1036-0.41739-2.291-0.67931-3.4708-0.69417-2.7007-0.034-6.3946 0.77176-9.0243 1.3883-5.3459 1.2534-14.751 4.6856-14.751 4.6856l-0.5207 0.52063-5.2062-14.578s8.5295-3.2551 13.016-3.8179c3.2163-0.40354 7.6077-0.41016 10.76 0.34708 4.5295 1.0882 8.6671 3.4192 12.495 6.074 3.9328 2.7274 5.7699 6.7399 9.3713 9.8919 1.9853 1.7375 9.5448 4.6856 9.5448 4.6856z" fill="#cdb544"/>
+ <path id="path10050" d="m1205.2 507.95 5.5214 5.8282 4.908 3.3742 15.951 3.9877 70.245-14.417s-10.551-9.7094-17.791-13.19c-6.5299-3.1392-14.23-5.5754-21.472-5.3619-5.7535 0.16963-11.715 2.0422-16.871 4.6012-4.9373 2.4506-7.2355 5.0679-11.35 8.7361-3.024 2.6962-6.7721 6.9246-10.123 9.2024-1.9668 1.3371-4.065 2.0612-6.4417 2.1472-4.4972 0.16275-12.577-4.9079-12.577-4.9079z" fill="#cdb544"/>
+ <path id="path10052" d="m1277.6 480.34c-3.8888-2.2437-7.4848-5.0886-11.656-6.7484-3.71-1.4762-7.6647-2.863-11.656-2.7607-2.5554 0.0655-5.0046 1.1585-7.3619 2.1472-2.7017 1.1332-5.3701 2.4779-7.6687 4.2944-2.7252 2.1536-4.4162 4.6502-6.1349 7.6687-1.5846 2.783-2.9458 6.2977-4.2945 9.2024-1.1824 2.5466-2.0897 4.9862-3.9877 7.0552-2.0187 2.2006-4.2443 4.5128-7.0551 5.5214-3.8508 1.3818-12.27 0.30675-12.27 0.30675s7.2226 3.0523 11.043 3.0675c2.7531 0.0109 5.5492-0.84589 7.9754-2.1472 3. [...]
+ <path id="path10054" d="m1423.6 608.69s-4.9882-4.0636-6.7646-6.3546c-1.0699-1.3798-1.9875-2.9003-2.6648-4.5097-0.7136-1.6957-0.9598-3.5522-1.4349-5.3296-0.8944-3.3465-1.2049-6.903-2.6648-10.044-0.703-1.5127-1.7976-2.8218-2.8698-4.0997-1.9874-2.3689-4.0964-4.6901-6.5596-6.5596-4.4354-3.3664-8.7822-5.8938-13.939-7.9945-0.9824-0.40017-2.0264-0.65827-3.0748-0.81994-2.9744-0.45871-10.249-1.2299-10.249-1.2299l2.8698 13.119s10.926-1.0625 15.989 0.61496c4.012 1.3293 7.6402 4.0211 10.454 7.1 [...]
+ <path id="path10062" d="m1370 621.88s10.787 8.9591 15.199 13.902c5.7167 6.4042 7.9666 19.3 13.976 25.431 2.5883 2.6404 9.3059 6.0363 9.3059 6.0363l-7.0423-1.2576-5.5332-2.2636-3.7727-5.2817-7.0423-8.8029-6.2878-6.0362-11.821-4.5272 3.0182-17.2z" fill="#cdb544"/>
+ <path id="path10060" d="m1357.7 631.6s15.134 6.6676 18.113 11.043c3.0577 4.492 5.3957 9.5708 6.7776 14.826 1.2614 4.7971 1.7568 9.8898 1.2708 14.826-0.5473 5.559-1.0611 10.23-4.236 14.826-2.0064 2.9044-5.9339 5.7042-8.8957 7.6248-3.6592 2.3729-11.437 6.354-11.437 6.354 20.941-15.993 25.811-35.581-1.2708-55.915l-0.3214-13.584z" fill="#f6e078"/>
+ <path id="path10058" d="m1376.8 591.84s10.545 8.4398 15.104 13.387c3.1014 3.3658 5.9676 7.0106 8.2384 10.984 1.476 2.583 2.6508 5.368 3.4326 8.2383 0.8803 3.2319 1.3251 6.6054 1.373 9.9546 0.064 4.4516-1.3441 8.8268-1.446 13.278-0.051 2.2143 0.029 4.4508 0.4163 6.6316 0.7726 4.3486 3.7759 12.701 3.7759 12.701s-4.7108-5.7369-6.8142-9.6771c-2.9091-5.4495-4.1688-10.095-4.6012-16.258-0.3733-5.3196 1.5569-11.387-0.6135-16.258-4.0952-9.191-23.926-19.939-23.926-19.939l5.0613-13.044z" fill= [...]
+ <path id="path10056" d="m1373.7 600.84s16.021-1.2434 23.738 0.51604c1.3509 0.30803 2.5764 1.041 3.7842 1.7201 2.8418 1.5978 5.2596 3.877 8.0845 5.5044 1.3778 0.79368 2.7625 1.6599 4.3003 2.0641 0.8336 0.21912 2.5801 0.17201 2.5801 0.17201s-3.5642-2.0041-5.1603-3.2682c-3.0831-2.4418-5.6553-5.6398-8.4285-8.4285-1.8013-1.8114-3.8927-4.4346-6.0203-5.8484-3.0241-2.0095-5.9308-2.5902-9.4607-3.4402-4.4262-1.0659-13.589-1.3761-13.589-1.3761l0.172 12.385z" fill="#cdb544"/>
+ <path id="path10064" d="m1331.6 687.12s6.0908 15.219 10.857 21.9c1.3845 1.9409 2.8142 4.0283 4.8667 5.2411 2.2148 1.3087 5.8791 1.8648 8.4232 2.2462 2.348 0.35194 6.177 0.18718 6.177 0.18718l-6.9257-8.236c-9.5133-12.853-2.2896-30.76-4.118-43.613l-19.28 22.275z" fill="#d1b948"/>
+ <path id="path10066" d="m1329.5 814.13-9.3047 4.6523-6.7995 0.71574h-5.726l-3.2208-1.0736-19.325-15.031-0.3579-22.188c9.4892 8.4001 13.033 24.701 28.679 30.76 4.2955 1.6636 9.3928 2.7526 16.054 2.1636z" fill="#d1b948"/>
+ <path id="path10068" d="m1313.7 805.19 1.0737-3.9366s2.0809-4.4216 2.505-6.7996c0.3979-2.2313 0.088-3.8947-0.4622-6.0936-0.9837-3.9348-3.0665-7.5226-5.541-10.736-1.3904-1.8057-3.6054-3.8206-5.2875-5.3583-1.1845-1.0829-2.1575-1.87-3.0241-3.2208-1.0798-1.6831-1.3074-3.7852-1.7893-5.7259-1.2575-5.0637-2.863-15.388-2.863-15.388l-6.7995 23.262s10.97 7.6822 15.03 12.883c1.9699 2.523 3.2144 5.5757 4.2945 8.5889 1.4451 4.0316 2.8629 12.525 2.8629 12.525z" fill="#f6e078"/>
+ <path id="path12041-3-7" d="m1300.1 757.7s1.118 11.169 5.4319 14.195c6.4847 4.5491 10.237 11.6 11.894 19.269 0.9434 4.3652-2.164 8.0997-3.1138 11.273-0.9485 3.1688 0.2599 5.7784 2.0811 7.898 3.6028 4.1934 12.731 3.4169 12.731 3.4169s-3.74 3.642-9.6325 5.3188c-4.0832 1.1619-9.9289 0.89415-13.271-0.17716-8.9922-2.8822-12.804-10.764-18.144-18.552-9.9252-14.474-7.0221-23.965-7.0221-23.965l7.5007-39.001c53.126-48.86 112.27-176.5 36.329-222.1l-24.447 11.238c-9.5962 4.4113-18.274-12.093-28 [...]
+ </g>
+ <g id="g15482" transform="translate(-129.89 -681.95)">
+ <g id="g13293" transform="translate(0,2)">
+ <g id="g12743-9-2-2-4-4-4-8-6-7-3" transform="matrix(.57931 -.81511 .81511 .57931 -361.12 1234.3)">
+ <path id="rect12617-8-7-3-7-6-1-1-5-5-5" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5-9-5-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429-4.6749 [...]
+ </g>
+ <g id="g12743-9-2-2-4-4-4-8-6-7-3-4" transform="matrix(.18994 -.98180 .98180 .18994 -126.46 1886.1)">
+ <path id="rect12617-8-7-3-7-6-1-1-5-5-5-1" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5-9-5-2-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429-4.674 [...]
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3-5-4-2" transform="matrix(-.079818 -.99681 .99681 -.079818 221.76 2262.6)">
+ <g id="g12383-4-2-8-5-4-1-6" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4-9-8-6" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3-1-8-7" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4-4-8-6-7-3-4-7" transform="matrix(.12775 -.99181 .99181 .12775 -114.3 1968.8)">
+ <path id="rect12617-8-7-3-7-6-1-1-5-5-5-1-7" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5-9-5-2-7-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429-4.6 [...]
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3-5-4-2-1" transform="matrix(-.33293 -.94295 .94295 -.33293 555.76 2484.2)">
+ <g id="g12383-4-2-8-5-4-1-6-8" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4-9-8-6-7" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3-1-8-7-8" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4-4-8-6-7-3-4-7-5" transform="matrix(.37007 -0.929 0.929 .37007 -397.53 1592.5)">
+ <path id="rect12617-8-7-3-7-6-1-1-5-5-5-1-7-8" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5-9-5-2-7-4-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429-4 [...]
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3-5-4-2-1-9" transform="matrix(-.23623 -.97170 .97170 -.23623 342.99 2401.1)">
+ <g id="g12383-4-2-8-5-4-1-6-8-1" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4-9-8-6-7-5" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3-1-8-7-8-5" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4-4-8-6-7-3-4-7-5-7" transform="matrix(.73698 -.67592 .67592 .73698 -599.49 811.68)">
+ <path id="rect12617-8-7-3-7-6-1-1-5-5-5-1-7-8-4" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5-9-5-2-7-4-2-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429 [...]
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3-5-4-2-1-9-9" transform="matrix(.16784 -.98581 .98581 .16784 -242.24 1920.7)">
+ <g id="g12383-4-2-8-5-4-1-6-8-1-8" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4-9-8-6-7-5-2" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3-1-8-7-8-5-0" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4-4-8-6-7-3-4-7-5-7-6" transform="matrix(.98948 -.14468 .14468 .98948 -310.67 -196.25)">
+ <path id="rect12617-8-7-3-7-6-1-1-5-5-5-1-7-8-4-2" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5-9-5-2-7-4-2-8-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.34 [...]
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3-5-4-2-1-9-9-5" transform="matrix(.53823 -.84280 .84280 .53823 -583.02 1259.9)">
+ <g id="g12383-4-2-8-5-4-1-6-8-1-8-8" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4-9-8-6-7-5-2-3" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3-1-8-7-8-5-0-0" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4-4-8-6-7-3-4-7-5-7-6-1" transform="matrix(.94099 .33844 -.33844 .94099 327.99 -797.37)">
+ <path id="rect12617-8-7-3-7-6-1-1-5-5-5-1-7-8-4-2-5" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5-9-5-2-7-4-2-8-2-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2. [...]
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3-5-4-2-1-9-9-5-5" transform="matrix(.93852 -.34523 .34523 .93852 -514.93 96.031)">
+ <g id="g12383-4-2-8-5-4-1-6-8-1-8-8-2" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4-9-8-6-7-5-2-3-2" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3-1-8-7-8-5-0-0-7" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4-4-8-6-7-3-4-7-5-7-6-1-8" transform="matrix(.63374 .77355 -.77355 .63374 1255.8 -1018.3)">
+ <g id="g13183" transform="matrix(.99808 -.062012 .062012 .99808 -71.324 79.322)">
+ <path id="rect12617-8-7-3-7-6-1-1-5-5-5-1-7-8-4-2-5-7" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5-9-5-2-7-4-2-8-2-2-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 [...]
+ </g>
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3-5-4-2-1-9-9-5-5-1" transform="matrix(.98225 .18759 -.18759 .98225 79.755 -687.1)">
+ <g id="g12383-4-2-8-5-4-1-6-8-1-8-8-2-1" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4-9-8-6-7-5-2-3-2-0" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3-1-8-7-8-5-0-0-7-1" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4-4-8-6-7-3-4-7-5-7-6-1-8-6" transform="matrix(.25052 .96811 -.96811 .25052 2010 -830.75)">
+ <g id="g13183-2" transform="matrix(.99808 -.062012 .062012 .99808 -71.324 79.322)">
+ <path id="rect12617-8-7-3-7-6-1-1-5-5-5-1-7-8-4-2-5-7-8" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5-9-5-2-7-4-2-8-2-2-6-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.27 [...]
+ </g>
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3-5-4-2-1-9-9-5-5-1-0" transform="matrix(.76389 .64535 -.64535 .76389 938.08 -1047)">
+ <g id="g12383-4-2-8-5-4-1-6-8-1-8-8-2-1-0" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4-9-8-6-7-5-2-3-2-0-9" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3-1-8-7-8-5-0-0-7-1-5" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3-5-4-2-1-9-9-5-5-1-0-9" transform="matrix(.55553 .83149 -.83149 .55553 1478.1 -1054.5)">
+ <g id="g12383-4-2-8-5-4-1-6-8-1-8-8-2-1-0-4" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4-9-8-6-7-5-2-3-2-0-9-3" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3-1-8-7-8-5-0-0-7-1-5-9" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ </g>
+ <g id="g11772">
+ <g id="g11353-9" transform="matrix(.20983 -.90443 .86635 .21906 -390.52 1765)" stroke-width="1.6469">
+ <path id="path11317-0" d="m1287.2 1335.4c-8.022 11.731-12.809 26.276-32.926 40.408 7.2388 1.5148 15.237 2.3593 22.459-1.7528-1.3111 6.0019-9.3714 14.781-13.78 20.008 15.951-0.318 24.909-3.401 33.878-10.993 9.8057-8.3003 17.972-21.922 24.55-42.996l-34.18-4.6742z" fill="#ebd25d"/>
+ <path id="path11319-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1282 1352.6c-0.5457 7.5146-3.3774 14.426-7.4053 20.662-0.2015 0.3119-0.8829 0.9921-1.5889 1.4349-0.7732 0.4849-1.5758 0.7333-1.8095 1.0671l4.9138-0.4927-0.1553 2.8043c4.3228-7.5824 7.4572-16.67 6.0451-25.475v-0.0002h0.0001z" fill="#806600"/>
+ <path id="path11351-22" d="m1258.9 1372.6c14.625 0.9679 21.861-10.906 20.267-24.102-5.2679 10.177-13.09 18.708-20.267 24.102z" fill="#f6e078"/>
+ <path id="path11317-9-7" d="m1287.2 1335.4c-8.022 11.731-12.809 26.276-32.926 40.408 7.2388 1.5148 15.237 2.3593 22.459-1.7528-1.3111 6.0019-9.3714 14.781-13.78 20.008 15.951-0.318 24.909-3.401 33.878-10.993 9.8057-8.3003 17.972-21.922 24.55-42.996l-34.18-4.6742z" stroke="#806600" stroke-width="1.6469" fill="none"/>
+ <path id="path11347-3" d="m1286.8 1348.4c1.1657 18.695-5.7718 31.331-15.425 41.177 25.085-5.6209 32.369-22.884 37.54-33.304 1.0807-2.569-7.1543-14.581-22.115-7.8732z" fill="#f6e078"/>
+ <path id="path11349-7" d="m1290.7 1352.1c-0.5346 11.28-4.8197 21.094-10.344 30.727 11.729-6.6524 17.383-17.126 21.905-29.358-3.7469-4.038-7.0131-3.8147-11.561-1.3691z" fill="#f8ec9c"/>
+ </g>
+ <g id="g11353">
+ <path id="path11317" d="m1287.2 1335.4c-8.022 11.731-12.809 26.276-32.926 40.408 7.2388 1.5148 15.237 2.3593 22.459-1.7528-1.3111 6.0019-9.3714 14.781-13.78 20.008 15.951-0.318 24.909-3.401 33.878-10.993 9.8057-8.3003 17.972-21.922 24.55-42.996l-34.18-4.6742z" fill="#ebd25d"/>
+ <path id="path11319" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1282 1352.6c-0.5457 7.5146-3.3774 14.426-7.4053 20.662-0.2015 0.3119-0.8829 0.9921-1.5889 1.4349-0.7732 0.4849-1.5758 0.7333-1.8095 1.0671l4.9138-0.4927-0.1553 2.8043c4.3228-7.5824 7.4572-16.67 6.0451-25.475v-0.0002h0.0001z" fill="#806600"/>
+ <path id="path11351" d="m1258.9 1372.6c14.625 0.9679 21.861-10.906 20.267-24.102-5.2679 10.177-13.09 18.708-20.267 24.102z" fill="#f6e078"/>
+ <path id="path11317-9" d="m1287.2 1335.4c-8.022 11.731-12.809 26.276-32.926 40.408 7.2388 1.5148 15.237 2.3593 22.459-1.7528-1.3111 6.0019-9.3714 14.781-13.78 20.008 15.951-0.318 24.909-3.401 33.878-10.993 9.8057-8.3003 17.972-21.922 24.55-42.996l-34.18-4.6742z" stroke="#806600" stroke-width="1.5" fill="none"/>
+ <path id="path11347" d="m1286.8 1348.4c1.1657 18.695-5.7718 31.331-15.425 41.177 25.085-5.6209 32.369-22.884 37.54-33.304 1.0807-2.569-7.1543-14.581-22.115-7.8732z" fill="#f6e078"/>
+ <path id="path11349" d="m1290.7 1352.1c-0.5346 11.28-4.8197 21.094-10.344 30.727 11.729-6.6524 17.383-17.126 21.905-29.358-3.7469-4.038-7.0131-3.8147-11.561-1.3691z" fill="#f8ec9c"/>
+ </g>
+ <g id="g11633" transform="translate(808.09 -42.667)">
+ <path id="path11585" d="m323.23 650.03c7.5515 16.171 24.857 9.2716 37.927 5.3944 11.416-3.3865 38.485 1.3465 38.485 1.3465l-4.1831-12.828s-23.833-5.962-34.859-1.1155c-12.868 5.6557-23.255 14.012-37.369 7.2028z" fill="#c40000"/>
+ <path id="path11609" d="m323.11 649.78s4.263 5.4126 7.7417 6.7589c3.2895 1.273 7.4456 1.6666 10.955 1.3146 8.2428-0.8268 18.323-6.7884 26.565-7.6274 10.816-1.1011 30.402 3.2057 30.402 3.2057l-3.3596-9.4945s-8.7167-1.9668-13.146-2.4832c-4.2603-0.49667-8.5718-0.82509-12.854-0.58428-2.1659 0.12179-4.3552 0.37964-6.4271 1.0225-4.2226 1.3102-7.947 3.8801-11.978 5.6967-2.9435 1.3266-5.8041 2.9169-8.9102 3.7978-2.5108 0.7121-5.1319 1.154-7.7417 1.1686-2.1139 0.0118-4.2338-0.34948-6.281-0 [...]
+ <path id="path11585-2-4" d="m396.54 648.04-1.0813-4.1047s-8.8005-3.0405-18.18-3.6805c-6.0558-0.41319-12.353 0.66353-16.679 2.565-12.868 5.6557-23.255 14.012-37.369 7.2028 0 0 7.7516 6.086 12.908 6.0842 10.193-0.003 21.498-8.9952 31.622-10.177 9.8992-1.1559 28.78 2.1105 28.78 2.1105z" fill="#e9001a"/>
+ <path id="path11585-2" d="m323.23 650.03c7.5515 16.171 24.857 9.2716 37.927 5.3944 11.416-3.3865 38.485 1.3465 38.485 1.3465l-4.1831-12.828c0.009-0.005-20.962-7.6368-34.859-1.1155-12.724 5.9708-23.255 14.012-37.369 7.2028z" stroke="#a00" stroke-width="1px" fill="none"/>
+ </g>
+ <g id="g10503" stroke-width="1.5">
+ <g id="g10432">
+ <path id="path12742-3" d="m1243.1 912.8 17.761 31.46s-5.5356 18.007-15.049 23.035c-0.851-12.55-10.038-28.258-15.684-41.613-1.8531-4.3832 8.9288-9.1456 12.972-12.882z" stroke="#918a6f" stroke-width="1.5" fill="#e2e2de"/>
+ <g id="g11970" stroke-width="1.5">
+ <path id="path10748" d="m1056 869.58c-12.367 6.7635-14.378 15.451-11.372 31.551 0 0-6.9952-1.3381-9.8597-3.2866-6.1083-4.1549-9.1825-7.2256-12.226-13.957-4.4896-9.9294-4.1472-24.81-6.9456-35.342-5.3522-20.143-18.913-52.852-26.661-70.873-3.3825-7.8673-3.7619-14.473-0.61776-17.974 0 0 7.4903-16.013 19.062-19.281 4.0909-1.1554 12.225 1.1097 12.225 1.1097s11.952 3.6208 19.808 4.7623c8.8537 1.2865 18.058 0.81167 26.84 2.5197 18.187 3.5371 54.555 20.328 54.555 20.328 0.8026-3.861 1.37 [...]
+ <path id="path10748-7-7" d="m1339 959.38s24.283 40.25 32.92 60.155c6.4051 14.761 10.36 33.976 17.738 48.275 6.455 12.511 13.374 29.094 26.03 35.26 8.45 4.117 20.123 2.8099 28.199-2 5.6519-3.3663 10.069-10.911 11.4-17.353 2.741-13.27-0.2531-27.364-3.6152-40.491-3.133-12.233-7.5911-23.385-13.184-34.706-17.201-34.819-50.618-77.562-66.175-113.5 0 0-10.308-21.985-15.191-38.89-3.9259-13.59-7.003-31.065-7.676-45.195-0.5858-12.299 3.3378-31.617 3.3378-31.617 14.229-6.7389 27.231-14.706 [...]
+ <path id="path10748-7-0" d="m1120.8 769.14c0.8026-3.861 1.3735-7.6944 2.3406-11.454 19.813-77.032 91.268-76.373 140.08-125.51 12.114-12.193 41.437-42.821 30.015-33.631l1.8751-5.1445 15.864-11.105s-8.6021 15.16-12.692 22.21c-3.9642 6.8344-9.2487 14.8-14.807 20.415-11.369 11.485-21.074 21.37-33.844 30.565-14.153 8.5068-26.243 16.546-40.623 25.487-18.621 11.578-39.072 24.669-51.955 42.247-11.618 15.853-1.5515 30.942-1.5515 30.942l-9.5188 8.4611-8.461 14.278-3.1729 0.52881-13.552-8. [...]
+ <path id="path10748-7-39" d="m1360 527.05c27.045 33.321 26.015 85.672-7.8347 140.54-21.168 34.314-44.606 55.664-53.503 89.012-4.3237 16.205-5.7227 35.028-2.4049 58.933 4.7244 34.04 14.681 67.942 26.118 100.35 2.8493 8.0729 6.7828 18.391 10.104 26.993-1.4638 12.64-14.56-29.475-3.2656 41.763 1.537 10.795 6.2709 26.711 7.6952 39.749 2.3587 21.591-3.0072 40.686-8.6909 62.663 0 0-3.2062-43.618-7.0349-65.109-2.9788-16.72-7.6968-33.098-12.358-49.43-11.082-38.832-28.209-75.939-37.072-11 [...]
+ <path id="path11583" d="m1328.2 1086.9s1.6078-5.5716 2.288-8.3892c1.7375-7.1973 3.4086-14.424 4.5759-21.736 1.4717-9.2178 3.0464-18.51 2.6693-27.837-0.136-3.3626-0.8722-6.6131-1.5253-9.9145-1.4853-7.5075-3.1535-14.979-4.5759-22.498-1.4497-7.6639-3.867-15.645-5.9404-23.43-14.012-52.615-40.178-98.818-43.921-157.33-1.73-27.044 2.7971-55.238 13.365-80.192 14.039-33.148 48.972-60.613 63.481-93.558 9.3322-21.19 15.627-45.12 13.365-68.163-1.8347-18.691-10.097-38.505-23.028-52.125-5.455 [...]
+ <path id="path11500" d="m1223.7 515.41c13.351-4.8208 28.497-0.62528 32.935 14.006-12.816-19.857-28.988-13.742-36.645-10.154l3.7098-3.8512z" fill="#e2e2de"/>
+ <path id="path11512" d="m1299.2 494.7s-3.6877-13.344-6.205-19.778c-1.9276-4.9274-4.1348-9.7705-6.7866-14.349-3.1183-5.3839-10.665-15.318-10.665-15.318 1.57 5.7917 3.3646 12.018 6.1267 19.661 2.6045 7.2069 4.9806 14.639 5.6982 21.171 0.5021 4.5705 1.2834 7.2836-1.1601 9.1352l12.992-0.52076z" fill="#f8f8f6"/>
+ <path id="path11512-8" d="m1299.2 494.7s-3.6877-13.344-6.205-19.778c-1.9276-4.9274-4.1348-9.7705-6.7866-14.349-3.1183-5.3839-10.665-15.318-10.665-15.318l0.1939 0.3878c9.9594 20.125 17.905 34.936 16.094 47.385l7.3684 1.6732z" fill="#fff"/>
+ <path id="path11544" d="m1273.8 493.72 6.3394-0.45282-4.3017-27.848-0.4529-19.245-3.6225 17.886-1.132 10.415 1.132 9.5091 2.0377 9.7356z" fill="#f8f8f6"/>
+ <path id="path10748-7-3" d="m1141.2 595.17c1.8753 1.0737 4.6535 2.9723 7.1693 2.3326 18.814-4.784 43.032-8.7833 45.35-0.11385 0.6292 2.3536 0.751 5.3064-0.5309 7.7435-2.4725 4.7006-7.6094 9.2388-12.483 11.35-4.3275 1.8744-13.723 2.845-13.723 2.845s1.8663 4.5446 4.4884 5.6186c8.9408 3.6621 19.48 2.5705 29.63-2.1624 6.7548-3.1498 15.582-13.801 24.251-16.683 28.494-9.4731 44.823 10.983 67.853-7.5494 25.128-7.7489 36.996-28.576 37.106-49.888 0.1217-23.608-12.761-46.389-39.455-54.073 [...]
+ <path id="path10748-7-0-5" d="m1120.8 769.14c0.8026-3.861 1.3735-7.6944 2.3406-11.454 19.813-77.032 91.268-76.373 140.08-125.51 12.114-12.193 41.437-42.821 30.015-33.631l1.8751-5.1445 1.9666-1.0927 4.6158-4.0388s-1.3643 6.3887-2.8849 9.2316c-3.0316 5.668-12.116 15.001-12.116 15.001s-16.132 17.719-24.81 25.964c-5.3386 5.072-10.758 10.119-16.732 14.424-9.4455 6.8079-19.937 14.035-30.003 19.886-11.467 6.6658-25.859 14.307-36.926 21.617-7.6713 5.0667-13.241 10.109-19.617 16.732-7.17 [...]
+ <path id="path11484" d="m1208.1 589.73 40.899-7.3035 4.7473 5.6686c-15.072-1.3461-29.469 0.95568-44.186 4.0169l-1.4607-2.3821z" fill="#d5d5d0"/>
+ <path id="path10748-7-9" d="m1305.7 578.1c10.622-17.201 14.776-36.943 2.8013-60.865 21.478 16.959 19.395 58.925-11.401 79.359-31.348 20.801-43.276 0.0341-71.768 9.5067-8.6687 2.882-17.496 13.533-24.251 16.683-10.15 4.7329-20.689 5.8244-29.63 2.1624-2.6221-1.074-4.4884-5.6186-4.4884-5.6186s8.1475 3.7959 12.527 4.0207c12.001 0.6162 26.179-4.6564 28.676-17.209 2.212-11.121-3.1182-19.166-12.213-25.718 12.246 0.35025 17.878 11.342 17.305 26.529 14.504-8.8293 29.106-7.4132 45.192-5.61 [...]
+ <path id="path11478" d="m1244.7 548.95s5.1225 16.162 10.02 22.904c3.3771 4.6486 7.6337 9.116 12.883 11.452 3.9477 1.7566 8.6072 2.0513 12.883 1.4315 4.8676-0.70548 9.9376-2.4419 13.599-5.7259 5.4857-4.9203 8.786-12.219 10.736-19.325 2.2107-8.0559 2.1781-16.826 0.7157-25.051-1.1246-6.3248-1.1098-14.187-5.1574-19.176-4.336-5.3439-10.191-10.766-16.462-13.599-6.7507-3.0496-14.093-4.9456-21.472-4.2944-7.8678 0.69426-16.578 4.8617-22.926 9.5615-2.5797 1.9099-8.3616 4.9294-8.3616 4.929 [...]
+ <path id="path11488" d="m1183.6 558.59s16.974-10.33 26.165-13.976c3.0781-1.2213 9.5884-2.6002 9.5884-2.6002l1.9502 3.5753s-6.964 0.38435-10.238 1.4626c-9.0014 2.9641-25.027 13.489-25.027 13.489l-2.4377-1.9502z" fill="#e2e2de"/>
+ <path id="path11480" d="m1255 530.82c-3.1505 6.1802-6.5154 10.647-9.8944 13.733-4.3452 3.9686-8.7159 5.9295-12.68 5.7624-7.1052-0.29946-11.924-3.4131-14.802-7.1227-2.6799-3.4538-6.3075-3.4015-9.2047-8.0786 3.0574 1.4785 12.798-3.1223 23.043-4.2709 8.77-0.98332 17.909 1.7222 23.539-0.0235z" fill="#d5d5d0"/>
+ <path id="path11482" d="m1216.2 522.88s8.5812-5.517 13.625-5.7998c7.1019-0.39823 14.941 1.0772 18.812 4.4087 0.9964 0.85752 6.3103 8.8518 6.3103 8.8518s-11.708-2.2646-14.943-2.3882c-2.6567-0.10152-5.8298 0.56857-8.4794 0.78877-3.8654 0.32125-7.2444-0.19336-11.043 0.59159-2.3669 0.48911-4.3913 2.0603-6.7045 2.7607-2.2455 0.67989-6.9018 1.3804-6.9018 1.3804 4.7927-6.125 1.9478-3.9521 9.3243-10.594z" fill="#f8f8f6"/>
+ <g id="g3649-0-7-3-8-8-4-2-5" transform="matrix(2.1507 0 0 2.1507 -395.37 -136.8)" stroke-width=".69744">
+ <path id="path4096-2-7-5-5-8-6-4-7-9" d="m749.94 313.06c0.24199 2.2783 3.7124 5.6431 7.5085 5.2299 3.7962-0.4132 6.4806-4.448 6.2386-6.7262-0.24199-2.2783-3.3188-1.4262-7.1149-1.013-3.7962 0.4132-6.8742 0.23146-6.6322 2.5093z" fill="#fff"/>
+ <path id="path4178-2-4-7-4-3-1-6-0-5" fill="#ececec" d="m763.31 313.3-1.0591-0.1412c-1.1328-0.23076-1.5266 1.083-2.3656 1.9271-1.3479 1.3559-3.5035 2.8382-7.2014-0.51498-0.40694-0.36899-1.6945 0.63546-1.6945 0.63546l2.2594 2.1888 2.7889 0.98848 2.5065-0.14121 2.5418-1.4121 1.9417-2.6124 0.28242-0.91788z"/>
+ <path id="path4096-7-7-8-2-3-8-4-4-5-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m761.5 309.86c0.68224 0.0792 1.3052 0.22919 1.7834 0.58236s0.79121 0.92635 0.86293 1.6015c0.14342 1.3503-0.54968 2.4588-1.7258 3.8773-1.1762 1.4184-2.8737 2.6019-4.9187 2.8244-2.0449 0.22259-3.9892-0.55594-5.4364-1.6888s-2.4454-2.6098-2.5888-3.96c-0.0717-0.67506 0.12465-1.27 0.51775-1.718 0.3931-0.44797 0.93203-0.73665 1.582-0.96089 1.3-0.44849 3.2515-0.12671 [...]
+ <g id="g4173-3-5-9-6-1-7-78-0-9" transform="matrix(-1 0 0 1 1481.5 0)" stroke-width=".69744">
+ <path id="path4125-7-8-7-5-5-8-8-9-1" d="m728.1 314.31c0 1.7212-1.3363 3.1164-2.9848 3.1164-1.6484 0-2.9848-1.3953-2.9848-3.1164 0-1.7212 1.3363-3.1164 2.9848-3.1164 1.6484 0 2.9848 1.3953 2.9848 3.1164z" fill="#806600"/>
+ <path id="path4149-3-9-3-5-9-3-0-4-3-7" d="m725.12 313.12c-0.55544 0-1.0625 0.47416-1.0625 1.1875s0.50706 1.1875 1.0625 1.1875 1.0312-0.45086 1.0312-1.1875-0.47581-1.1875-1.0312-1.1875z" transform="matrix(1.4583 0 0 1.2531 -332.36 -79.576)" fill="#540"/>
+ <path id="path4149-0-0-6-54-5-2-7-5-5" d="m725.12 313.12c-0.55544 0-1.0625 0.47416-1.0625 1.1875s0.50706 1.1875 1.0625 1.1875 1.0312-0.45086 1.0312-1.1875-0.47581-1.1875-1.0312-1.1875z" transform="matrix(1 0 0 .89401 0.923 32.601)" fill="#fff"/>
+ </g>
+ </g>
+ <path id="path11486" d="m1146 576.53s1.5711-9.8146 4.6817-13.449c1.368-1.5986 2.4673-2.045 4.4111-2.8502 2.7491-1.1387 6.1572-2.4857 9.0491-3.1862 2.5245-0.61145 5.1512-1.3421 7.7271-1.0079 5.2727 0.68418 14.766 6.0315 14.766 6.0315s8.5553-5.6595 13.438-8.063c4.8028-2.3641 15.118-6.0473 15.118-6.0473s4.3779 3.1047 8.0788 4.7192c4.8548 2.1179 15.454 3.6956 15.454 3.6956l0.3359 21.837-22.509 4.7034s-6.418-5.1362-10.079-6.8434c-6.0019-2.7988-11.82-3.325-18.412-2.695l-9.553 0.91293 [...]
+ <path id="path11490" d="m1174.7 554.04 8.2882 3.0878c9.0393-6.246 18.701-11.192 28.928-15.114l-7.9632-4.2254c-10.651 3.7248-20.043 9.8674-29.253 16.251z" fill="#f8f8f6"/>
+ <path id="path11492" d="m1167.4 619.4s9.2542-1.3578 13.375-3.0868c2.7147-1.1391 4.8865-2.5392 7.0747-4.5088 2.4651-2.2188 4.8222-4.4439 5.8551-7.5956 0.8816-2.6899 0.7814-5.9926-0.5843-8.472-0.8739-1.5866-3.8101-3.2135-3.8101-3.2135 19.774-2.2398 13.619 19.211 0.5137 24.924-7.4473 3.2464-14.532 3.0279-22.424 1.9527z" fill="#f0f0ec"/>
+ <path id="path11498" d="m1142.3 582.95s3.6429-2.5638 5.7319-3.2334c2.6275-0.84216 8.2304-0.88184 8.2304-0.88184-6.9537-3.1607-6.5635-8.4498-6.0258-15.285l-2.4248 6.3809-1.3965 7.4345-4.1152 5.585z" fill="#f0f0ec"/>
+ <path id="path11506" d="m1151.1 563.18s5.1647-2.1444 7.8874-2.1235c3.3126 0.0254 6.6184 1.1987 9.5558 2.7302 3.4099 1.7779 8.9492 7.2806 8.9492 7.2806h17.292s-8.6895-7.0462-13.5-9.8592c-3.789-2.2159-11.983-5.4605-11.983-5.4605s-6.6271 1.4226-9.8592 2.4269c-2.3226 0.72172-6.8256 2.5786-6.8256 2.5786l-1.5168 2.4269z" fill="#fff"/>
+ <path id="path11769" d="m1120.7 769.09 14.421 8.2878h0.9945l1.8233-0.99453 4.4754-8.6193 5.6357-7.6247 3.9781-4.3096 3.9781-2.1548c-10.177-1.3671-16.925-0.44122-21.548 12.763l-12.266-6.6302-1.4918 9.2823z" fill="#d5d5d0"/>
+ <path id="path10748-7-37" d="m1385.4 1150.2c-6.6679-3.7977-13.944-6.126-19.952-10.776-9.137-17.587-19.647-35.174-37.335-52.76l-18.291-17.244s3.1602-17.941 2.6706-28.04c-1.147-23.658-9.9075-94.46-30.026-101.95-5.0529-0.18226-6.8829 2.4693-11.664 8.3951-6.2981 7.8067-14.608 18.786-19.067 38.804-1.9383 8.7022-2.6548 20.472-2.0029 29.375 1.4824 20.246 4.3158 32.376 11.352 51.418 4.4513 12.046 11.037 24.877 20.026 34.048 11.226 11.455 28.625 15.932 40.06 27.367 0 0 17.462 14.805 24.0 [...]
+ <path id="path10748-7-90" d="m1040.4 837.64-17.251-50.835s-2.0858-4.059-1.592-6.1762c0.5865-2.5147 2.1399-3.1478 3.9658-4.9737 1.527-1.527 3.1712 0.60246 6.6663 2.6509 6.5573 3.843 17.802 11.001 28.246 20.39 15.258 13.717 28.16 30.3 45.877 41.935 11.949 7.8477 27.158 15.823 38.777 16.005 5.1936 0.0813 10.472-10.035 10.472-10.035s-0.1295-6.3085 0.9757-9.1806c1.4313-3.7195 3.6984-6.2142 6.7393-8.7903 2.1663-1.8352 5.307-3.5574 7.9112-4.6882 3.3449-1.4524 7.1549-1.8894 10.255-3.809 [...]
+ <path id="path10748-7-90-2" d="m1043.3 836.25-6.1774-8.2817-13.97-41.168s-2.0858-4.059-1.592-6.1762c0.5865-2.5147 2.1399-3.1478 3.9658-4.9737 1.527-1.527 3.1712 0.60246 6.6663 2.6509 6.5573 3.843 17.802 11.002 28.246 20.39 15.258 13.717 28.16 30.3 45.877 41.935 11.949 7.8477 27.158 15.823 38.777 16.005 5.1936 0.0813 8.3421-5.6951 10.472-10.035 1.356-2.7626-0.1295-6.3085 0.9757-9.1806 1.4313-3.7195 3.6984-6.2142 6.7393-8.7903 2.1663-1.8352 5.307-3.5574 7.9112-4.6882 3.3449-1.4524 [...]
+ <path id="path11494" d="m1153 574s-0.4191-5.3827 1.227-7.1574c0.9556-1.0303 2.6918-1.6991 4.0899-1.8405 1.5614-0.15787 4.2698 0.43747 5.726 1.0225 3.4511 1.3865 8.7933 7.3619 8.7933 7.3619s-11.175 1.7806-16.173 1.664c-1.6434-0.0383-3.6628-1.0504-3.6628-1.0504z" fill="#d5d5d0"/>
+ <path id="path11496" d="m1155.1 572.75c-0.3169-9.4891 8.2175-4.9856 11.941-0.58533-4.1766 1.2899-7.7408 1.7246-11.941 0.58533z" fill="#918a6f"/>
+ <path id="path11502" d="m1247.5 547.86c23.004 8.9919 43.978 3.1558 51-20.238-14.6 19.416-31.942 22.217-51 20.238z" fill="#f0f0ec"/>
+ <path id="path11504" d="m1248.5 552.13c18.178 49.477 63.414 26.545 51.808-19.428-14.023 27.342-32.6 25.411-51.808 19.428z" fill="#fff"/>
+ <path id="path11508" d="m1190.1 562.85c7.7754 3.8863 15.929 7.5835 20.62 13.012l24.824-6.6062 0.8008-10.81s-9.7075-1.5513-14.214-3.4032c-2.3816-0.97881-6.6062-4.0038-6.6062-4.0038-8.4747 1.2347-16.949 7.0638-25.424 11.811z" fill="#fff"/>
+ <path id="path11510" d="m1238.1 509.88s13.384 2.2802 18.405 8.6765c1.695 2.1592 4.9956 11.569 4.9956 11.569 18.593 1.0768 28.841-5.1646 37.32-10.156-14.325-24.44-40.372-23.808-60.72-10.089z" fill="#fff"/>
+ <g id="g11644" transform="translate(1.1704)" stroke-width="1.5">
+ <path id="path11542" d="m1284.3 490.37-1.3179-9.3902-2.4711-10.049-5.2717-12.85s-1.3243 13.074-0.8237 19.439c0.3269 4.1566 2.3064 11.861 2.3064 11.861l4.2832 1.3179 3.2948-0.32948z" fill="#bbb6a5"/>
+ <path id="path11536" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1275.2 457.55s1.4396 5.3342 2.2135 7.3853c1.8309 4.8528 3.3401 9.8248 4.5 14.875 0.7309 3.182 1.4379 8.8841 1.5626 9.875-2.3937 0.67542-4.7875 0.0446-7.1812-0.90262 1.4056 1.3752 2.2202 2.1519 3.8263 2.4026 1.6061 0.25072 3.2798 0.43185 4.9348 0.32126l0.7813-0.0312-0.094-0.8125s-1.0934-7.2195-1.933-10.875c-1.1762-5.1212-2.5394-10.742-4.9908-15.384l-3.6195-6.8541z" fill="#918a6f"/>
+ </g>
+ <path id="path11546" d="m1214.4 594.6 0.8855 8.8554c12.478-5.6132 25.115-6.5773 38.373-3.5422l-5.018-8.265c-12.284-0.75611-23.528 0.56705-34.241 2.9518z" fill="#f0f0ec"/>
+ <path id="path11723" d="m1316.7 508.77c24.487 17.942 35.812 38.823 38.231 68.167 0.8529 10.348-1.8495 21.782-4.409 31.845-2.9585 11.632-8.2843 23.352-15.029 33.279-10.254 15.093-24.898 28.858-36.5 42.941-9.4201 11.434-19.371 22.631-26.838 35.427-7.2705 12.459-11.032 25.595-13.956 39.721-2.9734 14.367-4.2368 27.231-3.2206 41.868 1.0761 15.499 3.5161 28.128 6.4412 43.387 3.3988 17.73 11.328 41.807 18.988 58.154 5.8614 12.509 19.946 51.965 15.312 51.965l-21.939-10.533s-6.8901-24.36 [...]
+ <path id="path11906" d="m1193 807.85c31.648 11.671 55.261-5.8155 64.853-24.237l1.8697 32.366c-17.81 16.83-37.943 20.484-64.349 18.77l-2.374-26.899z" fill="#f0f0ec"/>
+ <path id="path10748-7-2" d="m1368.3 1283.6c1.9692-18.601 0.6007-38.03 3.705-56.714 1.9438-11.699 4.4927-32.173 9.0815-46.49 4.901-15.291 11.193-25.26 11.193-25.26h0.0004c8.3956 7.4999-3.4123 25.82-5.4776 37.131-3.8211 20.927-7.0039 39.211-8.8957 60.4-1.3033 14.598 1.4538 32.24-2.4101 46.377-1.6594 6.0713-4.1126 36.004-8.4183 42.201-2.8139 4.0501-7.4735-15.443-9.5657-11.902-2.3279 3.9405-11.864 1.3046-15.145 1.9233-6.7093 1.2652-12.252 5.5483-13.517 12.465-0.784 4.2877-0.5132 8.0 [...]
+ <path id="path11837" d="m1185 752.27c0.6677-9.6692 8.0194-18.933 11.911-27.809 6.0225-13.737 7.2146-20.536 18.37-30.562 13.542-12.171 32.953-21.214 47.664-31.944 13.085-9.5443 25.783-20.129 35.787-32.866 7.0845-9.0198 16.607-30.135 16.607-30.135s13.241-13.257 16.861-19.115c4.4521-7.2036 4.8783-41.231 4.8783-41.231 16.116 30.616 13.076 51.119-4.9412 88.505-8.551 17.744-25.602 29.438-38.708 44.146-12.488 14.014-27.764 27.216-36.518 43.821-5.9233 11.236-9.1864 21.667-10.225 34.326- [...]
+ <path id="path11883" d="m1145.4 820.64c4.5808-4.5375 10.044-8.6379 16.36-9.9327 5.9177-1.2131 12.472 1.7927 18.45 0.92139 5.485-0.79955 15.776-5.2585 15.776-5.2585s-8.9448-20.215-11.101-30.967c-2.2244-11.09 4.6743-52.001 4.6743-52.001-33.902 15.24-24.706 42.118-37.978 67.776-2.9053 5.6167-11.738 12.416-16.944 8.7642l-22.492-15.776c-13.548-9.5027-31.37-20.594-47.476-24.396-11.752-2.7743-46.018-1.5672-46.018-1.5672 25.12 7.9539 50.454 26.98 69.719 44.739 12.115 11.168 24.777 25.24 [...]
+ <path id="path11900" d="m1028.8 871.6s2.9594-3.7938 5.0635-5.1725c2.1158-1.3863 9.3268-2.0716 9.3268-2.0716 0.2906 0-0.554-6.348 2.4958-9.3649 2.3478-2.3224 6.5539-1.6007 5.6291-4.0449-0.9045-2.3906-15.282-1.369-16.498-4.4729-3.1517-8.0435-7.1833-18.178-11.231-28.824-6.121-16.098-9.88-25.428-13.092-38.415-0.8042-3.2518 4.0244-11.171 6.1367-13.771 2.0766-2.5558 21.856-1.5774 21.856-1.5774s-25.287-11.679-29.472-10.537c-3.7897 1.0342-8.421 3.8213-10.123 7.3619-1.7274 3.5941-2.211 9 [...]
+ <path id="path11902" d="m1143.9 815.42c-3.9322 2.7853-6.6299 11.106-8.7097 13.109-2.2201 2.1389-6.3845 0.32991-9.2024-0.92023-11.911-5.2842-20.307-19.623-30.304-27.982-8.4723-7.0844-13.917-15.073-23.156-21.123-7.4653-4.8883-29.607-15.954-29.607-15.954s18.82 1.9858 25.905 4.6012c10.555 3.896 22.87 10.575 32.668 16.104 8.7506 4.9385 17.863 9.4397 25.767 15.644 3.4123 2.6786 8.176 8.8682 12.051 6.9237 6.4176-3.2205 11.008-6.267 16.583-13.714 2.4991-3.3379 4.6614-7.6138 8.4823-10.3l [...]
+ <path id="path11904" d="m1190.9 743.88s-14.7 2.5088-17.747 8.2822c-7.9677 15.095-13.314 36.504-10.648 44.96 2.5879 8.2109 9.862 5.597 18.339 7.099 4.2718 0.75689 9.5122 0.31217 13.015-2.3663l10.057-7.6906-13.015-50.284z" fill="#fff"/>
+ <path id="path11908" d="m1211.3 839.92c11.13-0.13947 16.275 1.8983 40.445-10.747 4.5185 15.098 3.8454 6.1717 5.5784 21.592 2.2769 20.261 15.851 46.223 23.945 66.521 3.8001 9.5289 7.0609 22.796 10.306 31.888-7.0173-15.124-22.421-35.975-33.194-51.995-11.34-16.863-25.626-27.098-36.017-41.706l-11.064-15.553z" fill="#fff"/>
+ <path id="path11910" d="m1258.4 1075.8c28.398 27.344 43.108 5.0868 57.055-13.584l5.4338 12.679c-14.84 35.82-45.192 41.13-62.488 0.9055z" fill="#f0f0ec"/>
+ <path id="path11916" d="m1155.5 755.95c10.396-18.322 28.049-30.316 46.977-37.377-32.667-5.6875-46.597 6.785-46.977 37.377z" fill="#f0f0ec"/>
+ <path id="path11914" d="m1155.4 755.85c8.2729-23.354 18.032-33.427 42.372-36.535-28.232-2.7498-41.808 12.069-42.372 36.535z" fill="#d5d5d0"/>
+ <path id="path11918" d="m1244.2 813.56s6.6692 7.3764 9.9912 12.62c3.174 5.0105 8.4135 22.612 8.4135 22.612l-3.6809-44.434-14.724 9.2024z" fill="#f0f0ec"/>
+ <path id="path11920" d="m1226.3 826.05c14.862-2.5594 40.731-24.128 40.731-24.128l-0.8354-11.283s-17.017 14.912-26.901 20.217c-5.7272 3.074-11.979 5.3816-18.379 6.5163-5.3746 0.95283-12.427 1.1095-17.878 0.83543-6.0444-0.30385-15.762-3.1407-15.762-3.1407l-6.4597 4.6444 3.1857 6.969c14.165-0.66142 28.261 1.3326 42.299-0.63086z" fill="#e2e2de"/>
+ <path id="path11912" d="m1187 815c33.59 5.7689 52.473-4.267 67.557-19.158 7.8804-7.7798 14.476-17.359 23.053-27.345-2.1564 3.9311 0.7752 9.232-1.5697 12.45-26.116 35.842-59.97 45.851-89.04 34.052z" fill="#d5d5d0"/>
+ <path id="path10748-7-399" d="m1322.4 915.89c5.9477 16.852 16.62 43.487 16.62 43.487s24.283 40.25 32.92 60.155c6.4051 14.761 10.36 33.976 17.738 48.275 6.455 12.511 13.374 29.094 26.03 35.26 8.45 4.117 20.123 2.8099 28.199-2 5.6519-3.3663 10.069-10.911 11.4-17.353 2.741-13.27-0.2531-27.364-3.6152-40.491-3.133-12.233-7.5911-23.385-13.184-34.706-17.201-34.819-50.618-77.562-66.175-113.5-5.5282-12.772-10.308-21.985-15.191-38.89-3.9259-13.59-7.003-31.065-7.676-45.195-0.5858-12.299 3. [...]
+ <path id="path10748-7-27" d="m1373.7 1279.2c1.6714-15.674 0.3021-31.522 2.078-47.785 1.6155-14.794 6.4981-34.248 10.057-48.699 1.2449-5.0543 3.9759-10.021 5.3161-15.751 1.2882-5.5073 1.2108-11.881 1.2108-11.881h0.0004c8.3956 7.4999-3.4123 25.82-5.4776 37.131-3.8211 20.927-7.0039 39.211-8.8957 60.4-0.2807 15.557 0.468 32.561-0.056 48.719-0.3507 10.822-1.6345 20.902-2.8335 31.262-0.6015 3.1199-2.8708 8.7803-5.0121 11.149-1.585 1.7535-3.0999 0.4157-3.8164 1.6285-0.6159 1.0426-3.140 [...]
+ <g id="g11719" stroke-width="1.5" fill="#918a6f">
+ <path id="path11707" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1179.1 820.41c-4.1259 2.2362-8.1398 2.6875-12.5 5.1562-4.0302 2.2819-7.8022 5.6682-9.875 9.9062-0.9799 2.0035-1.449 4.8633-1.7188 7.2812-0.2697 2.418-0.3124 4.375-0.3124 4.375l1.5 0.0312s0.051-1.903 0.3124-4.25c0.2619-2.347 0.7574-5.135 1.5626-6.7812 1.8933-3.8712 5.456-7.0842 9.2812-9.25 4.0776-2.3087 8.0698-2.772 12.469-5.1562 1.5783-0.85543 3.4279-2.5856 4.9687-4.125s2.75-2. [...]
+ <path id="path11713" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1137.1 776.06-1.2188 0.78125-14.957-8.4928-1.6995 0.71158 16.344 9.3125 0.4063 0.21875 0.375-0.25 1.7187-1.125 0.1563-0.125 0.094-0.1875c2.0854-4.4954 9.1798-17.496 17.632-23.474-8.5415 1.8379-16.213 17.732-18.851 22.63z"/>
+ </g>
+ <path id="path11966" d="m1268.2 958.24c-5.4513 7.9585-7.7915 17.732-10.28 27.052-2.3556 8.823-4.2837 17.92-4.3283 27.052-0.053 10.942 1.8387 21.949 4.8694 32.462 2.6171 9.0791 5.653 18.44 11.362 25.97 3.0973 4.0849 7.0263 8.1578 11.903 9.7387 2.9215 0.9471 6.4825 0.8942 9.1977-0.541 7.0481-3.7254 9.4187-11.561 12.444-18.936 2.8266-6.8918 2.6271-14.738 2.8694-22.182 0.4172-12.818 0.2993-25.828-2.1642-38.414-1.2817-6.5485-6.4924-18.936-6.4924-18.936s1.9001 15.201-0.5411 22.183c-2. [...]
+ <path id="path11968" d="m1319.2 1086.8s14.053 12.096 19.909 19.223c9.2488 11.255 23.685 36.729 23.685 36.729l16.82 10.298s-9.1435 14.604-12.014 22.655c-1.5675 4.3964-2.7461 13.731-2.7461 13.731l-8.2384-29.864c-2.1388-7.7533-11.124-18.717-17.163-24.028-13.443-11.823-42.221-26.775-42.221-26.775s10.632-5.5946 14.417-9.2681c4.1128-3.9917 7.5518-12.701 7.5518-12.701z" fill="#fff"/>
+ </g>
+ <path id="path9845" fill="#fff" d="m1030.2 864.18 5.9305-6.354-22.027-61.422s-7.4727-15.49-7.2013-22.451c0.1604-4.1136 2.1819-8.1497 4.6597-11.437 1.5131-2.0076 8.8956-2.118 8.8956-2.118s-6.4935-3.947-10.166-2.9652c-2.7008 0.72195-6.7168 3.4723-8.0484 5.9304-1.3058 2.4107-2.6231 5.4689-1.6944 8.0484 11.229 31.188 26.563 63.615 29.652 92.769z"/>
+ </g>
+ <path id="path10748-7" d="m1328.9 1343.7c-0.784 4.2877-0.5132 8.0506-3.6027 11.841-2.9578 3.6288-12.562 6.281-12.562 6.281-0.3844-9.5017-3.6689-14.446-8.6719-16.69-6.0457-2.7118-14.601-1.4802-23.58 0.4182 0 0 1.6424-11.543 6.6316-16.74 9.9191-10.332 30.158-20.851 38.695-32.311 17.972-24.123 21.886-63.968 15.22-93.09-2.6373-11.522-5.26-17.743-11.818-27.578-4.8953-7.3414-11.48-13.601-18.541-18.894-14.868-11.146-46.774-27.505-46.774-27.505-5.7507-3.0803-10.415-11.895-14.418-17.821-17 [...]
+ </g>
+ <g id="g37670" transform="matrix(-.76668 -.64202 -.64202 .76668 1071.6 1003.8)">
+ <g id="g36720" transform="translate(-161.52 -728.22)">
+ <g id="g27217-4" transform="translate(211.14 648.81)">
+ <path id="path9304-5-2-7-9-3-3-72-2-7-9-6-9" d="m-70.141-253.26-22-55.263c5.5731-1.9725 12.068-3.0233 19.272-3.3649-2.9299 8.2556-5.9695 16.298-4.8944 22.943 6.0527-4.5332 8.0104-10.704 10.095-16.825l7.0359 24.778c-4.2705-0.74874-1.9994-1.6312-13.214-3.7571 2.2471 4.2371 7.3916 9.4694 13.063 9.9844 3.8138 0.34634 6.582-0.83181 9.0063-2.9344 1.7413-1.5105 3.3293-3.5081 3.3084-5.7585-0.012-1.2888-0.023-2.5776-0.035-3.8664-0.01-0.82799-1.0293-1.9999-1.8575-2.0115-0.7889-0.0109-1.00 [...]
+ <path id="path9304-5-2-7-9-3-3-72-2-7-9-6-28-3" d="m48.246-301.65c0.1355 1.5832-0.4059 4.1949-0.4059 4.1949s1.8872-0.6088 2.8418-0.6766c0.6748-0.0479 1.4138-0.01 2.0298 0.27062 1.6876 0.76817 3.0034 2.4584 3.6536 4.195 0.601 1.6052 0.3875 3.4725 0 5.1422-0.6019 2.5939-3.104 4.5944-2.4358 7.172l0.9472 3.6537s-2.9663-0.17755-4.1948-0.94731c-1.4752-0.92406-2.3735-2.2478-2.8418-3.9243-0.4248-1.5205 0.4213-3.2148 0-4.7363-0.2107-0.76038-0.4289-2.0408-1.2179-2.0298-0.8281 0.0115-1.849 [...]
+ <path id="path9304-5-2-7-9-3-3-72-2-7-9-6-2-7" d="m61.17-275.95c3.9419-1.8886 7.2541-5.6236 8.9384-8.7995-11.215 2.1259-8.9438 3.0084-13.214 3.7571l7.0359-24.778c2.0845 6.1205 4.0423 12.292 10.095 16.825 1.0751-6.6452-1.9645-14.687-4.8945-22.943 7.204 0.34162 13.699 1.3924 19.272 3.3649l-22 55.263s-8.0677-2.1071-12.69-2.8571l0.80681 0.10295 6.6509-19.935zm-118.45 20.582c-4.2909 0.66898-8.5771 1.3684-12.857 2.1074l-22-55.263c5.5731-1.9725 12.068-3.0233 19.272-3.3649-2.9299 8.2556 [...]
+ <path id="path9304-5-2-7-9-3-3-72-2-7-9-6-6-7" d="m-1.8692-260.18c-5.6893 0-12.801 0.5-20.268 1.25l0.38917-0.0245-1.6174-16.482v0.00004c1.7038 0.0199 2.5573 0.17466 4.6936-0.23112 0.74318-0.14117 1.4258-0.30701 1.9874-0.49677 2.6807-0.90568 4.2577-2.0562 6.3316-3.9813 1.169-1.0851 1.9502-2.6612 2.4646-4.1709 0.5925-1.7388 0.3792-4.7396 0.3792-4.7396-2.6675 1.0111-4.9869 2.3704-7.0773 3.9587-2.3627 1.7949-4.433 3.8822-6.3833 6.0894l-0.1895-29.955c2.7786 3.0655 4.7992 5.8112 7.578 [...]
+ <path id="path9304-5-2-7-9-3-3-72-2-8-5" d="m-1.6746-284.28s-3.1625 4.7096-5.1072 6.3188c-2.7006 2.2348-4.4769 4.3821-7.9459 5.44-3.463 1.0562-8.2933 1.6501-11.919 1.458-3.5066-0.18589-7.1144-1.1695-10.275-2.6508-2.747-1.2876-7.1239-5.8377-7.1239-5.8377-2.1277 2.6708-4.2362 5.348-6.8149 6.7343-3.2978 1.7729-7.1568 2.133-10.58 1.9545-6.9577-0.36286-13.449-5.5692-18.655-14.095-3.3759-7.7245-7.2589-15.547-12.108-23.75 5.5891-1.9138 12.103-2.9333 19.327-3.2647-2.9384 8.0098-5.9867 1 [...]
+ <path id="path9304-5-2-7-9-3-3-72-2-8-3-4" d="m-64.342-271.3c-5.854-1.4554-11.278-6.3312-15.754-13.659-3.3759-7.7245-7.2589-15.547-12.108-23.75 5.5891-1.9138 12.103-2.9333 19.327-3.2647-2.9384 8.0098-5.9867 15.813-4.9085 22.26 6.07-4.3982 8.0334-10.386 10.124-16.324l6.8557 25.443c-4.2826-0.72645-1.8048-2.9846-13.052-5.0472 2.2536 4.111 1.8203 8.4269 7.5083 8.9266m127.51 0.87224c5.6879-0.49969 7.0933-5.6878 9.3469-9.7988-11.247 2.0626-9.1697 4.3208-13.452 5.0472l7.2562-25.443c2.0 [...]
+ </g>
+ <g id="g30594" transform="matrix(1.0346 0 0 1.0347 194.2 728.73)" stroke-width=".96652">
+ <path id="path5631-9-3-2-9-3" d="m14.571-379.78c-4.8924 0-7.9706 0.51456-11.759 0.90718 8.7718 11.852 7.7783 12.967 8.6744 17.009-2.9657-0.33468-6.2698-1.8976-7.9573-3.054-2.4858-1.7034-4.0472-4.0012-6.0465-6.0174l0.34017 19.957c2.1879-1.7405 4.0792-3.5799 6.7436-5.1615 1.8277-1.085 4.0193-2.0486 6.92-2.7759 0.1089 6.0979-0.88337 11.618-6.2932 14.968-1.9035 1.1785-3.8384 2.1751-6.0097 2.7214-2.287 0.57541-4.332 0.76094-6.6901 0.79378-2.2378 0.031-4.649-0.188-6.8035-0.79378-1.871 [...]
+ <path id="path5631-9-7-9-3-3-1-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m57.202-350.97-0.07806-0.1305c-0.09352-1.5921 0.44538-4.3182 0.44538-4.3182 0.30001-1.357 1.4634-2.8089 2.9046-3.3306 0.77691-0.28144 1.7202-0.38951 2.5561 0.0192 0.50973 0.24929 0.92068 0.44262 1.2587 0.7939 0.338 0.35135 0.54785 0.81324 0.77457 1.4717 0.33147 0.96276 0.18715 1.9667 0.01933 2.8272-0.27681 1.4194-0.24621 2.6605 0.15491 3.6211 0.2832 0.67821 0.85317 1 [...]
+ <path id="path6497-3-9-6-1-4-4" d="m14.356-378.08c-2.3459 0.0817-5.575 0.3555-7.5227 0.57647 0 0 3.4652 5.99 4.9116 9.1232 1.0337 2.2393 2.7647 7.0008 2.8258 7.0008l-0.215-16.7z" fill="#ffefa7"/>
+ <path id="path6497-3-9-0-84-1-44-4" d="m-0.56739-360.57c0.065051-1.9152-0.42698-4.5517-0.25097-6.1418 0 0 2.8355 2.989 5.3312 4.1698 1.7836 0.84397 7.1386 2.0974 7.1386 2.1473l-12.219-0.1753z" fill="#ffefa7"/>
+ <path id="path6497-3-9-0-5-8-9-14-8" d="m29.624-360.57c-0.06505-1.9152 0.42698-4.5517 0.25097-6.1418 0 0-2.8355 2.989-5.3312 4.1698-1.7836 0.84397-7.1386 2.0974-7.1386 2.1473l12.219-0.1753z" fill="#ffefa7"/>
+ <path id="path6497-3-9-0-2-3-8-1-1" d="m-0.68082-360.19c0.065051 1.9152-0.42698 4.5517-0.25097 6.1418 0 0 2.8355-2.989 5.3312-4.1698 1.7836-0.84397 7.1386-2.0974 7.1386-2.1473l-12.219 0.1753z" fill="#e7cd54"/>
+ <path id="path6497-3-9-0-5-7-9-0-7-6" d="m29.51-360.19c-0.06505 1.9152 0.42698 4.5517 0.25097 6.1418 0 0-2.8355-2.989-5.3312-4.1698-1.7836-0.84397-7.1386-2.0974-7.1386-2.1473l12.219 0.1753z" fill="#e7cd54"/>
+ <path id="path6646-2-9-1-0" d="m-27.099-376.36 0.63249 22.453-2.7408-3.9003c-0.98497-1.4017-3.2111-2.4728-4.8491-2.3191-1.302 0.12207-2.517 0.51059-3.2678 1.5812-0.8626 1.23-0.7379 4.5328-0.7379 4.5328s-0.90822-1.0668-1.1596-1.8974c-0.30546-1.0095-0.35295-2.1372-0.10542-3.1625 0.1698-0.70337 0.53153-1.3971 1.0541-1.8974 0.51077-0.4891 1.1943-0.87415 1.8975-0.94876 2.3814-0.25288 6.3249 1.8974 6.3249 1.8974s-0.93448-5.2516-0.7379-7.4844c0.29944-3.4012 3.6895-8.8548 3.6895-8.8548z [...]
+ <path id="path6646-3-30-5-9-2" d="m56.381-376.42-0.63249 22.453 2.7408-3.9003c0.98497-1.4017 3.2111-2.4728 4.8491-2.3191 1.302 0.12207 2.517 0.51059 3.2678 1.5812 0.8626 1.23 0.7379 4.5328 0.7379 4.5328s0.90822-1.0668 1.1596-1.8974c0.30546-1.0096 0.35295-2.1372 0.10542-3.1625-0.1698-0.70337-0.53153-1.3971-1.0541-1.8974-0.51077-0.48909-1.1943-0.87415-1.8975-0.94875-2.3814-0.25289-6.3249 1.8974-6.3249 1.8974s0.93448-5.2516 0.7379-7.4844c-0.29944-3.4012-3.6895-8.8547-3.6895-8.8547z [...]
+ <path id="path6497-3-9-9-9-2-7-2" d="m-68.765-371.78c2.1882-0.84924 5.264-1.87 7.1412-2.4343 0 0-1.4193 6.4218-1.514 9.8714-0.06772 2.4656 0.55736 7.3782 0.5012 7.4023l-6.1284-14.839z" fill="#f8eca8"/>
+ <path id="path6497-3-9-9-2-2-4-5-4" d="m97.905-371.65c-2.1882-0.84924-5.264-1.87-7.1412-2.4343 0 0 1.4193 6.4218 1.514 9.8714 0.06772 2.4655-0.55736 7.3782-0.5012 7.4023l6.1284-14.839z" fill="#e7cd54"/>
+ </g>
+ <path id="path9304-5-2-7-9-3-3-72-2-7-9-6-5-9" d="m141 395.55-22-55.263c5.5731-1.9725 12.068-3.0233 19.272-3.3649-2.9299 8.2556-5.9695 16.298-4.8944 22.943 6.0527-4.5332 8.0104-10.704 10.095-16.825l7.0359 24.778c-4.2705-0.74874-1.9994-1.6312-13.214-3.7571 1.6733 3.1551 4.9531 6.862 8.8609 8.7622 0.0372 0.0181 0.0745 0.036 0.11185 0.0538 1.3069 0.62197 2.6825 1.0406 4.0906 1.1685 3.8138 0.34633 6.582-0.83181 9.0063-2.9344 1.7413-1.5105 3.3293-3.5081 3.3084-5.7585-0.012-1.2888-0.02 [...]
+ <g id="g30417" transform="translate(211.14 648.81)">
+ <g id="g7602-9-5-1-5" transform="matrix(.90724 0 0 .90724 245.48 -1273.4)" stroke-width="1.1022">
+ <g id="g9013-8-30-8-8-7" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.2045">
+ <path id="path9015-6-90-4-23-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-1-5-8-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-5-1-3-6" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-1-3-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.2045" fill="none"/>
+ </g>
+ </g>
+ <g id="g30385" transform="translate(-0.000005)" stroke-width="1.1022">
+ <g id="g7602-7-2-0-0-6" transform="matrix(.90724 0 0 .90724 166.21 -1266.2)">
+ <g id="g9013-8-3-5-4-8-0" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.2045">
+ <path id="path9015-6-9-02-1-3-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-9-8-61-7-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-9-3-4-0-3" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-1-9-5-9-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.2045" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-7-7-9-2-3-4" transform="matrix(-.90724 0 0 .90724 -169.94 -1266.2)">
+ <g id="g9013-8-3-3-3-33-9-5" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.2045">
+ <path id="path9015-6-9-6-0-6-3-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-9-5-1-8-8-2" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-9-5-5-4-6-2" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-1-8-2-8-55-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.2045" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g30407" transform="translate(-0.12)" stroke-width="1.6138">
+ <g id="g7849-3-9-6-8" transform="matrix(.61874 -.033576 .033576 .61874 128.99 -971.74)">
+ <path id="rect7802-9-2-0-5" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" fill="#f6e078"/>
+ <path id="rect7802-4-6-3-5-7" d="m-346.46 1090.7h16.902l2.1993 3.8065h-21.808l2.7068-3.8065z" fill="#f8eca8"/>
+ <path id="rect7802-1-49-0-8-8" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" stroke="#806600" stroke-width="1.6138" fill="none"/>
+ </g>
+ <g id="g7849-7-2-9-8-2" transform="matrix(-.61874 -.033576 -.033576 .61874 -132.49 -971.74)">
+ <path id="rect7802-13-3-2-7-7" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" fill="#f6e078"/>
+ <path id="rect7802-4-8-5-7-2-6" d="m-346.46 1090.7h16.902l2.1993 3.8065h-21.808l2.7068-3.8065z" fill="#ffe9a7"/>
+ <path id="rect7802-1-4-97-2-17-6" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" stroke="#806600" stroke-width="1.6138" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g11952-75-2-8" transform="matrix(.50192 0 0 .50192 -201.84 -529.21)" stroke-width="4.5049">
+ <g id="g9188-7-7-9" transform="matrix(.50554 0 0 .38692 -961.11 29.491)">
+ <rect id="rect9190-24-3-5" fill-rule="evenodd" height="59.169" width="89.493" y="823.57" x="2840.1" fill="#f6e078"/>
+ <path id="path9192-49-9-7" d="m2840.1 823.57h89.493l-89.493 59.169v-59.169z" fill-rule="evenodd" fill="#f8eca8"/>
+ <path id="path9194-9-6-6" d="m2929.6 836.05v46.683h-71.619l71.619-46.683z" fill-rule="evenodd" fill="#e7cd54"/>
+ <rect id="rect9196-6-4-2" ry="3.0061" height="63.043" width="89.493" stroke="#806600" y="821.63" x="2840.1" stroke-width="4.5049" fill="none"/>
+ </g>
+ <g id="g9198-0-92-5" transform="matrix(.50554 0 0 .38692 -961.11 29.491)">
+ <g id="g9200-1-3-4" stroke-width="4.5049">
+ <g id="g9202-6-5-3">
+ <rect id="rect9204-2-9-2" fill-rule="evenodd" ry="5.1773" height="43.637" width="70.263" stroke="#a0892c" y="831.33" x="2849.7" fill="#2d6afa"/>
+ <path id="path9206-3-7-1" d="m2918.5 873.46c-0.9358 0.93579-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57727-3.6642-1.5131-0.9357-0.93579-1.513-2.2301-1.513-3.6642v-33.282c0-1.4341 0.5773-2.7284 1.513-3.6642 0.9358-0.93579 68.172 39.675 67.237 40.611z" fill-rule="evenodd" stroke="#a0892c" fill="#2b96f6"/>
+ <path id="path9208-5-2-2" d="m2918.5 873.46c-0.9358 0.93581-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57727-3.6642-1.5131-0.9357-0.93579-1.513-2.2301-1.513-3.6642v-33.282c0-1.4341 0.5773-2.7284 1.513-3.6642 0.4751-0.47512 18.04 9.7588 35.096 20.073 16.539 10.001 32.601 20.077 32.14 20.538z" fill-rule="evenodd" stroke="#d7e3f4" fill="#5183fb"/>
+ <path id="path9210-9-4-6" d="m2918.5 832.84c0.9357 0.93579 1.513 2.2301 1.513 3.6642v33.282c0 1.4341-0.5773 2.7284-1.513 3.6642-0.9358 0.93579-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57727-3.6642-1.5131-0.9357-0.93579 66.301-41.547 67.237-40.611z" fill-rule="evenodd" stroke="#afc6e9" fill="#1353b4"/>
+ <path id="path9212-1-2-6" d="m2918.5 873.46c-0.9358 0.93579-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57725-3.6642-1.5131-0.4748-0.47478 16.6-11.163 33.661-21.457 0 0 34.512 20.521 33.576 21.457z" fill-rule="evenodd" stroke="#afc6e9" fill="#134fab"/>
+ <rect id="rect9214-9-4-6" ry="5.1773" height="43.637" width="70.263" stroke="#a0892c" y="831.33" x="2849.7" fill="none"/>
+ </g>
+ <rect id="rect9216-1-6-0" fill-rule="evenodd" ry="0" height="22.304" width="39.367" stroke="#afc6e9" y="841.29" x="2865.2" fill="#135ecb"/>
+ </g>
+ </g>
+ </g>
+ <g id="g37588" transform="translate(.0010135)">
+ <g id="g37408" transform="translate(0 .092505)">
+ <g id="g14606-9-6-40-9-9" transform="matrix(.52883 -.0084722 .0094620 .47352 -289.73 -484.06)" stroke-width="1.998">
+ <g id="g36533" stroke-width="1.998">
+ <rect id="rect9196-0-6-81-2-5" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" stroke="#806600" stroke-width="1.9992" fill="#f6e078" fill-rule="evenodd" ry="10.771" width="35.829" height="22.674" y="340.21" x="494.63"/>
+ <rect id="rect8641-5-6-9-62-9" ry="8.271" fill-rule="evenodd" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" height="16.542" width="29.954" y="343.28" x="497.57" fill="#306947"/>
+ <path id="path8643-2-3-5-96-6" d="m565.02 299.34c0.16428 1.1753-0.61499 3.213-1.9202 4.2858-2.2356 1.8375-6.0141 2.4602-9.2376 2.7557-5.1056 0.46803-8.7752-2.1575-9.2208-5.3458-0.26654-1.907 0.5917-4.4462 2.7286-5.7076 1.4358-0.84752 3.6705-1.3512 5.7223-1.5393 3.4341-0.3148 8.07 0.0272 10.463 1.8022 1.1645 0.86395 1.3193 2.7051 1.4652 3.7489z" fill-rule="evenodd" fill="#36a464"/>
+ <rect id="rect8646-7-4-5-99-2" ry="8.271" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" height="16.542" width="29.954" stroke="#a0892c" y="343.28" x="497.57" stroke-width="1.9992" fill="none"/>
+ <path id="path8648-3-4-1-80-31" d="m816.44 431.48c0 1.6327-2.5369 2.9563-5.6663 2.9563s-5.6663-1.3236-5.6663-2.9563 2.5369-2.9563 5.6663-2.9563 5.6663 1.3236 5.6663 2.9563z" fill-rule="evenodd" transform="matrix(.77012 -.070597 .13944 .99765 -131.26 -73.481)" fill="#abe8c4"/>
+ </g>
+ </g>
+ <g id="g14768-2-7-3-2" transform="matrix(-.47070 .18125 .19629 .50975 211.95 -606.43)" stroke-width="1.9051">
+ <path id="path14614-9-9-7-6-5" d="m626.17 310.88-23.701-12.771 23.701-12.082 2.8814 13.147-2.8814 11.706z" stroke="#806600" stroke-width="1.9051" fill="#f6e078"/>
+ <path id="path14614-9-3-8-2-8-3-7" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.657 8.5789-5.657 9.4386z" fill="#ff0a3e"/>
+ <path id="path14614-9-3-2-8-0-7-8" d="m626.17 307.47-17.183-9.2586 22.66-0.18009-5.4769 9.4386z" fill="#bc0028"/>
+ <path id="path14766-9-4-5-5" d="m452.4 250.56 22.953-0.0249" transform="translate(156.53 47.58)" stroke="#f4d7d7" stroke-width="1.9051" fill="none"/>
+ <path id="path14614-9-3-8-3-2-4-8-3" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.8371 8.3988-5.8371 9.6187z" stroke="#a48d2f" stroke-width="1.9051" fill="none"/>
+ </g>
+ <g id="g8305-3-71-8" transform="matrix(.54659 0 0 .54659 -75.545 -943)" stroke-width="2.0328">
+ <g id="g8172-96-6-9" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-53-13-3" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.5173">
+ <path id="path9015-4-7-4-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-2-3-61" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-1-2-6" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-84-2-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.5173" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-2-1-9" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-10-1-4" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.5173">
+ <path id="path9015-4-3-6-1-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-0-2-6" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-3-3-6" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-7-3-9" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.5173" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g8305-1-8-0-9" transform="matrix(.54029 -.082784 .082784 .54029 -200.46 -917.14)" stroke-width="2.0328">
+ <g id="g8172-5-47-0-0" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-8-9-4-4" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.5173">
+ <path id="path9015-4-2-5-5-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-9-3-7-8" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-8-3-0-6" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-2-6-1-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.5173" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-0-0-8-75" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-4-89-6-5" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.5173">
+ <path id="path9015-4-3-8-7-3-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-5-4-0-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-8-59-9-9" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-3-7-6-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.5173" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g37408-4" transform="matrix(-1 0 0 1 95.514 .092505)">
+ <g id="g14606-9-6-40-9-9-7" transform="matrix(.52883 -.0084722 .0094620 .47352 -289.73 -484.06)" stroke-width="1.998">
+ <g id="g36533-0" stroke-width="1.998">
+ <rect id="rect9196-0-6-81-2-5-7" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" stroke="#806600" stroke-width="1.9992" fill="#f6e078" fill-rule="evenodd" ry="10.771" width="35.829" height="22.674" y="340.21" x="494.63"/>
+ <rect id="rect8641-5-6-9-62-9-8" ry="8.271" fill-rule="evenodd" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" height="16.542" width="29.954" y="343.28" x="497.57" fill="#306947"/>
+ <path id="path8643-2-3-5-96-6-0" d="m565.02 299.34c0.16428 1.1753-0.61499 3.213-1.9202 4.2858-2.2356 1.8375-6.0141 2.4602-9.2376 2.7557-5.1056 0.46803-8.7752-2.1575-9.2208-5.3458-0.26654-1.907 0.5917-4.4462 2.7286-5.7076 1.4358-0.84752 3.6705-1.3512 5.7223-1.5393 3.4341-0.3148 8.07 0.0272 10.463 1.8022 1.1645 0.86395 1.3193 2.7051 1.4652 3.7489z" fill-rule="evenodd" fill="#36a464"/>
+ <rect id="rect8646-7-4-5-99-2-9" ry="8.271" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" height="16.542" width="29.954" stroke="#a0892c" y="343.28" x="497.57" stroke-width="1.9992" fill="none"/>
+ <path id="path8648-3-4-1-80-31-2" d="m816.44 431.48c0 1.6327-2.5369 2.9563-5.6663 2.9563s-5.6663-1.3236-5.6663-2.9563 2.5369-2.9563 5.6663-2.9563 5.6663 1.3236 5.6663 2.9563z" fill-rule="evenodd" transform="matrix(.77012 -.070597 .13944 .99765 -131.26 -73.481)" fill="#abe8c4"/>
+ </g>
+ </g>
+ <g id="g14768-2-7-3-2-6" transform="matrix(-.47070 .18125 .19629 .50975 211.95 -606.43)" stroke-width="1.9051">
+ <path id="path14614-9-9-7-6-5-1" d="m626.17 310.88-23.701-12.771 23.701-12.082 2.8814 13.147-2.8814 11.706z" stroke="#806600" stroke-width="1.9051" fill="#f6e078"/>
+ <path id="path14614-9-3-8-2-8-3-7-6" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.657 8.5789-5.657 9.4386z" fill="#ff0a3e"/>
+ <path id="path14614-9-3-2-8-0-7-8-7" d="m626.17 307.47-17.183-9.2586 22.66-0.18009-5.4769 9.4386z" fill="#bc0028"/>
+ <path id="path14766-9-4-5-5-6" d="m452.4 250.56 22.953-0.0249" transform="translate(156.53 47.58)" stroke="#f4d7d7" stroke-width="1.9051" fill="none"/>
+ <path id="path14614-9-3-8-3-2-4-8-3-7" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.8371 8.3988-5.8371 9.6187z" stroke="#a48d2f" stroke-width="1.9051" fill="none"/>
+ </g>
+ <g id="g8305-3-71-8-6" transform="matrix(.54659 0 0 .54659 -75.545 -943)" stroke-width="2.0328">
+ <g id="g8172-96-6-9-6" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-53-13-3-2" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.5173">
+ <path id="path9015-4-7-4-8-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-2-3-61-7" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-1-2-6-0" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-84-2-8-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.5173" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-2-1-9-6" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-10-1-4-5" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.5173">
+ <path id="path9015-4-3-6-1-7-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-0-2-6-9" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-3-3-6-7" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-7-3-9-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.5173" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g8305-1-8-0-9-0" transform="matrix(.54029 -.082784 .082784 .54029 -200.46 -917.14)" stroke-width="2.0328">
+ <g id="g8172-5-47-0-0-6" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-8-9-4-4-4" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.5173">
+ <path id="path9015-4-2-5-5-4-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-9-3-7-8-7" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-8-3-0-6-4" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-2-6-1-4-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.5173" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-0-0-8-75-3" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-4-89-6-5-1" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.5173">
+ <path id="path9015-4-3-8-7-3-2-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-5-4-0-0-7" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-8-59-9-9-7" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-3-7-6-8-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.5173" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g13378">
+ <g id="g12743-9-2-2" transform="matrix(.96018 .27937 -.27937 .96018 326.89 -312.58)">
+ <path id="rect12617-8-7-3" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429-4.6749 5.3795-4.6749z [...]
+ </g>
+ <g id="g12789-5-3-9" transform="matrix(.99770 .067810 -.067810 .99770 -.41869 -66.855)">
+ <rect id="rect12763-7-9-1" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ <g id="g12743-9-2-2-4" transform="matrix(.71365 .70051 -.70051 .71365 1160.7 -590.73)">
+ <path id="rect12617-8-7-3-7" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429-4.6749 5.3795-4.674 [...]
+ </g>
+ <g id="g12789-5-3-9-5" transform="matrix(.98850 .15124 -.15124 .98850 120.59 -215.6)">
+ <g id="g12383" transform="matrix(.94184 .33606 -.33606 .94184 478.38 -358.37)">
+ <rect id="rect12763-7-9-1-5" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4" transform="matrix(.35937 .93319 -.93319 .35937 1923.3 -488.34)">
+ <path id="rect12617-8-7-3-7-6" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429-4.6749 5.3795-4.6 [...]
+ </g>
+ <g id="g12789-5-3-9-5-8" transform="matrix(.81220 .58338 -.58338 .81220 895.11 -594.92)">
+ <g id="g12383-4" transform="matrix(.94184 .33606 -.33606 .94184 478.38 -358.37)">
+ <rect id="rect12763-7-9-1-5-8" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4-4" transform="matrix(.27695 .96089 -.96089 .27695 2110 -441.41)">
+ <path id="rect12617-8-7-3-7-6-1" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429-4.6749 5.3795-4 [...]
+ </g>
+ <g id="g12789-5-3-9-5-8-3" transform="matrix(.63296 .77419 -.77419 .63296 1398.7 -647.03)">
+ <g id="g12383-4-2" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4-4-8" transform="matrix(.77311 .63427 -.63427 .77311 1151.1 -655.56)">
+ <path id="rect12617-8-7-3-7-6-1-1" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429-4.6749 5.3795 [...]
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7" transform="matrix(.85984 .51057 -.51057 .85984 848.83 -600.49)">
+ <g id="g12383-4-2-8" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4-4-8-6" transform="matrix(.99469 .10292 -.10292 .99469 266.06 -305.24)">
+ <path id="rect12617-8-7-3-7-6-1-1-5" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429-4.6749 5.37 [...]
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3" transform="matrix(.99803 .062777 -.062777 .99803 176.23 -235.04)">
+ <g id="g12383-4-2-8-5" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12743-9-2-2-4-4-4-8-6-7" transform="matrix(.84971 -.52725 .52725 .84971 -316.38 595.27)">
+ <path id="rect12617-8-7-3-7-6-1-1-5-5" d="m1238.3 1167.7c-5.5184 0-9.9375 3.1299-9.9375 8.6483v24.688c0 5.5184 4.4191 8.8294 9.9375 8.8294h7.9375c5.5184 0 9.9688-3.311 9.9688-8.8294v-24.688c0-5.5184-4.4504-8.6483-9.9688-8.6483h-7.9375zm0.6563 8.0233h6.625c1.9185 0 3.3125 1.3326 3.3125 3.1562v19.625c0 1.8236-1.394 3.1563-3.3125 3.1563h-6.625c-1.9186 0-3.3125-1.3147-3.3125-3.1563v-19.625c0-1.8416 1.3939-3.1562 3.3125-3.1562z" stroke="#806600" fill="#e7cd54"/>
+ <path id="path12665-6-0-6-1-0-3-5-9-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m1239.1 1169.6c-5.0739 0-9.1768 3.3076-9.1768 8.7606v20.69c0 5.453 4.1029 8.7606 9.1768 8.7606h6.1828c5.0745 0 9.2011-3.3007 9.2011-8.7606v-20.69c0-5.4599-4.1266-8.7606-9.2011-8.7606h-6.1828zm0 4.0857h6.1828c3.0361 0 5.4038 1.4083 5.4038 4.6749v20.69c0 3.2666-2.3677 4.6749-5.4038 4.6749h-6.1828c-3.0366 0-5.3795-1.3978-5.3795-4.6749v-20.69c0-3.2771 2.3429-4.6749 5. [...]
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3-5" transform="matrix(.81237 -.58314 .58314 .81237 -348.55 754.77)">
+ <g id="g12383-4-2-8-5-4" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4-9" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3-1" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ <g id="g12789-5-3-9-5-8-3-7-3-5-4" transform="matrix(.37855 -.92558 .92558 .37855 -231.3 1657.7)">
+ <g id="g12383-4-2-8-5-4-1" transform="matrix(.91850 .39543 -.39543 .91850 578.52 -405.85)">
+ <rect id="rect12763-7-9-1-5-8-6-8-4-9-8" ry="4.7327" height="42.791" width="9.8596" stroke="#806600" y="1167.1" x="1262" fill="#e7cd54"/>
+ <path id="path12787-6-9-7-8-0-9-3-3-1-8" d="m1266.8 1169.4c-1.3739 0-2.4062 1.0197-2.4062 2.375v33.344c0 1.3553 1.0324 2.375 2.4062 2.375h0.375c1.3741 0 2.4063-1.0196 2.4063-2.375v-33.344c0-1.3553-1.0322-2.375-2.4063-2.375h-0.375z" fill="#ffefa7"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g42532">
+ <g id="g12745" transform="translate(-129.89 -681.95)">
+ <path id="path12742" d="m307.67 930.8-17.761 31.46s5.5356 18.007 15.049 23.035c0.85099-12.55 10.038-28.258 15.684-41.613 1.8531-4.3832-8.9288-9.1456-12.972-12.882z" stroke="#806600" stroke-width="1.5" fill="#ebd25d"/>
+ <g id="g10305">
+ <path id="path10163-3" d="m87.423 1156.8c4.0377-1.686 8.7442-2.4342 13.037-3.1113 9.0231-1.4233 17.791-4.0109 25.307-9.2024 13.467-9.3023 22.798-23.995 30.675-38.343 10.269-18.708 15.105-42.614 23.773-62.116 6.2297-14.017 12.269-24.298 18.514-36.39 3.7324-7.226 13.629-16.638 13.629-16.638s-6.5111 18.533-7.4183 27.995c-1.2067 12.585-2 23.286-2 35.928 0 12.944 4.2791 28.09 2 40.831-2.5993 14.532-7.9578 28.764-15.352 41.54-5.2599 9.089-12.599 16.925-20.18 24.192-5.2658 5.0472-15.382 1 [...]
+ <g id="g10281">
+ <path id="path10163-3-9-8-0" d="m93.594 1154.8c-2.7429 1.1453-12.626 5.732-13.818 8.4455-2.9023 6.6071 0.07996 10.62 3.8918 12.108 3.4594 1.3499 8.3747-0.025 12.563-5.1535 0.57623 8.8733-4.0055 14.991-10.037 17.412-7.3921 2.967-16.056 1.9646-20.975-7.9113-4.5981 8.8519-4.0492 13.25 0.04581 16.767 3.8263 3.2866 8.0107 3.6083 12.262 7.4665 4.1161 3.7358 6.609 7.153 4.9006 14.936-2.4725-3.9019-5.7192-8.314-10.196-8.358-8.5089-0.084-16.738 2.4344-22.045-0.7208-7.8211-4.6495-8.576-10.0 [...]
+ <path id="path10201" d="m89.893 1028.2c2.5385-4.9444-0.91728-9.3522-3.8234-12.044-3.2194-2.9822-6.5943-3.8587-18.461-1.0261 7.0249-14.507 22.122-18.979 33.567-14.242-11.714-15.655-20.841-30.083-8.2383-47.589 4.327 13.19 8.4719 19.492 22.991 21.823-3.7476-22.319-17.621-34.836 0.58428-57.639 0.34506 15.646 5.951 24.603 23.619 25.066-3.802-18.202-13.448-34.593 6.9821-54.279-7.0175 29.441 15.802 16.653 20.844 34.487 0 0 13.953-24.336 16.732-38.08 3.3959-16.794 0.78505-31.69-7.8524-41. [...]
+ <path id="path10163-3-9-7" d="m213.55 806.59c-5.7699-17.252-14.423-33.445-22.23-51.68-7.7987-18.217-2.2336-36.839 19.8-37.62-9.4574-11.173-21.561-15.054-31.977-12.644-10.188 2.3576-16.583 7.5662-20.161 14.486-7.5753 14.651-2.5668 36.778 5.4827 54.329-6.6271-2.1482-13.733-5.5091-17.281-9.7022-10.229-12.089-6.6585-29.234-9.5886-45.88-3.256-18.497-14.743-32.963-32.696-38.478-9.143-2.809-24.982-2.0687-33.824 3.9877-5.3971 3.6971-7.6234 8.8801-8.5358 15.358-1.4546 10.327 3.4118 20.367 [...]
+ <path id="path10425-9" d="m91.471 716.83c0.83465-3.2405 2.3428-5.8962 4.2787-8.0256 3.9552-4.3505 9.6957-6.5037 15.124-6.9569 7.3554-0.61411 15.187 2.0207 20.843 7.5904 2.4373 2.4001 4.4218 4.4628 5.5821 8.0216 0.55767 1.7105 0.65898 4.5645 1.0311 6.46l2.0768 25.238c-3.8007-1.7241-5.9291-7.6072-11.773-15.085-4.1357-5.2923-9.8444-7.6532-19.612-6.7912-5.5938 0.49367-11.412 4.5796-17.735 26.865 0 0 2.6221-26.365 2.4237-28.624-0.26506-3.0175-2.2403-8.6926-2.2403-8.6926z" fill="#dfc64f"/>
+ <path id="path10425" d="m91.471 716.83c0.83465-3.2405 2.3428-5.8962 4.2787-8.0256 3.9552-4.3505 9.6957-6.5037 15.124-6.9569 7.3554-0.61411 15.187 2.0207 20.843 7.5904 2.4373 2.4001 4.4218 4.4628 5.5821 8.0216 0.55767 1.7105 0.65898 4.5645 1.0311 6.46-10.3-8.708-23.341-17.488-46.86-7.0895z" fill="#d1b948"/>
+ <path id="path10166" d="m163.77 773.34c0.29927-0.89806-1.9892-5.4633-4.2869-12.352-2.0769-6.2269-4.1613-14.189-4.3487-22.599-0.13793-6.1895 0.75169-12.622 3.4281-18.783 2.2522-5.1847 7.0987-9.5572 14.414-13.138 4.747-2.3235 13.292-4.2151 22.803-0.36731 4.7598 1.9257 9.7342 5.2359 14.527 10.517v-0.19973c-6.2591-4.2755-12.852-6.516-19.038-7.0474-10.321-0.88663-19.262 3.1505-24.122 10.101-4.3155 6.1731-6.729 15.055-1.3124 32.351 2.2064 7.0456 5.7121 15.487 10.918 25.711l-12.982-4.194 [...]
+ <path id="path10168" d="m167.22 819.02c-4.0594-3.9171-7.795-6.9599-11.415-9.2491-7.9194-5.0084-15.284-6.4089-24.272-5.4634-17.366 1.8269-34.104 12.623-38.797 28.796-1.7516 6.0357-2.176 23.731 12.357 34.183 5.0419 3.626 11.884 6.3802 21.096 7.4733-6.967-2.6155-12.354-5.7754-16.483-9.1629-12.674-10.396-12.777-22.766-11.848-28.457 2.3821-14.586 17.608-24.255 34.253-26.541 12.521-1.7198 25.845 0.73754 35.109 8.4211z" fill="#f8ec9c"/>
+ <path id="path10170" d="m130.8 735.7s-2.3297 10.073-1.9768 15.155c0.31562 4.545 1.3332 9.2405 3.6241 13.179 2.4991 4.2959 6.3743 7.8365 10.543 10.543 7.2018 4.6756 15.955 6.3649 24.051 9.225 3.7004 1.3072 7.7286 1.7969 11.202 3.6241 3.1881 1.6772 6.2747 3.8095 8.566 6.5892 1.0934 1.3264 2.3062 4.6125 2.3062 4.6125s-4.3578-5.4623-11.903-8.0778c-13.592-4.712-35.308-9.0626-44.765-18.609-4.2929-4.3333-6.2407-10.713-6.5893-16.803-0.41293-7.2147 4.942-19.438 4.942-19.438z" fill="#f8ec9c"/>
+ <path id="path10173" d="m117.52 724.72s1.0971 5.1909-0.0155 13.996c-0.74371 5.8859-3.1858 18.017-2.9281 19.301 1.0427 5.1956 4.2367 9.8859 7.6614 13.93 1.816 2.1444 4.1883 3.8096 6.6167 5.2237 12.779 7.4413 30.739 10.468 43.182 18.457 2.2805 1.464 9.0544 11.144 9.0544 11.144s-4.5737-4.2709-11.551-8.6111c-5.6562-3.5182-13.489-7.0819-17.005-8.453-9.2029-3.5886-19.389-5.0181-27.86-10.099-4.0178-2.41-8.3605-5.4194-10.827-9.4026-2.2835-3.6874-4.3112-8.6027-3.8622-12.917 0.20035-1.925 2 [...]
+ <path id="path10199" d="m220.87 941.51c-26.904 22.088-43.977 49.708-55.968 84.213-3.5395 10.186-7.3414 18.983-11.613 30.193-4.4881 11.779-8.6094 27.677-14.709 38.708-6.0973 11.026-12.571 24.887-23.999 30.193-6.2191 2.8875-11.431 6.141-19.354 6.9675-6.8486 0.7144-14.993-0.062-20.128-4.645-9.664-8.6238-13.065-13.77-12.487-22.224 1.0908-15.957 16.353-30.327 30.428-45.003 6.5629-6.8433 13.028-15.667 17.357-21.299 34.868-45.375 70.52-90.904 96.742-141.86 8.1636-15.864 12.556-31.303 12. [...]
+ <path id="path10307" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m107.25 702.31-2.0158 0.41828s3.2105 3.9732 5.8908 8.5192c2.6804 4.5461 4.0763 10.142 4.9809 14.062 1.3188 5.7157 1.0042 11.931-0.69963 18.219-1.7038 6.2873-3.2673 12.663-0.9375 18.656 1.5446 3.9734 2.9754 6.3705 4.9062 8.3438 1.9308 1.9732 2.6142 3.5011 6.08 5.875 4.8481 3.3208 15.199 6.7179 23.858 10.156 8.6589 3.4383 17.319 6.9165 21.812 10.094 3.2903 2.3266 6.203 6.247 8.2812 9 [...]
+ <path id="path10163-3-9-7-3" d="m137.6 717.88c-3.256-18.497-14.743-32.963-32.696-38.478-9.143-2.809-24.982-2.0687-33.824 3.9877-5.3971 3.6971-7.6234 8.8801-8.5358 15.358-1.4546 10.327 3.4118 20.367 1.2647 30.572-1.2408 5.8974-5.6368 11.546-5.6368 11.546-0.19198 0.57593 16.298 2.4325 25.057-7.5504 4.8636-5.543 8.5794-17.557 8.5794-17.557 1.1831-3.3614 3.078-6.0297 5.3445-8.0901 4.78-4.3454 11.211-5.9456 16.107-5.726 6.1664 0.27652 13.116 3.0043 18.057 7.0084 3.1561 2.5576 5.4927 5. [...]
+ <path id="path10164" d="m135.12 707.69-4.0577-8.3183s-3.194-4.7964-5.0861-6.9584c-2.5049-2.8622-5.0803-5.7752-8.2383-7.8951-2.807-1.8842-6.1253-2.8732-9.2681-4.1192-2.2539-0.89357-4.4888-1.9222-6.8653-2.4028-3.5958-0.72721-7.3248-0.94294-10.984-0.68652-4.5442 0.31839-8.998 1.5275-13.387 2.7461-1.9876 0.55181-4.3646 0.61339-5.8355 2.0596-3.7434 3.6805-5.2033 9.5186-5.4922 14.76-0.37051 6.7218 4.3835 12.877 4.92 19.587 0.45703 5.7172-3.2037 19.545-3.2037 19.545s9.5978-7.2615 12.014- [...]
+ <path id="path9307" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m82.092 678.64c-4.3547 0.9248-7.0763 3.6026-10.467 8.6397-3.3906 5.0372-4.5647 11.465-2.6578 17.781 0.92829-5.2132-0.90018-8.7738 3.1282-15.291 3.0178-4.8823 8.6479-9.9112 12.405-10.709l-2.408-0.42098zm16.252 1.7647c-0.7503 0.0196-2.1085 0.0507-2.8487 0.125-5.9217 0.5944-10.889 2.4534-15.026 8.12-2.2069 3.023-2.8501 8.0594-3.1875 12.567-0.33744 4.508-0.73138 12.509-1.6859 15.699l-4. [...]
+ <path id="path10163-3-9-8-0-4" d="m93.594 1154.8c-1.4199 0.5929-4.7532 1.2024-7.8037 2.9025-2.8423 1.584-5.4391 4.2342-6.014 5.543-2.9023 6.6071 0.07996 10.62 3.8918 12.108 3.4594 1.3499 8.3747-0.025 12.563-5.1535 0.57623 8.8733-4.0055 14.991-10.037 17.412-7.3921 2.967-16.056 1.9646-20.975-7.9113-4.5981 8.8519-4.0492 13.25 0.04581 16.767 3.8263 3.2866 8.0107 3.6083 12.262 7.4665 4.1161 3.7358 6.609 7.153 4.9006 14.936-2.4725-3.9019-5.7192-8.314-10.196-8.358-8.5089-0.084-16.738 2.4 [...]
+ <path id="path10163-3-9-8" d="m212.36 990.96s-9.8968 9.4121-13.629 16.638c-6.2458 12.092-12.285 22.373-18.514 36.39-8.6675 19.502-13.503 43.408-23.773 62.116-7.8763 14.348-17.207 29.041-30.675 38.343-7.516 5.1915-16.272 7.8566-25.307 9.2024-18.053 2.6892-32.189-0.9342-42.724-9.9956-14.669-12.617-19.286-26.342-17.896-39.867 2.6032-25.335 15.188-36.838 28.043-48.895 4.5174-4.2368 9.1316-8.4351 13.017-13.258 3.5981-4.4668 7.5424-8.9769 9.43-14.393 0.60133-1.7255 1.0906-3.7314 0.49631 [...]
+ <path id="path10247" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m52.219 1169.8c-1.2883 2.9029-2.2355 5.9477-3 9-1.1042 4.4083-2.3616 8.9586-2.3125 13.656 0.03225 3.088 1.1734 6.8787 3.125 9.3437 2.3306 2.9437 5.2755 3.3189 8.5938 4.1876 3.7687 0.9862 7.6402 0.032 10.844 1 2.8363 0.8573 6.3386 2.1197 8.2188 4.0624 1.0697 1.1054 2.0483 2.9271 2.7188 4.4688 0.67044 1.5417 1.0312 2.7812 1.0312 2.7812l1.4375-0.4374s-0.3885-1.3158-1.0938-2.9376c-0.70 [...]
+ <path id="path10201-8" d="m101.18 1000.9c-11.714-15.655-20.841-30.083-8.2383-47.589 4.327 13.19 8.4719 19.492 22.991 21.823-3.7476-22.319-17.621-34.836 0.58428-57.639 0.34506 15.646 5.951 24.603 23.619 25.066-3.802-18.202-13.448-34.593 6.9821-54.279-7.0175 29.441 15.802 16.653 20.844 34.487l-7.2624-6.2794s-6.8649-1.0361-9.8385-2.6832c-1.538-0.85191-3.8758-3.5776-3.8758-3.5776s-2.1711 3.6271-2.3851 5.6646c-0.49683 4.7296 2.234 9.278 2.6832 14.012 0.48813 5.1446 0 15.503 0 15.503l-5 [...]
+ <path id="path10288" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m109.25 701.28c-6.983 0.82874-13.611 4.5876-17.719 12.344-0.24542 0.46337-0.30717 0.96105-0.40625 1.5312-0.09908 0.5702-0.17486 1.1526-0.1875 1.5312l1.5 0.0312c0.0076-0.22833 0.06712-0.76826 0.15625-1.2812 0.08913-0.51299 0.26772-1.0682 0.28125-1.0938 5.1889-9.7973 14.375-12.758 23.188-11.469 8.813 1.2891 17.114 6.9336 20.188 14.281 0.67479 1.6132 1.1162 3.3078 1.25 5.0625 1.4115 0 [...]
+ <path id="path10253" d="m40.389 1173.7s0.7827-8.0577 2.0927-11.091c1.31-3.0336 0.7591-3.7852 5.0225-6.9059s14.858-6.6966 14.858-6.6966-7.5527-0.1858-12.138 0.6278c-4.585 0.8136-5.3947 0.9201-7.5337 2.5112s-4.1106 4.1128-4.6966 7.9523c-0.58603 3.8395 2.3947 13.602 2.3947 13.602z" fill="#f6e078"/>
+ <path id="path10255" d="m74.709 1154.7c-2.3372 0.5833-4.8918 1.4458-6.1192 3.0513-2.4093 3.1518-3.3481 7.5542-2.9593 10.384 0.45758 3.3302 2.5669 7.5436 6.0242 9.5863 1.7488 1.0333 3.8317 1.5126 6.1934 1.0449-6.2174-5.6981-11.557-12.224-3.139-24.066z" fill="#f6e078"/>
+ <path id="path10279" d="m186.74 825.8c18.304 30.08 12.504 56.376 0.49664 87.905 14.877-23.481 30.311-59.046 12.416-95.851-11.079-4.1258-12.216 1.6897-12.913 7.9462z" fill="#f8ec9c"/>
+ </g>
+ <g id="g10221">
+ <path id="path10163-3-9-1-7" d="m263.14 1137.6c-3.5662 6.4816-5.9822 13.311-6.9535 20.623-0.92953 10.155 5.8702 15.881 8.1815 23.382 1.3915 4.5161 1.1162 6.5438 0.26919 9.617 7.1356-4.2367 7.1674-6.8983 8.1007-10.932 1.6401-7.0886-1.0609-12.893 3.6944-18.954 0.74377 8.8038 4.7511 14.053 11.642 19.04 0 0-2.3585-9.7092 0.80337-13.344 4.4728-5.1411 10.596-8.0984 14.671-13.062 4.5546-5.5478 6.5498-13.229 0.81975-21.717 0 0 8.1069-5.3818 9.9985-11.839 1.7994-6.1424 0.22622-13.375-2.848 [...]
+ <path id="path10303" d="m189.51 1025.3s13.076-23.552 15.511-26.533c2.7958-3.4242 8.9952-9.7448 8.9952-9.7448l6.7464-47.974s-10.146 9.3883-14.826 14.464c-3.4458 3.7364-9.7311 11.739-9.7311 11.739 27.143-15.033 2.6554 34.599-6.6949 58.05z" fill="#d1b948"/>
+ <path id="path10163-3-9-3-8" d="m326.99 673.86-16.253 0.31798-18.434 30.645c-4.3289 7.1965-13.376 59.762-24.164 109.5-5.1242 23.624-10.641 46.61-16.231 63.792-7.1133 21.862-18.81 44.868-31.013 62.964-0.23269 0.34506-6.9171 17.055-8.3444 26.201-1.2176 7.802-0.1914 23.68-0.1914 23.68s-6.5111 18.533-7.4183 27.995c-1.2067 12.585-2 23.286-2 35.928 0 12.944 4.2791 28.09 2 40.831-2.5993 14.532-7.9578 28.764-15.352 41.54-5.2599 9.089-12.278 17.276-20.18 24.192l-15.906 13.92s12.964-6.385 2 [...]
+ <path id="path10163-3-7" d="m424.82 784.13c-8.6135-2.3097-17.233-5.9848-22.221-12.058-6.8254-8.3112-9.5152-27.28-14.308-38.314-10.77-24.797-29.521-60.312-29.521-60.312l-48.035 0.73765-18.434 30.645c-4.3289 7.1965-13.376 59.762-24.164 109.5-1.0993 5.0683-2.2167 10.107-3.3491 15.066 0 0 4.7148-4.5236 6.7176-7.0905 2.8222-3.6172 7.3893-11.612 7.3893-11.612l0.21112 8.445s7.242-3.7735 10.134-6.9671c3.7607-4.1529 7.4023-8.7992 9.0783-14.145 0.56881-1.8144 0.21112-6.756 0.21112-6.756s9.2 [...]
+ <path id="path10163-3-9-3" d="m320.18 673.86-9.4478 0.31798-18.434 30.645c-4.3289 7.1965-13.376 59.762-24.164 109.5-5.1242 23.624-10.641 46.61-16.231 63.792-7.1133 21.862-18.55 44.092-31.013 62.964 0.0272-0.43038-6.9171 17.055-8.3444 26.201-1.2176 7.802-0.1914 23.68-0.1914 23.68s-6.5111 18.533-7.4183 27.995c-1.2067 12.585-2 23.286-2 35.928 0 12.944 4.2791 28.09 2 40.831-2.5993 14.532-7.9578 28.764-15.352 41.54-5.2599 9.089-12.599 16.925-20.18 24.192 0 0 7.143-3.4969 10.885-6.4058 [...]
+ <path id="path13058" d="m299.17 961.73 7.8943-21.861s-6.6373 7.7327-10.931 7.0846c-6.3469-0.95807-12.347-14.776-12.347-14.776 0.23156 13.328 4.4303 22.187 15.384 29.553z" fill="#ebd25d"/>
+ <path id="path12926" d="m295.72 802.22s1.7454 4.1804 2.9084 8.632c0.7078 2.7092 1.1999 5.962 0.95152 7.1522-1.0055 4.8186-3.7337 8.7783-4.3932 13.656-0.44271 3.2745-0.18946 6.84 1.1875 9.8438 1.244 2.7136 3.727 6.7379 6.0312 8.625 8.2656 6.7692 18.822 8.5075 29.594 7.625-3.393 25.371-9.8186 24.722-26.969 52.406-11.043 17.827-15.906 42.062-15.906 42.062s1.9162 2.6973 3.0625 3.9062c1.3289 1.4015 4.375 3.8125 4.375 3.8125s6.1089-21.252 10.92-29.67c4.8108-8.418 8.4072-15.463 16.156-21 [...]
+ <path id="path12932" d="m302 810.47s0.79438 5.993 0.40625 8.9688c-0.53896 4.1321-3.6371 7.7719-3.75 11.938-0.0682 2.5184 0.25313 5.3846 1.875 7.3125 2.5108 2.9845 6.8091 4.1715 10.656 4.8125 4.4203 0.73648 9.1612 0.13515 13.406-1.25 12.463-4.0666 23.807 3.395 23.969 16.219-1.016 6.0298-3.5789 11.765-6.2812 17.25-2.4082 4.8883-5.8926 7.339-9.3909 11.517-5.6491 6.747-13.11 11.424-18.797 18.139-5.5623 6.5684-10.409 13.861-14.125 21.625-4.2228 8.8218-9.0938 27.906-9.0938 27.906l2.75 2 [...]
+ <path id="path10163-3-9-0" d="m524.71 814.59c10.997 8.9556 7.7281 13.438 9.9134 17.575 0.89744 1.6988 3.8805 4.2135 7.3162 5.581-16.024 4.2005-24.833 2.6523-37.277-9.3485 2.1434 8.9954 3.8833 15.28 10.809 21.677 0 0-12.971 1.5635-20.8-0.75956-6.7371-1.9991-20.216-13.205-20.216-13.205 0.0433 8.3417 2.738 14.031 8.8676 19.749-14.473-0.57347-25.02-3.1952-32.643-16.124-2.0327-3.4476-5.7307-3.508-5.7307-3.508 5.604 11.179-5.7532 13.172 5.3169 23.137-19.026-1.1372-21.038-2.9639-38.153-2 [...]
+ <path id="path10163-3-9-0-2" d="m524.71 814.59c10.997 8.9556 7.7281 13.438 9.9134 17.575 0.89744 1.6988 3.8805 4.2135 7.3162 5.581-16.024 4.2005-24.833 2.6523-37.277-9.3485 2.1434 8.9954 3.8833 15.28 10.809 21.677 0 0-12.971 1.5635-20.8-0.75956-6.7371-1.9991-20.216-13.205-20.216-13.205 0.0433 8.3417 2.738 14.031 8.8676 19.749-14.473-0.57347-25.02-3.1952-32.643-16.124-2.0327-3.4476-5.7307-3.508-5.7307-3.508 5.604 11.179-5.7532 13.172 5.3169 23.137-19.026-1.1372-21.038-2.9639-38.153 [...]
+ <path id="path13060" d="m299.17 961.93 4.6556-12.752-0.40484 0.20241c-9.6583 5.5571-14.898-2.661-18.825-10.931 0.59119 11.095 5.8739 17.295 14.574 23.48z" fill="#d1b948"/>
+ <path id="path10403" d="m304.84 1038.7c-29.558 25.993-58.671 22.845-72.435 0.6853-5.6531-9.1012-7.2589-21.618-7.3854-36.377-4.0357 13.552-4.5259 26.708-0.42286 37.721 6.4355 17.274 21.292 27.974 37.907 27.965 7.3134 0 14.919-1.0934 23.235-6.31-4.865 24.955-33.653 51.328-62.476 50.046 0 0 12.722 6.686 15.922 12.621 2.9375 5.4479-5.8527 28.881-5.8527 28.881s26.09-27.507 33.696-37.696c10.715-14.355 27.274-56.302 27.274-56.302l10.538-21.234z" fill="#ebd25d"/>
+ <path id="path10163-3-9-9" d="m234.25 1305.5c-5.3428-0.7549-10.755-6.1026-15.284-12.651-10.35-14.967-11.674-37.685-11.633-55.603 0.0428-19.024-0.83875-41.683-0.83875-41.683s16.634-12.251 23.736-19.756c12.963-13.539 23.477-26.042 32.138-37.412 17.583-23.084 27.525-41.502 34.798-54.458 0 0 19.542-27.957 24.941-46.333 3.0831-10.493 3.3315-22.005 1.4461-32.778-1.5278-8.7294-4.7226-16.912-9.1586-24.584-4.4723-7.7346-9.9019-12.655-15.483-18.414-2.7488-2.8361-6.4296-4.7658-8.8261-7.9051- [...]
+ <path id="path10215" d="m282.33 1163.8c0.28941-1.8795 0.91341-3.762 1.9323-5.3676 2.6031-4.1019 8.3116-5.8757 10.306-10.306 0.97119-2.1576 0.77086-4.7439 0.42941-7.0852-1.2645-8.6703-10.702-17.127-9.2322-25.764l1.7176-10.091-4.5088 9.2322c-3.5122 7.1916 5.5793 16.269 5.1529 24.262-0.11696 2.1922-1.0995 4.297-2.147 6.2263-1.776 3.2712-5.2544 5.4498-6.8705 8.8029-0.7989 1.6575-1.2802 3.5275-1.2882 5.3675-0.008 1.9097 0.47666 3.8537 1.2882 5.5823 0.80297 1.7103 3.4352 4.5088 3.4352 4 [...]
+ <path id="path10163-3-9-1" d="m264.91 1128.5-1.7737 9.1643c-3.5662 6.4816-5.9822 13.311-6.9535 20.623-0.92953 10.155 5.8702 15.881 8.1815 23.382 1.3915 4.5161 1.1162 6.5438 0.26919 9.617 7.1356-4.2367 7.1674-6.8983 8.1007-10.932 1.6401-7.0886-1.0609-12.893 3.6944-18.954 0.74377 8.8038 4.7511 14.053 11.642 19.04 0 0-2.3585-9.7092 0.80337-13.344 4.4728-5.1411 10.596-8.0984 14.671-13.062 4.5546-5.5478 6.5498-13.229 0.81975-21.717 0 0 8.1069-5.3818 9.9985-11.839 1.7994-6.1424 0.22622- [...]
+ <path id="path10163-3-9-9-9" d="m229.94 1163.2c-12.378 13.928-31.055 26.381-31.055 26.381s-0.0695 46.769 2.8148 68.89c1.3702 10.509 3.2889 21.37 8.3653 30.673 2.995 5.4884 7.1249 10.83 12.548 13.942 3.4359 1.9716 11.638 2.4064 11.638 2.4064-5.3428-0.7549-10.755-6.1026-15.284-12.651-10.35-14.967-11.674-37.685-11.633-55.603 0.0428-19.024-0.83875-41.683-0.83875-41.683s16.634-12.251 23.736-19.756c12.963-13.539 23.477-26.042 32.138-37.412 17.583-23.084 27.525-41.502 34.798-54.458 0 0 1 [...]
+ <g id="g12928" fill="#806600">
+ <path id="path12899" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m300.56 806.62s1.611 5.1228 2.3125 8.0625c0.46505 1.949 0.85844 5.648 0.53125 7.4375-0.22286 1.2189-0.70519 2.268-1.0938 3.4375-0.38856 1.1696-0.67189 2.4898-0.3125 4v0.0312c0.98722 3.658 3.7262 5.5228 7 6.1562 3.7294 0.72163 8.2371 0.0183 12.5-0.875s8.3008-2.007 10.844-2.25c6.7371-0.64379 16.703 0.20803 23.062 4.1562 0 0 0.031 0.0311 0.0312 0.0312 0.0399 0.0291 3.4832 2.5269 6 4. [...]
+ <path id="path12920" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m284.22 929.91s-0.65337 9.403 0.65881 14.25c1.0849 4.0076 2.3494 7.2767 4.9688 10.594 1.2022 1.5224 3.3574 3.3846 5.25 4.9375s3.5 2.75 3.5 2.75l0.9-1.19s-1.6066-1.1908-3.4688-2.7188c-1.8621-1.5279-4.0081-3.4231-5.0312-4.7188-1.6127-2.0423-2.7885-4.0718-3.7416-6.6207-0.50795-1.3584-0.95265-3.1799-1.3665-4.5301-0.80984-2.6421-1.2764-7.9386-1.6757-12.755z"/>
+ </g>
+ <path id="path10163-3-9-4" d="m518.61 734.15c-2.1841-1.0183-4.1867-1.484-6.4203-0.57944-4.0573 1.6431-5.031 2.4974-6.1724 6.7234-1.7823 6.599 3.3941 15.363 3.3941 15.363 5.1592 25.151-31.849 40.416-58.732 40.924-20.327 0.38423-42.276-2.8318-56.628-15.02-11.305-9.5999-10.736-33.949-17.3-48.929-10.832-24.723-20.178-44.007-30.5-59.569l12.515 0.37749s18.751 35.516 29.521 60.312c4.7923 11.034 7.4821 30.003 14.308 38.314 8.5829 10.451 27.919 13.8 39.475 15.312 15.705 2.054 63.254-5.6479 [...]
+ <path id="path10163-3-9-4-0" d="m502.94 766.24c-2.8072 2.136-2.772 5.2486-6.2788 8.1337-3.5648 2.9328-10.688 5.6362-15.58 7.5397-14.194 5.5226-32.172 6.3576-39.012 5.463-11.556-1.5114-30.892-4.8604-39.475-15.312-6.8254-8.3112-9.5152-27.28-14.308-38.314-10.77-24.797-29.521-60.312-29.521-60.312l-8.5149-0.37749 30.444 58.724c6.8356 13.185 8.6805 29.633 17.609 41.502 3.954 5.2563 11.174 10.209 17.366 12.423 29.374 10.501 68.907 8.7816 87.271-19.47z" fill="#d1b948"/>
+ <path id="path9996" d="m538.04 742.51s-3.9489 6.4566-5.2965 10.005c-1.6696 4.3957-1.5369 7.8273-3.2368 12.211-0.8484 2.1881-2.5071 5.8173-3.9724 7.6505-2.7879 3.4879-10.299 8.3862-10.299 8.3862s5.7218-6.1321 7.5034-9.8574c3.0072-6.288 4.6794-13.341 5.0023-20.303 0.18377-3.963-0.23743-8.9095-1.9126-12.506-2.3474-5.0394-10.887-11.77-10.887-11.77s6.35 1.0728 9.2689 2.354c2.6281 1.1536 5.1303 2.7292 7.2092 4.708 2.7213 2.5903 6.6206 9.1218 6.6206 9.1218z" fill="#d1b948"/>
+ <path id="path9998" d="m533.91 789.7c7.6944-2.3795 16.774-2.8003 22.932-8.507 2.6745-3.2024 3.5138-11.466 3.5138-11.466 0.9284-4.085 7.9075-4.9421 10.726-8.1371 1.7888-2.0277 2.9045-4.7269 3.3288-7.3974 0.36002-2.2657-0.86919-7.1755-1.5289-9.3727-0.65807-2.1917-6.5621-7.9651-6.5621-7.9651 1.109 5.8211 2.7641 13.726-0.73507 18.332-5.3008 6.5159-10.631 7.1991-14.168 8.0178 0.66854 4.2423 0.29347 8.994-0.84325 11.717-2.3483 5.6256-5.0788 8.6111-16.663 14.778z" fill="#d1b948"/>
+ <path id="path10000" d="m526.26 813.97s3.164-3.5964 5.6549-4.7713c3.0744-1.4501 7.2079-2.4661 10.603-2.2973 6.507 0.32347 12.457 4.0415 18.909 4.948 2.509 0.35254 5.1055 0.62688 7.5988 0.17671 2.4973-0.4509 7.0686-2.8274 7.0686-2.8274s-4.0398 4.3532-6.3618 6.185c-1.6422 1.2956-3.493 2.3448-5.4782 3.0042-2.1866 0.72625-4.4214 1.1015-6.7152 0.88357-2.6744-0.25414-5.2659-1.1618-7.7755-2.1206-2.0917-0.79916-3.8317-2.4787-6.0083-3.0042-5.669-1.3685-17.495-0.17671-17.495-0.17671z" fill= [...]
+ <path id="path10219" d="m310.04 1120.4s0.12469-4.2317-0.021-6.5967c-0.14119-2.2921-0.37901-4.6666-1.3193-6.7616-1.1886-2.6482-2.8894-5.2031-4.7616-7.4213-2.1825-2.5859-3.6601-5.3831-6.9265-6.2668-1.108-0.2997-3.2983-0.1649-3.2983-0.1649l-4.4528 9.0704 3.7931 0.1649s3.1651 5.6052 5.6072 7.5862c1.6429 1.3328 4.136 1.2975 5.7721 2.6387 2.4662 2.0216 5.6072 7.7511 5.6072 7.7511z" fill="#f6e078"/>
+ <path id="path10435" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m291.47 1109.8s-0.97907 2.5681-0.40625 4.9063c0.57282 2.3383 1.5682 4.5055 3.5312 6.3437 1.3437 1.2583 5.0734 4.5677 6.1875 6.4063l3.4062 5.625c0.3285 0 0.69105-0.31 0.875-0.625s0.18368-0.5999 0.15625-0.875c-0.0548-0.5503-0.28033-0.4884-0.625-1.1875-0.68935-1.3983-2.2458-3.8585-3.9062-5.7812-1.6422-1.9017-5.2708-4.2253-6.0625-5.5313 0 0-0.79981-0.9252-1.5625-2.4063-0.40668-0.7897-0 [...]
+ <path id="path10163-3-9-2" d="m141.75 1181.3c-12.049 7.9054-15.729 17.25-14.082 28.053 3.9333-7.566 10.841-6.6228 18.449-4.4153-16.213 11.371-21.696 20.486-17.923 39.877 4.1777-12.683 17.898-9.6554 27.512-15.6-8.6037 17.854-21.85 21.477-24.73 32.427-1.5496 5.8927-3.132 12.607 3.6623 26.103 1.0461-5.606 2.5632-10.19 5.0522-12.521 5.0953-4.7721 12.88-4.2515 19.345-12.792 0 0 0.57208 6.819-1.5337 10.751-2.7403 5.1165-4.0537 5.3616-7.5737 9.9765-3.1905 4.1829-6.5546 11.011-7.2816 16.2 [...]
+ <path id="path10163-3-9-2-7" d="m132.25 1189.8c-4.429 5.8652-5.6626 12.36-4.5757 19.491 3.9333-7.566 10.841-6.6228 18.449-4.4153-16.213 11.371-21.696 20.486-17.923 39.877 4.1777-12.683 17.898-9.6554 27.512-15.6-8.6037 17.854-21.85 21.477-24.73 32.427-1.5496 5.8927-3.132 12.607 3.6623 26.103 1.0461-5.606 2.5632-10.19 5.0522-12.521 5.0953-4.7721 12.88-4.2515 19.345-12.792 0 0 0.57208 6.819-1.5337 10.751-2.7403 5.1165-4.0537 5.3616-7.5737 9.9765-3.1905 4.1829-6.5546 11.011-7.2816 16. [...]
+ <path id="path13054" d="m365.11 785.95s8.5986 5.1218 12.39 6.1948c5.7123 1.6168 13.845 0.51373 19.746 1.1615 29.676 12.716 100.18 8.8337 127.83-7.0047-10.432 36.829-78.492 31.867-108.07 28.6-14.592-1.6114-28.57-5.1395-40.277-8.4318-4.0831-1.3166-9.6794-3.0974-9.6794-3.0974 1.6386-5.8076-0.6916-11.615-1.9359-17.423z" fill="#f8ec9c"/>
+ <path id="path13056" d="m372.89 793.2c33.631 9.87 107.48 19.601 148.83-2.1835-34.943 31.748-121.3 17.968-148.83 2.1835z" fill="#f8f0c3"/>
+ <path id="path13062" d="m244.05 987.5c1.2243-8.0878-4.0519-20.621-2-28.54 5.5328-21.352 15.39-34.107 24.204-54.326 7.2844-16.712 20.044-56.192 20.044-56.192s11.055 9.8402 16.52 11.905c6.945 2.6232 19.705 6.7023 19.705 6.7023-3.6711 11.493-8.2399 15.306-13.526 21.424-7.2449 8.3856-15.837 13.587-25.311 20.713-4.7687 3.5869-12.874 13.21-15.319 20.117-7.7995 22.029 5.9745 40.318 11.649 60.528 4.0207 14.32 4.7071 18.534 0 32.656-1.6963 5.0888-4.6129 11.044-9.6553 12.874-8.806 3.1955-10 [...]
+ <path id="path9984" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m537.19 741.94s-3.1407 3.028-5.2947 10.511c-2.3902 8.3033-3.9592 15.294-9.6225 21.771-2.7484 3.1434-9.7703 7.6241-9.7703 7.6241 7.0139-1.9388 11.712-6.128 15.554-11.692 3.4126-4.9412 3.9676-12.548 5.883-17.683 2.6912-7.2153 3.958-8.2517 3.958-8.2517l-0.70801-2.2795z" fill="#806600"/>
+ <path id="path9986" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m557.16 780.91s-7.3076 3.49-10.264 4.4158l-17.905 5.6073s13.445-2.0416 19.234-4.1181c3.196-1.1465 10.482-4.6441 10.482-4.6441l-1.5476-1.2609z" fill="#806600"/>
+ <path id="path10301" d="m283.33 863.01c6.3321-7.3264 13.74-2.7437 12.073 6.7608-11.135 25.085-22.877 45.257-36.565 58.159 13.299-23.77 17.212-38.827 24.492-64.92z" fill="#f8f0c3"/>
+ <path id="path10399" d="m288.24 977.9c27.685 29.477 9.3452 79.757-12.736 109.93 3.8467-13.375 15.953-35.014 18.162-61.721 1.0094-12.2-0.12363-27.399-5.4261-48.211z" fill="#d1b948"/>
+ <path id="path10433" d="m221.29 1047s-2.0681 4.4403-1.4704 10.293c1.1647 11.404 5.1924 22.743 5.8815 34.186 0.23617 3.9216-2.2056 13.601-2.2056 13.601s7.4368-9.4577 7.7194-15.806c0.42684-9.5895-4.817-22.355-7.3519-31.613-1.5868-5.7957-2.5732-10.66-2.5732-10.66z" fill="#f8ec9c"/>
+ <path id="path10482" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m243.69 1319.4s0.15419 0.2395 0.375 0.5313c0.22081 0.2916 0.45563 0.641 0.8125 0.9062 2.9471 2.1905 5.0578 3.3947 8.5119 4.25 3.3959 0.841 8.3073 0.4097 11.457 0.8438 1.8976 0.2615 3.5289 0.8979 4.6562 1.4687 0.56367 0.2854 0.99932 0.5398 1.25 0.7187 0.0932 0.067 0.12413 0.1024 0.15625 0.125-0.0198-0.024-0.0296-0.061-0.0625-0.1562-0.0412-0.1188-0.0912-0.4572 0.125-0.7188 1.1356 1.6 [...]
+ <path id="path10129" d="m186.17 1185.9s-2.2917 60.97 5.4159 90.015c2.2549 8.4975 5.5786 17.374 11.795 23.59 5.8894 5.8894 12.097 8.8722 20.101 11.174 6.1938 1.7815 19.245 1.8624 19.245 1.8624s-15.932 4.5513-24.382 3.7891c-7.3879-0.6664-15.141-3.5481-20.486-8.6911-8.4052-8.0867-12.682-21.32-15.798-32.56-7.6691-27.66-8.2416-82.973-8.2416-82.973l12.352-6.2079z" fill="#f8ec9c"/>
+ <path id="path10131" d="m220.4 1123.1s4.7297 0.2707 6.3467 3.4618c1.9125 3.7742 1.6371 8.7918 0 12.693-5.7357 13.67-25.752 26.171-38.657 33.465-16.082 9.0884-44.427 14.424-44.427 14.424s30.389-13.507 43.85-23.079c9.8698-7.0177 19.736-14.792 26.541-24.81 3.2512-4.7859 6.3467-16.155 6.3467-16.155z" fill="#f8ec9c"/>
+ <path id="path10172" d="m509.34 743.11c2.7509 3.6347 5.5018 3.7954 8.2526 3.3526 0 0 2.6083 12.127 1.1628 17.436-0.70509 2.5893-7.437 13.059-12.786 19.034-8.1692 9.1242-20.32 6.9684-20.32 6.9684s9.0379-1.3792 15.423-7.6612c7.0287-6.9154 11.483-16.935 11.879-20.303 0.39502-3.359-1.8275-9.1673-3.0063-13.554-0.74252-2.7629-0.60423-5.2728-0.60423-5.2728z" fill="#f8ec9c"/>
+ <path id="path10174" d="m522.24 783.85s8.6817-8.8107 11.605-14.7c2.6088-5.2552 3.1298-13.938 6.1895-19.084 0 0 1.6741-5.2172 4.3842-7.7368 1.6893-1.5706 6.1895-3.0947 6.1895-3.0947s0.62029 3.4598 1.5474 4.9c1.252 1.945 5.1579 4.6421 5.1579 4.6421s-3.9434 2.2479-6.4474 4.3842c-2.6135 2.2297-8.7684 5.4158-8.7684 5.4158s-1.1413 12.243-3.3526 15.732c-3.875 6.1139-16.505 9.5421-16.505 9.5421z" fill="#f8ec9c"/>
+ <path id="path10176" d="m531.26 794.12s18.339 7.9541 28.12 8.5986c1.4106 0.093 4.1831-0.69719 4.1831-0.69719s-0.70312-4.8482-0.2324-7.2043c0.55014-2.7536 3.4859-7.669 3.4859-7.669s-7.6324-0.79302-11.387-0.23239c-4.9184 0.73433-9.4019 3.2563-14.176 4.6479-3.3009 0.96219-9.993 2.5564-9.993 2.5564z" fill="#f8ec9c"/>
+ <path id="path10217" d="m264.3 1163.2s0.95977-5.3614 3.65-9.447c2.7279-4.143 11.829-11.311 13.741-15.888 1.9315-4.623-1.7176-15.888-1.7176-15.888s-1.1217 10.821-3.8647 15.459c-1.8809 3.18-8.3615 11.12-10.091 14.385-2.4968 4.713-1.7176 11.379-1.7176 11.379z" fill="#f6e078"/>
+ </g>
+ <path id="path10163-3-9" d="m87.423 1156.8c4.0377-1.686 8.7442-2.4342 13.037-3.1113 9.0231-1.4233 17.791-4.0109 25.307-9.2024 13.467-9.3023 22.798-23.995 30.675-38.343 10.269-18.708 15.105-42.614 23.773-62.116 6.2297-14.017 12.269-24.298 18.514-36.39 3.7324-7.226 13.629-16.638 13.629-16.638s-6.5111 18.533-7.4183 27.995c-1.2067 12.585-2 23.286-2 35.928 0 12.944 4.2791 28.09 2 40.831-2.5993 14.532-7.9578 28.764-15.352 41.54-5.2599 9.089-12.599 16.925-20.18 24.192-5.2658 5.0472-15.382 [...]
+ <g id="g10067">
+ <g id="g10008">
+ <path id="path10002" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ <g id="g10008-7" transform="matrix(.85388 .52047 -.52047 .85388 504.9 -154.82)">
+ <path id="path10002-9" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-3" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-8" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ <g id="g10008-7-0" transform="matrix(.25016 .96821 -.96821 .25016 1155 111.91)">
+ <path id="path10002-9-2" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-3-4" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-8-8" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ </g>
+ <g id="g10283">
+ <g id="g10008-9-9" transform="matrix(.38229 .92404 -.92404 .38229 762.67 544.83)">
+ <path id="path10002-0-9" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-5-7" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-2-0" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ <g id="g10008-9-9-3" transform="matrix(-.25297 .96747 -.96747 -.25297 1106.4 1033.7)">
+ <path id="path10002-0-9-9" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-5-7-8" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-2-0-6" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ <g id="g10008-9-9-3-5" transform="matrix(-.95155 .30750 -.30750 -.95155 939.41 1902.2)">
+ <path id="path10002-0-9-9-7" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-5-7-8-6" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-2-0-6-2" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ <g id="g10008-9-9-3-5-7" transform="matrix(.41833 .90829 .90829 -.41833 -715.86 1182.2)">
+ <path id="path10002-0-9-9-7-0" d="m508.23 732.27c-1.6911 3.3072 2.2802 6.7021 6.3716 7.8708 3.9129 1.1178 12.096-0.53477 11.199-4.2778-1.4468-8.8702 3.395-16.719 9.0403-23.083-12.745-0.0133-22.327 7.9367-26.611 19.49z" stroke="#800000" stroke-width="1px" fill="#ce0f25"/>
+ <path id="path10004-5-7-8-6-3" d="m510.57 732.73c5.8311-13.271 13.829-16.464 18.182-17.628-6.87 8.4698-8.9205 16.557-9.8151 21.967 0 0-4.4394 0.39078-6.4148-0.81357-1.5212-0.92743-2.5299-2.2111-1.9523-3.5255z" fill="#e94545"/>
+ <path id="path10006-2-0-6-2-9" d="m511.92 734.16s0.83293 1.0444 1.435 1.23c0.59132 0.18226 1.845-0.205 1.845-0.205 0.82613-5.7196 6.1414-12.425 9.7898-17.375-3.9368 1.3711-9.6132 7.2443-13.07 16.35z" fill="#ee6c6c"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g41996">
+ <g id="g15597" transform="translate(-129.89 -681.95)">
+ <path id="path14997-8-0-1-9-7-9-2-9-7-8-1" d="m245.19 705.12c6.0892 6.8313-1.1407 20.036-4.8307 27.34-3.6356 7.1966-2.9897 22.691-0.24134 30.218 8.4643 23.18 4.7872 26.079 2.0328 49.802l-0.00009 0.00001c5.7545-3.2407 12.687-8.2154 14.527-23.147 9.1849 5.8188 6.2169 22.21 6.2844 32.579 8.4384-8.6931 17.123-22.57 14.211-33.99 9.0095 4.7322 7.058 12.5 6.2038 22.023 10.495-7.0897 13.159-18.909 9.2206-30.567 7.5578 5.1579 13.347 6.9396 18.371 7.266 9.1609 0.59525 15.777-3.6482 25.929-1. [...]
+ <path id="path14997-8-0-1-9-7-9-2-9-7-8-1-0" d="m387.15 647.11s-3.2945 4.7835-5.8364 5.8364c-3.2952 1.3649-7.2341 0.84169-10.7 0-5.496-1.3347-15.077-7.7819-15.077-7.7819v9.241l-14.591-10.214s1.5028 11.292 4.8637 15.564c2.3381 2.9718 7.2968 2.9397 9.7273 5.8364 2.551 3.0403 4.2593 11.119 4.2593 11.119l-10.682-2.1636 4.4596 12.259s-5.1441-4.4309-7.6138-5.0139c-3.9446-0.9312-10.55 0-10.55 0s4.7207 6.6306 6.6589 10.7c1.2175 2.5562 0.33614 6.6589 0.33614 6.6589l-9.241-5.8364v10.7s-3.517 [...]
+ <path id="path14997-8-0-1-9-7-9-2-9-7-8-1-3-0" d="m441.8 756.03 9.8422 4.4082s-6.7652 6.3734-11.243 8.4057c-6.4758 2.9392-16.14 1.5298-16.14 1.5298s1.2137 3.1224 1.9086 4.4653c1.1243 2.1725 4.0412 5.2267 4.0412 5.2267s-16.134 0.58968-23.457-2.2511c-8.0558-3.1248-20.724-15.572-20.724-15.572-1.2036 5.15 1.8597 12.951 6.3097 18.129 0 0-13.635-1.5851-19.803-3.709-5.9027-2.0327-17.634-12.989-23.765-14.165-8.7323-1.6739-15.003-1.097-15.003-1.097 15.662 8.3534 18.546 16.736 20.097 33.239- [...]
+ <g id="g12890-8" transform="matrix(-.55866 .82940 .82940 .55866 -76.085 39.139)">
+ <path id="path12883-0" d="m242.14 654.49c1.4798 5.9642 1.28 18.091 0.74556 30.308-0.32905 7.5208-2.5006 16.779-7.6438 20.175l-10.748 7.0971s4.8273 1.0637 7.5645 1.1311c1.5787 0.0389 3.261 0.10718 4.7188-0.5 5.0925-2.5407 8.0455-3.7491 10.003-7.3974-0.31193 1.321-0.43129 0.067-0.90531 1.3885 0 0 1.4013 2.7063 1.5625 4.1875 0.40034 3.6774-1.5625 11-1.5625 11 3.6509-4.0189 6.4759-7.3729 8.125-11.594 2.8581-7.3154 4.1348-16.741 2.4318-24.286-2.6462-11.723-6.6949-21.864-14.291-31.51z" [...]
+ <path id="path12877-2" d="m182.71 634.09c-6.7358-10.514-8.5954-21.5-8.1507-33.735 0 0 9.0359-3.7769 14.49-3.8489 3.7161-0.0491 10.868 2.4905 10.868 2.4905l-2.4905-3.3961-0.67922-0.45281-7.0186-2.0377-7.4715 0.90563-11.773 2.9433v13.358l1.5849 9.2827 4.7546 8.6035 5.8866 5.8866z" fill="#f8f0c3"/>
+ <path id="path12879-4" d="m244.99 707.06c5.9687-8.4694 5.0768-25.553 2.7512-34.718 6.1404 14.733 8.1618 31.206-3.0565 43.594l0.76569-3.2668 0.60111-6.5081-1.0615 0.89924z" fill="#d0b434"/>
+ <path id="path12886-8" d="m207.94 641.23c1.298 2.1907 3.6863 3.1044 5.1272 5.6502 3.7069 6.5491 6.8752 15.391 11.588 21.46 4.0536 5.2193 9.6881 8.139 12.142 12.954 1.5146 2.9724 2.4296 7.3815 2.4669 10.366 0.0293 2.3388-0.61819 5.9024-2.2372 8.0075-1.4277 1.8563-2.928 2.297-5.5397 3.7489 0 0 2.3416-4.9181 1.5082-9.5456-0.87287-4.8465-4.9481-9.4444-6.1315-10.917-3.779-4.7044-8.3144-8.7944-11.856-13.68-1.8207-2.5116-3.706-5.0728-4.788-7.98-1.2378-3.3256-1.4348-6.9609-1.824-10.488-0. [...]
+ <path id="path12888-3" d="m233.58 692.85s0.39141-4.6473 0-6.9208c-0.35763-2.0773-0.5229-4.6083-2.1147-5.9596-6.4046-5.4369-10.633-8.663-13.971-15.432-3.1965-6.4818-5.9851-16.064-9.4829-22.825-1.929 18.207 7.0923 27.736 18.071 40.371 0.9346 1.1689 3.2611 3.7598 4.3999 5.398 2.1888 3.1487 3.0977 5.3677 3.0977 5.3677z" fill="#d1b948"/>
+ <path id="path12849-90" d="m178.26 603.22c17.099-2.2553 25.785 10.401 24.189 26.293-16.907 6.5687-22.433-13.78-24.189-26.293z" fill="#d1b948"/>
+ <path id="path12849-9-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m177.72 603.47c8.156-1.0758 14.718 2.5815 18.499 7.0604 3.6257 4.2955 5.2904 10.656 4.75 17.906 0 0-3.3294 0.78273-5.0146 0.69422-3.124-0.16408-9.1104-2.2538-9.1104-2.2538 4.9518 4.5251 9.7832 6.3983 16.219 3.997l0.78125-0.34375 0.0937-0.875c0.82867-8.2545-0.95966-17.086-5.4375-22.31-5.4364-6.3427-15.178-8.2332-20.78-3.875z" fill="#a28f38"/>
+ </g>
+ <path id="path12661-8-6" d="m280.9 698.63c-4.078-2.2589-6.9821-6.5694-8.9202-10.824-2.1812-4.7884-3.2214-11.261-5.9223-15.777-3.1967-5.3448-6.7967-4.4358-11.666-8.3187-2.091-1.6675-4.6218-2.9344-6.1982-5.0948-1.7701-2.4259-3.9468-9.6182-3.9468-9.6182s-3.5223 1.8087-7.4858 2.1804c-2.8859 0.2707-6.7603-0.27433-9.2492-1.76-2.1978-1.312-4.6822-5.4256-5.8413-7.7078-1.4758-2.9058-1.0413-9.3888-1.0413-9.3888s2.0261 4.3912 3.7336 6.0236c1.6933 1.6188 3.8409 2.9505 6.1339 3.4303 3.7021 0.77 [...]
+ <path id="path14997-8-0-1-9-7-9-2-9-7-8-1-3-9" d="m442.92 692.12s9.5653-0.24571 14.066-4.1965c9.9108-8.7 11.256-18.577 9.1991-26.418-3.3537-12.785-16.953-21.243-36.608-16.031-9.3723 2.4852-23.127 15.885-23.127 15.885s-2.4454 7.8959-5.0264 10.988c-1.9454 2.3305-4.6229 4.158-7.4715 5.2074-2.9173 1.0747-6.1758 0.79537-9.2827 0.90563-2.867 0.10174-5.8159 0.4513-8.6035-0.22641-2.5255-0.61397-4.8203-2.0096-7.0186-3.3961-1.6349-1.0312-3.2317-2.1888-4.5282-3.6225-2.0499-2.2669-2.808-5.5487 [...]
+ <path id="path12598" d="m336.95 785.72s-4.2962-1.0548-6.4904-1.1126c-3.1731-0.0836-6.317 0.6512-9.4575 1.1126-2.1115 0.31025-4.1717 1.0512-6.305 1.1126-3.1729 0.0914-6.397-0.27058-9.4575-1.1126-3.655-1.0056-7.179-2.6126-10.385-4.636-2.3359-1.4744-4.474-3.3095-6.305-5.3778-3.3409-3.774-6.477-7.9285-8.3448-12.61-1.5818-3.9644-1.9542-6.8668-2.2253-11.126-0.16505-2.5939 0.046-5.0243 0.37089-7.6031 0.53638-4.2578 2.1612-10.01 2.5962-14.279 0.23179-2.2753 0.45039-4.619 0-6.8613-0.56743-2 [...]
+ <path id="path12600" d="m338.99 711.2s3.0152 4.5332 5.1362 6.1145c3.556 2.6512 7.5708 3.9622 11.984 4.4024 3.2611 0.32528 6.6087-0.1638 9.7832-0.97831 4.635-1.1892 8.4686-3.0065 12.474-5.6253 6.4682-4.2295 11.912-10.676 17.61-15.898 3.7038-3.394 7.1239-7.163 11.251-10.028 2.7262-1.8924 6.5619-3.1154 9.7832-3.9133 3.4819-0.86247 6.2202-1.1499 9.7832-0.73374 3.1622 0.36936 5.4515 0.81112 8.3157 2.2012 3.1844 1.5455 6.3091 4.7013 9.294 6.6036 2.1523 1.3716 4.3514 2.8956 6.8482 3.4241 [...]
+ <path id="path12602" d="m277.54 788.66s-6.3793-8.4872-8.3486-12.636c-1.5708-3.3092-2.4203-5.4377-3.1589-9.0255-0.85142-4.1359-1.0187-8.4147-0.90256-12.636 0.13133-4.7747 1.4341-10.116 1.3538-14.892-0.0397-2.3614-0.45495-4.7311-1.1282-6.9948-0.63348-2.1301-2.7077-6.0922-2.7077-6.0922v-0.22564s1.5414 7.8007 1.3538 11.733c-0.27475 5.7614-3.1933 12.073-3.6102 17.825-0.33237 4.5858-0.21738 8.402 0.90255 12.861 1.3282 5.2886 3.908 8.6708 6.7692 13.313 1.8244 2.9598 5.0619 6.557 6.5435 9. [...]
+ <path id="path12606" d="m321.57 713.84s1.5522 6.4675 1.5522 8.2784 5.2059 9.0768 8.5371 11.124c3.7955 2.3327 8.5373 3.1687 12.935 3.8805 6.3986 1.0357 13.529 0.47322 19.92 1.5522 4.497 0.75917 8.1563 1.2763 11.9 3.8805 2.7898 1.9405 5.2898 4.1638 6.7262 7.2436 1.9183 4.1132 2.8457 8.5203 2.8457 12.935 0 2.1576-0.29908 4.2959 0.2587 6.4675 0.97936 3.8129 5.4327 10.607 5.4327 10.607s-6.2393-5.3241-8.2784-8.7958c-1.8785-3.1982-1.9366-8.7352-3.3631-12.159-1.5725-3.7741-2.8577-6.3659-5. [...]
+ <path id="path12608" d="m294.4 717.98s-0.70524 7.2702-0.2587 10.865c0.59569 4.7961 1.5111 9.7576 3.8805 13.97 2.8414 5.0514 7.1947 9.293 11.9 12.676 3.6969 2.6581 8.7938 4.2612 13.194 5.4327 4.6021 1.2253 7.7354 0.0467 12.159 1.8109 3.878 1.5466 8.1363 4.8603 10.865 8.0197 2.1465 2.485 4.0541 5.709 5.174 8.7958 1.702 4.6912 2.587 13.97 2.587 13.97s-4.0182-8.2358-6.7262-11.9c-2.6827-3.6302-5.539-7.3547-9.3132-9.8306-2.5318-1.6609-4.5-1.9346-7.5023-2.3283-2.9184-0.38267-6.9162 0.4117 [...]
+ <path id="path12627" d="m343.23 685.06s2.5689 1.9312 3.6398 3.6398c2.4058 3.8383 3.1378 9.8743 5.6417 13.649 1.5656 2.3604 3.431 4.1259 5.8237 5.6417 3.0832 1.9534 6.5794 2.7514 10.191 3.2758 3.4949 0.50738 7.1376 0.34287 10.555-0.54597 3.8629-1.0046 6.1786-2.4645 9.4635-4.7318 1.2709-0.8772 4.3678-3.8218 4.3678-3.8218-6.3859 2.2164-11.618 3.3806-15.959 3.7516-5.118 0.43749-9.0172-0.18199-12.067-1.5702-2.1649-0.98557-4.4062-2.3238-5.8253-3.8429-2.283-2.444-3.3051-5.3563-4.963-8.021 [...]
+ <path id="path12629" d="m439.57 738.55c-0.76306-2.1158 0.19395-4.5089 1.3024-6.6207 0.86803-1.6537 2.3472-3.0685 4.0158-3.9073 2.03-1.0205 4.3512-1.8448 6.6207-1.7366 1.718 0.0819 3.2047 0.72273 4.6671 1.628 1.9186 1.1877 3.5678 3.0243 4.45 5.1012 0.82339 1.9385 0.70526 4.1952 0.54268 6.2951-0.1524 1.9684-0.37153 3.8032-1.0854 5.6439-0.65561 1.6906-1.4636 3.3665-2.6049 4.7756-1.2596 1.5552-4.5585 3.9073-4.5585 3.9073l3.6902-8.1402c1.2746-2.8117 2.1913-6.4803 1.628-9.1171-0.53066-2. [...]
+ <path id="path12631" d="m401.61 735.47s4.1592 0.52363 5.762 1.7286c1.8879 1.4193 2.9607 3.7625 3.8413 5.9541 0.75372 1.8758 1.0074 3.9378 1.1524 5.9541 0.19312 2.685-0.80514 5.4456-0.19206 8.0668 0.60046 2.5673 2.0298 4.8338 3.6493 6.9144 0.91802 1.1795 2.0622 2.1861 3.2651 3.0731 1.7769 1.3101 5.762 3.2651 5.762 3.2651s0.46127 3.0618 1.1524 4.4176c1.0536 2.0668 4.4175 5.3779 4.4175 5.3779s-7.2166-1.7223-10.564-3.2651c-3.3713-1.554-6.9338-3.1896-9.4113-5.9541-2.1403-2.3882-3.4427-5 [...]
+ <path id="path40166" d="m402.98 724.33s6.7722 0.78876 9.8727 2.0942c1.8226 0.7674 3.2519 1.8795 4.6372 3.2909 2.0734 2.1125 3.5553 4.9458 5.0859 7.4793 2.1364 3.5361 3.7254 7.4129 6.133 10.77 1.3996 1.9517 2.7817 4.063 4.7868 5.3851 3.0276 1.9964 6.9496 2.1051 10.321 3.4405 2.655 1.0515 7.7785 3.5901 7.7785 3.5901s-2.6798 2.4797-4.338 3.1413c-2.8033 1.1185-5.9582 1.2822-8.9751 1.1967-2.3851-0.0676-4.8167-0.4561-7.0305-1.3463-2.0403-0.82038-4.0416-1.9756-5.5347-3.5901-1.3482-1.4579- [...]
+ <path id="path40168" d="m384.21 735.25s4.5037 1.0232 8.4382 4.0071c2.9317 2.2233 5.5473 6.5056 5.7484 7.066 0.86189 2.402 0.12473 5.1031 0.25505 7.6517 0.12621 2.4682-0.14015 4.5022 0.51012 6.8866 0.90038 3.3014 3.4867 8.285 5.6113 10.967 2.8859 3.6437 9.6922 7.6517 9.6922 7.6517s-4.0938-0.0784-6.1214-0.76517c-2.0578-0.69695-4.3649-1.7454-5.8663-3.3158-3.1278-3.2714-7.2977-7.5777-8.3158-11.988-0.78343-3.3934-0.3332-7.2018-0.51209-11.556-0.0702-1.7084-0.8525-4.5263-0.91714-5.8912-0. [...]
+ <path id="path40170" d="m354.82 737.36s6.9628-0.14373 10.196-1.2745c3.3837-1.1834 6.387-3.356 9.1763-5.6077 3.8345-3.0955 6.4317-7.2702 10.196-10.451 3.366-2.8442 7.8777-6.2925 11.98-7.9018 3.6022-1.4131 6.5871-1.7414 10.451-1.5294 3.2516 0.17844 6.5231 1.0834 9.4312 2.549 2.3226 1.1705 4.2 3.0859 6.1175 4.843 1.5509 1.4213 3.0971 2.886 4.3332 4.5881 1.8767 2.5843 2.8344 5.7423 4.5881 8.4116 1.8945 2.8836 3.9468 5.703 6.3724 8.1567 0.38247 0.38691 1.2745 1.0196 1.2745 1.0196s-4.521 [...]
+ <path id="path12955" d="m418.34 639.34s-2.8886-2.1899-4.76-2.9209c-1.8714-0.73097-3.7257-1.3069-5.4091-1.19s-3.2686 0.35102-5.0845 1.4064c-1.816 1.0553-4.2351 3.5455-6.0582 6.1664-4.4484 6.3951-9.0934 10.485-14.55 11.092-3.6647 0.40801-7.6956-0.75456-12.279-3.8442l10.818-2.5964c5.062-1.2149 10.382-10.198 13.415-12.657 3.0329-2.4592 4.0966-3.2114 6.7073-4.0027 2.6107-0.79137 6.0057-1.0467 8.5464-0.43273 2.5406 0.61394 4.6988 1.9581 6.1664 3.57s2.4882 5.4091 2.4882 5.4091z" fill="#f6e078"/>
+ <path id="path15571" d="m434.7 685.86s-4.3936-3.1802-5.8063-5.4192c-1.3719-2.1742-1.1613-4.645-1.1613-4.645s-6.2129 2.3818-8.5158 4.2579c-3.891 3.17-10.838 8.5159-10.838 8.5159s8.087-3.3965 12.387-3.8708c4.633-0.5111 13.935 1.1613 13.935 1.1613z" fill="#d1b948"/>
+ <path id="path15458" d="m444.8 659.37s-8.0483 1.0814-10.937 3.6102c-1.9533 1.7101-2.8948 4.4612-3.3978 7.0081-0.44662 2.2613-0.66864 6.7792 0.21952 8.9062 2.2505 5.3895 11.885 11.056 11.885 11.056s-8.2399-2.4868-12.105-5.7339c-2.8496-2.3941-4.8443-5.7906-5.5215-9.4503-0.72879-3.9383 0.43613-8.2604 2.336-11.786 1.6028-2.9745 4.1754-4.8099 7.1142-6.4771 2.4491-1.3895 5.9462-2.7608 5.9462-2.7608l7.7513 2.5484-3.2917 3.0793z" fill="#d1b948"/>
+ <path id="path15456" d="m449.15 656.07c-2.7579-0.73711-6.1378 0.54971-8.1761 2.5484-1.6782 1.6456-2.1396 4.3408-2.2298 6.6895-0.0952 2.479 0.41071 5.1685 1.8051 7.2204 1.2974 1.9091 3.0985 3.5114 5.203 4.4597 2.3171 1.0441 5.7727 1.5697 8.1761 0.74328 2.3314-0.80168 3.527-2.8802 4.3535-5.203 0.73565-2.0675 0.1629-6.5574-0.6371-8.6008-1.6344-4.1748-4.1633-6.6999-8.4946-7.8575z" fill="#d1b948"/>
+ <path id="path14298" d="m450.31 661.59c-3.9851 0-7 2.7456-7 5.9062s3.0087 5.875 7 5.875 7.0312-2.7215 7.0312-5.875-3.0462-5.9062-7.0312-5.9062z" transform="matrix(.99907 0 0 1.0646 .42036 -43.609)" fill="#b39c2d"/>
+ <path id="path15573" d="m407.01 710.68s3.6469 0.50118 5.3991 1.0383c2.016 0.61799 5.8144 2.4919 5.8144 2.4919s3.1124-1.8824 5.3991-2.2842c2.9513-0.51859 6.7802-0.1088 9.7599 0.20766 3.5958 0.38189 7.1825 0.9939 10.798 1.0383 1.9429 0.0239 3.5462 0.16977 5.3991-0.41532 2.3093-0.72921 4.5415-2.0016 6.2297-3.7378 1.7717-1.822 2.9813-4.39 4.1532-6.645 0.81375-1.5659 2.2842-4.7761 2.2842-4.7761l0.20766 0.20766s-3.7792 5.3214-9.3865 8.6511c-2.214 1.3147-6.1153 2.3189-8.0568 2.5624-5.0186 [...]
+ <path id="path11767" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m402.59 635.86c-4.4805 2.708-7.3778 8.3393-10.344 12.858-2.9659 4.5188-5.9691 8.6785-10.344 10.344-3.2197 1.2256-8.4279 0.35461-12.75-0.9375s-7.7812-2.9375-7.7812-2.9375c3.9337 5.4743 14.568 8.0623 20.604 6.1985 5.0312-1.5536 8.5357-7.3063 11.521-11.855 2.9854-4.5484 5.8352-9.1834 9.875-11.625 2.0488-1.2383 4.7748-1.5376 7.2812-1.2812 2.6823 0.27427 6.9688 2.4375 6.9688 2.4375l0.687 [...]
+ <g id="g12890" transform="translate(0,-5e-5)">
+ <path id="path12883" d="m238.03 654.91c1.4798 5.9642 5.3892 17.671 4.8547 29.887-0.32905 7.5208-2.3424 17.031-7.6438 20.175l-10.8 6.41s4.8566 1.2138 7.5938 1.2812c1.5787 0.0389 3.261 0.10718 4.7188-0.5 5.0925-2.5407 8.3551-5.7579 10.312-9.4062-0.31193 1.321-0.71348 2.616-1.1875 3.9375 0 0 1.4013 2.7063 1.5625 4.1875 0.40034 3.6774-1.5625 11-1.5625 11 3.6509-4.0189 6.4759-7.3729 8.125-11.594 2.8581-7.3154 2.953-14.987 1.25-22.531-2.6462-11.723-9.6222-23.199-17.219-32.844z" fill="#e [...]
+ <path id="path12877" d="m182.71 634.09c-6.7358-10.514-8.5954-21.5-8.1507-33.735 0 0 9.0359-3.7769 14.49-3.8489 3.7161-0.0491 10.868 2.4905 10.868 2.4905l-2.4905-3.3961-0.67922-0.45281-7.0186-2.0377-7.4715 0.90563-11.773 2.9433v13.358l1.5849 9.2827 4.7546 8.6035 5.8866 5.8866z" fill="#f8f0c3"/>
+ <path id="path12879" d="m251.98 699.43c-0.99899 15.151-8.1504 27.801-5.6187 18.757 1.2795-4.2211 1.7048-9.529-1.5099-13.048 5.9687-8.4694 3.7404-21.439 1.4147-30.604 5.3552 7.3007 6.2882 16.184 5.7138 24.894z" fill="#d0b434"/>
+ <path id="path12886" d="m207.94 641.23c8.718 6.7195 13.054 25.191 24.844 33.61 1.3195 2.4696 2.8004 3.8099 4.0133 6.4539 1.3912 3.0329 2.4296 7.3815 2.4669 10.366 0.0293 2.3388-0.61819 5.9024-2.2372 8.0075-1.4277 1.8563-2.928 2.297-5.5397 3.7489 0 0 2.3416-4.9181 1.5082-9.5456-0.87287-4.8465-4.9481-9.4444-6.1315-10.917-3.779-4.7044-8.3144-8.7944-11.856-13.68-1.8207-2.5116-3.706-5.0728-4.788-7.98-1.2378-3.3256-1.4348-6.9609-1.824-10.488-0.35045-3.1764-0.456-9.576-0.456-9.576z" fill [...]
+ <path id="path12888" d="m233.58 692.85s0.39141-4.6473 0-6.9208c-0.35763-2.0773-0.94187-4.2081-2.1147-5.9596-7.0814-5.227-13.292-13.702-16.699-20.764-3.0194-6.2599-3.3954-10.998-6.7552-17.492 0 0-0.0424 11.433 1.3457 16.918 2.6104 9.6916 10.406 16.181 16.725 23.454 0.9346 1.1689 3.2611 3.7598 4.3999 5.398 2.1888 3.1487 3.0977 5.3677 3.0977 5.3677z" fill="#d1b948"/>
+ <path id="path12849" d="m178.26 603.22c17.099-2.2553 25.785 10.401 24.189 26.293-16.907 6.5687-22.433-13.78-24.189-26.293z" fill="#d1b948"/>
+ <path id="path12849-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m177.72 603.47c8.156-1.0758 14.718 2.5815 18.499 7.0604 3.6257 4.2955 5.2904 10.656 4.75 17.906 0 0-3.3294 0.78273-5.0146 0.69422-3.124-0.16408-9.1104-2.2538-9.1104-2.2538 4.9518 4.5251 9.7832 6.3983 16.219 3.997l0.78125-0.34375 0.0937-0.875c0.82867-8.2545-0.95966-17.086-5.4375-22.31-5.4364-6.3427-15.178-8.2332-20.78-3.875z" fill="#a28f38"/>
+ </g>
+ <path id="path14997-8-0-1-9-7-9-2-9-7-8-1-3-2" d="m308.27 538.2c-5.6268-12.324-11.119-14.988-24.585-19.52l0.78774 10.383c-8.9878-8.1652-17.889-14.625-30.649-13.153l8.1927 10.76c-13.452-8.1864-18.75-8.5508-34.444-6.8614-9.2524 12.088-13.049 18.217-13.235 32.532l-4.472-12.763c-8.2524 9.8418-7.7605 20.829-5.8921 32.827l-8.2346-6.374c-3.6298 13.737-4.4297 19.788 2.7608 31.27 0 0-1.4837-9.3264-1.2245-14.006 0.11577-2.09 1.2345-6.1572 1.2345-6.1572l8.8663 3.9406s-1.1704-13.509-0.19097-20 [...]
+ <path id="path12957" d="m273.86 541.1c7.6828-0.59544 15.871-0.50457 24.562 0.1531-18.552 8.5077-31.91 21.632-41.192 35.933-23.6 1.6396-42.689 6.5595-53.461 17.528 4.2914-11.055 12.048-18.603 15.488-27.45 0 0 5.129-14.568 8.381-21.558 1.7151-3.6868 5.8491-10.705 5.8491-10.705s10.346 0.27134 15.465 0.95447c8.4036 1.1214 24.909 5.1444 24.909 5.1444z" fill="#ebd25d"/>
+ <path id="path12957-2" d="m214.99 583.06c24.05-28.828 24.579-29.009 65.299-37.058-18.552 8.5077-16.801 13.43-26.083 27.731-23.6 1.6396-28.444-1.6424-39.216 9.3264z" fill="#ebd25d"/>
+ <g id="g11864-1-3-6-8" transform="matrix(.85687 -.47478 .47478 .85687 164.32 -85.449)" stroke-width="1.0208">
+ <path id="path11244-93-3-8-8-7-3" d="m-273.02 707.39 7.2533 41.722 23.775 6.0908 22.969-8.2226 3.2237-39.286s-8.4924 4.4942-13.298 4.2636c-5.5868-0.26815-14.506-6.3954-14.506-6.3954s-9.1963 5.1682-14.506 5.7863c-5.2063 0.60599-14.909-3.959-14.909-3.959z" fill="#806600"/>
+ <g id="g11234-8-8-0-7-5-0" transform="matrix(.91650 0 0 .69266 -114.68 469.91)" stroke-width="1.2812">
+ <path id="path12918-4-0-0-8-23-4-4" d="m-141.01 427.17c-16.228 0-32.409-6.2023-36.492-24.291-1.6413-7.2709-1.0533-12.269 3.6582-24.49 3.0873-8.008-3.7017-21.025-4.9533-29.74-0.44954-3.1303 0-11.491 0-11.491l11.145 6.3276s-0.0455 10.272 0.61916 15.288c0.83306 6.2878 3.1077 12.638 3.0958 18.983-0.0104 5.4758-3.0958 17.085-3.0958 17.085 17.206 9.0968 33.729 8.1275 50.96 0 0 0-3.0855-11.609-3.0958-17.085-0.012-6.3452 2.2627-12.695 3.0958-18.983 0.66466-5.0163 0.61917-15.288 0.61917-1 [...]
+ <path id="path12918-4-8-0-2-24-2-8-8-4-1" d="m-141.36 427.1c-16.228 0-32.054-6.2023-36.137-24.291-1.6413-7.2709-1.0533-12.269 3.6582-24.49 3.0873-8.008-3.7017-21.025-4.9533-29.74-0.44954-3.1303 0-11.491 0-11.491l6.1682 3.3094s-0.84239 8.435-0.36039 12.613c0.75461 6.5418 4.7962 12.52 5.0454 19.1 0.30044 7.9346-3.3436 23.425-3.3436 23.425s1.6731 7.3961 5.8662 10.091c12.361 7.9439 35.72 8.4548 48.113 0.00001 4.1216-2.8118 5.67-10.091 5.67-10.091s-3.4478-15.49-3.1473-23.425c0.24916-6 [...]
+ <path id="path11232-8-4-1-1-8-7" d="m-176.57 384.41-1.802 13.89 3.9444 13.161 7.9285 9.7304 15.497 5.7662h19.1l15.136-5.7662 7.2077-7.5681 4.685-10.451 0.374-8.5321-2.1958-10.23c-3.0829 6.6061-0.27652 17.952-6.1865 24.415-6.6897 7.3156-21.374 10.289-29.491 10.168-7.2391-0.10776-22.768-4.5115-28.117-10.844-7.1237-8.4327-1.866-18.059-6.0809-23.74z" fill="#d1b948"/>
+ <path id="path12918-4-8-3-8-7-1-3-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-179.94 335.06-0.0937 2.0312s-0.13081 2.0904-0.1875 4.5938c-0.0567 2.5034-0.0679 5.3468 0.1875 7.125 0.65856 4.5856 2.6771 10.04 4.125 15.312 1.4479 5.2722 2.2575 10.308 0.90625 13.812-4.7402 12.295-6.252 17.765-4.5695 25.219 2.113 9.3603 8.2903 16.904 15.132 20.864 6.8416 3.9608 15.164 5.5312 23.438 5.5312 8.2734 0 16.331-1.5607 22.906-5.5312 6.5757-3.9706 12.178 [...]
+ </g>
+ <g id="g11138-9-3-2-9-3-5" transform="matrix(.91650 0 0 .69266 -114.98 471.91)" stroke="#999" stroke-width=".58357">
+ <g id="g4683-4-0-9-3-9-0-3" transform="matrix(2.1955 0 0 2.1955 -1774 -400.67)" fill="#fff">
+ <path id="path4659-1-5-0-0-0-4-2" d="m730.58 342.35c0.47408 3.0335 0.0283 1.9644 2.1918 8.8595 0.70208-3.2921 1.4464-6.1923 2.8892-9.9629l-5.0811 1.1033z"/>
+ <path id="path4659-2-71-22-5-6-1-0-9" d="m756.84 342.35c-0.47408 3.0335-0.0283 1.9644-2.1918 8.8595-0.70208-3.2921-1.4464-6.1923-2.8892-9.9629l5.0811 1.1033z"/>
+ </g>
+ <g id="g11132-7-2-0-6-2-9" transform="translate(.15697)">
+ <g id="g4683-4-7-3-2-4-3-4-8" transform="matrix(2.1955 0 0 -2.1955 -1773.2 1148.1)">
+ <path id="path4659-1-9-7-7-8-7-5-0" d="m730.58 342.35c0.47408 3.0335 0.0283 2.5076 2.1918 8.8595 0.70208-3.2921 0.92142-6.0712 2.3643-9.8417-0.0951-1.2239-3.9043-2.9583-4.5561 0.98219z" stroke="#999" stroke-width=".58357" fill="#fff"/>
+ </g>
+ <g id="g4683-4-7-7-9-3-0-48-9-8" transform="matrix(-2.1955 0 0 -2.1955 1490.4 1148.1)">
+ <path id="path4659-1-9-9-0-7-3-9-4-9" d="m730.58 342.35c0.47408 3.0335 0.0283 2.5076 2.1918 8.8595 0.70208-3.2921 0.92142-6.0712 2.3643-9.8417-0.0951-1.2239-3.9043-2.9583-4.5561 0.98219z" stroke="#999" stroke-width=".58357" fill="#fff"/>
+ </g>
+ </g>
+ </g>
+ <g id="g11291-2-9-9-5-5-7" transform="matrix(.91650 0 0 .64166 -114.98 487.44)" stroke-width="1.3312">
+ <path id="path4371-3-6-3-0-4-0-6-0" d="m-157.9 353.76c-0.88501 24.747 2.5107 45.902 16.676 63.648 14.165-17.746 17.561-38.9 16.676-63.648l0.10028 0.79954-6.7518-1.0933-4.64-3.4669-5.4681-5.9014-5.2402 7.2427-7.2908 2.6825-4.0611-0.26306h-0.00007z" fill="#e9001a"/>
+ <path id="path4418-7-9-2-5-7-9-8" d="m-157.52 352.17 10.925-0.79877 6.4022-7.2585 8.5362 8.9336 6.7381 0.64494c-1.2907 8.5921-2.987 28.09-5.2824 36.414-1.9458 7.0559-9.9919 20.984-9.9919 20.984s-10.007-16.359-11.805-23.025c-2.3328-8.6469-5.5221-35.894-5.5221-35.894z" fill="#d80000"/>
+ <path id="path4418-7-4-9-3-1-7-0-8" d="m-155.25 352.17s3.6267-0.54577 6.188-2.4126c3.2545-2.372 8.0456-10.633 8.0456-10.633l9.358 13.922 4.4664 0.64494c-0.19874 19.665-4.7623 33.86-13.003 49.235-10.134-14.162-12.955-31.47-15.055-50.756z" fill="#c40000"/>
+ <path id="path4425-8-70-9-1-5-0-6" d="m-144.05 342.82s1.1074 17.584 1.2476 24.04c0.46695 21.496 1.1544 33.097 2.0354 30.596 0.6456-1.8328 1.3707-11.228 1.4978-29.819 0.0387-5.6507 0.87399-24.638 0.87399-24.638l-2.6395-4.3793-3.0153 4.2z" stroke-width="1.3312" fill="#920000"/>
+ <path id="path4371-3-9-6-3-9-0-8-0-2" d="m-141.22 417.41c14.165-17.746 17.561-38.9 16.676-63.648l-16.862-14.064-16.489 14.064c-1.5457 25.832 4.5966 45.246 16.676 63.648z" stroke="#a00" stroke-width="1.3312" fill="none"/>
+ </g>
+ </g>
+ <g id="g19390-9-7-7-6-1-7" transform="matrix(.91248 -.50560 .49406 .89166 527.53 1052.6)" stroke-width=".96972">
+ <path id="path18423-8-9-0-0-4-4-3" d="m-62.653-508.36 0.111 11.959 5.3481 6.3015 14.134 2.4506v9.1021l3.0561 7.7018 9.9322 7.7018 9.9322 1.0502 7.4956-1.3057 7.4027-6.7462 11.46 7.3517 9.5502 0.35008 10.314-4.201 5.7301-6.6515 0.76402-14.703 9.9322 0.35007 7.6402-4.9011 2.6741-5.6013 0.382-12.253c-7.0814 6.8367-14.394 18.475-27.123 17.504-0.96711 6.6813-0.41494 13.081-3.4526 16.794-3.7262 4.5542-8.8305 6.6448-14.872 5.7076-2.14-0.33198-5.9783-3.4103-8.4527-6.7251-1.8109-2.426-2.18 [...]
+ <path id="path18423-1-3-4-7-9-1" d="m-63.688-505.5 1.146 9.1021 5.3481 6.3015 14.134 2.4506v9.1021l3.0561 7.7018 9.9322 7.7018 9.9322 1.0502 7.4956-1.3057 7.4027-6.7462 11.46 7.3517 9.5502 0.35008 10.314-4.201 5.7301-6.6515 0.76402-14.703 9.9322 0.35007 7.6402-4.9011 2.6741-5.6013 0.382-9.4522c-4.3963 8.5218-9.7579 16.866-24.042 17.233-1.2963 7.0685-1.3337 13.631-4.8345 17.608-2.5041 2.8452-6.1016 4.1883-11.149 5.2153-3.5254 0.71729-8.1726-0.56433-12.057-3.3435-2.4603-1.7604-4.614 [...]
+ <path id="path18503-7-9-5-6-7-1" d="m200.2 170.67c0 5.2808-4.6822 9.5617-10.458 9.5617s-10.458-4.2809-10.458-9.5617 4.6822-9.5616 10.458-9.5616 10.458 4.2809 10.458 9.5616z" transform="matrix(.95270 .41466 -.41451 .75829 -133.42 -689.72)" fill="#f8ec9c"/>
+ <path id="path18503-1-2-9-1-8-2-1" d="m200.2 170.67c0 5.2808-4.6822 9.5617-10.458 9.5617s-10.458-4.2809-10.458-9.5617 4.6822-9.5616 10.458-9.5616 10.458 4.2809 10.458 9.5616z" transform="matrix(-0.973 .40952 .42334 .74890 125.17 -687)" fill="#f8ec9c"/>
+ <path id="path18562-3-9-4-72-0-7" d="m189.75 163.53c-4.5638 0-8.0312 3.2972-8.0312 7.125s3.4674 7.125 8.0312 7.125 8-3.2875 8-7.125-3.4362-7.125-8-7.125z" transform="matrix(-0.973 .40952 .42334 .74890 125.17 -687)" fill="#f8f0c3"/>
+ <path id="path18586-6-1-2-19-4-8" d="m189.75 163.56c-4.5556 0-8 3.2758-8 7.0938s3.4444 7.0938 8 7.0938 7.9688-3.266 7.9688-7.0938c0-3.8277-3.4131-7.0938-7.9688-7.0938z" transform="matrix(.95270 .41466 -.41451 .75829 -133.42 -689.72)" fill="#f8f0c3"/>
+ <path id="path4402-5-5-7-4-7-3-3" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-62.842-508.75c-2.9267 7.1222-1.6907 13.16 2.356 17.082 3.7192 3.6052 9.6859 5.1756 16.354 5.0802-0.08005 0.80974-0.18116 1.6964-0.20777 3.7467-0.03659 2.8146 0.08936 6.0999 1.178 8.573 2.4454 5.5545 7.2658 9.895 13.027 12.307 4.7587 1.9926 10.554 1.8855 15.383 0.38103 2.8355-0.88321 5.1977-3.2048 7.0681-4.8141 1.2874-1.1077 1.8414-1.792 2.4946-2.4766 1.646 1.8597 5.1 [...]
+ </g>
+ <g id="g11854-0-6-0-1" transform="matrix(.89202 -.49425 .46453 .83838 254.65 271.99)" stroke-width="1.053">
+ <g id="g12711-5-2-6-70-4-2" transform="matrix(.96060 0 0 .96060 -5.8744 19.133)">
+ <path id="path18606-81-3-7-8-8-7" d="m-170.79 319.17s0.0423-3.7585 0.77001-5.8102c1.3915-3.9231 6.6945-11.337 6.6945-11.337s-8.3699 3.872-12.554 3.8105c-4.4737-0.0658-7.3727-1.6368-11.197-3.8105-4.929-2.8017-14.25-10.161-14.25-10.161s1.1206 10.238 3.7323 14.607c1.9523 3.2659 5.1237 5.9078 8.4824 7.9384 3.7582 2.2721 8.1783 3.5717 12.554 4.4455 1.8836 0.37618 5.7681 0.31753 5.7681 0.31753z" fill="#f8eb9b"/>
+ <path id="path18606-7-4-6-1-1-7-8" d="m-172.44 317.23s0.0362-3.2224 0.66019-4.9815c1.193-3.3636 5.7397-7.8045 5.7397-7.8045s-7.1761 4.0278-10.764 3.975c-3.8356-0.0564-6.9264-1.6866-10.205-3.5502-4.226-2.4021-11.613-8.9281-11.613-8.9281s1.1121 6.087 3.3513 9.8329c1.6738 2.8001 4.8469 5.7733 7.7266 7.5143 3.2222 1.9481 6.4066 2.9206 10.158 3.6699 1.615 0.32253 4.9454 0.27225 4.9454 0.27225z" fill="#f8f0c3"/>
+ </g>
+ <g id="g12719-7-5-5-2-1-8" transform="matrix(.96060 0 0 .96060 -5.8744 19.133)">
+ <g id="g12715-1-5-9-2-0-6" stroke-width="1.053">
+ <path id="path18606-8-3-8-1-5-2-4" d="m-113.42 319.17s-0.0423-3.7585-0.77001-5.8102c-1.3915-3.9231-6.6945-11.337-6.6945-11.337s8.3699 3.872 12.554 3.8105c4.4737-0.0658 7.3727-1.6368 11.197-3.8105 4.929-2.8017 14.25-10.161 14.25-10.161s-1.1206 10.238-3.7323 14.607c-1.9523 3.2659-5.1237 5.9078-8.4824 7.9384-3.7582 2.2721-8.1783 3.5717-12.554 4.4455-1.8836 0.37618-5.7681 0.31753-5.7681 0.31753z" fill="#f8eb9b"/>
+ <path id="path18606-7-2-8-1-5-9-4-3" d="m-111.77 317.23s-0.0362-3.2224-0.66019-4.9815c-1.193-3.3636-5.7397-7.8045-5.7397-7.8045s7.1761 4.0278 10.763 3.975c3.8356-0.0564 6.9264-1.6866 10.205-3.5502 4.226-2.4021 11.613-8.9281 11.613-8.9281s-1.1121 6.087-3.3513 9.8329c-1.6738 2.8001-4.8469 5.7733-7.7266 7.5143-3.2222 1.9481-6.4066 2.9206-10.158 3.6699-1.6149 0.32253-4.9454 0.27225-4.9454 0.27225z" fill="#f8f0c3"/>
+ </g>
+ </g>
+ </g>
+ <g id="g12702-8-0-0-8-9-0" transform="matrix(.85687 -.47478 .47478 .85687 249.49 276.25)" stroke-width="1.0208">
+ <g id="g12670-6-3-5-2-3-4" transform="translate(0 -.1228)" stroke-width="1.0208">
+ <path id="path18588-5-9-9-33-5-3" d="m-161.98 319.48-0.76672-6.9961 11.117-21.526-0.19169-15.965-11.501 4.1259-12.459 1.6145-15.526-2.8702-7.4755 0.17939-5.1754 8.4312s3.4042 0.83418 6.687 2.8992c2.8938 1.8203 2.9777 5.0258 6.3884 8.0749 3.4372 3.0728 10.199 5.9842 12.49 6.4155 8.4749 1.5957 17.666-4.9128 17.666-4.9128l-2.0568 3.9392c-2.87 5.4968-9.6502 13.61 0.80324 16.591v-0.00001z" fill="#ebd25d"/>
+ <path id="path18726-7-8-4-0-8-7" d="m-202.6 284.91 3.3183-5.6629 5.8558-1.0961 17.763 3.1055 10.345-1.4614 13.664-3.4708 0.39039 8.4031s-4.9311 0.47169-6.713 1.977c-2.2306 1.8844-1.9448 5.6537-3.8443 7.8716-1.5966 1.8643-3.8015 3.2057-6.041 4.2104-2.6332 1.1813-5.5352 2.0698-8.4208 2.0137-3.6119-0.0703-7.5621-1.5506-10.617-3.4781-1.6458-1.0383-2.8492-2.7212-3.8443-4.3934-1.7968-3.0197-1.6419-6.9382-4.2104-9.3361-0.79037-0.73789-1.3003-0.97747-2.3798-0.9153-1.9032 0.10962-5.265 2. [...]
+ </g>
+ <path id="path18700-6-6-3-6-8-2" d="m-150.45 274.63s2.046 6.2051 2.2718 9.4157c0.23538 3.3476-0.13693 6.761-0.97363 10.023-0.6799 2.6508-2.2052 5.047-3.2455 7.5933l-4.2191 10.327s4.7144-1.7724 7.14-1.5187c2.741 0.28673 7.4645 3.341 7.4645 3.341s4.576-3.9006 7.4645-4.2522c3.021-0.3678 8.7627 2.4299 8.7627 2.4299s-7.4419-12.953-9.0873-20.046c-0.87241-3.761-1.3036-7.8039-0.32455-11.542 0.53036-2.0248 3.2454-5.4672 3.2454-5.4672l0.32455 14.883 10.061 19.439 1.9473 4.556-1.9473 5.7709- [...]
+ <g id="g12670-5-2-5-4-2-7-9" transform="matrix(-1 0 0 1 -283.02 -.1228)" stroke-width="1.0208">
+ <path id="path18588-3-70-7-4-4-9-7" d="m-161.98 319.48-0.76672-6.9961 11.117-21.526-0.19169-15.965-11.501 4.1259-12.459 1.6145-15.526-2.8702-7.4755 0.17939-5.1754 8.4312s3.4042 0.83418 6.687 2.8992c2.8938 1.8203 2.9777 5.0258 6.3884 8.0749 3.4372 3.0728 10.199 5.9842 12.49 6.4155 8.4749 1.5957 17.666-4.9128 17.666-4.9128l-2.0568 3.9392c-2.87 5.4968-9.6502 13.61 0.80324 16.591v-0.00001z" fill="#ebd25d"/>
+ <path id="path18726-0-3-6-4-0-4-2" d="m-202.6 284.91 3.3183-5.6629 5.8558-1.0961 17.763 3.1055 10.345-1.4614 13.664-3.4708 0.39039 8.4031s-4.9311 0.47169-6.713 1.977c-2.2306 1.8844-1.9448 5.6537-3.8443 7.8716-1.5966 1.8643-3.8015 3.2057-6.041 4.2104-2.6332 1.1813-5.5352 2.0698-8.4208 2.0137-3.6119-0.0703-7.5621-1.5506-10.617-3.4781-1.6458-1.0383-2.8492-2.7212-3.8443-4.3934-1.7968-3.0197-1.6419-6.9382-4.2104-9.3361-0.79037-0.73789-1.3003-0.97747-2.3798-0.9153-1.9032 0.10962-5.265 [...]
+ </g>
+ </g>
+ <path id="path18698-4-4-4-17-1-4" d="m260.73 625.55c4.7559-6.5939 10.168-13.446 18.341-9.2286 1.2081-9.3594 9.8536-10.501 18.023-11.154l0.81322 2.8186-6.3918 3.7752-3.3796 5.6089-0.18365 6.8737-3.2242 3.1876-3.3798-0.69596-9.0011-3.1856-9.3757 3.7938-2.2415-1.7937z" fill="#baa440"/>
+ <g id="g12741-8-7-3-08-7-8" transform="matrix(.85687 -.47478 .47478 .85687 249.53 276.23)" stroke-width="1.0311">
+ <g id="g18803-0-1-5-55-7-5" transform="matrix(1.0234 0 0 .95773 -136.24 790.16)">
+ <path id="path18750-4-3-7-7-0-0" d="m146.15 120.21s-1.9452-5.2011-0.81042-8.5355c1.5612-4.5875 5.226-8.086 9.7251-9.8862 4.3602-1.7446 9.586-0.38641 14.047 1.0806 4.842 1.5921 9.0505 5.2775 13.777 7.1848 4.4384 1.7909 13.237 0.97155 13.237 0.97155l-12.697 5.4028-12.697 1.0806-15.128-3.782-5.4028 0.27014-4.0521 6.2132z" transform="translate(-211.14 -648.81)" fill="#ebd25d"/>
+ <path id="path18787-6-8-7-4-9-8" d="m-63.297-532.84s-0.70016-3.3253 0-4.7783c1.1497-2.3858 4.6018-4.7176 7.2251-5.647 3.2678-1.1578 4.9736-1.1241 8.3904-0.43439 4.5872 0.92597 9.5599 4.8379 13.984 6.2986 3.7832 1.2491 11.653 2.8235 11.653 2.8235l-13.285 2.8235-8.1573-0.43439-12.819-2.6063-3.2629 0.43439-3.7291 1.5204z" fill="#d1b948"/>
+ </g>
+ <g id="g18803-2-0-4-7-1-2-4" transform="matrix(-1.0234 0 0 .95773 -146.85 790.16)">
+ <path id="path18750-0-32-8-2-5-2-6" d="m146.15 120.21s-1.9452-5.2011-0.81042-8.5355c1.5612-4.5875 5.226-8.086 9.7251-9.8862 4.3602-1.7446 9.586-0.38641 14.047 1.0806 4.842 1.5921 9.0505 5.2775 13.777 7.1848 4.4384 1.7909 13.237 0.97155 13.237 0.97155l-12.697 5.4028-12.697 1.0806-15.128-3.782-5.4028 0.27014-4.0521 6.2132z" transform="translate(-211.14 -648.81)" fill="#ebd25d"/>
+ <path id="path18787-7-6-0-4-9-3-0" d="m-63.297-532.84s-0.70016-3.3253 0-4.7783c1.1497-2.3858 4.6018-4.7176 7.2251-5.647 3.2678-1.1578 4.9736-1.1241 8.3904-0.43439 4.5872 0.92597 9.5599 4.8379 13.984 6.2986 3.7832 1.2491 11.653 2.8235 11.653 2.8235l-13.285 2.8235-8.1573-0.43439-12.819-2.6063-3.2629 0.43439-3.7291 1.5204z" fill="#d1b948"/>
+ </g>
+ </g>
+ <path id="path18702-9-4-2-9-2-4" d="m275.64 610.46s-4.5052-0.0688-6.6505 0.59146c-1.5306 0.47106-4.215 2.3355-4.215 2.3355l-1.4577-21.19-5.3187-14.239 8.826 11.952 17.756 12.16s-3.4164 1.3945-5.3391 2.9583c-1.7069 1.3883-3.6009 5.4324-3.6009 5.4324z" fill="#f8ec9c"/>
+ <path id="path18835-4-6-9-7-1-5" d="m273.63 606.69c-4.1638-1.8534-6.0455 0.4119-8.6936 1.2942l-0.75608-17.782 15.876 9.4045c-4.6979 0.9826-5.1137 4.2752-6.4267 7.0838z" fill="#f8f0c3"/>
+ <g id="g3671-1-4-3-3-3-3-7-1" transform="matrix(1.6508 -.91470 .91470 1.6508 -1247.9 751.15)" stroke-width=".46496">
+ <path id="path4096-5-3-7-2-7-2-7-9" d="m731.53 313.06c-0.24199 2.2783-3.7124 5.6431-7.5085 5.2299-3.7962-0.4132-6.4806-4.448-6.2386-6.7262 0.24199-2.2783 3.3188-1.4262 7.1149-1.013 3.7962 0.4132 6.8742 0.23146 6.6322 2.5093z" fill="#fff"/>
+ <path id="path4178-5-8-8-6-0-2-8-1" d="m718.15 313.3 1.0591-0.1412c1.1328-0.23076 1.5266 1.083 2.3656 1.9271 1.3479 1.3559 3.5035 2.8382 7.2014-0.51498 0.40694-0.36899 1.6945 0.63546 1.6945 0.63546l-2.2594 2.1888-2.7889 0.98848-2.5065-0.14121-2.5418-1.4121-1.9417-2.6124-0.28242-0.91788z" fill="#ececec"/>
+ <path id="path4096-7-5-4-8-9-0-39-7-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m719.96 309.34c-0.68224 0.0792-1.3052 0.22919-1.7834 0.58236s-0.79121 0.92635-0.86293 1.6015c-0.14342 1.3503 0.54968 2.9784 1.7258 4.3968 1.1762 1.4184 2.8737 2.6019 4.9187 2.8244 2.0449 0.22259 3.9892-0.55594 5.4364-1.6888s2.4454-2.6098 2.5888-3.96c0.0717-0.67506-0.12465-1.27-0.51775-1.718-0.3931-0.44797-0.93203-0.73665-1.582-0.96089-1.3-0.44849-3.2515-0.12671-5. [...]
+ <g id="g4173-8-0-3-4-6-4-3-1" transform="translate(-.082778)" stroke-width=".46496">
+ <path id="path4125-29-0-8-1-6-1-2-6" d="m728.1 314.31c0 1.7212-1.3363 3.1164-2.9848 3.1164-1.6484 0-2.9848-1.3953-2.9848-3.1164 0-1.7212 1.3363-3.1164 2.9848-3.1164 1.6484 0 2.9848 1.3953 2.9848 3.1164z" fill="#806600"/>
+ <path id="path4149-3-8-9-1-3-2-42-1-0" d="m725.12 313.12c-0.55544 0-1.0625 0.47416-1.0625 1.1875s0.50706 1.1875 1.0625 1.1875 1.0312-0.45086 1.0312-1.1875-0.47581-1.1875-1.0312-1.1875z" transform="matrix(1.4583 0 0 1.2531 -332.36 -79.576)" fill="#540"/>
+ <path id="path4149-2-3-5-7-5-7-3-3" d="m725.12 313.12c-0.55544 0-1.0625 0.47416-1.0625 1.1875s0.50706 1.1875 1.0625 1.1875 1.0312-0.45086 1.0312-1.1875-0.47581-1.1875-1.0312-1.1875z" transform="matrix(1 0 0 .89401 0.923 32.601)" fill="#fff"/>
+ </g>
+ </g>
+ <g id="g3649-0-7-3-8-8-4-2-2" transform="matrix(1.6508 -.91470 .91470 1.6508 -1241.1 747.98)" stroke-width=".46496">
+ <path id="path4096-2-7-5-5-8-6-4-7-1" d="m749.94 313.06c0.24199 2.2783 3.7124 5.6431 7.5085 5.2299 3.7962-0.4132 6.4806-4.448 6.2386-6.7262-0.24199-2.2783-3.3188-1.4262-7.1149-1.013-3.7962 0.4132-6.8742 0.23146-6.6322 2.5093z" fill="#fff"/>
+ <path id="path4178-2-4-7-4-3-1-6-0-8" d="m763.31 313.3-1.0591-0.1412c-1.1328-0.23076-1.5266 1.083-2.3656 1.9271-1.3479 1.3559-3.5035 2.8382-7.2014-0.51498-0.40694-0.36899-1.6945 0.63546-1.6945 0.63546l2.2594 2.1888 2.7889 0.98848 2.5065-0.14121 2.5418-1.4121 1.9417-2.6124 0.28242-0.91788z" fill="#ececec"/>
+ <path id="path4096-7-7-8-2-3-8-4-4-5-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m761.5 309.34c0.68224 0.0792 1.3052 0.22919 1.7834 0.58236s0.79121 0.92635 0.86293 1.6015c0.14342 1.3503-0.54968 2.9784-1.7258 4.3968-1.1762 1.4184-2.8737 2.6019-4.9187 2.8244-2.0449 0.22259-3.9892-0.55594-5.4364-1.6888s-2.4454-2.6098-2.5888-3.96c-0.0717-0.67506 0.12465-1.27 0.51775-1.718 0.3931-0.44797 0.93203-0.73665 1.582-0.96089 1.3-0.44849 3.2515-0.12671 5.1 [...]
+ <g id="g4173-3-5-9-6-1-7-78-0-2" transform="matrix(-1 0 0 1 1481.5 0)" stroke-width=".46496">
+ <path id="path4125-7-8-7-5-5-8-8-9-9" d="m728.1 314.31c0 1.7212-1.3363 3.1164-2.9848 3.1164-1.6484 0-2.9848-1.3953-2.9848-3.1164 0-1.7212 1.3363-3.1164 2.9848-3.1164 1.6484 0 2.9848 1.3953 2.9848 3.1164z" fill="#806600"/>
+ <path id="path4149-3-9-3-5-9-3-0-4-3-9" d="m725.12 313.12c-0.55544 0-1.0625 0.47416-1.0625 1.1875s0.50706 1.1875 1.0625 1.1875 1.0312-0.45086 1.0312-1.1875-0.47581-1.1875-1.0312-1.1875z" transform="matrix(1.4583 0 0 1.2531 -332.36 -79.576)" fill="#540"/>
+ <path id="path4149-0-0-6-54-5-2-7-5-9" d="m725.12 313.12c-0.55544 0-1.0625 0.47416-1.0625 1.1875s0.50706 1.1875 1.0625 1.1875 1.0312-0.45086 1.0312-1.1875-0.47581-1.1875-1.0312-1.1875z" transform="matrix(1 0 0 .89401 0.923 32.601)" fill="#fff"/>
+ </g>
+ </g>
+ <path id="path3477-9-0-3-9-4-7-5-4-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m249.41 583.76s-7.8444 10.182-17.533 15.512c-4.2503 2.3385-11.08 3.335-16.183 5.6223-2.5517 1.1437-4.8774 2.7329-5.8332 5.2389-0.95582 2.5059-0.42049 5.5404 1.6431 9.2721 1.5574-1.504-0.24595-4.6614 1.1273-8.4287 0.52256-1.4335 1.9819-2.5195 4.1746-3.5023 4.3854-1.9656 11.315-2.9449 16.426-5.757 9.1859-5.0536 15.437-12.625 17.146-14.778 1.3545 1.7503 6.0397 6.2775 7 [...]
+ <path id="path14997-8-0-1-9-7-9-2-9-7-8-1-3" d="m245.19 705.12c6.0892 6.8313-1.1407 20.036-4.8307 27.34-3.6356 7.1966-2.9897 22.691-0.24134 30.218 8.4643 23.18 4.7872 26.079 2.0328 49.802l-0.00009 0.00001c5.7545-3.2407 12.687-8.2154 14.527-23.147 9.1849 5.8188 6.2169 22.21 6.2844 32.579 8.4384-8.6931 17.123-22.57 14.211-33.99 9.0095 4.7322 7.058 12.5 6.2038 22.023 10.495-7.0897 13.159-18.909 9.2206-30.567 7.5578 5.1579 13.347 6.9396 18.371 7.266 9.1609 0.59525 15.777-3.6482 25.929- [...]
+ </g>
+ <g id="g41578">
+ <g id="g17126-4-2" transform="matrix(.59859 -.32153 .32153 .59859 -184.91 212.26)">
+ <g id="g11106-0-7" transform="matrix(.85001 0 0 .85001 357.75 -645.43)" stroke-width="1.7314">
+ <path id="path8995-2-0-7-2-4-3-8-3-1-5-6-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m247.5 479.16s-0.0398 0.0259-0.0625 0.0312c-0.0203 0.005-0.0417-0.002-0.0625 0-12.483 0.9658-28.931 8.0187-41.812 9.9062-2.5301 1.092-4.2383 2.5398-5.2874 4.1516-1.3465 2.0686-1.8544 4.3758-1.5541 6.6104 0.29753 2.214 0.68966 4.3286 3.2015 6.2212 1.3282 1.0008 3.3685 1.9395 6.5463 2.7981 53.99-8.7602 134.87-13.278 215.41 0.0625 2.6882-0.68331 4.7243-1.5794 6 [...]
+ <path id="path8995-2-0-7-2-4-3-8-3-1-5-5-8-3-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m198.72 499.86c0.29753 2.214 0.68966 4.3286 3.2015 6.2212 1.3282 1.0008 3.3685 1.9395 6.5463 2.7981 53.99-8.7602 134.87-13.278 215.41 0.0625 2.6882-0.68331 4.7243-1.5794 6.2126-2.643 2.2931-1.6388 3.2852-3.6752 3.3566-5.9432 3.6891-15.776-238.82-12.957-234.72-0.49551z" fill="#ececec"/>
+ <path id="path8995-2-0-7-2-4-3-8-3-1-5-5-8-2-4-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m201.93 506.08c1.3282 1.0008 3.3685 1.9395 6.5463 2.7981 53.99-8.7602 134.87-13.278 215.41 0.0625 2.6882-0.68331 4.7243-1.5794 6.2126-2.643-35.648-8.0634-80.61-10.845-115.15-10.665-40.175 0.20895-83.898 3.4-113.02 10.447z" fill="#c5c5c5"/>
+ <path id="path8995-2-0-7-2-4-3-8-3-1-5-5-6-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m247.5 479.16s-0.0398 0.0259-0.0625 0.0312c-0.0203 0.005-0.0417-0.002-0.0625 0-12.483 0.9658-28.931 8.0187-41.812 9.9062-2.5301 1.092-4.2383 2.5398-5.2874 4.1516-1.3465 2.0686-1.8544 4.3758-1.5541 6.6104 0.29753 2.214 0.68966 4.3286 3.2015 6.2212 1.3282 1.0008 3.3685 1.9395 6.5463 2.7981 53.99-8.7602 134.87-13.278 215.41 0.0625 2.6882-0.68331 4.7243-1.5794 [...]
+ </g>
+ <g id="g17117-9-3" transform="translate(-1.5218)" stroke-width="1.4717" fill="#696969">
+ <path id="path13625-3-6-46-4-6-79-39-8-6-7-8" d="m637.66-228.06c-3.6079-0.48355-6.9826-1.1036-10.156-1.8404-2.7939-0.64877-5.4314-1.3881-7.9342-2.2045 0.73097 1.1897 1.8737 2.3782 4.5613 3.2047-2.157 0.0242-4.9433 0.90639-5.9411 1.363 1.0617 0.40128 3.967 1.1164 6.119 1.025-2.554 0.96729-3.5144 2.2264-4.0656 3.4505 2.2408-0.89515 4.6117-1.7282 7.1325-2.4887 3.1766-0.95844 6.5913-1.8018 10.284-2.5096z"/>
+ <g id="g17109-4-9" stroke-width="1.4717">
+ <path id="path13625-3-6-46-4-6-79-39-9-3" d="m561.45-224.52c-3.629-0.28535-7.0325-0.71973-10.241-1.2818-2.8252-0.49487-5.4993-1.0887-8.0429-1.7669 0.79499 1.1479 2.001 2.272 4.7299 2.9502-2.1524 0.14223-4.8863 1.1756-5.8576 1.6861 1.0821 0.34257 4.0222 0.89764 6.1659 0.68851-2.4973 1.1056-3.3873 2.4154-3.8707 3.6679 2.1884-1.0164 4.5102-1.978 6.9856-2.8754 3.1194-1.1309 6.4828-2.1599 10.131-3.0687z"/>
+ <path id="path13625-3-6-46-4-6-79-39-8-7-4-7" d="m713.81-220.99c-3.5006-0.99828-6.7508-2.098-9.7845-3.2842-2.6713-1.0445-5.1748-2.1561-7.5338-3.3245 0.55194 1.2826 1.5115 2.6233 4.0521 3.8284-2.138-0.2868-5.0223 0.18478-6.0755 0.49285 0.99282 0.55005 3.7648 1.6763 5.9075 1.8958-2.6668 0.58926-3.7985 1.6968-4.5203 2.8288 2.3463-0.563 4.8125-1.0458 7.4166-1.4352 3.2816-0.4908 6.7821-0.83348 10.538-1.0019z"/>
+ </g>
+ <g id="g17113-1-1" transform="translate(1.7086)" stroke-width="1.4717">
+ <path id="path13625-3-6-46-4-6-79-39-8-9-5" d="m597.87-226.77c-3.6079-0.48355-6.9826-1.1036-10.156-1.8404-2.7939-0.64877-5.4314-1.3881-7.9342-2.2045 0.73097 1.1897 1.8737 2.3782 4.5613 3.2047-2.157 0.0242-4.9433 0.90639-5.9411 1.363 1.0617 0.40128 3.967 1.1164 6.119 1.025-2.554 0.96729-3.5144 2.2264-4.0656 3.4505 2.2408-0.89515 4.6117-1.7282 7.1325-2.4887 3.1766-0.95844 6.5913-1.8018 10.284-2.5096z"/>
+ <path id="path13625-3-6-46-4-6-79-39-8-7-6-6-7" d="m674.02-226.09c-3.5865-0.62263-6.9347-1.3726-10.077-2.2315-2.7668-0.75627-5.3737-1.597-7.843-2.5095 0.68444 1.2171 1.7803 2.4488 4.4341 3.3786-2.1563-0.0592-4.9746 0.71466-5.9893 1.1323 1.0454 0.44202 3.9209 1.2689 6.0748 1.2607-2.5895 0.86787-3.5979 2.0889-4.1959 3.2908 2.2737-0.80789 4.675-1.5486 7.2233-2.2112 3.2113-0.83495 6.656-1.5458 10.373-2.1103z"/>
+ </g>
+ </g>
+ </g>
+ <g id="g40986">
+ <g id="g28169-4-3-1-8-3" transform="matrix(.24072 -.12961 .13676 0.254 -232.52 -182.77)" stroke-width="3.5608">
+ <path id="path25053-5-4-2-1-9" d="m1219.6 702.3 17.558-48.601 7.0916-20.121 17.575-10.352 17.8-38.344 8.3852-10.028 1.2943-35.329s-12.298-25.061-31.33-34.06c-27.225-12.874-64.179-11.103-64.179-11.103s-8.5364-21.396-24.193-29.722c-15.657-8.3261-33.042-10.333-51.289-10.333s-50.995 15.463-68.704 20.008c-9.2065 2.363-29.998 10.333-29.998 10.333s-20.792-7.9701-29.998-10.333c-17.709-4.5453-50.457-20.008-68.704-20.008s-35.064 1.7049-51.289 10.333c-15.089 8.0241-35.803 29.722-35.803 29.7 [...]
+ <path id="path28147-1-7-5-8-8" d="m1288.2 573.44-7.5765 10.332-19.285 40.637-18.597 8.954-22.729 68.877-400.17-1.3775-28.239-70.254-18.597-30.306-10.332-10.332-2.7551-9.6427v-6.8877l-1.3775-22.041s14.201-17.858 22.729-22.041c7.871-3.8601 28.928-4.1326 28.928-4.1326s-17.07 8.0197-21.352 14.464c-5.8302 8.776-6.8877 46.836-6.8877 46.836s14.838-32.035 23.418-37.882c8.0544-5.4886 30.306-11.709 30.306-11.709s-15.256 14.463-17.908 22.729c-2.7169 8.4696-2.9688 21.857 1.3775 29.617 10.25 [...]
+ <path id="path28149-1-9-0-1-7" d="m822.29 700.43-33.063-79.557s-18.944-23.447-22.73-36.162c-2.3953-8.0428-0.75063-19.992 2.0664-27.897 2.5402-7.128 14.465-20.664 14.465-20.664s-9.0667 16.094-10.332 23.764c-1.215 7.3653-1.0744 18.025 2.0664 24.797 4.242 9.1462 19.631 24.797 19.631 24.797s-2.4213-24.872 0-35.129c1.1147-4.7219 4.1565-10.713 7.2324-14.465 2.2406-2.7331 9.2988-7.2324 9.2988-7.2324s-5.1294 7.6317-6.1992 11.365c-1.4539 5.0743-2.0724 12.389-1.0332 17.564 3.1932 15.902 23 [...]
+ <path id="path28151-6-8-4-1-4" d="m776.46 514.28s4.2989 2.258 9.8244 0.0621c6.5632-2.6083 15.064-9.8457 23.047-11.408 11.874-2.3236 20.673 0.5749 22.178 2.2662 4.6058 5.173 6.6223 15.083 11.455 20.045 4.9083 5.0402 20.045 12.17 20.045 12.17s-9.6916-15.948-11.455-23.625c-1.2017-5.2331-4.9737-19.921 0-17.898 51.897 21.108 29.807-19.158 39.837-24.575 8.5707-4.6289 9.8535-8.6173 19.584-9.0731 12.804-0.59969 19.048 4.6572 31.426 7.9878 18.717 5.0365 40.815 35.596 60.136 37.141 12.052 [...]
+ <path id="path28162-1-0-2-3-1" d="m784.24 609.07s7.7214-0.84811 19.682-2.1692c7.2117-0.79655 19.663 3.8423 29.193 2.7841 15.13-1.68 34.44-15.502 50.438-17.305 15.998-1.8032 56.023 17.319 66.805 16.256 43.982-4.3366 35.204-23.758 58.227-23.636 10.05 0.0531 26.602-13.793 35.472-3.3832 29.69 34.844 87.384 28.834 119.38 13.954 16.046-7.4623 49.179 27.294 73.066 8.6459 13.99-10.921 31.672 3.1317 31.672 3.1317l-53.742 64.142-404.81 2.675-25.381-65.096z" fill-rule="evenodd" fill="#920000"/>
+ <path id="path28153-9-7-6-0-7" d="m1219.6 702.3 17.558-48.601 7.0916-20.121 17.575-10.352 17.8-38.344 8.3852-10.028 1.2943-35.329s-12.298-25.061-31.33-34.06c-27.225-12.874-64.179-11.103-64.179-11.103s-8.5364-21.396-24.193-29.722c-15.657-8.3261-33.042-10.333-51.289-10.333s-50.995 15.463-68.704 20.008c-9.2065 2.363-29.998 10.333-29.998 10.333s-20.792-7.9701-29.998-10.333c-17.709-4.5453-50.457-20.008-68.704-20.008s-35.064 1.7049-51.289 10.333c-15.089 8.0241-35.803 29.722-35.803 29.7 [...]
+ </g>
+ <g id="g10024-3-7-6" transform="matrix(.50801 -.27351 .27351 .50801 -229.35 -205.03)" stroke-width="1.7332">
+ <g id="g9716-6-4-2-0" transform="matrix(-1 0 0 1 923.9 0)">
+ <g id="g9502-7-1-3-2" stroke-width="1.7332">
+ <path id="path13193-8-9-5-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m358.41 213.62c-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23.83 8.75 23.83l12.611-2.25s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 5.1768-5.1254 12.469-8.3005 19.938-10.031 6.6614-1.5437 14.188-2.2045 20.03 [...]
+ <path id="path13193-7-9-4-5-8-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m462.42 228.08-1.6406-6.2969s-4.6615 1.2344-10.156 2.4062c-5.4947 1.1719-12.358 2.1227-13.969 2.0312-8.297-0.47093-13.168-1.1633-20.969-3.625-11.169-3.5243-19.074-7.4316-31.688-10.062-8.4994-1.7728-17.217-0.76456-25.594 1.0938-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23. [...]
+ <path id="path13193-7-8-1-9-3-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m334.71 298.25 3.1527-0.5625s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 2.0694-2.0489 4.477-3.7862 7.0987-5.2441 3.9365-2.1891 8.3559-3.7483 12.839-4.7872 3.3688-0.78067 6.9589-1.3356 10.441-1.5376 3.403-0.19744 6.7025-0.0578 9.5906 0.53756 1.5147 0.31224 2.957 0.64935 4.349 1.0084 3.8285 0.98747 [...]
+ <path id="path13193-7-7-88-5-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m358.41 213.62c-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23.83 8.75 23.83l12.611-2.25s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 5.1768-5.1254 12.469-8.3005 19.938-10.031 6.6614-1.5437 14.188-2.2045 20 [...]
+ </g>
+ <g id="g7602-71-8-8-2-78-3-1-8-6-9" transform="matrix(1.331 0 0 1.331 679.36 -1151.1)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-87-7-1-4" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-87-38-7-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-74-8-9-2" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-49-9-2-9" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-15-6-4-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-0-5-86-8-0" transform="matrix(1.331 0 0 1.331 676 -1167.8)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-2-5-9-3-1" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-4-8-59-9-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-8-2-6-6-4" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-3-9-8-4-0" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-9-8-6-7-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-5-2-9-7-9" transform="matrix(1.331 0 0 1.331 677.01 -1185.6)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-22-0-4-3-7" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-7-7-7-1-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-3-4-6-7-5" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-7-8-8-4-4" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-90-5-1-9-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-3-8-3-6-8" transform="matrix(1.331 0 0 1.331 683.83 -1202.4)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-9-3-8-9-7" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-9-0-0-8-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-7-6-8-0-7" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-0-2-1-3-4" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-3-2-1-6-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-8-5-8-6-7" transform="matrix(1.331 0 0 1.331 696.57 -1215.6)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-6-2-7-5-5" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-5-2-6-4-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-76-7-1-2-2" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill= [...]
+ <path id="path9019-7-4-4-1-0-695-4-2-1-8-3-7" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-7-5-8-1-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-9-2-3-2-2" transform="matrix(1.331 0 0 1.331 712.48 -1224.2)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-99-1-5-1-2" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-1-1-6-2-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-72-0-8-5-8" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill= [...]
+ <path id="path9019-7-4-4-1-0-695-4-36-1-8-6-0" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-5-8-9-4-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-81-7-9-8-0" transform="matrix(1.331 0 0 1.331 730.67 -1228.8)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-4-6-3-0-6" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-71-0-7-1-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-38-0-2-0-9" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill= [...]
+ <path id="path9019-7-4-4-1-0-695-4-4-9-38-5-0" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-8-5-3-4-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-6-6-5-2-7" transform="matrix(1.331 0 0 1.331 749.32 -1227.9)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-0-2-1-6-5" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-3-8-5-7-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-2-5-42-9-4" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill= [...]
+ <path id="path9019-7-4-4-1-0-695-4-6-9-2-5-5" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-94-4-9-9-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-37-3-1-1-1" transform="matrix(1.331 0 0 1.331 799.8 -1214.7)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-8-9-5-0-3" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-8-0-8-8-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-381-5-8-9-7" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill [...]
+ <path id="path9019-7-4-4-1-0-695-4-5-6-0-9-1" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-35-3-4-7-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-36-6-0-9-9" transform="matrix(1.331 0 0 1.331 767.06 -1222.9)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-5-3-8-6-7" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-95-0-5-9-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-4-8-5-0-8" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-9-4-9-5-3" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-1-0-5-7-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-55-4-7-2-1" transform="matrix(1.331 0 0 1.331 783.43 -1217.9)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-41-6-7-2-2" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-88-4-3-0-9" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-35-6-7-1-6" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill= [...]
+ <path id="path9019-7-4-4-1-0-695-4-22-4-6-5-5" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-6-3-4-0-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g9716-3-5-3">
+ <g id="g9502-5-6-9" stroke-width="1.7332">
+ <path id="path13193-4-4-9" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m358.41 213.62c-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23.83 8.75 23.83l12.611-2.25s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 5.1768-5.1254 12.469-8.3005 19.938-10.031 6.6614-1.5437 14.188-2.2045 20.031- [...]
+ <path id="path13193-7-9-5-5-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m462.42 228.08-1.6406-6.2969s-4.6615 1.2344-10.156 2.4062c-5.4947 1.1719-12.358 2.1227-13.969 2.0312-8.297-0.47093-13.168-1.1633-20.969-3.625-11.169-3.5243-19.074-7.4316-31.688-10.062-8.4994-1.7728-17.217-0.76456-25.594 1.0938-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23.83 [...]
+ <path id="path13193-7-8-6-2-6" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m334.71 298.25 3.1527-0.5625s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 2.0694-2.0489 4.477-3.7862 7.0987-5.2441 3.9365-2.1891 8.3559-3.7483 12.839-4.7872 3.3688-0.78067 6.9589-1.3356 10.441-1.5376 3.403-0.19744 6.7025-0.0578 9.5906 0.53756 1.5147 0.31224 2.957 0.64935 4.349 1.0084 3.8285 0.98747 7. [...]
+ <path id="path13193-7-94-3-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m358.41 213.62c-9.0186 2.0007-18.587 5.9746-26.125 13.438-6.9868 6.9175-11.634 15.083-14.312 25-2.507 9.2816-2.5832 14.802-1.4688 24.045 1.434 11.893 8.75 23.83 8.75 23.83l12.611-2.25s-7.5991-16.016-8.4545-23.111c-1.0276-8.5228-0.99559-11.257 1.125-19.108 2.1967-8.1331 5.3862-13.722 10.875-19.156 5.1768-5.1254 12.469-8.3005 19.938-10.031 6.6614-1.5437 14.188-2.2045 20.0 [...]
+ </g>
+ <g id="g7602-71-8-8-2-78-3-363-0-2" transform="matrix(1.331 0 0 1.331 679.36 -1151.1)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-47-6-0" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-40-4-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-75-7-1" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-02-1-5" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-54-1-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-0-21-8-6" transform="matrix(1.331 0 0 1.331 676 -1167.8)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-2-51-5-4" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-4-6-2-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-8-0-0-5" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-3-0-1-5" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-9-2-1-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-5-3-2-4" transform="matrix(1.331 0 0 1.331 677.01 -1185.6)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-22-05-4-1" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-7-0-5-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-3-5-5-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-7-7-2-6" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-90-4-3-9" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-3-80-2-7" transform="matrix(1.331 0 0 1.331 683.83 -1202.4)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-9-6-3-7" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-9-05-1-9" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-7-9-1-3" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-0-28-9-2" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-3-3-8-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-8-7-0-9" transform="matrix(1.331 0 0 1.331 696.57 -1215.6)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-6-6-9-9" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-5-29-5-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-76-8-2-2" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-2-5-4-8" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-7-9-2-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-9-25-3-6" transform="matrix(1.331 0 0 1.331 712.48 -1224.2)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-99-5-5-6" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-1-9-8-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-72-1-4-7" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-36-14-5-3" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-5-4-1-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-81-2-1-8" transform="matrix(1.331 0 0 1.331 730.67 -1228.8)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-4-63-0-4" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-71-6-4-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-38-91-1-3" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-4-0-6-0" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-8-4-1-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-6-5-4-6" transform="matrix(1.331 0 0 1.331 749.32 -1227.9)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-0-8-5-5" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-3-21-2-9" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-2-6-3-5" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-6-0-3-8" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-94-8-6-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-37-4-8-9" transform="matrix(1.331 0 0 1.331 799.8 -1214.7)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-8-7-4-1" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-8-81-8-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-381-7-3-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-5-0-9-6" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-35-4-2-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-36-69-3-3" transform="matrix(1.331 0 0 1.331 767.06 -1222.9)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-5-5-0-3" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-95-32-9-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-4-9-2-1" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-9-41-7-5" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-1-6-2-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-78-3-55-6-2-8" transform="matrix(1.331 0 0 1.331 783.43 -1217.9)" stroke-width="1.3022">
+ <g id="g9013-8-9-4-38-3-1-6-41-0-7-5" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-7-6-88-2-9-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-04-5-35-3-3-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-695-4-22-3-0-1" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-3-2-6-5-9-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g15605-0-3" transform="matrix(1.0654 -.57362 .57362 1.0654 -32.904 -1028)" stroke-width=".82645">
+ <g id="g9189-31-8-1-7" transform="matrix(.69812 0 0 .69812 -384.77 582.66)">
+ <g id="g9185-7-1-5-9" stroke-width="1.1838">
+ <path id="rect8245-8-0-2-4-8-4-1-8-0" d="m185.96 37.047c1.5672-1.9839 3.4392-3.4577 4.9565-5.4749 1.5941-2.1194 2.8103-4.7978 3.4354-7.503-2.771 0.69088-5.4494 1.9071-7.5688 3.5011-2.0172 1.5172-3.491 3.3892-5.4749 4.9565v-25.411c1.9839 1.5672 3.4577 3.4392 5.4749 4.9565 2.1194 1.5941 4.7978 2.8103 7.5688 3.5011-0.62508-2.7052-1.8413-5.3836-3.4354-7.503-1.5172-2.0173-3.3892-3.491-4.9565-5.4749l28.152 9e-7c-1.5672 1.9839-3.4392 3.4577-4.9565 5.4749-1.5941 2.1194-2.8103 4.7978-3. [...]
+ <path id="rect8245-8-0-2-4-8-3-9-3-2-1" d="m192.57 33.851c2.0468-4.0155 3.7826-8.1375 4.8352-12.571-4.2402 1.2249-8.865 2.5218-12.624 4.8888v-12.697c4.0325 2.0619 8.1856 3.7777 12.624 4.8888-1.1683-4.2295-2.4815-8.8326-4.8352-12.571l14.93 9e-7c-2.0468 4.0155-3.7826 8.1375-4.8352 12.571 4.2402-1.2249 8.865-2.5218 12.624-4.8888v12.697c-4.0325-2.0619-8.1856-3.7777-12.624-4.8888 1.1683 4.2295 2.4815 8.8326 4.8352 12.571l-14.93 0.000001z" fill="#f6e078"/>
+ </g>
+ <g id="g7602-71-8-8-2-7-0-6-0-5-9" transform="matrix(1.331 0 0 1.331 562.93 -1417.2)" stroke-width=".88942">
+ <g id="g9013-8-9-4-38-3-4-7-9-72-0-2" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="1.7788">
+ <path id="path9015-6-3-7-0-0-8-2-8-35-2-9" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-0-3-0-8-8-6" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-6-5-3-3-3-9" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-0-8-6-5-9-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="1.7788" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g7966-6-6-9-6" transform="matrix(.54414 0 0 .54414 -354.05 592.26)">
+ <g id="g12979-91-7-9-9-7-5-1-3-0" transform="matrix(1.8635 0 0 1.8334 97.192 -1597.7)" stroke-width=".82170">
+ <path id="path9021-6-8-7-3-0-6-90-7-5-5-3-42-7-0-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="matrix(1.04 0 0 1.04 -2741.9 82.476)" fill="#d1b948"/>
+ <path id="path12933-6-20-9-2-3-3-9-1-0" d="m2689.7 776.41c-4.67 0-8.4375 3.8205-8.4375 8.625s3.7675 8.625 8.4375 8.625 8.4687-3.8277 8.4687-8.625-3.7987-8.625-8.4687-8.625z" transform="matrix(1.1016 0 0 1.0954 -2908.7 37.898)" fill="#e7cd54"/>
+ <path id="path12933-0-17-9-1-4-8-1-2-5-2" d="m2689.7 776.41c-4.67 0-8.4375 3.8205-8.4375 8.625s3.7675 8.625 8.4375 8.625 8.4687-3.8277 8.4687-8.625-3.7987-8.625-8.4687-8.625z" transform="matrix(.97315 0 0 .97449 -2564.3 131.75)" fill="#f6e078"/>
+ <path id="path12933-0-3-3-07-0-2-4-2-4-2-1" d="m2689.7 776.41c-4.0731 0.66389-7.7184 4.6204-8.4375 8.625-0.8487 4.726 3.7675 8.625 8.4375 8.625s8.4687-3.8277 8.4687-8.625-3.7987-8.625-8.4687-8.625z" transform="matrix(.83440 0 0 .81835 -2192.2 252.97)" fill="#f8eca8"/>
+ <path id="path9021-6-8-7-3-0-6-9-8-1-8-3-6-1-8-7-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="matrix(1.04 0 0 1.04 -2741.9 82.476)" stroke="#806600" stroke-width=".79013" fill="none"/>
+ </g>
+ <g id="g7960-25-3-3-0" stroke-width="1.5188">
+ <path id="rect4875-6-9-9-4" fill="#f6e078" d="m195.84 28.438v17.062h-17.062v8.6875h42.812v-8.6875h-17.094v-17.062h-8.6562z"/>
+ <path id="path7956-4-6-6-7" d="m178.71 45.543-0.10818 4.3271h21.528v-21.636l-4.219 0.10818-0.10818 17.2h-17.092z" fill="#f8eca8"/>
+ <path id="path7958-8-4-4-3" d="m178.67 54.045h43.145v-1.8475h-43.037l-0.10867 1.8475z" fill="#e7cd54"/>
+ <path id="rect4875-93-0-7-9-5" d="m195.84 28.437v17.062h-17.062v8.6875h42.812v-8.6875h-17.094v-17.062h-8.6562z" stroke="#806600" stroke-width="1.5188" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g16905-1-7-2-8" transform="matrix(.50801 -.27351 .27351 .50801 -74.801 -290.71)">
+ <g id="g14096-0-3-3-1" transform="translate(-39.304 193.4)" stroke-width="1.7332">
+ <g id="g14089-5-17-5-6">
+ <rect id="rect8897-4-4-9-3" fill-rule="evenodd" ry="6.386" height="71.72" width="25.322" y="34.934" x="182.33" fill="#f6d900"/>
+ <path id="rect8897-9-4-2-9-7-8" d="m188.71 34.934h12.55c3.5379 0 6.386 2.8482 6.386 6.386v35.584l-25.322 7.3685v-42.952c0-3.5379 2.8482-6.386 6.386-6.386z" fill-rule="evenodd" fill="#e7cd54"/>
+ <path id="rect8897-9-67-69-2-6" d="m188.71 34.934h12.55c3.5379 0 6.386 2.8482 6.386 6.386v21.105l-25.322 7.3685v-28.473c0-3.5379 2.8482-6.386 6.386-6.386z" fill-rule="evenodd" fill="#f6e078"/>
+ <path id="rect8897-9-6-9-8-4-0" d="m188.71 34.934h12.55c3.5379 0 6.386 2.8482 6.386 6.386v7.3685l-25.322 7.3685v-14.737c0-3.5379 2.8482-6.386 6.386-6.386z" fill-rule="evenodd" fill="#f8eca8"/>
+ <rect id="rect8897-3-5-0-2-2" ry="6.386" height="71.72" width="25.322" stroke="#806600" y="34.934" x="182.33" stroke-width="1.7332" fill="none"/>
+ </g>
+ <g id="g9547-9-3-4-6" transform="translate(-303.37 -281.42)">
+ <g id="g9537-1-6-6-9" stroke-width="1.6996">
+ <g id="g9532-0-6-7-0" transform="matrix(1.147 0 0 .90673 226.84 -537.15)">
+ <rect id="rect8899-8-54-5-2" fill-rule="evenodd" ry="3.7999" height="79.256" width="7.0406" y="941.22" x="221.33" fill="#f6e078"/>
+ <path id="path8903-9-2-9-1" d="m221.75 986.97s1.3234-2.7096 2.7564-9.9086c0.7863-3.9502 3.8064-9.5906 3.8064-9.5906v-23.369l-2.0571-2.3913-3.1648-0.17081-1.5824 1.8789 0.24165 43.551z" fill-rule="evenodd" fill="#f8eca8"/>
+ <path id="rect8907-9-3-2-2" d="m224.85 941.22c1.9502 0 3.5203 1.6948 3.5203 3.7999v71.656c0 2.1051-1.57 3.7999-3.5203 3.7999-1.9502 0-3.5203-1.6948-3.5203-3.7999v-71.656c0-2.1052 1.57-3.7999 3.5203-3.7999z" stroke="#806600" stroke-width="1.6996" fill="none"/>
+ </g>
+ <g id="g9527-7-1-6-1" transform="matrix(1.147 0 0 .90673 232.09 -537.15)">
+ <rect id="rect8901-9-2-2-7" fill-rule="evenodd" ry="3.7999" height="79.256" width="7.0406" y="941.22" x="240.49" fill="#f6e078"/>
+ <path id="path8905-6-1-9-9" d="m240.56 983.37s0.84005-7.9265 2.273-15.126c0.7863-3.9502 4.5313-8.808 4.5313-8.808v-15.544l-2.0571-2.3913-3.1648-0.17081-1.5824 1.8789v40.16z" fill-rule="evenodd" fill="#f8eca8"/>
+ <rect id="rect8909-9-2-6-8" ry="3.7999" height="79.256" width="7.0406" stroke="#806600" y="941.22" x="240.49" stroke-width="1.6996" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g13677-0-5-9-7" transform="translate(-25.575 194.49)" stroke-width="1.3022">
+ <g id="g7602-71-8-8-2-45-4-57-6-9-6" transform="matrix(1.331 0 0 1.331 544.15 -1401.7)">
+ <g id="g9013-8-9-4-38-3-8-9-22-4-8-2" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-21-6-0-80-0-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-6-9-15-1-3-3" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-0-8-05-0-6-8" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-8-0-6-5-3-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-45-4-1-4-4-7-9" transform="matrix(1.331 0 0 1.331 544.15 -1387.6)">
+ <g id="g9013-8-9-4-38-3-8-9-9-5-2-5-6" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-21-6-8-2-6-8-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-6-9-0-3-7-7-2" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-0-8-9-0-9-7-3" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-8-0-5-6-5-1-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-45-4-4-4-9-6-9" transform="matrix(1.331 0 0 1.331 544.15 -1373.5)">
+ <g id="g9013-8-9-4-38-3-8-9-2-7-1-1-5" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-21-6-3-1-08-3-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-6-9-5-1-9-4-2" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-0-8-8-8-9-3-1" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-8-0-4-5-7-2-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-45-4-11-2-9-2-1" transform="matrix(1.331 0 0 1.331 544.15 -1359.3)">
+ <g id="g9013-8-9-4-38-3-8-9-0-0-69-1-9" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-21-6-4-1-0-1-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-6-9-1-1-57-1-7" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-0-8-6-2-22-2-6" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-8-0-1-4-0-3-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-71-8-8-2-45-4-5-5-1-3-6" transform="matrix(1.331 0 0 1.331 544.15 -1345.2)">
+ <g id="g9013-8-9-4-38-3-8-9-23-5-5-0-7" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.6044">
+ <path id="path9015-6-3-7-0-0-21-6-36-2-0-0-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-7-0-8-5-6-9-8-3-5-4-4" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-4-4-1-0-0-8-4-2-6-5-7" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-0-1-5-8-0-8-3-4-7-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.6044" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g6103-1-5-0-7" transform="matrix(.50801 -.27351 .27351 .50801 -51.281 -199.23)">
+ <g id="g7330-9-2-1-0" transform="translate(467.6 -914.69)" stroke-width="1.7332">
+ <g id="g6917-80-3-8-6" transform="translate(-0.000005)">
+ <g id="g6826-9-06-6-3" stroke-width="1.7332">
+ <path id="path9304-5-2-7-8-5-4-3-3" d="m-147.29 1086.9c-6.7196 15.023-12.101 29.69-17.375 44.782h-108.31-108.31c-5.0982-14.589-10.297-30.282-16.708-44.782 0 0 13.482 18.865 23.578 23.427 5.6081 2.5339 12.623 3.2894 18.421 1.228 7.6415-2.7166 17.807-16.579 17.807-16.579s9.1411 10.698 15.351 13.509c5.8285 2.6378 12.644 2.745 19.035 2.4561 5.6554-0.2556 11.92-0.4688 16.579-3.6842 7.0552-4.8687 14.123-21.491 14.123-21.491s6.8378 13.078 12.281 17.807c4.4913 3.9023 10.131 6.8156 15. [...]
+ <path id="path6816-24-7-0-5" d="m-323.12 1068.9v20.64l131.31 0.3558 1.0676-17.793-17.081-13.167-14.946 10.32-21.352 3.5586-10.676-2.491-19.572-19.928-8.1848 13.879-16.014 7.4731-17.081 0.7117-7.4731-3.5586z" transform="translate(1.7031 40.705)" fill="#f6e078"/>
+ <path id="path6814-2-1-9-0" d="m-362.62 1089.6-1.0676-16.014 11.743-3.5586 12.099-10.676 13.523 10.32 4.6262 1.7793 0.71172 18.861-41.636-0.7117z" transform="translate(1.7031 40.705)" fill="#f6e078"/>
+ <path id="path9304-5-2-7-8-3-9-35-1-6-2" d="m-355.23 1131.7h-26.066c-5.0982-14.589-10.297-30.282-16.708-44.782 0 0 13.482 18.865 23.578 23.427 5.6081 2.5339 12.623 3.2894 18.421 1.228l0.77398 20.127zm161.95-22.583c5.6351 2.5153 12.414 3.2557 18.421 1.8421 6.3568-1.496 11.698-6.1001 16.579-10.439 4.3566-3.8723 10.988-13.602 10.988-13.602-6.7196 15.023-12.101 29.69-17.375 44.782h-28.998v-0.3943l0.38462-22.189z" fill="#d1b948"/>
+ <path id="path6818-8-8-2-6" d="m-274.73 1052.2 1.7793 39.145 47.685 0.3559v-21.352l-11.032 3.5586-15.302-1.7793-16.014-11.032-7.1172-8.8965z" transform="translate(1.7031 40.705)" fill="#e7cd54"/>
+ <path id="path6820-4-52-8-6" d="m-226.33 1087.2 0.35586-16.178 18.149-11.032 13.879 10.676v19.736h-32.739l0.35586-3.2028z" transform="translate(1.7031 40.705)" fill="#d0b500"/>
+ <path id="path6822-5-0-4-8" d="m-368.32 1071.4 1.7353 19.784h13.523l-1.3794-20.496-4.6262 1.7793-9.2524-1.0676z" transform="translate(1.7031 40.705)" fill="#e7cd54"/>
+ <path id="path6824-1-1-6-7" d="m-346.25 1091 0.35587-25.266 5.6938-7.473 7.1172 7.8289 0.35586 25.622-13.523-0.7118z" transform="translate(1.7031 40.705)" fill="#f8eca8"/>
+ </g>
+ <path id="path9304-5-2-7-8-3-7-0-1-1-6-3" d="m-273.08 1085.9s-7.0907 16.623-14.146 21.491c-4.6594 3.2154-10.924 3.4286-16.579 3.6842-6.3911 0.2889-13.207 0.1817-19.035-2.4561-6.2098-2.8104-15.351-13.509-15.351-13.509s-10.166 13.862-17.807 16.579c-5.7985 2.0614-12.813 1.3059-18.421-1.228-10.097-4.5619-23.578-23.427-23.578-23.427 2.5084 5.6735 4.8312 11.53 7.0351 17.431 0 0 5.1958 5.5032 8.6917 7.9379 3.6114 2.5151 7.8706 4.2357 12.193 5.0647 4.1762 0.801 8.603 0.7287 12.755-0.18 [...]
+ <path id="path9304-5-2-7-8-3-0-2-2-7" d="m-147.29 1086.9c-6.7196 15.023-12.101 29.69-17.375 44.782h-28.286-80.026-82.603-25.71c-5.0982-14.589-10.297-30.282-16.708-44.782 0 0 13.482 18.865 23.578 23.427 5.6081 2.5339 12.623 3.2894 18.421 1.228 7.6415-2.7166 17.807-16.579 17.807-16.579s9.1411 10.698 15.351 13.509c5.8285 2.6378 12.644 2.745 19.035 2.4561 5.6554-0.2556 11.92-0.4688 16.579-3.6842 7.0552-4.8687 14.123-21.491 14.123-21.491s6.8378 13.078 12.281 17.807c4.4913 3.9023 10. [...]
+ </g>
+ <g id="g6994-4-4-5-6">
+ <path id="path9304-5-2-7-9-3-16-5-1-5" d="m-272.65 1095.5s-4.9394 7.6033-7.9767 10.201c-4.2181 3.6078-6.9924 5.7811-12.411 7.4891-5.4087 1.7051-12.953 2.664-18.616 2.3538-5.4768-0.3001-11.112-1.888-16.048-4.2795-4.2906-2.0787-11.127-8.1311-11.127-8.1311-3.3232 4.3118-7.5549 7.3405-11.583 9.5786-5.1507 2.8622-10.24 3.1201-15.586 2.832-10.867-0.5858-21.005-7.3742-29.137-21.138-5.2727-12.47-11.338-25.099-18.912-38.342 8.7295-3.0896 18.903-4.7355 30.187-5.2706-4.5894 12.931-9.3504 [...]
+ <path id="path9304-5-2-7-9-3-3-3-14-5-7-4" d="m-365.99 1115.5c-10.867-0.5858-21.005-7.3742-29.137-21.138-5.2727-12.47-11.338-25.099-18.912-38.342 8.7295-3.0896 18.903-4.7355 30.187-5.2706-4.5894 12.931-9.3504 25.528-7.6664 35.936 9.4806-7.1005 12.547-16.767 15.812-26.354l11.021 38.812c-6.6889-1.1728-3.1317-2.555-20.698-5.8849 3.5198 6.6368 11.578 14.832 20.462 15.639l-1.0681 6.6014zm185.62-6.6014c8.8838-0.8067 16.942-9.0022 20.462-15.639-17.566 3.3299-14.009 4.7121-20.698 5.884 [...]
+ <path id="path9304-5-2-7-9-3-3-9-5-2-1-6" d="m-311.65 1115.5c-5.4768-0.3001-11.112-1.888-16.048-4.2795-4.2906-2.0787-11.127-8.1311-11.127-8.1311-3.3232 4.3118-7.5549 7.3405-11.583 9.5786-5.1507 2.8622-10.24 3.1201-15.586 2.832l-0.18752 1.8729 1.2556-8.4743c5.9737 0.5425 10.31-1.3029 14.107-4.5963 2.7277-2.3659 5.2149-5.4949 5.1822-9.0197-0.0187-2.0187-0.0375-4.0374-0.0562-6.0561-0.012-1.2969-1.6125-3.1325-2.9094-3.1507-1.2358-0.017-1.5777 1.9883-1.9076 3.1793-0.66009 2.3832 0.6 [...]
+ <path id="path6670-7-2-3-8-8" d="m-272.67 1079.3 6.7927 8.052 3.2702 13.197 9.6181 6.7327 14.042 3.0778 14.042-1.7312 10.772-6.9251 1.5389-7.5021 10.965 0.3847 2.116 8.0792 11.157 7.5022 10.003 0.577 12.311-6.5403 6.7327-8.8486 7.3098 2.3083-7.3098 8.4639-8.0792 6.348-6.1556 2.116-4.6167 0.7694h-5.9632l-4.8091-0.5771-4.6167-1.1541-5.5785-3.4625-7.3098-6.7327-6.7327 4.809-6.5403 3.8473-8.4639 2.8854-8.4639 0.5771-10.003-0.9618-8.6563-2.5007-8.2716-5.3862-6.5403-7.5021-2.5607-3.8 [...]
+ <path id="path5631-9-3-2-4-3" d="m-272.65 1048.6c-7.8954 0-12.863 0.8304-18.977 1.464 14.156 19.128 12.553 20.926 13.999 27.449-4.7861-0.5401-10.118-3.0623-12.842-4.9285-4.0116-2.749-6.5313-6.4571-9.7578-9.7109l0.54897 32.206c3.5309-2.8088 6.583-5.7772 10.883-8.3296 2.9496-1.7509 6.4863-3.306 11.167-4.4797 0.17574 9.8408-1.4256 18.75-10.156 24.155-3.0719 1.9018-6.1944 3.5102-9.6985 4.3918-3.6908 0.9286-6.991 1.228-10.796 1.281-3.6114 0.05-7.5026-0.3034-10.979-1.281-3.0199-0.849 [...]
+ <path id="path5631-9-7-9-3-3-0-1" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-203.85 1095.1-0.12597-0.2106c-0.15092-2.5694 0.71875-6.9687 0.71875-6.9687 0.48416-2.19 2.3616-4.533 4.6875-5.375 1.2538-0.4542 2.7761-0.6286 4.125 0.031 0.82261 0.4023 1.4858 0.7143 2.0312 1.2812 0.54546 0.567 0.88412 1.3124 1.25 2.375 0.53493 1.5537 0.30202 3.1738 0.0312 4.5626-0.44672 2.2906-0.39733 4.2935 0.25 5.8437 0.45703 1.0945 1.3768 1.9155 2.5625 2.625-0 [...]
+ <path id="path6497-3-9-6-1-7-7" d="m-272.99 1051.4c-3.7858 0.1318-8.997 0.5737-12.14 0.9303 0 0 5.5922 9.6667 7.9264 14.723 1.6682 3.6138 4.4617 11.298 4.5603 11.298l-0.3465-26.951z" fill="#ffefa7"/>
+ <path id="path6497-3-9-0-84-1-7-1" d="m-297.08 1079.6c0.10498-3.0908-0.68906-7.3455-0.40502-9.9117 0 0 4.576 4.8236 8.6035 6.7293 2.8784 1.362 11.52 3.3848 11.52 3.4653l-19.719-0.2829z" fill="#ffefa7"/>
+ <path id="path6497-3-9-0-5-8-9-1-6" d="m-248.35 1079.6c-0.10498-3.0908 0.68906-7.3455 0.40502-9.9117 0 0-4.576 4.8236-8.6035 6.7293-2.8784 1.362-11.52 3.3848-11.52 3.4653l19.719-0.2829z" fill="#ffefa7"/>
+ <path id="path6497-3-9-0-2-3-8-2-4" d="m-297.26 1080.3c0.10498 3.0908-0.68906 7.3455-0.40502 9.9117 0 0 4.576-4.8236 8.6035-6.7293 2.8784-1.362 11.52-3.3848 11.52-3.4653l-19.719 0.2829z" fill="#e7cd54"/>
+ <path id="path6497-3-9-0-5-7-9-0-2-4" d="m-248.54 1080.3c-0.10498 3.0908 0.68906 7.3455 0.40502 9.9117 0 0-4.576-4.8236-8.6035-6.7293-2.8784-1.362-11.52-3.3848-11.52-3.4653l19.719 0.2829z" fill="#e7cd54"/>
+ <path id="path6646-2-9-7-9" d="m-339.89 1054.2 1.0207 36.235-4.4231-6.2943c-1.5895-2.2621-5.1821-3.9906-7.8254-3.7426-2.1011 0.197-4.0619 0.824-5.2736 2.5518-1.3921 1.985-1.1908 7.315-1.1908 7.315s-1.4657-1.7216-1.8713-3.062c-0.49296-1.6292-0.56959-3.449-0.17012-5.1036 0.27402-1.1351 0.85779-2.2546 1.7012-3.0621 0.82428-0.7893 1.9273-1.4107 3.0621-1.5311 3.8431-0.4081 10.207 3.0621 10.207 3.0621s-1.5081-8.4751-1.1908-12.078c0.48324-5.4888 5.9541-14.29 5.9541-14.29z" fill="#ffefa7"/>
+ <path id="path6646-3-30-5-4-5" d="m-205.17 1054.1-1.0207 36.235 4.4231-6.2943c1.5895-2.2621 5.1821-3.9906 7.8254-3.7426 2.1011 0.197 4.0619 0.824 5.2736 2.5518 1.3921 1.985 1.1908 7.315 1.1908 7.315s1.4657-1.7216 1.8713-3.062c0.49296-1.6292 0.56959-3.449 0.17012-5.1036-0.27402-1.1351-0.85779-2.2546-1.7012-3.0621-0.82428-0.7893-1.9273-1.4107-3.0621-1.5311-3.8431-0.4081-10.207 3.0621-10.207 3.0621s1.5081-8.4751 1.1908-12.078c-0.48324-5.4888-5.9541-14.29-5.9541-14.29z" fill="#e7cd54"/>
+ <path id="path6497-3-9-9-9-2-7-9" d="m-407.13 1061.5c3.5314-1.3705 8.4951-3.0178 11.524-3.9285 0 0-2.2905 10.364-2.4433 15.93-0.10928 3.9789 0.89946 11.907 0.80883 11.946l-9.89-23.948z" fill="#f8eca8"/>
+ <path id="path6497-3-9-9-2-2-4-5-8" d="m-138.16 1061.8c-3.5314-1.3705-8.4951-3.0178-11.524-3.9285 0 0 2.2905 10.364 2.4433 15.93 0.10928 3.9789-0.89946 11.907-0.80883 11.946l9.89-23.948z" fill="#e7cd54"/>
+ <path id="path9304-5-2-7-9-3-3-72-2-7-4" d="m-272.65 1095.5s-4.9394 7.6033-7.9767 10.201c-4.2181 3.6078-6.9924 5.7811-12.411 7.4891-5.4087 1.7051-12.953 2.664-18.616 2.3538-5.4768-0.3001-11.112-1.888-16.048-4.2795-4.2906-2.0787-11.127-8.1311-11.127-8.1311-3.3232 4.3118-7.5549 7.3405-11.583 9.5786-5.1507 2.8622-10.24 3.1201-15.586 2.832-10.867-0.5858-21.005-7.3742-29.137-21.138-5.2727-12.47-11.338-25.099-18.912-38.342 8.7295-3.0896 18.903-4.7355 30.187-5.2706-4.5894 12.931-9.350 [...]
+ </g>
+ </g>
+ <g id="g6083-27-3-3-0" transform="translate(0.000009)" stroke-width="1.1838">
+ <g id="g7602-9-5-8-7" transform="matrix(1.4641 0 0 1.4641 594.14 -1415.8)">
+ <g id="g9013-8-30-8-9-3" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.3676">
+ <path id="path9015-6-90-4-3-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-1-5-7-5" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-5-1-1-1" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-8-1-5-1" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.3676" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-7-2-0-7-0" transform="matrix(1.4641 0 0 1.4641 472.65 -1405)">
+ <g id="g9013-8-3-5-4-5-2" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.3676">
+ <path id="path9015-6-9-02-1-7-9" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-9-8-61-2-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-9-3-4-4-3" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-1-9-5-4-5" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.3676" fill="none"/>
+ </g>
+ </g>
+ <g id="g7602-7-7-9-2-9-8" transform="matrix(-1.4641 0 0 1.4641 -82.739 -1405)">
+ <g id="g9013-8-3-3-3-33-9-4" transform="matrix(.5 0 0 .5 -1617.5 688.21)" stroke-width="2.3676">
+ <path id="path9015-6-9-6-0-6-6-8" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-5-9-5-1-8-0-4" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-7-9-5-5-4-1-1" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-6-1-8-2-8-6-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="2.3676" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g7885-7-3-2-0" transform="translate(467.6 -914.69)" stroke-width="1.7332">
+ <g id="g7849-3-9-3-8" transform="matrix(.99853 -.054185 .054185 .99853 -59.74 -16.657)">
+ <path id="rect7802-9-2-5-5" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" fill="#f6e078"/>
+ <path id="rect7802-4-6-3-9-8" d="m-346.46 1090.7h16.902l2.1993 3.8065h-21.808l2.7068-3.8065z" fill="#f8eca8"/>
+ <path id="rect7802-1-49-0-1-4" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" stroke="#806600" stroke-width="1.7332" fill="none"/>
+ </g>
+ <g id="g7849-7-2-9-9-7" transform="matrix(-.99853 -.054185 -.054185 .99853 -485.55 -16.657)">
+ <path id="rect7802-13-3-2-1-2" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" fill="#f6e078"/>
+ <path id="rect7802-4-8-5-7-6-8" d="m-346.46 1090.7h16.902l2.1993 3.8065h-21.808l2.7068-3.8065z" fill="#ffe9a7"/>
+ <path id="rect7802-1-4-97-2-3-0" d="m-346.46 1090.7h16.902l2.1993 3.8065-2.1993 3.8064h-16.902l-2.7068-3.8064 2.7068-3.8065z" stroke="#806600" stroke-width="1.7332" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g7932-5-2-6-2" transform="matrix(.50801 -.27351 .27351 .50801 -41.96 -181.66)" stroke-width="1.7332">
+ <g id="g11746-2-0-7-0-1-7-4-5" transform="translate(-301.8 -173.48)" stroke-width="1.7332">
+ <path id="path8971-7-4-4-6-7-9-0-4" d="m390.39 381.08s12.056-0.88424 33.297-2.0834c21.242-1.1992 44-1.8289 55.609-1.8289h35.387c11.245 0 34.538 0.62974 55.609 1.8289s33.055 2.2045 33.055 2.2045l7.3876-33.005s-75.7-6.8309-113.75-6.8309c-38.046 0.00001-113.75 6.8309-113.75 6.8309l7.1454 32.884z" fill-rule="evenodd" fill="#d1b948"/>
+ <path id="path8973-3-6-4-47-1-3-8-0" d="m482.92 341.44 29.641 0.14614 0.0643 35.396h-28.107l-1.5987-35.542z" fill-rule="evenodd" fill="#c5a941"/>
+ <path id="path8979-9-0-9-8-8-0-1-6" d="m399.02 346.47 85.628-5.2802-0.0547 34.195-83.535 3.8807-2.0386-32.795z" fill-rule="evenodd" fill="#e7cd54"/>
+ <path id="path8981-7-3-1-4-4-9-9-3" d="m405.94 345.53 57.768-3.8534 1.5287 34.637-57.258 2.6756-2.0384-33.459z" fill-rule="evenodd" fill="#f6e078"/>
+ <path id="path8983-7-2-5-0-0-0-5-0" d="m413.79 344.77 32.903-2.1182 1.5287 34.7-16.197 0.58798-16.197 0.58798-2.0384-33.758z" fill-rule="evenodd" fill="#f8eca8"/>
+ <path id="path8991-9-6-5-0-7-1-5-0" d="m478.97 373c-11.723 0-34.477 0.62611-55.783 1.8289-13.345 0.76851-20.741 2.0497-34.044 3.3554l1.3309 2.8063c13.389-1.2191 19.657-1.4181 33.076-2.2262 21.178-1.1956 43.924-1.8289 55.419-1.8289h35.387c11.128 0 34.433 0.63364 55.435 1.8289 20.937 1.1916 33.698 2.3473 33.698 2.3473l0.64144-2.6573s-12.772-2.4188-33.976-3.6256c-21.139-1.2031-44.436-1.8289-55.798-1.8289h-35.387z" fill-rule="evenodd" fill="#d1b948"/>
+ <path id="path8993-5-9-5-62-7-5-1-5" d="m423.19 344.46c-21.376 1.2068-39.864 3.6462-39.864 3.6462l1.3372 5.8374s17.782-2.3174 38.889-3.509c21.178-1.1956 43.924-1.671 55.419-1.671h35.387c11.128 0 34.784 0.72957 55.786 1.9248 20.937 1.1916 39.16 3.2552 39.16 3.2552l1.0163-5.8374s-18.96-2.4394-40.164-3.6462c-21.139-1.2031-44.436-2.6863-55.798-2.6863h-35.387c-18.632 0.32121-37.21 1.6156-55.782 2.6863h0.00005z" fill-rule="evenodd" fill="#d0b500"/>
+ <path id="path8995-7-3-4-8-4-12-82-7-2" d="m496.5 341.73c38.012-0.0193 76.02 2.041 113.86 6.2343l-6.9279 33.312c-37.64-3.3788-68.451-4.2827-106.51-4.5808m0.5045-34.966c-38.012-0.0193-76.02 2.041-113.86 6.2343l6.9279 33.312c37.64-3.3788 68.451-4.2827 106.51-4.5808" stroke="#806600" stroke-width="1.7332" fill="none"/>
+ </g>
+ <g id="g8876-0-1-2-7-2-5-7-2" transform="matrix(1.0111 0 0 .77383 772.99 -265.67)" stroke-width="1.9595">
+ <path id="path8995-2-0-3-3-9-4-7-0-8-0" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-644.32 561.77-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-1.9091 2.9817-2.0675 5.7008 1.4062 7.875 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-2.2332 54.688-2.4688h35c10.916 0 33.968 0.8703 54.688 2.5 20.625 1.6223 41.688 4.9375 41.688 4.9375 3.5944-2.398 3.2039-5.0807 1.25-7.875 0 0-21.258-3.4064-42.312-5.0625-20.96-1.6 [...]
+ <path id="path8995-2-0-4-0-7-8-1-4-2-0-8" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-454.93 569.96c0.10745-1.3197-0.47864-1.7281-1.4556-3.1253 0 0-21.258-3.4064-42.312-5.0625-20.96-1.6487-43.984-2.5-55.312-2.5h-35c-18.464 0.0721-36.901 1.21-55.313 2.5001l-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-0.95457 1.4908-1.4714 1.6349-1.3154 2.9592 15.614-1.897 28.807-4.0506 43.915-5.2316 23.98-1.8745 49.508-2.2351 72.356-2.328 [...]
+ <path id="path8995-2-0-7-8-0-8-2-8-7-8-4-2" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-687.27 572.98c0.44377 0.60668 1.0848 1.1838 1.9525 1.7269 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-2.2332 54.688-2.4688h35c10.916 0 33.968 0.8703 54.688 2.5 20.625 1.6223 41.688 4.9375 41.688 4.9375 1.1271-0.75199 1.4529-1.1907 1.871-1.9933-39.889-7.1136-76.13-7.8257-114.39-8.1801-37.267-0.34515-79.257 1.8974-117.12 8.4466h0.00005z" f [...]
+ <path id="path8995-2-0-7-3-8-0-5-5-3-4-5" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-644.32 561.77-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-1.9091 2.9817-2.0675 5.7008 1.4062 7.875 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-2.2332 54.688-2.4688h35c10.916 0 33.968 0.8703 54.688 2.5 20.625 1.6223 41.688 4.9375 41.688 4.9375 3.5944-2.398 3.2039-5.0807 1.25-7.875 0 0-21.258-3.4064-42.312-5.0625-20.96-1 [...]
+ </g>
+ <g id="g8876-3-8-3-7-8-7-9-5-5" transform="matrix(.94011 0 0 .77383 732.44 -231.28)" stroke-width="2.0321">
+ <path id="path8995-2-0-0-3-8-4-9-3-9-3-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-644.32 561.77-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-1.9091 2.9817-2.0675 5.7008 1.4062 7.875 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-2.2332 54.688-2.4688h35c10.916 0 33.968 0.8703 54.688 2.5 20.625 1.6223 41.688 4.9375 41.688 4.9375 3.5944-2.398 3.2039-5.0807 1.25-7.875 0 0-21.258-3.4064-42.312-5.0625-20.96-1 [...]
+ <path id="path8995-2-0-4-6-6-1-8-9-89-3-9-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-454.93 569.96c0.10745-1.3197-0.47864-1.7281-1.4556-3.1253 0 0-21.258-3.4064-42.312-5.0625-20.96-1.6487-43.984-2.5-55.312-2.5h-35c-18.464 0.0721-36.901 1.21-55.313 2.5001l-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-0.95457 1.4908-1.4714 1.6349-1.3154 2.9592 15.614-1.897 28.807-4.0506 43.915-5.2316 23.98-1.8745 49.508-2.2351 72.356-2. [...]
+ <path id="path8995-2-0-7-8-2-0-5-5-9-37-0-6-7" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-687.27 572.98c0.44377 0.60668 1.0848 1.1838 1.9525 1.7269 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-2.2332 54.688-2.4688h35c10.916 0 33.968 0.8703 54.688 2.5 20.625 1.6223 41.688 4.9375 41.688 4.9375 1.1271-0.75199 1.4529-1.1907 1.871-1.9933-39.889-7.1136-76.13-7.8257-114.39-8.1801-37.267-0.34515-79.257 1.8974-117.12 8.4466h0.00005z [...]
+ <path id="path8995-2-0-7-2-4-3-8-3-1-1-5-4" style="block-progression:tb;text-indent:0;color:#000000;text-transform:none" d="m-644.32 561.77-0.0312 0.0312h-0.0312c-13.369 1.2568-28.842 2.6278-42.344 5.0312-1.9091 2.9817-2.0675 5.7008 1.4062 7.875 12.963-2.3075 28.246-3.7112 41.625-4.9688 18.145-1.3742 36.44-1.7781 54.688-2.0138h35c10.916 0 33.968 0.41526 54.688 2.045 20.625 1.6223 41.688 4.9375 41.688 4.9375 3.5944-2.398 3.2039-5.0807 1.25-7.875 0 0-21.258-3.4064-42.312-5.0625-20 [...]
+ </g>
+ <g id="g7430-5-5-3-0" transform="translate(.20976 .68990)">
+ <g id="g11952-75-2-7-0" transform="translate(-302.32 -173.09)" stroke-width="3.919">
+ <g id="g9188-7-7-2-6" transform="matrix(.50554 0 0 .38692 -961.11 29.491)">
+ <rect id="rect9190-24-3-1-6" fill-rule="evenodd" height="59.169" width="89.493" y="823.57" x="2840.1" fill="#f6e078"/>
+ <path id="path9192-49-9-8-1" d="m2840.1 823.57h89.493l-89.493 59.169v-59.169z" fill-rule="evenodd" fill="#f8eca8"/>
+ <path id="path9194-9-6-4-3" d="m2929.6 836.05v46.683h-71.619l71.619-46.683z" fill-rule="evenodd" fill="#e7cd54"/>
+ <rect id="rect9196-6-4-21-2" ry="3.0061" height="59.169" width="89.493" stroke="#806600" y="823.57" x="2840.1" stroke-width="3.919" fill="none"/>
+ </g>
+ <g id="g9198-0-92-0-5" transform="matrix(.50554 0 0 .38692 -961.11 29.491)">
+ <g id="g9200-1-3-6-8" stroke-width="3.919">
+ <g id="g9202-6-5-0-5">
+ <rect id="rect9204-2-9-3-0" fill-rule="evenodd" ry="5.1773" height="43.637" width="70.263" stroke="#a0892c" y="831.33" x="2849.7" fill="#2d6afa"/>
+ <path id="path9206-3-7-7-5" d="m2918.5 873.46c-0.9358 0.93579-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57727-3.6642-1.5131-0.9357-0.93579-1.513-2.2301-1.513-3.6642v-33.282c0-1.4341 0.5773-2.7284 1.513-3.6642 0.9358-0.93579 68.172 39.675 67.237 40.611z" fill-rule="evenodd" stroke="#a0892c" fill="#2b96f6"/>
+ <path id="path9208-5-2-8-6" d="m2918.5 873.46c-0.9358 0.93581-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57727-3.6642-1.5131-0.9357-0.93579-1.513-2.2301-1.513-3.6642v-33.282c0-1.4341 0.5773-2.7284 1.513-3.6642 0.4751-0.47512 18.04 9.7588 35.096 20.073 16.539 10.001 32.601 20.077 32.14 20.538z" fill-rule="evenodd" stroke="#d7e3f4" fill="#5183fb"/>
+ <path id="path9210-9-4-4-7" d="m2918.5 832.84c0.9357 0.93579 1.513 2.2301 1.513 3.6642v33.282c0 1.4341-0.5773 2.7284-1.513 3.6642-0.9358 0.93579-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57727-3.6642-1.5131-0.9357-0.93579 66.301-41.547 67.237-40.611z" fill-rule="evenodd" stroke="#afc6e9" fill="#1353b4"/>
+ <path id="path9212-1-2-7-5" d="m2918.5 873.46c-0.9358 0.93579-2.2301 1.5131-3.6642 1.5131h-59.908c-1.4341 0-2.7284-0.57725-3.6642-1.5131-0.4748-0.47478 16.6-11.163 33.661-21.457 0 0 34.512 20.521 33.576 21.457z" fill-rule="evenodd" stroke="#afc6e9" fill="#134fab"/>
+ <rect id="rect9214-9-4-9-7" ry="5.1773" height="43.637" width="70.263" stroke="#a0892c" y="831.33" x="2849.7" fill="none"/>
+ </g>
+ <rect id="rect9216-1-6-5-5" fill-rule="evenodd" ry="0" height="22.304" width="39.367" stroke="#afc6e9" y="841.29" x="2865.2" fill="#135ecb"/>
+ </g>
+ </g>
+ </g>
+ <g id="g11969-6-7-3-3" transform="translate(-302.24 -173.09)" stroke-width="1.7332">
+ <g id="g11756-36-5-3-5">
+ <g id="g14606-9-6-40-9-6-6" transform="matrix(.87076 -.013950 .015580 .77968 -53.131 133.63)" stroke-width="2.1032">
+ <rect id="rect9196-0-6-81-2-0-3" ry="10.771" stroke="#806600" stroke-width="2.1044" fill="#f6e078" fill-rule="evenodd" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" width="35.829" height="22.674" y="340.21" x="494.63"/>
+ <rect id="rect8641-5-6-9-62-8-2" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" fill-rule="evenodd" ry="8.271" height="16.542" width="29.954" y="343.28" x="497.57" fill="#306947"/>
+ <path id="path8643-2-3-5-96-9-7" d="m565.02 299.34c0.16428 1.1753-0.61499 3.213-1.9202 4.2858-2.2356 1.8375-6.0141 2.4602-9.2376 2.7557-5.1056 0.46803-8.7752-2.1575-9.2208-5.3458-0.26654-1.907 0.5917-4.4462 2.7286-5.7076 1.4358-0.84752 3.6705-1.3512 5.7223-1.5393 3.4341-0.3148 8.07 0.0272 10.463 1.8022 1.1645 0.86395 1.3193 2.7051 1.4652 3.7489z" fill-rule="evenodd" fill="#36a464"/>
+ <rect id="rect8646-7-4-5-99-7-1" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" ry="8.271" height="16.542" width="29.954" stroke="#a0892c" y="343.28" x="497.57" stroke-width="2.1044" fill="none"/>
+ <path id="path8648-3-4-1-80-4-9" d="m816.44 431.48c0 1.6327-2.5369 2.9563-5.6663 2.9563s-5.6663-1.3236-5.6663-2.9563 2.5369-2.9563 5.6663-2.9563 5.6663 1.3236 5.6663 2.9563z" fill-rule="evenodd" transform="matrix(.77012 -.070597 .13944 .99765 -131.26 -73.481)" fill="#abe8c4"/>
+ </g>
+ <g id="g14768-2-7-3-5-5" transform="matrix(-.81814 .14282 .15467 .88602 852.1 11.28)" stroke-width="2.0054">
+ <path id="path14614-9-9-7-6-9-1" d="m626.17 310.88-23.701-12.771 23.701-12.082 2.8814 13.147-2.8814 11.706z" stroke="#806600" stroke-width="2.0054" fill="#f6e078"/>
+ <path id="path14614-9-3-8-2-8-3-75-7" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.657 8.5789-5.657 9.4386z" fill="#ff0a3e"/>
+ <path id="path14614-9-3-2-8-0-7-7-6" d="m626.17 307.47-17.183-9.2586 22.66-0.18009-5.4769 9.4386z" fill="#bc0028"/>
+ <path id="path14766-9-4-5-4-0" d="m452.4 250.56 22.953-0.0249" transform="translate(156.53 47.58)" stroke="#f4d7d7" stroke-width="2.0054" fill="none"/>
+ <path id="path14614-9-3-8-3-2-4-8-5-5" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.8371 8.3988-5.8371 9.6187z" stroke="#a48d2f" stroke-width="2.0054" fill="none"/>
+ </g>
+ <g id="g10214-5-7-8-6" transform="translate(.77786 -117.02)" stroke-width="2.1398">
+ <g id="g8305-3-71-7-1" transform="matrix(.9 0 0 .9 292.52 -504.08)">
+ <g id="g8172-96-6-95-1" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-53-13-9-5" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.7551">
+ <path id="path9015-4-7-4-6-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-2-3-6-9" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-1-2-8-0" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-84-2-5-4" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.7551" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-2-1-2-7" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-10-1-8-2" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.7551">
+ <path id="path9015-4-3-6-1-3-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-0-2-9-3" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-3-3-3-0" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-7-3-3-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.7551" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g8305-1-8-0-3-3" transform="matrix(.9 0 0 .9 241.08 -501.27)">
+ <g id="g8172-5-47-0-9-4" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-8-9-4-1-2" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.7551">
+ <path id="path9015-4-2-5-5-44-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-9-3-7-5-3" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-8-3-0-2-1" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-2-6-1-6-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.7551" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-0-0-8-9-9" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-4-89-6-50-7" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.7551">
+ <path id="path9015-4-3-8-7-3-3-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-5-4-0-02-1" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-8-59-9-8-4" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-3-7-6-3-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.7551" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ <g id="g11756-9-5-2-1-0" transform="matrix(-1 0 0 1 994.39 0)">
+ <g id="g14606-9-6-4-74-8-7-0" transform="matrix(.87076 -.013950 .015580 .77968 -53.131 133.63)" stroke-width="2.1032">
+ <rect id="rect9196-0-6-1-5-4-8-4" ry="10.771" stroke="#806600" stroke-width="2.1044" fill="#f6e078" fill-rule="evenodd" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" width="35.829" height="22.674" y="340.21" x="494.63"/>
+ <rect id="rect8641-5-6-6-87-6-6-6" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" fill-rule="evenodd" ry="8.271" height="16.542" width="29.954" y="343.28" x="497.57" fill="#306947"/>
+ <path id="path8643-2-3-1-95-6-8-9" d="m565.02 299.34c0.16428 1.1753-0.61499 3.213-1.9202 4.2858-2.2356 1.8375-6.0141 2.4602-9.2376 2.7557-5.1056 0.46803-8.7752-2.1575-9.2208-5.3458-0.26654-1.907 0.5917-4.4462 2.7286-5.7076 1.4358-0.84752 3.6705-1.3512 5.7223-1.5393 3.4341-0.3148 8.07 0.0272 10.463 1.8022 1.1645 0.86395 1.3193 2.7051 1.4652 3.7489z" fill-rule="evenodd" fill="#36a464"/>
+ <rect id="rect8646-7-4-2-9-2-6-7" transform="matrix(.99582 -.091287 .13843 .99037 0 0)" ry="8.271" height="16.542" width="29.954" stroke="#a0892c" y="343.28" x="497.57" stroke-width="2.1044" fill="none"/>
+ <path id="path8648-3-4-0-6-5-7-3" d="m816.44 431.48c0 1.6327-2.5369 2.9563-5.6663 2.9563s-5.6663-1.3236-5.6663-2.9563 2.5369-2.9563 5.6663-2.9563 5.6663 1.3236 5.6663 2.9563z" fill-rule="evenodd" transform="matrix(.77012 -.070597 .13944 .99765 -131.26 -73.481)" fill="#abe8c4"/>
+ </g>
+ <g id="g14768-2-4-6-1-4-9" transform="matrix(-.81814 .14282 .15467 .88602 852.1 11.28)" stroke-width="2.0054">
+ <path id="path14614-9-9-4-8-7-0-3" d="m626.17 310.88-23.701-12.771 23.701-12.082 2.8814 13.147-2.8814 11.706z" stroke="#806600" stroke-width="2.0054" fill="#f6e078"/>
+ <path id="path14614-9-3-8-2-5-5-1-0-2" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.657 8.5789-5.657 9.4386z" fill="#ff0a3e"/>
+ <path id="path14614-9-3-2-8-9-28-8-8-9" d="m626.17 307.47-17.183-9.2586 22.66-0.18009-5.4769 9.4386z" fill="#bc0028"/>
+ <path id="path14766-9-7-3-4-7-4" d="m452.4 250.56 22.953-0.0249" transform="translate(156.53 47.58)" stroke="#f4d7d7" stroke-width="2.0054" fill="none"/>
+ <path id="path14614-9-3-8-3-2-5-9-0-6-8" d="m626.17 307.47-17.183-9.2586 17.183-8.759 5.8371 8.3988-5.8371 9.6187z" stroke="#a48d2f" stroke-width="2.0054" fill="none"/>
+ </g>
+ <g id="g10214-3-33-7-4-3" transform="translate(.77786 -117.02)" stroke-width="2.1398">
+ <g id="g8305-9-3-7-6-9" transform="matrix(.9 0 0 .9 292.52 -504.08)">
+ <g id="g8172-0-9-1-3-5" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-3-1-2-7-5" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.7551">
+ <path id="path9015-4-26-44-2-8-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-8-5-7-4-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-9-2-4-6-7" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-1-6-7-8-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.7551" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-4-9-5-2-9" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-8-5-7-3-8" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.7551">
+ <path id="path9015-4-3-7-0-3-0-3" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-1-3-8-4-0" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-9-0-9-4-9" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-31-2-37-3-7" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.7551" fill="none"/>
+ </g>
+ </g>
+ </g>
+ <g id="g8305-1-1-8-1-3-1" transform="matrix(.9 0 0 .9 241.08 -501.27)">
+ <g id="g8172-5-4-3-5-2-8" transform="matrix(.9 0 0 .9 18.93 108.07)">
+ <g id="g9013-80-8-5-1-7-9-5" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.7551">
+ <path id="path9015-4-2-9-7-5-7-0" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-9-0-8-7-9-4" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-8-9-6-2-7-2" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-2-3-8-4-1-6" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.7551" fill="none"/>
+ </g>
+ </g>
+ <g id="g8172-3-0-4-67-4-3-0" transform="matrix(.9 0 0 .9 19.798 121.61)">
+ <g id="g9013-80-4-4-7-4-9-3-9" transform="matrix(.45 0 0 .45 -1021.1 731)" stroke-width="4.7551">
+ <path id="path9015-4-3-8-5-0-9-9-9" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" fill-rule="evenodd" transform="translate(0 -2.0633)" fill="#ececec"/>
+ <path id="path9017-6-6-5-7-08-6-0-8" d="m2680.8 788.62 1.995 2.5122 3.8421 2.1427 3.3249 0.14778 3.5466-0.36944 3.7682-2.9555 1.6255-2.5122 1.0345-3.916v-4.0638l-1.6256-2.2905-2.3643-2.7338-2.9556-1.1822s1.536 2.7184 1.9211 3.9899c0.3698 1.2211 0.3941 2.812 0.1478 4.0638-0.2379 1.2086-0.8568 2.7319-1.6255 3.6944-0.8515 1.0661-2.4648 2.3639-3.6943 2.9555-1.3729 0.66057-3.1321 0.84093-4.6549 0.88664-1.2898 0.0387-4.2855-0.36943-4.2855-0.36943z" fill-rule="evenodd" fill="#ccc"/>
+ <path id="path9019-0-5-8-5-7-0-4-9" d="m2690.3 778.01c0 1.8965-1.5558 3.4358-3.4727 3.4358s-3.4727-1.5392-3.4727-3.4358c0-0.97409 0.7666-0.9438 1.4256-1.5692 0.624-0.59226 1.6935-1.6845 2.6259-1.6845 1.9169 0 2.8939 1.3572 2.8939 3.2537z" fill-rule="evenodd" transform="matrix(1.6596 0 0 1.6237 -1773.2 -485.36)" fill="#fff"/>
+ <path id="path9021-3-9-3-0-6-1-7-2" d="m2700.2 785.03c0 5.8876-4.6959 10.66-10.488 10.66-5.7927 0-10.488-4.7728-10.488-10.66 0-5.8876 4.6958-10.66 10.488-10.66 5.7926 0 10.488 4.7728 10.488 10.66z" transform="translate(0 -2.0633)" stroke="#808080" stroke-width="4.7551" fill="none"/>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/test/asprintf4win.h b/test/asprintf4win.h
new file mode 100644
index 0000000..6a5b01f
--- /dev/null
+++ b/test/asprintf4win.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2001 Federico Di Gregorio <fog at debian.org>
+ * Copyright (C) 1991, 1994-1999, 2000, 2001 Free Software Foundation, Inc.
+ *
+ * This code has been derived from an example in the glibc2 documentation.
+ * This file is part of the psycopg module.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2,
+ * or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * asprintf.c -- asprintf() implementation for braindamaged operating systems
+ * $Id: asprintf.c 554 2004-10-30 00:19:27Z fog $
+ */
+
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+#include <stdarg.h>
+#include <stdio.h>
+#ifndef _WIN32
+#include <sys/time.h>
+#endif
+#include <stdlib.h>
+
+#ifdef _WIN32
+#define vsnprintf _vsnprintf
+#endif
+
+int
+asprintf(char **buffer, char *fmt, ...)
+{
+ /* Guess we need no more than 200 chars of space. */
+ int size = 200;
+ int nchars;
+ va_list ap;
+
+ *buffer = (char*)malloc(size);
+ if (*buffer == NULL) return -1;
+
+ /* Try to print in the allocated space. */
+ va_start(ap, fmt);
+ nchars = vsnprintf(*buffer, size, fmt, ap);
+ va_end(ap);
+
+ if (nchars >= size)
+ {
+ char *tmpbuff;
+ /* Reallocate buffer now that we know how much space is needed. */
+ size = nchars+1;
+ tmpbuff = (char*)realloc(*buffer, size);
+
+
+ if (tmpbuff == NULL) { /* we need to free it*/
+ free(*buffer);
+ return -1;
+ }
+
+ *buffer=tmpbuff;
+ /* Try again. */
+ va_start(ap, fmt);
+ nchars = vsnprintf(*buffer, size, fmt, ap);
+ va_end(ap);
+ }
+
+ if (nchars < 0) return nchars;
+ return size;
+}
diff --git a/test/bicycle.svg b/test/bicycle.svg
new file mode 100644
index 0000000..cd8617e
--- /dev/null
+++ b/test/bicycle.svg
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="shopping_bicycle.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs22">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ id="perspective24" />
+ </defs>
+ <metadata
+ id="metadata10">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="1003"
+ inkscape:window-width="1400"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="0.70710678"
+ inkscape:cx="615.26172"
+ inkscape:cy="415.25176"
+ inkscape:window-x="0"
+ inkscape:window-y="20"
+ inkscape:current-layer="svg2" />
+ <g
+ id="g1327">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 L 1.704,516.927 C 1.704,557.771 22.598,579.156 63.896,579.156 L 515.92,579.156 C 557.227,579.156 578.149,558.84 578.149,516.927 L 578.149,66.804 C 578.149,24.203 557.227,1.768 514.627,1.768 C 514.624,1.768 66.133,1.625 66.275,1.768 z"
+ style="fill:#111111;stroke:#eeeeee;stroke-width:3.40799999"
+ id="path1329" />
+ </g>
+ <g
+ id="g2319"
+ transform="translate(879.29125,36.805119)">
+ <path
+ id="path2323"
+ style="fill:#ffffff;stroke:none"
+ d="" />
+ </g>
+ <g
+ id="g2325"
+ transform="translate(879.29125,36.805119)">
+ <path
+ id="path2329"
+ style="fill:#ffffff;stroke:none"
+ d="" />
+ </g>
+ <path
+ transform="matrix(-0.9834594,0,0,0.9834594,323.42176,-101.89163)"
+ style="font-size:12px;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:26;stroke-opacity:1"
+ sodipodi:type="arc"
+ sodipodi:ry="78.380615"
+ sodipodi:rx="78.380615"
+ sodipodi:cy="461.96271"
+ sodipodi:cx="200.53224"
+ id="path596"
+ d="M 278.91286,461.96271 A 78.380615,78.380615 0 1 1 122.15163,461.96271 A 78.380615,78.380615 0 1 1 278.91286,461.96271 z" />
+ <path
+ transform="matrix(-0.9834594,0,0,0.9834594,653.78261,-103.3933)"
+ style="font-size:12px;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:26;stroke-opacity:1"
+ sodipodi:type="arc"
+ sodipodi:ry="78.380615"
+ sodipodi:rx="78.380615"
+ sodipodi:cy="461.96271"
+ sodipodi:cx="200.53224"
+ id="path595"
+ d="M 278.91286,461.96271 A 78.380615,78.380615 0 1 1 122.15163,461.96271 A 78.380615,78.380615 0 1 1 278.91286,461.96271 z" />
+ <path
+ style="font-size:12px;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:20.52971458;stroke-linejoin:round;stroke-opacity:1"
+ sodipodi:nodetypes="ccccc"
+ id="path594"
+ d="M 395.50064,219.78507 L 197.2842,220.78618 L 127.20771,350.92828 L 261.35419,350.92828 L 401.5072,255.82445" />
+ <path
+ style="font-size:12px;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:25;stroke-linecap:round"
+ sodipodi:nodetypes="ccccscccccsscsccccccccccccssccc"
+ id="path593"
+ d="M 387.8839,141.79102 C 398.65069,141.79102 406.78894,141.55079 415.13057,154.29434 C 417.53169,158.54247 418.62948,163.72941 417.74288,168.89256 C 416.6793,174.76358 413.20345,180.53176 409.10585,183.94641 C 403.67995,188.468 398.53061,188.1192 399.36281,192.18386 C 400.43059,197.39931 403.6893,204.64686 407.21088,216.41541 C 410.78555,228.36126 415.03025,242.98187 419.1968,257.38265 C 423.36335,271.7834 427.4534,285.97209 430.69096,297.02835 C 432.30979,302.55645 433.72356,307.3 [...]
+ <path
+ style="font-size:12px;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:24.58648491;stroke-opacity:1"
+ id="path599"
+ d="M 258.78569,346.85349 L 190.82923,180.50178" />
+ <path
+ style="font-size:12px;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:8.97406769;stroke-linecap:round;stroke-opacity:1"
+ id="path600"
+ d="M 282.14699,304.37879 L 241.08743,399.94641"
+ sodipodi:nodetypes="cc" />
+ <path
+ transform="matrix(-0.2772911,0,0,0.2449148,316.20929,238.03626)"
+ style="font-size:12px;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:31.30500031;stroke-opacity:1"
+ sodipodi:type="arc"
+ sodipodi:ry="78.380615"
+ sodipodi:rx="78.380615"
+ sodipodi:cy="461.96271"
+ sodipodi:cx="200.53224"
+ id="path597"
+ d="M 278.91286,461.96271 A 78.380615,78.380615 0 1 1 122.15163,461.96271 A 78.380615,78.380615 0 1 1 278.91286,461.96271 z" />
+ <path
+ style="font-size:12px;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:12.53958607;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="cc"
+ id="path601"
+ d="M 300.4261,304.42236 L 264.15616,304.75482" />
+ <path
+ style="font-size:12px;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:12.53910732;stroke-linecap:round;stroke-opacity:1"
+ sodipodi:nodetypes="cc"
+ id="path602"
+ d="M 259.57689,398.57363 L 223.30695,398.9061" />
+ <path
+ style="font-size:12px;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.55582194pt;stroke-opacity:1"
+ sodipodi:nodetypes="cssccc"
+ id="path603"
+ d="M 157.55855,165.63576 L 242.85812,165.63576 C 246.04359,165.63576 250.15505,171.27063 246.04359,175.01517 C 241.59685,179.24723 201.62409,187.93397 201.62409,187.93397 C 201.62409,187.93397 190.65196,190.94246 184.81192,190.2346 C 178.97192,189.52672 158.79734,187.75702 157.55855,165.63576 z" />
+</svg>
diff --git a/test/car_repair.svg b/test/car_repair.svg
new file mode 100644
index 0000000..6ed9054
--- /dev/null
+++ b/test/car_repair.svg
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="shopping_car_repair.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata10">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="1005"
+ inkscape:window-width="1280"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="0.70710678"
+ inkscape:cx="-28.16038"
+ inkscape:cy="399.03428"
+ inkscape:window-x="112"
+ inkscape:window-y="18"
+ inkscape:current-layer="svg2" />
+ <defs
+ id="defs4">
+ <clipPath
+ id="clipoutline2"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ d="M 55.8,12 L 56.56,12.16 C 65.4,9.22 85.24,20.8 80.82,31.12 C 79.7,32.74 79.89,35.62 81.24,37.43 L 56.43,62.25 C 55.04,60.86 51.95,60.89 50.53,62.25 L 9.5,101.63 C 5.76,105.22 8.7,108.27 10.28,109.88 L 17.64,117.24 C 19.25,118.84 23.5,121 26.52,117.8 L 65.24,76.99 C 66.59,75.57 66.6,72.52 65.24,71.12 C 65.24,71.12 65.25,71.1 65.24,71.1 L 90.15,46.2 C 92.78,48.57 95.263827,48.774854 97.62,48.13 C 102.17057,46.884568 104.70725,51.336643 107.43,54.59 L 106.2,55.8 C 104.38,57.64 1 [...]
+ id="outline2" />
+ </clipPath>
+ <clipPath
+ id="clipoutline1"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ d="M 22.42,17.2 L 35.38,30.15 L 32.88,38.93 L 24.1,41.43 L 11.14,28.47 L 5.28,34.33 L 20.17,55.79 L 37.73,52.45 L 99.36,118.07 C 108.8,127.58 121.53,113.32 112.7,105.2 L 46.85,42.92 L 50.86,25.16 L 28.72,10.89 L 22.42,17.2 z M 103.48,109.17 C 105.16,107.49 107.88,107.49 109.56,109.17 C 111.24,110.85 111.24,113.57 109.56,115.25 C 107.88,116.92 105.16,116.92 103.48,115.25 C 101.8,113.57 101.8,110.85 103.48,109.17 z"
+ id="outline1" />
+ </clipPath>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ id="perspective12" />
+ <style
+ type="text/css"
+ id="style6">
+
+ .fil0 {fill:#EF7900}
+
+ </style>
+ <inkscape:perspective
+ id="perspective6807"
+ inkscape:persp3d-origin="29.116032 : 19.410688 : 1"
+ inkscape:vp_z="58.232063 : 29.116032 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 29.116032 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective6954"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 290 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <marker
+ viewBox="0 0 10 10"
+ refY="5"
+ refX="10"
+ orient="auto"
+ markerWidth="4"
+ markerUnits="strokeWidth"
+ markerHeight="3"
+ id="ArrowStart">
+ <path
+ id="path2295"
+ d="M 10 0 L 0 5 L 10 10 z" />
+ </marker>
+ <marker
+ viewBox="0 0 10 10"
+ refY="5"
+ refX="0"
+ orient="auto"
+ markerWidth="4"
+ markerUnits="strokeWidth"
+ markerHeight="3"
+ id="ArrowEnd">
+ <path
+ id="path2292"
+ d="M 0 0 L 10 5 L 0 10 z" />
+ </marker>
+ <inkscape:perspective
+ id="perspective7597"
+ inkscape:persp3d-origin="178.5405 : 158.483 : 1"
+ inkscape:vp_z="357.08099 : 237.7245 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 237.7245 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <g
+ id="g1327">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 L 1.704,516.927 C 1.704,557.771 22.598,579.156 63.896,579.156 L 515.92,579.156 C 557.227,579.156 578.149,558.84 578.149,516.927 L 578.149,66.804 C 578.149,24.203 557.227,1.768 514.627,1.768 C 514.624,1.768 66.133,1.625 66.275,1.768 z"
+ style="fill:#111111;stroke:#eeeeee;stroke-width:3.40799999"
+ id="path1329" />
+ </g>
+ <path
+ style="fill:#ffffff;stroke:none"
+ d="M 141.14967,158.36231 C 119.80221,158.36231 108.47786,170.01662 103.24986,183.65843 L 75.498084,255.31598 C 64.496777,256.72664 44.994807,269.64014 44.994807,294.10338 L 44.994807,385.22859 L 72.006925,385.22859 L 72.006925,414.37092 C 72.006925,450.22454 122.7471,449.80228 122.74711,414.37092 L 122.74711,385.22859 L 214.02027,385.22859 L 214.0499,385.22859 L 305.32301,385.22859 L 305.32301,414.37092 C 305.32301,449.80228 356.06294,450.22454 356.06323,414.37092 L 356.06323,385.22 [...]
+ id="path2301" />
+ <g
+ id="g2319"
+ transform="translate(879.29125,36.805119)">
+ <path
+ id="path2323"
+ style="fill:#ffffff;stroke:none"
+ d="" />
+ </g>
+ <g
+ id="g2325"
+ transform="translate(879.29125,36.805119)">
+ <path
+ id="path2329"
+ style="fill:#ffffff;stroke:none"
+ d="" />
+ </g>
+ <g
+ id="spanner"
+ transform="matrix(-1.9177282,-1.988248,1.988248,-1.9177282,460.24478,551.21965)"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:2.34710145;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
+ <use
+ height="580"
+ width="580"
+ y="0"
+ x="0"
+ xlink:href="#outline1"
+ class="outline-big"
+ id="use4649"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:2.34710145;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <use
+ height="580"
+ width="580"
+ y="0"
+ x="0"
+ xlink:href="#outline1"
+ class="outline-small"
+ id="use4651"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:2.34710145;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <use
+ height="580"
+ width="580"
+ y="0"
+ x="0"
+ xlink:href="#outline1"
+ class="aluminium4"
+ id="use4653"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:2.34710145;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <use
+ height="580"
+ width="580"
+ y="0"
+ x="0"
+ class="stroke-highlight"
+ xlink:href="#outline1"
+ clip-path="url(#clipoutline1)"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:2.34710145;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="use4655" />
+ <path
+ class="high-specularity"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:2.34710145;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 24.33,15.4 L 37.78,28.78 L 34.45,40.47 L 23.5,43.74 L 9.9319417,30 L 5.2,34.54 L 19.4,54.48 L 38.3,50.34 L 100.8,116.7 C 108.3,125 121,114.03 111.94,105.1 L 45.04,42 L 48.9,24.83 L 28.94,10.8 L 24.33,15.4 z M 104.3,108.7 C 105.97,107.03 108.93,106.7 110.6,108.4 C 112.3,110.07 113.66,113.03 111.25,116.24 C 109.25,118.24 106.05,118.16 104.05,116 C 102.37,114.32 102.6,110.4 104.3,108.7 z"
+ id="path4657" />
+ <path
+ class="specularity"
+ style="fill:#ffffff;stroke:#ffffff;stroke-width:2.34710145;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 24.2,15.42 L 47.67,39.07 L 50.89,25.2 L 28.79,10.8 L 24.2,15.42 z"
+ id="path4659" />
+ </g>
+</svg>
diff --git a/test/check_sql_stmt.c b/test/check_sql_stmt.c
new file mode 100644
index 0000000..4df231a
--- /dev/null
+++ b/test/check_sql_stmt.c
@@ -0,0 +1,672 @@
+/*
+
+ check_sql_stmt.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2011
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifndef _WIN32
+#include <dirent.h>
+#include <fnmatch.h>
+#endif
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#ifdef _WIN32
+#include "fnmatch4win.h"
+#include "scandir4win.h"
+#include "asprintf4win.h"
+#include "fnmatch_impl4win.h"
+#endif
+
+struct test_data
+{
+ char *test_case_name;
+ char *database_name;
+ char *sql_statement;
+ int expected_rows;
+ int expected_columns;
+ char **expected_results;
+ int *expected_precision;
+};
+
+struct db_conn
+{
+ sqlite3 *db_handle;
+ char *db_path;
+ int read_only;
+ const void *cache;
+};
+
+static void
+close_connection (struct db_conn *conn)
+{
+ if (conn->db_path != NULL)
+ free (conn->db_path);
+ conn->db_path = NULL;
+ if (conn->db_handle != NULL)
+ sqlite3_close (conn->db_handle);
+ conn->db_handle = NULL;
+ if (conn->cache == NULL)
+ spatialite_cleanup ();
+}
+
+static void
+save_connection (struct db_conn *conn, const char *database_name,
+ sqlite3 * db_handle, int read_only, int empty_db)
+{
+ int len = strlen (database_name);
+ conn->db_handle = db_handle;
+ conn->read_only = read_only;
+ if (read_only)
+ {
+ conn->db_path = malloc (len - 2);
+ memcpy (conn->db_path, database_name, len - 3);
+ *(conn->db_path + len - 3) = '\0';
+ }
+ else if (empty_db)
+ {
+ conn->db_path = malloc (9);
+ strcpy (conn->db_path, ":memory:");
+ }
+ else
+ {
+ conn->db_path = malloc (len + 1);
+ strcpy (conn->db_path, database_name);
+ }
+}
+
+static int
+compare_path (const char *pth1, const char *pth2, int read_only)
+{
+ int ret = 0;
+ if (!read_only)
+ {
+ if (strcmp (pth1, pth2) == 0)
+ ret = 1;
+ }
+ else
+ {
+ if (strncmp (pth1, pth2, strlen (pth2) - 3) == 0)
+ ret = 1;
+ }
+ return ret;
+}
+
+static int
+load_dyn_extensions (sqlite3 * db_handle)
+{
+ int ret;
+ char *err_msg = NULL;
+ sqlite3_enable_load_extension (db_handle, 1);
+ ret =
+ sqlite3_exec (db_handle, "SELECT load_extension('mod_rasterlite2')",
+ NULL, NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "load_extension(mod_rasterlite2) error: %s\n",
+ err_msg);
+ sqlite3_free (err_msg);
+ return 0;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT load_extension('mod_spatialite')",
+ NULL, NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "load_extension('mod_spatialite') error: %s\n",
+ err_msg);
+ sqlite3_free (err_msg);
+ return 0;
+ }
+ return 1;
+}
+
+int
+do_one_case (struct db_conn *conn, const struct test_data *data,
+ int load_extension)
+{
+ sqlite3 *db_handle = NULL;
+ int ret;
+ char *err_msg = NULL;
+ int i;
+ char **results;
+ int rows;
+ int columns;
+ int read_only = 0;
+ int empty_db = 0;
+ int not_memory_db = 0;
+
+ fprintf (stderr, "Test case: %s\n", data->test_case_name);
+ if (strncmp
+ ("_RO", data->database_name + strlen (data->database_name) - 3,
+ strlen ("_RO")) == 0)
+ read_only = 1;
+ if (strcmp ("NEW:memory:", data->database_name) == 0)
+ empty_db = 1;
+ if (conn->db_handle != NULL)
+ {
+ if (empty_db)
+ ;
+ else if (compare_path (conn->db_path, data->database_name, read_only))
+ {
+ if (conn->read_only == read_only)
+ {
+ db_handle = conn->db_handle;
+ goto skip_init;
+ }
+ }
+ close_connection (conn);
+ }
+
+ if (conn->cache == NULL && !load_extension)
+ spatialite_init (0);
+
+ /* This hack checks if the name ends with _RO */
+ if (strncmp
+ ("_RO", data->database_name + strlen (data->database_name) - 3,
+ strlen ("_RO")) == 0)
+ {
+ fprintf (stderr, "opening read_only\n");
+ read_only = 1;
+ ret =
+ sqlite3_open_v2 (data->database_name, &db_handle,
+ SQLITE_OPEN_READONLY, NULL);
+ }
+ else if (empty_db)
+ {
+ ret =
+ sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
+ NULL);
+ }
+ else
+ {
+ if (strcmp (data->database_name, ":memory:") != 0)
+ not_memory_db = 1;
+ ret =
+ sqlite3_open_v2 (data->database_name, &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
+ NULL);
+ }
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "cannot open %s db: %s\n", data->database_name,
+ sqlite3_errmsg (db_handle));
+ sqlite3_close (db_handle);
+ db_handle = NULL;
+ return -1;
+ }
+
+ if (load_extension)
+ {
+ if (!load_dyn_extensions (db_handle))
+ {
+ sqlite3_close (db_handle);
+ db_handle = NULL;
+ return -3;
+ }
+ }
+ else
+ {
+ if (conn->cache != NULL)
+ spatialite_init_ex (db_handle, conn->cache, 0);
+ rl2_init (db_handle, 0);
+ }
+ save_connection (conn, data->database_name, db_handle, read_only, empty_db);
+
+ if (read_only || not_memory_db)
+ goto skip_init;
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+ skip_init:
+
+ ret =
+ sqlite3_get_table (db_handle, data->sql_statement, &results, &rows,
+ &columns, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -10;
+ }
+ if ((rows != data->expected_rows) || (columns != data->expected_columns))
+ {
+ fprintf (stderr, "Unexpected error: bad result: %i/%i.\n", rows,
+ columns);
+ return -11;
+ }
+ for (i = 0; i < (data->expected_rows + 1) * data->expected_columns; ++i)
+ {
+ if (results[i] != NULL && data->expected_precision[i] == 0)
+ {
+ data->expected_precision[i] = strlen (results[i]);
+ }
+ if (results[i] == NULL)
+ {
+ if (strcmp ("(NULL)", data->expected_results[i]) == 0)
+ {
+ /* we expected this */
+ continue;
+ }
+ else
+ {
+ fprintf (stderr, "Null value at %i.\n", i);
+ fprintf (stderr, "Expected value was: %s\n",
+ data->expected_results[i]);
+ return -12;
+ }
+ }
+ else if (strlen (results[i]) == 0)
+ {
+ fprintf (stderr, "zero length result at %i\n", i);
+ fprintf (stderr, "Expected value was : %s|\n",
+ data->expected_results[i]);
+ return -13;
+ }
+ else if (strncmp
+ (results[i], data->expected_results[i],
+ data->expected_precision[i]) != 0)
+ {
+ fprintf (stderr, "Unexpected value at %i: %s|\n", i,
+ results[i]);
+ fprintf (stderr, "Expected value was : %s|\n",
+ data->expected_results[i]);
+ return -14;
+ }
+ }
+ sqlite3_free_table (results);
+
+ return 0;
+}
+
+int
+get_clean_line (FILE * f, char **line)
+{
+ size_t len = 0;
+ ssize_t num_read = 0;
+ ssize_t end = 0;
+ char *tmp_line = NULL;
+ char prev;
+
+#if !defined(_WIN32) &&!defined(__APPLE__)
+/* expecpting to be on a sane minded platform [linux-like] */
+ num_read = getline (&(tmp_line), &len, f);
+#else
+/* neither Windows nor MacOsX support getline() */
+ len = 1024 * 1024;
+ tmp_line = malloc (len);
+ if (fgets (tmp_line, len, f) == NULL)
+ {
+ free (tmp_line);
+ num_read = -1;
+ }
+ else
+ num_read = strlen (tmp_line);
+#endif
+
+ if (num_read < 1)
+ {
+ fprintf (stderr, "failed to read at %li: %li\n", ftell (f), num_read);
+ return -1;
+ }
+ /* trim the trailing new line and any comments */
+ prev = '\0';
+ for (end = 0; end < num_read; ++end)
+ {
+ if (*(tmp_line + end) == '\n')
+ break;
+ if (*(tmp_line + end) == '#' && prev != '\'' && prev != '"')
+ break;
+ prev = *(tmp_line + end);
+ }
+ /* trim any trailing spaces */
+ while (end > 0)
+ {
+ if (*(tmp_line + end - 1) != ' ')
+ {
+ break;
+ }
+ *(tmp_line + end - 1) = '\0';
+ end--;
+ }
+ *line = malloc (end + 1);
+ memcpy (*line, tmp_line, end);
+ (*line)[end] = '\0';
+ free (tmp_line);
+ return 0;
+}
+
+void
+handle_precision (char *expected_result, int *precision)
+{
+ int i;
+ int prcsn;
+ int result_len = strlen (expected_result);
+ *precision = 0;
+ for (i = result_len - 1; i >= 0; --i)
+ {
+ if (expected_result[i] == ':')
+ {
+ prcsn = atoi (&(expected_result[i + 1]));
+ if (prcsn > 0)
+ {
+ expected_result[i] = '\0';
+ *precision = prcsn;
+ }
+ break;
+ }
+ }
+}
+
+struct test_data *
+read_one_case (const char *filepath)
+{
+ int num_results;
+ int i;
+ char *tmp;
+ FILE *f;
+ struct test_data *data;
+
+ f = fopen (filepath, "r");
+
+ data = malloc (sizeof (struct test_data));
+ get_clean_line (f, &(data->test_case_name));
+ get_clean_line (f, &(data->database_name));
+ get_clean_line (f, &(data->sql_statement));
+ get_clean_line (f, &(tmp));
+ data->expected_rows = atoi (tmp);
+ free (tmp);
+ get_clean_line (f, &(tmp));
+ data->expected_columns = atoi (tmp);
+ free (tmp);
+ num_results = (data->expected_rows + 1) * data->expected_columns;
+ data->expected_results = malloc (num_results * sizeof (char *));
+ data->expected_precision = malloc (num_results * sizeof (int));
+ for (i = 0; i < num_results; ++i)
+ {
+ get_clean_line (f, &(data->expected_results[i]));
+ handle_precision (data->expected_results[i],
+ &(data->expected_precision[i]));
+ }
+ fclose (f);
+ return data;
+}
+
+void
+cleanup_test_data (struct test_data *data)
+{
+ int i;
+ int num_results = (data->expected_rows + 1) * (data->expected_columns);
+
+ for (i = 0; i < num_results; ++i)
+ {
+ free (data->expected_results[i]);
+ }
+ free (data->expected_results);
+ free (data->expected_precision);
+ free (data->test_case_name);
+ free (data->database_name);
+ free (data->sql_statement);
+ free (data);
+}
+
+int
+test_case_filter (const struct dirent *entry)
+{
+ return (fnmatch ("*.testcase", entry->d_name, FNM_PERIOD) == 0);
+}
+
+int
+run_all_testcases (struct db_conn *conn, int load_extension)
+{
+ struct dirent **namelist;
+ int n;
+ int i;
+ int result = 0;
+ const char *security_level;
+
+ n = scandir ("sql_stmt_tests", &namelist, test_case_filter, alphasort);
+ if (n < 0)
+ {
+ perror ("scandir");
+ return -1;
+ }
+
+ for (i = 0; i < n; ++i)
+ {
+ struct test_data *data;
+ char *path;
+ if (asprintf (&path, "sql_stmt_tests/%s", namelist[i]->d_name) < 0)
+ {
+ return -1;
+ }
+ data = read_one_case (path);
+ free (path);
+
+ result = do_one_case (conn, data, load_extension);
+
+ cleanup_test_data (data);
+ if (result != 0)
+ {
+ return result;
+ }
+ free (namelist[i]);
+ }
+ free (namelist);
+
+ security_level = getenv ("SPATIALITE_SECURITY");
+ if (security_level == NULL)
+ ;
+ else if (strcasecmp (security_level, "relaxed") == 0)
+ {
+ n = scandir ("sql_stmt_security_tests", &namelist, test_case_filter,
+ alphasort);
+ if (n < 0)
+ {
+ perror ("scandir");
+ return -1;
+ }
+
+ for (i = 0; i < n; ++i)
+ {
+ struct test_data *data;
+ char *path;
+ if (asprintf
+ (&path, "sql_stmt_security_tests/%s",
+ namelist[i]->d_name) < 0)
+ {
+ return -1;
+ }
+ data = read_one_case (path);
+ free (path);
+
+ result = do_one_case (conn, data, load_extension);
+
+ cleanup_test_data (data);
+ if (result != 0)
+ {
+ return result;
+ }
+ free (namelist[i]);
+ }
+ free (namelist);
+ }
+
+ return result;
+}
+
+int
+run_specified_testcases (int argc, char *argv[], struct db_conn *conn,
+ int load_extension)
+{
+ int result = 0;
+ int i = 0;
+
+ for (i = 1; i < argc; ++i)
+ {
+ struct test_data *data;
+ data = read_one_case (argv[i]);
+ result = do_one_case (conn, data, load_extension);
+ cleanup_test_data (data);
+ if (result != 0)
+ {
+ break;
+ }
+ }
+ return result;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+ struct db_conn conn;
+ conn.db_path = NULL;
+ conn.db_handle = NULL;
+ conn.cache = cache;
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* testing in current mode */
+ if (argc == 1)
+ {
+ result = run_all_testcases (&conn, 0);
+ }
+ else
+ {
+ result = run_specified_testcases (argc, argv, &conn, 0);
+ }
+ if (result != 0)
+ {
+ /* it looks like if MinGW applies some wrong assumption */
+ /* some negative values are incorrectly reported to be OK */
+ /* forcing -1 seems to resolve this issue */
+ result = -1;
+ }
+
+ close_connection (&conn);
+ spatialite_cleanup_ex (conn.cache);
+ conn.cache = NULL;
+
+ if (result == 0)
+ {
+ /* testing again in legacy mode */
+ fprintf (stderr,
+ "\n****************** testing again in legacy mode\n\n");
+ if (argc == 1)
+ {
+ result = run_all_testcases (&conn, 0);
+ }
+ else
+ {
+ result = run_specified_testcases (argc, argv, &conn, 0);
+ }
+ close_connection (&conn);
+ }
+
+ if (result == 0)
+ {
+ /* testing again in load_extension mode */
+ fprintf (stderr,
+ "\n****************** testing again in load_extension mode\n\n");
+ if (argc == 1)
+ {
+ result = run_all_testcases (&conn, 1);
+ }
+ else
+ {
+ result = run_specified_testcases (argc, argv, &conn, 1);
+ }
+ close_connection (&conn);
+ }
+
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/doctors.svg b/test/doctors.svg
new file mode 100644
index 0000000..deb8fce
--- /dev/null
+++ b/test/doctors.svg
@@ -0,0 +1,418 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="doctors.svg"
+ sodipodi:docbase="s:\Data\FacilityIcons"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata2975">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="792"
+ inkscape:window-width="1152"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.24494543"
+ inkscape:cx="17.817672"
+ inkscape:cy="-145.58293"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:current-layer="svg2"
+ showgrid="false" />
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ id="perspective2441" />
+ <inkscape:perspective
+ id="perspective3452"
+ inkscape:persp3d-origin="30 : 20 : 1"
+ inkscape:vp_z="60 : 30 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 30 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <symbol
+ viewBox="244.5 110 489 219.9"
+ id="symbol-university">
+ <path
+ id="path4460"
+ d="M79,43l57,119c0,0,21-96,104-96s124,106,124,106l43-133l82-17L0,17L79,43z" />
+ <path
+ id="path4462"
+ d="M94,176l-21,39"
+ stroke-width="20"
+ stroke="#000000"
+ fill="none" />
+ <path
+ id="path4464"
+ d="M300,19c0,10.5-22.6,19-50.5,19S199,29.5,199,19s22.6-19,50.5-19S300,8.5,300,19z" />
+ <path
+ id="path4466"
+ d="M112,216l-16-38L64,88c0,0-9-8-4-35s16-24,16-24"
+ stroke-width="20"
+ stroke="#000000"
+ ill="none" />
+ </symbol>
+ <inkscape:perspective
+ id="perspective4471"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4668"
+ inkscape:persp3d-origin="6 : 4 : 1"
+ inkscape:vp_z="12 : 6 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 6 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4904"
+ inkscape:persp3d-origin="16 : 10.666667 : 1"
+ inkscape:vp_z="32 : 16 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 16 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <marker
+ style="overflow:visible;"
+ id="Arrow2Lend"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow2Lend">
+ <path
+ transform="scale(1.1) rotate(180) translate(1,0)"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+ id="path4137" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow1Mend"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Mend">
+ <path
+ transform="scale(0.4) rotate(180) translate(10,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4125" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="TriangleOutL"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="TriangleOutL">
+ <path
+ transform="scale(0.8)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+ id="path4214" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow1Lend"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Lend">
+ <path
+ transform="scale(0.8) rotate(180) translate(12.5,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4119" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="Tail"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Tail">
+ <g
+ transform="scale(-1.2)"
+ id="g4152">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -3.8048674,-3.9585227 L 0.54352094,0"
+ id="path4154" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -1.2866832,-3.9585227 L 3.0617053,0"
+ id="path4156" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M 1.3053582,-3.9585227 L 5.6537466,0"
+ id="path4158" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -3.8048674,4.1775838 L 0.54352094,0.21974226"
+ id="path4160" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -1.2866832,4.1775838 L 3.0617053,0.21974226"
+ id="path4162" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M 1.3053582,4.1775838 L 5.6537466,0.21974226"
+ id="path4164" />
+ </g>
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="Arrow1Sstart"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Sstart">
+ <path
+ transform="scale(0.2) translate(6,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4128" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow1Send"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Send">
+ <path
+ transform="scale(0.2) rotate(180) translate(6,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4131" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="SemiCircleOut"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="SemiCircleOut">
+ <path
+ transform="scale(0.6) translate(7.125493,0.763446)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;marker-end:none"
+ d="M -2.5,-0.80913858 C -2.5,1.9508614 -4.7400000,4.1908614 -7.5,4.1908614 L -7.5,-5.8091386 C -4.7400000,-5.8091386 -2.5,-3.5691386 -2.5,-0.80913858 z "
+ id="path4235" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow2Send"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow2Send">
+ <path
+ transform="scale(0.3) rotate(180) translate(-2.3,0)"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+ id="path4149" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="TriangleOutS"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="TriangleOutS">
+ <path
+ transform="scale(0.2)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+ id="path4220" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="CurveIn"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="CurveIn">
+ <path
+ transform="scale(0.6)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;marker-end:none;fill:none"
+ d="M 4.6254930,-5.0456926 C 1.8654930,-5.0456926 -0.37450702,-2.8056926 -0.37450702,-0.045692580 C -0.37450702,2.7143074 1.8654930,4.9543074 4.6254930,4.9543074"
+ id="path4238" />
+ </marker>
+ <marker
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="InfiniteLineStart"
+ inkscape:stockid="InfiniteLineStart"
+ style="overflow:visible">
+ <g
+ transform="translate(-13,0)"
+ id="g4298">
+ <circle
+ cx="3"
+ cy="0"
+ r="0.8"
+ id="circle4300" />
+ <circle
+ cx="6.5"
+ cy="0"
+ r="0.8"
+ id="circle4302" />
+ <circle
+ cx="10"
+ cy="0"
+ r="0.8"
+ id="circle4304" />
+ </g>
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="StopS"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="StopS">
+ <path
+ transform="scale(0.2)"
+ style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+ d="M 0.0,5.65 L 0.0,-5.65"
+ id="path4229" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="Arrow2Sstart"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow2Sstart">
+ <path
+ transform="scale(0.3) translate(-2.3,0)"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round"
+ id="path4146" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="DiamondS"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="DiamondS">
+ <path
+ transform="scale(0.2)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "
+ id="path4202" />
+ </marker>
+ <marker
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="RazorWire"
+ inkscape:stockid="RazorWire">
+ style="overflow:visible">
+ <path
+ d="M 0.022727273,-0.74009011 L 0.022727273,0.69740989 L -7.7585227,3.0099099 L 10.678977,3.0099099 L 3.4914773,0.69740989 L 3.4914773,-0.74009011 L 10.741477,-2.8963401 L -7.7272727,-2.8963401 L 0.022727273,-0.74009011 z "
+ style="fill:#808080;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1pt"
+ transform="scale(0.8,0.8)"
+ id="path4286" />
+</marker>
+ <inkscape:perspective
+ id="perspective5233"
+ inkscape:persp3d-origin="16 : 10.666667 : 1"
+ inkscape:vp_z="32 : 16 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 16 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective5412"
+ inkscape:persp3d-origin="250 : 166.66667 : 1"
+ inkscape:vp_z="500 : 250 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 250 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective5571"
+ inkscape:persp3d-origin="202.85715 : 136.19048 : 1"
+ inkscape:vp_z="405.71429 : 204.28572 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 204.28572 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective2446"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <g
+ id="g1327">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 L 1.704,516.927 C 1.704,557.771 22.599,579.156 63.896,579.156 L 515.92,579.156 C 557.227,579.156 578.149,558.841 578.149,516.927 L 578.149,66.804 C 578.149,24.203 557.227,1.768 514.628,1.768 C 514.624,1.768 66.133,1.625 66.275,1.768 z "
+ style="fill:#111;stroke:#eee;stroke-width:3.40799999"
+ id="path1329" />
+ </g>
+ <g
+ id="layer3"
+ inkscape:label="Layout"
+ style="display:none;stroke:#757575;stroke-opacity:1"
+ transform="matrix(48.14969,0,0,48.14969,-536.27327,-33.306752)">
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4134"
+ width="10"
+ height="10"
+ x="1"
+ y="1" />
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4136"
+ width="8"
+ height="8"
+ x="2"
+ y="2" />
+ </g>
+ <path
+ style="fill:#ffffff"
+ d="M 292.17556,563.5086 C 271.21594,529.59522 308.79761,485.66367 334.48611,514.04916 C 342.47121,522.87259 338.75505,523.8459 320.96064,517.59169 C 305.11306,512.0217 305.11306,512.0217 303.29766,533.89419 C 302.29917,545.9241 301.23644,557.59058 300.93603,559.81973 C 300.28306,564.66508 294.41692,567.13518 292.17556,563.5086 z M 251.62039,522.63515 C 250.71766,521.17448 262.28673,512.06188 277.32946,502.38496 C 292.37215,492.70803 304.67985,482.8395 304.67985,480.4549 C 304.67985, [...]
+ id="path2452"
+ sodipodi:nodetypes="cssssccsssssssccssssssssccsssssssssssccsssssssssccssssssssccsssccsssssssccssssssccssssssssssssccsssssssssssc" />
+</svg>
diff --git a/test/fastfood.svg b/test/fastfood.svg
new file mode 100644
index 0000000..44b51f4
--- /dev/null
+++ b/test/fastfood.svg
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="food_fastfood.svg"
+ sodipodi:docbase="s:\Data\FacilityIcons"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata2975">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="947"
+ inkscape:window-width="1048"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.92167712"
+ inkscape:cx="301.5186"
+ inkscape:cy="281.19503"
+ inkscape:window-x="91"
+ inkscape:window-y="25"
+ inkscape:current-layer="svg2"
+ showgrid="false" />
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ id="perspective2441" />
+ <inkscape:perspective
+ id="perspective3452"
+ inkscape:persp3d-origin="30 : 20 : 1"
+ inkscape:vp_z="60 : 30 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 30 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <symbol
+ viewBox="244.5 110 489 219.9"
+ id="symbol-university">
+ <path
+ id="path4460"
+ d="M79,43l57,119c0,0,21-96,104-96s124,106,124,106l43-133l82-17L0,17L79,43z" />
+ <path
+ id="path4462"
+ d="M94,176l-21,39"
+ stroke-width="20"
+ stroke="#000000"
+ fill="none" />
+ <path
+ id="path4464"
+ d="M300,19c0,10.5-22.6,19-50.5,19S199,29.5,199,19s22.6-19,50.5-19S300,8.5,300,19z" />
+ <path
+ id="path4466"
+ d="M112,216l-16-38L64,88c0,0-9-8-4-35s16-24,16-24"
+ stroke-width="20"
+ stroke="#000000"
+ ill="none" />
+ </symbol>
+ <inkscape:perspective
+ id="perspective4471"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4668"
+ inkscape:persp3d-origin="6 : 4 : 1"
+ inkscape:vp_z="12 : 6 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 6 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <g
+ id="g1327">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 L 1.704,516.927 C 1.704,557.771 22.599,579.156 63.896,579.156 L 515.92,579.156 C 557.227,579.156 578.149,558.841 578.149,516.927 L 578.149,66.804 C 578.149,24.203 557.227,1.768 514.628,1.768 C 514.624,1.768 66.133,1.625 66.275,1.768 z "
+ style="fill:#111;stroke:#eee;stroke-width:3.40799999"
+ id="path1329" />
+ </g>
+ <g
+ id="layer3"
+ inkscape:label="Layout"
+ style="display:none;stroke:#757575;stroke-opacity:1"
+ transform="matrix(48.14969,0,0,48.14969,-536.27327,-33.306752)">
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4134"
+ width="10"
+ height="10"
+ x="1"
+ y="1" />
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4136"
+ width="8"
+ height="8"
+ x="2"
+ y="2" />
+ </g>
+ <path
+ transform="matrix(14.685839,0,0,14.685839,577.76584,1150.0639)"
+ style="font-size:40px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:NPSPICT3;-inkscape-font-specification:NPSPICT3"
+ d="M -4.9023438,-73.108887 L -7.0227051,-65.628418 L -17.822266,-65.628418 L -15.222168,-44.98877 L -6.3830566,-44.98877 L -3.7426758,-65.628418 L -5.7421875,-65.628418 L -3.6621094,-72.748779 L -4.9023438,-73.108887 z M -19.102783,-53.588623 C -18.889587,-55.455476 -20.302753,-56.468658 -23.342285,-56.628174 L -30.662842,-56.628174 C -33.702398,-56.468658 -35.128992,-55.455476 -34.942627,-53.588623 L -19.102783,-53.588623 z M -34.942627,-47.988037 C -35.128992,-46.121989 -33.702398 [...]
+ id="flowRoot3192" />
+</svg>
diff --git a/test/fnmatch4win.h b/test/fnmatch4win.h
new file mode 100644
index 0000000..a91b072
--- /dev/null
+++ b/test/fnmatch4win.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 1992 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details. */
+
+/*
+ * Modified for WinCvs/MacCVS : Alexandre Parenteau <aubonbeurre at hotmail.com> --- June 1998
+ */
+
+#ifndef _FNMATCH_H
+
+#define _FNMATCH_H 1
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define FNM_NOMATCH 1 /* Match failed. */
+#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
+#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
+#define FNM_PERIOD 0x04 /* Period must be matched by period. */
+#define FNM_LEADING_DIR 0x08 /* Ignore /<tail> after Imatch. */
+#define FNM_CASEFOLD 0x10 /* Case insensitive search. */
+#define FNM_PREFIX_DIRS 0x20 /* Directory prefixes of pattern match too. */
+
+/* Value returned by `fnmatch' if STRING does not match PATTERN. */
+#undef FNM_NOMATCH
+#define FNM_NOMATCH 1
+
+#if !defined(__STDC__) && (defined(WIN32)|| defined(TARGET_OS_MAC))
+# define __STDC__ 1
+#endif
+
+/* Match STRING against the filename pattern PATTERN,
+ returning zero if it matches, FNM_NOMATCH if not. */
+#if __STDC__
+ extern int fnmatch (const char *pattern, const char *string, int flags);
+#else
+ extern int fnmatch ();
+#endif
+
+#if defined (__CYGWIN32__) || defined (WIN32)
+ /* Under Windows NT, filenames are case-insensitive, and both / and \
+ are path component separators. */
+
+# define FOLD_FN_CHAR(c) (WNT_filename_classes[(unsigned char) (c)])
+ extern unsigned char WNT_filename_classes[];
+#endif /* defined (__CYGWIN32__) || defined (WIN32) */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* fnmatch.h */
diff --git a/test/fnmatch_impl4win.h b/test/fnmatch_impl4win.h
new file mode 100644
index 0000000..31184d6
--- /dev/null
+++ b/test/fnmatch_impl4win.h
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 1989, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Guido van Rossum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * From FreeBSD fnmatch.c 1.11
+ * $Id: fnmatch.c 273994 2009-01-20 01:37:48Z pajoye $
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94";
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6.
+ * Compares a filename or pathname to a pattern.
+ */
+
+#define EOS '\0'
+
+static const char *rangematch(const char *, char, int);
+
+int fnmatch(const char *pattern, const char *string, int flags)
+{
+ const char *stringstart;
+ char c, test;
+
+ for (stringstart = string;;)
+ switch (c = *pattern++) {
+ case EOS:
+ if ((flags & FNM_LEADING_DIR) && *string == '/')
+ return (0);
+ return (*string == EOS ? 0 : FNM_NOMATCH);
+ case '?':
+ if (*string == EOS)
+ return (FNM_NOMATCH);
+ if (*string == '/' && (flags & FNM_PATHNAME))
+ return (FNM_NOMATCH);
+ if (*string == '.' && (flags & FNM_PERIOD) &&
+ (string == stringstart ||
+ ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
+ return (FNM_NOMATCH);
+ ++string;
+ break;
+ case '*':
+ c = *pattern;
+ /* Collapse multiple stars. */
+ while (c == '*')
+ c = *++pattern;
+
+ if (*string == '.' && (flags & FNM_PERIOD) &&
+ (string == stringstart ||
+ ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
+ return (FNM_NOMATCH);
+
+ /* Optimize for pattern with * at end or before /. */
+ if (c == EOS)
+ if (flags & FNM_PATHNAME)
+ return ((flags & FNM_LEADING_DIR) ||
+ strchr(string, '/') == NULL ?
+ 0 : FNM_NOMATCH);
+ else
+ return (0);
+ else if (c == '/' && flags & FNM_PATHNAME) {
+ if ((string = strchr(string, '/')) == NULL)
+ return (FNM_NOMATCH);
+ break;
+ }
+
+ /* General case, use recursion. */
+ while ((test = *string) != EOS) {
+ if (!fnmatch(pattern, string, flags & ~FNM_PERIOD))
+ return (0);
+ if (test == '/' && flags & FNM_PATHNAME)
+ break;
+ ++string;
+ }
+ return (FNM_NOMATCH);
+ case '[':
+ if (*string == EOS)
+ return (FNM_NOMATCH);
+ if (*string == '/' && flags & FNM_PATHNAME)
+ return (FNM_NOMATCH);
+ if ((pattern =
+ rangematch(pattern, *string, flags)) == NULL)
+ return (FNM_NOMATCH);
+ ++string;
+ break;
+ case '\\':
+ if (!(flags & FNM_NOESCAPE)) {
+ if ((c = *pattern++) == EOS) {
+ c = '\\';
+ --pattern;
+ }
+ }
+ /* FALLTHROUGH */
+ default:
+ if (c == *string)
+ ;
+ else if ((flags & FNM_CASEFOLD) &&
+ (tolower((unsigned char)c) ==
+ tolower((unsigned char)*string)))
+ ;
+ else if ((flags & FNM_PREFIX_DIRS) && *string == EOS &&
+ (c == '/' && string != stringstart ||
+ string == stringstart+1 && *stringstart == '/') )
+ return (0);
+ else
+ return (FNM_NOMATCH);
+ string++;
+ break;
+ }
+ /* NOTREACHED */
+}
+
+static const char *
+rangematch(const char *pattern, char test, int flags)
+{
+ int negate, ok;
+ char c, c2;
+
+ /*
+ * A bracket expression starting with an unquoted circumflex
+ * character produces unspecified results (IEEE 1003.2-1992,
+ * 3.13.2). This implementation treats it like '!', for
+ * consistency with the regular expression syntax.
+ * J.T. Conklin (conklin at ngai.kaleida.com)
+ */
+ if ( (negate = (*pattern == '!' || *pattern == '^')) )
+ ++pattern;
+
+ if (flags & FNM_CASEFOLD)
+ test = tolower((unsigned char)test);
+
+ for (ok = 0; (c = *pattern++) != ']';) {
+ if (c == '\\' && !(flags & FNM_NOESCAPE))
+ c = *pattern++;
+ if (c == EOS)
+ return (NULL);
+
+ if (flags & FNM_CASEFOLD)
+ c = tolower((unsigned char)c);
+
+ if (*pattern == '-'
+ && (c2 = *(pattern+1)) != EOS && c2 != ']') {
+ pattern += 2;
+ if (c2 == '\\' && !(flags & FNM_NOESCAPE))
+ c2 = *pattern++;
+ if (c2 == EOS)
+ return (NULL);
+
+ if (flags & FNM_CASEFOLD)
+ c2 = tolower((unsigned char)c2);
+
+ if ((unsigned char)c <= (unsigned char)test &&
+ (unsigned char)test <= (unsigned char)c2)
+ ok = 1;
+ } else if (c == test)
+ ok = 1;
+ }
+ return (ok == negate ? NULL : pattern);
+}
+
diff --git a/test/gif1.gif b/test/gif1.gif
new file mode 100644
index 0000000..c869755
Binary files /dev/null and b/test/gif1.gif differ
diff --git a/test/gray-striped.tif b/test/gray-striped.tif
new file mode 100644
index 0000000..3e7e8e0
Binary files /dev/null and b/test/gray-striped.tif differ
diff --git a/test/gray-tiled.tif b/test/gray-tiled.tif
new file mode 100644
index 0000000..dc2abce
Binary files /dev/null and b/test/gray-tiled.tif differ
diff --git a/test/gray_gamma.xml b/test/gray_gamma.xml
new file mode 100644
index 0000000..d748a0b
--- /dev/null
+++ b/test/gray_gamma.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>gray_gamma</Name>
+ <Description>
+ <Title>Gray, GammaValue</Title>
+ <Abstract>Grayscale, contrast enhancement: GAMMA Value</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ContrastEnhancement>
+ <GammaValue>1.6</GammaValue>
+ </ContrastEnhancement>
+</RasterSymbolizer>
diff --git a/test/gray_gamma2.xml b/test/gray_gamma2.xml
new file mode 100644
index 0000000..16d0c26
--- /dev/null
+++ b/test/gray_gamma2.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>gray_gamma2</Name>
+ <Description>
+ <Title>Gray, Normalize</Title>
+ <Abstract>Grayscale, contrast enhancement: NORMALIZE</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ChannelSelection>
+ <GrayChannel>
+ <SourceChannelName>1</SourceChannelName>
+ <ContrastEnhancement>
+ <GammaValue>1.6</GammaValue>
+ </ContrastEnhancement>
+ </GrayChannel>
+ </ChannelSelection>
+</RasterSymbolizer>
diff --git a/test/gray_histogram.xml b/test/gray_histogram.xml
new file mode 100644
index 0000000..af0289b
--- /dev/null
+++ b/test/gray_histogram.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>gray_histogram</Name>
+ <Description>
+ <Title>Gray, Histogram</Title>
+ <Abstract>Grayscale, contrast enhancement: HISTOGRAM</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ContrastEnhancement>
+ <Histogram/>
+ </ContrastEnhancement>
+</RasterSymbolizer>
diff --git a/test/gray_histogram2.xml b/test/gray_histogram2.xml
new file mode 100644
index 0000000..773111d
--- /dev/null
+++ b/test/gray_histogram2.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>gray_histogram2</Name>
+ <Description>
+ <Title>Gray, Histogram</Title>
+ <Abstract>Grayscale, contrast enhancement: HISTOGRAM</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ChannelSelection>
+ <GrayChannel>
+ <SourceChannelName>1</SourceChannelName>
+ <ContrastEnhancement>
+ <Histogram/>
+ </ContrastEnhancement>
+ </GrayChannel>
+ </ChannelSelection>
+</RasterSymbolizer>
diff --git a/test/gray_normalize.xml b/test/gray_normalize.xml
new file mode 100644
index 0000000..011f3bc
--- /dev/null
+++ b/test/gray_normalize.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>gray_normalize</Name>
+ <Description>
+ <Title>Gray, Normalize</Title>
+ <Abstract>Grayscale, contrast enhancement: NORMALIZE</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ContrastEnhancement>
+ <Normalize/>
+ </ContrastEnhancement>
+</RasterSymbolizer>
diff --git a/test/gray_normalize2.xml b/test/gray_normalize2.xml
new file mode 100644
index 0000000..139b799
--- /dev/null
+++ b/test/gray_normalize2.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>gray_normalize2</Name>
+ <Description>
+ <Title>Gray, Normalize</Title>
+ <Abstract>Grayscale, contrast enhancement: NORMALIZE</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ChannelSelection>
+ <GrayChannel>
+ <SourceChannelName>1</SourceChannelName>
+ <ContrastEnhancement>
+ <Normalize/>
+ </ContrastEnhancement>
+ </GrayChannel>
+ </ChannelSelection>
+</RasterSymbolizer>
diff --git a/test/group_style_1.xml b/test/group_style_1.xml
new file mode 100644
index 0000000..8aee4bc
--- /dev/null
+++ b/test/group_style_1.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <se:Name>group_style_1</se:Name>
+ <se:Description>
+ <se:Title>style-1 title</se:Title>
+ <se:Abstract>style-1 abstract</se:Abstract>
+ </se:Description>
+ <NamedLayer>
+ <se:Name>dumb_dem</se:Name>
+ <NamedStyle>
+ <se:Name>srtm_brightness</se:Name>
+ </NamedStyle>
+ </NamedLayer>
+ <NamedLayer>
+ <se:Name>dumb1</se:Name>
+ </NamedLayer>
+</StyledLayerDescriptor>
diff --git a/test/group_style_2.xml b/test/group_style_2.xml
new file mode 100644
index 0000000..3526b0f
--- /dev/null
+++ b/test/group_style_2.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <se:Name>group_style_2</se:Name>
+ <se:Description>
+ <se:Title>style-2 title</se:Title>
+ </se:Description>
+ <NamedLayer>
+ <se:Name>dumb_dem</se:Name>
+ <NamedStyle>
+ <se:Name>srtm_brightness</se:Name>
+ </NamedStyle>
+ </NamedLayer>
+ <NamedLayer>
+ <se:Name>dumb0</se:Name>
+ <NamedStyle>
+ <se:Name>style1</se:Name>
+ </NamedStyle>
+ </NamedLayer>
+</StyledLayerDescriptor>
diff --git a/test/hospital.svg b/test/hospital.svg
new file mode 100644
index 0000000..ebd1386
--- /dev/null
+++ b/test/hospital.svg
@@ -0,0 +1,429 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="health_hospital.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata2975">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="925"
+ inkscape:window-width="1280"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.92167712"
+ inkscape:cx="300.07316"
+ inkscape:cy="281.19503"
+ inkscape:window-x="1280"
+ inkscape:window-y="24"
+ inkscape:current-layer="svg2"
+ showgrid="false"
+ inkscape:window-maximized="1" />
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ id="perspective2441" />
+ <inkscape:perspective
+ id="perspective3452"
+ inkscape:persp3d-origin="30 : 20 : 1"
+ inkscape:vp_z="60 : 30 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 30 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <symbol
+ viewBox="244.5 110 489 219.9"
+ id="symbol-university">
+ <path
+ id="path4460"
+ d="M79,43l57,119c0,0,21-96,104-96s124,106,124,106l43-133l82-17L0,17L79,43z" />
+ <path
+ id="path4462"
+ d="M94,176l-21,39"
+ stroke-width="20"
+ stroke="#000000"
+ fill="none" />
+ <path
+ id="path4464"
+ d="M300,19c0,10.5-22.6,19-50.5,19S199,29.5,199,19s22.6-19,50.5-19S300,8.5,300,19z" />
+ <path
+ id="path4466"
+ d="M112,216l-16-38L64,88c0,0-9-8-4-35s16-24,16-24"
+ stroke-width="20"
+ stroke="#000000"
+ ill="none" />
+ </symbol>
+ <inkscape:perspective
+ id="perspective4471"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4668"
+ inkscape:persp3d-origin="6 : 4 : 1"
+ inkscape:vp_z="12 : 6 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 6 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4904"
+ inkscape:persp3d-origin="16 : 10.666667 : 1"
+ inkscape:vp_z="32 : 16 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 16 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <marker
+ style="overflow:visible;"
+ id="Arrow2Lend"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow2Lend">
+ <path
+ transform="scale(1.1) rotate(180) translate(1,0)"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+ id="path4137" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow1Mend"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Mend">
+ <path
+ transform="scale(0.4) rotate(180) translate(10,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4125" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="TriangleOutL"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="TriangleOutL">
+ <path
+ transform="scale(0.8)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+ id="path4214" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow1Lend"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Lend">
+ <path
+ transform="scale(0.8) rotate(180) translate(12.5,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4119" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="Tail"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Tail">
+ <g
+ transform="scale(-1.2)"
+ id="g4152">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -3.8048674,-3.9585227 L 0.54352094,0"
+ id="path4154" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -1.2866832,-3.9585227 L 3.0617053,0"
+ id="path4156" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M 1.3053582,-3.9585227 L 5.6537466,0"
+ id="path4158" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -3.8048674,4.1775838 L 0.54352094,0.21974226"
+ id="path4160" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -1.2866832,4.1775838 L 3.0617053,0.21974226"
+ id="path4162" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M 1.3053582,4.1775838 L 5.6537466,0.21974226"
+ id="path4164" />
+ </g>
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="Arrow1Sstart"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Sstart">
+ <path
+ transform="scale(0.2) translate(6,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4128" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow1Send"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Send">
+ <path
+ transform="scale(0.2) rotate(180) translate(6,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4131" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="SemiCircleOut"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="SemiCircleOut">
+ <path
+ transform="scale(0.6) translate(7.125493,0.763446)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;marker-end:none"
+ d="M -2.5,-0.80913858 C -2.5,1.9508614 -4.7400000,4.1908614 -7.5,4.1908614 L -7.5,-5.8091386 C -4.7400000,-5.8091386 -2.5,-3.5691386 -2.5,-0.80913858 z "
+ id="path4235" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow2Send"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow2Send">
+ <path
+ transform="scale(0.3) rotate(180) translate(-2.3,0)"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+ id="path4149" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="TriangleOutS"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="TriangleOutS">
+ <path
+ transform="scale(0.2)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+ id="path4220" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="CurveIn"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="CurveIn">
+ <path
+ transform="scale(0.6)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;marker-end:none;fill:none"
+ d="M 4.6254930,-5.0456926 C 1.8654930,-5.0456926 -0.37450702,-2.8056926 -0.37450702,-0.045692580 C -0.37450702,2.7143074 1.8654930,4.9543074 4.6254930,4.9543074"
+ id="path4238" />
+ </marker>
+ <marker
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="InfiniteLineStart"
+ inkscape:stockid="InfiniteLineStart"
+ style="overflow:visible">
+ <g
+ transform="translate(-13,0)"
+ id="g4298">
+ <circle
+ cx="3"
+ cy="0"
+ r="0.8"
+ id="circle4300"
+ d="M 3.8,0 C 3.8,0.44182781 3.4418278,0.80000001 3,0.80000001 2.5581722,0.80000001 2.2,0.44182781 2.2,0 c 0,-0.44182781 0.3581722,-0.80000001 0.8,-0.80000001 0.4418278,0 0.8,0.3581722 0.8,0.80000001 z" />
+ <circle
+ cx="6.5"
+ cy="0"
+ r="0.8"
+ id="circle4302"
+ d="M 7.3,0 C 7.3,0.44182781 6.9418278,0.80000001 6.5,0.80000001 6.0581722,0.80000001 5.7,0.44182781 5.7,0 c 0,-0.44182781 0.3581722,-0.80000001 0.8,-0.80000001 0.4418278,0 0.8,0.3581722 0.8,0.80000001 z" />
+ <circle
+ cx="10"
+ cy="0"
+ r="0.8"
+ id="circle4304"
+ d="M 10.8,0 C 10.8,0.44182781 10.441828,0.80000001 10,0.80000001 9.5581722,0.80000001 9.2,0.44182781 9.2,0 c 0,-0.44182781 0.3581722,-0.80000001 0.8,-0.80000001 0.441828,0 0.8,0.3581722 0.8,0.80000001 z" />
+ </g>
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="StopS"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="StopS">
+ <path
+ transform="scale(0.2)"
+ style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+ d="M 0.0,5.65 L 0.0,-5.65"
+ id="path4229" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="Arrow2Sstart"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow2Sstart">
+ <path
+ transform="scale(0.3) translate(-2.3,0)"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round"
+ id="path4146" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="DiamondS"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="DiamondS">
+ <path
+ transform="scale(0.2)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "
+ id="path4202" />
+ </marker>
+ <marker
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="RazorWire"
+ inkscape:stockid="RazorWire">
+ style="overflow:visible">
+ <path
+ d="M 0.022727273,-0.74009011 L 0.022727273,0.69740989 L -7.7585227,3.0099099 L 10.678977,3.0099099 L 3.4914773,0.69740989 L 3.4914773,-0.74009011 L 10.741477,-2.8963401 L -7.7272727,-2.8963401 L 0.022727273,-0.74009011 z "
+ style="fill:#808080;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1pt"
+ transform="scale(0.8,0.8)"
+ id="path4286" />
+</marker>
+ <inkscape:perspective
+ id="perspective5233"
+ inkscape:persp3d-origin="16 : 10.666667 : 1"
+ inkscape:vp_z="32 : 16 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 16 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective5412"
+ inkscape:persp3d-origin="250 : 166.66667 : 1"
+ inkscape:vp_z="500 : 250 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 250 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <g
+ id="g1327">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 L 1.704,516.927 C 1.704,557.771 22.599,579.156 63.896,579.156 L 515.92,579.156 C 557.227,579.156 578.149,558.841 578.149,516.927 L 578.149,66.804 C 578.149,24.203 557.227,1.768 514.628,1.768 C 514.624,1.768 66.133,1.625 66.275,1.768 z "
+ style="fill:#111;stroke:#eee;stroke-width:3.40799999"
+ id="path1329" />
+ </g>
+ <g
+ id="layer3"
+ inkscape:label="Layout"
+ style="display:none;stroke:#757575;stroke-opacity:1"
+ transform="matrix(48.14969,0,0,48.14969,-536.27327,-33.306752)">
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4134"
+ width="10"
+ height="10"
+ x="1"
+ y="1" />
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4136"
+ width="8"
+ height="8"
+ x="2"
+ y="2" />
+ </g>
+ <path
+ sodipodi:type="arc"
+ style="fill:none;stroke:#ffffff;stroke-width:25.1376152;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="path2207"
+ sodipodi:cx="217.14285"
+ sodipodi:cy="305.71429"
+ sodipodi:rx="288.57144"
+ sodipodi:ry="288.57144"
+ d="m 505.71429,305.71429 a 288.57144,288.57144 0 1 1 -577.142879,0 288.57144,288.57144 0 1 1 577.142879,0 z"
+ transform="matrix(0.86047263,0,0,0.86047263,100.67386,22.912007)" />
+ <rect
+ transform="scale(-1,-1)"
+ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:20;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;stroke-linejoin:round"
+ id="rect3180"
+ width="362.27322"
+ height="81.835243"
+ x="-468.65591"
+ y="-326.88843" />
+ <rect
+ y="246.60173"
+ x="-467.10742"
+ height="81.835243"
+ width="362.27322"
+ id="rect3182"
+ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:20;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;stroke-linejoin:round"
+ transform="matrix(0,-1,1,0,0,0)" />
+</svg>
diff --git a/test/ir_false_color1.xml b/test/ir_false_color1.xml
new file mode 100644
index 0000000..1fe40d9
--- /dev/null
+++ b/test/ir_false_color1.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>ir_false_color1</Name>
+ <Description>
+ <Title>False Color InfraRed</Title>
+ <Abstract>a false color raster style: Infrared, Red, Green bands</Abstract>
+ </Description>
+ <Opacity>0.7</Opacity>
+ <ChannelSelection>
+ <RedChannel>
+ <SourceChannelName>4</SourceChannelName>
+ </RedChannel>
+ <GreenChannel>
+ <SourceChannelName>1</SourceChannelName>
+ </GreenChannel>
+ <BlueChannel>
+ <SourceChannelName>2</SourceChannelName>
+ </BlueChannel>
+ </ChannelSelection>
+</RasterSymbolizer>
diff --git a/test/ir_false_color1_gamma.xml b/test/ir_false_color1_gamma.xml
new file mode 100644
index 0000000..5c126a8
--- /dev/null
+++ b/test/ir_false_color1_gamma.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>ir_false_color1_gamma</Name>
+ <Description>
+ <Title>False Color InfraRed</Title>
+ <Abstract>a false color raster style: Infrared, Red, Green bands</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ChannelSelection>
+ <RedChannel>
+ <SourceChannelName>4</SourceChannelName>
+ </RedChannel>
+ <GreenChannel>
+ <SourceChannelName>1</SourceChannelName>
+ </GreenChannel>
+ <BlueChannel>
+ <SourceChannelName>2</SourceChannelName>
+ </BlueChannel>
+ </ChannelSelection>
+ <ContrastEnhancement>
+ <GammaValue>1.1</GammaValue>
+ </ContrastEnhancement>
+</RasterSymbolizer>
diff --git a/test/ir_false_color2.xml b/test/ir_false_color2.xml
new file mode 100644
index 0000000..3672f63
--- /dev/null
+++ b/test/ir_false_color2.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>ir_false_color2</Name>
+ <Description>
+ <Title>False Color InfraRed</Title>
+ <Abstract>a false color raster style: Infrared, Red, Green bands</Abstract>
+ </Description>
+ <Opacity>0.7</Opacity>
+ <ChannelSelection>
+ <RedChannel>
+ <SourceChannelName>4</SourceChannelName>
+ </RedChannel>
+ <GreenChannel>
+ <SourceChannelName>3</SourceChannelName>
+ </GreenChannel>
+ <BlueChannel>
+ <SourceChannelName>2</SourceChannelName>
+ </BlueChannel>
+ </ChannelSelection>
+</RasterSymbolizer>
diff --git a/test/ir_false_color2_gamma.xml b/test/ir_false_color2_gamma.xml
new file mode 100644
index 0000000..d18655b
--- /dev/null
+++ b/test/ir_false_color2_gamma.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>ir_false_color2_gamma</Name>
+ <Description>
+ <Title>False Color InfraRed</Title>
+ <Abstract>a false color raster style: Infrared, Red, Green bands</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ChannelSelection>
+ <RedChannel>
+ <SourceChannelName>4</SourceChannelName>
+ </RedChannel>
+ <GreenChannel>
+ <SourceChannelName>3</SourceChannelName>
+ </GreenChannel>
+ <BlueChannel>
+ <SourceChannelName>2</SourceChannelName>
+ </BlueChannel>
+ </ChannelSelection>
+ <ContrastEnhancement>
+ <GammaValue>1.1</GammaValue>
+ </ContrastEnhancement>
+</RasterSymbolizer>
diff --git a/test/ir_gray.xml b/test/ir_gray.xml
new file mode 100644
index 0000000..7094c33
--- /dev/null
+++ b/test/ir_gray.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>ir_gray</Name>
+ <Description>
+ <Title>InfraRed Band as Grayscale</Title>
+ <Abstract>a single band raster style: InfraRed as Grayscale</Abstract>
+ </Description>
+ <Opacity>0.8</Opacity>
+ <ChannelSelection>
+ <GrayChannel>
+ <SourceChannelName>4</SourceChannelName>
+ </GrayChannel>
+ </ChannelSelection>
+</RasterSymbolizer>
diff --git a/test/ir_gray_gamma.xml b/test/ir_gray_gamma.xml
new file mode 100644
index 0000000..e9b7c20
--- /dev/null
+++ b/test/ir_gray_gamma.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>ir_gray_gamma</Name>
+ <Description>
+ <Title>InfraRed Band as Grayscale</Title>
+ <Abstract>a single band raster style: InfraRed as Grayscale</Abstract>
+ </Description>
+ <Opacity>0.8</Opacity>
+ <ChannelSelection>
+ <GrayChannel>
+ <SourceChannelName>4</SourceChannelName>
+ </GrayChannel>
+ </ChannelSelection>
+ <ContrastEnhancement>
+ <GammaValue>1.4</GammaValue>
+ </ContrastEnhancement>
+</RasterSymbolizer>
diff --git a/test/jewelry.svg b/test/jewelry.svg
new file mode 100644
index 0000000..8759723
--- /dev/null
+++ b/test/jewelry.svg
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="shopping_jewelry.svg"
+ sodipodi:docbase="s:\Data\FacilityIcons"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata2975">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="978"
+ inkscape:window-width="1400"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="1.8433542"
+ inkscape:cx="181.98368"
+ inkscape:cy="442.3878"
+ inkscape:window-x="0"
+ inkscape:window-y="45"
+ inkscape:current-layer="svg2"
+ showgrid="false" />
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="6.1230318e-14 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ id="perspective2441" />
+ <inkscape:perspective
+ id="perspective3452"
+ inkscape:persp3d-origin="30 : 20 : 1"
+ inkscape:vp_z="60 : 30 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 30 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <symbol
+ viewBox="244.5 110 489 219.9"
+ id="symbol-university">
+ <path
+ id="path4460"
+ d="M79,43l57,119c0,0,21-96,104-96s124,106,124,106l43-133l82-17L0,17L79,43z" />
+ <path
+ id="path4462"
+ d="M94,176l-21,39"
+ stroke-width="20"
+ stroke="#000000"
+ fill="none" />
+ <path
+ id="path4464"
+ d="M300,19c0,10.5-22.6,19-50.5,19S199,29.5,199,19s22.6-19,50.5-19S300,8.5,300,19z" />
+ <path
+ id="path4466"
+ d="M112,216l-16-38L64,88c0,0-9-8-4-35s16-24,16-24"
+ stroke-width="20"
+ stroke="#000000"
+ ill="none" />
+ </symbol>
+ <inkscape:perspective
+ id="perspective4471"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4668"
+ inkscape:persp3d-origin="6 : 4 : 1"
+ inkscape:vp_z="12 : 6 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 6 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <g
+ id="g1327">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 L 1.704,516.927 C 1.704,557.771 22.599,579.156 63.896,579.156 L 515.92,579.156 C 557.227,579.156 578.149,558.841 578.149,516.927 L 578.149,66.804 C 578.149,24.203 557.227,1.768 514.628,1.768 C 514.624,1.768 66.133,1.625 66.275,1.768 z "
+ style="fill:#111;stroke:#eee;stroke-width:3.40799999"
+ id="path1329" />
+ </g>
+ <g
+ id="layer3"
+ inkscape:label="Layout"
+ style="display:none;stroke:#757575;stroke-opacity:1"
+ transform="matrix(48.14969,0,0,48.14969,-536.27327,-33.306752)">
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4134"
+ width="10"
+ height="10"
+ x="1"
+ y="1" />
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4136"
+ width="8"
+ height="8"
+ x="2"
+ y="2" />
+ </g>
+ <g
+ id="g3338"
+ transform="matrix(1.3973279,-0.2437849,0.2437849,1.3973279,-185.07402,-56.183307)" />
+ <path
+ sodipodi:type="arc"
+ style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:60.38683701;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="path7112"
+ sodipodi:cx="277.75455"
+ sodipodi:cy="326.11499"
+ sodipodi:rx="180.10646"
+ sodipodi:ry="180.10646"
+ d="M 457.86101,326.11499 A 180.10646,180.10646 0 1 1 97.648087,326.11499 A 180.10646,180.10646 0 1 1 457.86101,326.11499 z"
+ transform="matrix(0.7459895,0,0,0.7459895,87.91225,101.97486)" />
+ <g
+ id="g7124"
+ transform="matrix(1.3954028,0,0,1.3954028,-121.6059,-34.815923)"
+ style="opacity:0.4">
+ <path
+ sodipodi:nodetypes="cccccc"
+ id="path7114"
+ d="M 256.9241,180.04181 L 216.43814,104.89486 L 266.99629,71.76582 L 315.50158,71.76582 L 319.87526,172.48768 L 256.9241,180.04181 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:11.60412884000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:11.60412884000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 340.71544,180.04181 L 381.2014,104.89486 L 330.64326,71.765815 L 274.13796,71.765815 L 277.76429,172.48768 L 340.71544,180.04181 z"
+ id="path7116"
+ sodipodi:nodetypes="cccccc" />
+ </g>
+ <path
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:16.19243431;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 250.95343,65.343467 L 180.42266,111.56575 L 236.90149,216.43565 L 295.36838,209.38708 L 353.83528,216.43565 L 410.31411,111.56575 L 339.78334,65.343467 L 318.63767,65.343467 L 260.93888,65.343467 L 250.95343,65.343467 z"
+ id="path7951" />
+ <path
+ id="path7960"
+ d="M 250.95343,123.1778 L 180.42266,111.56575 L 236.90149,216.43565 L 295.36838,209.38708 L 353.83528,216.43565 L 410.31411,111.56575 L 339.78334,123.1778 L 250.95343,123.1778 z"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:16.19216728;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="cccccccc" />
+ <path
+ id="path7962"
+ d="M 249.82386,123.13262 L 236.90149,216.43565 L 295.36838,209.38708 L 353.83528,216.43565 L 343.8518,123.62407 L 336.89163,65.343467 L 255.15546,65.343467 L 249.82386,123.13262 z"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:16.19243431;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="cccccccc" />
+</svg>
diff --git a/test/jpeg1.jpg b/test/jpeg1.jpg
new file mode 100644
index 0000000..17a3155
Binary files /dev/null and b/test/jpeg1.jpg differ
diff --git a/test/jpeg2.jpg b/test/jpeg2.jpg
new file mode 100644
index 0000000..00fef17
Binary files /dev/null and b/test/jpeg2.jpg differ
diff --git a/test/map_samples/ascii/ascii1.asc b/test/map_samples/ascii/ascii1.asc
new file mode 100644
index 0000000..7f6b95f
--- /dev/null
+++ b/test/map_samples/ascii/ascii1.asc
@@ -0,0 +1,606 @@
+ncols 600
+nrows 600
+xllcorner 1646100.00000000
+yllcorner 4739680.00000000
+cellsize 1.00000000
+NODATA_value -9999.00000000
+ 256.954 256.114 255.874 255.914 256.034 255.934 255.704 255.654 255.554 255.464 255.154 255.114 255.254 255.304 255.354 256.804 258.444 258.364 257.674 256.994 255.814 255.044 254.304 256.784 256.544 255.264 254.624 253.654 252.674 254.904 254.924 254.624 254.394 254.164 253.884 253.164 252.294 251.824 251.364 250.834 250.254 249.654 248.984 248.314 247.524 245.774 246.884 248.184 247.784 247.364 246.994 246.544 245.914 245.274 244.794 244.414 243.204 241.524 241.064 241.474 242.314 242 [...]
+ 256.894 255.814 255.414 255.264 255.494 255.404 255.274 255.144 255.014 255.104 255.464 255.854 255.794 255.664 255.544 256.534 257.814 257.834 257.434 257.314 257.284 257.254 256.614 255.804 255.064 255.184 255.864 254.454 253.184 252.194 251.724 251.394 254.534 254.334 253.894 252.714 252.004 251.314 250.674 250.324 250.434 249.914 249.014 248.124 247.864 248.114 247.794 247.894 247.814 247.594 247.184 246.004 243.664 241.314 244.704 244.284 243.004 240.754 239.274 239.754 242.734 242 [...]
+ 255.384 256.514 256.314 255.984 255.644 255.404 255.014 255.274 255.784 256.194 256.144 255.934 255.814 256.054 256.344 257.354 257.814 258.014 258.164 258.214 257.474 256.524 256.454 256.494 256.574 256.544 256.434 255.654 254.314 253.234 253.064 252.834 252.004 251.304 250.524 251.104 251.424 251.474 250.934 250.084 249.504 249.514 249.324 248.544 248.104 247.824 246.684 246.194 247.064 247.104 247.374 246.694 245.214 243.744 243.524 243.804 243.704 243.514 243.324 242.914 242.564 242 [...]
+ 255.924 254.924 254.814 255.084 255.764 255.374 254.824 254.844 255.154 255.474 255.394 255.504 255.914 256.394 256.964 257.364 257.824 257.614 257.934 257.994 256.294 256.474 256.344 256.274 256.254 256.234 256.094 254.584 253.244 252.484 254.424 254.154 254.174 254.194 253.704 251.834 250.814 250.074 249.414 248.874 248.754 248.654 248.544 248.424 248.384 248.424 248.274 247.794 247.164 246.914 246.034 244.544 244.114 243.664 243.454 244.014 244.074 243.744 243.434 242.944 242.314 241 [...]
+ 256.094 254.744 254.944 255.494 256.054 255.794 255.454 255.354 255.184 254.994 255.044 255.124 255.614 256.154 256.704 257.324 257.954 257.094 256.394 255.894 257.294 256.914 256.774 256.644 256.564 256.244 255.704 255.984 256.254 256.274 255.404 254.654 254.524 254.394 253.824 252.514 251.534 251.094 250.654 249.874 248.794 248.424 248.374 248.324 248.334 248.394 248.124 247.644 247.154 246.974 246.894 245.614 243.084 241.204 242.464 244.764 244.174 243.594 243.244 242.764 242.244 241 [...]
+ 255.344 255.284 255.484 255.854 256.204 255.954 255.634 255.404 255.194 255.054 255.084 255.194 255.824 256.564 257.304 257.964 258.704 258.594 258.384 258.124 257.734 257.344 257.214 257.084 256.524 255.874 255.314 255.684 256.044 256.104 255.344 254.614 253.814 253.404 253.054 252.384 251.584 251.534 251.124 250.394 249.294 248.454 248.114 247.924 248.164 248.644 248.334 247.424 246.504 246.344 245.704 245.244 243.604 243.014 245.294 244.774 244.304 243.774 243.194 240.884 239.854 240 [...]
+ 255.884 255.284 255.474 255.784 256.084 255.834 255.364 255.614 255.994 255.984 255.734 255.244 255.944 256.784 257.634 258.404 258.994 257.774 258.354 258.614 258.184 257.784 257.474 256.954 256.494 255.734 255.084 255.314 255.584 255.754 255.664 255.194 253.744 252.374 251.374 251.174 250.964 251.054 251.144 250.684 249.564 248.914 248.714 248.414 247.974 248.044 248.214 248.064 246.344 245.394 245.534 244.964 244.784 245.014 244.974 244.754 244.164 243.734 243.304 240.994 237.724 237 [...]
+ 255.924 255.654 255.734 255.864 255.724 255.134 254.534 255.074 255.784 256.494 255.964 255.244 256.044 256.924 258.044 258.554 258.994 258.764 257.874 257.284 258.524 258.024 257.804 257.584 257.164 256.474 255.874 255.684 255.404 255.074 254.914 254.804 254.654 254.494 253.644 252.724 252.234 252.004 251.614 251.164 250.154 249.404 249.224 249.044 248.634 248.084 247.684 247.544 247.434 246.974 244.604 243.534 244.124 245.474 245.554 245.164 244.394 243.604 243.004 242.784 242.604 241 [...]
+ 256.054 255.794 255.494 255.184 254.994 254.694 254.534 255.234 255.814 256.224 255.654 255.234 256.484 257.754 258.974 259.224 259.474 259.404 259.254 259.064 258.564 258.134 257.544 257.174 256.734 256.324 256.164 255.724 255.284 254.944 254.664 254.414 254.224 254.124 253.124 251.644 251.134 250.544 250.984 250.874 251.084 250.544 249.854 249.164 248.664 248.094 247.704 247.494 247.294 246.774 246.194 244.714 242.674 240.634 240.354 240.154 239.704 239.154 239.064 239.804 242.504 240 [...]
+ 256.164 255.804 255.324 254.974 254.634 254.524 254.764 254.894 255.024 255.174 255.194 255.244 256.384 257.364 258.274 258.844 259.744 258.484 257.214 258.064 258.694 258.324 257.664 257.004 256.434 256.284 256.134 255.704 255.214 254.824 254.594 254.384 252.994 251.594 250.714 252.004 252.584 252.014 251.244 250.574 250.344 250.234 249.734 249.054 248.594 248.234 247.974 247.954 247.894 247.224 246.364 245.644 245.284 244.924 243.274 242.684 242.754 242.724 242.694 242.484 242.174 241 [...]
+ 256.704 256.344 255.814 255.364 254.954 255.144 254.984 255.694 256.224 256.574 256.084 255.264 256.204 257.294 258.484 259.394 259.704 258.074 258.924 258.304 258.454 258.064 257.484 256.904 256.404 256.084 255.744 255.344 254.944 254.534 254.124 253.924 253.974 254.014 253.024 251.504 252.424 251.894 251.364 251.014 250.434 249.464 248.744 248.224 248.364 246.554 245.474 247.254 247.124 246.864 246.304 244.594 243.064 241.974 242.764 243.774 243.514 242.604 241.964 241.794 241.734 240 [...]
+ 257.784 257.184 256.774 256.364 255.734 255.254 254.734 255.314 255.744 256.064 255.384 255.274 255.604 255.934 256.464 258.044 259.524 258.784 257.594 257.064 258.524 257.984 257.264 256.614 256.134 255.574 255.074 254.834 254.594 254.384 254.164 253.904 253.604 253.444 252.384 252.034 251.734 251.434 251.124 250.954 250.734 250.024 248.574 247.174 247.184 247.644 247.434 245.434 243.434 244.074 245.484 244.394 242.274 241.004 241.844 242.234 241.904 241.074 240.004 240.514 241.704 240 [...]
+ 258.364 257.724 256.734 255.774 255.094 255.274 255.944 255.744 255.524 255.174 255.224 255.324 255.794 256.264 256.864 257.934 259.114 259.114 259.084 258.564 256.474 256.824 257.614 256.984 256.344 255.674 255.254 255.254 255.254 254.364 252.384 251.814 254.144 252.844 251.644 252.244 252.634 251.894 251.274 250.744 250.264 250.164 250.164 250.034 248.264 246.694 246.854 246.864 246.874 246.394 245.814 244.294 242.574 242.054 244.164 244.394 242.514 240.044 238.584 241.774 241.944 241 [...]
+ 258.494 257.934 256.844 255.784 254.984 255.714 255.814 255.794 255.774 255.564 255.444 255.394 255.874 256.224 256.664 257.484 258.414 258.444 258.474 258.014 257.024 256.394 256.854 256.904 256.654 256.074 255.714 255.514 255.334 255.124 254.884 254.784 254.864 254.934 254.524 253.604 252.694 252.144 251.374 250.844 250.364 249.774 249.284 249.234 248.844 247.654 246.594 245.904 245.914 245.554 245.084 243.584 242.924 242.264 243.144 243.824 243.604 243.174 242.754 241.434 239.584 239 [...]
+ 258.454 257.904 256.794 255.704 254.794 254.794 254.884 254.984 255.204 255.354 255.304 255.424 255.724 256.014 256.284 257.024 257.614 257.444 257.404 257.174 256.904 257.114 256.744 256.374 256.124 255.844 255.574 255.374 255.214 255.114 255.054 254.984 254.894 254.804 253.844 252.274 251.434 251.234 251.134 249.714 247.614 246.654 246.294 245.934 246.324 247.324 247.284 246.604 245.874 245.784 245.604 245.134 244.564 243.904 243.184 243.104 242.974 242.764 242.444 242.384 242.224 241 [...]
+ 258.064 257.414 256.504 255.604 254.874 255.424 255.904 255.754 255.474 255.264 255.354 255.434 255.514 255.594 255.884 256.544 257.034 256.904 256.894 257.024 257.454 257.774 257.504 257.184 256.264 254.804 254.254 254.724 255.204 255.334 255.044 254.574 253.914 253.534 252.484 252.354 252.044 251.464 250.944 250.074 249.454 249.144 249.014 248.874 248.454 247.924 246.654 245.494 244.334 244.274 245.694 245.494 244.964 244.434 243.314 240.534 240.364 241.354 242.354 241.444 240.994 240 [...]
+ 257.714 257.064 256.674 256.124 255.734 255.844 255.634 255.504 255.364 255.374 255.404 255.484 255.884 256.314 256.804 257.304 257.434 256.554 255.674 256.594 257.374 258.384 258.054 257.734 256.974 255.554 254.534 254.744 254.834 254.764 254.614 254.454 253.954 253.404 253.174 253.194 253.004 252.654 252.074 251.484 249.604 249.064 249.204 249.014 248.404 247.784 247.554 247.424 246.684 245.984 245.404 244.884 244.314 243.754 243.234 242.744 241.124 239.414 238.544 241.444 240.524 238 [...]
+ 257.604 256.974 256.634 256.294 255.964 255.664 255.754 255.924 256.104 256.254 255.874 255.654 256.174 256.604 257.054 257.594 258.214 258.104 257.824 258.074 256.854 256.174 256.564 257.184 256.614 254.424 253.584 254.184 254.794 254.844 254.514 254.354 254.074 253.754 253.694 253.654 253.284 252.094 250.884 249.964 248.974 248.904 248.254 247.204 246.084 247.064 247.174 247.054 246.894 246.184 245.324 244.974 244.704 244.194 243.704 243.204 242.184 241.354 240.644 240.784 240.624 238 [...]
+ 257.914 257.534 257.094 256.614 256.294 256.484 256.534 256.464 256.364 256.174 255.784 255.704 256.104 256.504 256.964 257.874 258.414 258.084 257.764 256.924 255.614 255.884 256.194 256.704 256.374 255.724 255.564 255.834 255.654 255.274 254.664 254.184 253.784 253.414 253.414 253.594 253.244 252.284 250.544 249.674 249.044 249.444 249.854 250.254 248.824 247.104 246.254 244.584 242.944 244.034 245.374 244.294 243.784 243.554 244.014 243.694 241.714 240.434 239.634 240.404 241.254 240 [...]
+ 258.374 257.784 257.324 256.874 256.494 256.174 255.934 255.934 255.984 255.954 255.744 255.704 255.824 256.014 256.494 257.444 257.974 257.624 257.424 257.454 257.754 257.664 257.344 257.044 256.634 256.264 255.944 255.604 255.294 254.904 254.334 254.114 253.994 253.674 253.574 253.644 253.304 252.674 251.494 250.114 249.464 249.734 249.924 250.124 248.714 247.094 246.894 246.924 246.954 246.454 245.944 244.704 243.424 242.314 242.614 243.034 241.044 239.064 238.684 241.304 241.424 240 [...]
+ 258.574 257.664 257.054 256.454 255.944 255.714 255.644 255.644 255.644 255.664 255.714 255.794 256.194 256.744 257.454 257.844 257.874 257.864 257.864 257.844 257.794 257.624 257.284 256.944 256.634 256.324 255.974 255.664 255.314 254.654 253.844 253.634 253.724 253.824 253.434 253.404 253.094 252.564 251.914 251.354 250.404 249.684 249.214 249.284 248.794 247.624 247.064 246.644 246.614 246.254 245.874 244.944 244.104 243.274 242.404 241.404 240.954 240.794 241.454 241.624 241.644 240 [...]
+ 258.124 257.174 256.684 256.224 255.874 255.724 255.774 255.744 255.844 255.914 255.874 256.054 256.714 256.994 257.634 258.034 258.084 258.264 258.434 258.474 258.134 257.764 257.364 256.974 256.544 256.054 255.704 255.424 255.134 253.784 254.624 254.344 254.224 254.044 253.554 252.934 252.454 252.054 251.664 251.214 250.674 249.984 248.034 246.084 246.524 247.574 246.114 244.404 244.024 244.244 245.564 245.524 245.404 244.594 244.014 242.794 241.864 240.944 241.524 241.874 241.884 241 [...]
+ 258.594 257.864 257.274 256.664 256.314 256.524 256.614 256.404 256.184 256.024 255.944 255.884 255.904 255.924 256.004 256.984 258.744 258.914 259.084 258.984 258.634 258.284 257.864 257.484 256.994 256.164 255.604 255.214 254.814 254.004 252.854 252.594 252.684 253.774 253.454 253.084 252.534 252.004 251.484 251.074 250.664 250.044 249.394 248.744 246.914 246.024 245.154 245.794 246.464 245.974 245.444 244.194 242.944 242.514 243.144 243.834 241.644 240.284 239.664 239.564 240.354 240 [...]
+ 258.064 257.144 257.174 257.154 256.794 256.244 255.894 255.904 255.994 256.074 255.974 255.944 255.994 256.044 256.084 257.144 258.174 258.994 259.384 259.464 259.234 258.754 258.114 257.484 256.744 256.194 255.814 255.424 255.064 254.804 254.394 254.074 253.764 253.434 253.484 253.284 252.634 251.904 251.354 250.764 250.264 249.954 249.664 249.154 247.764 247.094 246.724 246.364 246.474 246.034 244.184 243.884 243.584 244.044 242.714 241.454 241.614 242.224 242.584 241.164 238.454 237 [...]
+ 256.174 255.244 255.654 256.054 256.054 255.634 255.634 255.794 255.954 256.044 256.004 256.004 256.214 256.654 257.154 257.984 258.744 259.054 259.374 259.354 259.014 258.504 257.894 257.334 256.914 256.534 256.074 255.634 255.194 253.534 253.824 253.514 253.094 252.654 252.424 252.474 251.944 251.064 250.184 250.784 250.194 249.574 249.154 248.854 248.394 247.694 246.074 245.094 244.864 245.514 245.734 245.284 244.844 245.154 244.804 243.184 242.904 242.614 242.374 242.244 241.624 239 [...]
+ 255.834 255.164 255.434 255.884 256.064 255.904 255.824 256.074 256.294 256.374 256.184 256.284 256.814 257.184 257.934 258.564 258.874 258.914 259.104 258.994 258.754 258.424 258.004 257.584 257.034 256.424 255.964 255.504 255.034 254.744 253.224 251.914 250.664 250.824 250.304 249.964 249.404 248.774 248.114 249.044 250.224 249.674 249.044 248.434 248.014 247.574 246.994 246.514 246.144 246.384 246.334 244.114 242.584 242.204 242.434 242.904 242.424 242.174 242.674 242.874 242.864 242 [...]
+ 256.204 255.964 256.314 256.674 256.534 256.054 255.894 256.124 256.324 256.324 256.124 256.194 256.374 256.564 257.344 258.534 259.024 258.834 258.634 258.454 258.364 257.564 257.714 257.274 256.714 256.004 255.434 254.924 254.414 254.214 254.164 253.754 253.024 251.744 251.104 250.924 250.764 250.604 250.444 250.354 250.564 249.884 249.074 248.344 247.984 247.604 246.994 246.214 245.944 246.224 246.374 245.744 245.214 244.754 244.394 243.614 241.464 239.604 239.664 242.334 242.734 242 [...]
+ 256.924 256.744 256.654 256.674 256.464 256.104 255.964 256.044 256.134 256.164 256.144 256.294 256.684 257.084 257.414 257.894 258.314 258.074 257.874 257.934 258.104 257.454 256.204 254.944 254.544 255.284 255.074 254.594 254.104 254.064 254.084 253.764 253.284 252.804 252.564 252.354 252.174 251.914 251.544 250.424 250.114 249.604 249.034 248.074 246.664 246.404 246.154 245.964 246.404 246.394 246.184 245.584 244.904 244.374 244.194 243.944 243.444 242.944 242.544 242.514 242.344 241 [...]
+ 257.344 257.054 256.654 256.254 255.954 255.924 256.264 256.214 256.234 256.254 256.274 256.514 257.054 257.734 258.174 257.824 257.564 257.804 257.834 257.764 257.374 256.994 256.604 256.274 255.874 255.334 254.984 254.654 254.324 253.874 253.684 253.424 253.134 252.894 252.654 252.424 252.214 252.004 251.764 249.384 247.854 247.104 247.324 247.644 248.104 247.614 245.984 244.554 244.034 244.574 244.894 244.594 244.514 244.694 244.344 243.984 243.474 242.964 242.564 242.264 241.364 239 [...]
+ 256.974 256.514 255.994 255.604 255.864 256.564 256.774 256.604 256.444 256.384 256.404 256.824 257.554 258.244 257.784 256.584 256.424 256.864 257.314 257.154 256.984 256.704 256.314 256.014 255.894 255.704 255.444 255.254 253.144 253.814 252.754 252.854 253.054 252.954 252.624 252.324 252.094 251.864 250.864 250.154 251.654 249.584 247.514 246.164 247.094 247.894 247.244 246.324 245.194 244.944 244.464 242.804 241.144 241.254 242.864 243.844 243.184 242.604 242.164 241.814 240.834 241 [...]
+ 256.304 256.354 256.274 256.184 256.334 256.694 256.794 256.644 256.484 256.444 256.474 257.094 257.674 258.254 258.274 257.974 257.814 257.654 257.414 257.314 257.234 257.064 256.814 256.534 256.404 255.754 255.464 255.224 254.514 253.394 252.084 251.994 252.354 252.724 252.744 252.454 252.504 252.554 251.564 251.464 252.004 250.354 248.954 247.724 247.164 247.204 246.964 246.714 245.914 244.204 242.764 241.864 240.974 241.174 242.864 243.414 241.324 239.244 239.504 241.824 241.684 241 [...]
+ 256.454 256.014 255.894 255.774 255.974 256.704 256.954 256.714 256.474 256.874 257.624 258.064 258.204 258.344 258.304 258.244 258.184 258.134 258.074 257.504 256.744 256.614 256.724 256.854 256.304 255.624 255.434 255.234 255.024 254.314 253.554 252.484 251.454 250.444 251.254 252.424 252.114 252.004 251.934 252.194 251.954 251.224 250.324 249.124 247.844 246.234 246.654 246.874 246.804 247.074 246.714 245.614 244.524 244.044 243.874 242.314 242.064 241.814 240.284 237.424 237.604 239 [...]
+ 255.944 255.524 255.464 255.424 255.954 256.834 257.084 256.814 256.534 257.024 257.914 258.264 258.394 258.534 258.524 258.304 258.064 257.904 257.784 257.124 255.914 255.944 256.284 256.634 256.104 255.434 255.254 255.114 254.974 254.254 253.464 253.304 253.154 252.754 252.404 252.004 250.504 249.014 247.974 249.904 251.614 251.034 249.244 247.664 246.694 245.904 246.394 247.054 247.434 247.294 247.204 246.274 245.374 244.644 244.114 242.614 242.214 241.974 242.014 242.324 240.704 240 [...]
+ 256.584 256.154 255.794 255.424 255.874 256.844 257.144 257.004 256.854 257.414 258.084 258.394 258.604 258.894 258.674 258.174 258.034 258.034 258.034 256.864 255.744 255.464 255.694 256.184 255.754 255.544 255.284 255.014 254.744 254.094 253.454 253.474 253.404 252.414 251.344 251.804 251.624 251.444 250.924 250.854 250.984 250.364 249.154 248.064 247.304 247.654 247.774 247.904 248.074 247.824 247.274 246.384 245.454 244.534 243.824 243.024 241.984 241.344 241.214 241.054 240.004 239 [...]
+ 256.994 256.484 256.064 255.544 255.904 256.224 256.464 256.644 257.184 257.694 258.204 258.714 259.104 259.514 259.114 258.364 257.464 256.504 255.644 256.734 257.904 257.334 256.744 256.154 255.924 255.154 254.374 255.264 254.994 254.254 253.534 253.404 253.374 253.274 252.364 251.554 251.544 251.474 251.304 250.984 250.514 248.814 248.374 248.014 247.844 248.164 247.444 246.724 246.834 246.444 244.974 244.694 244.394 243.154 240.914 239.944 241.014 241.934 240.504 239.004 238.964 238 [...]
+ 256.334 256.234 255.894 255.544 255.634 255.854 256.364 257.034 257.694 258.444 259.194 259.454 259.404 259.354 258.824 258.794 258.914 259.074 259.244 258.284 257.014 256.594 256.354 256.374 255.414 254.454 254.174 253.754 253.374 253.454 253.794 253.594 253.344 253.024 252.104 251.374 251.194 251.144 250.654 248.414 247.634 248.084 248.954 249.324 248.704 248.354 247.924 247.324 246.574 245.774 244.334 243.814 243.344 243.364 243.774 243.544 242.224 240.904 239.464 237.944 238.004 239 [...]
+ 256.244 256.264 255.934 255.604 255.644 255.824 256.704 257.814 258.844 258.914 259.124 259.554 259.714 259.574 258.234 256.614 257.464 259.464 259.504 258.334 257.354 257.154 257.054 256.994 256.134 255.304 255.274 255.254 255.094 254.654 254.224 253.774 253.334 252.904 252.414 251.954 251.474 250.744 249.474 249.284 249.944 249.624 249.334 249.414 248.924 248.144 247.514 247.064 246.824 246.344 245.834 245.694 245.264 244.984 244.864 244.174 242.794 241.484 241.064 241.214 240.654 239 [...]
+ 256.404 256.214 255.944 255.674 255.694 255.824 256.744 258.054 259.354 259.984 260.234 260.254 260.194 259.974 259.764 259.594 259.554 259.544 259.524 258.794 257.744 257.424 257.094 256.714 256.064 255.744 255.904 256.054 256.004 254.104 252.414 252.484 253.204 252.714 252.474 252.064 251.764 251.464 250.024 248.524 248.814 247.844 246.964 247.104 247.864 248.014 247.144 246.274 245.934 246.274 245.624 243.734 241.834 244.934 245.124 243.724 241.294 239.164 239.764 241.584 240.354 238 [...]
+ 256.394 256.214 255.984 255.774 255.814 255.934 256.174 256.454 257.084 258.254 260.064 259.994 259.434 259.044 258.954 259.084 259.164 259.244 259.204 258.124 256.904 256.694 256.614 256.514 256.184 256.104 255.784 255.664 255.644 255.434 255.164 254.304 253.354 252.544 252.274 252.024 251.734 251.424 250.854 249.824 249.444 249.114 248.334 247.894 248.274 248.834 248.124 247.384 246.974 247.084 246.784 246.484 245.974 245.564 244.954 244.274 243.504 242.744 241.344 238.744 238.044 239 [...]
+ 256.654 256.434 256.134 255.834 255.874 256.174 257.374 258.754 260.114 260.534 260.634 260.214 259.484 258.744 257.354 256.334 256.674 257.724 258.214 257.204 256.234 255.294 254.354 254.854 255.154 256.334 256.294 255.994 255.404 253.774 254.644 253.894 253.144 252.184 251.184 251.904 251.594 251.264 251.024 250.704 250.304 249.904 249.514 249.204 249.134 248.894 248.254 247.544 247.024 245.984 244.374 243.824 244.904 245.134 244.744 244.084 243.384 242.694 242.114 241.034 240.064 239 [...]
+ 256.524 256.334 256.064 255.804 256.654 256.984 257.604 258.654 259.704 260.114 260.404 259.894 259.234 258.674 258.134 257.604 257.604 257.694 257.784 256.794 256.444 256.294 256.084 255.584 254.784 255.324 254.214 253.114 254.374 254.794 253.154 252.514 253.094 252.114 251.274 250.924 250.774 250.624 250.644 250.594 250.434 250.024 249.624 249.304 249.104 248.884 248.324 247.694 247.164 246.944 245.734 243.634 241.784 242.924 243.844 243.494 243.214 242.524 242.104 241.464 240.194 239 [...]
+ 256.474 256.164 255.974 255.744 257.474 259.504 259.894 259.874 259.854 260.054 259.994 259.604 259.174 258.734 258.264 257.814 257.754 257.674 257.564 257.484 257.324 257.004 256.604 256.174 255.584 255.374 255.564 255.744 255.464 255.424 254.864 254.124 253.224 252.424 251.904 251.534 251.364 251.134 250.984 251.124 250.934 250.384 249.834 249.504 249.304 249.084 248.854 248.624 248.214 247.644 247.134 246.614 246.104 245.064 243.664 242.854 242.574 242.294 241.984 241.724 241.374 240 [...]
+ 256.224 255.934 255.804 255.664 257.434 259.454 259.814 259.874 260.094 259.834 259.504 259.094 258.754 258.414 257.964 257.284 257.334 257.384 257.374 257.104 256.804 256.524 256.304 256.074 255.804 255.534 255.304 255.234 255.124 254.844 254.474 253.754 253.024 252.484 251.984 251.534 251.314 251.154 250.774 250.474 250.484 250.464 250.034 249.674 249.514 249.194 248.734 248.374 248.054 247.684 247.214 246.744 246.284 245.294 244.084 243.354 242.884 242.414 241.044 238.474 237.464 237 [...]
+ 256.124 255.864 255.744 255.614 257.304 259.294 259.894 260.284 260.674 260.474 260.174 259.664 259.054 258.434 257.594 256.964 257.054 257.324 257.504 256.004 255.784 255.784 255.784 255.904 255.654 255.384 255.064 254.744 254.054 254.174 253.884 253.284 252.684 252.194 252.054 251.834 250.854 249.474 248.394 249.104 249.584 249.624 249.674 249.424 249.184 248.894 248.484 248.014 247.654 247.294 246.954 246.664 246.224 245.364 244.264 243.564 243.094 242.624 241.364 239.764 238.794 238 [...]
+ 256.164 256.024 255.824 255.604 257.104 258.814 259.514 259.844 260.184 259.974 259.334 259.004 258.684 258.314 258.164 257.974 257.854 257.724 257.594 257.484 256.974 256.474 255.894 255.474 255.794 255.554 255.134 254.724 253.934 252.604 251.724 251.634 252.044 252.234 252.014 251.734 251.214 250.704 249.834 249.684 249.884 249.704 249.534 249.184 248.684 248.204 247.844 247.474 247.194 246.964 246.514 246.164 245.874 245.274 244.244 243.664 243.234 242.764 241.784 240.424 239.844 239 [...]
+ 256.334 256.094 255.824 255.564 255.984 257.124 257.774 258.564 259.474 258.854 258.504 257.604 257.154 256.754 256.954 257.444 257.414 257.384 257.384 256.644 255.984 255.714 255.444 255.324 255.614 255.204 254.984 254.574 254.114 253.674 253.294 252.984 252.644 252.124 251.704 251.484 251.304 250.814 250.364 250.024 249.924 249.924 249.854 249.564 249.194 248.634 248.004 247.434 247.144 246.904 246.414 245.864 245.294 244.724 244.164 243.734 243.334 242.704 241.934 240.854 240.204 239 [...]
+ 256.294 256.194 255.994 255.794 256.204 256.314 257.114 257.914 258.754 259.084 259.344 258.534 257.744 257.054 257.514 257.314 256.154 257.144 257.434 256.924 256.494 256.144 255.814 255.454 254.804 254.284 254.124 253.954 253.684 253.214 252.844 252.694 252.564 252.204 251.404 250.904 250.774 250.654 250.514 250.154 249.654 249.354 249.294 249.094 248.704 248.444 248.294 247.684 246.854 246.174 245.684 244.394 242.934 243.554 244.584 243.784 242.594 241.394 241.054 240.944 239.604 239 [...]
+ 255.434 255.544 255.734 256.084 256.134 256.414 257.244 258.204 259.174 259.184 258.954 258.524 258.124 257.804 257.764 257.814 257.214 256.244 255.704 256.734 256.414 256.584 256.754 256.524 256.224 255.724 254.834 253.934 253.064 252.514 252.244 252.324 252.364 252.024 251.384 250.914 250.724 250.544 250.394 250.264 249.284 247.844 246.934 246.244 247.514 247.934 247.824 247.714 247.304 244.314 243.024 242.234 241.564 241.734 243.274 242.594 241.704 241.464 241.104 240.964 239.584 239 [...]
+ 255.054 255.444 255.834 256.204 257.024 257.834 258.214 258.444 258.654 258.484 258.524 258.214 257.914 257.664 257.994 258.214 257.724 257.174 256.634 256.154 255.794 255.974 256.124 256.164 255.704 254.994 254.224 253.364 252.474 252.014 251.744 251.604 251.704 251.814 251.624 251.194 250.954 250.744 250.604 250.484 249.464 249.234 249.124 248.504 247.624 247.874 247.834 247.794 247.434 246.944 246.314 245.854 245.394 244.844 243.664 242.114 240.494 238.924 241.824 241.314 240.814 240 [...]
+ 255.014 255.334 255.704 256.124 257.334 258.264 258.224 258.104 257.774 257.944 258.044 257.374 256.764 256.404 257.354 257.624 257.134 256.644 256.124 255.454 255.034 255.234 255.584 255.564 254.814 254.054 253.364 252.694 252.564 253.124 253.064 252.334 251.604 251.314 251.474 251.264 250.854 250.514 250.604 250.724 250.314 249.714 249.364 248.804 248.044 247.644 247.424 247.324 247.214 247.084 246.414 245.664 244.994 244.924 244.474 244.044 243.034 241.884 241.704 241.444 240.624 239 [...]
+ 255.094 255.624 256.414 257.254 258.374 258.214 257.604 257.014 256.704 257.124 257.444 256.634 256.114 255.944 256.914 256.614 256.844 256.644 256.184 255.534 254.844 253.794 253.654 255.394 254.594 253.834 253.144 252.544 252.324 252.804 252.744 252.094 251.454 251.204 251.354 250.584 249.364 249.724 250.134 250.584 250.404 249.804 249.184 248.584 247.924 247.454 247.164 246.944 246.644 246.454 244.674 242.704 241.484 241.244 242.704 242.654 242.454 241.544 241.344 241.164 240.454 239 [...]
+ 255.694 256.684 257.494 258.064 257.984 258.054 257.914 257.574 257.324 257.554 257.184 256.914 256.644 256.294 255.314 254.834 255.204 255.774 256.064 255.644 255.664 255.554 254.914 253.954 253.384 253.744 253.524 253.294 253.044 252.694 252.484 252.374 251.904 250.824 249.944 249.704 249.754 249.894 250.234 250.434 250.154 249.584 249.014 248.404 247.814 247.454 247.044 246.644 246.314 246.014 245.054 243.984 243.024 242.674 242.274 241.084 239.854 239.004 240.814 240.704 240.014 239 [...]
+ 255.924 256.434 256.944 257.434 257.784 258.084 257.974 257.774 257.544 257.204 256.904 256.594 257.034 256.724 256.084 255.734 255.804 255.874 255.284 255.194 256.004 255.874 255.744 255.264 254.264 253.624 253.424 253.244 252.844 252.224 251.834 251.744 251.644 251.344 250.654 250.414 250.434 250.324 250.004 249.834 249.474 248.894 248.314 247.534 246.794 246.694 246.714 246.564 246.184 245.814 245.024 244.174 243.324 243.054 242.784 242.104 241.424 240.854 240.944 241.014 239.314 237 [...]
+ 256.084 256.444 256.944 257.424 257.784 258.024 257.664 257.294 256.994 257.094 256.954 256.424 256.094 256.104 256.654 256.274 255.964 255.664 255.004 254.894 255.224 255.764 255.724 254.704 252.774 253.624 253.354 253.094 252.344 251.274 250.934 250.954 250.994 250.764 250.304 250.144 250.154 250.164 249.874 249.454 248.904 248.324 247.734 247.124 246.294 246.164 246.194 246.254 245.854 245.424 244.934 244.444 243.624 243.344 243.024 242.704 242.624 242.544 242.244 241.614 239.704 239 [...]
+ 257.444 257.554 257.644 257.774 258.094 257.644 256.894 256.274 255.854 256.604 257.304 256.164 255.034 254.504 254.034 255.224 256.184 255.994 255.954 255.934 255.594 255.274 254.994 254.114 253.834 253.534 253.214 252.834 251.934 250.794 250.474 250.584 250.694 250.254 248.944 248.874 249.244 249.624 249.444 249.014 248.414 247.804 247.194 246.704 246.094 246.084 246.104 246.124 245.814 245.424 244.924 244.294 243.294 243.384 243.034 242.684 242.414 242.274 241.694 241.004 239.544 238 [...]
+ 257.174 257.504 257.864 258.144 257.544 256.954 256.604 256.274 256.354 257.574 257.554 257.584 257.614 257.494 256.864 256.474 256.524 256.334 256.074 255.704 255.374 255.244 255.004 253.964 252.824 252.394 252.044 252.674 251.724 250.574 250.304 250.464 250.624 249.734 249.504 249.254 248.774 249.334 249.134 248.684 247.824 246.864 246.144 246.094 245.954 246.024 246.164 246.304 245.834 245.274 244.684 243.534 242.434 242.634 242.824 242.504 242.164 241.814 241.394 240.864 240.124 239 [...]
+ 257.354 257.754 258.154 258.394 258.104 257.844 257.694 257.444 257.184 257.084 256.864 256.884 256.814 256.654 256.494 256.394 256.264 256.134 255.784 255.124 254.774 254.774 254.794 254.574 254.074 253.594 253.134 252.544 251.774 250.894 250.654 250.724 250.794 250.834 251.214 250.954 250.334 249.624 248.714 248.224 247.824 247.184 246.224 246.074 246.174 246.204 246.234 246.394 244.694 243.674 243.764 243.844 243.224 242.794 242.404 242.084 241.754 241.424 241.074 240.694 240.174 239 [...]
+ 257.944 258.114 258.324 258.434 258.164 257.824 257.614 257.414 257.244 257.604 257.394 256.184 255.194 255.104 256.204 255.794 255.564 255.344 254.934 254.834 254.814 254.654 254.494 253.904 253.014 252.564 252.354 252.184 251.994 251.434 251.224 251.154 251.084 250.984 250.844 250.464 250.014 249.564 248.834 247.864 247.334 246.964 246.594 246.334 246.184 246.094 246.054 246.024 245.144 243.464 243.174 243.194 243.264 242.764 242.184 241.354 240.674 240.424 240.484 240.414 240.034 239 [...]
+ 258.224 258.194 258.074 257.894 257.574 257.514 257.314 257.164 257.184 257.594 257.624 257.094 256.574 256.034 255.374 254.994 254.954 254.914 254.954 255.074 254.974 254.734 254.524 253.864 253.984 253.394 252.494 251.754 251.574 251.444 251.034 250.454 249.384 249.514 250.434 250.234 249.694 249.184 248.634 248.014 247.394 246.814 246.284 245.924 245.584 245.494 245.424 245.354 244.844 244.244 243.904 243.614 243.304 242.914 242.064 241.754 240.884 240.044 239.714 239.784 239.444 239 [...]
+ 257.934 257.614 257.294 257.174 257.474 257.594 257.334 257.054 257.004 257.384 257.414 256.984 256.544 256.004 255.404 254.614 253.624 252.644 253.844 254.534 255.024 254.724 254.434 254.424 254.554 254.064 253.334 252.364 251.784 251.324 250.934 250.514 250.104 249.914 250.294 249.544 248.774 248.174 248.124 247.704 246.884 246.114 245.514 245.584 245.364 245.314 245.264 245.204 245.144 245.054 244.684 244.304 243.854 242.794 241.874 241.564 241.254 240.664 239.684 238.704 237.714 236 [...]
+ 257.554 257.474 257.254 257.174 257.634 257.794 257.394 256.984 256.824 257.154 257.204 256.894 256.594 256.154 255.264 254.684 254.594 254.054 253.604 253.854 254.334 254.194 254.144 254.124 254.284 253.884 253.134 252.394 251.844 251.324 250.994 250.714 250.444 250.144 249.924 248.974 248.014 247.044 247.344 247.494 246.394 245.554 244.754 245.064 245.194 245.204 244.224 243.114 243.594 244.874 244.484 244.094 243.604 242.574 241.684 241.284 240.824 240.134 238.734 237.604 237.324 237 [...]
+ 256.824 256.854 256.884 257.104 257.644 257.794 257.364 256.924 256.764 256.474 255.754 254.624 253.604 253.744 254.074 253.994 254.004 254.024 254.004 253.924 253.914 253.964 253.984 253.824 253.604 253.184 252.594 252.064 251.584 251.154 250.954 250.794 250.564 249.934 249.374 248.274 247.094 246.024 246.754 247.604 246.404 245.144 244.094 244.304 243.494 243.704 244.404 245.024 244.884 244.714 244.494 244.124 243.664 242.944 242.104 241.614 240.894 239.974 238.604 237.744 237.834 237 [...]
+ 257.244 257.084 256.904 256.994 257.514 257.554 257.124 256.704 256.264 255.774 255.694 256.084 256.474 256.424 255.774 255.224 254.684 254.054 253.714 253.584 253.484 253.504 253.524 253.514 253.344 252.974 252.564 252.104 251.584 251.044 250.854 249.874 248.614 248.134 249.174 248.344 247.344 246.154 246.594 247.414 246.194 245.104 244.174 244.774 244.874 244.714 244.544 244.714 244.014 242.544 242.254 242.984 243.724 243.094 242.394 241.644 240.904 239.824 238.264 237.104 236.474 235 [...]
+ 257.254 257.224 257.204 257.214 257.244 257.084 256.724 256.224 255.724 255.274 255.254 255.614 255.974 255.894 255.694 255.244 254.634 254.014 253.674 253.504 252.604 251.404 250.294 251.104 252.634 252.824 252.524 252.164 251.624 251.044 250.814 250.634 250.454 249.824 249.134 248.404 247.484 246.564 245.684 245.084 244.824 244.644 244.524 244.854 245.324 245.044 244.794 244.594 244.494 243.374 242.714 242.174 242.874 242.654 242.414 241.844 241.284 240.174 237.944 236.444 236.024 235 [...]
+ 256.824 256.734 256.664 256.644 256.714 256.354 255.544 254.864 254.404 254.964 255.354 255.424 255.254 255.134 255.064 254.814 254.364 253.714 253.384 253.354 252.424 251.174 252.334 251.964 251.964 252.084 251.894 251.704 251.944 251.684 251.174 250.654 250.164 249.494 248.774 248.094 247.404 246.744 246.334 245.934 245.614 245.294 245.064 245.314 245.264 243.744 242.214 241.554 244.484 244.354 244.094 243.644 243.194 243.084 242.904 242.244 241.524 240.714 239.724 238.634 238.404 238 [...]
+ 256.314 256.204 256.084 256.084 256.184 256.174 255.744 255.194 255.194 255.384 254.644 253.444 252.634 253.724 253.894 253.644 253.524 253.394 253.344 253.254 252.924 252.214 251.174 250.634 250.584 250.054 249.494 250.144 250.604 251.484 250.954 250.364 249.764 249.294 248.654 248.064 247.474 246.834 246.474 246.104 245.814 245.524 245.314 245.614 245.784 245.374 244.974 244.424 241.744 240.454 241.664 242.874 243.504 243.064 242.634 241.944 241.394 240.914 240.324 239.714 239.304 238 [...]
+ 256.084 255.814 255.544 255.504 255.654 255.634 255.554 255.524 255.504 255.504 255.234 254.614 253.764 253.924 253.754 253.644 253.554 253.474 253.264 253.024 252.704 252.394 252.084 250.594 249.094 249.984 251.694 251.064 251.314 250.824 250.614 250.064 249.524 249.024 248.564 248.064 247.504 246.934 246.484 246.154 245.974 245.754 245.404 244.744 244.864 244.934 244.994 244.634 244.194 243.804 243.864 243.824 243.534 242.794 241.704 240.014 239.444 240.844 240.334 239.274 237.534 235 [...]
+ 255.904 255.624 255.304 255.224 255.684 255.804 255.664 255.524 255.574 255.784 255.514 255.024 254.524 254.214 253.774 253.634 253.634 253.584 253.364 253.024 251.824 250.464 250.454 250.894 250.504 250.824 251.034 251.244 250.394 249.564 249.504 249.434 249.484 247.964 247.384 246.254 246.624 247.144 245.304 243.914 244.484 245.084 245.574 245.324 244.524 243.274 242.204 242.624 243.884 243.654 243.584 243.514 243.134 242.154 240.974 240.704 240.884 240.944 240.364 239.474 238.754 237 [...]
+ 255.594 255.724 255.854 256.184 256.214 255.944 255.904 255.744 255.714 255.054 254.714 254.514 254.454 254.094 253.554 253.534 253.564 253.594 253.354 253.104 252.764 252.414 251.434 251.234 251.664 251.174 250.684 250.194 249.974 249.764 249.514 249.264 249.314 247.974 247.674 247.804 247.934 247.984 247.164 246.444 246.094 245.654 245.114 243.484 242.694 242.824 243.574 243.964 243.644 243.424 243.354 242.584 242.064 241.864 241.284 241.184 241.204 240.694 239.524 238.654 238.094 237 [...]
+ 256.134 256.534 256.834 256.564 255.874 255.584 255.494 255.404 254.904 254.354 253.434 252.974 253.914 253.414 252.674 252.754 253.034 253.464 253.404 253.254 252.824 252.414 252.014 251.954 251.454 251.244 251.024 250.454 248.274 246.874 249.664 249.264 248.884 249.084 248.684 248.264 247.904 247.624 246.634 245.894 245.414 244.944 244.744 245.174 244.724 244.284 243.834 243.894 243.454 242.564 241.274 240.064 239.644 238.574 238.534 239.334 240.134 240.414 239.544 238.224 236.644 235 [...]
+ 256.054 256.354 256.654 256.454 255.954 254.884 253.564 252.244 253.134 254.414 254.264 253.474 252.674 252.954 252.744 252.874 253.084 253.344 253.424 253.454 252.994 252.424 251.844 251.284 250.754 250.644 250.514 250.384 249.284 248.034 248.264 248.304 248.234 248.404 248.504 248.114 247.624 246.874 244.714 243.784 243.924 244.274 244.024 242.344 242.014 242.514 243.494 243.624 242.314 241.394 240.214 239.294 239.244 240.024 239.994 239.634 239.284 239.474 239.384 239.074 238.604 238 [...]
+ 255.814 256.084 256.364 255.054 253.574 252.514 253.444 254.034 253.964 254.674 254.694 254.204 253.664 253.394 253.174 253.134 253.114 253.094 253.084 252.754 252.374 251.994 251.554 250.984 250.454 250.354 250.184 249.894 249.434 248.624 248.134 247.644 247.544 247.514 247.474 247.134 246.724 245.684 245.094 245.334 245.144 244.944 244.694 243.854 243.214 243.404 243.674 243.884 242.074 240.474 240.494 239.964 239.584 240.194 240.394 240.004 239.664 239.374 239.114 238.854 238.634 238 [...]
+ 256.064 256.004 255.924 255.884 255.954 255.964 255.214 254.034 255.234 254.744 254.234 253.774 253.314 253.034 252.784 252.724 252.654 252.584 252.284 251.914 251.634 251.304 250.974 250.534 250.414 249.754 249.084 248.724 246.814 245.694 245.564 245.454 245.494 246.434 247.324 246.814 246.164 245.124 244.834 245.284 245.114 244.944 244.694 244.344 243.944 243.594 243.244 243.064 242.934 242.934 242.304 241.504 240.574 238.854 237.994 238.544 239.084 238.964 238.474 238.414 238.564 238 [...]
+ 255.574 255.354 255.144 255.374 255.804 255.764 255.504 255.244 254.684 254.124 253.694 253.294 252.914 252.614 252.254 252.134 252.024 251.924 251.564 251.174 250.914 250.744 250.574 250.364 250.264 249.774 249.094 248.434 247.884 247.354 247.104 246.844 246.624 247.094 247.334 246.714 246.174 245.734 245.504 245.304 245.344 245.274 244.954 244.344 243.934 243.464 243.034 242.234 240.994 241.004 241.134 241.264 240.554 239.894 239.454 239.154 238.824 238.454 238.004 237.374 237.504 237 [...]
+ 254.834 254.294 253.884 254.584 255.334 254.304 252.914 253.564 254.434 254.484 254.014 253.414 252.814 252.364 251.934 251.424 251.134 250.934 250.704 250.904 250.744 250.584 250.404 250.054 249.684 249.264 248.854 248.424 247.884 247.524 247.594 247.674 247.694 247.604 247.314 246.674 246.034 245.374 245.184 245.014 244.954 244.924 243.844 241.114 240.374 241.254 242.124 242.204 241.094 240.854 241.354 241.644 239.994 238.154 238.134 238.534 238.534 238.284 238.064 237.484 236.744 236 [...]
+ 254.554 254.004 253.464 254.174 254.934 254.764 254.274 253.204 253.994 252.934 252.664 252.474 252.544 252.254 251.894 251.434 250.954 250.464 249.104 248.014 249.284 250.184 249.964 249.584 249.264 249.044 248.824 248.494 247.444 246.824 247.324 247.594 247.624 247.564 247.284 246.664 246.044 245.374 244.664 244.334 244.174 244.014 243.724 243.104 242.414 241.914 241.834 242.024 241.304 240.794 241.134 241.504 241.224 238.434 237.134 236.644 236.134 235.834 235.814 235.424 234.984 234 [...]
+ 254.564 254.284 254.044 253.684 254.674 254.364 253.934 253.514 252.334 251.204 251.234 251.594 251.884 251.724 251.604 251.254 250.904 250.514 250.144 249.614 248.864 248.144 247.454 246.954 246.674 247.034 247.144 246.984 245.734 245.424 246.134 246.854 247.324 247.154 246.894 246.344 245.734 244.594 242.944 242.524 242.394 243.074 242.384 241.494 240.994 240.214 240.714 241.164 241.354 241.124 240.744 240.374 239.934 239.444 238.964 238.484 238.004 237.344 236.694 236.734 236.604 236 [...]
+ 254.374 254.304 254.134 252.994 252.164 252.264 252.414 252.504 252.304 252.034 251.214 250.714 250.204 249.874 249.424 249.194 250.264 249.854 249.514 249.284 249.374 249.474 249.334 248.014 248.554 248.584 248.604 248.434 247.454 246.434 246.744 246.984 246.384 244.924 244.134 243.794 244.494 244.754 244.144 243.624 243.314 243.044 241.894 239.844 239.964 239.774 239.504 239.404 241.114 240.894 240.364 239.954 239.784 239.694 239.154 238.484 237.814 237.104 236.374 236.084 236.004 236 [...]
+ 253.994 253.984 253.974 253.574 253.174 252.864 252.564 252.304 252.144 252.004 251.924 251.784 251.464 251.314 251.114 250.664 250.064 249.484 249.164 249.184 249.364 249.554 249.384 248.204 247.704 247.944 248.184 247.944 247.204 246.764 246.794 246.824 246.154 245.504 245.134 244.774 244.424 244.344 243.844 243.364 242.934 242.494 242.264 242.214 242.094 242.074 242.044 241.774 241.224 240.684 240.154 239.534 239.324 239.254 238.734 238.134 237.624 236.024 234.084 234.444 235.124 236 [...]
+ 253.874 253.794 253.654 252.014 252.684 252.774 252.404 252.044 251.894 251.854 251.384 250.914 250.554 250.304 250.024 249.724 249.444 249.324 249.364 249.364 249.564 249.674 249.264 246.734 246.324 246.454 247.984 247.714 247.154 246.744 246.544 246.484 246.304 245.874 245.514 245.204 244.764 244.274 243.814 243.424 243.124 242.784 242.434 242.154 241.994 241.774 241.554 241.284 240.754 240.234 239.614 238.994 238.864 238.924 238.534 238.024 237.354 236.684 234.884 234.434 235.104 235 [...]
+ 253.364 253.194 253.044 252.174 251.634 251.854 252.014 251.764 251.784 251.784 251.314 250.854 250.384 249.964 249.544 249.384 249.234 249.114 248.694 248.404 248.764 249.174 249.484 249.034 248.484 248.064 247.724 247.434 247.284 247.014 246.604 246.184 245.704 245.274 245.004 243.704 242.074 241.494 242.914 243.434 243.264 242.974 242.394 241.894 241.744 241.674 241.464 240.294 239.164 238.814 238.524 237.994 238.274 238.804 238.164 237.264 236.364 236.264 234.294 234.174 234.924 235 [...]
+ 252.604 252.294 251.984 251.884 252.094 251.964 251.844 251.634 251.764 251.874 251.384 250.864 250.354 249.844 249.494 249.344 249.234 249.044 248.424 248.114 248.354 248.594 248.844 248.734 248.394 247.634 246.134 246.284 247.184 246.934 246.324 245.724 245.214 244.594 244.314 244.204 244.124 242.904 242.274 241.664 241.394 242.404 242.164 241.364 241.234 241.154 241.074 240.904 239.304 238.784 238.484 238.164 237.874 238.424 237.714 236.904 236.154 235.994 235.494 235.354 235.274 235 [...]
+ 252.284 251.824 251.394 251.524 251.604 251.674 251.744 251.814 251.914 251.654 251.214 250.774 250.344 250.134 249.884 248.714 247.234 246.384 247.414 248.174 248.364 248.494 248.514 248.244 248.074 247.834 247.584 247.204 246.834 246.424 246.124 245.504 244.184 242.864 242.854 242.864 243.964 242.674 242.304 241.994 241.694 241.814 241.374 240.164 240.074 240.214 240.364 240.254 240.114 238.634 237.094 236.864 236.394 238.144 236.894 235.254 233.684 235.884 235.714 235.614 235.534 235 [...]
+ 252.454 252.244 252.044 251.974 251.914 251.974 251.924 251.864 251.614 251.094 250.754 250.334 249.904 249.584 249.264 249.134 249.004 248.564 247.564 247.634 247.854 248.074 247.454 245.024 245.214 246.984 246.664 246.254 245.694 245.334 245.134 244.934 243.894 241.904 242.654 244.074 243.794 242.324 240.214 240.064 240.764 241.664 241.564 240.584 239.384 238.414 237.974 238.484 239.874 238.874 238.604 238.324 238.534 238.314 237.654 236.964 236.104 234.614 232.314 233.174 234.034 234 [...]
+ 252.004 251.714 251.444 251.534 251.694 251.694 251.694 251.674 251.254 250.624 249.194 248.544 248.254 249.534 248.834 248.544 248.444 248.204 247.804 247.744 247.734 247.734 247.384 246.374 245.974 245.214 243.774 244.544 245.154 244.914 244.724 244.524 244.324 244.594 244.404 244.004 243.614 242.954 242.104 241.904 241.934 241.964 241.564 240.974 239.494 237.774 236.104 239.254 239.464 239.114 238.744 238.484 238.254 237.924 237.284 236.774 236.264 235.854 235.244 234.384 233.524 233 [...]
+ 251.574 251.154 250.784 251.004 251.304 251.314 251.324 251.294 250.514 249.714 249.894 250.084 250.334 249.604 248.984 248.564 248.154 247.774 247.544 247.434 247.244 247.004 246.544 246.094 245.944 245.944 245.934 244.844 243.094 242.474 244.554 244.404 244.104 243.834 243.824 243.754 243.694 242.924 241.794 241.664 241.884 242.094 241.704 241.084 240.554 239.924 239.284 238.984 238.784 237.264 235.664 234.994 237.624 237.414 236.934 236.424 235.834 235.714 235.214 233.754 232.554 231 [...]
+ 251.224 250.594 250.054 250.554 250.924 250.844 250.734 250.484 249.164 248.534 248.864 249.324 249.544 248.924 248.384 248.064 247.804 247.414 246.734 246.374 244.894 244.204 244.024 245.444 245.534 245.004 244.834 243.964 242.394 245.084 244.684 244.274 243.924 243.494 243.054 242.094 240.454 239.894 241.214 241.334 241.094 241.244 240.974 240.474 240.264 240.114 239.724 238.544 237.574 236.594 236.384 236.164 236.774 236.974 236.334 235.704 235.064 235.314 235.354 233.624 231.884 231 [...]
+ 250.774 250.164 249.374 248.504 248.964 249.364 249.774 249.754 249.374 249.174 249.074 248.854 248.554 248.034 247.744 247.644 247.454 247.044 246.604 246.454 246.554 246.634 245.584 245.444 246.164 245.424 244.684 244.484 244.534 244.344 244.194 243.614 242.814 242.334 241.454 241.024 241.694 240.534 238.454 237.784 237.394 237.014 238.074 239.664 238.924 237.914 237.324 237.704 238.084 237.684 237.324 237.114 237.124 237.154 236.424 235.624 234.884 235.404 235.464 233.944 233.974 233 [...]
+ 250.054 249.864 249.794 250.364 249.754 249.734 249.544 249.234 249.344 249.414 248.904 248.294 247.274 246.464 246.854 246.784 246.724 245.994 244.124 243.344 245.544 245.964 244.854 244.864 245.214 245.544 245.614 245.154 244.534 244.204 244.004 242.744 241.504 241.184 241.454 241.764 242.074 241.764 241.254 240.854 240.474 240.084 239.184 239.224 238.874 238.384 237.904 236.304 234.334 234.614 234.984 235.354 235.924 236.644 235.884 235.194 234.624 234.384 234.264 232.544 231.804 231 [...]
+ 250.684 250.384 249.834 248.724 248.144 248.294 248.644 249.004 249.374 248.944 248.254 247.524 246.484 245.724 245.494 245.734 245.964 245.984 245.804 245.214 244.254 243.294 243.324 245.184 245.194 244.374 243.924 243.584 243.434 243.644 242.224 240.794 240.254 239.824 240.074 242.214 242.304 240.394 239.244 239.054 238.924 238.704 238.254 239.004 238.614 238.134 237.654 237.474 237.224 236.874 236.414 236.144 236.314 236.234 234.414 233.014 233.404 234.244 233.984 233.384 232.824 232 [...]
+ 250.244 249.894 249.324 248.664 248.374 248.534 248.684 248.134 248.114 247.684 247.084 246.494 245.944 245.694 245.934 246.114 246.274 246.274 245.894 245.414 244.844 244.274 244.294 244.854 244.644 243.894 243.144 241.704 242.624 242.844 243.084 243.364 242.974 241.994 241.724 241.774 241.814 239.724 237.134 236.934 236.694 236.074 236.424 236.304 236.154 236.014 235.484 235.474 235.634 235.514 235.684 236.474 236.744 236.834 235.894 234.954 234.194 234.384 233.614 232.134 232.074 232 [...]
+ 249.674 249.334 248.604 246.684 246.254 247.124 248.564 247.974 246.804 246.244 246.124 245.884 245.714 246.014 246.004 246.054 246.104 245.984 245.554 245.324 245.284 245.094 244.514 244.104 243.954 243.574 243.154 240.164 239.614 239.354 241.174 242.784 242.544 242.004 241.584 241.234 240.884 240.834 240.854 239.734 238.504 237.154 238.144 238.914 237.294 235.664 235.214 235.394 236.604 236.544 236.424 236.294 236.154 236.054 235.404 234.754 234.154 233.774 232.994 231.794 231.224 231 [...]
+ 249.304 248.884 248.514 248.254 248.034 247.904 247.774 247.084 245.194 244.924 245.464 246.214 246.434 246.584 246.534 246.124 245.514 245.614 245.014 244.614 244.504 244.404 244.034 243.324 243.154 243.134 242.044 240.674 239.244 239.174 239.274 239.374 239.714 241.404 241.244 240.914 240.544 240.264 240.144 239.004 238.604 238.194 237.154 237.074 235.764 235.884 236.004 236.124 235.354 235.134 235.024 235.844 235.804 235.594 234.894 234.204 233.484 233.044 232.334 230.794 229.244 229 [...]
+ 248.814 248.394 248.104 248.484 248.444 247.874 247.324 246.764 246.164 245.964 245.844 245.714 245.744 245.874 245.184 244.004 243.254 243.704 245.044 244.644 244.044 242.204 241.584 241.974 241.924 241.884 241.854 240.804 238.944 239.594 240.434 241.084 241.424 241.264 240.934 240.634 240.334 240.274 240.034 239.074 238.514 238.074 237.764 236.694 235.654 234.904 235.104 235.224 235.264 234.704 234.474 235.274 235.514 235.504 234.774 234.024 233.294 232.684 232.254 232.054 231.834 231 [...]
+ 248.644 248.324 248.274 248.614 248.624 248.344 248.064 247.534 246.704 246.154 245.834 245.294 245.034 245.074 244.814 243.834 242.794 242.384 243.794 244.034 243.784 243.144 242.664 241.644 241.244 240.914 240.594 240.314 240.244 239.624 239.164 239.794 240.564 241.274 240.944 240.584 240.224 239.914 239.834 239.424 238.444 237.444 235.294 234.424 234.884 235.914 236.834 236.434 235.654 233.994 232.334 232.074 234.804 234.754 234.074 233.554 233.034 232.544 232.164 232.104 232.044 231 [...]
+ 248.704 248.324 248.194 248.474 248.314 247.854 247.464 246.974 246.664 246.274 245.604 244.944 244.814 245.194 244.904 244.294 243.694 242.414 241.424 243.254 243.094 242.934 242.174 241.304 241.464 241.714 241.684 241.904 241.754 241.404 240.814 240.064 239.814 240.634 240.404 240.174 239.844 238.664 238.134 238.284 238.434 238.074 236.774 235.944 235.864 235.794 236.024 235.034 233.794 233.614 234.284 235.064 234.664 234.184 233.664 233.124 232.664 232.454 231.994 231.464 231.354 231 [...]
+ 248.144 247.984 248.024 248.244 248.054 247.554 247.054 246.784 246.804 246.574 246.054 245.464 245.364 245.104 244.744 244.354 243.964 243.354 243.054 243.144 242.864 242.384 241.724 241.144 241.194 241.384 241.564 241.574 241.344 241.294 241.004 240.724 238.424 237.064 239.464 239.184 238.914 238.464 237.174 235.994 234.824 234.794 235.424 236.514 236.264 236.054 235.894 235.654 234.364 233.414 233.094 233.824 233.814 233.604 232.924 232.264 231.834 231.984 231.384 229.734 228.684 230 [...]
+ 247.544 247.504 247.584 247.574 247.384 247.084 246.794 246.734 246.944 246.684 246.014 245.344 244.914 244.704 244.464 244.174 243.814 242.334 240.744 240.584 240.634 241.394 241.234 241.614 241.544 241.324 241.054 241.094 239.794 240.254 240.714 241.114 240.134 238.964 238.664 238.314 237.804 237.414 237.154 237.054 236.934 236.814 236.614 236.084 234.544 232.994 231.844 231.674 231.614 232.044 232.714 233.264 233.484 233.354 232.724 232.184 231.814 231.764 231.304 230.824 230.334 229 [...]
+ 247.124 247.114 247.054 246.924 246.524 246.054 245.704 245.024 244.974 245.114 245.024 244.824 244.494 244.354 244.124 243.864 243.604 242.824 241.904 241.704 241.594 241.484 240.974 241.184 240.844 240.494 240.194 240.304 240.374 240.294 240.204 240.084 239.294 238.654 238.434 238.214 237.734 236.564 236.104 236.164 236.214 236.154 236.014 235.564 234.324 233.084 232.214 232.504 232.304 231.584 231.524 232.794 232.794 232.764 232.574 232.054 231.524 231.104 231.014 231.134 230.964 230 [...]
+ 247.164 246.874 246.694 246.754 246.334 245.634 244.924 244.984 245.664 245.504 245.094 244.534 244.234 244.164 243.934 243.664 243.134 242.904 242.744 242.444 242.044 241.654 241.144 240.644 240.494 240.234 239.984 239.604 239.254 239.344 239.434 239.524 236.844 235.324 237.794 237.604 237.374 236.234 235.924 235.814 235.904 236.034 236.124 235.744 234.664 234.204 233.854 233.824 233.474 232.514 231.564 231.084 231.404 231.534 231.464 231.394 231.104 230.504 230.274 230.394 230.514 230 [...]
+ 246.154 245.674 245.514 246.094 245.744 244.964 244.184 244.164 244.614 244.424 244.094 243.754 243.634 243.964 243.804 243.494 242.064 240.654 242.044 241.904 241.574 241.244 240.774 240.304 240.144 239.944 239.734 239.734 239.464 239.524 239.584 239.214 238.494 237.464 237.044 236.324 236.934 236.674 236.204 235.844 235.624 235.544 235.724 235.684 235.494 235.054 234.334 233.304 233.094 233.364 232.894 232.014 231.334 231.044 230.624 230.404 230.214 229.884 229.744 229.824 229.904 229 [...]
+ 245.504 245.054 245.194 245.554 245.304 244.894 244.224 243.024 242.344 242.644 243.054 243.144 243.424 243.934 243.554 243.144 242.724 240.574 238.134 240.214 241.614 241.444 240.884 240.184 239.754 239.324 239.024 239.214 239.484 239.314 238.944 238.014 236.804 235.814 235.744 235.764 236.354 236.394 236.104 235.204 234.314 234.154 234.644 234.934 234.784 234.624 234.114 231.164 230.184 231.124 232.104 232.694 231.974 231.294 230.834 230.024 229.684 229.834 229.014 227.774 227.884 228 [...]
+ 245.694 245.074 244.594 244.434 244.094 242.104 241.024 241.704 243.744 243.904 243.654 243.354 243.344 243.284 242.894 242.464 242.064 241.734 241.344 241.254 241.074 240.894 240.304 240.374 240.174 239.904 239.574 239.624 239.294 238.934 238.654 238.234 235.384 233.984 236.294 235.984 235.674 235.474 235.004 233.484 232.534 232.704 233.904 234.894 234.454 234.064 233.854 233.554 232.904 232.194 231.484 231.944 231.994 231.424 230.304 229.204 228.984 229.694 229.624 229.444 229.454 229 [...]
+ 244.834 245.664 244.994 244.014 243.834 243.844 243.864 243.514 243.684 243.684 243.374 243.064 242.904 242.684 242.344 242.004 241.614 241.384 241.344 240.884 240.424 239.934 239.654 239.534 238.174 236.804 235.704 238.634 238.844 238.354 237.874 237.304 236.804 236.784 236.184 235.594 235.034 234.734 234.084 232.784 231.484 231.354 233.404 234.464 234.154 233.724 233.194 232.644 232.214 231.754 231.284 231.224 231.604 230.984 230.274 229.584 229.514 229.914 229.644 229.134 228.614 227 [...]
+ 244.414 244.694 244.224 243.664 243.524 243.424 243.464 241.984 241.934 240.704 239.324 239.234 240.114 242.084 241.774 241.464 241.144 241.084 241.004 240.294 239.634 239.044 238.184 238.084 238.634 239.174 239.574 238.694 238.034 237.884 237.294 235.464 235.034 236.004 235.544 235.074 234.534 234.104 233.394 232.944 232.934 233.174 233.214 232.604 232.274 232.324 232.604 231.844 230.724 229.344 228.184 230.074 230.304 230.584 230.844 230.164 229.744 229.644 229.344 228.934 228.514 228 [...]
+ 244.724 244.264 242.474 243.614 242.684 241.154 239.624 240.824 243.494 243.324 242.884 242.334 241.974 241.514 241.224 240.944 240.684 240.604 240.474 239.824 239.154 238.454 236.624 235.754 237.644 238.794 239.064 237.924 235.464 234.274 233.174 233.284 234.764 235.504 235.004 234.564 234.054 233.434 233.124 232.954 231.764 231.234 231.744 231.574 231.254 231.684 231.854 230.884 229.774 229.544 229.314 229.184 229.004 228.354 228.334 229.544 229.834 229.394 228.984 228.604 228.154 227 [...]
+ 244.594 244.034 242.354 240.784 241.164 241.684 242.024 242.464 243.084 242.794 242.464 242.134 239.624 237.904 238.204 240.024 240.304 240.124 239.844 239.294 238.744 237.604 237.874 238.264 238.194 238.124 238.024 237.724 236.514 237.004 237.144 237.014 236.114 235.334 234.804 234.284 233.764 233.014 232.414 231.234 230.054 230.094 231.734 231.674 230.134 228.614 229.054 230.654 230.414 229.254 228.784 228.244 227.944 228.084 228.294 228.934 229.174 228.844 228.414 227.954 227.494 227 [...]
+ 244.244 242.804 242.924 242.534 242.334 242.174 242.084 242.314 242.324 242.084 241.854 241.624 241.494 241.264 240.854 240.314 239.764 239.514 239.404 239.254 239.074 237.584 236.204 237.314 237.044 236.774 236.544 236.754 236.824 236.664 236.514 236.364 235.974 235.294 234.674 234.054 233.504 232.974 232.504 232.224 231.944 231.624 231.454 230.844 230.494 230.944 230.274 227.894 227.844 228.754 229.664 229.964 229.144 228.794 228.734 228.844 228.654 228.314 227.884 227.414 226.954 226 [...]
+ 243.984 243.614 243.224 242.834 242.544 242.234 241.924 241.824 241.724 239.884 239.994 240.874 240.544 240.174 239.794 239.464 239.254 239.144 238.914 238.794 238.614 238.344 237.324 236.774 236.884 236.854 236.774 236.694 236.414 236.244 236.074 235.794 235.274 234.314 232.694 231.494 231.054 230.384 229.944 230.674 231.264 230.714 230.034 230.214 230.514 231.024 230.404 228.694 228.304 228.394 228.524 228.784 227.044 226.574 227.074 228.114 228.264 227.964 227.504 227.014 226.304 225 [...]
+ 242.964 242.604 242.424 242.334 242.074 241.804 241.484 241.424 241.374 240.284 239.054 237.824 237.934 239.694 239.494 239.304 239.094 238.294 237.534 237.604 237.664 237.654 236.894 236.384 236.494 236.604 236.624 236.274 236.004 235.834 235.564 235.204 234.584 234.194 233.574 232.954 231.754 229.534 229.194 229.914 230.624 231.244 231.154 230.314 229.834 229.884 230.284 230.074 229.194 228.604 228.634 227.364 225.174 225.694 226.704 227.714 227.854 227.594 226.924 226.194 225.474 224 [...]
+ 243.184 243.224 242.954 242.444 241.794 241.144 240.764 240.474 240.044 239.894 239.784 239.764 239.524 239.364 239.284 239.104 238.804 235.954 234.084 235.454 235.284 235.334 236.304 235.984 236.094 236.214 236.164 235.754 235.284 234.754 234.334 233.954 232.774 232.344 232.614 232.884 232.104 230.524 229.844 229.724 229.624 230.244 229.774 229.244 228.904 228.024 228.414 229.604 228.544 226.824 225.094 224.554 224.414 225.464 225.384 224.864 225.014 226.954 226.304 225.724 225.154 224 [...]
+ 243.204 243.144 242.894 242.674 241.964 241.204 240.454 237.724 236.164 237.284 238.394 238.774 238.664 238.594 238.574 238.644 238.644 237.474 236.414 235.494 234.574 233.694 234.644 235.184 234.974 234.894 234.834 234.834 234.994 234.734 234.294 233.424 231.814 231.324 231.604 232.154 231.904 230.684 230.414 230.624 230.574 229.494 229.324 229.164 228.894 229.004 229.224 229.274 228.904 228.424 227.894 225.824 223.794 224.904 226.114 227.324 227.144 226.474 225.904 225.354 224.954 224 [...]
+ 243.044 241.614 242.434 242.284 241.584 240.874 240.174 239.834 239.504 239.164 238.824 238.404 235.674 235.124 236.144 237.184 238.364 237.514 236.784 236.294 235.784 235.214 234.654 234.324 234.224 234.114 234.164 234.524 234.674 234.554 234.374 233.874 232.834 232.284 232.074 231.864 231.284 230.264 230.354 230.574 230.784 230.674 230.424 230.144 229.844 229.564 229.454 229.354 229.304 229.274 229.074 227.594 226.804 226.594 226.434 226.764 226.494 224.184 224.184 224.194 224.754 224 [...]
+ 242.874 240.194 241.924 241.124 240.734 240.344 239.814 239.614 239.434 239.074 238.644 238.234 238.374 238.344 238.104 237.924 237.664 236.944 236.294 235.914 235.484 234.914 234.884 234.744 234.394 234.054 233.884 234.104 233.984 233.614 233.314 232.784 231.864 231.334 231.014 230.684 230.224 229.864 229.984 230.314 230.564 230.454 230.054 228.564 227.384 227.054 229.024 228.924 228.914 228.904 228.864 226.924 225.754 225.594 225.474 225.334 225.254 223.554 223.434 223.414 224.324 224 [...]
+ 242.994 242.144 240.984 240.024 239.814 239.644 239.474 239.354 239.054 238.644 238.224 237.854 237.864 237.804 237.464 236.994 236.494 235.824 235.514 235.274 235.034 234.894 234.794 234.184 233.484 231.714 231.534 233.344 233.034 232.434 231.954 231.604 230.854 230.454 229.764 228.274 227.404 228.734 229.144 229.224 229.434 229.384 229.144 227.594 227.074 226.794 227.554 228.264 227.164 226.974 226.774 225.374 223.724 223.614 223.514 223.404 222.504 221.594 221.994 222.904 223.814 223 [...]
+ 241.974 241.664 240.964 240.154 239.864 239.354 238.854 238.684 238.124 238.544 238.404 238.264 237.744 236.904 235.984 235.174 234.654 234.364 234.294 234.354 234.434 234.364 233.884 233.464 232.894 232.324 232.314 233.084 232.694 231.514 230.344 229.844 229.654 229.404 228.524 228.784 228.934 228.544 228.314 228.354 228.404 228.624 228.494 228.374 228.204 227.914 227.724 227.734 226.114 225.314 224.994 223.124 223.394 224.064 224.734 225.144 224.444 223.554 223.454 223.354 223.154 222 [...]
+ 241.064 240.744 240.264 239.874 239.094 238.314 237.764 237.444 236.724 235.204 233.694 233.034 235.144 236.384 235.934 235.164 233.934 231.424 230.894 232.864 233.544 233.454 233.104 232.884 232.744 232.604 232.664 232.914 232.654 232.144 231.334 229.744 228.384 227.984 227.804 228.184 228.374 228.224 227.924 227.654 227.384 227.354 227.814 227.774 227.644 227.514 227.234 226.914 225.344 223.764 222.214 223.104 224.014 223.634 224.014 224.634 224.134 223.374 223.204 222.914 222.494 220 [...]
+ 240.204 240.234 239.974 239.524 239.154 238.464 237.784 237.064 236.444 236.184 235.914 235.434 234.684 235.424 235.214 234.914 234.674 234.624 234.494 233.954 233.384 232.894 232.224 232.004 232.234 232.194 232.254 232.134 232.014 231.674 231.164 230.384 229.204 228.634 228.244 227.834 227.494 227.324 227.184 226.814 225.234 225.904 227.674 227.364 226.814 226.454 226.174 225.864 225.494 225.124 224.754 224.824 224.744 224.664 224.324 223.984 223.584 223.144 222.614 222.314 221.824 219 [...]
+ 239.944 239.794 239.184 238.674 238.334 238.054 237.724 237.064 236.574 236.264 235.944 235.644 235.114 234.454 233.894 233.434 233.214 233.444 233.364 233.024 232.204 231.394 230.704 230.554 230.964 231.394 231.104 230.374 230.284 230.284 230.294 229.554 228.224 227.694 227.374 227.074 226.864 226.564 226.634 226.624 226.624 226.384 227.044 226.614 226.104 225.574 225.804 225.714 224.144 223.214 222.654 222.514 223.684 223.754 223.834 223.754 223.344 222.834 222.354 221.874 221.414 220 [...]
+ 239.244 239.074 238.504 238.064 237.784 237.504 237.174 236.714 236.324 236.034 235.644 235.154 234.384 233.874 233.394 232.924 232.824 233.194 232.634 231.534 229.924 228.874 229.454 229.994 230.384 230.774 230.404 229.404 228.924 228.644 228.664 227.854 227.724 227.494 227.254 226.984 226.964 226.994 227.154 227.344 227.474 226.954 226.234 225.854 225.334 224.814 224.954 225.274 225.054 224.624 224.194 224.074 223.614 223.474 223.454 223.504 222.494 221.884 221.514 221.324 221.124 220 [...]
+ 239.264 238.994 238.274 237.474 237.054 236.714 236.374 236.034 235.704 235.334 234.974 234.724 234.634 234.254 233.624 233.014 232.864 233.444 233.134 232.184 231.144 230.394 230.024 229.694 229.734 230.074 229.654 228.254 228.514 228.304 228.104 226.474 224.114 226.324 227.294 227.094 226.774 226.754 226.884 227.014 227.144 226.754 226.184 226.104 226.014 225.774 225.054 224.414 224.194 223.974 223.754 223.764 223.654 223.274 223.114 222.964 222.494 221.744 221.534 221.214 220.944 221 [...]
+ 239.274 239.054 237.944 237.114 236.644 236.244 235.824 235.374 235.024 234.834 234.634 234.494 233.804 233.424 233.444 233.464 233.234 232.834 232.444 232.044 231.824 231.704 231.614 230.924 230.294 229.654 229.324 228.124 228.244 228.654 228.754 228.434 228.064 227.714 227.374 227.034 226.774 226.404 226.364 226.464 226.564 225.924 225.444 225.534 225.124 224.154 224.194 224.624 224.304 223.994 223.774 223.564 223.314 222.694 222.074 221.774 221.744 221.724 221.314 220.904 220.594 220 [...]
+ 239.114 238.864 237.934 237.214 236.784 236.344 235.854 235.204 234.264 233.054 232.054 231.804 232.234 232.294 232.634 232.974 231.714 228.394 228.884 230.234 232.124 231.584 230.494 229.854 229.294 228.734 228.494 228.484 228.564 228.644 228.624 228.084 227.494 227.124 226.744 226.374 226.194 226.024 225.974 225.914 225.824 224.344 224.014 224.744 224.914 225.084 223.974 223.664 224.044 223.754 223.444 222.494 219.884 219.764 220.594 221.294 221.274 221.194 221.044 220.954 220.794 220 [...]
+ 238.684 238.414 237.684 237.104 236.764 236.294 235.134 232.274 231.694 232.604 233.504 233.794 233.084 232.934 233.034 233.094 231.454 230.074 231.554 232.224 232.084 231.284 229.594 229.124 228.784 228.314 228.074 226.624 227.854 227.884 227.914 227.774 227.064 226.484 226.014 225.614 225.774 225.724 225.324 224.944 224.854 222.634 222.974 223.674 224.374 225.344 222.894 221.724 222.094 222.464 222.944 222.804 222.264 220.824 219.384 218.554 217.394 217.104 218.074 219.164 219.904 219 [...]
+ 238.284 237.904 237.004 236.434 236.164 235.894 235.604 233.794 233.134 233.574 234.024 234.264 233.554 233.304 233.294 233.284 232.684 230.734 231.304 231.684 231.684 230.544 228.694 228.414 228.284 228.164 228.024 226.864 227.054 227.274 227.134 226.934 226.574 226.124 225.534 224.954 224.934 225.134 224.784 224.364 223.944 224.124 223.964 223.524 223.604 223.684 220.354 221.144 220.564 221.254 222.284 222.714 222.684 221.464 220.254 219.114 218.224 217.874 218.144 218.414 218.534 218 [...]
+ 237.944 237.584 236.844 236.314 235.964 235.624 235.224 234.934 234.684 233.494 232.894 231.064 229.554 231.134 232.344 232.014 231.454 231.304 231.234 231.134 231.034 230.674 230.414 229.864 229.294 228.604 228.494 228.534 227.954 227.384 227.024 226.374 225.184 225.034 224.874 224.554 224.254 224.124 223.784 223.444 223.104 223.364 223.454 223.004 222.584 222.284 221.364 220.244 220.664 221.274 221.664 220.774 219.874 219.534 219.544 219.404 218.724 218.124 217.974 217.994 217.924 217 [...]
+ 237.534 237.244 236.594 235.904 235.194 234.664 234.254 234.124 233.944 233.714 233.514 233.024 231.454 231.384 231.284 230.934 231.034 231.054 230.814 230.634 230.474 230.314 229.404 229.224 229.074 228.544 226.954 225.184 224.944 224.704 224.464 224.384 224.364 224.224 224.164 224.124 223.964 223.694 223.354 223.024 222.704 222.194 222.164 221.664 221.174 220.944 221.974 222.034 221.354 221.124 221.434 220.784 220.214 219.854 219.524 219.204 218.624 218.254 218.114 217.794 217.504 217 [...]
+ 237.604 237.204 236.304 235.464 234.654 233.854 233.344 233.274 233.354 233.214 233.124 232.664 232.134 231.494 230.834 230.204 230.404 230.954 230.684 230.074 229.474 228.674 227.984 228.034 228.084 228.124 227.654 226.704 225.954 225.204 224.454 224.334 224.234 224.094 223.954 223.814 223.754 223.244 221.234 219.624 219.024 220.034 221.494 221.264 220.734 220.274 220.634 220.534 218.604 217.874 218.304 218.864 219.974 219.494 219.004 218.664 218.364 217.424 217.144 216.964 216.724 216 [...]
+ 237.894 237.614 236.644 235.484 234.244 232.994 232.664 233.344 233.414 233.024 232.644 232.264 231.874 231.654 231.164 229.394 227.974 230.074 229.334 228.214 227.514 227.114 227.624 227.674 227.734 227.694 227.524 226.914 224.704 223.194 222.904 222.884 222.584 222.684 222.784 223.644 223.704 223.434 223.164 222.874 222.454 221.804 221.274 221.084 220.894 220.714 220.514 220.524 220.744 220.864 220.024 216.614 215.694 216.654 217.774 218.494 218.464 217.474 216.104 215.014 215.004 216 [...]
+ 236.934 236.614 236.324 236.134 235.924 235.704 234.994 233.564 232.864 232.434 231.994 231.534 231.074 230.814 230.544 230.274 229.894 229.754 229.384 227.044 224.454 225.524 227.934 227.274 226.724 226.674 226.694 226.814 226.334 224.774 223.194 223.624 224.544 224.504 224.374 224.104 223.724 223.714 223.644 223.574 223.164 222.114 221.474 221.104 220.734 220.534 220.354 220.374 220.614 220.864 220.774 219.904 219.254 218.824 218.404 217.934 217.634 217.104 216.414 215.984 216.084 216 [...]
+ 236.674 236.334 236.174 235.694 235.294 234.914 234.114 233.014 232.434 231.914 231.464 230.924 230.044 229.644 229.294 228.964 229.094 229.664 229.264 228.784 228.304 228.274 228.044 227.624 226.914 226.214 226.144 226.114 225.654 225.264 224.874 224.704 224.004 221.964 221.104 220.274 221.064 223.244 223.234 223.124 222.954 222.324 221.494 220.994 220.624 219.564 216.444 216.874 217.614 219.974 219.844 218.954 218.324 217.484 216.644 216.184 216.234 216.294 216.204 216.114 216.044 215 [...]
+ 236.534 236.094 235.754 235.274 234.294 232.504 232.194 232.914 232.384 231.944 231.504 230.564 229.354 228.904 228.694 228.494 228.374 228.794 228.544 228.284 227.994 227.544 227.044 226.664 226.294 225.164 224.524 222.174 222.544 224.244 225.264 225.164 224.494 224.294 224.434 224.004 222.664 222.314 222.334 222.444 222.514 222.134 221.684 221.164 220.654 219.114 216.424 215.624 216.614 218.084 218.924 218.324 217.404 216.434 215.864 215.664 215.944 216.064 215.924 215.814 215.564 215 [...]
+ 236.434 236.004 235.304 234.764 234.284 233.614 231.984 230.784 231.284 232.054 231.534 229.574 229.724 229.274 228.844 228.414 228.224 227.984 227.314 225.164 223.024 224.594 226.404 224.354 222.804 223.854 224.884 222.854 224.654 224.864 225.084 225.014 224.694 223.814 223.124 222.674 221.704 221.314 221.924 222.544 222.754 222.684 222.314 221.484 220.644 218.964 219.984 219.664 218.844 217.684 217.594 216.174 215.524 215.324 216.034 216.624 216.274 215.984 215.764 215.624 215.654 215 [...]
+ 234.044 234.014 234.904 234.434 233.104 231.684 232.464 232.644 231.004 230.634 231.014 229.394 228.024 228.124 228.224 228.334 228.094 227.674 227.204 226.784 226.374 226.544 226.244 226.224 226.004 225.784 225.224 224.424 224.784 224.794 224.804 224.784 224.424 223.464 222.584 221.324 218.524 220.754 221.244 222.074 222.534 221.924 221.484 220.724 220.094 219.384 218.724 218.604 218.584 218.294 216.514 215.734 215.634 215.364 215.864 216.434 216.024 215.984 215.734 215.474 214.984 214 [...]
+ 236.424 235.854 235.174 234.694 234.164 233.644 232.964 232.194 230.944 229.504 228.064 229.124 229.484 229.104 228.734 228.394 227.934 227.344 227.064 226.774 226.444 225.574 224.774 224.834 224.904 225.114 224.774 224.484 224.504 224.524 224.544 224.564 224.234 223.224 222.214 220.784 222.324 222.804 222.694 222.584 222.304 221.584 220.554 219.954 219.364 218.954 218.124 217.494 217.374 217.354 217.214 216.694 216.184 215.804 215.614 214.704 213.764 214.064 214.644 214.854 213.914 212 [...]
+ 236.404 235.744 234.854 234.274 233.744 233.214 232.634 232.054 231.404 230.794 230.424 228.164 229.054 229.034 228.594 228.144 227.554 226.934 226.714 226.434 226.154 224.844 223.904 224.044 224.214 224.414 224.284 224.284 223.944 223.914 223.924 224.384 223.344 220.464 217.584 217.424 221.374 222.094 222.134 222.174 221.814 220.304 219.294 218.674 218.064 217.694 217.674 217.284 216.784 216.274 216.034 215.864 215.484 214.994 214.504 213.564 212.244 212.204 212.924 213.634 213.424 210 [...]
+ 236.304 234.264 231.344 232.864 233.624 233.164 232.604 231.844 231.664 231.504 231.334 230.514 228.744 228.544 228.344 227.894 227.024 226.364 226.154 225.954 225.754 222.934 223.544 223.804 224.064 224.314 224.474 224.394 223.994 223.584 223.154 223.324 223.464 223.174 222.614 222.034 221.484 221.254 221.284 221.304 220.814 219.654 218.954 218.264 217.384 216.884 216.964 215.704 213.844 212.854 213.104 215.514 215.094 214.084 213.074 212.824 213.004 212.794 212.694 212.594 211.754 209 [...]
+ 236.005 235.524 234.984 233.394 231.684 229.974 230.284 231.424 231.234 230.944 230.664 228.244 226.514 227.344 228.274 229.394 228.234 227.064 226.404 225.744 225.144 223.684 223.424 224.294 224.324 224.244 224.044 223.774 223.424 223.064 222.654 222.074 221.924 221.734 221.534 221.274 220.634 220.244 220.114 219.984 219.884 219.114 218.864 217.934 216.954 215.334 213.864 213.334 213.094 212.854 215.244 214.814 213.854 212.754 211.714 211.614 212.034 212.104 212.114 212.034 212.154 212 [...]
+ 235.495 234.985 234.474 232.804 231.064 229.344 229.184 230.004 229.854 229.844 230.134 229.634 229.174 228.704 228.574 228.434 227.634 227.504 226.674 225.874 225.124 224.664 224.324 224.004 223.674 223.584 223.494 223.254 222.704 222.344 221.974 221.514 220.964 220.444 220.184 219.964 219.594 218.634 217.404 217.204 217.234 217.284 217.074 217.154 217.144 214.954 216.644 216.804 216.784 216.764 214.994 213.494 213.024 212.074 211.124 211.034 211.394 210.664 209.844 209.014 211.794 212 [...]
+ 235.315 234.715 234.314 233.944 233.574 232.124 231.384 229.374 229.584 229.804 230.004 230.124 230.084 229.244 228.334 227.414 227.494 227.364 226.494 225.594 224.614 222.914 222.624 223.784 223.394 223.084 223.194 223.014 222.444 221.884 221.364 220.964 220.414 219.884 219.364 219.144 218.954 218.024 216.664 215.304 215.444 216.794 215.924 214.024 212.114 214.114 216.674 216.584 216.464 216.384 213.834 213.114 213.614 213.024 212.434 211.704 211.174 210.514 209.864 209.214 208.964 208 [...]
+ 235.475 232.905 233.505 233.764 233.174 232.594 231.264 229.994 230.014 230.084 230.144 229.924 229.284 228.434 227.574 226.674 226.624 226.304 225.544 224.784 223.944 224.874 224.914 224.104 223.304 222.554 222.374 222.184 221.914 221.644 221.194 220.814 220.254 219.574 218.894 218.664 219.054 218.784 217.914 217.044 217.224 218.134 217.924 217.224 216.524 216.614 216.934 216.544 216.214 216.094 215.564 213.084 212.374 211.884 211.274 211.434 212.124 210.364 208.534 206.894 208.384 210 [...]
+ 234.795 235.255 233.655 233.305 232.884 231.944 231.394 230.994 230.844 230.524 230.214 229.474 228.604 227.764 226.964 226.174 225.974 225.894 225.764 225.514 225.214 224.654 223.934 223.554 223.174 222.534 221.874 221.304 220.934 220.654 220.594 220.714 219.884 218.754 218.054 217.744 218.034 218.344 218.644 218.874 218.204 217.734 217.374 216.554 215.744 216.024 216.814 216.644 216.194 215.744 215.254 214.524 213.954 213.394 212.874 212.634 212.514 211.234 209.954 208.654 209.304 210 [...]
+ 234.345 235.165 234.725 234.165 233.605 232.964 232.604 232.244 230.184 228.114 227.844 228.634 228.324 227.474 226.604 225.794 225.754 225.494 225.154 224.804 224.674 224.644 223.434 222.624 222.264 221.834 221.204 220.664 220.084 219.074 218.324 219.174 219.804 218.704 217.564 216.924 217.214 217.394 217.634 217.944 217.614 216.924 216.184 215.414 215.104 214.634 214.994 214.854 214.634 214.234 214.244 214.274 213.864 213.574 213.274 212.884 212.204 210.994 209.654 208.314 209.004 209 [...]
+ 235.425 232.845 232.125 233.565 234.345 234.035 233.734 233.004 231.924 230.844 229.164 227.164 225.674 224.984 226.034 225.304 225.434 225.164 224.424 223.684 223.354 224.254 223.404 221.704 220.564 220.654 218.724 217.564 217.554 217.664 217.814 218.634 219.114 218.354 217.594 216.964 216.744 216.864 216.974 217.044 216.764 215.904 214.624 214.074 213.854 212.694 213.884 213.854 213.614 213.374 213.104 213.444 212.914 212.504 212.234 211.664 210.924 209.744 208.974 208.434 208.614 208 [...]
+ 235.295 234.945 234.595 234.565 234.445 234.335 233.785 233.044 231.684 230.474 229.264 228.444 227.914 227.304 224.964 222.714 224.024 225.004 224.604 224.084 223.544 223.424 222.414 220.464 220.814 221.904 221.274 220.604 219.984 219.464 218.954 218.734 218.574 218.374 217.764 215.624 212.894 212.534 215.314 215.964 216.024 215.924 214.624 214.034 213.464 213.644 214.154 214.044 213.914 213.774 213.214 212.584 212.034 211.484 210.934 210.674 210.374 209.854 209.334 208.724 208.434 208 [...]
+ 235.405 235.145 234.965 234.755 234.555 234.305 233.735 232.975 231.574 230.194 228.824 228.304 227.704 226.834 225.954 225.424 225.334 224.704 224.284 223.864 223.514 223.324 223.044 222.714 222.284 221.794 221.164 220.704 220.114 219.514 218.944 218.364 217.744 217.584 217.424 217.464 217.444 217.074 216.494 215.844 215.014 215.074 214.694 214.234 213.764 213.904 213.954 213.964 213.974 213.884 212.814 211.844 211.384 211.114 210.834 210.684 210.454 209.814 209.154 208.514 208.084 207 [...]
+ 232.505 230.395 230.835 232.335 233.835 234.365 233.505 232.435 231.315 230.194 229.014 227.804 226.414 224.854 223.644 223.244 224.774 224.794 224.224 223.634 223.224 223.024 221.544 220.434 219.334 219.814 221.484 221.224 221.054 220.874 219.824 217.784 217.244 217.114 216.974 217.044 217.284 216.954 216.504 216.044 215.184 214.214 213.884 213.364 212.844 213.264 213.944 213.334 213.284 213.274 212.544 211.344 211.154 210.904 210.634 210.434 210.164 209.514 208.854 208.224 208.214 207 [...]
+ 234.915 234.685 234.425 233.925 233.515 233.095 232.335 231.765 231.045 230.075 229.044 227.494 226.494 225.284 223.664 222.404 223.804 224.534 223.954 223.364 223.064 223.424 221.924 221.794 222.094 221.724 221.094 220.784 220.604 220.364 217.954 213.274 214.384 216.624 216.494 216.724 217.144 216.744 215.704 214.664 214.104 213.444 213.704 214.004 214.114 214.134 214.054 213.474 212.884 212.294 211.574 210.754 209.644 209.524 209.434 210.034 209.674 209.034 208.404 207.954 207.794 207 [...]
+ 234.125 234.075 233.915 233.155 232.405 231.655 231.245 230.785 229.775 227.395 225.485 226.944 227.554 226.444 225.324 223.954 222.444 221.694 220.384 221.004 220.504 222.214 222.744 222.724 222.544 221.804 219.944 220.014 219.834 219.654 217.404 215.584 217.094 216.734 216.364 216.244 216.734 215.814 214.704 214.264 214.164 212.724 213.164 213.544 213.884 213.904 213.774 213.264 212.914 212.574 211.144 210.064 208.984 208.364 207.764 208.614 209.124 208.704 208.284 207.874 207.604 207 [...]
+ 234.685 232.955 231.485 231.265 231.885 231.105 228.975 228.405 228.315 228.225 228.015 227.335 227.404 226.174 224.944 223.504 223.534 224.034 224.224 224.074 223.504 222.204 221.824 221.824 221.834 221.604 220.194 218.734 218.554 218.384 217.814 216.654 216.534 216.554 216.414 215.894 216.014 215.484 214.454 213.934 213.134 212.114 212.544 212.964 213.394 213.404 213.244 212.804 212.474 212.164 211.594 210.244 209.634 208.984 208.134 207.274 207.324 207.784 207.934 207.564 207.434 207 [...]
+ 231.045 231.435 231.685 231.495 231.305 231.105 230.665 229.875 229.045 228.255 227.585 227.775 226.985 224.804 223.874 223.254 223.544 224.144 223.864 223.584 223.164 222.634 222.184 221.754 221.314 220.944 220.714 219.724 218.604 217.914 218.054 218.154 215.994 213.654 212.494 212.574 215.494 215.264 214.884 214.114 211.034 209.484 210.014 211.204 212.654 212.674 212.384 211.654 211.514 211.244 209.944 210.364 209.634 208.904 208.094 206.094 205.534 206.094 206.654 207.094 206.954 206 [...]
+ 232.175 232.385 232.395 232.115 231.785 231.335 230.385 229.505 228.275 225.935 224.415 226.755 227.595 226.935 226.224 225.444 224.514 223.954 223.604 223.284 221.384 217.414 218.524 220.544 221.654 221.214 220.914 219.864 218.664 217.534 217.014 217.774 215.754 213.484 212.014 212.604 215.344 215.014 214.514 213.314 212.864 211.674 211.914 212.124 212.324 211.914 211.514 209.844 208.614 208.054 208.344 209.344 208.794 208.504 207.844 205.704 206.524 205.564 205.414 206.414 206.354 206 [...]
+ 233.735 233.155 232.345 232.055 231.775 231.325 230.585 229.865 229.085 228.315 227.605 226.735 226.925 226.335 225.845 225.214 224.264 223.704 223.274 222.834 222.674 222.494 222.414 222.234 221.944 221.764 221.464 220.164 219.224 218.464 217.744 216.874 216.414 216.244 215.924 215.594 215.304 213.974 212.754 211.554 211.354 211.324 211.504 211.684 211.864 211.574 210.634 208.274 207.484 207.694 209.144 208.784 208.804 208.534 207.734 203.244 201.724 203.494 205.274 206.474 205.914 205 [...]
+ 233.865 232.705 232.135 232.095 232.045 231.925 231.065 230.045 229.275 228.455 227.725 227.535 227.155 226.595 226.035 225.405 224.774 223.964 223.064 222.164 221.994 222.154 222.084 221.964 221.844 221.654 220.344 219.234 218.184 218.044 215.284 213.294 212.804 215.034 215.624 215.104 214.624 213.294 213.244 213.224 211.784 211.444 210.984 210.514 210.664 210.664 210.244 210.574 210.444 210.524 209.134 208.164 208.204 208.234 207.594 204.914 203.824 203.854 205.304 206.314 205.394 204 [...]
+ 232.085 233.165 232.785 232.405 231.895 231.345 230.555 229.835 229.245 228.645 228.165 227.985 227.595 227.105 226.555 225.985 225.135 224.584 224.234 223.634 223.084 222.964 222.364 221.634 221.064 220.904 220.944 220.144 219.194 218.184 214.994 213.394 215.694 216.644 216.004 213.714 212.014 211.734 212.384 213.044 211.894 210.744 211.044 210.694 210.194 206.854 206.404 206.994 208.674 210.144 209.814 209.164 208.644 208.124 207.254 207.004 207.264 206.434 204.844 205.664 204.124 204 [...]
+ 232.515 232.805 232.215 231.265 230.315 229.745 229.795 229.675 229.225 228.885 228.595 228.345 227.865 227.325 226.785 226.085 225.145 224.635 224.274 223.924 223.714 223.514 222.384 221.344 220.554 220.394 220.544 220.024 219.144 218.274 217.934 217.434 217.294 216.874 216.454 216.334 216.274 214.844 213.414 211.974 210.394 209.324 209.614 209.624 209.584 211.024 211.364 211.154 210.754 210.264 209.554 209.194 208.734 208.194 207.754 207.714 207.314 206.764 206.174 204.184 201.294 205 [...]
+ 232.755 230.435 230.365 231.715 230.905 230.275 230.135 229.775 229.475 229.185 228.785 228.185 227.655 227.165 226.655 226.235 226.065 225.445 224.665 223.894 222.384 221.634 220.734 219.744 218.744 219.304 219.164 219.114 219.054 218.904 217.694 216.084 216.254 216.434 216.604 216.514 216.244 214.744 213.234 211.734 210.354 209.714 209.894 210.084 209.704 211.124 211.474 211.274 211.064 210.594 209.734 208.934 208.374 207.804 207.264 207.124 206.784 206.244 205.694 205.294 205.144 204 [...]
+ 230.915 231.965 231.635 230.015 228.395 228.075 229.955 229.935 229.535 229.135 228.665 227.895 227.055 226.205 225.585 225.185 224.905 224.315 223.655 222.945 221.694 222.664 220.934 220.714 220.504 219.954 218.354 218.054 218.074 218.104 216.644 215.284 215.604 215.954 216.314 216.264 215.934 214.444 212.924 211.414 210.704 209.504 207.714 205.924 205.934 210.114 211.464 210.844 210.214 209.634 209.244 208.764 208.464 208.154 207.694 206.764 205.964 205.384 204.804 204.424 204.514 204 [...]
+ 231.755 231.855 231.865 231.615 231.365 230.465 230.365 229.985 229.655 229.365 228.805 227.725 225.825 223.645 222.245 221.715 223.735 223.835 223.425 222.995 222.385 222.774 221.384 220.274 219.494 218.964 218.524 218.194 217.864 217.534 216.334 215.184 215.324 215.454 215.594 215.444 215.034 213.664 212.294 211.024 210.454 210.044 209.874 209.694 209.554 210.244 210.464 209.844 209.154 208.744 209.214 208.994 208.644 208.174 206.224 200.634 202.374 205.084 204.534 204.314 204.534 204 [...]
+ 232.825 230.435 229.575 229.415 229.235 229.195 230.105 230.565 230.275 229.015 227.955 228.175 226.865 226.675 225.855 225.195 224.415 224.205 223.755 223.295 222.745 222.205 221.214 219.574 217.934 217.864 218.314 217.974 217.634 217.304 216.474 215.824 215.144 214.464 214.284 214.124 213.654 212.444 211.274 210.194 210.044 209.744 209.744 209.734 209.654 209.764 209.634 208.614 207.864 207.514 208.434 208.684 208.224 207.784 205.714 202.474 201.814 201.884 204.244 204.074 204.294 203 [...]
+ 233.425 232.225 231.235 229.915 228.595 227.905 230.145 230.655 230.265 229.605 229.215 228.455 227.195 225.795 224.825 224.175 223.785 223.465 223.155 222.825 222.405 222.045 221.445 220.854 220.264 217.514 215.024 217.154 217.354 217.004 216.524 215.974 215.644 215.194 214.504 214.114 213.674 212.364 211.144 210.084 209.814 209.794 209.784 209.784 209.514 208.264 208.314 208.624 208.824 208.114 208.164 208.054 207.674 207.294 205.054 205.654 204.624 203.714 202.804 202.704 203.514 203 [...]
+ 233.445 232.875 232.295 231.755 231.345 230.955 230.615 230.145 229.575 229.005 228.475 227.945 227.415 226.505 225.095 222.635 220.785 222.435 222.615 222.385 222.385 222.135 221.655 221.175 220.634 220.014 219.174 218.414 217.604 216.794 216.324 215.774 215.294 214.934 214.574 213.994 213.434 212.494 211.564 210.824 210.264 209.904 209.854 209.824 208.934 205.454 206.394 207.434 207.804 208.074 208.004 207.664 207.194 206.434 205.914 205.604 203.334 200.424 197.984 200.024 202.654 202 [...]
+ 233.675 233.305 233.095 232.975 232.845 232.205 230.735 229.765 228.985 227.615 226.905 226.695 226.175 225.745 225.435 225.445 225.595 223.175 221.145 219.815 219.595 222.095 221.485 220.965 220.435 219.684 218.854 218.134 217.414 216.674 216.344 215.914 215.244 214.564 213.964 213.134 212.374 211.784 211.274 210.744 210.104 209.734 209.644 209.554 208.544 207.394 206.954 207.044 207.124 206.674 205.234 204.654 204.524 204.404 204.784 204.824 204.384 203.754 203.234 202.884 202.634 201 [...]
+ 232.645 230.055 231.135 232.545 232.955 232.275 230.615 229.625 228.865 227.465 227.345 227.025 226.535 226.025 225.515 225.355 225.175 223.115 223.195 222.945 222.315 221.815 221.195 220.375 219.405 219.085 218.274 217.734 217.114 216.394 215.904 215.624 215.374 215.084 214.404 213.574 212.954 212.484 211.994 211.414 210.644 210.084 209.554 209.304 209.094 208.534 207.464 207.034 207.064 205.754 201.934 201.584 202.614 204.084 204.674 204.244 203.934 203.654 203.384 203.034 202.594 202 [...]
+ 233.225 233.935 233.715 233.115 232.525 231.645 230.295 229.165 227.385 225.595 225.175 227.215 226.715 225.995 225.365 225.015 224.485 224.015 223.545 222.855 222.135 220.915 218.705 216.505 216.615 218.005 217.605 216.964 216.394 215.834 215.664 215.244 214.954 214.714 214.444 213.794 213.224 212.764 212.304 211.834 211.174 210.504 210.004 209.484 208.614 207.794 207.644 207.754 207.714 205.744 201.214 203.634 204.054 204.754 204.654 203.934 203.764 203.704 203.494 203.104 202.624 202 [...]
+ 231.965 233.135 232.855 232.205 231.565 231.085 230.675 229.875 228.525 226.325 225.845 226.595 226.785 225.985 225.185 224.475 224.065 223.325 222.895 222.465 221.535 220.635 218.555 216.465 215.155 217.545 217.995 216.755 215.524 214.804 215.124 215.114 214.794 214.454 214.114 213.484 212.924 212.474 212.014 211.554 211.084 210.574 210.024 209.474 208.584 206.964 206.564 206.864 207.194 207.154 207.354 206.954 206.304 205.634 204.874 203.874 203.624 203.564 202.994 203.024 202.744 202 [...]
+ 232.735 232.965 232.445 231.855 230.205 230.495 230.305 228.935 227.415 227.975 227.485 224.535 224.565 224.605 224.745 225.075 225.475 224.405 223.325 222.255 221.835 221.375 220.935 220.485 220.045 219.105 217.565 215.435 213.305 212.974 214.174 215.234 214.064 213.304 212.984 213.124 212.624 212.204 211.784 211.314 210.814 210.304 209.914 209.624 209.334 209.084 208.574 207.834 207.084 206.844 207.184 206.754 206.054 205.344 204.604 203.824 202.954 202.174 201.384 201.474 202.214 200 [...]
+ 233.065 232.755 231.375 229.685 227.985 227.355 228.235 229.065 228.675 227.655 227.685 227.245 226.855 226.475 226.215 226.005 225.245 224.685 224.135 223.515 221.995 220.505 219.985 219.465 219.005 217.775 216.275 217.395 216.855 216.325 216.074 215.054 214.534 213.364 212.294 212.314 212.174 211.694 211.274 210.854 210.354 210.004 209.764 209.474 208.814 208.034 207.924 207.974 207.214 206.664 206.684 206.224 205.724 205.354 204.574 203.614 202.664 202.004 201.504 201.194 201.274 199 [...]
+ 232.795 232.405 231.035 229.475 227.855 226.745 228.385 227.885 227.175 226.405 225.555 225.465 227.045 226.995 226.365 225.635 225.105 224.685 224.235 223.745 219.605 216.905 215.975 215.695 215.865 218.045 218.605 217.875 217.145 216.335 214.715 213.744 213.404 213.074 212.734 212.224 211.694 211.164 210.644 210.154 209.754 209.434 209.214 208.994 207.764 206.184 205.714 205.574 206.484 206.714 206.264 206.074 205.784 205.434 204.664 203.504 203.014 202.594 201.894 201.114 200.324 199 [...]
+ 233.785 230.625 229.875 229.455 229.045 229.785 229.845 228.205 226.425 226.805 227.565 228.385 227.605 226.825 226.045 225.515 225.085 224.705 224.315 223.925 222.905 221.945 221.475 221.025 220.575 220.115 219.255 218.125 217.005 216.145 214.435 213.505 213.354 213.184 212.894 212.164 211.634 211.324 210.944 210.514 210.314 209.814 209.214 208.734 207.084 206.514 206.424 206.214 206.494 206.584 205.654 205.424 205.294 205.154 204.424 203.414 202.444 201.624 200.834 200.054 199.334 199 [...]
+ 234.845 232.655 232.005 231.345 230.655 228.735 227.165 228.015 228.865 228.245 227.155 228.475 227.585 226.695 225.845 225.415 225.145 224.795 224.435 223.265 222.945 221.975 221.485 221.005 220.515 220.045 219.345 218.255 217.475 216.655 214.875 213.795 213.245 213.094 212.784 212.034 211.484 211.054 210.744 210.534 210.374 209.914 209.344 209.004 207.954 206.984 206.804 206.714 206.544 206.224 205.514 205.284 204.874 204.394 204.074 203.624 202.634 201.584 200.534 199.354 198.574 198 [...]
+ 234.525 232.385 231.805 231.305 230.765 229.135 229.225 227.815 226.485 225.175 226.115 228.315 225.975 223.635 221.655 223.055 224.895 224.115 223.075 221.625 221.435 221.855 221.405 220.965 220.485 219.995 218.665 216.215 215.435 214.695 214.575 215.395 214.545 213.665 212.854 212.224 211.614 211.094 210.584 209.404 208.484 208.054 207.824 208.804 208.704 206.684 206.334 206.294 206.174 205.814 205.554 205.024 204.454 203.854 203.214 203.004 202.094 201.164 200.494 199.504 198.544 198 [...]
+ 233.145 229.715 229.625 229.595 229.975 228.175 227.415 228.015 228.615 228.425 228.425 228.255 227.615 226.725 225.845 225.325 224.725 223.935 223.185 222.435 222.135 221.615 220.945 220.455 219.985 219.785 218.495 216.915 215.405 214.385 215.335 215.735 215.055 214.365 213.615 212.674 211.984 211.354 210.724 209.304 210.414 210.564 210.124 209.684 209.284 208.124 207.564 207.104 206.634 206.264 205.774 205.234 204.694 204.074 203.244 202.284 201.844 201.384 200.904 199.934 198.994 198 [...]
+ 231.475 229.705 229.735 229.795 229.865 229.655 229.175 227.545 227.775 228.575 228.125 227.455 227.115 226.765 226.455 225.845 225.085 224.245 223.395 222.605 222.195 221.635 220.855 220.065 219.295 219.155 218.825 218.245 217.325 215.995 214.385 213.825 214.155 214.405 213.535 210.515 209.274 209.764 210.394 210.694 210.784 210.614 210.034 209.344 208.664 207.754 207.244 206.674 206.024 205.534 205.064 204.524 203.904 203.294 202.814 202.164 201.654 201.014 200.364 199.954 199.404 198 [...]
+ 231.305 231.715 231.345 230.885 230.425 228.445 228.865 228.415 226.995 225.575 225.615 227.045 226.825 226.605 226.365 225.655 224.915 224.675 224.435 223.975 222.635 221.555 221.025 220.495 219.795 217.885 215.925 215.435 216.155 216.305 214.515 214.005 214.245 214.475 214.545 213.975 213.185 212.364 211.564 211.064 210.914 209.054 206.754 206.544 205.594 206.714 206.284 205.674 205.114 204.724 204.354 203.714 203.084 202.434 202.364 202.134 201.394 200.654 199.924 199.864 199.594 198 [...]
+ 236.095 234.775 233.565 232.065 230.565 230.475 229.795 229.635 228.675 227.715 225.515 226.395 226.385 226.025 225.665 224.905 224.525 224.515 224.355 224.155 222.395 220.925 220.385 219.805 219.205 218.505 217.065 216.645 216.215 216.095 215.885 215.525 215.055 214.595 214.175 213.875 213.265 212.515 211.754 211.264 210.974 209.764 207.754 205.754 204.864 205.584 205.194 204.944 204.684 204.204 203.644 203.004 202.354 201.704 201.814 201.934 201.334 200.724 200.014 199.934 199.724 198 [...]
+ 236.685 235.315 232.985 231.445 229.995 229.215 230.585 229.595 228.605 227.615 226.425 225.605 225.215 224.825 224.625 224.255 224.015 223.945 223.765 223.315 221.075 219.885 219.355 218.745 218.465 218.445 218.115 217.605 217.125 216.685 216.385 215.835 215.125 214.465 214.025 213.635 213.005 212.145 211.255 210.554 210.124 208.304 206.194 204.444 204.504 205.884 205.624 205.094 204.384 204.174 203.734 201.954 200.174 199.244 200.194 200.974 200.424 200.074 199.724 199.674 199.464 198 [...]
+ 236.675 235.545 233.145 230.735 228.765 229.315 230.705 229.335 228.165 227.085 224.965 224.395 224.255 225.145 224.385 224.075 223.745 223.035 222.365 221.755 219.935 220.425 219.595 218.245 216.675 214.615 216.775 218.135 217.655 217.225 216.115 215.455 215.305 214.595 213.905 213.405 212.615 211.705 210.915 210.355 209.874 209.334 208.784 208.154 207.664 206.734 204.794 202.854 202.704 204.124 204.084 202.094 200.094 199.964 199.464 200.534 200.174 199.814 199.954 199.314 199.074 198 [...]
+ 235.845 235.415 233.005 230.885 229.525 229.915 231.035 229.605 228.185 226.755 224.795 224.685 223.415 222.145 221.495 221.275 222.115 223.655 223.025 222.005 218.505 216.885 216.375 215.855 216.275 218.685 218.605 218.185 217.775 216.775 214.575 214.015 214.065 214.275 214.105 213.385 212.675 211.935 211.205 210.655 210.255 209.164 208.814 208.114 207.724 207.434 206.784 206.124 205.274 205.094 204.794 204.204 203.614 203.014 201.614 200.514 200.684 200.834 200.974 199.894 198.864 197 [...]
+ 234.865 234.745 232.815 232.015 231.215 230.375 230.935 229.505 228.065 226.635 225.875 225.555 225.785 224.935 223.765 223.995 224.125 223.595 223.065 222.115 220.065 219.465 218.495 217.545 217.585 219.075 218.485 217.775 217.095 216.035 216.005 215.845 215.575 215.305 214.955 214.365 213.305 211.975 210.645 210.535 211.075 208.955 207.444 206.164 205.324 207.134 206.604 206.284 205.974 205.724 205.434 204.394 203.334 202.264 201.334 200.504 200.844 201.174 201.384 200.184 198.874 197 [...]
+ 234.355 233.645 232.995 232.205 231.145 230.855 229.985 229.175 228.275 226.875 224.985 224.505 224.885 225.265 225.365 223.215 221.825 221.415 221.605 220.975 220.575 220.465 219.425 218.385 218.325 218.475 218.105 217.535 216.825 215.255 212.495 212.795 214.935 215.425 214.955 213.835 211.705 209.395 207.085 206.365 205.525 208.865 209.675 207.994 207.234 202.614 202.144 201.974 201.824 205.374 207.334 205.384 202.264 199.154 199.384 200.274 200.174 200.424 200.664 199.974 198.654 197 [...]
+ 233.345 232.115 231.595 231.185 230.775 229.455 228.445 227.915 227.565 227.215 225.035 224.625 225.835 225.755 225.605 224.435 223.855 223.155 222.525 222.115 221.795 220.285 218.305 216.965 217.035 218.045 216.715 215.985 215.825 215.995 216.115 216.145 215.875 215.475 214.645 213.575 211.375 210.335 209.925 211.215 211.505 209.185 207.125 205.445 205.234 205.564 206.074 206.584 207.084 206.934 206.894 205.064 203.244 200.964 200.664 200.194 200.084 199.974 199.694 199.074 198.354 197 [...]
+ 234.255 232.525 232.015 231.505 230.995 230.535 230.015 229.395 227.675 225.725 226.495 227.345 226.775 226.205 225.645 225.285 223.935 221.905 219.905 219.035 221.025 220.325 218.315 216.575 216.945 219.415 217.795 216.725 216.155 216.075 215.185 215.215 215.225 214.815 214.355 214.225 213.845 212.705 211.255 210.945 211.175 209.425 207.665 205.905 203.575 204.274 205.404 206.534 207.664 207.314 206.504 205.214 203.854 202.494 201.224 200.524 200.104 199.664 199.174 198.394 197.314 195 [...]
+ 234.465 233.145 232.415 231.715 231.155 231.045 230.795 229.765 228.745 227.465 227.235 227.605 227.015 226.435 225.775 224.985 223.535 223.415 223.175 221.835 221.925 221.845 221.245 220.655 220.185 219.755 219.125 218.445 217.635 215.545 213.035 212.545 212.135 212.525 212.105 214.175 213.675 212.965 212.255 211.745 211.315 210.185 208.885 207.515 207.335 204.055 204.404 205.684 206.964 207.384 207.264 205.494 203.724 201.984 200.504 197.604 197.774 198.374 198.794 197.934 196.134 195 [...]
+ 234.735 233.475 232.845 232.055 231.265 231.335 230.645 230.255 229.095 227.285 228.285 227.405 226.335 225.515 224.815 224.225 223.825 223.475 223.085 221.665 219.695 219.175 218.715 220.285 219.825 216.935 215.775 216.035 216.955 216.995 215.965 215.335 215.075 214.865 214.685 214.075 213.405 212.735 212.225 209.365 207.605 207.365 207.135 206.855 206.795 206.755 205.775 204.794 203.984 206.654 206.384 204.424 202.464 200.654 199.894 198.954 198.044 198.174 198.454 198.084 197.804 197 [...]
+ 234.115 232.845 232.275 231.725 231.175 229.945 229.155 228.845 228.835 228.805 228.145 227.565 226.875 225.825 224.835 224.115 223.265 222.955 222.655 222.475 222.335 220.745 218.735 216.725 217.505 219.805 219.115 218.425 217.745 216.825 215.655 215.055 214.505 213.955 213.575 213.485 213.075 212.605 212.145 210.985 209.525 208.975 208.245 207.515 206.935 206.395 206.005 205.645 205.294 205.874 205.244 204.184 202.414 200.594 198.414 197.454 196.284 196.424 196.964 197.534 197.684 197 [...]
+ 233.365 231.955 231.595 231.235 230.695 229.405 228.715 228.685 228.655 228.455 227.755 227.185 226.825 226.565 226.035 224.265 223.375 222.945 222.505 222.255 222.335 220.715 219.145 218.215 218.855 219.505 218.825 218.145 217.465 216.495 214.875 213.195 211.515 212.045 211.635 213.555 212.925 212.285 211.775 209.315 209.715 210.055 208.975 207.885 207.675 207.255 206.855 206.245 205.625 204.124 203.394 201.454 199.514 198.194 198.214 197.794 196.904 196.024 195.734 196.114 197.154 198 [...]
+ 232.375 230.925 230.605 230.295 229.965 229.015 228.605 228.245 228.035 227.775 227.425 227.325 227.255 227.185 226.635 224.055 223.045 222.825 222.605 222.395 222.515 221.115 221.125 221.095 220.605 220.055 218.715 217.255 215.705 213.805 212.095 214.215 214.725 214.885 212.345 209.475 209.015 208.545 208.095 209.305 211.285 210.185 209.095 208.305 207.235 206.835 206.305 205.775 205.215 202.095 200.574 200.844 201.224 201.354 200.174 199.364 198.894 198.424 197.874 195.574 195.624 197 [...]
+ 231.395 229.985 229.705 229.425 229.215 229.285 229.105 228.615 228.135 227.695 227.515 227.315 227.175 227.085 226.385 223.725 222.515 222.265 222.075 222.095 222.315 222.025 221.655 221.215 220.875 220.585 219.225 217.745 216.255 215.415 214.795 214.225 213.825 214.695 212.565 212.125 211.745 211.355 211.305 211.435 211.365 210.755 210.135 209.445 207.395 205.785 205.325 204.865 204.225 202.755 202.165 201.784 201.394 201.354 199.924 199.034 198.454 197.884 197.614 197.404 197.034 197 [...]
+ 231.475 230.175 229.555 229.295 229.215 229.315 229.145 228.705 228.285 227.525 227.185 227.295 227.035 226.775 225.635 223.725 224.115 223.235 222.345 222.025 222.165 221.885 221.565 221.225 220.805 220.295 219.165 218.095 217.015 215.035 213.705 213.765 213.815 214.315 212.665 211.215 210.945 210.745 211.465 211.345 211.075 210.185 209.195 208.205 204.995 205.255 205.555 204.725 203.945 203.525 202.365 200.895 199.664 199.064 199.524 199.534 198.794 197.924 197.694 198.624 198.584 197 [...]
+ 232.415 231.295 230.275 229.385 228.455 227.195 227.075 227.715 228.495 228.155 226.705 226.085 225.895 225.705 225.255 224.375 223.905 223.585 223.255 222.565 221.915 221.645 221.375 221.075 220.445 219.505 218.855 218.185 217.175 214.735 212.215 212.675 213.405 214.135 213.515 213.095 212.465 212.025 211.715 210.695 209.975 208.025 206.075 205.025 205.715 206.395 205.495 204.605 203.895 201.785 199.845 199.735 199.635 199.104 199.864 199.994 199.114 198.234 197.924 195.854 195.414 195 [...]
+ 232.235 231.125 229.895 228.665 227.745 228.795 229.165 228.895 228.625 228.345 227.985 227.375 226.665 225.955 224.465 221.335 221.505 222.995 223.165 222.425 221.855 221.255 220.665 220.245 219.595 217.295 216.625 215.965 215.295 214.615 213.955 213.385 213.345 214.065 213.865 213.515 213.005 212.405 211.805 210.615 209.245 208.425 208.175 207.935 207.735 206.325 205.335 205.065 204.375 204.625 204.525 204.035 203.555 202.215 200.014 199.324 199.414 198.914 198.654 196.614 196.524 197 [...]
+ 232.425 231.785 231.025 230.275 229.285 229.075 229.195 229.175 228.515 227.915 227.525 226.875 226.155 225.425 225.005 225.285 224.655 223.705 222.755 222.035 221.575 219.795 217.955 216.255 215.755 216.725 216.835 216.935 217.045 216.655 216.255 215.455 214.655 214.195 213.835 213.245 212.785 212.325 211.835 210.845 209.625 207.995 207.055 206.255 207.625 207.985 206.825 205.665 204.855 205.705 205.165 204.165 203.155 201.475 199.695 199.884 199.494 198.964 198.614 198.544 197.944 197 [...]
+ 232.625 231.815 231.295 230.595 229.995 229.775 229.185 228.585 227.995 227.365 226.505 225.865 225.305 224.735 224.375 224.505 223.825 222.915 222.015 221.385 220.995 220.415 220.275 219.955 219.205 218.145 217.375 216.835 216.585 216.245 215.785 215.385 214.995 214.345 213.635 212.805 212.365 211.915 211.465 210.725 209.915 209.385 208.835 208.335 208.645 207.585 205.195 202.795 202.465 206.375 204.735 202.145 199.545 198.425 199.935 199.315 197.594 196.024 197.514 198.794 198.064 197 [...]
+ 232.095 231.325 230.835 230.335 229.795 229.085 228.655 228.275 227.895 227.275 225.855 225.445 225.335 224.955 224.785 223.935 223.305 222.755 221.975 221.355 220.905 220.645 220.385 220.115 219.385 218.575 218.545 217.735 216.925 216.555 215.895 215.575 215.215 214.245 213.285 212.495 212.025 211.575 211.135 210.455 209.785 209.215 208.645 207.895 205.585 204.775 205.055 206.165 206.995 206.595 205.735 204.515 203.285 202.005 200.785 200.085 199.625 199.154 198.894 198.874 198.514 198 [...]
+ 231.965 231.265 230.675 230.085 229.505 228.955 228.555 228.235 227.915 227.105 225.305 224.945 224.865 224.775 224.255 223.235 222.415 220.635 218.865 219.385 221.035 219.375 217.725 216.065 217.175 218.925 218.895 218.875 218.845 218.125 216.795 215.205 214.665 214.115 213.275 212.535 212.045 211.545 211.065 210.465 209.875 209.415 208.945 208.225 208.385 207.565 207.385 207.205 206.755 205.285 204.645 204.545 203.455 202.095 200.485 199.785 199.255 198.725 198.544 198.534 198.294 197 [...]
+ 231.855 231.195 230.695 230.145 229.565 228.855 228.425 228.125 227.825 227.385 226.415 225.705 225.055 224.395 223.905 223.435 222.985 222.525 222.085 221.855 221.625 220.925 220.265 219.605 219.615 219.705 219.565 219.425 219.285 218.175 216.555 214.365 212.575 210.885 211.635 212.315 210.445 208.575 207.905 208.755 209.685 209.355 208.965 208.125 204.635 205.015 204.905 206.125 205.905 201.635 201.155 201.975 203.035 202.265 198.785 198.815 199.495 199.205 198.905 197.344 194.824 193 [...]
+ 230.015 231.155 230.745 230.335 229.325 226.935 227.775 228.085 227.835 227.435 226.985 226.265 225.495 224.755 224.145 224.495 223.805 223.025 222.355 222.255 222.205 221.405 220.595 219.795 219.665 219.595 219.495 219.375 219.155 217.975 216.345 214.015 211.695 210.505 211.475 212.775 212.155 211.645 210.945 207.565 207.065 206.975 207.765 208.445 208.445 208.165 207.705 207.345 205.785 201.525 201.015 202.015 203.285 202.325 198.255 197.935 197.965 197.995 196.855 194.765 195.294 196 [...]
+ 231.395 231.035 230.955 230.525 229.405 229.605 229.375 228.895 228.415 227.945 227.305 226.515 225.725 224.945 224.425 224.715 224.105 223.395 222.545 222.315 221.705 220.895 220.085 219.255 219.065 219.125 218.825 218.675 218.515 217.445 216.165 214.625 213.795 213.255 212.865 212.455 211.975 211.465 210.675 210.185 209.695 208.895 207.785 208.155 208.255 208.125 207.815 207.515 207.045 205.945 205.195 204.615 204.025 203.125 201.765 201.315 201.105 200.895 200.145 198.955 198.415 196 [...]
+ 232.215 231.465 230.745 230.075 228.875 228.205 228.865 229.435 228.915 226.885 227.265 226.295 225.145 224.005 223.615 224.265 223.635 223.015 222.385 221.745 221.085 219.065 218.045 217.155 218.905 219.525 218.725 217.925 217.415 216.445 215.235 213.805 213.035 212.275 212.395 212.265 210.285 209.085 208.405 208.095 209.235 209.465 208.585 207.905 207.995 207.845 207.505 207.155 206.705 206.035 205.275 204.435 203.595 202.695 201.645 201.235 201.135 201.035 200.405 199.345 198.785 198 [...]
+ 229.405 228.455 227.895 227.675 227.475 229.885 229.985 229.505 229.035 227.335 224.595 224.805 225.135 225.445 223.925 224.475 223.705 222.935 222.165 222.115 222.105 221.695 221.075 220.455 219.885 219.355 218.775 218.115 217.325 213.825 211.715 212.205 212.695 213.185 212.645 212.505 212.195 211.615 211.035 210.635 210.055 209.175 208.295 207.515 207.395 207.325 207.205 206.865 206.275 205.445 204.645 203.815 203.085 202.445 201.625 201.415 201.305 201.165 201.005 200.495 199.655 198 [...]
+ 233.625 231.995 229.805 228.305 227.915 229.965 229.995 229.545 229.115 228.445 228.665 227.795 226.835 226.375 225.665 224.875 222.635 220.395 218.775 219.905 222.065 221.495 220.935 220.335 219.625 217.155 216.475 216.255 217.015 216.795 216.225 215.275 214.325 213.595 211.815 211.365 211.015 210.665 211.045 210.535 209.785 208.855 207.955 207.195 206.765 206.605 206.535 206.475 205.835 204.735 204.045 203.465 202.885 202.215 201.515 201.325 201.215 201.105 200.985 200.745 199.315 197 [...]
+ 233.395 231.945 231.365 230.785 230.335 230.285 230.255 229.825 229.385 229.395 229.345 227.185 224.955 223.055 223.345 225.545 224.845 223.765 222.595 222.715 221.885 220.115 218.355 216.655 218.755 219.785 217.865 215.615 216.365 216.175 215.665 215.185 214.705 214.215 213.355 211.195 210.635 210.655 211.285 210.615 209.835 208.845 207.845 207.065 206.775 206.625 205.915 205.195 204.385 203.405 202.735 202.405 202.225 201.655 200.815 200.655 200.555 200.455 200.435 200.515 197.455 195 [...]
+ 233.125 232.525 231.795 230.985 230.565 230.515 230.225 229.915 229.565 229.145 228.715 227.955 227.215 226.475 226.185 226.135 225.455 224.725 223.995 223.285 222.545 221.565 220.515 219.475 219.775 219.355 216.775 214.205 211.895 214.465 215.865 215.615 215.325 214.835 214.085 213.525 212.895 211.775 210.815 210.275 209.425 208.475 207.545 206.825 206.505 205.775 204.915 204.095 203.415 202.715 202.445 202.255 201.925 201.635 200.905 200.725 200.535 200.045 199.995 200.105 196.845 194 [...]
+ 232.465 232.135 231.425 230.695 230.275 230.165 229.805 229.435 229.045 228.615 228.085 227.485 226.895 226.225 225.925 225.755 225.235 224.725 224.205 223.285 222.385 221.785 221.185 220.475 220.125 219.605 218.995 217.995 217.005 216.435 215.905 215.475 215.215 214.915 214.325 213.435 212.255 211.075 210.145 209.765 209.025 208.085 207.175 206.465 206.105 205.575 205.015 204.385 203.695 202.935 202.415 201.955 201.505 201.225 201.135 199.895 199.385 199.495 199.625 199.815 199.045 198 [...]
+ 231.265 230.905 230.475 230.115 229.605 229.525 229.165 228.805 228.435 227.975 227.725 227.025 226.465 225.895 225.995 225.535 222.855 220.185 218.585 220.505 222.685 221.775 221.005 220.405 219.715 219.065 218.475 217.895 217.325 216.785 216.245 215.725 215.215 214.645 214.045 213.165 212.055 210.955 210.075 209.735 208.995 208.295 207.595 206.605 205.545 205.015 204.745 204.585 203.935 202.945 202.435 201.855 201.275 201.015 200.945 199.875 199.295 198.715 199.225 199.415 196.595 194 [...]
+ 231.285 230.985 230.695 230.475 228.495 225.525 226.395 227.255 228.005 227.815 227.855 227.155 226.455 225.755 225.735 225.875 224.685 223.525 222.355 222.895 222.395 219.655 218.735 217.885 219.535 218.895 218.315 217.745 217.195 217.395 217.055 215.805 214.555 213.585 214.235 213.375 212.215 211.035 209.965 209.395 208.865 208.265 207.815 206.925 205.425 205.235 205.155 205.005 204.115 202.925 202.295 201.695 200.985 200.645 200.505 200.175 199.805 199.325 199.475 199.205 195.775 194 [...]
+ 232.115 231.535 231.075 230.645 230.345 230.285 229.785 229.285 228.715 228.285 227.685 227.115 226.535 225.915 225.645 225.465 224.235 223.015 221.825 222.655 222.485 220.365 218.245 217.295 217.355 216.645 218.395 217.835 217.295 217.205 215.925 213.315 211.195 210.705 212.165 213.035 212.545 211.315 209.105 207.625 207.315 207.175 207.155 207.075 205.505 205.355 205.385 205.415 204.355 202.825 202.005 201.225 200.455 200.135 200.245 199.615 198.985 198.455 198.855 199.445 199.325 199 [...]
+ 232.675 232.005 231.315 230.625 230.345 230.405 230.355 230.115 229.885 229.195 227.705 227.115 226.545 225.995 225.765 224.955 222.325 219.685 217.575 222.655 222.815 221.295 220.605 219.905 219.615 218.925 218.465 218.015 217.625 217.555 215.815 214.425 213.925 213.435 210.685 211.435 211.345 211.255 210.575 210.255 209.385 208.345 207.295 206.695 206.565 205.965 205.185 204.415 203.625 202.575 201.785 201.295 200.805 200.685 200.685 200.155 199.645 199.125 199.315 198.845 195.775 193 [...]
+ 233.095 232.195 231.285 230.385 230.175 230.365 230.335 230.555 230.785 229.675 227.425 227.605 227.095 226.585 226.175 225.625 224.325 223.025 221.615 221.885 222.065 222.355 222.555 222.765 221.415 220.325 219.445 218.565 217.955 218.025 215.995 212.835 210.395 211.395 212.675 213.055 212.205 211.775 211.575 210.895 209.775 208.595 207.555 206.605 206.555 205.725 204.795 203.685 203.205 202.565 202.115 201.675 201.445 200.665 200.265 198.885 197.505 196.495 198.285 198.525 195.305 194 [...]
+ 232.795 230.565 228.345 226.415 227.865 230.925 231.165 231.395 231.525 230.795 229.705 229.035 228.375 227.705 226.185 225.985 224.975 223.965 222.615 223.825 223.325 223.055 222.795 222.535 220.775 218.925 217.385 216.075 214.685 211.985 211.455 210.915 210.385 209.895 213.235 214.035 213.315 212.385 211.745 211.235 210.395 209.515 208.505 207.645 206.635 205.415 204.185 203.025 202.595 202.695 202.465 202.255 202.035 200.915 199.915 199.915 199.835 199.755 199.885 199.655 199.685 199 [...]
+ 232.265 230.625 229.145 227.825 231.245 231.825 231.905 231.975 232.035 231.505 230.645 229.705 228.765 227.875 226.955 226.745 226.685 226.545 226.015 224.405 223.055 222.105 221.155 220.725 219.255 218.455 217.615 216.765 215.975 216.015 215.705 215.095 214.495 213.285 212.185 211.775 211.355 211.275 211.895 211.405 210.045 208.945 207.785 207.025 206.625 205.585 204.545 203.505 203.045 202.915 202.665 202.425 202.195 200.565 199.165 199.215 199.265 199.255 199.665 200.145 199.955 199 [...]
+ 232.665 233.065 233.245 233.435 233.165 232.585 232.465 232.335 232.185 231.305 229.875 229.545 229.105 228.155 227.795 227.185 226.665 226.145 225.625 224.425 223.605 222.635 221.035 219.505 218.785 218.025 217.435 216.845 216.065 215.365 215.045 214.555 214.075 212.805 213.565 214.245 214.225 214.145 212.925 210.255 208.955 208.255 207.795 207.695 207.825 206.675 205.335 204.005 203.555 203.305 203.055 202.235 201.275 197.315 200.515 200.455 199.945 199.435 199.985 200.395 200.225 200 [...]
+ 228.545 229.715 231.925 233.595 233.155 232.445 232.225 231.805 231.385 229.925 228.515 228.205 227.895 227.585 227.095 226.155 224.085 222.985 221.945 225.075 222.745 220.515 219.685 218.515 217.685 217.435 217.505 217.055 216.445 215.745 215.385 215.155 214.745 214.525 214.895 214.575 213.935 213.585 212.265 210.205 209.535 209.035 208.575 208.485 208.125 206.795 205.465 203.555 203.845 203.665 202.335 200.995 199.855 200.525 201.325 200.825 200.325 199.995 198.795 198.635 198.765 199 [...]
+ 232.875 233.175 233.465 233.865 233.375 232.455 231.665 230.875 230.135 229.395 228.675 227.775 226.875 226.385 226.295 225.535 224.695 226.195 226.095 224.355 221.975 219.065 216.885 215.085 216.115 216.165 216.455 216.845 216.965 216.175 215.815 215.635 215.385 215.095 215.105 214.925 214.555 213.925 212.755 210.875 209.365 208.455 208.295 207.255 207.765 206.675 205.595 201.635 203.635 203.905 200.955 197.995 195.685 203.315 201.875 201.535 201.195 200.375 198.295 197.105 198.095 199 [...]
+ 234.215 234.035 234.015 233.995 231.635 230.555 231.315 230.575 229.685 229.155 228.865 228.285 227.035 225.135 225.795 226.655 226.185 225.715 225.535 223.835 222.325 220.945 219.585 218.395 217.685 217.365 217.535 217.675 217.295 215.815 215.495 215.495 215.565 214.655 214.005 213.605 213.205 213.545 212.865 210.935 209.535 208.255 206.985 206.405 206.715 205.655 204.765 203.875 204.155 203.995 203.315 203.765 204.215 203.715 201.955 199.255 196.695 199.915 196.125 198.725 199.235 199 [...]
+ 235.775 235.195 234.625 234.045 233.595 233.015 231.815 230.605 229.405 229.085 228.735 228.125 227.535 226.945 227.185 227.015 226.355 225.755 225.065 223.415 221.275 219.675 218.855 218.095 217.825 217.955 218.245 218.525 217.845 211.315 212.135 214.045 215.955 215.355 214.555 213.335 212.065 212.545 211.775 210.935 209.805 208.665 207.805 205.945 204.185 204.285 204.135 203.995 204.285 204.815 203.515 202.215 202.215 201.865 201.835 199.095 198.165 201.525 200.715 199.965 200.165 199 [...]
+ 235.925 235.255 234.575 233.905 233.005 231.985 231.115 230.245 229.355 229.165 228.865 228.105 227.355 226.625 226.975 226.825 226.055 225.285 224.325 223.565 222.875 220.275 217.685 216.585 218.325 216.515 214.815 214.165 213.585 216.005 216.195 216.825 216.965 216.735 215.575 214.605 213.655 212.455 211.855 211.045 210.285 209.515 208.765 207.675 206.215 206.525 206.845 206.535 203.595 205.635 205.695 205.785 205.875 204.225 202.805 202.375 201.945 201.665 201.195 200.465 199.485 198 [...]
+ 235.515 234.845 234.135 233.395 231.035 229.815 230.535 230.695 230.175 229.645 228.645 227.495 226.575 225.775 225.785 225.555 224.775 223.995 222.965 221.645 220.005 217.525 215.445 215.645 219.895 219.635 219.015 218.405 217.065 214.735 215.045 215.745 216.465 215.665 213.205 212.815 212.445 211.805 211.255 211.225 210.615 210.005 209.395 208.965 207.735 207.625 207.045 206.355 205.055 205.995 206.015 206.055 206.095 204.875 203.485 203.145 202.795 202.405 200.075 199.265 199.945 201 [...]
+ 234.675 233.435 232.195 230.955 226.755 225.305 226.865 228.525 230.185 229.535 228.515 227.405 226.245 225.135 225.025 223.585 222.165 221.115 220.295 223.305 221.175 218.805 217.965 218.135 219.235 219.035 218.895 218.755 217.865 215.695 215.575 215.715 215.845 215.385 214.265 213.755 213.085 212.415 212.045 211.895 211.145 210.195 209.245 205.975 204.905 201.765 201.645 201.525 204.995 206.285 206.125 205.965 205.915 205.545 204.815 203.625 202.465 201.435 201.765 202.015 202.035 202 [...]
+ 233.655 232.895 232.125 230.735 229.055 226.555 227.285 228.015 228.755 229.165 228.125 227.125 226.125 225.125 224.565 222.945 220.605 219.825 224.325 223.515 222.185 220.275 218.315 218.295 219.395 219.445 219.305 219.235 218.515 212.665 216.965 216.975 217.025 216.535 214.955 214.265 213.695 213.205 212.045 211.595 210.655 209.725 209.385 209.445 209.615 208.405 207.195 206.125 202.865 204.225 204.325 205.005 205.685 205.505 204.765 203.345 201.175 199.465 201.185 201.495 201.565 201 [...]
+ 232.965 230.535 228.665 227.465 228.165 231.065 231.225 231.375 231.475 229.935 228.595 227.515 226.465 225.145 220.635 221.495 222.915 224.335 225.045 223.885 221.435 218.585 215.735 218.255 220.595 218.195 216.535 215.855 219.125 218.055 217.815 217.685 217.615 216.815 215.325 215.135 214.715 214.225 213.005 211.725 211.665 211.595 211.175 211.135 210.815 209.815 208.815 207.715 207.125 206.775 206.595 206.225 205.845 205.905 204.815 201.905 203.795 202.825 202.215 201.925 202.105 202 [...]
+ 234.855 232.425 231.245 230.075 232.575 233.135 232.635 232.205 231.815 228.645 228.785 226.795 224.795 223.455 225.505 226.285 226.255 226.275 226.055 225.165 222.515 219.325 216.285 222.115 221.765 219.315 216.495 214.535 219.615 218.555 218.075 217.815 217.555 216.815 215.705 215.405 215.205 214.995 214.305 213.205 212.395 212.195 211.495 210.885 209.695 209.585 209.255 208.035 207.435 207.065 207.045 207.025 207.015 207.235 206.745 205.235 203.815 202.845 203.025 202.025 199.545 197 [...]
+ 237.495 235.755 234.005 231.865 233.455 233.925 233.345 232.745 232.155 225.415 230.085 229.595 229.045 228.475 227.845 227.385 226.955 226.705 226.355 222.945 224.845 223.555 220.435 222.965 223.285 222.305 221.635 220.975 220.025 218.445 217.815 217.215 216.705 216.085 215.585 215.055 214.525 214.195 213.435 212.175 209.765 207.355 206.295 205.355 210.895 210.575 209.745 208.905 206.785 206.665 207.465 208.255 208.905 208.765 207.265 204.985 202.965 201.695 203.515 205.105 205.385 205 [...]
+ 237.975 236.715 235.445 234.175 233.915 233.495 233.075 232.665 232.255 230.745 230.005 229.645 229.335 229.055 228.905 228.175 227.435 226.695 224.255 217.675 224.365 223.715 223.065 222.545 222.245 219.625 216.735 215.115 220.595 219.985 219.375 218.375 217.335 216.585 215.705 215.205 214.695 214.155 213.165 212.185 212.025 209.995 207.935 211.905 211.765 211.015 210.385 209.795 207.515 206.795 207.485 208.445 209.435 208.995 207.335 204.115 200.885 199.825 203.695 205.845 206.165 206 [...]
+ 237.975 237.035 236.095 234.845 233.905 233.015 232.665 232.315 231.885 229.705 228.985 229.275 229.565 229.545 229.175 228.195 226.915 225.745 223.055 223.835 224.315 223.015 222.065 221.545 219.895 221.575 219.555 217.315 215.975 220.365 220.015 219.395 218.325 217.245 216.285 215.775 215.265 214.645 213.525 212.585 212.425 212.255 212.105 212.505 212.595 211.975 211.345 210.125 209.145 208.215 208.555 209.015 209.445 208.575 206.715 203.575 200.825 206.225 206.115 206.495 206.685 206 [...]
+ 238.095 237.195 235.955 234.255 233.145 232.435 232.165 231.905 231.405 227.945 227.315 228.275 229.245 229.995 229.335 226.895 223.725 222.115 221.445 223.715 221.615 219.655 218.835 216.945 219.065 221.535 220.855 220.185 221.105 220.105 219.705 219.405 219.105 215.025 217.425 216.435 216.015 215.365 214.065 212.985 212.865 212.785 212.695 213.295 213.265 211.725 210.415 209.185 209.275 209.085 208.985 208.885 208.665 206.815 207.385 204.685 202.265 207.665 203.715 203.385 204.065 206 [...]
+ 238.115 236.315 234.615 232.925 228.995 232.815 232.405 231.065 231.075 224.945 230.305 230.095 229.875 229.585 228.965 227.025 223.965 220.855 225.395 225.775 225.375 223.045 220.355 220.495 216.455 215.775 215.105 214.435 221.855 221.845 221.205 220.555 219.905 218.345 217.715 214.805 211.895 209.865 210.955 212.895 213.355 213.825 213.765 213.985 213.195 210.545 207.905 205.765 209.515 208.925 207.115 205.565 207.335 210.535 210.295 209.815 209.335 208.815 208.145 206.525 204.255 201 [...]
+ 237.755 236.375 235.585 234.805 231.415 228.475 226.845 225.265 232.075 230.605 229.835 229.405 228.965 228.665 229.165 227.275 225.035 222.805 226.235 225.755 225.405 224.955 224.505 221.975 221.685 219.115 216.755 214.575 223.155 222.975 222.095 220.995 219.895 218.845 217.895 216.755 215.625 214.935 214.805 213.855 215.015 214.655 213.615 214.255 213.165 210.145 207.165 211.525 210.405 210.075 210.285 210.495 210.665 210.595 210.345 209.985 209.625 209.125 208.105 207.845 208.205 208 [...]
+ 238.095 237.215 236.315 235.365 233.115 232.515 232.665 232.735 233.275 230.925 228.545 226.165 224.505 229.885 230.035 227.655 224.375 221.145 226.635 225.315 225.205 225.135 225.055 223.395 223.505 223.415 221.665 219.635 220.535 221.125 217.985 217.455 216.925 219.175 218.205 217.555 216.915 216.445 214.245 213.665 213.495 213.325 212.435 213.075 212.785 211.045 208.195 210.715 211.575 209.385 208.335 208.245 208.675 210.975 210.765 210.315 209.665 208.915 207.815 207.825 208.425 208 [...]
+ 238.245 237.595 236.755 235.645 229.525 234.405 233.855 233.295 232.565 230.915 230.465 228.885 227.305 230.205 229.965 229.365 228.335 225.205 226.405 225.295 224.915 224.845 224.855 224.835 224.735 224.295 224.005 223.725 223.465 222.795 219.325 215.865 212.705 219.805 218.745 218.275 217.915 217.555 217.605 216.345 214.405 212.265 210.115 211.365 211.285 209.545 212.055 213.475 211.635 209.625 207.025 204.945 210.455 208.555 210.795 210.065 209.335 209.435 209.895 210.375 210.485 209 [...]
+ 237.645 237.295 237.005 236.755 236.515 235.225 234.385 233.215 232.115 231.475 231.115 230.785 230.445 229.985 229.205 228.625 228.095 227.555 227.025 226.375 225.995 225.545 225.095 224.735 224.545 223.815 223.085 222.555 222.335 221.625 219.345 218.175 216.995 218.805 217.765 215.675 213.585 211.885 215.795 218.415 216.825 215.235 213.645 213.995 213.675 214.205 214.725 215.115 214.295 212.345 209.385 206.295 204.575 211.445 209.585 206.955 204.325 209.985 211.485 210.995 210.415 209 [...]
+ 237.015 236.985 236.945 236.705 236.075 235.525 235.065 234.605 234.075 232.585 231.905 231.485 231.055 230.555 229.825 229.215 228.625 228.045 227.235 226.115 225.805 225.495 225.185 224.935 224.615 222.765 220.925 219.075 221.775 224.645 222.585 219.655 216.715 218.835 217.625 218.255 217.305 216.095 218.185 218.645 216.985 215.495 214.875 215.375 214.105 214.645 215.095 215.405 215.435 214.025 211.975 210.025 208.415 210.715 208.795 208.275 209.075 210.115 211.235 209.075 206.835 204 [...]
+ 236.185 236.305 236.435 236.445 235.725 235.365 234.905 234.555 234.045 232.385 230.335 228.225 226.115 226.125 229.505 229.645 229.345 228.935 227.975 226.555 226.165 225.775 225.485 225.285 224.525 222.425 221.775 221.125 222.875 224.325 220.685 217.705 216.645 218.565 217.055 217.455 217.095 216.735 219.085 218.205 215.695 215.115 214.895 213.465 212.735 212.615 212.505 212.915 215.265 214.795 213.985 213.245 211.705 207.825 207.345 207.415 207.475 212.245 212.355 210.145 206.975 203 [...]
+ 234.475 234.925 235.365 236.665 236.495 235.685 234.855 234.035 233.025 231.505 230.475 229.485 228.495 227.925 229.585 230.215 230.595 230.545 229.655 228.725 228.525 227.005 224.855 225.165 223.775 221.445 219.805 221.075 223.745 224.345 222.715 221.545 221.005 216.135 213.995 213.995 214.085 216.785 218.745 217.975 216.245 213.905 211.895 214.125 215.305 215.135 214.975 215.295 215.545 215.005 214.225 213.455 212.185 210.345 211.075 208.955 207.455 212.145 211.615 209.405 206.605 204 [...]
+ 232.655 234.415 236.225 237.405 236.695 235.535 234.205 232.885 231.205 227.945 230.625 231.595 230.875 230.315 229.405 229.965 230.405 230.845 231.075 230.435 227.055 224.505 222.355 226.285 223.515 223.975 224.425 224.655 224.515 224.245 223.355 222.655 221.965 218.655 219.155 218.685 218.595 218.875 218.015 216.265 214.595 212.935 216.715 213.005 211.065 210.735 210.415 212.305 215.735 214.625 211.875 209.125 209.355 212.835 212.345 212.395 211.475 211.345 211.035 210.785 210.495 209 [...]
+ 237.875 237.595 237.265 236.885 236.485 234.195 231.235 228.285 233.585 228.465 231.005 228.845 227.125 225.685 227.505 231.525 231.105 230.175 229.665 230.895 227.495 224.105 221.025 224.815 222.735 223.495 224.105 224.725 220.625 219.425 219.255 222.185 220.995 220.915 219.955 219.485 219.045 218.605 215.275 214.845 214.615 214.395 214.855 214.285 213.225 211.975 211.785 211.345 210.115 209.685 209.565 209.535 208.925 208.545 213.395 212.775 212.165 211.805 211.835 211.525 211.135 210 [...]
+ 237.195 237.205 237.215 237.115 236.075 235.325 233.095 230.865 231.535 232.995 232.875 232.665 232.025 231.775 229.835 232.185 231.895 231.615 231.475 231.845 230.595 229.105 227.605 225.575 224.735 224.775 224.805 224.845 222.355 223.485 221.385 220.155 218.965 219.245 219.295 218.815 218.335 217.825 218.255 218.475 218.465 218.445 218.365 217.125 216.275 216.325 216.335 216.355 215.995 214.415 212.375 212.055 213.155 209.595 209.285 213.205 212.435 211.675 211.235 210.995 210.785 210 [...]
+ 235.115 237.635 237.925 237.455 231.695 231.515 232.525 233.135 232.645 232.595 232.425 232.215 232.005 232.475 232.915 232.645 232.365 232.065 231.925 230.965 229.915 228.575 227.065 226.545 225.835 225.475 225.125 224.765 221.425 225.735 223.095 220.065 217.025 222.305 222.705 221.815 220.125 217.875 217.615 219.105 218.945 218.775 218.565 215.825 215.025 215.295 215.555 215.675 215.995 216.225 214.615 212.965 215.135 212.105 211.765 211.795 211.825 211.695 211.235 211.175 211.185 211 [...]
+ 238.235 237.995 237.755 237.255 236.995 236.305 235.525 234.735 234.395 234.805 233.635 232.375 231.145 231.675 233.045 232.835 232.505 232.175 231.405 230.265 228.295 226.575 225.065 225.045 226.295 226.465 226.635 226.695 227.075 226.715 226.185 224.505 222.815 221.535 222.995 222.615 222.415 222.215 220.265 218.275 216.585 214.905 213.845 216.365 216.165 214.495 212.815 213.575 215.985 216.925 216.985 216.935 216.365 214.565 213.775 212.965 212.155 211.855 211.475 209.655 207.845 206 [...]
+ 238.935 238.985 237.875 238.215 238.225 235.735 232.925 230.115 235.485 234.845 232.465 230.025 227.575 229.365 232.245 232.135 232.015 231.895 231.185 230.375 227.525 224.825 222.125 227.595 226.855 227.235 227.605 227.925 227.205 226.585 225.525 224.765 224.605 224.635 224.045 223.345 222.835 222.525 219.575 218.905 216.755 216.135 215.655 214.715 215.465 215.815 216.155 218.505 218.145 216.175 213.765 211.385 214.625 213.035 211.435 210.175 208.915 208.385 209.775 208.325 206.855 206 [...]
+ 239.395 239.275 239.165 238.935 238.345 237.595 235.785 233.605 235.135 234.395 234.115 233.645 233.005 232.465 232.205 231.695 231.315 231.215 227.765 225.325 224.585 223.845 222.405 226.065 227.455 227.485 227.585 227.685 227.945 227.375 226.495 225.675 224.955 225.035 223.995 221.395 220.525 220.115 221.085 219.875 218.795 218.505 218.815 219.685 219.805 219.535 219.205 217.615 214.265 213.945 213.845 211.975 213.025 210.985 211.155 213.425 213.535 211.435 208.215 214.735 214.275 213 [...]
+ 239.295 239.075 238.845 238.355 237.545 236.785 236.035 235.385 234.575 233.665 233.385 233.095 232.805 233.225 232.955 232.045 231.465 230.875 230.365 229.845 228.475 227.095 225.725 227.235 227.325 227.175 227.025 226.845 226.325 227.225 226.695 225.975 225.245 225.245 224.315 223.315 222.645 221.475 219.425 217.615 216.245 215.465 219.965 220.385 218.965 218.635 218.495 218.015 216.025 215.505 216.305 216.225 216.675 216.015 215.165 214.295 213.465 213.585 214.195 214.155 214.085 214 [...]
+ 237.365 238.465 238.595 238.075 237.315 236.575 235.835 235.125 233.525 229.205 230.425 231.715 231.995 232.735 233.905 232.705 231.755 230.655 230.365 230.115 229.375 228.635 227.895 227.715 226.725 224.835 222.945 221.335 224.165 225.985 225.935 225.885 225.555 225.145 223.985 221.665 219.345 218.085 216.955 216.335 215.965 215.595 216.285 220.155 218.775 216.735 214.725 216.515 218.255 217.385 215.765 214.145 215.215 217.175 215.985 213.835 211.675 211.595 213.015 214.015 215.085 216 [...]
+ 239.425 239.135 238.835 238.335 237.545 237.345 237.125 235.895 235.845 231.525 232.745 233.605 233.185 232.925 233.605 231.505 229.805 229.235 229.475 230.675 229.265 228.545 227.825 227.655 226.475 227.625 227.635 227.645 226.245 225.425 225.025 225.045 225.075 224.735 223.555 221.595 219.865 219.435 221.185 221.545 220.215 218.885 217.475 216.075 215.725 215.595 215.345 214.875 213.575 214.565 215.925 217.285 218.025 217.895 217.035 216.395 215.755 213.985 214.395 216.145 216.675 216 [...]
+ 239.725 239.425 239.115 238.705 238.165 237.965 237.775 237.585 236.695 235.105 232.905 231.655 230.705 230.715 233.745 231.335 228.925 227.655 229.065 231.185 230.555 229.905 229.175 228.955 228.685 228.395 228.105 227.825 225.635 225.135 224.645 224.175 223.705 223.395 223.055 222.665 222.285 222.575 222.795 222.055 220.745 220.265 219.745 218.495 218.145 218.055 218.895 218.155 216.005 219.445 219.255 218.805 218.375 217.975 215.925 213.735 213.185 214.995 217.645 217.295 216.755 216 [...]
+ 239.815 239.415 239.005 238.525 237.785 237.735 237.685 237.655 237.145 236.225 235.605 234.985 234.365 234.335 233.935 231.925 230.975 230.025 229.725 231.155 230.285 229.645 229.005 229.385 229.245 228.605 227.975 227.515 224.595 224.085 224.065 224.175 224.235 223.255 222.705 222.445 222.235 222.165 222.725 222.695 222.035 221.375 220.405 219.465 218.585 217.705 218.015 217.095 220.005 218.255 218.125 218.045 217.145 215.285 213.015 211.995 212.715 214.275 217.905 217.255 216.605 215 [...]
+ 240.005 239.335 238.875 238.265 235.235 235.855 236.465 237.075 237.045 236.505 235.825 235.135 234.455 233.975 233.005 230.875 231.015 232.555 232.315 231.655 230.425 229.185 228.195 228.775 229.085 228.765 228.335 227.705 227.475 226.085 224.215 222.335 220.975 223.135 223.135 221.695 220.255 220.035 224.355 224.375 223.605 222.835 221.175 218.385 217.615 216.755 215.895 216.755 220.155 218.315 216.185 214.295 214.415 216.145 216.255 216.375 216.665 216.815 214.725 212.975 211.225 211 [...]
+ 241.045 240.195 239.355 238.455 237.555 237.465 237.385 237.295 237.015 236.105 233.955 231.805 229.905 234.095 232.935 233.155 233.375 233.455 233.205 232.155 229.955 228.485 227.135 228.875 227.075 226.575 226.065 225.555 224.945 224.425 223.965 223.495 223.605 225.455 224.575 222.675 221.435 222.265 224.705 224.305 223.625 223.115 222.675 222.105 221.965 221.775 221.325 221.165 221.155 220.235 218.425 216.035 214.005 219.275 217.645 216.375 215.365 214.745 214.845 216.205 216.255 216 [...]
+ 242.015 241.075 240.125 239.415 238.725 238.095 236.515 234.935 234.775 235.825 234.135 233.155 232.185 232.135 232.515 232.915 233.305 233.695 233.415 232.635 231.865 230.945 229.925 227.755 226.275 226.635 226.985 227.185 228.485 228.495 227.755 227.015 225.925 225.015 224.645 224.245 223.835 223.415 223.735 223.105 222.345 222.065 222.865 222.615 220.865 219.805 219.665 218.955 219.015 218.985 219.275 219.555 217.435 219.875 219.555 219.245 218.945 218.965 218.895 218.265 217.315 216 [...]
+ 241.946 240.865 239.825 239.225 239.145 237.125 236.705 237.295 235.915 235.775 234.275 235.335 235.215 234.455 233.175 233.995 234.105 234.215 233.445 232.705 232.065 231.295 230.525 228.665 227.835 227.785 227.315 226.605 228.085 228.525 227.605 226.695 225.445 222.885 222.635 222.585 222.645 222.665 223.405 222.635 221.135 220.645 221.115 222.845 222.355 221.205 219.925 220.195 220.875 219.935 219.855 219.775 219.965 220.115 219.205 218.295 217.385 217.625 218.125 217.155 216.175 215 [...]
+ 241.466 240.476 239.395 239.075 239.395 238.405 237.485 236.645 234.375 232.665 233.885 235.105 235.615 235.385 235.475 235.395 235.135 234.805 234.035 233.335 232.805 232.275 231.735 227.985 226.405 225.835 225.265 224.715 227.285 227.165 225.405 223.645 222.565 224.425 224.055 222.715 221.375 220.425 219.895 219.605 219.355 219.105 220.505 222.615 222.105 221.765 221.475 221.275 221.205 219.255 217.305 215.665 218.225 220.225 220.045 219.865 219.615 218.585 217.325 217.055 216.665 216 [...]
+ 240.496 239.676 238.856 238.905 239.305 237.235 235.665 234.085 234.115 234.955 236.145 236.515 236.665 236.515 235.835 235.375 234.915 234.565 234.115 233.485 232.475 231.525 230.995 228.165 226.985 225.915 225.635 226.985 226.585 226.105 225.605 225.095 224.645 224.385 225.025 224.905 224.785 224.705 224.515 224.195 223.865 223.415 222.945 222.605 221.065 219.445 218.755 218.095 217.115 217.735 218.845 219.955 219.995 219.715 219.525 219.025 218.515 218.285 217.765 217.085 215.375 213 [...]
+ 240.826 240.286 239.756 239.396 239.085 238.605 238.165 237.875 237.625 237.155 236.865 236.575 236.275 236.605 235.825 235.105 234.575 234.045 233.695 233.195 233.245 232.605 231.535 230.415 229.235 229.875 229.935 229.405 228.935 228.435 227.815 227.045 226.245 225.325 225.085 225.075 225.055 225.075 224.655 224.185 223.945 223.355 222.895 222.655 221.495 221.365 221.245 221.845 221.205 219.535 219.165 219.065 217.955 216.595 216.655 216.725 216.775 217.925 218.495 217.995 217.495 216 [...]
+ 239.916 240.016 239.446 237.406 236.266 236.835 237.395 238.545 238.365 237.885 236.725 235.575 234.855 235.575 235.795 234.875 233.955 233.035 232.195 231.745 231.825 232.245 232.665 229.545 227.305 227.155 227.135 227.455 226.325 225.755 225.635 225.475 225.275 225.595 225.285 224.645 224.205 222.535 224.235 223.155 221.555 220.595 220.465 222.515 221.045 220.295 220.645 220.795 221.225 220.495 220.365 220.235 220.015 218.935 219.015 218.985 218.675 219.055 218.975 218.285 217.595 215 [...]
+ 240.966 240.306 239.646 237.706 238.526 239.116 239.325 238.945 238.885 238.805 238.105 237.415 236.405 235.825 235.505 233.425 231.345 231.775 232.155 231.095 232.045 232.985 232.955 231.565 230.035 228.425 226.945 226.415 225.935 225.415 224.885 224.345 224.505 227.605 228.005 227.435 226.675 225.685 225.045 223.755 222.285 220.825 219.915 219.095 220.025 221.075 222.125 220.585 219.195 218.525 219.355 220.195 217.945 217.295 217.495 218.135 219.315 219.495 219.115 218.245 217.435 216 [...]
+ 240.856 241.046 240.646 240.216 238.776 238.296 237.376 236.235 237.755 239.125 238.755 238.265 237.585 233.095 232.725 231.815 230.905 230.035 232.865 233.885 233.645 233.405 233.195 231.505 230.855 230.605 230.355 230.145 229.935 229.545 229.225 228.855 228.565 228.665 227.155 225.195 224.745 224.295 225.855 224.435 223.255 222.995 222.285 221.185 221.015 221.455 222.425 222.355 221.935 221.375 220.805 220.475 220.425 220.335 220.145 220.075 220.175 219.855 219.355 218.355 216.935 215 [...]
+ 239.366 240.336 241.296 240.736 239.546 238.596 237.646 236.626 237.915 238.975 238.565 238.165 237.775 235.335 234.995 234.065 233.135 232.495 234.645 234.505 233.855 233.555 233.175 231.265 230.035 230.585 231.135 230.925 228.965 228.665 228.765 228.875 228.955 228.855 228.185 227.255 225.995 225.885 226.655 225.845 224.585 223.125 223.255 224.125 223.915 223.715 223.515 222.115 221.025 220.945 220.865 220.785 219.515 218.255 218.965 219.695 220.425 220.035 219.245 217.985 216.635 214 [...]
+ 238.866 237.766 236.676 239.636 239.806 239.646 239.476 238.926 237.906 239.335 238.705 238.085 237.455 236.085 235.775 234.445 232.825 231.655 235.105 234.565 233.205 232.485 232.125 231.975 230.515 228.965 227.415 226.765 226.655 226.655 228.265 228.745 228.795 228.525 227.825 227.175 226.565 226.165 226.255 224.605 222.865 221.235 222.225 224.125 223.905 223.695 223.485 220.855 222.135 221.955 221.525 221.085 221.065 220.545 220.605 220.605 220.415 219.915 219.395 219.235 218.915 218 [...]
+ 241.066 239.986 238.916 239.296 240.026 240.086 239.946 239.806 239.746 238.656 236.595 234.525 232.775 235.495 236.835 236.495 236.145 234.935 234.945 234.255 232.305 231.275 230.905 230.725 229.665 229.115 229.765 230.145 229.865 229.455 229.075 228.705 228.365 228.025 226.695 225.245 224.225 224.005 226.075 225.745 225.345 224.925 224.665 224.375 224.155 223.815 223.275 222.885 222.205 220.545 218.885 217.775 217.275 217.945 217.545 218.425 219.305 219.315 219.015 218.845 218.655 218 [...]
+ 240.356 240.996 241.366 240.646 239.756 238.776 237.786 236.806 238.556 239.416 238.816 238.195 237.575 234.765 235.545 236.005 235.605 235.275 235.585 235.215 234.715 234.025 233.255 233.195 232.485 231.615 230.705 229.975 229.385 228.955 228.505 228.055 227.675 227.355 227.295 227.275 227.245 226.855 226.005 225.095 224.855 224.605 224.825 224.645 224.045 223.445 222.835 222.435 221.855 220.435 220.225 220.105 218.815 217.805 217.815 217.905 218.325 218.395 218.415 218.265 218.115 218 [...]
+ 240.926 241.426 240.966 240.556 240.896 240.796 240.696 240.226 240.166 239.886 239.276 238.676 238.065 236.345 235.055 235.305 235.055 234.265 233.765 234.735 234.695 234.215 233.825 233.905 233.135 232.155 231.175 229.565 227.325 227.625 228.055 228.675 228.835 227.285 227.105 226.995 226.915 226.445 225.325 223.975 222.615 223.415 224.185 224.915 224.505 224.095 223.685 222.605 221.475 220.435 220.335 220.225 220.985 220.345 219.375 218.455 217.545 217.695 217.525 217.865 217.865 217 [...]
+ 240.686 239.196 238.116 239.816 241.286 240.836 240.376 239.896 239.936 239.716 239.166 238.616 238.036 237.115 236.455 235.865 235.275 234.385 232.135 232.665 233.495 234.115 233.925 233.745 232.935 232.005 231.045 230.795 230.745 229.875 229.395 229.435 228.835 227.665 226.615 225.565 224.545 224.475 225.235 225.195 225.295 225.445 224.945 224.465 224.495 224.525 224.155 221.515 220.245 219.885 220.495 221.115 221.235 220.685 219.645 219.055 218.475 217.155 216.805 215.805 214.795 214 [...]
+ 241.886 241.366 240.916 240.906 240.886 240.456 240.026 239.606 239.606 239.156 238.856 236.696 234.546 236.386 235.935 234.075 232.215 231.005 230.955 232.025 233.285 233.755 233.575 233.415 232.565 231.595 230.635 230.445 231.715 231.415 230.785 230.055 227.945 226.915 226.535 226.155 226.385 226.275 225.445 225.305 225.235 225.165 224.985 224.315 224.285 224.345 224.405 221.395 219.805 219.815 221.455 221.215 220.985 220.885 220.555 220.295 220.095 219.155 218.185 218.365 218.265 217 [...]
+ 242.186 241.896 241.526 240.896 240.266 239.926 239.576 239.426 238.526 238.086 237.786 237.666 237.546 237.216 236.766 236.295 235.825 235.365 234.935 234.505 234.105 233.705 233.335 233.075 232.525 232.415 232.305 231.975 231.375 230.995 230.575 230.155 229.545 227.845 227.265 226.685 226.725 226.355 225.155 224.835 224.505 224.335 224.565 224.385 224.305 224.235 224.415 223.795 223.205 222.785 222.265 221.745 221.115 220.735 220.575 220.395 220.195 219.505 218.825 218.145 217.545 217 [...]
+ 241.806 241.426 241.046 240.186 239.996 239.896 239.806 239.716 238.526 238.016 237.936 237.856 237.756 237.426 236.946 236.406 235.865 235.355 234.965 234.535 234.095 233.645 233.225 232.895 232.605 232.325 232.065 231.705 230.835 230.615 230.385 230.065 229.445 228.735 228.265 227.585 226.845 225.765 225.125 223.985 222.845 221.695 221.745 221.745 221.745 222.675 223.615 222.285 221.715 221.755 221.785 221.265 220.675 220.335 220.315 220.295 220.125 219.345 218.155 216.535 214.975 214 [...]
+ 241.356 240.686 239.646 240.386 240.266 240.086 239.906 239.726 237.936 235.716 234.786 233.856 233.546 236.276 235.786 234.076 232.356 232.605 235.155 234.895 234.185 233.555 233.135 232.775 232.425 232.135 231.855 231.305 230.545 230.105 229.885 229.665 229.505 228.795 227.985 227.175 226.405 225.975 225.465 225.105 224.655 224.205 223.935 223.475 222.275 221.445 221.335 220.195 220.575 220.755 220.865 220.985 218.295 217.585 218.535 219.495 220.375 220.085 219.535 218.995 218.245 217 [...]
+ 239.796 239.836 239.886 238.466 238.646 239.716 239.876 239.566 238.846 237.966 237.076 236.196 235.446 235.986 236.576 236.266 235.946 235.556 235.625 235.005 234.295 233.285 232.635 232.735 232.385 232.025 231.535 231.105 230.715 230.265 229.815 229.365 229.095 228.935 228.305 227.655 227.005 226.115 225.215 224.995 224.775 224.485 223.865 223.055 222.455 221.865 221.285 219.375 219.755 220.195 220.635 221.065 220.665 220.405 220.425 220.475 220.465 219.935 219.285 218.535 217.785 217 [...]
+ 241.946 240.126 238.136 237.556 238.216 238.766 239.316 239.246 239.146 237.976 236.866 236.336 235.456 235.196 235.706 235.796 235.896 235.846 235.416 234.395 233.325 232.265 231.645 231.645 230.335 229.025 228.275 228.775 230.965 230.475 229.975 229.505 229.095 228.805 228.165 227.455 226.755 225.795 225.045 224.955 224.815 224.605 222.365 222.295 221.725 221.155 220.605 222.175 223.015 221.805 220.605 219.465 220.315 220.415 220.285 220.155 220.065 219.485 218.765 217.975 217.195 216 [...]
+ 240.826 239.776 238.786 239.776 240.486 239.246 237.506 235.596 238.206 238.366 237.666 236.936 236.156 235.666 235.386 234.946 235.046 234.976 234.676 233.636 232.755 231.995 231.245 230.575 230.875 231.165 231.455 231.505 231.165 230.625 230.115 229.625 229.195 228.565 227.855 227.155 226.355 225.895 225.015 224.825 224.745 224.665 224.225 223.995 223.915 223.585 223.255 223.365 222.595 220.825 219.065 217.845 219.275 219.885 219.855 219.755 219.495 218.595 217.895 217.175 216.455 216 [...]
+ 239.066 240.016 240.966 240.086 240.106 240.426 240.086 239.676 238.656 237.896 237.216 236.536 235.426 235.006 236.026 235.736 235.166 234.686 234.006 233.896 233.486 232.715 231.435 230.445 230.795 231.145 231.545 231.675 231.195 230.685 230.145 229.615 228.255 227.915 227.405 226.575 225.745 225.745 225.855 225.445 225.035 224.655 224.025 223.615 223.535 223.455 223.335 223.145 222.535 221.525 220.395 219.005 219.305 219.195 219.165 219.135 218.925 217.895 217.255 216.775 216.205 215 [...]
+ 241.236 241.056 240.126 237.776 237.776 238.596 239.416 239.766 238.946 238.176 237.446 236.716 235.556 234.746 234.906 235.156 235.036 234.426 233.386 233.276 232.586 231.826 232.535 230.995 231.375 231.755 232.145 231.815 230.635 230.165 229.695 229.195 226.865 226.565 226.645 226.735 227.305 226.855 226.645 226.155 225.625 225.085 224.535 224.175 223.725 223.215 222.705 222.315 221.635 220.825 220.115 219.375 218.505 218.405 218.255 218.035 217.735 217.215 216.595 216.145 215.715 215 [...]
+ 240.066 239.016 238.196 239.146 238.966 239.026 239.076 239.036 238.526 237.106 235.476 233.856 233.536 233.156 233.186 234.386 234.696 234.066 233.776 232.576 231.796 231.446 231.896 231.675 231.705 231.845 232.005 231.335 230.405 229.705 229.185 228.715 226.575 225.105 224.705 224.305 223.905 225.655 226.905 224.845 222.775 222.355 222.815 223.515 223.015 222.545 222.215 221.855 220.885 219.505 218.125 217.475 218.715 218.955 218.475 217.795 217.195 217.335 216.815 216.115 215.405 215 [...]
+ 241.956 241.466 240.726 240.666 240.256 239.796 239.286 238.746 238.126 236.776 235.606 234.726 234.166 235.826 235.556 235.136 234.706 234.386 233.806 232.436 231.056 229.676 230.326 231.726 231.765 231.815 231.865 231.355 230.255 229.085 228.575 228.075 227.705 228.315 228.195 228.045 227.895 225.685 225.265 225.045 224.825 225.135 223.845 222.895 222.555 222.235 221.895 221.495 220.525 220.375 220.245 220.445 220.515 219.965 219.145 218.335 217.455 215.705 215.825 216.325 216.055 215 [...]
+ 240.626 240.246 239.426 236.986 237.216 238.096 238.976 238.906 238.106 236.726 236.386 236.086 235.876 236.036 235.686 235.286 234.876 233.546 233.556 233.646 233.736 233.826 233.166 232.026 232.046 232.055 232.065 231.545 230.435 228.765 228.315 227.865 226.665 228.225 228.225 228.225 228.215 226.085 224.095 222.825 223.585 224.345 223.705 222.865 222.545 222.235 221.875 221.065 220.055 218.755 218.925 219.835 220.785 220.275 219.725 219.135 217.935 217.245 216.945 216.465 215.985 215 [...]
+ 240.566 239.946 239.656 240.656 240.226 239.696 239.196 238.636 238.026 237.306 236.576 236.016 235.756 235.936 235.746 235.546 235.356 233.736 232.586 233.426 234.196 234.066 233.426 232.266 231.946 231.746 231.685 231.135 230.425 229.665 229.095 228.615 228.725 228.205 228.115 228.055 228.045 227.055 226.085 225.345 224.595 223.825 223.075 222.135 221.025 219.925 219.475 220.845 221.365 221.285 221.465 221.455 220.505 220.005 219.535 219.045 218.595 218.005 217.325 216.715 215.965 215 [...]
+ 241.476 240.416 239.776 240.586 240.106 239.476 238.856 238.276 238.026 236.536 234.936 234.016 233.576 235.816 234.956 234.626 234.296 234.346 234.006 233.886 233.776 233.646 233.116 232.226 230.856 230.276 229.706 229.335 229.005 228.515 228.015 227.515 227.145 227.555 227.935 227.815 227.685 226.695 225.775 225.035 224.295 223.515 222.675 221.945 221.255 220.565 220.255 221.725 221.935 221.815 221.735 221.745 221.415 220.665 219.955 218.795 218.185 217.735 217.045 216.325 215.575 214 [...]
+ 239.926 239.676 240.686 240.016 239.406 238.836 238.256 237.946 238.366 237.166 236.036 234.906 234.726 235.836 234.976 234.116 233.266 232.946 233.246 233.416 233.306 233.186 233.156 232.606 231.206 230.326 229.446 228.756 227.825 226.935 226.985 227.385 225.505 225.795 225.915 226.035 227.105 226.105 225.205 224.365 223.465 222.605 222.775 222.115 221.685 221.515 221.455 221.945 221.975 221.765 221.565 221.525 221.515 219.945 217.595 215.155 214.775 216.945 215.825 214.415 213.015 213 [...]
+ 242.056 241.386 240.596 238.556 238.666 237.966 236.536 234.956 237.476 236.956 236.436 235.516 233.766 231.916 232.356 232.656 232.946 232.666 231.646 231.966 232.296 232.616 232.516 232.186 231.756 231.216 230.526 227.556 226.136 226.215 226.865 227.525 227.345 227.055 226.385 226.195 225.995 225.955 224.465 222.665 221.435 221.555 222.095 222.115 221.975 221.825 221.605 221.295 221.345 221.445 221.365 220.985 220.375 218.725 216.785 214.845 214.625 216.515 216.035 215.445 214.645 212 [...]
+ 241.446 240.986 240.546 239.856 237.926 236.096 234.766 235.316 236.866 236.036 235.546 235.056 233.626 233.086 232.196 231.316 230.426 231.396 233.076 232.696 232.396 232.176 231.766 230.916 230.266 229.696 229.116 228.706 229.336 228.886 228.435 227.975 227.485 227.155 226.315 225.425 224.785 224.425 224.065 223.885 222.555 221.265 221.455 221.555 221.415 221.265 221.045 220.665 220.575 220.695 220.825 221.125 217.515 218.545 220.165 219.075 216.785 214.415 214.935 215.255 213.895 213 [...]
+ 240.856 240.426 240.016 240.436 239.946 239.396 238.206 237.506 238.536 237.226 235.756 234.386 233.516 235.466 234.766 234.076 233.376 232.306 232.676 232.576 232.196 231.816 231.746 231.086 229.376 228.436 227.906 227.786 229.096 228.716 228.326 227.915 227.305 226.935 226.875 226.815 226.485 225.345 224.005 222.305 220.625 219.425 222.365 222.215 222.105 221.995 221.675 220.845 220.685 220.565 220.445 220.725 219.345 219.125 219.105 218.105 215.705 216.685 215.815 214.965 214.105 214 [...]
+ 238.286 236.826 237.176 240.586 238.756 236.806 236.326 236.686 238.646 237.376 236.446 235.526 234.936 235.296 234.666 234.026 233.366 231.296 231.216 231.216 231.206 231.596 231.466 231.086 230.536 229.966 229.396 229.506 228.986 228.346 227.916 227.526 224.015 224.465 226.145 226.655 226.575 225.485 223.825 222.075 220.935 220.565 219.315 219.015 218.915 218.805 219.805 220.985 220.765 220.485 219.895 219.275 218.435 216.875 215.285 214.155 215.855 216.495 215.195 213.885 212.755 212 [...]
+ 240.896 240.736 240.626 240.676 240.536 240.296 239.986 239.676 238.406 236.396 234.376 232.786 233.046 234.796 233.046 231.296 229.896 231.136 232.736 232.136 231.636 231.216 230.826 230.186 229.596 229.006 228.416 228.126 229.076 228.506 227.856 227.206 225.916 225.545 225.215 224.885 226.335 223.875 223.555 223.405 223.255 223.025 222.635 222.055 221.425 220.475 220.355 220.455 220.505 219.625 218.765 218.155 217.845 217.585 217.315 217.055 216.705 216.345 215.605 214.815 213.615 212 [...]
+ 240.496 240.156 240.086 240.326 240.196 240.006 239.826 239.256 238.376 237.506 236.756 235.996 234.706 234.756 234.446 234.136 233.826 233.266 232.666 232.096 231.506 230.916 230.656 229.846 228.216 226.926 226.016 227.156 228.286 228.096 227.906 227.536 224.566 223.506 222.805 221.945 226.835 223.005 221.085 221.355 222.255 222.895 222.475 221.885 221.245 220.615 219.845 219.295 219.455 219.635 219.795 218.935 218.205 217.805 217.375 216.935 216.555 216.155 215.295 214.435 213.575 212 [...]
+ 240.176 239.756 239.626 239.956 239.746 239.546 239.336 239.146 238.716 237.626 236.546 235.586 233.106 231.906 232.296 232.686 233.736 233.236 232.656 232.146 231.636 231.126 228.986 227.256 226.746 226.246 225.736 227.566 228.466 228.386 227.336 226.216 223.236 224.186 225.766 225.415 226.245 224.935 224.295 223.815 223.185 221.725 218.645 218.505 218.475 218.435 217.855 216.475 218.345 218.765 218.975 218.905 218.145 217.705 217.295 216.915 214.345 211.365 211.855 212.335 212.765 212 [...]
+ 239.396 239.236 239.316 239.596 239.496 239.366 239.246 239.006 238.316 237.726 237.096 235.996 235.456 234.716 233.926 233.426 232.986 232.486 232.136 231.836 231.436 230.916 230.836 230.516 230.076 229.636 229.196 228.926 228.006 226.786 225.676 224.466 225.326 225.466 224.936 224.406 224.025 224.435 224.015 223.315 222.625 221.315 220.805 220.675 220.225 219.185 219.305 219.725 219.345 218.975 218.595 217.495 216.015 216.025 216.035 216.635 215.925 214.395 213.855 213.365 212.875 212 [...]
+ 239.426 239.166 239.186 239.306 239.206 239.096 238.966 238.496 236.636 235.866 235.096 234.326 234.116 234.686 233.946 233.146 232.356 231.806 231.406 231.156 230.906 230.656 229.916 229.536 229.226 228.906 228.496 227.986 226.986 225.856 225.096 224.386 224.616 224.946 225.006 225.066 224.566 223.935 223.475 222.655 221.825 220.195 217.935 217.135 216.275 215.725 217.395 219.545 219.075 218.385 217.695 217.625 217.735 217.145 216.565 216.675 216.175 215.115 214.395 213.585 212.775 212 [...]
+ 237.716 235.716 236.706 239.476 239.206 238.936 238.666 235.416 231.706 232.276 233.516 234.256 234.676 233.416 233.196 232.986 232.576 231.326 230.546 230.536 230.536 230.486 228.286 226.816 226.246 225.686 225.136 226.216 226.556 225.856 225.146 224.586 224.336 223.906 223.886 223.886 224.016 223.846 222.925 221.975 221.025 220.395 220.425 220.065 219.695 219.345 219.235 219.345 218.525 217.695 216.915 216.915 217.555 217.255 216.805 216.205 215.395 214.305 213.585 212.875 212.145 211 [...]
+ 238.716 238.456 238.966 239.516 239.266 238.896 238.486 237.616 234.526 235.646 235.926 235.516 233.796 232.386 232.256 232.156 232.056 228.676 229.206 229.796 229.856 229.906 229.876 229.616 229.176 228.746 228.296 226.756 226.066 225.466 224.866 224.326 223.426 223.026 222.776 222.526 222.656 222.706 222.486 221.405 219.635 218.955 220.165 219.895 219.635 219.375 219.255 219.065 218.525 217.975 217.305 217.155 216.975 216.275 215.585 214.965 214.155 213.445 212.905 212.355 211.805 211 [...]
+ 238.846 238.656 238.666 238.576 238.326 238.096 237.876 237.166 236.316 235.846 235.366 234.896 233.496 232.196 231.986 231.766 231.436 231.076 230.616 230.256 229.886 229.526 229.406 229.146 228.726 228.306 227.826 226.736 226.036 225.366 224.586 223.766 223.006 222.706 222.426 222.196 221.086 217.986 218.476 219.146 219.815 220.125 219.825 219.715 219.595 219.355 218.805 218.345 217.795 217.225 216.655 216.495 216.355 215.635 214.865 214.095 213.565 212.925 212.445 211.975 211.665 211 [...]
+ 238.586 238.376 238.166 237.746 237.516 237.286 237.066 236.556 235.946 235.166 234.376 233.856 232.736 232.026 231.066 230.576 230.246 231.046 230.676 230.336 229.996 229.646 229.466 228.916 228.286 227.866 227.406 226.446 225.576 224.806 224.036 223.416 222.996 222.746 222.466 222.176 221.776 221.126 220.806 220.446 220.086 219.785 219.595 219.475 219.365 219.105 218.685 217.875 217.235 216.605 215.965 215.955 215.975 215.085 214.205 213.335 213.315 213.215 212.745 212.275 211.845 210 [...]
+ 238.296 237.996 237.496 237.006 236.016 234.676 233.556 234.706 235.166 233.226 231.606 230.816 231.326 232.606 231.926 230.916 229.916 230.596 230.616 229.986 229.606 229.226 229.556 229.016 228.336 227.646 226.826 225.716 224.906 224.286 223.656 223.086 222.686 222.486 222.316 222.146 221.726 220.976 220.726 220.486 220.216 219.856 219.525 219.115 218.705 218.295 217.975 217.655 217.045 216.425 215.815 215.815 215.435 215.085 214.535 213.835 214.025 213.685 212.835 211.975 211.125 210 [...]
+ 237.746 237.446 237.126 237.076 236.826 236.576 236.256 235.866 235.216 234.546 233.826 233.076 233.116 232.996 232.486 231.976 231.476 230.286 229.826 229.126 228.436 228.556 228.186 227.656 227.056 226.396 225.306 222.026 222.086 222.496 222.916 223.116 222.496 222.246 222.076 221.906 221.516 220.886 219.816 218.756 217.696 217.996 219.346 218.875 218.435 218.015 215.495 213.015 213.855 214.685 215.525 215.655 215.125 213.175 211.225 210.285 213.055 212.885 212.015 211.165 210.445 207 [...]
+ 237.466 237.196 235.826 235.416 235.966 236.356 236.006 235.676 235.076 234.096 233.186 232.436 232.466 232.446 232.226 232.006 231.666 227.906 226.216 226.646 227.076 227.426 226.946 226.606 225.956 225.306 224.646 223.946 223.716 223.566 223.406 223.076 222.296 222.056 221.876 221.696 221.346 220.636 219.456 219.296 219.136 218.336 217.186 217.146 217.105 218.155 216.145 215.125 215.035 214.935 215.685 215.575 215.095 214.465 213.835 213.165 212.685 212.205 211.705 211.175 210.465 209 [...]
+ 237.206 237.096 237.166 236.976 236.246 235.526 234.796 232.846 232.686 231.936 231.186 230.426 230.446 231.146 231.516 231.286 231.076 231.196 230.206 228.976 227.766 226.686 226.486 226.256 225.976 225.706 225.146 223.806 223.516 223.326 223.136 222.796 222.326 222.036 221.756 221.476 221.026 219.976 218.416 216.856 215.906 218.816 219.986 219.466 218.896 218.305 216.045 214.965 214.665 214.545 215.395 215.155 214.485 213.705 212.915 212.135 211.795 211.365 210.915 210.485 210.035 209 [...]
+ 237.276 237.206 236.736 235.756 234.756 233.786 233.056 230.186 230.086 230.006 232.766 233.266 232.226 231.326 231.196 230.856 230.476 230.826 230.056 228.916 227.766 226.706 223.836 223.066 222.536 222.006 221.516 223.516 222.256 220.796 219.756 219.346 221.406 222.666 222.086 221.806 221.126 219.866 220.046 220.186 220.296 219.866 219.436 218.926 218.306 217.676 217.305 216.375 216.155 215.725 215.175 214.475 213.335 211.565 209.885 209.865 211.495 211.225 210.645 210.065 209.475 208 [...]
+ 236.536 236.366 235.616 234.986 234.876 234.336 233.796 233.636 232.826 232.286 232.316 232.366 231.486 231.146 231.096 231.046 230.756 230.546 229.736 228.596 227.456 226.436 226.046 225.186 224.666 224.136 223.666 223.306 223.696 223.666 223.626 223.286 223.556 221.426 220.496 220.106 219.686 219.796 219.806 219.866 219.936 219.636 218.736 218.086 217.446 216.796 216.526 216.235 215.665 215.105 214.545 214.165 213.215 211.595 210.185 210.225 212.085 210.835 210.375 209.685 209.035 208 [...]
+ 235.706 235.256 233.626 234.096 235.176 234.846 234.516 233.936 233.446 232.846 232.246 231.646 230.666 230.456 230.546 230.626 230.686 230.546 229.576 228.406 227.176 226.036 225.666 224.316 222.906 222.736 222.306 223.166 223.756 224.346 224.266 223.806 222.906 220.766 218.946 217.596 217.226 219.316 218.946 218.566 218.586 218.446 217.926 217.556 217.356 217.156 216.366 215.756 215.255 214.765 214.275 214.705 214.655 213.875 212.825 211.765 210.685 209.425 209.005 208.755 208.705 208 [...]
+ 233.126 232.376 235.616 235.076 234.556 234.046 233.616 233.406 232.956 232.326 231.696 231.086 230.736 230.676 230.666 230.586 230.486 230.426 229.206 227.806 226.436 225.336 225.086 223.776 222.436 221.526 221.446 224.566 224.286 224.006 223.766 223.276 222.756 222.076 221.436 220.826 219.996 218.806 217.216 216.226 216.066 217.516 217.446 217.266 216.986 216.496 214.076 212.976 213.466 213.955 214.445 214.035 213.895 213.325 212.745 212.105 209.455 208.905 208.625 208.375 208.335 208 [...]
+ 236.546 236.166 235.576 234.866 234.506 234.006 233.506 233.096 231.606 229.766 227.966 227.256 227.336 228.246 229.366 230.316 230.216 230.046 228.786 227.266 225.716 224.536 224.316 223.846 224.856 225.126 224.976 224.026 223.646 223.336 223.026 222.806 222.206 220.386 220.066 219.736 219.276 218.996 218.796 218.596 218.396 217.316 216.476 216.176 215.686 215.186 215.106 215.226 215.176 215.126 215.085 212.485 213.615 212.835 212.065 211.265 210.025 209.375 208.665 207.965 207.315 206 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
diff --git a/test/map_samples/ascii/ascii2.asc b/test/map_samples/ascii/ascii2.asc
new file mode 100644
index 0000000..5fed2b5
--- /dev/null
+++ b/test/map_samples/ascii/ascii2.asc
@@ -0,0 +1,606 @@
+ncols 600
+nrows 600
+xllcenter 1646700.50000000
+yllcenter 4739680.50000000
+cellsize 1.00000000
+NODATA_value -9999.00000000
+ 171.689 171.689 171.349 170.439 169.579 168.959 169.539 170.199 169.029 168.339 168.019 169.629 168.529 168.499 169.499 170.869 171.249 170.289 167.729 165.159 164.189 165.969 168.509 166.689 164.869 165.639 168.269 169.039 169.819 170.739 170.849 170.429 169.989 169.539 169.089 169.549 170.278 170.168 170.198 170.828 170.288 169.488 168.018 166.448 166.248 170.348 171.418 169.608 168.718 170.538 170.968 172.448 172.708 172.518 172.188 171.528 173.398 173.638 174.088 174.708 175.578 176 [...]
+ 171.929 172.009 171.509 170.199 168.539 168.169 169.149 171.089 169.589 169.289 169.059 169.169 168.639 169.519 170.949 171.759 169.229 167.689 168.879 170.069 170.019 168.619 167.009 165.519 164.029 166.389 168.979 169.749 169.789 169.839 169.989 169.899 169.499 169.329 169.749 170.199 170.018 170.388 171.078 171.848 171.228 170.428 171.028 171.878 172.708 172.528 172.368 172.128 171.238 170.498 170.558 172.528 173.058 173.738 174.128 173.928 174.028 174.408 174.638 174.908 175.688 176 [...]
+ 171.789 171.399 170.689 170.699 170.969 171.239 170.159 169.479 170.659 170.519 168.919 169.959 170.419 170.779 171.509 171.359 170.919 171.909 171.339 170.729 170.189 171.079 171.049 168.649 169.579 170.159 170.069 170.059 170.009 169.859 169.729 169.649 169.999 170.539 170.879 170.549 170.088 170.658 171.478 172.298 171.818 171.258 171.488 171.828 172.408 172.308 172.238 170.228 169.018 168.928 170.068 171.118 173.258 174.678 174.758 174.798 173.948 172.578 174.638 175.008 175.598 175 [...]
+ 171.769 171.939 171.849 171.659 171.439 171.499 168.849 166.509 167.939 169.669 171.239 171.659 171.859 171.609 171.359 170.579 168.379 166.949 166.769 167.079 169.769 173.249 173.349 171.519 169.029 168.989 169.999 170.139 169.959 169.829 169.729 169.619 169.679 169.919 170.159 170.539 171.378 172.088 172.218 172.348 171.928 171.538 171.658 171.898 171.998 169.088 168.398 170.768 173.128 173.608 174.178 174.908 175.048 175.178 174.918 173.988 172.868 172.368 172.758 173.068 174.138 175 [...]
+ 172.179 172.259 172.199 172.169 172.069 171.829 171.799 170.999 170.459 170.009 170.649 171.229 171.759 171.559 171.349 171.019 170.429 170.819 171.479 172.209 173.049 174.009 174.119 170.559 166.959 167.509 170.189 170.709 170.379 170.169 169.569 168.679 168.669 170.099 172.019 172.849 172.828 170.728 168.108 165.908 166.488 167.878 168.378 170.308 172.218 173.078 173.508 174.008 174.508 174.948 175.038 175.188 175.248 175.308 174.958 174.528 174.008 172.468 171.258 171.658 174.308 175 [...]
+ 171.979 172.029 172.029 172.329 172.349 172.379 172.189 171.059 169.879 169.759 170.359 170.969 171.859 172.069 171.849 171.809 172.179 172.499 173.069 173.649 173.989 174.079 173.829 173.059 172.649 173.209 174.209 173.549 171.339 169.119 168.049 168.739 169.589 171.039 172.849 173.219 173.338 171.318 170.208 171.398 172.558 171.678 171.498 171.348 172.288 173.948 175.538 175.398 175.258 175.248 175.728 175.918 175.888 175.398 175.168 175.208 175.388 176.008 176.648 175.868 173.748 175 [...]
+ 171.739 170.499 171.709 172.199 172.789 173.319 173.209 173.069 173.019 171.909 171.129 171.759 171.959 171.789 171.779 172.639 172.619 172.539 173.049 173.579 171.889 167.729 168.409 171.579 174.739 175.609 174.949 173.199 170.619 168.929 167.339 166.609 167.929 170.799 172.729 172.769 172.868 171.978 172.008 172.118 173.528 173.168 171.218 170.718 171.188 172.398 176.078 175.878 175.768 175.598 175.578 175.908 175.418 174.928 174.848 174.978 175.308 176.058 176.838 176.268 175.618 174 [...]
+ 171.549 170.319 169.389 170.039 172.839 173.409 173.289 172.569 171.909 171.249 171.569 172.379 171.659 169.989 170.759 172.159 172.699 172.809 173.909 174.459 174.829 175.029 175.039 175.389 175.799 175.569 175.429 174.609 173.139 171.849 172.339 173.179 172.949 172.549 172.149 172.728 174.198 174.718 174.658 174.568 174.248 173.778 174.418 174.738 174.948 175.288 176.198 176.248 176.288 176.178 175.828 175.568 175.508 175.378 175.508 175.948 176.358 176.768 177.038 175.838 174.308 173 [...]
+ 172.309 172.319 172.079 172.309 172.759 173.189 173.459 172.389 172.039 172.809 173.639 173.189 172.509 172.939 173.439 173.589 173.049 172.249 173.789 174.849 175.379 175.409 175.429 175.239 175.039 175.329 175.889 176.069 175.469 174.879 174.829 174.979 174.459 173.919 173.369 174.728 174.968 174.958 174.928 175.008 174.538 173.898 174.548 175.138 175.688 175.868 175.848 175.808 175.858 175.718 175.488 175.308 175.448 175.938 176.078 176.108 176.478 176.728 176.908 176.608 176.038 175 [...]
+ 168.969 169.059 172.019 172.229 172.179 172.789 173.319 173.819 173.879 174.119 173.609 170.449 169.979 170.949 173.119 174.429 173.939 173.119 171.769 173.539 174.769 175.509 175.389 174.369 173.349 174.069 175.429 175.549 174.949 174.349 174.569 175.599 173.309 170.219 169.099 171.388 174.858 174.968 175.138 175.238 173.758 172.448 173.358 174.278 174.908 175.278 175.328 174.218 173.948 173.328 172.038 172.898 175.378 176.698 176.588 176.378 176.238 176.408 176.548 175.668 173.928 173 [...]
+ 170.989 172.219 170.929 171.399 171.979 173.369 173.839 174.169 174.019 172.649 170.849 173.409 173.159 173.759 174.349 174.949 174.799 173.989 172.679 171.969 173.419 175.109 175.129 174.779 171.379 174.249 174.979 174.759 174.199 174.549 175.419 176.019 175.949 175.839 175.739 175.078 174.408 174.558 174.778 174.828 173.198 172.968 173.408 174.378 175.328 175.608 175.718 175.778 175.828 175.868 176.188 176.428 176.368 176.308 176.128 175.718 175.568 175.808 176.068 174.808 174.478 175 [...]
+ 172.629 173.299 172.859 173.019 171.729 170.799 172.049 174.059 174.859 175.679 175.909 173.039 171.099 171.189 173.169 174.359 174.629 173.909 171.449 168.989 170.909 173.279 173.269 173.539 173.809 171.559 170.589 171.659 172.769 175.709 175.679 175.749 175.689 175.619 175.549 175.138 175.548 175.618 175.568 175.168 172.868 170.868 170.678 170.588 170.718 173.698 176.318 176.278 176.248 176.288 176.338 176.398 176.798 177.188 177.108 176.538 175.618 174.298 172.888 173.118 173.188 173 [...]
+ 174.349 172.059 171.899 171.329 170.759 171.669 174.179 174.689 175.579 176.469 176.329 173.809 172.109 172.519 173.289 172.619 172.589 174.329 174.539 174.119 173.979 173.439 173.409 173.699 173.989 175.099 176.479 176.629 176.249 175.879 175.669 175.299 175.229 175.339 175.629 176.148 176.448 174.778 173.068 174.018 175.348 176.918 176.798 176.668 176.658 176.848 177.188 177.038 176.898 176.818 176.898 177.108 177.578 177.938 176.678 174.058 173.148 173.878 172.888 174.168 175.988 177 [...]
+ 170.819 173.679 172.599 173.129 173.659 174.239 174.769 175.109 175.669 176.429 176.749 176.139 175.079 174.229 173.689 173.009 173.119 172.819 172.099 173.769 174.029 173.859 173.839 173.789 174.049 175.209 176.629 176.739 176.569 176.479 175.919 175.179 172.989 172.059 173.299 174.848 176.218 175.978 175.758 176.048 176.818 176.828 176.678 176.518 176.518 176.818 177.028 176.988 176.968 176.058 173.828 172.988 173.268 175.098 176.048 176.988 177.658 176.728 175.438 175.858 176.598 177 [...]
+ 175.009 174.449 173.919 173.969 174.149 174.469 174.799 174.709 174.109 173.539 174.509 176.009 174.979 173.489 173.049 174.329 175.459 175.549 175.159 174.969 173.669 172.429 174.999 174.829 174.659 175.749 176.399 176.479 176.499 176.819 176.279 175.629 175.419 175.049 175.109 176.118 175.788 175.998 176.188 176.358 176.468 176.698 174.328 171.958 171.588 174.598 176.318 174.678 174.678 175.918 176.378 177.438 177.378 177.218 176.828 176.828 176.888 175.008 174.138 174.858 177.368 178 [...]
+ 172.829 173.239 174.319 174.389 174.419 174.759 175.889 176.039 175.479 176.639 177.809 176.969 176.309 175.949 175.579 175.639 176.099 175.599 174.319 173.449 175.499 174.809 174.939 175.299 175.179 175.269 175.389 175.759 176.189 176.619 176.619 176.669 176.779 176.519 176.249 175.838 175.798 175.898 175.998 176.328 177.048 177.578 177.718 177.748 177.578 176.938 176.388 175.788 175.178 174.208 174.218 175.728 176.358 177.298 176.028 173.838 174.668 176.238 177.518 177.878 178.208 178 [...]
+ 171.979 172.929 174.329 174.429 174.519 174.939 176.119 177.129 177.549 177.999 178.079 177.519 177.149 176.869 176.509 176.519 176.859 176.339 175.069 173.799 174.449 175.429 175.619 175.469 175.319 174.989 174.479 175.219 176.159 176.619 176.769 176.609 174.249 171.889 171.859 173.668 176.318 176.628 176.928 177.258 177.418 177.668 178.218 178.778 178.828 178.268 177.338 175.638 174.398 174.318 174.968 173.878 173.478 173.468 174.258 174.738 176.208 177.528 178.198 178.458 178.628 178 [...]
+ 174.579 174.819 174.769 175.029 175.109 174.949 176.599 177.139 177.479 177.839 177.909 177.549 177.249 177.179 177.119 177.059 176.959 176.269 175.319 174.889 175.409 175.959 174.529 175.869 175.759 173.239 171.259 172.359 174.579 176.789 173.229 173.819 175.069 176.319 176.609 176.588 176.618 176.998 177.458 176.968 173.628 173.698 175.798 178.658 178.858 178.628 177.928 175.908 173.898 174.448 173.938 172.948 172.908 172.878 174.298 175.948 177.158 177.908 178.598 179.038 179.318 179 [...]
+ 174.109 175.039 175.049 175.059 175.259 175.579 176.129 176.639 176.959 177.279 177.169 176.569 176.389 176.749 176.819 176.759 176.749 176.579 176.259 176.109 176.169 176.239 174.759 172.999 171.399 174.239 176.309 176.819 177.039 177.249 175.909 174.599 176.199 176.329 176.449 176.398 176.308 176.848 177.448 178.188 178.898 178.948 177.438 175.928 176.658 178.958 178.068 176.058 173.948 174.228 176.138 175.878 175.218 174.448 174.668 176.488 177.588 178.278 178.878 179.368 179.758 179 [...]
+ 174.519 174.859 175.139 175.089 175.039 175.419 174.909 174.399 174.339 175.939 176.419 175.749 175.639 175.989 176.379 176.569 176.639 176.699 176.759 176.809 176.799 176.749 176.829 176.939 176.939 176.299 175.649 176.719 177.909 178.619 177.609 176.579 176.639 176.579 175.909 173.328 173.438 174.648 176.448 177.998 178.878 179.498 179.598 179.698 179.498 178.828 177.618 175.718 173.838 174.488 175.038 174.598 173.888 173.178 174.698 176.928 177.968 178.498 179.028 179.498 179.978 180 [...]
+ 173.579 173.789 174.039 174.319 174.589 174.999 176.199 176.459 174.839 173.249 174.029 175.299 175.949 176.119 176.299 176.339 176.269 176.589 177.099 177.299 177.279 177.359 177.029 176.589 176.509 174.019 174.199 174.589 176.859 179.219 174.919 172.469 173.559 175.389 176.969 177.628 178.238 178.178 178.108 178.338 178.738 178.958 179.008 179.058 178.838 178.398 177.388 175.588 173.788 174.698 177.078 177.408 175.908 177.678 178.348 178.388 178.628 179.018 179.408 179.458 179.658 179 [...]
+ 173.359 173.299 173.539 174.519 174.999 175.659 176.579 177.249 177.489 177.729 177.349 176.399 176.259 176.779 177.149 175.479 173.239 173.719 175.739 177.759 178.129 178.129 177.809 176.029 174.299 177.669 178.179 178.859 179.349 179.719 177.989 176.219 177.159 178.109 179.289 179.368 179.398 179.198 178.798 178.608 178.618 178.298 178.548 178.598 177.398 174.728 174.708 176.298 177.898 178.748 179.138 179.088 178.428 177.778 177.758 178.728 179.498 179.518 179.408 179.588 179.598 178 [...]
+ 174.539 173.639 173.389 174.509 175.619 176.399 176.859 177.299 177.539 177.789 176.359 174.269 173.489 174.589 175.699 176.279 176.649 177.169 177.939 178.719 178.769 178.609 178.539 178.439 178.339 178.169 177.989 178.699 179.419 179.979 178.999 178.289 179.069 179.439 179.759 180.038 180.318 179.878 179.218 177.548 176.468 177.188 177.108 177.408 178.328 178.278 178.538 179.118 179.708 180.038 179.698 179.518 179.828 180.388 180.648 180.338 179.978 179.648 179.238 179.518 179.768 179 [...]
+ 173.009 175.879 175.559 176.069 176.589 176.929 177.099 176.559 175.129 174.399 175.799 177.869 177.959 177.629 177.289 176.749 176.309 176.899 177.829 178.709 178.689 178.519 178.549 178.599 178.649 178.379 178.119 178.689 179.249 179.579 176.709 175.909 177.869 179.259 179.499 180.158 180.218 178.628 177.748 176.018 174.278 174.038 175.268 176.688 178.018 179.178 179.498 180.048 180.558 180.538 180.168 180.408 181.088 181.728 181.548 181.138 180.668 180.168 179.678 180.168 180.658 180 [...]
+ 176.589 175.589 175.039 175.319 176.399 177.149 177.179 176.579 175.149 174.359 176.259 177.709 177.809 177.739 177.609 175.909 174.879 175.659 177.299 179.379 179.199 178.389 178.529 178.719 178.859 178.609 178.519 179.069 179.499 179.519 178.669 177.799 177.689 178.069 178.379 179.428 179.488 177.038 174.708 173.498 173.468 174.248 174.598 174.578 175.028 177.918 179.568 180.178 180.718 181.048 180.678 180.918 181.548 182.188 181.988 181.588 181.188 180.848 180.508 180.728 181.178 180 [...]
+ 177.049 177.099 177.249 177.589 177.689 177.789 177.869 177.239 176.899 176.619 177.509 178.029 178.179 178.119 178.039 177.799 177.529 178.259 179.269 180.289 179.319 178.229 178.369 178.569 178.759 178.799 178.809 178.979 179.159 179.289 179.139 178.569 176.849 174.989 173.859 175.778 176.968 175.588 174.198 173.528 173.498 174.318 175.668 175.528 176.448 178.228 179.198 179.568 180.048 180.488 180.918 181.288 181.748 182.208 182.018 181.888 181.678 181.508 181.418 179.318 177.678 179 [...]
+ 177.519 177.269 177.289 177.729 178.169 178.589 178.709 178.169 177.249 177.409 178.309 178.659 178.469 178.399 178.339 178.259 178.169 178.919 179.799 180.669 179.659 178.349 176.929 175.499 177.419 178.289 178.239 178.369 178.449 178.519 177.839 176.549 175.339 174.119 173.749 173.688 173.668 174.468 175.268 175.598 176.108 176.448 176.658 177.028 177.788 178.558 179.458 179.598 179.748 179.008 179.298 180.648 181.818 182.138 182.298 182.168 182.178 182.208 182.318 181.788 181.248 180 [...]
+ 176.199 178.699 178.669 178.509 178.359 178.709 179.149 178.939 178.739 178.749 178.649 178.489 178.329 178.279 178.239 177.479 176.389 177.379 178.659 179.559 178.719 178.279 176.899 177.479 176.739 177.869 177.849 176.419 174.989 173.979 173.949 173.899 173.839 173.789 173.729 175.228 176.038 175.908 176.048 177.278 177.828 177.798 177.898 178.028 178.488 179.178 179.498 179.558 179.708 179.148 178.368 177.868 178.658 180.318 180.648 182.038 182.868 183.318 183.718 183.168 182.608 183 [...]
+ 176.179 177.829 178.639 178.579 178.349 178.629 179.309 179.189 178.409 177.639 177.189 176.639 176.439 176.379 176.319 175.379 174.659 175.279 176.509 177.659 176.309 178.009 176.649 175.279 174.189 174.169 174.669 175.399 174.929 173.959 176.159 177.489 176.659 175.739 175.809 176.308 176.738 178.438 178.598 178.768 178.588 178.488 178.588 178.708 179.088 179.728 179.118 178.378 180.278 180.568 180.958 181.378 181.678 181.968 181.608 182.578 183.318 183.658 183.978 184.018 183.558 183 [...]
+ 177.219 178.049 177.679 177.549 177.419 178.079 178.869 179.209 179.369 179.119 177.509 175.349 175.509 175.459 175.399 174.719 174.629 174.559 174.489 175.039 174.349 174.279 174.239 174.199 174.169 174.149 174.119 174.239 175.199 175.699 175.499 175.669 177.589 177.969 178.029 179.088 179.188 179.148 179.108 179.278 179.638 179.508 179.448 179.388 179.798 180.448 180.668 180.168 179.668 180.458 182.018 183.158 183.318 183.468 183.318 182.978 183.258 183.598 184.088 184.208 184.258 184 [...]
+ 177.389 177.749 177.249 176.359 175.639 176.379 177.369 177.659 176.559 175.149 174.859 175.209 175.769 176.909 177.139 177.529 176.539 176.369 177.319 178.179 176.899 176.079 175.639 175.979 176.259 176.519 177.139 176.699 175.869 175.869 177.699 177.909 178.429 178.949 179.239 179.488 179.638 179.628 179.608 179.988 181.298 181.028 181.258 181.588 182.158 181.078 180.858 181.058 181.288 182.158 183.068 181.798 179.778 178.698 179.028 179.368 181.218 183.058 184.498 184.678 184.858 184 [...]
+ 177.329 175.839 175.149 175.109 175.059 175.009 175.199 175.409 175.329 175.049 175.749 177.779 178.139 177.569 176.999 176.279 176.269 176.239 176.219 176.829 179.889 180.609 180.409 178.559 177.699 179.969 179.889 179.189 178.479 178.259 178.089 178.169 178.479 178.799 179.058 179.168 179.248 179.548 180.168 180.818 181.798 182.428 182.608 182.788 180.718 178.438 177.828 177.248 178.658 179.838 182.458 183.338 183.718 184.048 183.558 183.058 183.568 183.498 183.578 184.548 185.008 185 [...]
+ 175.189 175.149 175.539 175.669 175.809 176.279 176.959 177.119 177.069 177.069 176.529 175.769 176.549 177.759 178.979 179.639 179.989 180.189 180.379 180.129 180.389 180.549 180.469 180.419 180.389 180.459 180.469 180.319 180.159 180.099 180.449 180.149 179.369 178.799 179.378 180.098 180.418 180.998 181.138 181.538 182.158 181.128 179.288 177.768 179.598 182.538 181.198 182.058 181.198 180.638 181.238 182.048 182.668 183.288 183.628 183.548 181.848 180.148 179.588 182.548 185.168 185 [...]
+ 175.449 175.089 175.829 177.039 177.419 178.139 176.679 176.399 176.489 176.849 177.539 178.059 178.649 179.539 180.429 180.599 180.739 180.319 179.849 179.489 179.799 180.119 180.409 180.709 181.029 181.209 181.229 181.189 181.199 181.369 181.699 181.799 181.649 181.909 182.068 181.968 181.508 181.498 181.488 181.668 181.968 181.958 182.968 183.538 183.098 182.298 180.948 180.208 179.478 179.828 181.578 182.238 182.708 183.068 180.908 179.438 181.508 183.588 184.278 183.028 182.408 180 [...]
+ 179.029 178.709 178.509 178.399 178.489 179.319 179.749 178.889 177.669 176.699 177.889 180.539 180.839 181.019 181.389 181.319 181.109 180.539 179.139 178.099 178.639 180.199 180.229 180.459 180.789 181.029 181.199 181.279 181.669 182.069 182.389 181.589 179.549 179.369 180.658 182.038 181.648 181.838 182.028 182.228 182.218 182.618 183.198 183.778 181.538 180.448 181.178 182.198 181.828 182.118 182.488 182.938 183.398 183.678 182.908 183.188 183.868 184.178 183.908 183.848 184.998 184 [...]
+ 179.509 179.829 180.239 180.649 180.369 180.509 180.819 181.169 181.559 181.889 181.459 179.909 179.289 179.349 180.989 181.039 181.189 179.519 177.849 177.099 178.009 180.629 180.799 180.599 180.519 180.739 181.219 181.669 182.129 182.319 182.669 182.989 182.929 182.599 183.078 182.458 182.308 182.358 182.148 182.108 182.168 182.438 182.898 183.418 183.278 183.168 181.868 180.788 182.408 182.748 182.998 183.328 183.548 183.588 183.068 183.508 183.048 182.788 182.748 184.148 186.108 185 [...]
+ 178.399 177.099 179.589 180.129 180.679 180.959 181.089 181.049 180.959 181.179 181.339 181.569 181.909 181.809 181.399 181.419 181.249 181.339 181.449 181.579 181.339 180.749 180.849 180.629 180.429 180.969 181.389 181.479 181.559 181.799 182.579 183.059 183.259 183.449 183.248 182.698 182.328 182.108 181.908 181.898 181.918 182.178 182.528 182.878 183.048 183.168 182.508 181.498 180.498 181.958 183.988 182.688 181.528 180.878 182.108 184.348 184.778 185.228 185.778 186.038 186.238 186 [...]
+ 178.379 179.039 179.309 179.959 180.619 181.069 181.429 181.539 181.519 181.459 181.339 181.189 181.439 181.809 182.149 181.679 181.219 181.219 181.219 181.339 181.609 181.729 181.319 180.899 180.729 181.289 181.009 179.399 178.819 178.899 181.639 183.139 183.329 183.189 182.828 182.418 182.298 182.188 182.088 182.128 182.288 182.378 182.448 182.668 182.808 182.868 181.608 180.208 179.898 181.668 184.418 184.668 184.748 184.788 184.318 184.098 184.688 185.288 185.828 186.048 186.218 186 [...]
+ 176.979 178.589 179.679 180.559 182.309 182.359 182.139 182.039 182.069 182.099 181.959 181.709 181.709 181.719 181.889 181.629 181.599 182.079 182.309 182.289 182.239 181.869 181.779 181.559 181.599 181.819 181.679 181.599 181.629 182.149 182.919 182.839 182.469 182.149 182.168 182.628 182.698 182.678 182.668 182.768 182.578 182.788 183.048 183.128 183.138 182.848 181.758 180.588 181.108 182.058 184.448 184.728 184.938 184.978 184.848 184.828 185.108 185.308 185.568 185.978 186.138 186 [...]
+ 180.099 181.219 181.789 182.249 182.669 182.779 182.709 182.529 182.369 182.269 181.999 181.649 180.129 179.019 180.499 182.499 182.169 182.509 182.989 183.219 182.719 182.339 180.289 178.899 178.979 180.879 181.029 181.579 182.259 182.509 182.709 182.559 182.769 182.989 181.498 180.068 181.398 183.378 183.308 183.008 182.718 182.988 183.358 183.728 183.438 183.008 182.998 182.668 182.288 182.678 183.998 184.268 184.628 184.478 182.388 182.698 184.358 185.208 185.448 185.878 186.038 185 [...]
+ 177.739 180.409 181.399 181.949 182.499 182.589 182.619 182.469 182.379 182.329 182.509 181.739 181.479 182.159 182.789 182.959 183.109 183.329 183.549 183.669 183.499 183.239 182.819 182.399 181.939 181.549 180.779 180.159 180.459 182.129 182.479 182.639 182.959 183.289 183.638 184.128 184.178 183.908 183.638 183.408 183.188 183.478 183.878 184.268 183.768 183.158 183.178 183.298 183.328 181.638 181.518 183.308 184.568 184.388 182.328 181.508 183.048 184.588 185.578 185.948 186.268 184 [...]
+ 180.399 179.849 180.339 181.109 182.409 182.449 182.349 182.469 182.419 182.379 182.659 182.829 181.519 180.199 180.269 181.999 183.899 183.739 183.629 183.419 182.309 181.189 181.539 182.529 181.199 179.719 179.519 179.459 179.409 180.709 182.499 182.609 182.869 183.129 183.718 184.508 184.688 184.648 184.598 184.298 183.818 183.958 184.188 184.558 184.028 183.478 182.448 181.398 180.658 182.368 183.998 184.278 184.558 184.778 184.798 184.908 185.258 185.608 185.718 185.438 185.708 185 [...]
+ 180.499 180.889 181.229 181.619 182.069 182.019 181.899 182.079 182.259 182.439 182.999 183.429 182.159 181.829 181.959 183.669 184.109 184.009 183.879 183.539 182.809 182.039 180.919 179.799 180.529 182.789 182.969 183.199 183.429 182.089 183.459 183.489 183.599 183.699 184.128 184.358 184.468 184.478 184.458 182.888 181.688 181.238 180.748 180.748 183.298 184.038 184.308 184.588 184.668 184.498 184.428 184.488 184.518 184.688 185.218 185.018 183.728 182.948 182.588 184.418 185.608 185 [...]
+ 180.619 180.839 181.099 181.429 181.759 181.739 181.699 180.459 180.179 180.889 183.059 183.259 182.199 181.139 181.469 183.159 183.949 183.869 183.779 183.599 183.129 182.769 182.659 181.419 181.279 182.549 182.719 182.869 183.019 181.559 180.969 182.319 183.309 183.249 183.448 183.908 183.998 183.968 183.738 184.178 184.468 184.828 185.168 185.498 185.198 184.868 184.928 184.978 184.808 183.258 183.458 184.748 184.788 184.758 185.208 185.658 185.838 186.018 185.278 183.398 182.388 182 [...]
+ 180.959 181.119 181.269 181.419 181.619 181.619 181.639 181.869 182.139 182.399 182.569 182.529 181.959 181.989 182.529 183.239 183.519 183.519 183.519 183.339 182.729 182.609 183.189 183.759 183.619 183.039 182.869 182.959 183.009 183.009 183.219 183.159 182.939 182.719 181.688 183.238 183.188 182.688 182.198 183.248 184.078 184.568 185.068 185.498 185.248 185.058 185.108 185.118 185.148 185.348 185.238 183.598 182.248 183.208 184.088 185.638 185.848 186.008 185.368 185.498 185.078 184 [...]
+ 181.039 181.159 181.169 181.209 181.319 181.539 181.749 181.959 182.139 182.369 182.819 182.859 181.829 182.109 182.939 183.959 183.639 181.749 180.279 179.369 179.269 182.019 183.029 184.039 184.179 183.469 183.179 183.199 183.249 183.569 183.999 183.889 183.779 183.579 182.768 182.468 182.928 182.818 182.378 183.568 183.688 184.258 184.788 185.288 185.118 185.088 185.098 185.108 185.208 185.448 185.398 185.218 184.388 183.868 183.948 185.188 185.448 185.738 185.928 185.998 185.968 185 [...]
+ 181.389 181.229 181.399 181.449 181.509 181.849 182.259 181.869 181.499 181.739 182.399 183.059 183.369 183.589 183.869 184.429 183.909 181.939 180.399 181.669 183.219 183.529 184.009 184.179 184.049 183.669 183.019 183.619 183.919 183.789 183.499 183.379 183.549 183.759 184.018 184.418 184.208 183.898 183.638 181.638 182.068 181.868 183.468 185.168 185.118 185.008 185.168 185.268 185.398 185.698 185.618 184.078 183.158 182.688 182.928 183.018 182.648 182.278 182.268 182.508 183.818 185 [...]
+ 179.449 181.639 181.879 181.929 182.359 182.449 182.529 182.369 182.009 181.799 182.379 182.729 183.049 183.359 183.609 183.709 183.189 182.459 181.729 182.509 183.269 183.529 183.339 183.149 183.179 183.319 182.389 181.539 181.289 182.919 183.699 183.909 184.069 184.099 184.448 184.808 184.638 184.428 184.188 183.338 182.738 183.508 184.288 185.308 184.978 184.698 184.748 184.598 184.608 185.158 185.348 185.148 184.968 185.158 185.468 185.158 184.538 185.418 184.748 183.218 182.848 183 [...]
+ 180.249 178.999 180.199 181.399 182.519 182.569 182.589 182.399 182.229 182.119 182.239 182.449 182.799 183.149 183.409 183.669 183.599 183.109 182.889 181.759 179.749 181.169 183.859 183.779 183.759 183.589 182.569 181.179 179.969 182.219 184.219 184.319 184.419 184.529 184.768 184.988 184.728 184.358 183.978 183.838 184.238 183.938 184.058 184.478 184.268 184.208 182.968 181.728 181.598 184.068 184.558 184.728 184.808 185.008 185.448 185.158 183.968 182.778 182.868 183.328 183.278 183 [...]
+ 181.189 179.819 180.369 181.609 182.739 182.799 182.819 182.549 182.279 182.139 182.309 182.459 182.479 182.749 183.099 183.509 183.179 181.659 180.149 180.699 182.889 183.509 183.789 184.069 184.069 183.839 182.689 182.229 182.889 183.719 183.779 183.959 184.249 184.539 184.748 184.848 184.488 184.138 183.808 181.798 180.628 180.488 180.348 180.368 181.038 181.938 183.488 185.068 185.778 184.278 183.308 183.758 184.658 185.228 185.458 185.148 184.008 182.868 182.858 183.618 183.938 185 [...]
+ 183.349 183.309 181.989 180.669 180.929 182.459 182.309 182.429 182.319 182.189 182.439 182.509 182.589 182.619 182.029 182.309 183.519 183.399 183.079 183.449 184.069 184.359 184.429 184.429 183.889 183.299 182.119 182.259 182.499 183.849 183.429 183.679 183.959 184.179 184.338 184.718 184.438 184.158 183.878 183.578 183.368 184.118 184.868 185.338 185.088 184.818 184.168 183.308 183.068 183.868 184.218 185.028 185.318 184.568 182.958 182.358 183.388 182.998 182.728 182.858 183.138 183 [...]
+ 183.329 183.249 182.539 182.709 182.809 182.399 181.569 181.469 181.569 181.699 181.899 181.959 182.179 182.399 181.939 181.909 181.959 182.089 183.079 184.009 184.219 184.429 184.709 184.879 184.309 183.449 183.539 183.779 183.789 183.449 183.269 183.419 183.559 183.629 184.198 184.748 184.428 184.088 183.788 183.778 183.848 184.028 184.288 184.688 184.798 184.798 184.098 183.538 183.118 182.228 182.218 183.378 184.608 184.438 183.008 182.478 182.968 183.558 183.298 183.128 183.158 183 [...]
+ 183.289 183.249 182.999 182.899 182.919 183.039 182.669 181.459 180.249 180.309 181.349 181.999 181.799 181.909 182.289 182.959 183.499 183.749 183.879 182.499 181.669 183.959 184.379 184.799 184.389 183.809 183.689 183.639 183.539 183.599 183.699 183.609 183.479 183.349 183.858 184.218 183.948 183.818 183.798 183.838 183.878 183.918 184.088 184.258 184.478 184.218 183.228 183.948 184.668 184.418 184.578 184.788 185.008 184.348 184.058 184.358 184.748 184.198 183.988 183.368 183.438 185 [...]
+ 182.899 183.169 183.089 182.859 182.609 182.539 182.339 181.239 180.649 180.729 181.809 182.119 181.949 181.759 182.019 182.799 183.319 183.629 183.949 184.079 183.489 184.049 184.709 184.779 184.659 184.489 184.289 184.079 183.869 183.889 183.889 182.439 181.179 180.769 183.198 183.738 183.748 183.758 183.888 183.938 183.978 183.958 183.938 183.898 183.868 183.528 183.208 183.008 182.888 183.058 183.748 184.868 184.968 184.178 182.818 182.728 182.528 182.998 182.898 182.928 183.138 183 [...]
+ 182.569 182.889 182.989 183.079 183.049 182.289 181.889 181.789 181.219 181.059 181.509 181.759 181.639 181.519 181.819 182.569 183.059 183.379 183.699 182.209 180.549 181.279 182.539 184.509 184.339 184.059 183.899 183.689 183.449 183.519 183.589 183.459 183.319 183.479 183.348 183.308 183.578 183.848 184.088 184.268 184.398 184.208 184.028 183.998 183.808 183.348 182.478 181.608 181.358 181.578 182.238 183.368 184.508 184.098 183.938 184.558 183.688 182.828 182.718 182.818 183.068 183 [...]
+ 181.989 182.229 182.339 182.429 182.159 180.919 180.469 180.829 181.179 181.229 180.889 180.949 181.419 181.529 181.839 182.369 182.589 182.769 183.089 183.169 183.179 183.379 183.639 183.909 183.759 183.649 183.399 183.119 182.939 181.679 182.929 183.359 183.799 184.198 184.148 184.148 184.338 184.348 184.388 184.608 184.678 184.498 184.308 184.098 183.848 183.538 182.548 181.638 181.488 182.048 182.788 183.738 184.698 184.308 184.258 184.088 183.688 183.058 182.928 183.058 183.058 184 [...]
+ 180.949 181.299 181.349 181.419 181.349 180.479 179.789 179.779 180.089 180.119 179.809 179.789 180.219 180.679 181.219 181.809 182.159 182.259 182.359 182.629 182.889 183.079 183.159 183.149 183.209 183.279 183.229 183.119 183.009 182.239 182.329 182.509 183.269 184.778 184.718 184.508 184.528 184.508 184.278 184.518 184.748 184.568 184.398 184.328 184.508 184.658 184.388 183.998 184.088 183.808 183.398 182.948 183.368 183.798 183.608 183.528 183.708 183.778 183.618 183.528 184.218 184 [...]
+ 179.699 180.029 180.009 179.989 179.879 179.639 179.749 179.809 179.829 179.739 179.569 179.539 179.479 179.409 179.809 180.089 180.629 181.259 181.589 181.889 182.409 182.319 182.119 182.029 182.679 183.819 183.719 183.389 183.069 183.399 183.219 184.209 184.689 185.028 184.778 184.428 183.998 183.628 183.428 184.078 184.458 184.258 184.058 184.008 184.358 184.598 184.728 184.928 184.888 184.568 184.798 185.538 186.138 184.858 182.618 183.608 183.608 182.808 183.038 183.258 183.328 183 [...]
+ 180.479 181.189 180.799 180.759 180.579 179.859 179.839 180.069 180.299 180.219 179.849 179.599 179.439 179.369 179.289 180.109 181.119 181.709 180.669 180.119 179.689 182.219 182.229 182.239 183.269 183.839 183.559 183.269 182.899 182.429 182.299 183.289 184.269 184.988 184.548 184.108 183.748 183.458 182.718 180.798 180.928 181.978 183.448 184.488 184.648 184.718 184.928 185.118 184.058 182.568 183.478 184.948 185.828 185.588 185.518 184.988 183.988 182.978 182.628 183.108 184.438 185 [...]
+ 182.979 182.889 182.449 182.039 181.849 181.779 181.449 181.459 181.549 181.329 180.599 180.669 180.859 180.649 180.049 179.249 179.419 179.669 179.189 179.009 179.039 180.069 181.179 182.309 182.929 183.569 183.159 182.759 182.379 182.649 183.129 183.729 184.039 184.228 184.008 183.948 183.698 183.498 183.478 183.458 183.418 183.878 184.348 184.608 184.578 184.608 184.788 184.908 184.468 185.668 185.778 184.898 184.018 183.798 185.548 185.488 184.738 184.108 183.798 183.398 184.328 185 [...]
+ 183.299 183.339 182.869 182.399 182.149 182.299 182.339 182.269 182.229 181.959 181.509 181.609 182.079 182.549 182.899 183.169 182.569 181.819 181.069 180.309 178.999 178.769 179.849 181.879 182.669 183.409 183.179 183.169 183.189 183.489 183.709 183.919 183.869 183.708 183.758 183.878 183.918 183.958 183.848 183.428 183.308 183.568 183.828 184.008 183.838 183.858 184.148 184.488 185.098 185.908 185.148 183.318 181.488 183.138 185.618 184.938 184.228 184.868 184.748 184.658 185.348 185 [...]
+ 182.189 182.089 182.549 182.999 182.729 182.729 182.399 182.299 182.199 182.259 182.329 182.329 182.419 182.509 182.729 182.749 182.329 182.029 181.919 180.789 179.749 179.969 180.159 180.329 179.819 179.719 180.189 181.769 183.219 183.579 183.849 183.629 183.409 183.288 183.508 183.658 183.628 183.578 182.678 180.798 180.778 181.668 183.248 183.978 183.808 183.908 184.168 184.388 184.538 185.318 185.638 185.698 185.748 185.618 185.548 185.378 184.408 183.438 183.498 184.798 185.338 185 [...]
+ 181.879 181.529 181.699 182.229 182.749 183.259 182.989 182.319 181.649 181.619 181.549 180.839 179.869 180.599 181.949 182.579 182.509 182.399 182.219 182.329 182.319 181.189 180.119 179.069 178.879 180.389 181.019 181.649 182.639 183.099 183.369 182.789 182.209 181.908 182.438 182.888 182.888 183.118 183.298 183.088 183.118 183.478 183.878 184.048 183.988 184.048 184.308 184.548 184.548 184.438 184.628 184.678 184.728 183.038 182.738 183.688 184.618 185.108 185.158 183.918 183.928 183 [...]
+ 181.969 182.249 182.229 182.199 182.529 183.299 183.489 183.239 182.709 181.929 181.239 181.169 181.819 182.469 181.119 182.229 182.709 182.499 182.289 182.669 183.149 182.919 182.699 181.689 180.859 179.399 178.539 179.179 180.529 182.419 182.519 181.819 181.269 181.238 181.858 181.718 181.338 182.228 183.108 183.248 183.288 183.488 183.688 183.698 183.488 183.568 183.878 184.188 184.238 184.368 184.348 184.248 184.008 183.928 183.878 184.428 185.038 185.608 183.718 182.028 182.038 182 [...]
+ 182.219 182.299 182.469 182.639 182.989 183.379 183.409 183.169 182.899 183.019 183.329 183.029 183.029 182.749 182.149 181.499 181.489 181.709 182.889 183.349 183.349 183.159 182.849 181.579 181.719 181.339 180.339 179.339 178.609 178.199 179.359 180.239 181.099 181.408 181.808 181.538 181.448 181.838 183.348 183.508 183.488 183.488 183.628 183.568 183.798 184.028 184.208 184.028 183.988 184.158 184.038 183.808 183.578 183.498 183.448 183.898 184.328 184.708 182.858 181.738 181.708 181 [...]
+ 182.379 182.579 182.639 182.799 182.919 182.989 182.909 182.709 182.519 182.669 182.999 181.969 181.289 181.179 182.799 182.949 183.109 183.229 183.329 183.279 183.179 182.299 180.949 180.129 182.689 182.739 181.479 180.399 181.309 181.139 180.589 180.549 180.689 181.718 181.808 181.838 182.608 183.178 183.488 183.518 183.488 183.458 183.468 183.858 184.228 184.188 183.958 183.728 183.678 183.688 183.508 183.248 182.988 181.628 182.278 183.408 183.968 183.888 182.688 181.828 181.738 181 [...]
+ 182.609 182.799 182.919 182.949 182.999 183.019 182.839 182.569 182.339 182.489 183.009 183.119 183.079 183.009 183.019 183.009 183.129 183.289 183.449 183.129 182.889 182.899 182.939 183.029 183.049 182.859 182.229 181.589 180.839 180.569 180.629 180.049 179.549 178.898 178.018 179.068 180.928 183.078 183.138 183.238 183.038 183.088 183.088 183.468 184.068 184.128 183.838 183.558 183.558 183.598 183.308 182.958 182.658 183.008 183.518 182.428 182.038 183.148 182.308 181.598 181.568 181 [...]
+ 181.569 181.789 182.269 182.749 182.939 182.969 182.879 182.659 182.389 182.739 183.279 183.349 183.349 183.359 183.329 183.199 183.289 183.379 183.499 183.199 183.019 183.069 183.119 183.199 183.229 182.769 180.939 179.719 179.319 181.919 183.659 183.809 183.859 183.458 182.728 182.358 182.298 182.238 182.268 182.478 181.608 180.618 181.138 181.178 183.018 183.538 183.358 183.278 183.208 183.308 183.168 182.988 182.778 183.038 183.278 182.578 181.858 181.388 182.298 182.918 182.698 182 [...]
+ 181.769 181.819 181.969 182.479 182.739 182.789 181.709 181.459 182.249 182.679 182.999 183.089 183.149 183.179 183.059 182.799 183.119 183.319 183.399 183.299 183.279 182.689 180.909 180.279 183.149 183.079 183.149 183.209 183.289 183.589 183.729 183.519 183.319 182.958 182.668 181.638 180.028 178.708 179.128 181.338 181.228 180.108 179.118 180.578 183.018 183.418 183.238 183.058 182.908 182.798 182.868 183.008 183.148 183.018 183.108 182.718 182.248 182.018 182.948 183.648 184.208 184 [...]
+ 182.119 182.229 182.339 182.459 181.799 180.509 180.719 181.309 182.019 182.449 182.829 182.749 182.709 182.759 182.499 182.329 182.469 182.769 183.079 183.389 183.459 183.299 183.109 182.919 182.699 182.549 182.509 182.499 182.619 183.229 183.429 183.319 183.259 183.088 182.558 181.398 179.998 179.938 180.868 181.508 181.888 181.768 182.698 183.468 183.828 183.598 183.198 182.788 182.958 183.028 181.818 180.488 180.018 181.838 183.758 182.768 181.788 181.498 182.628 183.288 182.338 181 [...]
+ 182.119 182.209 182.279 182.329 181.859 181.059 180.979 181.419 181.979 182.369 182.689 182.579 182.459 182.339 182.369 182.339 182.189 182.029 182.229 182.379 182.469 182.629 182.799 182.859 183.029 183.109 182.999 182.889 183.009 183.109 182.989 182.999 183.099 182.738 181.828 180.888 179.948 179.008 178.608 178.668 179.568 180.658 182.268 182.978 183.298 183.058 182.778 182.558 182.728 182.998 183.238 183.478 183.738 184.088 184.488 184.148 183.338 182.628 182.708 182.978 182.108 181 [...]
+ 181.679 181.649 181.699 181.739 181.819 181.909 182.009 182.029 182.049 182.219 182.469 182.349 182.209 182.079 181.949 181.709 181.839 181.789 181.649 181.489 181.409 180.949 180.129 179.759 181.529 182.279 180.169 178.209 179.219 181.159 182.509 182.649 182.829 182.698 182.468 181.798 181.078 180.608 180.488 180.428 180.418 181.298 182.228 182.688 182.748 182.618 182.498 182.288 182.558 182.768 183.178 183.518 183.828 183.528 183.508 183.368 183.708 183.978 183.458 182.448 182.698 182 [...]
+ 178.869 179.079 180.179 181.269 181.349 181.329 181.599 181.889 182.109 182.259 182.409 182.459 182.439 182.289 179.369 178.829 179.139 180.259 181.369 181.309 181.249 181.209 181.159 181.399 182.289 181.939 181.849 181.289 180.909 181.509 182.799 182.919 183.029 183.008 182.978 181.948 180.388 178.828 179.968 182.258 181.098 180.708 180.818 181.248 181.998 181.328 180.578 179.818 181.408 182.298 181.848 181.948 182.288 182.888 183.898 184.298 184.598 184.288 182.558 181.878 182.598 183 [...]
+ 181.659 181.829 181.779 181.729 181.349 180.909 180.979 181.179 181.459 181.799 182.059 182.069 182.099 182.139 182.229 181.529 180.889 180.249 181.249 181.279 181.279 181.139 180.999 181.269 182.299 181.869 180.029 179.469 181.609 182.399 182.329 182.519 182.919 183.158 183.208 183.108 182.988 182.858 182.618 182.308 181.208 181.278 181.358 181.688 180.008 179.128 178.278 178.918 179.958 182.018 182.568 183.108 183.378 183.928 184.208 184.358 184.508 184.248 183.098 182.698 183.348 183 [...]
+ 181.349 181.709 181.819 181.849 181.279 180.609 180.029 179.319 178.619 180.869 181.069 181.049 181.029 181.039 181.449 181.839 181.529 181.149 180.919 181.129 180.789 181.499 179.939 180.739 182.439 182.579 182.579 182.479 182.159 181.609 181.869 182.339 182.809 182.938 182.878 182.768 182.608 182.448 182.218 182.328 182.198 182.108 182.188 180.358 178.668 178.328 178.958 180.228 180.458 180.818 181.768 181.838 182.098 183.218 184.018 183.998 183.978 183.258 181.558 181.638 181.948 182 [...]
+ 181.189 181.179 181.189 181.279 181.499 181.359 181.169 180.979 180.609 179.239 178.339 178.789 180.089 181.309 181.709 181.469 181.069 180.679 180.509 180.679 180.289 178.989 177.689 178.639 181.959 181.079 180.679 181.249 181.659 181.529 181.799 181.949 182.109 182.158 182.498 181.358 179.728 178.098 179.798 182.228 180.698 179.418 179.408 179.908 180.268 181.228 182.238 183.258 183.188 183.148 181.658 179.958 178.728 181.148 183.338 183.318 183.298 183.338 183.178 183.128 183.258 183 [...]
+ 180.859 180.829 180.669 180.509 180.879 181.359 181.029 180.749 180.539 180.669 180.769 180.879 181.089 181.279 181.259 181.109 180.849 180.579 180.449 180.619 180.879 181.249 181.619 181.679 181.439 180.239 179.059 179.549 182.199 181.419 181.279 181.399 181.639 181.958 182.228 180.588 181.028 181.988 182.518 182.578 182.138 182.178 182.218 181.828 181.528 183.128 183.318 183.518 183.918 183.868 181.798 179.728 179.508 181.298 182.888 182.738 182.638 182.678 182.808 182.928 183.038 183 [...]
+ 180.299 180.419 180.509 180.429 180.779 181.099 179.509 177.929 177.559 180.079 180.279 180.249 180.219 180.289 180.599 180.769 180.539 180.549 180.599 180.649 180.619 180.909 181.179 181.199 180.859 181.039 181.579 182.109 181.849 180.989 181.019 181.279 181.539 181.648 181.698 179.968 179.188 178.898 181.078 181.038 181.088 181.638 182.868 182.988 183.098 183.198 183.328 183.528 183.778 184.088 183.618 183.138 182.398 182.518 182.958 182.738 182.518 182.428 182.538 182.638 182.678 182 [...]
+ 177.659 178.159 179.279 180.389 180.709 180.899 180.249 180.409 180.689 180.899 180.909 180.589 180.399 180.119 178.649 177.979 178.909 179.839 180.339 180.089 180.079 180.499 180.929 179.859 178.199 179.119 179.669 181.109 181.449 180.729 180.809 181.189 181.559 181.638 181.558 180.598 179.508 178.808 180.398 182.798 183.058 183.078 183.088 183.198 183.258 183.528 183.798 184.038 184.168 183.968 183.698 183.178 182.878 183.128 182.478 180.548 178.618 178.798 178.178 179.698 182.618 182 [...]
+ 179.269 179.119 179.169 180.429 180.709 180.689 179.159 178.269 178.809 181.159 181.349 181.079 180.789 180.609 180.879 180.829 180.039 179.249 179.519 179.699 180.029 180.479 180.919 180.729 178.979 178.749 179.209 180.549 180.799 180.159 180.399 180.809 181.258 181.348 181.448 181.558 181.668 181.748 181.788 182.538 182.598 182.568 183.118 183.168 183.198 183.328 183.448 183.588 183.858 183.618 181.618 179.618 178.418 178.368 179.088 180.678 182.218 181.598 181.848 182.058 182.168 182 [...]
+ 178.579 178.669 178.769 179.979 180.309 180.719 180.829 180.839 180.889 181.119 181.219 180.959 180.689 180.449 180.249 179.939 179.529 179.439 179.469 179.689 179.809 179.819 180.099 179.869 179.839 178.599 176.769 175.039 176.769 179.619 180.009 180.429 180.838 181.098 181.348 181.328 181.218 181.108 179.888 180.498 180.658 181.258 182.638 182.668 182.728 182.858 183.048 183.258 183.398 183.588 183.548 183.508 183.368 183.018 182.648 181.738 180.828 180.528 181.648 182.328 181.948 181 [...]
+ 179.489 179.609 179.659 179.689 180.209 180.639 180.789 180.919 180.969 180.699 180.459 180.269 180.059 179.789 179.539 179.569 179.599 179.509 179.589 179.879 179.969 179.929 179.889 180.009 180.149 179.979 179.829 179.679 179.749 179.889 180.119 180.149 180.178 180.488 181.058 180.938 180.838 180.818 181.458 181.908 182.008 182.118 182.138 180.248 179.278 180.688 182.088 183.018 183.078 182.798 182.628 182.288 182.218 182.578 182.408 182.438 182.368 182.488 182.548 181.928 180.708 178 [...]
+ 179.019 179.109 179.219 179.349 179.769 180.119 180.359 180.579 180.619 180.319 180.239 180.049 179.719 179.219 179.139 179.199 179.429 179.659 179.659 179.379 179.399 179.579 179.539 179.699 179.469 179.329 179.369 179.399 179.579 179.939 178.169 176.259 174.838 177.438 180.798 180.828 180.828 180.818 181.198 181.558 181.548 181.388 181.278 181.828 181.848 181.838 181.818 181.918 182.438 181.848 179.498 177.138 177.388 180.578 182.058 181.858 181.658 181.768 182.118 181.638 180.648 179 [...]
+ 178.549 178.479 178.409 178.529 179.029 179.559 179.879 180.139 180.389 180.579 180.429 179.749 179.069 178.639 178.939 178.989 178.809 178.939 178.909 178.779 178.829 178.519 176.949 178.839 179.259 179.319 179.319 179.189 179.459 179.779 180.079 180.379 180.668 180.688 180.658 180.618 180.568 180.518 180.668 180.238 178.138 176.708 178.438 178.698 181.288 181.158 181.118 181.188 181.598 181.268 179.228 180.488 181.228 181.318 181.998 181.808 181.618 181.698 181.978 181.498 180.618 179 [...]
+ 176.129 176.269 177.039 177.789 178.439 178.979 179.339 179.709 179.969 179.939 179.649 178.959 178.229 177.969 178.539 178.779 178.619 178.529 178.579 178.669 178.749 178.869 178.989 179.189 179.279 177.639 177.389 177.899 179.059 179.299 179.589 179.869 180.148 180.218 180.338 180.288 180.228 180.058 176.528 177.418 180.928 181.858 182.578 181.598 181.208 181.208 181.208 181.238 181.348 181.058 180.088 179.108 178.948 180.838 182.148 181.918 181.688 181.698 181.958 181.788 181.438 180 [...]
+ 177.289 177.179 177.059 177.159 178.299 179.049 178.949 179.049 179.299 179.249 178.919 178.179 177.489 177.619 178.149 178.389 178.399 178.419 178.399 178.299 178.509 178.829 179.129 179.089 178.869 177.229 176.939 176.659 179.019 178.969 179.239 179.499 179.738 179.878 180.268 180.138 179.998 179.838 180.918 181.938 182.098 182.198 182.218 181.828 181.628 181.688 181.748 181.818 181.518 181.298 181.408 181.718 181.738 181.928 182.008 181.878 181.748 181.858 182.028 181.908 181.598 181 [...]
+ 177.549 177.789 178.029 178.459 178.999 179.119 179.029 178.909 177.919 177.659 178.499 178.339 178.179 178.129 178.169 178.279 178.439 178.489 178.349 177.949 177.999 178.229 178.499 178.529 178.859 178.949 178.899 178.679 178.619 178.909 179.109 179.319 179.268 179.958 180.488 180.288 180.058 179.838 179.758 180.578 181.048 181.508 181.588 181.258 181.118 181.318 181.478 181.468 181.118 181.198 181.588 181.978 181.918 181.688 181.688 181.718 181.698 181.878 182.138 182.008 181.788 181 [...]
+ 178.089 178.089 178.229 178.389 178.549 178.629 178.579 178.539 178.079 176.199 175.399 175.739 177.169 177.959 177.999 177.949 178.039 178.199 177.959 177.509 177.609 177.859 178.109 178.469 178.889 177.849 176.699 177.249 178.359 179.249 178.869 178.499 178.158 179.228 179.868 179.728 179.588 179.478 179.458 179.678 179.978 180.488 179.988 175.828 176.698 178.028 179.338 180.238 180.498 180.788 180.948 181.118 181.008 180.698 180.718 180.958 181.288 181.588 181.838 181.868 181.848 181 [...]
+ 176.279 176.179 177.179 178.079 178.499 178.649 178.549 178.479 178.319 178.019 177.739 177.629 177.639 177.699 177.829 177.809 177.719 177.629 177.539 177.469 177.589 177.739 177.829 178.229 178.679 178.219 178.079 177.949 178.939 178.899 178.399 177.989 177.578 176.688 176.218 177.188 178.148 178.998 179.258 179.498 179.738 179.968 180.118 179.998 179.848 179.748 179.658 179.618 179.948 180.678 180.688 180.548 180.598 180.348 179.298 177.968 179.498 179.488 181.058 181.778 181.908 182 [...]
+ 178.029 177.319 176.679 177.569 178.109 178.459 178.499 178.389 178.289 178.179 177.949 177.639 177.329 177.339 177.619 177.659 177.599 177.509 175.289 172.849 175.339 177.219 177.229 177.519 177.459 175.629 173.789 172.349 175.679 178.619 178.289 177.959 177.598 176.878 176.528 177.298 178.068 178.888 179.448 179.918 179.978 180.058 180.188 179.778 178.988 177.828 176.668 177.168 179.408 180.368 180.188 179.998 180.028 180.208 180.338 179.738 179.078 179.318 180.568 181.218 181.608 181 [...]
+ 178.059 176.179 174.689 175.109 176.439 177.809 177.919 177.999 178.059 177.879 177.519 177.029 176.659 176.759 177.109 177.269 177.259 177.199 177.209 177.219 176.999 176.759 176.519 176.369 176.249 175.089 175.699 176.299 177.469 178.349 178.049 177.749 177.398 177.338 177.978 178.708 178.528 178.508 179.228 179.718 179.828 179.878 179.768 179.328 179.338 179.498 179.658 179.318 179.568 180.078 179.888 179.698 179.698 179.828 179.948 179.988 179.978 177.968 176.768 177.968 179.638 181 [...]
+ 177.769 175.909 174.939 176.329 177.839 177.469 177.009 176.879 176.959 177.359 176.419 174.589 172.759 174.059 176.329 176.479 176.589 176.689 176.889 177.189 176.719 176.199 175.679 175.779 175.779 174.239 175.049 175.999 175.579 178.369 178.039 177.849 177.788 178.438 178.558 178.238 177.928 177.908 178.628 179.048 179.168 179.298 179.338 179.228 179.138 179.048 178.968 177.708 176.638 177.818 179.158 179.318 177.998 176.208 175.448 176.908 178.368 178.178 180.478 180.968 181.168 181 [...]
+ 177.639 178.139 178.649 178.739 178.199 177.789 177.429 176.989 176.979 177.379 177.359 177.229 177.099 176.649 176.019 175.889 175.849 175.949 176.319 176.849 176.859 176.839 176.419 176.349 176.269 176.069 176.569 177.279 177.599 177.939 177.889 177.849 178.058 178.358 178.508 178.288 178.068 178.118 178.348 178.448 178.458 178.508 178.548 178.778 178.818 178.658 178.558 178.518 178.638 178.788 178.938 179.098 178.768 178.148 177.938 177.798 177.658 178.278 180.128 180.528 180.948 181 [...]
+ 176.879 175.049 174.069 175.599 178.089 178.269 177.969 177.669 177.439 177.319 177.189 177.069 176.939 176.429 176.099 176.019 175.949 175.839 176.089 176.339 174.559 172.349 170.749 175.199 176.489 174.839 174.709 175.289 176.589 177.079 177.359 177.639 177.928 178.378 178.608 178.378 178.098 177.938 178.038 178.038 177.998 178.018 178.148 178.458 178.558 178.518 178.468 178.488 178.488 178.548 178.628 178.698 178.798 178.658 179.038 179.238 179.368 179.328 179.458 180.138 180.818 181 [...]
+ 177.309 177.629 178.019 178.219 178.159 178.019 177.829 177.619 177.389 172.959 171.999 171.859 171.719 173.319 176.769 176.699 176.609 176.519 176.419 176.279 176.319 176.359 176.289 176.489 176.319 175.509 175.039 174.519 174.609 176.639 177.329 177.819 178.128 178.538 178.608 178.318 178.028 177.768 177.868 177.868 177.788 177.708 177.798 178.078 178.338 178.548 178.758 178.828 178.658 178.608 178.558 178.458 178.598 178.718 178.768 178.808 178.828 178.868 178.868 179.518 180.288 181 [...]
+ 177.609 177.769 177.939 176.669 173.499 172.209 173.259 174.469 175.799 177.109 176.909 176.739 176.569 176.159 175.729 175.809 175.919 175.859 175.879 176.239 175.919 175.659 175.579 175.889 176.199 176.119 176.019 175.419 171.919 172.939 173.669 176.219 178.198 178.508 178.408 178.008 177.568 177.328 177.578 177.608 177.458 177.338 177.458 177.778 178.068 178.338 178.548 178.548 178.138 177.978 178.018 178.128 178.378 178.598 178.558 178.518 178.478 178.808 179.088 179.648 180.008 180 [...]
+ 173.929 174.689 176.499 177.529 177.639 177.419 177.179 176.939 176.979 176.909 176.609 176.279 176.039 175.549 175.229 175.019 175.129 175.239 175.719 176.059 176.159 175.949 175.759 176.019 175.799 175.669 175.539 174.979 175.899 176.869 177.109 177.189 177.988 177.878 177.648 177.288 176.998 176.938 177.158 177.228 177.178 177.028 177.138 177.468 177.698 177.888 178.078 177.578 176.838 176.948 177.458 177.958 178.148 178.308 178.268 178.038 177.798 178.378 178.698 178.918 179.128 179 [...]
+ 177.629 177.449 177.219 177.149 177.309 176.839 176.089 175.599 175.669 176.309 176.079 175.719 175.399 175.289 175.249 174.859 174.869 174.699 174.989 175.129 174.509 173.899 174.009 175.519 175.449 175.529 175.629 175.109 172.729 172.259 173.639 175.759 177.178 177.268 177.318 176.958 176.598 176.498 176.498 176.538 176.608 176.678 176.878 177.198 177.288 177.298 177.298 176.808 176.798 177.178 177.408 177.438 177.658 177.778 177.488 177.198 176.948 177.578 178.218 178.918 179.308 179 [...]
+ 177.239 177.119 177.009 176.889 176.779 176.439 175.839 175.079 175.249 175.789 175.549 175.109 174.679 174.739 174.889 173.679 172.929 172.409 174.099 174.969 174.919 174.809 174.649 175.219 175.409 175.509 175.409 175.179 174.599 174.869 175.559 176.219 176.468 176.988 177.308 177.248 177.078 176.928 176.538 176.618 176.938 177.188 177.228 176.458 176.308 176.398 176.788 176.898 176.848 176.788 176.728 176.678 176.908 177.078 177.358 177.438 177.488 177.138 177.458 178.188 178.858 179 [...]
+ 176.389 176.099 175.939 175.909 175.929 175.619 175.199 174.779 174.369 174.069 174.549 175.089 174.999 174.909 174.569 174.079 173.599 173.319 174.429 175.189 173.029 170.379 169.379 172.879 175.129 174.989 174.849 174.709 174.729 174.859 174.949 175.039 175.298 176.278 176.698 176.698 176.758 176.618 176.178 176.298 176.648 176.948 176.538 175.968 176.198 176.498 176.798 176.718 176.608 176.628 176.668 176.708 176.718 176.708 175.058 173.408 172.428 174.718 176.608 177.228 177.838 178 [...]
+ 175.789 175.489 175.189 175.159 175.379 174.969 174.419 173.969 173.329 172.869 173.109 173.719 174.319 174.319 174.239 173.929 173.599 173.379 174.029 174.489 174.409 174.289 173.279 174.569 174.759 174.499 174.249 174.089 174.609 174.899 174.859 174.789 175.168 175.998 176.268 176.318 176.328 175.978 175.468 175.638 176.038 176.448 176.668 176.658 176.308 175.978 175.648 176.088 176.368 176.428 176.408 176.328 176.408 176.208 174.648 174.438 175.598 175.438 175.758 176.418 177.078 177 [...]
+ 175.339 175.079 174.819 174.239 172.729 172.669 173.019 173.359 173.259 173.029 173.099 173.169 173.279 173.399 173.469 173.459 173.389 173.169 173.709 174.079 173.899 172.719 172.169 173.599 173.259 173.109 173.229 173.679 174.349 174.569 174.599 174.639 175.129 175.678 175.708 175.548 175.388 175.038 174.668 174.918 175.338 175.758 176.168 176.438 175.978 175.508 175.178 175.118 175.788 175.768 175.718 175.658 175.378 175.628 176.108 175.878 175.768 175.758 175.838 176.798 176.988 177 [...]
+ 175.349 174.919 174.319 174.189 174.239 173.909 173.649 173.389 173.379 173.409 173.389 173.359 173.429 173.279 173.049 172.879 172.859 172.929 173.559 173.859 173.569 173.289 172.899 172.179 172.129 172.399 172.679 172.959 173.419 173.769 174.259 174.749 175.229 175.569 175.508 175.228 174.928 174.538 174.268 174.268 174.688 175.128 175.428 175.838 175.798 175.708 175.608 175.298 174.988 175.088 175.218 175.218 172.968 174.488 176.778 177.068 177.278 177.068 176.858 176.798 176.748 176 [...]
+ 174.899 174.299 173.809 173.559 173.639 173.639 173.619 173.369 173.469 173.579 173.679 173.659 173.629 173.369 173.109 172.879 172.649 172.589 172.769 172.819 172.629 172.439 172.409 172.659 172.909 172.879 172.829 172.949 172.849 172.379 171.769 171.949 172.359 174.669 175.189 174.898 174.618 174.598 174.708 174.728 174.728 174.718 174.858 175.078 174.988 174.868 174.748 174.468 174.198 174.388 174.768 175.438 175.658 176.188 176.488 176.778 177.038 176.898 176.768 175.858 174.108 173 [...]
+ 174.539 174.289 174.049 173.709 173.339 171.999 170.639 169.469 171.569 173.449 173.529 173.619 173.699 173.259 172.809 172.589 172.339 172.139 172.219 172.379 172.239 172.189 172.289 172.649 172.799 172.749 172.839 172.739 172.359 172.739 173.479 174.129 174.419 174.809 174.849 174.599 174.348 174.368 174.598 174.908 175.238 175.398 175.458 175.368 175.058 174.588 173.918 174.048 173.758 174.498 175.238 175.848 175.898 175.948 176.128 176.388 176.638 176.878 176.928 176.908 176.888 176 [...]
+ 174.329 174.119 173.879 173.719 173.559 173.359 172.979 172.469 173.239 173.349 172.739 172.279 172.359 172.189 171.819 169.999 168.399 169.139 171.289 172.629 172.439 172.249 172.239 172.559 172.679 172.809 172.939 172.809 172.339 172.549 172.709 172.859 173.189 174.039 174.099 173.839 173.499 173.618 173.868 174.598 175.108 175.428 175.458 175.248 173.288 173.098 172.998 173.558 174.058 174.578 175.058 175.528 175.918 176.138 176.188 176.148 176.168 176.398 176.598 176.758 176.918 176 [...]
+ 174.339 174.109 173.919 173.449 173.249 171.569 171.219 172.049 173.589 173.089 172.499 171.909 171.149 171.449 171.339 172.149 172.579 172.819 172.549 172.369 172.269 172.179 172.009 171.749 171.889 172.289 172.639 172.489 172.279 170.729 168.769 167.489 169.109 172.929 173.289 172.819 172.359 172.389 172.598 173.358 174.118 174.848 174.998 174.768 173.478 172.058 170.708 172.138 174.578 174.978 175.188 175.298 175.238 174.908 173.068 173.018 173.898 174.308 176.128 176.258 176.418 176 [...]
+ 174.849 174.729 174.579 173.709 172.729 173.049 173.249 173.449 173.069 172.489 171.699 170.819 170.099 170.919 171.709 172.109 172.519 172.189 169.919 169.529 171.389 172.309 172.129 171.469 171.289 171.489 171.889 172.039 172.019 172.379 172.889 173.389 173.469 173.299 173.179 173.099 173.019 172.939 172.629 172.418 172.408 173.138 173.818 173.908 173.518 173.168 172.888 173.388 174.118 174.458 174.788 174.758 173.538 173.968 174.908 174.058 173.628 174.118 175.828 175.978 176.198 175 [...]
+ 173.809 174.009 173.889 172.819 171.789 172.109 172.419 172.729 172.899 172.449 170.439 169.349 169.329 171.509 171.349 171.569 171.929 172.109 171.909 171.819 171.829 171.839 170.999 169.009 169.739 170.209 170.899 171.339 171.449 171.809 172.229 172.659 172.749 172.739 172.789 172.819 172.829 172.679 172.639 172.739 172.528 172.318 172.958 172.878 172.718 172.568 172.328 172.468 172.798 173.378 174.008 173.988 173.198 173.978 174.788 174.738 174.818 175.018 175.318 175.848 176.378 176 [...]
+ 172.589 172.799 172.999 172.709 171.819 171.479 171.299 171.599 172.019 172.349 171.949 171.529 171.069 170.899 170.819 170.919 171.019 171.069 170.939 170.919 170.989 171.049 171.219 170.879 170.779 170.789 171.249 171.639 171.629 171.949 172.209 172.289 172.279 172.359 172.329 172.269 172.219 172.249 172.319 172.439 172.559 172.678 172.118 171.578 171.568 171.778 171.988 172.168 172.408 173.018 173.458 173.768 173.938 173.938 173.798 173.648 173.778 174.178 174.488 174.958 175.458 173 [...]
+ 172.569 172.099 171.949 171.809 171.819 171.839 171.499 170.909 169.789 171.409 170.989 170.489 170.049 170.559 170.909 170.809 170.439 170.159 170.209 170.249 170.039 170.099 170.269 170.179 170.759 171.439 171.559 171.659 171.899 171.969 171.989 171.979 172.079 172.249 172.239 172.239 172.239 172.169 172.009 172.649 173.299 173.599 172.408 171.158 171.348 171.528 171.648 171.868 172.088 172.368 172.658 172.928 173.168 173.368 173.468 173.558 173.798 174.208 174.508 174.728 174.908 173 [...]
+ 172.159 171.799 171.479 171.319 171.259 171.359 171.469 171.249 168.079 166.789 167.429 168.499 169.489 170.239 170.529 170.119 169.779 170.039 170.519 170.439 170.029 169.619 167.779 168.209 168.939 169.469 170.519 171.669 172.209 172.169 172.049 171.919 171.969 171.979 171.999 172.119 172.309 172.059 172.059 172.139 172.749 173.359 171.959 170.918 170.498 171.088 171.218 171.548 171.828 172.048 172.238 172.458 172.698 172.898 173.058 173.188 173.748 174.438 174.628 174.658 174.688 174 [...]
+ 169.739 170.419 171.109 170.629 170.449 170.999 171.539 171.229 169.039 168.039 168.419 168.799 168.119 169.419 170.399 170.479 170.559 170.499 170.269 169.949 169.579 169.209 168.309 168.109 167.039 167.239 169.229 170.629 171.459 171.439 171.469 171.549 171.589 171.599 171.829 172.069 172.269 172.539 172.779 172.749 172.719 172.689 172.459 171.839 170.618 169.448 168.338 169.298 170.568 170.888 171.348 172.058 172.398 172.558 172.618 172.678 173.258 174.328 174.738 173.738 171.858 171 [...]
+ 170.809 169.879 170.379 169.799 169.589 170.009 170.539 170.839 170.039 169.289 169.309 169.319 168.509 166.849 166.429 167.439 169.239 170.059 169.659 169.419 169.229 168.899 169.219 169.499 169.289 168.999 169.029 169.909 170.589 170.719 170.859 171.069 171.099 171.089 171.269 171.429 171.589 171.829 172.039 172.139 172.239 172.209 171.629 170.849 170.439 170.038 169.608 168.628 169.238 169.988 170.738 171.448 172.088 172.438 172.528 172.608 173.168 174.108 174.478 174.598 174.748 174 [...]
+ 171.349 170.589 169.839 169.789 169.669 169.769 169.869 169.879 169.619 168.759 167.179 166.139 167.319 169.589 169.839 169.969 169.779 169.249 168.669 168.449 168.429 168.449 168.509 168.589 168.749 168.899 169.059 169.299 169.539 169.839 170.329 170.809 170.859 170.889 171.009 171.049 171.039 171.239 171.379 171.589 171.709 171.699 170.529 169.929 170.079 170.249 169.818 169.438 170.198 170.758 170.868 171.348 172.268 171.618 170.058 168.488 169.908 172.988 174.148 174.548 174.958 174 [...]
+ 170.819 170.049 169.439 168.439 167.829 167.969 168.979 169.719 169.529 168.669 167.229 166.169 166.899 169.179 169.859 169.379 168.899 168.369 167.809 167.799 167.939 168.069 168.159 168.299 168.449 168.559 168.659 168.789 168.719 169.199 169.689 170.189 170.339 170.809 170.739 170.669 170.529 170.639 170.759 170.989 171.229 171.379 170.709 170.319 170.269 170.129 169.509 167.628 167.298 168.548 169.848 170.988 171.888 172.328 172.498 172.678 172.838 173.068 173.578 174.068 174.528 174 [...]
+ 170.309 169.879 169.539 169.679 169.589 169.549 169.449 169.299 169.039 168.269 168.179 168.089 168.849 169.129 168.909 168.489 168.149 167.639 167.089 167.189 167.449 167.709 167.879 167.949 168.049 168.149 168.229 168.089 168.039 168.499 168.969 169.429 170.199 170.839 170.479 170.109 169.779 170.119 170.689 170.969 171.249 171.389 170.599 169.979 169.829 169.739 169.459 168.089 167.798 168.528 169.258 170.318 171.268 171.788 172.078 172.368 172.308 172.138 172.668 173.258 173.858 174 [...]
+ 170.219 169.779 169.299 168.769 168.689 168.739 168.789 167.919 165.679 164.909 166.029 167.429 168.299 168.179 168.239 167.949 167.599 167.389 167.179 167.279 167.499 167.749 167.729 167.569 167.609 167.679 167.749 167.879 168.119 168.569 169.009 169.469 170.059 170.319 169.909 169.469 169.119 169.939 170.459 170.639 170.889 170.949 170.079 169.909 170.169 170.429 170.359 169.959 170.089 169.899 169.668 170.098 171.108 171.608 171.818 171.958 170.258 167.678 168.858 171.248 172.968 173 [...]
+ 169.859 169.429 169.099 168.719 168.499 168.499 168.569 168.439 167.879 167.469 167.549 167.619 166.349 166.529 166.649 166.989 167.259 167.019 166.709 167.129 167.639 168.149 167.979 167.559 167.599 167.539 167.469 167.669 167.689 168.009 168.449 168.909 169.359 169.429 169.059 168.699 168.439 169.399 170.049 170.189 170.339 170.419 170.199 170.199 170.309 170.419 170.419 169.999 169.659 169.489 169.479 169.728 170.648 171.018 171.188 171.368 170.688 169.328 168.888 169.058 169.458 170 [...]
+ 169.169 168.819 168.539 168.449 168.409 168.399 168.349 168.289 168.189 167.709 167.189 166.739 165.369 163.109 163.349 164.739 166.119 166.329 165.999 166.259 166.609 166.959 166.939 167.589 167.499 167.419 167.329 167.159 167.099 167.389 167.669 167.979 168.049 167.999 167.809 167.879 168.019 168.609 169.269 169.459 169.619 169.699 169.949 170.299 170.379 170.269 169.969 169.409 169.409 169.699 169.969 170.039 170.028 170.458 170.998 171.548 170.818 169.508 170.698 171.978 172.968 173 [...]
+ 168.579 168.229 167.869 167.529 167.499 167.629 167.759 167.869 168.089 167.829 167.299 166.709 166.249 165.909 165.829 165.859 165.899 165.499 165.069 165.329 165.599 165.819 166.609 167.349 166.799 167.319 167.389 167.039 166.909 167.479 168.049 168.309 168.019 167.809 167.819 167.699 167.759 168.789 169.159 169.419 169.429 169.129 169.779 170.009 169.879 169.759 169.509 169.149 169.189 169.539 169.899 170.319 170.629 171.028 171.278 171.398 170.498 170.198 170.548 170.888 171.868 172 [...]
+ 167.139 167.289 167.329 167.189 167.329 167.679 167.969 168.179 168.169 167.729 167.149 166.549 166.089 165.719 165.589 165.509 165.489 165.029 164.639 164.529 164.479 164.699 165.509 166.129 165.049 164.699 165.359 166.999 166.709 167.279 167.849 168.349 168.129 167.239 167.069 166.619 166.789 168.999 169.899 169.119 168.339 168.109 169.039 169.319 169.059 168.799 168.529 168.399 168.669 169.079 169.589 169.829 170.239 170.469 170.658 170.858 171.118 171.428 172.088 170.458 168.808 170 [...]
+ 166.419 166.469 166.659 166.929 167.259 167.549 167.829 167.979 167.959 167.389 166.569 165.749 165.309 165.489 165.269 165.129 165.049 164.849 164.659 163.609 162.339 161.069 164.749 165.599 166.149 166.739 167.329 166.729 166.519 167.099 167.669 168.129 167.889 166.919 164.649 162.439 162.249 166.339 168.089 167.379 167.409 167.409 167.829 168.069 167.859 167.729 167.869 167.819 168.189 168.639 169.159 169.359 169.389 169.619 169.859 170.098 170.228 170.428 171.108 171.858 172.678 173 [...]
+ 166.149 166.049 166.139 165.799 165.819 166.479 167.139 167.479 167.489 166.849 166.019 165.279 164.069 163.889 164.049 164.099 164.439 164.529 164.519 164.679 164.829 165.019 165.139 165.349 165.889 166.429 166.919 166.399 166.279 166.869 167.459 167.899 167.859 167.799 167.389 166.929 166.639 166.889 166.949 167.089 167.229 167.229 167.019 167.239 167.599 167.949 168.209 168.549 168.869 168.939 169.019 169.039 169.059 169.219 169.369 169.459 167.848 166.848 168.458 170.388 172.188 172 [...]
+ 165.089 165.659 165.989 166.519 166.889 167.189 167.469 167.499 166.989 166.299 165.619 164.939 164.369 163.439 163.449 163.469 164.089 164.249 164.699 164.769 164.849 165.009 164.919 164.869 165.329 165.799 166.259 165.959 166.319 166.869 167.459 167.979 168.169 167.989 167.469 166.949 166.699 167.139 167.149 166.829 166.559 166.549 166.799 167.129 167.359 167.499 166.879 166.529 167.459 168.449 168.749 168.629 168.629 168.709 168.799 168.889 169.199 169.248 171.168 171.388 171.608 171 [...]
+ 163.909 164.499 165.269 166.269 166.509 166.629 166.739 166.539 165.979 165.349 164.979 164.609 164.189 164.159 163.999 163.999 164.019 164.539 164.939 164.899 164.839 164.769 164.519 164.479 165.009 165.449 165.889 166.159 166.529 167.089 167.639 168.089 168.139 167.929 167.489 167.039 166.909 167.219 167.129 166.819 166.449 166.369 166.539 166.639 166.749 166.929 167.589 168.089 168.129 168.369 168.559 168.329 168.049 168.249 168.519 168.789 168.959 168.839 169.708 170.438 170.808 169 [...]
+ 164.439 164.029 164.459 165.799 165.849 165.469 165.169 164.999 164.939 164.799 164.529 164.169 164.219 164.409 164.259 164.139 164.019 164.259 164.479 164.459 164.409 164.289 164.139 164.129 164.719 165.309 165.819 166.259 166.679 167.089 167.489 167.919 168.209 168.189 167.729 167.339 167.159 167.289 165.739 164.779 164.699 164.999 165.659 166.599 167.189 167.769 167.789 167.169 167.249 167.629 168.019 168.319 168.179 168.419 168.609 168.739 169.209 169.329 169.049 169.078 169.468 170 [...]
+ 164.749 164.869 165.319 165.569 165.449 165.179 164.799 164.439 164.089 163.919 163.759 163.609 163.749 163.939 163.739 163.529 163.399 163.699 163.929 163.689 163.489 163.369 163.939 164.809 164.989 165.329 165.899 166.279 166.619 166.979 167.399 167.819 168.189 168.129 167.899 167.669 167.259 166.589 164.989 164.719 166.679 167.459 166.349 166.569 166.979 167.329 167.029 166.299 166.559 166.969 167.799 167.969 168.259 168.399 168.549 168.689 169.259 169.739 168.939 167.699 166.908 170 [...]
+ 164.289 164.429 164.679 165.039 164.949 164.729 164.509 164.219 163.839 163.639 163.459 163.299 163.439 163.819 163.599 163.349 163.019 163.269 163.529 161.529 159.459 158.659 162.639 165.279 165.479 165.679 165.879 166.199 166.599 166.949 167.299 167.419 167.529 167.499 167.429 167.359 166.989 166.279 166.359 166.779 167.309 167.029 165.919 165.959 166.309 166.609 164.949 165.319 166.299 167.349 168.389 168.339 168.159 168.429 168.709 168.979 169.039 169.319 169.259 168.989 168.849 170 [...]
+ 163.769 163.879 164.199 164.819 164.649 164.359 164.089 163.799 163.439 163.549 163.419 163.229 163.569 163.739 163.439 163.149 162.869 162.999 163.179 163.499 163.829 164.209 164.809 165.199 165.389 165.589 165.849 166.369 166.739 166.699 166.669 166.679 167.239 167.479 167.339 166.739 164.529 164.089 164.369 165.379 166.389 166.229 165.179 165.229 165.489 165.739 163.779 164.109 164.349 165.649 167.889 168.389 168.219 166.719 165.219 164.579 164.309 165.059 167.139 169.449 169.709 170 [...]
+ 163.879 164.039 164.319 164.419 164.369 164.179 163.879 163.429 162.939 163.049 163.149 163.249 163.069 162.839 162.569 162.429 162.309 162.539 162.949 163.279 163.609 163.989 164.219 164.409 164.529 164.499 164.839 166.009 166.229 166.159 166.009 166.179 166.829 166.489 165.939 165.359 162.969 161.329 161.559 162.869 165.259 165.169 164.829 164.949 165.179 165.479 165.499 165.819 166.429 167.059 167.599 167.889 168.199 168.659 169.129 169.529 169.819 169.999 170.069 170.099 170.169 170 [...]
+ 164.129 164.289 164.139 163.789 163.769 163.789 163.799 163.199 162.649 162.529 162.399 162.499 162.299 162.399 162.249 162.089 161.999 162.409 162.789 163.119 163.449 162.999 159.439 160.389 160.869 161.349 162.059 163.809 165.619 165.439 165.249 165.229 165.239 164.879 164.539 164.339 164.259 164.379 162.989 161.239 159.899 161.309 164.549 165.089 165.349 165.569 165.549 165.339 165.969 166.489 167.029 167.299 167.589 167.909 168.229 168.579 169.179 169.519 169.479 168.189 167.309 169 [...]
+ 163.969 164.269 164.499 164.329 164.289 164.249 164.229 163.479 162.529 162.249 162.129 161.999 162.189 162.349 162.189 162.039 161.959 162.359 162.729 163.029 163.249 163.349 163.229 161.989 162.689 163.459 162.949 163.269 164.889 164.909 164.969 164.879 164.509 164.219 163.979 163.749 163.789 163.989 163.509 163.519 163.519 163.969 164.899 165.279 165.409 165.539 165.029 164.009 165.299 166.589 167.069 167.239 167.499 167.699 167.959 168.069 166.949 167.329 168.229 169.129 169.619 169 [...]
+ 163.199 163.779 163.999 164.139 164.169 164.129 164.029 163.339 162.599 162.309 162.019 161.739 161.869 162.029 162.279 162.499 162.409 162.519 162.449 162.459 162.529 162.609 162.719 163.159 163.859 164.509 164.859 164.739 164.739 164.789 164.679 164.399 164.069 163.909 163.749 163.589 163.699 164.109 162.539 161.179 161.609 161.089 164.569 164.839 165.079 165.339 164.219 163.699 164.479 165.829 167.169 167.549 167.739 167.979 168.229 168.329 168.509 168.769 169.129 169.439 168.819 166 [...]
+ 159.979 158.929 161.089 163.529 163.519 163.519 163.529 163.249 162.639 162.349 162.049 161.749 161.749 161.739 161.989 162.239 162.429 162.279 162.149 162.099 162.049 162.069 162.249 162.769 163.529 164.229 164.629 164.529 164.289 164.019 163.799 163.529 163.219 163.089 163.089 163.199 163.529 163.819 164.059 164.249 164.399 164.359 164.379 164.639 164.889 165.149 165.289 165.419 166.009 166.599 167.179 167.739 168.149 168.149 168.189 168.169 167.839 168.039 168.449 168.949 168.439 165 [...]
+ 160.859 161.109 163.129 163.209 162.999 162.779 162.719 162.489 162.299 162.099 161.809 161.529 161.489 161.549 161.789 162.029 162.219 162.119 161.979 161.799 161.619 161.479 161.359 161.919 162.839 163.759 164.219 164.019 163.769 163.609 163.479 163.179 162.689 162.689 162.799 162.879 163.009 163.229 163.509 163.779 164.049 164.189 164.289 164.559 164.829 165.099 165.299 165.499 166.189 166.989 167.779 168.209 168.559 168.429 168.139 168.029 168.229 168.159 168.439 168.729 168.439 169 [...]
+ 161.459 161.099 162.739 162.739 162.489 162.259 162.029 161.849 161.659 161.459 161.259 161.059 161.219 161.359 161.449 161.579 161.759 161.889 162.159 162.389 162.609 162.459 161.589 161.839 162.679 163.639 164.069 163.699 163.519 163.409 163.229 162.889 162.479 162.389 162.349 162.299 162.569 163.319 163.559 163.779 164.019 164.149 164.239 164.509 164.779 165.039 161.889 160.199 162.489 165.119 167.559 168.139 168.299 168.009 167.719 167.639 168.159 168.519 168.679 168.819 168.919 169 [...]
+ 161.989 161.919 162.049 162.149 161.899 161.659 161.409 161.219 160.979 160.539 160.199 160.059 160.409 159.639 158.189 157.589 158.279 160.339 161.989 161.969 161.959 161.779 161.419 161.699 162.479 163.259 163.559 163.299 163.039 162.749 162.449 162.149 161.989 161.919 161.929 162.139 162.749 163.079 163.629 163.979 164.209 164.299 164.179 164.439 164.709 164.849 164.999 165.149 165.699 166.249 166.819 167.529 167.909 167.669 167.409 167.359 167.879 168.239 168.419 168.589 168.779 168 [...]
+ 160.779 161.019 161.139 161.279 161.299 161.319 161.079 160.849 160.779 160.279 159.779 158.959 158.439 157.599 157.239 160.239 161.689 161.889 161.829 161.549 161.229 161.189 161.569 161.849 162.109 162.369 162.649 162.659 160.659 158.269 156.849 157.829 161.179 161.669 161.929 162.169 162.359 162.569 163.049 163.529 164.009 164.099 163.999 164.119 164.209 164.299 164.639 164.929 165.479 166.039 166.589 167.099 167.419 167.219 167.099 167.159 167.679 168.009 168.169 168.319 168.499 168 [...]
+ 161.379 161.709 161.239 160.779 160.769 160.879 160.999 161.239 161.089 160.169 159.249 158.339 158.359 158.779 158.899 160.039 160.959 161.159 161.029 160.779 160.429 160.409 161.159 161.409 161.469 161.759 161.899 161.939 161.719 161.469 161.209 160.559 160.619 160.949 161.089 161.229 161.559 162.249 162.149 162.079 162.559 162.989 163.079 163.209 163.419 163.649 164.409 164.799 165.349 165.739 165.979 166.499 166.089 164.519 165.559 166.259 166.219 167.699 167.789 167.879 168.119 168 [...]
+ 161.009 161.429 161.509 161.439 161.239 160.719 160.429 160.749 160.289 159.389 159.059 158.259 155.999 156.939 157.339 159.099 160.159 159.999 159.879 159.819 159.759 160.109 160.779 159.199 159.299 159.679 160.539 161.129 160.909 160.659 160.419 158.919 157.969 156.929 156.299 156.939 158.659 161.729 162.199 162.079 161.969 162.119 162.509 162.669 162.819 162.999 163.829 164.469 164.529 164.649 164.899 165.539 165.489 164.829 164.169 164.079 165.839 167.219 167.309 167.449 167.699 168 [...]
+ 160.549 160.829 160.659 160.079 158.329 157.199 158.769 160.429 159.259 157.479 156.919 157.399 159.479 159.369 159.099 158.829 159.719 159.789 159.749 159.659 159.559 159.639 159.879 158.199 156.099 155.979 156.969 161.419 161.229 160.799 160.379 160.169 159.909 160.039 160.169 160.169 159.899 160.899 161.379 161.859 162.409 162.349 162.329 162.509 162.679 162.879 163.369 163.889 164.029 164.329 164.159 163.229 164.259 165.809 166.349 166.699 166.869 167.039 167.179 167.319 167.569 167 [...]
+ 160.309 160.589 160.099 159.479 159.609 159.779 159.909 159.799 158.729 158.459 158.499 159.469 159.659 159.629 159.439 159.329 159.349 159.469 159.509 159.499 159.389 157.169 154.549 155.229 157.409 159.589 159.729 158.959 159.529 160.139 160.759 160.529 160.039 160.219 160.479 160.729 157.639 156.129 158.639 161.879 162.929 162.599 162.249 162.409 162.669 162.909 163.059 163.489 163.839 164.169 164.479 164.759 165.189 165.749 166.319 165.559 165.149 164.219 163.039 162.289 164.859 168 [...]
+ 158.489 157.749 158.739 158.119 158.069 158.019 158.089 158.679 159.119 159.139 159.129 159.169 159.299 159.169 158.999 158.809 158.739 158.879 158.909 159.149 159.389 159.379 159.159 159.139 159.149 159.109 159.089 158.979 159.399 159.809 160.369 160.239 160.339 160.599 160.849 161.089 160.929 160.869 161.319 162.009 162.679 161.019 160.369 161.349 162.339 163.129 163.059 163.039 163.239 163.479 163.799 164.259 164.749 165.319 165.889 164.699 164.719 166.499 167.209 167.239 167.669 168 [...]
+ 158.559 157.789 157.519 157.459 157.679 157.769 157.989 158.619 158.699 158.709 158.719 158.679 158.549 158.369 158.059 157.749 157.689 158.629 159.099 159.429 159.759 159.719 159.379 159.359 159.339 159.329 159.219 159.079 156.919 155.399 156.039 157.079 158.089 159.299 160.619 161.159 161.119 161.169 161.489 161.789 161.929 160.979 160.579 161.239 161.819 162.409 163.089 163.239 163.259 163.159 163.209 163.579 164.129 164.719 165.379 166.239 167.059 167.289 167.339 167.379 167.829 168 [...]
+ 158.779 158.459 157.689 157.429 157.639 157.849 158.059 158.299 158.369 158.299 158.229 158.179 158.219 156.799 154.729 152.899 154.469 158.419 158.929 159.459 159.769 159.709 159.249 159.229 159.249 159.429 159.499 159.789 160.169 160.549 160.749 161.119 161.439 160.969 160.509 160.049 160.189 160.519 160.699 160.899 160.899 157.339 156.399 158.409 160.429 161.899 162.119 162.489 162.499 162.499 162.809 163.129 163.649 164.269 164.899 165.659 166.569 167.009 167.119 167.099 167.339 167 [...]
+ 159.019 158.739 157.739 157.229 157.359 157.489 157.699 157.899 157.889 157.739 157.669 157.689 157.809 157.869 157.509 157.149 157.049 157.339 157.859 158.519 159.209 159.239 158.999 159.189 159.379 159.559 160.069 160.589 160.429 160.259 160.089 160.469 160.719 160.189 159.719 159.359 159.729 159.839 160.029 160.199 160.489 160.879 160.979 161.419 161.859 161.969 161.499 161.419 161.679 161.929 162.379 163.049 163.589 164.169 164.749 165.059 165.369 165.789 166.119 166.699 166.959 167 [...]
+ 158.169 158.239 157.289 156.909 157.049 157.149 157.289 157.479 157.419 157.259 157.099 156.779 156.529 156.739 157.089 157.239 157.079 156.449 157.059 157.809 158.549 158.859 158.929 159.109 159.259 159.409 159.799 159.939 159.779 159.799 160.049 160.359 159.949 159.679 159.409 159.139 159.009 159.009 159.219 159.429 159.779 160.929 161.639 161.749 161.849 161.799 161.329 161.219 161.429 161.799 162.129 162.719 163.339 163.929 164.649 165.019 165.139 165.639 166.229 166.829 166.959 166 [...]
+ 156.979 157.159 156.609 156.379 156.519 156.629 156.789 156.919 156.849 156.239 155.519 155.099 155.759 155.939 156.179 156.549 156.219 155.489 155.989 156.539 157.099 157.489 157.809 158.429 158.729 158.909 159.119 159.719 159.989 160.249 160.429 159.589 158.989 158.809 158.699 158.579 158.519 158.749 159.009 159.249 159.709 161.139 160.909 158.879 156.839 157.509 159.629 161.139 161.539 161.949 162.369 162.679 163.299 164.029 164.769 165.069 165.149 165.629 166.149 166.679 166.679 166 [...]
+ 156.449 156.189 156.039 155.869 155.699 155.679 155.839 156.209 155.779 154.969 154.359 155.019 156.219 155.569 155.699 155.819 156.159 156.369 156.299 156.219 155.869 155.939 156.269 156.889 157.509 158.139 159.159 160.079 160.159 160.239 160.319 159.589 159.149 158.909 158.629 158.309 158.499 158.779 159.089 159.369 159.599 160.669 161.249 161.069 160.889 160.579 160.259 160.939 161.419 161.899 162.389 162.899 163.419 163.839 164.259 164.589 164.799 165.299 165.909 166.579 166.699 166 [...]
+ 156.229 155.909 155.699 155.389 155.169 154.969 155.069 155.559 155.699 155.539 155.379 155.919 156.169 154.329 152.199 151.359 156.399 156.069 155.609 155.179 154.799 155.039 155.889 155.769 156.049 156.679 158.379 159.319 159.449 159.579 159.689 159.429 159.399 159.049 158.689 158.399 158.409 158.659 159.169 159.689 160.059 160.119 160.289 160.449 160.609 160.779 160.929 161.169 161.649 162.169 160.859 158.259 160.829 163.679 163.919 164.009 164.289 165.069 165.879 166.699 166.839 166 [...]
+ 156.149 155.709 155.119 154.809 154.489 154.169 154.379 155.279 154.219 152.569 152.789 155.959 155.929 155.759 155.739 155.779 155.549 155.209 154.919 154.639 154.349 155.169 155.749 155.649 155.549 155.479 157.009 158.329 158.499 158.659 158.879 159.119 159.169 158.869 158.559 158.269 158.409 158.529 158.449 158.849 158.279 154.969 156.019 159.459 160.559 160.829 160.979 161.399 161.949 162.489 162.859 163.089 163.309 163.519 163.729 163.789 163.779 164.489 165.259 166.039 166.539 166 [...]
+ 156.139 155.559 154.629 154.369 154.379 154.109 154.389 155.339 155.419 155.519 155.729 155.699 155.479 155.189 155.149 154.979 155.059 155.219 155.029 154.839 154.649 155.079 155.489 155.489 155.499 155.519 155.929 156.949 157.079 157.159 157.389 158.909 158.949 158.649 158.349 158.189 158.519 157.639 156.549 156.609 156.739 158.039 159.849 160.329 160.819 161.079 161.089 161.419 161.909 162.399 162.779 163.099 163.089 162.979 162.859 163.339 163.649 164.279 164.899 165.459 165.719 166 [...]
+ 155.219 154.569 153.849 153.949 154.079 154.209 154.779 155.739 155.659 155.499 155.339 155.169 154.969 152.849 150.689 148.529 155.439 154.959 154.979 154.969 154.799 155.249 155.659 155.669 155.719 155.649 151.909 152.829 153.469 154.099 156.209 157.809 158.709 158.429 158.159 157.989 158.029 157.049 156.129 156.579 157.189 158.139 159.789 160.159 160.529 160.799 160.909 160.479 159.869 159.989 158.879 157.539 159.659 161.799 162.329 162.449 163.179 163.809 164.429 164.999 165.049 165 [...]
+ 154.519 154.309 154.179 154.329 154.569 154.819 154.979 155.139 154.929 154.659 154.469 154.359 155.079 155.189 155.469 155.779 155.169 154.519 154.759 154.999 155.239 155.709 154.949 153.419 153.829 154.299 155.339 156.559 156.809 157.019 157.289 157.909 158.399 158.529 158.719 158.829 158.339 158.019 157.949 158.169 158.109 158.179 158.649 159.119 159.929 158.869 156.959 157.769 159.119 161.399 161.299 159.959 161.039 162.229 163.469 162.929 162.449 162.999 163.529 164.049 164.859 165 [...]
+ 154.239 154.239 153.779 153.919 154.209 154.399 154.519 151.659 151.319 151.839 153.529 154.789 155.589 155.599 155.699 155.799 155.399 154.749 155.099 155.429 155.679 155.269 154.309 152.019 150.259 149.659 153.769 156.629 156.849 157.019 157.279 157.789 158.059 158.349 158.559 158.559 158.109 158.089 158.029 157.969 157.729 157.189 157.809 158.759 159.719 160.159 160.119 160.399 160.809 161.589 162.759 163.739 163.749 163.579 163.399 163.009 162.479 162.639 162.799 162.899 164.199 165 [...]
+ 153.399 153.749 153.169 153.349 153.709 154.059 154.319 154.239 154.199 154.319 154.449 154.569 154.649 154.349 154.109 154.209 154.029 154.349 154.759 155.159 155.409 155.469 155.659 155.449 154.919 154.579 155.689 156.009 156.249 156.479 156.859 157.129 157.369 157.509 157.649 157.689 157.489 157.489 157.589 157.689 157.499 157.869 158.629 159.229 159.829 160.119 159.779 160.279 160.959 161.609 161.699 162.239 162.339 162.469 162.899 163.049 162.699 162.979 162.799 161.789 164.289 165 [...]
+ 153.949 153.759 153.619 153.709 153.859 154.009 153.899 153.659 153.699 153.759 153.729 153.769 153.759 153.829 153.449 153.059 153.149 153.489 153.989 154.539 155.079 155.629 155.409 154.979 154.539 154.299 154.649 155.009 155.419 155.839 156.209 156.639 156.909 156.839 156.659 156.509 156.449 156.619 156.809 156.909 156.969 157.239 158.019 158.799 159.429 159.509 159.399 159.979 160.599 161.249 161.199 161.079 161.449 161.819 162.249 162.589 162.929 163.169 163.389 163.629 164.419 165 [...]
+ 153.859 153.579 153.289 153.289 153.329 153.389 153.159 152.829 153.089 153.179 153.279 152.919 152.799 152.999 153.209 153.209 153.579 154.049 154.349 154.649 154.899 154.449 154.219 154.009 153.859 153.789 154.319 154.839 155.169 155.059 155.139 155.599 155.649 155.509 155.369 155.459 155.319 155.499 155.739 156.039 156.169 156.159 156.889 157.789 158.689 159.179 159.549 160.189 160.879 161.569 161.299 160.929 161.229 161.409 161.589 161.699 162.019 162.489 162.949 163.489 164.099 164 [...]
+ 150.219 151.069 152.699 152.709 152.749 152.779 152.229 152.329 152.689 153.059 153.419 152.629 151.959 153.049 154.039 154.269 154.579 154.589 154.979 155.369 155.629 154.969 154.479 154.229 153.609 153.159 153.879 153.939 153.839 153.749 153.809 154.139 154.259 154.779 155.289 155.499 155.119 155.469 156.019 156.489 156.589 156.359 157.079 157.679 158.249 159.009 159.629 160.289 160.479 160.529 161.099 160.759 160.849 160.939 160.939 161.169 161.389 161.839 162.369 162.919 163.439 164 [...]
+ 151.819 152.059 152.689 152.529 152.339 152.229 150.909 150.499 150.699 151.819 152.949 151.859 151.009 152.239 153.459 154.689 154.699 154.879 155.209 155.569 155.629 152.529 152.339 152.679 152.629 152.219 152.509 152.549 152.829 153.359 153.759 154.169 154.669 155.089 155.179 155.069 154.999 155.209 155.679 156.209 156.569 156.429 156.859 157.389 157.659 158.509 159.379 159.319 159.189 159.059 159.709 160.379 160.439 160.419 160.389 160.829 161.229 161.789 162.399 162.929 163.149 163 [...]
+ 151.909 152.039 151.759 152.109 152.139 151.939 152.379 152.959 152.709 152.659 152.609 151.749 151.079 152.219 153.359 154.299 155.149 155.639 155.509 154.199 153.279 155.149 155.589 154.119 152.629 151.629 151.689 151.909 152.379 152.919 153.639 154.239 154.469 154.559 154.639 154.919 155.389 155.619 155.779 155.939 156.139 156.379 156.349 156.419 156.499 157.539 158.899 158.859 158.789 158.729 158.849 159.329 159.399 159.729 160.129 160.429 160.999 161.799 162.609 163.319 163.369 163 [...]
+ 151.679 150.889 150.259 150.609 151.009 151.549 152.289 152.889 152.439 151.989 151.749 150.969 150.639 151.269 151.239 151.279 153.149 154.949 155.269 155.589 155.789 155.189 154.259 153.039 151.719 151.349 151.129 151.359 151.689 152.019 152.729 153.709 153.929 154.009 154.089 154.379 154.689 155.179 155.709 156.059 156.199 156.379 156.289 156.189 156.089 156.689 158.119 158.139 158.179 158.509 158.649 158.859 159.259 159.659 160.039 160.299 160.649 161.229 161.939 162.639 163.259 163 [...]
+ 151.319 150.619 149.829 150.359 150.889 151.429 152.019 152.279 151.859 151.369 150.809 150.239 150.059 150.719 151.399 152.109 153.129 153.879 154.319 154.759 154.979 154.219 152.329 150.469 148.799 149.089 151.519 152.109 152.979 153.619 154.189 154.079 154.039 154.029 153.969 154.089 154.309 154.539 155.059 155.589 156.009 156.149 156.119 156.089 156.059 156.659 157.409 157.779 158.149 158.499 158.619 158.779 159.109 159.449 159.789 160.129 160.539 161.099 161.639 162.139 162.619 163 [...]
+ 150.209 149.749 149.569 149.939 150.349 150.759 151.229 151.099 150.239 150.099 149.789 149.699 149.939 150.619 151.299 152.029 151.689 151.709 152.519 153.339 153.799 154.019 152.049 149.029 146.019 146.509 150.809 152.049 152.689 153.519 153.939 154.189 154.319 154.249 154.179 154.229 154.389 154.619 154.869 155.089 155.379 155.729 155.829 155.859 155.889 156.379 157.029 157.339 157.539 157.749 158.029 158.219 158.599 158.819 159.029 159.349 159.789 160.509 161.239 161.889 162.259 162 [...]
+ 149.499 148.979 148.869 149.199 149.529 149.849 150.289 150.039 147.769 145.509 143.579 145.439 148.019 150.109 150.729 150.959 149.409 149.469 150.479 151.489 151.849 150.779 150.999 151.409 151.829 152.069 152.049 152.319 152.639 152.969 153.589 154.489 154.519 154.359 154.189 154.109 153.149 153.629 154.149 154.369 154.369 154.589 154.759 154.999 155.349 156.049 156.579 156.739 156.889 156.909 157.539 157.769 157.759 157.749 157.939 157.999 158.709 159.909 160.819 161.599 162.089 162 [...]
+ 149.309 148.579 148.019 148.399 148.729 149.049 149.439 149.269 148.349 147.439 146.629 145.429 145.739 147.489 149.229 150.189 149.169 149.119 149.759 150.399 150.829 150.839 151.069 151.389 151.719 151.939 152.019 152.299 152.349 152.389 152.869 153.729 153.809 153.799 154.199 153.379 152.089 152.569 153.209 153.849 153.909 153.829 154.109 154.379 154.669 155.399 156.029 155.919 155.829 155.849 156.989 157.689 157.619 157.559 157.689 158.579 158.669 160.049 160.789 161.289 161.589 161 [...]
+ 148.609 147.659 147.059 147.439 147.819 148.189 148.249 148.009 147.469 147.189 146.559 143.229 144.749 147.419 148.299 148.849 148.579 149.179 149.869 150.519 150.899 150.209 150.119 150.259 150.589 150.889 151.549 151.719 151.739 151.729 152.359 153.179 153.629 154.049 154.439 154.399 154.049 154.009 153.979 153.949 153.989 153.929 154.059 154.129 154.199 154.519 155.059 154.939 155.049 155.419 156.489 157.269 157.239 157.219 157.459 158.379 159.219 160.009 160.799 161.329 161.329 161 [...]
+ 147.899 147.139 146.569 146.719 146.869 147.239 147.319 147.539 147.869 147.689 147.299 146.269 146.329 146.849 147.519 148.039 148.319 148.889 149.409 149.929 149.989 149.349 149.389 149.469 149.549 150.159 151.169 151.159 151.119 151.079 151.839 152.999 153.349 153.579 153.799 153.889 154.349 154.049 153.779 153.749 153.969 153.939 153.929 153.899 153.829 154.329 154.669 154.939 155.219 155.499 156.339 156.839 156.889 156.929 157.199 157.579 158.569 159.569 160.249 160.879 161.429 161 [...]
+ 147.329 146.169 143.849 144.569 145.559 146.469 146.559 146.759 147.119 147.469 147.759 147.449 147.469 148.019 148.569 148.949 148.379 148.459 148.839 149.219 149.409 149.319 149.389 149.629 149.869 150.379 150.539 150.509 150.409 150.239 151.109 152.329 152.589 152.839 153.259 153.759 153.899 151.649 151.039 151.079 151.189 153.369 152.519 153.509 153.679 154.359 154.919 155.139 155.359 155.609 155.989 156.329 156.829 157.389 158.069 159.039 159.479 159.079 158.129 159.839 161.099 161 [...]
+ 147.069 146.669 145.929 145.859 145.789 145.829 145.959 146.199 146.559 146.919 147.199 146.869 147.189 148.009 148.489 148.599 148.059 148.199 148.589 148.969 149.159 149.119 149.309 149.549 149.799 149.969 150.259 147.979 148.489 149.139 149.919 150.739 151.429 152.119 152.809 153.159 153.089 151.519 151.799 152.079 149.819 152.359 151.199 150.389 150.329 152.439 154.669 154.929 155.429 155.519 153.759 155.399 157.479 158.149 158.319 158.469 159.189 160.009 160.829 161.379 161.219 161 [...]
+ 145.669 146.579 146.159 145.699 145.369 145.209 145.449 145.569 145.639 145.949 146.079 145.629 146.009 146.869 147.729 148.119 147.669 147.839 148.249 148.659 148.869 148.789 149.159 149.379 149.609 149.979 150.449 148.319 146.159 144.009 146.219 149.879 150.259 150.839 151.849 152.619 152.879 152.779 152.769 152.879 153.399 152.899 153.229 153.469 153.419 153.669 154.319 155.109 155.689 156.219 156.629 157.159 157.789 158.419 158.829 158.109 158.389 159.459 160.519 161.269 161.659 161 [...]
+ 146.419 146.829 145.559 143.779 142.699 142.859 145.069 145.739 145.339 144.939 144.809 145.819 146.269 146.479 146.889 147.229 147.079 147.409 147.869 148.319 148.299 147.869 148.469 149.169 149.719 149.869 149.489 149.349 149.309 149.589 149.869 149.969 150.529 150.919 151.319 152.029 152.589 152.469 152.359 152.059 152.689 153.109 153.049 152.999 152.949 152.809 153.299 154.339 155.379 156.019 156.339 156.819 157.389 157.949 158.509 159.049 159.509 159.899 160.249 160.919 161.479 161 [...]
+ 147.099 146.659 145.679 145.079 144.479 144.779 145.889 146.139 145.819 145.619 145.769 146.419 146.639 146.809 146.989 146.959 146.469 146.959 147.459 147.949 147.829 146.989 147.919 148.719 149.459 149.299 149.039 149.289 149.529 149.659 149.589 149.579 150.189 150.799 151.349 152.119 152.719 152.239 151.719 151.209 152.169 152.709 152.759 152.899 152.999 152.809 152.909 153.479 154.519 154.699 152.679 153.429 155.139 156.949 157.239 155.299 156.439 157.229 159.289 159.999 161.379 161 [...]
+ 146.419 146.479 146.189 145.649 145.109 144.979 145.969 146.149 145.949 145.779 145.839 146.389 146.629 146.769 146.909 146.909 140.769 144.469 147.259 147.499 147.039 146.099 147.109 148.109 149.119 149.629 149.859 149.319 148.759 148.199 148.219 149.109 149.439 149.939 150.559 152.239 152.289 149.899 147.499 147.349 147.529 148.019 149.349 151.329 153.009 152.839 152.989 153.539 154.079 154.649 155.269 155.969 156.729 157.479 158.219 159.019 159.859 160.709 161.119 161.459 161.879 161 [...]
+ 145.759 146.079 145.959 145.409 144.879 144.719 145.519 145.679 145.449 145.229 145.209 145.379 145.679 146.019 146.259 146.249 145.979 145.399 145.679 146.669 146.479 146.669 147.039 147.399 148.409 148.849 148.679 146.779 144.879 145.409 146.289 148.689 149.009 149.329 149.659 151.089 152.369 152.419 152.039 151.549 150.669 151.139 152.079 151.769 152.689 152.539 152.719 153.319 153.939 154.519 155.019 155.739 156.689 157.639 158.209 158.349 159.189 160.119 161.049 160.219 159.179 159 [...]
+ 145.259 145.499 145.349 144.789 144.229 144.099 144.909 145.069 144.919 144.719 144.579 144.449 145.149 145.629 146.029 145.779 145.079 144.539 144.159 143.779 144.789 146.919 147.509 147.879 148.249 148.259 148.139 148.509 148.839 149.159 148.649 148.279 148.619 148.989 149.369 149.339 150.509 151.029 151.549 151.199 147.969 147.569 148.819 150.899 152.509 152.379 152.639 153.259 154.009 154.699 155.239 156.059 157.009 157.939 158.399 158.439 159.109 159.929 160.689 160.949 160.899 160 [...]
+ 144.909 144.919 144.729 144.409 143.859 143.739 144.339 144.359 144.199 144.049 143.809 143.489 144.249 145.149 146.119 144.569 143.079 145.509 145.209 144.899 145.469 146.489 147.079 147.669 148.179 147.939 147.629 148.129 148.639 148.999 148.479 148.359 149.209 149.699 149.979 149.779 149.609 150.219 150.929 151.539 151.259 151.469 151.909 152.279 152.339 152.259 152.679 153.509 154.339 154.979 155.369 156.469 157.429 158.349 158.869 158.829 158.809 159.169 159.709 160.119 160.349 160 [...]
+ 144.4 144.259 144.059 143.759 143.449 143.159 143.259 143.279 143.259 143.209 142.959 138.889 141.629 144.599 146.379 146.609 146.129 145.849 145.559 145.179 145.699 145.959 143.879 141.789 141.629 143.799 147.149 147.479 147.979 148.489 148.249 148.369 149.219 150.049 150.709 149.479 150.329 150.849 151.359 151.879 151.969 151.959 151.919 151.989 152.049 152.289 152.769 153.429 154.109 154.709 154.989 156.129 157.499 158.879 159.539 159.649 159.409 159.119 159.039 159.839 160.409 160.4 [...]
+ 144.06 144.17 143.979 143.669 143.369 143.079 142.959 143.019 143.079 143.079 143.419 144.099 144.479 145.249 146.019 146.189 146.059 145.859 145.599 145.339 145.679 146.379 146.179 145.969 145.689 146.229 146.789 147.089 147.399 147.739 147.619 147.859 148.769 149.689 150.209 145.419 144.859 147.769 150.679 152.019 152.509 152.669 152.639 152.609 152.649 152.309 152.519 153.389 154.059 154.259 154.359 155.389 156.659 158.019 158.409 158.269 158.019 158.259 158.719 159.549 160.489 160.2 [...]
+ 143.71 143.51 143.61 143.749 143.449 143.239 143.159 143.049 143.109 143.159 143.719 144.609 144.889 145.139 145.389 145.569 145.699 145.589 145.489 145.399 146.249 147.059 146.679 146.249 145.819 146.399 146.949 147.229 147.459 147.679 147.529 147.599 147.769 148.659 149.409 149.089 149.899 150.839 151.629 152.359 152.829 153.079 153.099 152.969 152.579 151.739 152.229 153.139 154.039 154.209 153.859 154.739 155.979 157.209 157.589 157.199 157.479 157.939 158.399 159.249 160.169 159.93 [...]
+ 142.9 142.39 142.51 142.83 143.199 143.409 143.389 142.939 142.419 142.259 142.849 143.789 144.129 144.439 144.659 144.899 144.959 145.169 145.349 145.289 145.949 146.329 146.009 145.989 146.139 146.699 146.659 147.679 147.859 148.039 148.099 147.969 147.999 148.019 148.169 148.949 149.679 149.739 149.799 149.899 151.769 153.049 152.819 152.589 152.379 152.749 153.239 153.589 153.939 154.169 154.209 154.919 155.799 156.839 157.459 157.569 157.799 157.999 158.149 158.469 159.049 158.299 [...]
+ 142.25 141.8 142.13 142.67 143.18 143.319 142.649 142.689 142.489 141.989 142.259 143.019 143.309 143.659 144.009 143.899 143.869 144.119 144.469 144.819 145.329 145.679 145.989 146.159 146.339 145.609 145.639 146.669 147.679 148.599 148.259 147.969 147.999 148.039 148.109 148.469 149.319 150.249 151.169 151.189 152.369 152.899 152.609 152.319 151.249 149.139 149.739 151.579 153.419 154.239 154.339 155.139 155.989 156.579 156.899 157.119 157.389 157.649 157.849 157.879 157.809 158.069 1 [...]
+ 141.9 141.17 141.43 141.89 142.35 142.14 141.349 141.429 141.569 141.699 142.239 142.979 143.179 143.379 143.629 143.519 143.389 143.679 143.969 144.269 144.459 144.709 145.149 145.589 145.859 145.379 145.269 145.319 146.109 146.969 146.909 147.359 148.169 148.179 148.229 148.459 148.769 149.519 150.379 151.239 152.029 152.169 151.969 151.909 151.979 152.549 153.109 153.649 154.189 154.489 154.439 154.919 155.459 155.999 156.339 156.599 156.499 155.739 154.979 156.009 158.029 158.639 15 [...]
+ 140.96 139.98 140.32 140.83 141.33 141.12 140.37 141.199 142.059 142.619 142.959 142.909 142.899 143.019 143.209 141.519 142.149 143.109 142.489 141.859 144.099 144.229 144.579 145.009 145.429 145.289 145.519 145.569 145.619 145.649 145.489 145.979 146.859 147.739 148.469 148.529 148.849 149.319 149.789 149.829 149.939 150.579 151.449 152.159 152.199 152.099 152.609 153.129 153.659 154.079 154.369 154.879 155.429 155.979 156.539 156.989 157.569 158.089 158.609 157.939 157.719 158.319 15 [...]
+ 139.87 139.16 140.01 140.96 141.77 141.17 138.88 140.63 141.659 142.699 142.979 142.789 142.829 142.819 142.809 140.169 137.589 141.959 143.339 143.629 143.769 144.069 144.419 144.769 145.119 145.579 145.869 145.999 146.129 146.189 145.829 145.759 145.939 146.709 147.679 148.539 148.789 149.129 149.529 149.429 149.649 150.899 151.489 151.859 152.029 152.169 152.579 153.029 153.269 153.679 154.079 154.649 155.219 155.899 157.159 157.919 158.179 158.449 158.719 157.679 157.059 157.849 158 [...]
+ 139.6 138.91 139.71 140.49 141.26 141.42 140.59 141.62 142.2 142.669 142.659 142.269 142.459 142.639 142.699 142.539 142.499 142.599 142.689 142.949 143.499 144.069 144.439 144.809 145.169 144.859 144.959 145.789 146.219 146.299 146.029 146.069 146.269 146.479 146.979 148.199 148.709 148.999 149.339 149.729 150.339 149.689 148.589 149.079 149.659 149.979 150.779 151.659 152.539 152.659 153.929 154.569 155.209 155.839 157.229 158.699 158.469 158.409 158.449 155.759 155.929 155.739 155.53 [...]
+ 139.82 139.52 139.72 139.93 140.17 140.72 141.36 141.08 140.92 141.4 141.4 141.749 141.579 141.759 141.929 142.199 142.579 142.599 142.649 142.709 143.299 143.609 144.259 144.629 144.829 143.749 143.739 144.609 145.489 146.149 146.099 146.089 146.109 146.139 146.679 148.249 148.819 148.969 149.129 149.439 150.009 150.689 151.399 152.059 152.409 152.569 152.009 151.069 150.129 151.729 154.419 155.079 155.759 156.439 157.789 159.079 159.029 158.869 158.699 158.319 158.379 158.719 159.059 [...]
+ 140.07 140.07 139.93 139.92 140.03 140.65 141.19 141.76 141.54 141.22 141.27 141.33 141.139 140.939 140.829 141.939 142.829 142.769 142.589 142.359 142.389 142.729 143.389 144.079 144.539 141.609 140.849 141.909 144.849 145.479 146.009 146.249 146.139 145.869 146.369 148.069 148.879 149.389 149.769 150.109 150.689 151.349 151.759 152.179 152.499 152.139 151.839 151.559 151.829 152.589 154.189 154.929 155.689 156.499 157.439 158.509 158.839 159.159 159.499 158.999 158.589 158.649 158.749 [...]
+ 140.61 140.44 140.22 140.05 139.88 139.94 140.33 140.9 141.48 142.02 142 141.63 141.37 140.989 140.609 141.799 142.079 141.919 141.719 141.499 142.259 143.079 143.429 143.889 144.299 143.689 143.909 144.499 144.729 145.119 145.919 145.239 143.839 144.349 145.979 147.829 148.629 149.119 149.629 150.009 150.449 150.919 151.369 151.719 151.639 151.379 151.989 152.639 153.279 153.589 153.849 154.659 155.469 156.279 157.249 158.099 158.339 158.629 158.959 158.939 158.729 158.719 158.659 158. [...]
+ 140.99 140.68 140.36 140.05 139.77 139.59 139.33 139.81 140.32 140.86 141.04 141.33 140.99 140.66 140.449 140.819 141.049 141.109 141.179 141.379 142.549 143.199 143.779 144.139 144.349 144.019 143.909 143.979 144.049 144.479 145.489 145.729 146.059 146.399 146.659 147.489 148.409 148.869 149.179 149.329 149.579 150.149 150.439 150.739 150.819 151.069 151.639 152.099 152.569 153.099 153.559 154.379 155.209 156.049 157.049 157.909 158.219 158.539 158.829 158.379 158.369 158.379 158.399 1 [...]
+ 141.22 140.66 140.26 139.89 139.56 138.84 138.29 138.77 139.25 139.74 140.37 140.69 140.5 140.3 140.14 140.429 140.679 140.899 141.129 141.419 142.059 142.709 143.359 144.009 144.419 143.989 143.889 144.149 144.429 144.979 145.529 146.029 146.529 147.009 147.479 147.939 147.359 146.569 146.569 146.979 149.259 149.719 149.949 150.179 150.659 150.979 151.379 151.779 152.199 152.729 153.399 154.229 154.999 155.609 156.519 157.359 157.909 158.459 158.909 158.309 157.979 158.199 158.429 158. [...]
+ 140.08 140.41 140.15 139.75 139.34 134.57 139.31 138.72 138.17 138.65 139.32 139.85 140 139.94 139.79 140.03 140.169 140.489 140.719 141.029 141.849 142.489 142.949 143.499 143.879 143.859 144.129 144.429 144.639 144.949 145.409 145.989 146.529 147.029 147.529 147.949 148.019 148.159 148.289 148.569 149.049 149.289 149.509 149.739 150.249 150.879 151.329 151.779 152.239 152.729 153.239 153.799 154.359 154.959 155.939 156.629 156.659 156.969 157.339 158.279 158.279 158.349 158.229 158.27 [...]
+ 138.91 139.4 139.4 139.4 139.22 139.27 139.09 138.66 138.21 137.7 136.87 137.98 138.06 138.51 139.37 139.27 139.41 139.769 140.219 140.769 141.509 141.999 142.649 143.109 143.509 143.809 144.289 144.449 144.619 144.869 145.279 145.859 146.489 147.109 147.579 147.869 147.929 147.949 147.979 148.239 148.619 148.919 149.249 149.579 149.989 150.499 150.929 151.279 151.629 152.449 153.109 153.689 154.319 154.949 155.759 156.329 156.139 156.029 155.909 156.949 157.469 157.439 157.409 157.629 [...]
+ 139.3 138.47 138.12 138.07 138.03 138.26 138.32 137.8 137.29 136.78 136.41 136.7 137.32 138.09 138.91 138.95 139.25 139.63 139.999 140.139 139.349 139.949 141.139 142.339 143.129 144.469 144.929 145.099 145.259 145.499 145.579 145.949 146.389 146.969 146.139 144.939 144.749 144.549 144.519 145.649 148.539 148.859 149.139 149.349 150.009 150.439 150.709 150.979 151.189 151.729 152.529 153.209 153.899 154.879 155.469 156.159 156.779 157.409 157.749 156.509 156.429 157.009 157.589 158.619 [...]
+ 138.59 137.85 137.34 136.82 136.51 137.22 137.68 137.14 137.01 136.93 136.99 136.08 134.96 134.99 135.44 137.31 139.42 139.9 140.35 140.119 137.379 138.269 139.689 141.099 142.409 143.619 144.309 144.799 145.029 145.239 145.569 145.489 145.279 145.079 144.739 145.359 145.489 145.829 147.539 148.439 148.549 148.709 148.869 149.029 149.699 150.459 150.679 150.889 151.079 151.289 151.749 152.739 153.729 154.689 155.149 155.619 157.029 158.029 158.269 156.709 159.049 158.789 158.489 158.399 [...]
+ 137.7 137.11 136.98 136.62 136.1 136.93 137.49 137.42 137.33 137.26 137.45 137.02 138.22 138.64 139 139.03 139.36 139.87 140.37 140.84 141.229 140.089 139.859 140.229 140.929 142.209 142.699 143.239 143.779 144.559 145.449 145.659 145.859 146.059 145.209 145.199 145.629 146.069 147.189 148.129 148.629 148.839 149.049 149.259 149.579 150.109 150.359 150.729 151.099 151.179 151.599 152.439 153.349 154.269 154.339 154.809 155.369 156.099 157.239 158.789 159.339 158.999 158.369 156.949 158. [...]
+ 136.91 136.3 136.31 136.32 136.33 137.07 137.58 137.52 137.46 137.41 137.56 137.7 137.85 138.1 138.45 138.43 138.8 139.43 140.06 140.64 141.04 139.839 138.599 138.479 138.299 142.209 142.379 142.199 142.319 142.549 144.559 145.019 145.209 145.229 146.269 146.859 147.129 147.399 147.659 146.169 145.789 148.019 149.169 149.369 149.769 150.109 150.479 150.839 151.109 151.659 152.019 152.819 153.619 154.069 154.139 154.759 155.979 157.209 158.339 159.249 159.489 159.289 158.729 158.439 159. [...]
+ 137.18 136.9 137.08 137.25 137.43 137.72 136.7 133.98 131.64 135.76 137.55 137.44 137.49 137.63 137.68 137.52 138.05 138.96 139.86 140.58 140.78 141.02 141.269 141.459 142.219 143.049 143.269 143.439 143.339 143.559 144.139 144.069 143.969 143.889 145.129 146.959 145.679 145.519 145.599 145.789 148.679 148.899 149.119 149.309 149.769 150.189 150.469 150.749 151.039 152.019 152.819 153.349 153.869 154.309 154.379 155.039 156.319 157.599 158.699 159.219 158.559 156.769 154.979 156.349 158 [...]
+ 137.14 136.98 137.07 137.17 137.29 137.69 137.79 136.64 134.11 137.34 137.26 137.14 137.01 136.87 136.87 137.67 138.49 139.22 139.47 139.76 140.16 140.79 141.04 141.289 142.139 143.389 142.599 143.099 142.999 143.339 144.059 144.009 143.999 143.989 145.499 147.389 147.049 147.769 148.489 148.089 148.449 148.529 148.609 148.679 149.419 149.979 150.169 150.179 150.299 151.809 152.669 153.309 154.049 154.709 154.899 155.599 156.689 157.549 158.429 159.159 159.249 159.159 158.949 158.529 15 [...]
+ 136.77 136.75 136.79 136.83 136.89 137.27 137.37 137.27 137.17 137.06 136.81 136.79 136.88 136.78 136.99 137.44 137.54 137.69 137.93 138.24 139.18 140.02 140.83 141.59 142.199 142.599 141.219 139.769 138.339 140.519 144.199 142.999 141.809 140.759 142.309 144.849 145.109 146.429 147.749 148.459 148.519 148.479 148.439 148.389 148.779 149.369 149.339 149.309 149.629 151.269 152.569 153.349 154.139 154.709 154.519 155.029 155.909 156.779 157.639 158.439 157.809 158.379 158.129 157.609 156 [...]
+ 136.29 136.29 136.23 136.17 136.21 136.53 136.59 136.46 136.35 136.25 136.21 136.35 136.44 136.52 136.4 136.18 136.29 135.69 134.52 134.65 138.66 139.31 140.07 140.92 141.5 141.879 142.129 142.379 142.669 143.429 144.229 144.219 144.209 144.199 145.609 147.339 147.799 147.879 147.959 146.739 145.919 146.789 147.659 148.519 148.589 148.799 149.459 150.129 150.809 151.639 152.429 153.249 154.069 154.579 153.889 154.199 155.099 155.999 156.719 157.209 156.479 155.229 153.979 154.849 157.63 [...]
+ 135.96 134.54 132.1 131.63 136.19 136.08 136.14 136.03 135.91 135.77 136.29 136.4 136.34 136.27 136.13 131.97 137.45 138.15 138.47 138.88 139.56 139.89 140.2 140.51 140.84 141.2 141.509 141.829 142.159 143.009 143.969 144.199 144.659 145.109 145.769 146.829 147.369 147.909 148.459 148.159 147.899 148.229 148.459 148.699 148.829 149.159 149.999 150.819 151.489 152.099 152.869 153.309 153.629 153.939 154.019 154.199 154.899 155.599 155.989 156.409 156.889 157.369 157.889 156.719 155.559 1 [...]
+ 135.38 133.88 132.03 130.54 136.61 137.29 137.28 136.82 136.35 136.13 136.08 136.27 136.55 136.5 136.83 137.86 137.92 137.78 137.93 138.39 139.23 139.5 139.76 140.06 140.38 140.68 141.3 141.829 142.139 142.729 143.639 143.259 142.879 142.759 144.459 146.509 147.039 147.569 148.119 148.029 148.179 148.409 148.479 148.439 148.999 149.349 150.129 150.979 151.789 152.409 152.769 152.969 153.149 153.389 153.759 154.329 155.019 155.699 156.019 155.829 156.399 157.109 157.819 157.609 159.769 1 [...]
+ 134.99 135.22 135.81 136.41 136.94 137.25 137.09 136.67 136.37 136.07 135.41 134.63 134.67 134.72 135.65 137.84 138.31 138.02 137.73 138.07 139.08 139.33 139.57 139.75 139.95 140.29 140.89 141.52 142.139 142.829 143.449 143.639 143.639 143.629 145.079 146.149 146.659 147.149 147.649 145.359 145.839 146.649 147.449 147.819 148.659 149.539 150.299 151.059 151.789 152.469 152.829 152.919 153.039 153.289 153.809 154.229 154.619 155.009 155.619 155.969 156.539 157.289 158.109 159.289 160.669 [...]
+ 134.42 134.76 135.45 136.01 136.53 136.78 136.92 136.71 136.42 134.44 128.83 134.36 131.92 129.48 131.97 137.72 137.99 137.7 137.4 138 139.05 139.2 139.34 139.49 139.85 140.37 140.94 141.51 142.09 142.629 143.079 143.669 144.249 144.509 145.139 145.349 145.909 146.469 146.999 146.309 147.939 147.889 147.849 147.829 148.219 149.169 150.259 151.319 152.029 152.549 152.859 152.989 153.109 153.299 153.669 153.889 153.989 154.089 154.699 155.799 157.039 157.939 158.739 159.779 159.439 159.87 [...]
+ 133.06 133.46 134.28 135.19 135.75 135.37 135.54 135.89 136.23 136.2 135.96 134.01 131.76 131.7 137.59 138.02 138.25 138.48 138.57 138.82 138.83 138.97 139.23 139.5 139.95 140.7 141.29 141.88 142.45 142.83 143.069 143.249 143.809 144.389 142.269 142.789 145.049 145.599 146.149 146.349 146.759 146.929 147.119 147.569 147.989 148.789 150.029 151.139 151.169 147.999 148.629 149.679 150.719 153.249 153.689 154.089 154.519 154.829 155.169 155.629 156.889 158.139 159.359 160.269 160.929 160.9 [...]
+ 130.45 131.18 133.38 134.54 135.04 134.25 134.64 135.24 135.7 135.83 134.88 134.55 132.8 131.04 137.48 137.81 137.94 138.07 138.19 138.29 138.46 138.88 139.16 139.44 140.12 140.76 141.43 142.01 142.59 142.97 143.3 143.509 143.729 143.939 144.489 144.909 145.049 145.179 145.309 145.289 145.499 145.949 146.389 146.849 147.369 148.259 149.579 150.869 151.929 152.079 152.359 152.709 152.119 152.319 153.729 154.099 154.469 154.839 155.079 155.309 155.969 156.809 158.029 159.149 160.039 160.0 [...]
+ 132.77 132.43 132.03 131.63 132.03 133.18 133.64 134.4 134.54 135.29 134.1 133.5 133.88 135.82 136.74 137.33 137.41 137.49 137.56 137.69 137.89 138.32 138.76 139.18 139.61 140.09 140.83 141.56 142.26 142.66 143 143.26 143.609 143.949 144.489 144.999 145.469 145.949 146.189 146.149 145.809 145.109 144.809 144.719 146.399 147.959 148.839 150.019 151.139 151.819 152.109 152.809 153.679 152.749 149.959 151.459 153.319 154.689 154.999 155.239 155.849 156.469 157.059 158.049 159.229 159.439 1 [...]
+ 127.08 128.38 130.63 132.17 132.2 129.23 131.33 128.84 128.46 137.6 136.65 136.54 136.36 135.97 136.19 136.61 136.79 136.9 136.96 137.14 137.69 138.3 138.87 139.31 139.6 139.91 140.49 141.21 141.97 142.39 142.72 143.41 143.79 144.129 144.629 144.349 145.189 145.639 146.079 146.309 146.449 146.749 147.009 147.199 147.379 147.699 148.559 149.439 150.399 151.249 152.199 153.159 154.049 154.579 154.179 154.349 154.669 154.999 155.389 155.809 156.119 156.409 156.689 157.549 158.499 158.999 1 [...]
+ 132.52 132.46 132.34 132.14 129.92 127.23 134.65 133.43 131.33 133.44 136.75 136.34 135.89 135.45 135.32 135.56 135.74 135.98 136.26 136.77 137.44 138 138.6 139.19 139.55 139.96 140.56 141.14 141.71 141.38 142.14 142.59 143.04 144.25 142.94 142.719 143.659 144.589 145.639 145.969 146.169 146.249 146.349 146.549 147.119 147.559 148.049 148.589 149.569 150.709 151.799 152.799 153.799 154.389 154.489 154.699 154.979 155.259 156.049 156.889 156.979 156.999 157.019 157.299 158.229 158.739 15 [...]
+ 131.96 131.9 131.87 131.87 132.57 133.58 134.73 135.24 135.75 136.31 136.93 136.31 135.62 134.93 134.75 134.88 135.09 135.31 135.56 136.24 137.04 137.57 138.1 138.66 138.9 139.25 140 140.75 141.38 138.78 138.59 139.71 141.58 143.31 141.96 142.24 143.019 144.149 145.239 145.559 145.739 145.849 146.079 146.269 146.589 147.129 147.649 148.159 149.339 151.189 152.299 152.939 153.559 154.269 154.979 155.169 155.339 155.469 156.299 157.359 157.459 157.559 157.639 157.799 158.049 158.439 158.8 [...]
+ 132.48 132.23 132.03 131.93 132.63 133.15 134.08 135.03 135.97 136.31 136.1 135.47 134.84 134.49 134.38 134.43 134.86 135.29 135.72 136.42 136.85 137.2 137.69 138.22 138.35 139.36 139.86 140.66 141.45 141.76 141.97 142.28 142.58 142.47 142.54 142.98 143.61 144.239 144.819 145.099 145.409 145.699 145.999 146.419 145.329 145.909 146.719 147.519 148.169 148.779 149.999 151.429 152.849 153.889 154.729 155.029 155.279 155.499 156.359 157.359 157.539 157.699 157.769 157.859 157.909 157.969 15 [...]
+ 132.36 131.74 131.44 131.17 131.35 131.94 132.77 133.61 134.45 134.92 135.24 135.08 134.74 134.42 134.3 134.36 134.88 135.48 136.32 136.72 136.84 137.16 137.52 137.87 139.08 140.23 140.77 141.26 141.74 141.86 141.88 141.76 141.64 141.54 142.21 142.88 143.4 143.91 144.399 144.629 144.819 144.889 144.959 145.539 147.219 147.699 147.739 147.779 148.259 149.139 150.289 151.519 152.749 153.729 154.359 154.829 155.179 155.519 156.089 156.869 157.039 157.179 157.329 157.999 158.139 157.899 157 [...]
+ 131.7 131.06 130.37 129.75 130.33 132.67 132.61 132.53 132.76 133.45 134.31 134.58 134.85 134.66 134.45 134.48 135.41 136.33 137.21 137.27 137.19 137.32 137.45 137.75 138.64 139.7 140.54 141.37 142.03 141.84 141.6 141.41 141.38 141.5 142.33 142.95 143.4 143.91 144.37 144.329 144.229 144.189 144.359 144.949 145.129 145.949 147.069 147.569 148.489 149.659 150.099 150.789 151.959 153.019 153.819 154.329 154.879 155.589 156.159 156.719 156.759 156.789 156.859 157.479 157.929 157.659 157.399 [...]
+ 132.35 129.99 127.45 125.28 130.49 132.44 130.11 128.54 128.36 129.73 133.61 134.05 134.35 134.66 134.56 134.59 135.21 135.83 136.46 136.71 137.23 137.54 137.74 137.88 135.05 139.3 137.52 136.91 137.48 139.49 140.89 139.64 140.03 140.49 141.52 142.45 141.71 141.72 141.86 143.32 144.319 144.719 145.129 145.669 146.529 146.949 147.209 147.479 148.359 149.679 150.249 150.759 151.269 152.329 153.579 154.349 155.109 155.879 156.379 156.759 156.959 157.109 157.249 157.399 157.509 157.569 157. [...]
+ 132.3 132.04 131.52 130.97 129.67 131.78 130.19 128.6 127.02 132.81 133.21 133.69 134.17 134.65 134.57 134.56 135.04 134.93 133.82 134.99 137.14 137.46 137.77 137.96 139.99 140.9 140.66 140.43 140.01 140.41 140.74 140.84 140.94 141.07 141.8 142.6 142.34 142.13 142.4 143.86 144.61 144.719 144.829 145.369 146.509 146.909 147.219 147.529 147.999 148.869 149.459 150.229 150.999 152.179 153.549 154.309 155.059 155.819 156.359 156.749 157.029 157.469 157.909 154.199 153.799 156.709 157.769 15 [...]
+ 131.32 131.06 130.8 130.54 129.36 129.14 130.25 131.36 133.07 133.22 133.13 133.8 134.46 134.99 134.78 133.92 132.29 130.67 134.14 134.22 137.21 137.2 137.11 137.2 139.77 140.94 140.85 140.75 140.76 141.08 141.3 141.62 141.91 142.25 142.54 142.77 143.11 142.97 143.24 144.11 144.69 145.27 145.199 145.109 146.109 146.609 146.969 147.339 147.809 148.349 149.359 150.219 150.969 152.059 153.379 154.159 154.929 155.699 156.099 156.559 157.109 157.659 158.159 158.189 157.599 157.109 156.859 15 [...]
+ 131.47 131.68 131.89 131.85 131.99 132.04 131.42 131.83 132.23 132.47 133 133.61 134.24 134.87 134.67 134.63 135.14 135.65 136.17 136.65 136.74 136.61 136.53 136.57 136.37 135.95 136.33 136.81 137.41 139.39 141.35 141.64 141.93 141.86 141.85 142.13 142.5 142.88 143.27 143.88 144.47 145.04 145.61 146.049 145.979 146.229 146.559 146.929 147.409 147.989 148.959 149.969 150.979 152.099 153.189 153.969 154.749 155.529 155.889 156.229 156.659 157.149 157.659 158.209 158.519 157.209 154.739 15 [...]
+ 131.84 132.25 132.49 132.71 133.06 132.84 131.71 131.54 131.13 131.82 132.7 133.28 133.86 134.45 134.25 134.28 134.85 135.43 136.03 136.28 135.92 136.21 136.49 136.71 137.01 136.71 137.68 139.6 140.24 141.22 141.7 141.57 141.45 141.36 141.28 141.7 142.28 142.87 143.25 143.66 144.25 144.85 145.45 146.04 146.499 146.809 147.389 147.959 147.929 148.099 148.839 149.579 150.549 151.759 152.959 153.679 154.399 155.129 155.919 156.429 156.769 156.999 157.249 157.759 158.049 158.029 158.179 158 [...]
+ 131.86 132.26 132.64 133.02 133.12 132.59 129.68 126.76 125.45 127.22 129.48 132.09 132.96 133.48 133.47 133.71 134.44 135.16 135.77 137.25 137.14 135.68 134.74 133.66 132.28 134.69 137.65 140.61 141.06 139.63 138.69 137.63 137.05 137.62 138.4 138.58 138.93 139.9 140.62 142.81 143.77 144.45 145.07 145.74 146.32 146.139 145.889 145.789 146.709 148.169 148.909 149.649 150.309 151.789 153.109 153.709 154.279 154.749 155.329 155.909 156.199 156.489 156.879 157.199 157.559 157.849 158.149 15 [...]
+ 132.34 132.46 132.58 132.8 133.05 133.25 132.43 131.61 128.73 131.32 131.51 131.86 132.2 132.55 132.39 132.67 133.72 135.47 137.21 137.86 137.91 137.93 138.18 138.45 138.63 137.75 136.39 136.87 137.47 141.84 140.91 139.49 139.96 140.54 141.24 141.86 142.26 142.66 143.11 142.6 143.16 143.87 144.57 145.24 145.95 146.55 147.099 147.659 147.969 148.199 148.839 149.479 150.139 151.499 152.779 153.379 153.959 154.439 154.819 155.239 155.749 156.259 156.709 156.589 156.889 157.909 158.919 159. [...]
+ 132.07 130.55 129.03 128.46 130.98 132.87 129.7 126.53 124.09 127.75 132.05 131.72 131.53 131.87 131.81 132.33 132.94 133.55 134.21 136.39 137.81 138.26 138.51 138.08 138 137.92 136.98 136.05 141.51 141.65 141.6 141.48 141.35 142.16 141.3 141.45 141.79 142.16 142.84 143.76 144.16 144.46 144.76 144.99 145.43 146.09 146.75 147.329 147.919 148.359 148.949 149.409 149.879 150.889 151.969 152.649 153.409 154.169 155.079 155.559 156.019 156.419 156.719 156.409 156.989 158.059 159.099 159.829 [...]
+ 131.38 131.33 132.04 132.27 132.58 132.09 130.16 129.42 128.68 128.04 132.64 132.33 131.95 131.49 132.02 132.66 133.36 134.01 134.67 135.43 136.8 137.65 138.51 138.37 135.85 135.48 137.86 139.04 140.54 141.13 141.6 141.95 142.21 141.98 141.83 141.71 141.89 142.28 142.88 143.94 143.35 142.61 141.87 141.94 142.55 143.86 145.3 146.75 147.509 148.069 148.549 149.029 149.719 149.839 149.449 151.139 152.819 153.929 154.759 155.439 155.909 156.379 156.829 156.409 156.909 157.979 159.049 159.69 [...]
+ 130.79 131.37 131.95 132.27 132.37 132.07 131.64 131.2 130.84 132.13 131.96 131.58 131.64 131.4 131.97 132.63 133.38 134.18 134.97 135.56 135.49 135.91 136.66 137.72 138.47 137.86 137.16 136.93 137.65 140.55 141.59 141.93 142.27 142.79 143.33 142.34 141.53 141.59 141.71 143.86 144.33 144.68 145.03 145.35 145.65 145.95 146.08 146.35 147.07 147.679 148.429 149.169 149.919 150.869 151.719 152.299 152.969 153.649 154.369 155.049 155.709 156.359 156.829 156.409 156.849 157.509 158.169 158.82 [...]
+ 129.71 130.22 130.73 131.24 131.41 131.29 130.94 130.58 130.23 131.18 130.73 128.86 126.99 126.22 130.47 132.71 133.52 134.34 135.31 135.36 135.22 134.95 134.68 135.79 137.76 138.65 139.32 139.81 141.26 141.89 142.24 142.54 142.82 142.97 142.87 141.84 141.76 141.78 142.16 143.64 144.05 144.44 144.83 145.08 145.32 145.62 146.36 147.14 147.3 147.82 148.559 149.229 149.909 150.959 151.839 152.209 152.409 152.729 154.219 154.929 155.589 156.229 156.809 156.929 157.159 157.639 157.609 157.71 [...]
+ 129.23 129.32 129.42 129.82 130.11 130.46 130.75 130.78 130.39 130.82 130.92 131.14 131.35 131.6 132.05 132.99 134.24 135.5 136.58 136.79 136.53 136.03 135.51 135.44 137.19 136.64 135.35 134.08 141.64 141.92 142.21 142.43 142.61 140.95 138.49 141 143.3 143.35 143.49 143.89 144.24 144.54 144.67 145.11 145.32 145.94 146.7 147.47 147.84 148.04 148.7 149.349 149.859 150.389 150.889 150.839 150.859 151.259 153.139 154.479 155.169 155.869 156.559 156.829 156.779 156.579 156.489 156.619 157.00 [...]
+ 128.92 129.07 129.17 129.27 129.27 129.54 130.07 130.6 131.13 130.46 130.57 130.8 131.03 131.28 131.57 132.54 133.86 135.15 136.25 136.44 136.24 136 135.85 136.27 137.16 137.87 137.25 136.63 141 141.44 141.86 142.09 142.28 142.42 142.52 142.97 143.3 143.63 143.77 143.98 144.11 144.25 144.38 144.75 144.99 145.73 146.48 147.22 147.29 148.24 148.77 149.29 149.789 149.969 150.399 150.779 151.159 151.549 152.279 153.559 154.259 154.969 155.669 156.369 156.319 156.059 155.789 156.189 157.029 [...]
+ 128.55 128.71 128.89 129.1 129.44 129.98 130.78 131.59 132.09 130.55 128.97 127.45 125.94 126.34 131.37 132.3 133.6 134.8 135.36 135.44 135.54 135.69 135.84 136.29 137.22 138 138.76 139.52 140.16 140.63 141.05 141.46 141.87 142.02 142.07 142.6 143.13 143.66 143.74 143.69 143.92 144.24 144.56 143.46 144.23 144.27 144.37 144.6 145.84 147.91 148.49 149.18 149.88 150.389 150.869 151.549 151.959 152.399 152.659 153.109 153.769 154.359 154.799 155.419 155.419 155.229 155.039 155.479 156.439 1 [...]
+ 128.51 128.73 128.96 129.17 129.47 129.54 129.58 130.09 130.51 129.49 129.87 130.5 131.14 131.6 131.4 131.93 132.65 133.36 133.89 134.54 134 133.13 132.54 133.75 137.43 138.32 138.83 139.54 140.11 139.75 140.29 140.83 141.25 141.92 142.08 142.01 142.31 142.8 143.57 143.64 142.91 142.19 141.59 143.44 145.38 144.6 143.83 144.56 145.84 147.95 148.64 149.3 149.83 150.45 150.799 150.989 151.219 151.669 152.269 152.819 153.299 153.799 154.229 154.559 154.739 154.839 154.949 155.079 155.409 15 [...]
+ 128.28 128.33 128.46 128.59 129.03 129.23 129.22 129.21 129.27 129.8 130.45 131.18 131.89 132.41 132.15 132.32 132.65 132.85 133.26 134.04 135.04 135.96 136.88 137.7 138.19 138.74 139.26 139.77 139.59 138.73 139.31 139.93 140.55 141.38 142.23 142.22 142.17 142.11 142.67 143.54 143.86 144.18 144.5 144.88 145.16 145.89 146.43 146.92 147.17 147.98 148.52 149.04 149.58 150.26 150.64 150.729 150.809 151.119 152.069 152.609 152.879 152.989 153.479 154.239 154.429 154.629 154.889 153.719 152.7 [...]
+ 128.21 127.95 127.68 127.64 129.28 129.94 129.59 129.26 129.33 129.98 130.66 131.33 132.01 132.5 132.38 132.53 132.76 132.99 133.36 133.96 134.98 136.07 137.13 137.87 138.22 138.78 139.34 139.9 139.81 139.02 139.01 139.04 139.66 140.72 141.73 141.82 141.91 141.91 142.11 142.68 143.09 143.79 144.48 144.72 144.43 143.89 143.35 144.23 145.72 147.48 147.98 148.33 148.71 149.31 149.68 149.88 150.08 150.539 151.619 151.339 150.719 151.769 152.499 154.469 154.779 154.879 154.969 155.179 155.48 [...]
+ 128.08 127.6 127.3 127.27 129.16 130.08 130.43 130.21 129.98 130.3 130.44 131.01 131.57 132.03 132.2 132.58 132.83 133.08 133.46 133.59 134.63 135.78 136.86 137.58 137.84 138.19 138.54 139.1 139.1 139.78 139.72 139.67 139.72 140.16 141.42 141.62 141.73 141.82 141.84 142.23 142.93 143.63 144.03 144.56 144.44 145.09 145.98 146.86 147.11 147.13 147.33 147.54 147.83 148.63 149.27 149.8 149.43 149.58 150.939 151.289 151.439 151.589 153.339 155.199 155.279 154.389 153.059 154.069 156.099 156. [...]
+ 128.09 127.61 127.13 126.82 128.49 129.35 129.67 129.99 130.23 129.94 130.1 130.45 130.81 131.23 131.74 132.14 132.51 132.96 133.17 133.02 134.11 135.26 136.42 137.13 137.38 138.15 138.47 138.79 139.5 140.6 140.75 140.89 141.03 141.07 141.25 141.45 141.65 141.85 141.84 141.85 142.26 142.67 143.07 144.03 144.83 145.19 145.56 146.17 146.82 147.28 147.55 147.81 148.13 148.71 149.17 148.4 147.63 148.86 151.78 152.359 152.749 153.019 153.529 154.459 154.489 154.579 154.769 155.389 156.039 15 [...]
+ 128.18 127.44 126.69 126.36 127.6 128.23 128.66 129.06 129.28 129.59 129.8 129.97 130.31 130.72 132.02 132.46 132.61 132.8 133.08 133.24 134.16 135.09 136.02 136.59 136.8 137.63 138.47 139.3 140.05 140.89 140.79 140.59 140.4 140.54 141.09 141.34 141.6 141.81 142.15 142.31 142.62 143.03 143.44 143.47 144.32 144.74 145.35 145.98 146.47 146.98 147.32 147.81 148.31 148.81 149.56 150.43 151.39 152.22 152.53 152.65 152.729 152.809 153.249 154.189 154.359 154.509 154.659 155.169 155.789 156.09 [...]
+ 127.41 127.6 126.8 125.74 125.71 127.26 127.85 128.45 129.04 129.6 129.71 129.81 129.92 130.71 132.74 133.25 133.34 133.32 133.37 133.37 133.91 134.6 135.43 135.9 136.62 137.39 138.19 139.05 139.91 140.64 140.4 140.17 140.05 138.35 138.35 138.62 139.99 141.35 142.2 142.6 143.05 143.51 143.98 143.91 143.86 143.55 143.73 144.33 145.66 146.9 147.41 147.92 148.49 149.01 149.88 150.93 151.98 152.79 153.18 152.82 152.49 152.209 152.849 154.179 154.199 154.179 154.159 154.599 155.159 155.539 1 [...]
+ 125.86 126.05 126.33 126.6 125.19 125.77 126.97 128.17 128.95 129.18 129.24 129.28 129.34 130.11 131.88 132.31 132.61 132.98 133.22 133.45 133.93 134.46 134.99 135.73 136.46 137.12 137.83 138.54 139.35 140.13 140.31 140.2 140.09 139.92 140.05 140.42 140.78 141.15 141.87 142.7 143.18 143.65 144.12 144.38 144.54 144.74 144.93 145.24 146.18 146.7 146.76 146.82 147.36 149.08 150.14 150.9 151.67 152.5 153.43 152.96 151.51 150.06 151.929 153.019 153.129 153.239 153.809 154.129 154.709 155.139 [...]
+ 125.78 126.23 126.68 126.93 126.35 126.7 127.35 128.03 128.57 128.95 127.97 126.79 126.12 127.72 131.29 131.62 131.96 132.32 132.79 133.71 134.04 134.36 134.78 135.35 135.68 136.19 136.71 137.38 138.15 138.81 139.41 140.02 140.06 138.16 137.42 138.02 139.17 140.32 140.85 141.73 142.79 143.83 144.3 144.34 144.66 145.03 145.53 146.04 146.6 146.67 146.41 146.39 146.97 146.45 148.18 150.62 151.55 151.87 152.67 152.82 152.88 152.96 152.6 152.019 152.759 153.499 154.239 154.269 154.149 154.21 [...]
+ 125.76 126.06 126.36 126.47 126.1 126.5 127.19 127.87 128.5 129 129.51 130.05 130.59 130.82 130.73 131.17 131.77 132.38 133.18 133.18 133.81 134.25 134.58 136.22 136.53 137.06 137.35 137.06 137.4 137.86 138.38 139.01 139.65 140.06 140.42 140.48 140.26 140.05 140.36 140.95 141.94 143.01 144.03 141.89 142.38 143.08 143.78 144.29 144.11 144.74 145.84 147.66 148.07 146.9 148.19 149.88 151.57 152.28 152.01 152.03 152.16 152.3 151.96 151.48 152.219 152.919 153.619 153.889 153.839 153.829 154. [...]
+ 125.31 125.5 125.69 124.77 121.31 123.01 125.18 127.35 128.65 129.27 129.51 129.73 130.04 130.36 131.13 131.71 132.29 132.55 132.44 132.27 132.9 133.53 134.23 135.89 137.66 137.49 137.31 137.13 137.41 137.8 138.21 138.62 139.11 139.56 139.93 140.19 140.45 140.63 140.65 141.08 141.83 142.57 143.31 143.22 143.83 144.54 145.25 146.1 146.94 147.73 148.07 148.11 148.41 149.58 150.12 150.69 151.27 151.89 152.22 152.18 152.05 151.85 150.14 148.53 149.52 150.519 151.539 152.079 154.019 154.899 [...]
+ 124.89 124.78 124.93 125.13 125.62 126.35 127.08 127.84 128.58 128.93 129.68 130.26 130.5 131.01 131.12 131.32 131.53 131.76 131.61 131.45 132.52 133.6 134.4 135.61 136.93 136.9 137.06 137.22 135.36 134.42 135.77 137.28 138.79 139.55 139.98 140.43 140.84 141.15 141.12 141.4 142.13 142.47 142.63 141 141.66 142.25 142.84 143.55 145.97 147.13 147.77 148.56 149.27 149.75 149.65 149.85 150.43 151.05 151.49 151.47 151.45 151.39 151.23 151.52 151.76 151.85 151.929 153.099 153.859 154.519 155.1 [...]
+ 125.07 124.84 124.61 124.82 125.72 126.44 127.25 128.06 128.31 128.12 128.89 129.64 130.39 130.1 130.45 130.65 130.97 131.3 130.92 130.62 131.8 132.97 134.15 135.27 136.44 137.03 137.3 137.45 137.69 137.48 136.69 136.91 137.31 138.01 139.46 140.59 141.04 141.5 141.38 141.62 141.84 142.06 142.01 141.87 142.38 143.1 143.82 144.29 144.18 146.22 145.77 146.67 149.01 149.49 149.59 149.58 149.59 150.13 150.25 150.36 150.79 151.21 151.62 151.92 152.31 152.62 152.93 153.229 153.769 154.379 154. [...]
+ 125.08 124.98 124.88 125.03 125.34 126.39 127.5 128.6 129.06 128.49 128.67 128.84 129.49 128.18 126.37 127.75 129.31 130.88 130.72 130.51 131.63 132.76 133.89 134.94 135.85 136.46 137.07 137.69 137.63 137.29 136.87 136.94 137.02 137.8 138.74 139.77 140.81 141.65 141.94 142.13 142.17 142.2 142.01 142.32 143.54 144.65 145.75 147.23 148.82 148 146.33 145.21 146.14 148.93 149.05 149.21 149.37 149.45 149.79 150.24 150.69 151.21 152 152.45 152.68 152.92 153.05 153.35 153.729 154.189 154.639 1 [...]
+ 125.09 125.62 125.6 125.43 123.94 126.05 127.37 128.62 129.14 129.08 129.16 129.31 129.48 129.33 129.15 129.79 130.43 131.07 130.78 131.45 132.12 132.96 134.15 135.08 135.98 136.7 137.42 138.07 138.11 138.24 138.42 138.4 138.34 136.96 137.04 139.3 140.68 141.29 141.65 141.83 141.92 142.11 142.38 143.14 144.08 145.04 145.98 147.21 149.09 149.56 149.41 149.27 150.12 150.09 149.95 149.81 149.66 149.65 149.75 150.21 150.66 151.18 152.03 152.37 152.31 153.12 153.23 153.52 153.49 153.429 153. [...]
+ 124.27 124.89 125.5 126.1 126.61 127.3 127.92 128.55 129.08 129.51 129.58 129.65 129.71 129.69 129.59 130.18 130.79 131.4 130.09 130.22 130.99 132.45 133.9 134.86 135.67 136.31 137.01 137.7 138.08 138.35 138.36 138.37 138.38 139.34 139.38 138.6 138.51 138.58 138.86 139.42 140.38 141.45 142.39 142.99 143.85 144.82 145.79 147.1 149.01 149.68 150.02 150.37 150.34 150.16 150.08 150.01 149.75 150.05 150.55 150.83 151.05 151.28 151.72 151.86 150.8 149.73 148.87 151.79 152.9 152.63 152.399 152 [...]
+ 124.25 124.72 125.19 125.66 126.02 126.62 127.23 127.83 128.42 128.98 129.1 129.22 129.3 129.38 129.83 129.11 129.31 130.65 132 132.58 132.78 132.98 133.4 134.33 135.11 135.75 136.4 137.04 137.5 137.77 137.74 137.72 137.77 139.19 139.28 139.18 139.53 139.91 140.6 141.08 141.25 141.54 142.44 142.79 143.66 144.66 145.65 146.98 148.79 149.43 149.82 150.21 149.66 149.33 149.69 149.67 149.66 149.97 150.47 150.72 150.97 151.15 151.65 152.1 152.54 152.97 152.98 152.66 152.4 152.34 152.22 152.2 [...]
+ 124.32 124.64 125.05 125.32 125.56 126.43 127.21 128 128.52 128.63 129.06 129.21 129.37 129.96 130.63 131.33 131.82 131.56 130.67 132.96 133.41 133.87 134.12 134.89 135.48 135.72 136.11 136.76 137.12 137.22 137.18 137.37 138.06 138.72 138.91 138.15 137.39 137.64 139.83 141 141.39 142.06 142.66 142.73 142.32 141.87 141.42 143.82 148.36 148.93 149.28 149.63 147.46 144.01 145.67 147.33 149.2 149.84 150.17 150.38 150.59 150.78 151.33 151.57 151.56 151.57 151.59 151.84 151.71 151.72 151.76 1 [...]
+ 124.82 124.88 124.94 125.21 125.61 126.47 127.27 128.06 128.38 128.43 128.88 129.33 129.79 130.31 130.87 131.45 131.96 132.48 132.62 133 133.71 134.18 134.65 135.47 136.22 136.46 136.67 136.69 136.78 137.12 137.8 138.49 139.11 138.98 139.21 139.66 140.12 140.18 138.81 139.41 140.18 141.58 142.51 142.29 143.22 144.45 145.69 146.46 147.56 148.02 148.42 149.04 149.39 149.39 147.87 146.36 145.03 147.69 149.61 149.85 150.16 150.47 150.24 150.46 150.39 150.36 150.52 150.87 151.08 151.19 151.3 [...]
+ 124.2 124.39 124.52 124.81 125.29 126.08 126.87 127.66 128.02 128.29 128.82 129.34 129.81 130.32 130.8 131.25 131.71 132.29 132.36 132.76 133.5 134.27 135.04 136.16 136.16 136.39 136.8 136.87 137.52 137.98 138.24 138.5 138.96 138.62 138.85 139.42 139.99 140 139.73 139.67 139.62 140.73 141.6 141.84 142.99 144.34 145.68 146.43 146.55 147.33 148.13 148.93 149.24 149.1 149.28 149.35 149.41 149.52 149.43 149.71 149.99 150.13 149.86 149.72 149.88 150.05 150.21 150.24 150.47 150.76 151.06 151. [...]
+ 123.36 122.5 121.65 123.04 124.92 125.66 126.45 127.23 127.7 128.17 128.37 128.84 129.3 129.93 130.74 131.59 132.43 133.16 132.77 132.76 133.59 134.42 135.21 135.87 135.57 134.48 133.39 133.4 136.2 137.13 136.07 135.02 134.87 135.5 137.4 139.54 140.19 140.7 140.6 140.72 140.92 141.07 141.28 141.37 142.58 144.01 145.35 145.99 146.02 147.09 148.16 148.98 149.17 149.06 149 148.93 148.88 149.09 149.3 149.3 149.37 149.43 149.49 149.48 149.6 149.68 149.85 150.26 150.49 150.7 150.69 150.64 150 [...]
+ 123.54 123.61 123.7 124.19 124.92 125.58 126.25 126.95 127.88 128.59 128.49 128.39 128.44 129.27 130.19 131.06 132 132.93 132.54 132.95 133.77 134.64 135.51 135.76 136.14 137.04 137.39 137.42 135.71 137.02 136.78 137.18 137.63 138.69 139.19 138.67 138.76 138.87 140.06 140.16 140.36 141.05 140.96 140.35 141.65 143.2 144.87 145.82 145.77 146.68 147.76 148.84 149.16 149.03 149.47 149.84 149.96 149.24 149.17 149.12 149.1 149.08 149.05 149.13 149.18 149.23 149.39 149.98 150.03 149.93 149.86 [...]
+ 123.75 124.21 124.48 124.86 125.34 125.98 126.62 127.31 128 128.39 128.76 129.11 129 127.42 127.12 128.44 129.75 131.05 132.41 133.45 134.15 134.85 135.53 135.36 135.79 136.7 137.61 138.49 139.1 139.47 139.58 139.12 138.67 139.3 139.64 140.21 140.77 140.82 140.14 140.15 139.97 139.92 139.94 140.94 142.04 143.12 144.6 145.66 146.18 147.01 147.83 148.65 148.97 148.97 149.27 149.56 149.85 150.06 149.45 149.32 149.2 148.94 148.38 148.73 149.16 149.34 149.51 149.63 149.74 149.9 150.07 150.22 [...]
+ 123.71 124.27 124.82 125.37 125.63 126.14 126.63 127.11 127.56 127.87 127.05 126.57 126.62 128.65 130.68 131.57 132.43 132.72 133.1 133.2 133.69 134.2 134.85 135.15 135.75 136.35 137.02 137.89 138.86 139.36 139.61 139.97 140.35 140.09 140.29 140.78 141.12 141.17 141.32 140.65 139.74 138.83 139.52 141.74 142.35 143.23 144.15 145.01 145.57 146.31 147.1 147.94 147.6 147.57 148.08 148.59 149.07 148.9 148.89 149.54 148.04 146.72 147.37 148.63 149.29 149.23 149.25 149.36 149.6 149.88 149.98 1 [...]
+ 124.55 124.79 125.03 124.95 125.03 125.55 126.08 126.65 127.89 128.47 128.72 128.99 129.26 129.82 130.52 131.4 132.25 133.11 132.83 133.03 133.71 134.21 134.72 135.27 135.74 136.39 136.97 137.65 138.8 139.44 139.81 140.04 139.26 138.36 139.61 140.1 140.59 141.41 142.04 140.85 140.35 141.1 141.65 141.66 142.22 142.68 143.15 144 144.91 145.64 146.37 147.1 146.58 146.1 146.93 147.8 148.67 146.41 147.91 149.24 149.37 149.46 149.3 149.14 148.95 148.76 148.72 149 148.96 148.95 149 148.97 149. [...]
+ 124.3 124.43 124.63 124.66 125.14 125.82 126.5 127.2 128.18 128.8 129.2 129.59 129.75 130.07 130.6 131.4 132.21 132.85 132.22 132.47 133.26 134.03 134.71 134.75 135.24 135.97 136.71 137.53 138.71 139.16 139.22 139.29 138.36 136.91 136.97 137.65 139.91 140.76 142.36 142.58 141.78 140.49 140.33 139.55 139.45 140.76 142.07 143.43 144.46 145.18 145.75 146.32 146.57 146.28 147.05 147.78 148.31 148.69 148.95 149.16 149.37 149.56 149.35 149.1 148.85 148.6 148.49 148.7 148.65 148.64 148.65 149. [...]
+ 124.44 124.62 124.8 125.2 125.7 126.27 126.88 127.5 128.17 128.66 129.07 129.48 129.88 128.52 130.05 131.33 131.97 132.57 129.3 129.6 132.13 133.22 133.87 134.13 134.56 135 135.7 136.47 137.54 138.15 138.53 138.63 138.76 138.97 139.44 139.9 140.03 140.71 142.32 142.49 142.29 142.03 141.66 141.3 141.36 141.43 141.49 141.49 141.57 142.45 143.8 145.54 146.05 146.34 146.73 147.19 147.73 148.2 148.53 148.7 148.88 149.04 149.16 148.92 148.68 148.47 148.3 146.95 147.47 148.03 148.58 149.2 150 [...]
+ 123.92 124.44 125.11 125.67 126.19 126.71 127.22 127.73 128.11 128.57 128.99 129.41 129.8 130.85 131.8 131.96 132.13 132.32 132.74 133.07 133.33 133.35 132.9 132.91 133.49 133.87 134.26 135.64 136.58 137.08 137.47 137.86 138.06 138.18 138.66 139.18 139.7 140.22 141.24 141.27 141.24 141.18 140.91 140.69 140.88 141.37 141.85 141.51 142.25 143.19 144.14 145.6 146.06 146.35 146.64 146.93 147.21 147.41 147.72 147.94 148.21 148.48 148.57 148.56 148.51 148.46 148.35 148.26 148.37 148.51 148.65 [...]
+ 124.06 124.83 125.56 125.94 126.34 126.96 127.58 128.14 128.41 128.51 128.52 128.76 129.15 130.34 130.94 131.27 131.59 131.49 131.78 132.14 132.7 133.27 133.05 133.08 133.3 133.53 134.66 136.05 136.77 137.23 137.26 137.27 137.32 137.8 138.09 138.36 138.81 139.04 139.49 139.46 139.66 140.04 140.54 140.48 140.98 141.47 141.96 143.42 144.26 145.1 145.33 145.56 145.2 145.45 145.87 146.3 146.6 146.08 146.39 147.24 147.64 147.9 147.93 147.96 147.99 148.02 148.26 148.57 148.68 148.75 148.83 14 [...]
+ 123.99 124.74 125.49 125.88 126.18 126.66 127.19 127.71 128.18 128.66 128.74 128.75 128.81 129.58 130.19 129.88 129.57 129.12 127.98 129.8 132.3 133.62 134.3 134.34 134.84 135.55 135.91 135.14 133.53 133.98 134.33 134.68 135.2 137.42 137.76 138.02 138.29 138.47 138.33 138.64 138.95 139.26 139.72 140.21 140.14 140.75 141.36 141.84 143.83 144.22 144.61 145.08 144.76 144.49 143.9 143.3 143.02 145.59 146.18 145.19 144.2 143.89 144.99 146.21 147.45 147.98 147.05 145.06 146.57 148.12 149.07 1 [...]
+ 124.43 124.87 125.26 125.52 125.81 126.25 126.69 127.18 127.96 128.45 128.68 128.92 129.13 129.74 130.34 130.88 131.23 131.48 131.1 131.75 132.66 133.58 134.15 133.75 134.26 134.98 135.7 136.27 136.55 136.78 136.94 136.98 136.69 137.23 137.49 137.71 137.92 138.13 138.25 138.53 138.81 139.08 139.36 139.69 139.35 139.63 140.35 140.42 142.3 142.79 143.47 144.15 144.8 144.9 145.24 145.58 145.89 146.32 146.82 147.27 147.7 147.96 147.66 147.95 148.37 148.78 149.05 149 148.51 149.34 149.54 149 [...]
+ 123.98 124.27 124.67 125.13 125.76 126.26 126.76 127.26 127.76 128.21 128.78 129.21 129.49 129.97 130.21 130.38 130.54 130.75 130.73 131.48 132.41 133.34 134.02 134.24 134.52 134.81 135.19 135.75 136.28 136.67 137.05 137.32 137.39 137.34 137.33 137.4 137.61 137.6 137.72 138.04 138.35 138.65 138.94 139.11 140.27 140.98 141.68 142.01 142.02 142.62 143.21 143.56 144.59 145.25 145.6 145.96 146.26 146.29 146.49 146.85 147.23 147.47 147.41 147.73 148.14 148.54 148.97 149.18 148.17 147.22 146. [...]
+ 122.73 121.62 121.18 124.67 125.82 126.32 126.82 127.32 127.4 126.91 126.93 126.96 127.26 129.22 130.21 130.24 130.27 130.29 130.43 130.92 131.64 132.48 133.2 134.24 134.57 134.78 135.08 135.47 135.88 135.16 134.42 134.79 135.35 137.42 136.5 136.2 136.27 136.38 137.21 137.43 137.71 138.02 137.95 137.99 139.16 140.33 141.5 142.03 142.47 142.88 143.27 143.63 144.8 144.76 143.56 142.35 142.51 146.96 147.3 147.21 147.1 147.17 147.33 147.67 148.04 148.08 148.64 148.85 147.7 146.92 147.77 148 [...]
+ 124.6 124.32 123.87 126.18 126.63 126.91 126.83 126.69 126.29 126.43 127.56 128.69 129.77 130.12 130.14 130.05 129.66 129.28 130.28 130.77 131.28 131.78 132.6 134.08 133.66 134.07 134.47 135.03 135.27 134.57 135.4 136.24 136.35 137.32 136.47 136.6 136.74 136.63 137.55 137.74 137.86 137.97 137.62 137.95 138.4 139.49 140.7 141.47 141.92 142.35 142.86 143.41 145.02 145.4 146.22 146.48 146.71 146.78 146.74 146.67 146.61 146.79 147.25 147.13 147.03 147.07 147.67 148.76 149.16 149.56 149.17 1 [...]
+ 124.41 124.95 123.75 125.95 125.56 124.61 123.78 125.75 127.83 128.23 128.7 129.23 129.75 130.01 130.1 130.17 129.87 130.18 130.11 130.44 130.83 131.3 131.95 133.13 132.41 131.58 131.34 132.09 135.02 135.48 135.96 136.51 135.2 133.47 133.52 133.77 134.56 135.67 137.46 137.61 137.75 137.95 138.23 138.26 138.78 139.32 139.87 140.77 141.44 141.95 142.47 143.09 144.28 145.03 145.36 145.68 145.93 146.11 146.23 146.31 146.39 146.65 147.17 146.82 145.35 143.87 146.44 148.67 149.03 149.31 149.5 [...]
+ 124.08 124.54 125 125.37 126.03 126.65 127.26 127.85 128.04 127.37 127.02 127.07 127.53 129.36 129.25 128.48 127.71 126.98 127.98 128.33 129.59 130.84 131.91 132.45 133.09 133.67 134.24 134.66 134.87 135.21 135.65 136.09 136.57 136.84 137.22 137.63 138.04 136.54 136.79 137.46 137.68 137.9 137.57 137.27 137.72 138.18 138.73 140.09 140.93 141.59 142.25 142.91 143.55 144.11 144.62 145.13 145.65 146.13 146.23 146.29 146.39 146.15 146.5 146.65 146.8 147.06 145.57 145.32 146.17 147.81 149.25 [...]
+ 124.1 124.28 124.15 125.01 125.72 126.49 127.03 127.08 128.02 127.31 127.05 127.5 127.7 129.22 130.08 130.36 130.56 130.37 128.8 129.72 130.71 131.54 132.11 132.22 132.87 133.53 134.18 134.51 134.57 134.74 134.92 135.27 135.98 136.52 136.81 137.1 137.44 136.44 136.78 137.66 137.62 137.57 136.86 136.83 137.68 138.01 138.35 139.67 140.44 140.41 140.38 140.77 142.67 143.71 144.25 144.79 145.27 145.76 146.02 146.24 146.46 146.05 145.66 146.26 146.82 147.37 148.36 149.12 149.12 149.09 149.05 [...]
+ 122.19 121.2 122.66 124.97 124.56 123.84 123.12 125.21 127.95 127.26 126.24 125.23 126.82 129.86 129.94 130.05 130.2 129.97 130.19 129.8 129.39 130.45 132.71 132.05 132.82 133.59 134.26 132.95 131.34 132.04 133.52 135.01 136.15 136.01 135.21 134.42 133.65 135.54 137.4 137.31 137.22 137.11 136.55 136.6 137.61 138.71 139.53 140.03 140.41 140.72 140.99 141.4 142.55 143.24 143.78 144.3 144.77 145.16 145.39 145.55 145.72 144.17 143.39 146.26 146.75 147.02 147.93 148.72 148.7 148.62 148.54 14 [...]
+ 124.09 124.3 124.53 124.9 125.48 126.14 126.81 127.45 127.95 128.35 128.81 129.27 129.65 129.8 129.86 129.91 129.95 129.06 128.32 128.56 128.81 129.06 129.82 132.05 132.72 133.51 134.3 134.56 134.52 135.07 135.62 136.17 136.15 135.79 135.95 136.11 136.27 136.78 137.13 136.97 136.82 136.66 137.44 137.83 138.28 138.37 138.55 139.56 139.93 140.29 140.69 141.18 142.01 142.68 143.25 143.85 144.02 144.18 144.4 144.62 144.89 145.41 145.82 146.02 146.23 146.44 147.03 147.64 147.72 147.8 147.86 [...]
+ 124.15 124.17 123.96 122.35 123.17 124.68 126.19 127.22 127.57 127.92 128.28 128.64 129.02 129.62 129.68 129.69 129.67 129.64 132.09 132.29 132.7 133.11 133.18 132.82 133.36 133.9 134.44 134.63 134.65 135.13 135.6 136.11 135.98 135.71 136.1 136.49 136.64 136.32 136.54 136.41 136.44 136.68 137.22 137.71 137.68 137.66 137.81 138.88 139.56 139.98 140.4 140.99 141.8 142.42 142.98 143.55 143.67 143.1 143.48 143.93 144.37 144.95 145.54 145.56 145.57 145.59 145.79 146.21 146.3 146.4 146.49 147 [...]
+ 124.6 124.96 125.08 124.84 125.25 125.95 123.93 122.39 124.5 126.71 127.93 128.29 128.76 129.33 129.69 130.05 129.22 129.37 132.34 132.27 132.2 132.39 132.46 132.61 131.79 130.97 130.15 132.04 134.58 134.8 135.23 135.68 133.65 134.31 135.93 136.33 136.73 136.48 136.51 136.76 137.02 137.2 137.47 137.7 137.9 138.05 138.24 138.7 139.22 139.75 140.28 140.88 141.66 142.07 142.47 142.87 141.81 139.54 140.73 142.27 143.81 144.88 145.54 145.36 145.19 144.84 145.13 145.29 145.19 145.09 145.16 14 [...]
+ 123.98 124.39 124.59 123.95 124.42 125.13 125.84 126.4 125.37 126.12 127.17 127.87 128.32 128.77 129.13 129.74 130.35 131.14 132.33 132.29 132.24 132.24 132.4 132.53 133.06 133.6 134.14 134.34 134.41 134.64 134.88 135.11 134.48 134.3 135.19 136.08 136.72 136.83 136.86 136.89 136.91 136.94 137.33 137.58 137.85 138.23 138.61 139 139.49 139.92 140.25 140.72 141.48 141.8 142.04 141.88 141.32 141.9 142.7 143.5 144.29 144.9 145.36 144.86 144.42 144.08 144.55 144.93 145.34 145.75 146.14 146.4 [...]
+ 123.3 123.62 123.78 123.82 124.1 124.42 124.95 125.48 126.45 126.88 127.26 127.74 128.18 128.22 128.93 129.64 130.34 131.2 132.03 132.1 132.17 132.23 132.1 132 132.52 133.04 133.57 133.78 133.9 134.05 134.23 134.47 134.5 134.89 135.66 136.43 136.97 136.9 136.72 136.73 136.7 136.68 137.26 137.67 138.06 138.43 138.66 138.9 138.51 138.04 138.87 140.74 141.68 142.16 142.56 142.47 141.58 142.6 143.12 143.5 143.88 144.59 145.14 143.85 142.47 141.09 142.9 144.56 145.1 145.67 146.25 146.68 146. [...]
+ 123.02 123.42 123.77 124 123.38 122.64 122.06 122.97 126.58 126.95 127.3 127.65 127.78 127.69 128.36 129.04 129.72 130.49 130.87 130.94 130.98 131.01 130.98 131.29 131.77 132.28 132.79 133.07 133.38 133.65 133.79 133.93 134.06 134.41 135.16 135.91 136.65 134.38 134.7 135.4 136.1 136.41 137.18 137.7 137.98 138.3 138.52 138.42 137.96 138.37 138.96 140.33 142.11 142.27 142.4 142.52 142.74 142.58 142.92 143.26 143.48 143.62 143.83 143.02 142.52 143.39 142.97 143.18 144.01 144.84 145.77 146. [...]
+ 122.93 123.45 123.82 123.93 123.61 125.05 125.67 126.09 126.27 126.65 127.02 127.4 127.79 128.17 128.72 129.29 129.87 130.17 130.12 130.04 129.96 129.88 130.07 130.48 130.96 131.45 131.93 132.28 132.63 133.04 133.46 133.73 133.79 134.09 134.73 135.38 136.05 135.42 135.89 136.16 136.35 136.61 137.49 137.99 138.39 138.84 139.24 139.38 139.91 140.37 140.7 141.05 141.69 141.77 141.79 141.8 142.03 142.39 142.59 142.78 143 142.92 142.6 142.29 141.98 141.67 142.64 143.16 143.24 144.13 145.18 1 [...]
+ 123.27 123.93 124.41 124.49 124.97 125.49 126.01 126.4 126.34 126.66 126.98 127.38 127.84 128.63 129.23 129.84 130.39 130.55 130.43 130.23 130.01 129.79 128.59 127.95 129.08 130.22 131.37 131.79 132.21 132.49 132.91 133.33 133.4 133.66 133.99 134.54 135.1 136.07 135.65 134.96 134.26 134.22 136.61 138.07 138.89 139.35 139.74 139.95 140.24 140.55 140.76 140.75 140.99 141.45 141.87 141.99 142 142.13 142.29 142.31 142.34 142.21 142.14 142.36 142.58 142.88 143.2 143.55 143.9 144.25 144.59 14 [...]
+ 123.21 123.87 124.45 124.7 125.16 125.15 124.86 125.37 126.46 126.75 127.05 127.34 128 128.79 129.36 129.86 130.32 130.42 129.97 128.95 127.94 126.96 128.07 127.73 128.83 129.65 129.97 131.05 132.08 132.35 132.63 132.9 133.31 133.6 133.76 133.91 134.1 135.36 135.99 136.16 136.34 136.36 136.71 137.52 138.37 139.23 139.95 140.1 140.01 140.07 140.06 139.97 139.95 140.41 140.95 141.54 141.78 141.68 141.65 141.61 141.58 141.56 141.6 141.79 142.09 142.38 142.66 142.97 143.3 143.63 143.98 143. [...]
+ 122.39 123.48 124.19 124.21 124.69 125.17 125.63 126.06 126.28 126.57 126.86 127.15 127.58 128.02 128.58 129.2 129.86 129.99 129.9 129.93 129.96 129.98 128.37 127.68 128.9 130.12 130.66 130.54 132.03 132.16 132 131.84 132.68 133.12 133.53 133.87 134.05 134.76 135.35 135.56 135.79 136.03 136.34 136.85 137.43 138.24 139.03 139.54 138.46 137.23 136.53 136.83 140 140.29 140.58 140.96 141.19 141.27 141.41 141.55 141.69 141.85 141.96 142.15 142.34 142.52 142.41 142.71 143 143.2 142.71 141.35 [...]
+ 122.41 123.39 123.98 123.49 124 124.51 124.98 125.4 126.16 126.26 126.44 126.71 127.01 127.41 128.06 128.7 129.34 129.51 129.47 129.52 129.6 129.68 128.12 127.8 129.03 130.32 131.61 131.88 131.58 131.34 131.1 131.1 132.09 132.6 133.06 133.52 133.99 134.57 134.94 135.15 135.36 135.61 135.91 136.37 136.95 137.54 138.06 138.75 139.18 139.58 139.98 140.38 140.5 140.79 141 141.2 141.1 141.14 141.31 141.47 141.62 141.67 141.87 142.16 142.45 142.87 142.91 141.93 141.77 142.57 142.53 142.24 142 [...]
+ 123.55 123.84 123.58 122.71 123.33 123.98 124.64 125.39 126.14 126.49 126.62 126.74 126.59 127 127.59 128.13 128.68 128.85 129.12 129.33 129.4 129.48 128.4 129.24 129.56 130.31 131.72 131.5 131.34 131.76 132.17 132.6 133.25 133.59 133.66 133.73 133.91 134.34 134.72 135.07 135.42 135.67 135.63 136.07 136.55 137.06 137.49 137.83 138.28 138.98 139.68 140.16 140.41 140.69 140.81 140.92 140.95 140.81 141.01 141.22 141.42 141.42 141.62 142.06 142.48 142.91 143.6 143.56 142.4 141.21 140.4 142. [...]
+ 122.93 122.46 123.35 122.97 123.59 124.21 124.83 125.28 125.68 126.44 127.2 127.95 126.39 123.87 126.26 128.3 127.3 128.11 128.69 128.93 129.16 129.38 128.66 128.72 129.26 129.98 131.39 131.16 131.31 131.85 132.34 132.75 133.42 133.7 133.74 133.79 133.85 133.98 134.37 134.74 135.02 135.36 135.54 135.98 136.5 136.97 137.21 137.39 138.01 138.69 139.39 139.75 139.96 139.87 139.8 139.9 140.13 140.26 140.57 140.93 141.29 140.97 141.19 141.62 142.02 142.52 143.71 143.64 143.32 143.04 142.92 1 [...]
+ 119.5 118.27 123.44 123.01 123.51 124.03 124.56 124.94 125.41 125.79 126.44 127.14 127.71 128.27 128.28 128.29 126.65 127.05 129.03 129.13 129.26 129.49 130.03 130.34 129.38 128.43 127.75 129.83 130.52 130.03 130.26 130.64 132.63 133.69 133.71 133.75 133.86 133.96 134.1 134.3 134.5 134.76 135.29 135.96 136.5 137.04 137.32 137.27 137.86 138.48 139.1 139.41 139.49 139.55 139.57 139.59 139.41 139.76 140.17 140.57 140.9 140.54 140.6 141.02 141.44 141.88 142.91 143.13 143.15 143.16 143.13 14 [...]
+ 122.14 122.72 122.92 122.81 123.28 123.73 124.17 124.82 125.5 125.89 126.27 126.66 127.25 127.77 127.74 127.71 127.68 129.06 128.93 127.73 127.2 127.47 129.65 131.04 129.7 129.95 130.23 130.13 130.46 130.73 131.34 132.01 133.18 133.73 133.69 133.64 133.72 134.2 134.36 134.44 134.52 134.59 134.81 135.7 136.64 137.51 137.89 138.03 138.47 138.44 138.41 138.4 138.49 138.88 139.27 139.67 139.34 139.16 139.49 139.82 140.15 139.81 139.91 140.23 140.56 140.98 141.8 142.02 142.34 142.65 142.82 1 [...]
+ 121.35 121.89 122.26 122.56 122.86 123.16 123.54 124.14 124.75 125.47 126.18 126.75 127.22 127.42 127.27 127.11 126.98 128.72 130.14 130.65 131.16 131.66 131.91 131.56 130.54 129.52 128.86 130.62 131.07 131.87 132.51 133.07 133.6 132.9 131.83 130.75 130.67 133.4 133.29 132.49 131.7 132.12 134.31 134.91 135.79 136.68 137.21 137.06 137.15 137.24 137.34 137.5 137.65 138 138.44 138.89 138.79 138.64 138.94 139.23 139.51 139.64 139.66 139.85 139.96 140.1 140.94 141.36 141.73 142.22 142.65 142 [...]
+ 121.19 121.91 122.29 122.46 122.86 123.21 123.57 123.75 124.08 124.95 125.82 126.69 127.12 127.21 127.77 128.19 128.35 128.41 129.75 130.43 131.11 131.71 131.57 131.26 130.93 130.69 130.48 130.39 130.77 131.52 132.26 132.94 133.3 133.39 133.32 133.25 133.26 133.46 133.01 133.55 133.75 133.68 134.15 134.68 135.11 135.58 135.83 135.44 135.55 136.3 137.06 137.36 137.51 137.78 138.02 138.23 138.17 138.2 138.44 138.67 138.93 138.44 138.84 139.06 138.91 139.1 140.12 140.76 141.43 142.11 142.6 [...]
+ 122.08 122.22 122.37 122.56 122.97 123.36 123.73 123.87 124.14 125.01 125.85 126.58 126.32 126.29 126.85 127.87 128.91 129.27 129.52 129.9 130.56 131.22 130.96 131.02 130.74 130.47 130.25 130.32 130.67 131.14 131.62 132.25 133.1 133.15 132.97 132.8 132.82 132.73 132.26 131.74 131.78 132.01 133.96 134.97 135.95 136.45 136.02 135.87 136.62 137.2 137.5 137.42 137.53 137.54 137.59 137.8 137.91 138.02 138.29 138.55 138.85 139.42 138.88 139.08 139.2 139.54 140.9 141.6 141.85 142.07 142.42 142 [...]
+ 120.45 122.11 122.4 122.7 122.88 123.07 123.42 123.55 123.74 124.38 125.07 125.8 125.51 126.2 127.24 128.27 128.89 129.37 129.72 130.01 130.29 130.62 131.28 131.29 130.9 130.5 130.18 130.21 130.52 130.97 131.45 131.92 132.65 131.91 130.81 129.71 129.86 132.41 132.9 133.2 133.42 133.44 133.66 134.83 135.84 136.85 137.32 137.22 137.56 137.9 138.11 138.03 137.61 137.46 137.37 137.28 137.46 137.68 137.98 138.35 138.96 139.39 139.82 140.19 140.54 140.94 141.33 141.51 141.69 141.84 142.11 142 [...]
+ 121.961 122.19 122.53 122.65 122.82 122.96 123.1 123.03 123.23 123.9 124.58 125.26 125.79 126.28 126.86 127.43 128 128.73 129.13 129.14 129.3 129.68 130.96 130.95 130.6 130.28 130.03 130 130.35 130.81 131.27 131.73 132.19 131.35 130.31 129.26 129.87 132.85 133.12 133.15 133.17 133.1 133.15 134.37 135.59 136.82 137.35 137.44 137.33 137.22 137.11 137.88 138.04 137.56 137.08 136.69 136.94 137.46 138.15 138.85 139.45 139.53 139.78 140.08 140.4 140.81 141.42 141.38 141.43 141.48 141.66 141.6 [...]
+ 121.011 121.701 122.02 122.06 122.26 122.46 122.66 123.04 123.53 124.01 124.48 125.05 125.69 126.23 126.66 127.02 127.36 128.31 127.87 127.29 127.52 127.9 129.5 130.63 130.35 130.07 129.83 129.66 130.12 130.76 131.38 131.84 130.5 131.03 131.76 130.79 129.4 132.18 132.33 132.47 132.74 132.78 132.87 133.86 134.97 136.18 136.54 136.58 136.44 136.3 136.17 136.75 137.27 137.25 136.97 136.48 136.61 137.13 137.79 138.47 139.13 139.61 139.87 140.34 140.82 141.22 141.62 141.57 140.41 139.05 141. [...]
+ 120.041 120.731 121.081 121.57 122.01 122.33 122.58 123.15 123.63 124.14 124.57 125 125.71 126.25 126.46 126.66 126.99 127.76 127.24 126.11 127.09 128.02 129.32 130.28 129.95 129.59 129.29 129.2 129.97 130.77 131.45 130.98 128.6 129.25 130.08 131.03 131.78 131.6 131.15 131.45 132.13 132.56 132.83 133.74 134.66 135.57 135.85 135.75 135.6 135.47 135.34 135.65 135.95 135.96 136.12 136.29 136.49 136.96 137.61 138.27 138.89 139.41 139.95 140.47 140.87 141.27 141.3 139.23 137.17 135.63 140.98 [...]
+ 119.901 120.361 120.621 121.011 121.501 122.06 122.62 122.92 123.36 123.86 124.35 124.84 125.92 126.49 126.63 126.76 126.91 127.89 128.48 128.65 129.21 129.75 130.09 129.84 129.44 129.04 128.74 128.67 129.48 130.43 131.42 132.1 132.17 131.14 129.88 130.24 131 131.33 130.87 130.79 130.79 131.53 133.17 133.5 133.82 134.74 135.09 135.05 134.89 134.86 134.94 135.17 135.5 135.67 135.84 136.02 136.42 137 137.7 138.39 139 139.17 139.51 139.87 140.21 140.61 141.06 141.03 140.63 140.23 140.83 14 [...]
+ 119.891 120.501 120.621 120.931 121.601 122.261 122.92 122.67 122.79 123.35 123.9 124.39 125.69 126.34 126.5 126.67 126.9 128.3 128.86 129.06 129.27 129.34 129.72 129.56 129.27 128.97 128.7 129.29 129.84 130.36 131.18 131.83 131.34 130.21 129.07 127.93 128.71 130.98 131.21 131.43 131.68 132.12 132.87 133.26 133.64 134.06 134.68 134.83 134.91 135 135.08 135.14 135.2 135.37 135.55 135.74 136.05 136.66 137.29 137.63 137.92 138.06 138.41 138.79 139.04 139.6 140.07 140.38 140.73 141.23 140.6 [...]
+ 119.501 120.121 120.341 120.711 121.051 121.581 122.111 121.9 122.23 122.83 123.44 124.06 125.48 126.09 126.34 126.57 126.83 127.86 128.37 128.32 128.27 128.32 128.95 128.89 128.68 128.53 128.74 129.57 130.31 130.87 131.36 131.36 131.01 130.98 130.95 130.91 130.63 130.56 130.83 131.1 131.36 131.63 132.05 132.48 132.92 133.35 134.31 134.95 134.98 135.01 135.03 135.44 135.5 135.5 135.51 135.55 135.88 136.07 136.22 136.42 136.72 137.12 137.18 137.4 137.66 138.24 139.2 139.71 140.21 140.71 [...]
+ 119.561 120.241 120.831 121.201 121.251 121.301 121.331 121.741 122.22 122.73 123.24 123.8 125.07 125.64 124.74 123.8 123.26 126.89 127.66 127.57 127.53 127.78 128.34 128.23 128.12 127.99 128.18 128.83 129.58 130.33 131.09 131.85 132.52 132.04 131.55 131.07 130.67 130.16 130.43 130.79 131.21 131.79 132.17 132.73 133.22 133.61 134.21 134.92 134.94 135.03 135.17 135.03 135.27 135.44 135.54 135.6 136.11 136.24 136.2 136.15 136.39 137.03 137.09 137.23 137.4 137.73 138.68 139.18 139.7 140.22 [...]
+ 120.321 121.171 121.661 121.661 121.371 121.141 121.171 119.611 120.291 122.36 123.3 123.87 124.69 125.01 125.26 125.51 125.93 127.03 127.33 127.43 127.53 127.66 127.54 127.43 127.55 127.93 128.37 128.58 129.36 130.16 130.98 131.77 132.43 131.97 131.46 130.92 130.3 129.68 130.13 130.59 131.01 131.65 132.08 132.05 132.02 132.49 133.68 134.81 135.04 135.28 135.5 134.69 134.59 134.8 135.01 135.08 135.17 135.3 135.39 135.48 136.31 137.34 137.49 137.65 137.83 137.97 138.38 138.86 139.35 139. [...]
+ 120.161 120.971 121.641 122.061 122.351 122.071 121.771 121.771 122.151 122.781 123.41 123.99 124.16 124.45 124.83 125.2 125.74 126.89 127.22 127.42 127.54 127.48 125.21 125.39 126.06 127.4 128.26 128.47 129.12 129.85 130.58 130.6 129.99 130.1 130.22 130.33 129.72 129.01 129.4 129.67 129.94 130.95 131.6 131.62 131.74 131.85 133.4 134.41 134.6 134.79 134.94 134.34 134.28 134.4 134.52 134.52 134.08 134.56 135.32 136.07 136.91 137.53 137.92 138.32 138.65 138.48 138.31 138.54 138.78 139.02 [...]
+ 119.831 120.701 121.301 121.701 122.031 122.351 122.681 121.631 121.681 122.651 123.631 124.32 124.42 124.67 124.97 125.33 125.86 126.68 127 127.2 127.4 127.63 127.9 127.87 127.24 127.03 127.9 128.23 128.72 129.2 129.78 129.85 129.76 129.78 129.81 129.91 129.23 128.55 128.73 128.92 129.18 130.06 130.98 131.17 131.36 131.66 132.95 133.74 133.95 134.17 134.54 134.19 134.11 134.22 134.34 134.38 134.08 134.71 135.32 135.79 136.29 136.85 137.25 137.52 137.76 138.66 138.91 138.95 138.99 139.0 [...]
+ 119.481 120.351 121.121 121.651 121.991 122.341 122.661 120.371 120.721 122.761 123.411 123.861 124.2 124.68 125.19 125.7 126.09 126.12 126.44 126.79 127.14 127.38 127.66 127.62 127.75 127.98 128.19 128.06 127.52 126.99 126.49 127.61 129.41 129.45 129.47 129.49 128.89 128.37 128.71 129.06 129.41 129.76 130.2 130.55 130.89 131.24 132.4 133.14 133.55 133.97 134.33 134.2 134.16 134.23 134.3 134.2 134 134.39 134.82 135.24 135.7 136.24 136.39 136.55 136.7 137.71 138.72 139 139.27 139.52 138. [...]
+ 119.111 119.851 120.831 121.491 120.951 119.071 119.121 122.931 123.031 123.191 123.351 123.521 123.751 124.22 124.71 125.19 125.55 125.91 126.06 126.31 126.66 127 127.34 127.58 127.82 128.06 128.14 128.1 128.28 128.41 128.54 128.29 128.85 128.9 128.96 129 129.03 129.4 129.12 129.04 129.4 129.54 129.88 130.22 130.5 130.75 131.5 132.18 132.65 133.32 133.94 133.82 133.94 134.15 134.35 134.25 133.81 134.16 134.51 134.85 135.28 135.74 135.89 136.06 136.22 137.04 137.89 138.08 138.25 138.43 [...]
+ 118.771 119.331 119.911 120.581 121.261 121.961 122.681 123.241 123.311 123.321 123.331 123.441 123.421 123.831 124.28 124.78 125.32 125.89 126.07 126.21 126.35 126.57 126.93 127.17 127.41 127.64 127.75 127.83 128.1 128.37 128.58 128.61 129.05 129.55 130.05 130.17 130.33 130.61 130.33 129.99 129.43 129.45 129.58 129.78 129.99 130.23 130.78 131.46 132.19 132.92 133.52 133.44 133.58 133.83 134.07 134.36 134.32 134.54 134.7 134.68 134.86 135.28 135.44 135.6 135.74 136.57 137.22 137.3 137.3 [...]
+ 118.501 119.031 119.311 119.851 120.511 121.241 121.961 123.151 123.391 123.341 123.341 123.301 123.101 123.581 124.121 124.65 125.18 125.57 125.85 126.12 126.32 126.53 126.46 126.7 126.94 127.18 127.34 127.65 127.91 128.18 128.3 128.62 129.06 129.41 129.78 130.15 130.72 130.75 130.28 129.8 129.23 129.38 129.54 129.81 130.1 130.37 130.49 131.19 131.95 132.7 133.31 133.41 133.55 133.74 133.93 133.95 134.2 134.27 134.35 134.39 134.57 134.91 134.97 135.11 135.25 136.09 136.6 136.55 136.51 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [...]
diff --git a/test/map_samples/ctrt/cap1.tif b/test/map_samples/ctrt/cap1.tif
new file mode 100644
index 0000000..f0d2b3b
Binary files /dev/null and b/test/map_samples/ctrt/cap1.tif differ
diff --git a/test/map_samples/ctrt/cap2.tif b/test/map_samples/ctrt/cap2.tif
new file mode 100644
index 0000000..e48da37
Binary files /dev/null and b/test/map_samples/ctrt/cap2.tif differ
diff --git a/test/map_samples/orbview3-orbetello/orbetello1.tif b/test/map_samples/orbview3-orbetello/orbetello1.tif
new file mode 100644
index 0000000..e8658d1
Binary files /dev/null and b/test/map_samples/orbview3-orbetello/orbetello1.tif differ
diff --git a/test/map_samples/orbview3-orbetello/orbetello2.tfw b/test/map_samples/orbview3-orbetello/orbetello2.tfw
new file mode 100644
index 0000000..4bab54a
--- /dev/null
+++ b/test/map_samples/orbview3-orbetello/orbetello2.tfw
@@ -0,0 +1,6 @@
+4.06000000
+0.00000000
+0.00000000
+-4.06000000
+680818.000
+4701082.000
diff --git a/test/map_samples/orbview3-orbetello/orbetello2.tif b/test/map_samples/orbview3-orbetello/orbetello2.tif
new file mode 100644
index 0000000..7c78bc5
Binary files /dev/null and b/test/map_samples/orbview3-orbetello/orbetello2.tif differ
diff --git a/test/map_samples/orbview3-trieste/trieste1.tif b/test/map_samples/orbview3-trieste/trieste1.tif
new file mode 100644
index 0000000..227945e
Binary files /dev/null and b/test/map_samples/orbview3-trieste/trieste1.tif differ
diff --git a/test/map_samples/orbview3-trieste/trieste2.tif b/test/map_samples/orbview3-trieste/trieste2.tif
new file mode 100644
index 0000000..d4134f5
Binary files /dev/null and b/test/map_samples/orbview3-trieste/trieste2.tif differ
diff --git a/test/map_samples/trento-gray/trento-gray1.jgw b/test/map_samples/trento-gray/trento-gray1.jgw
new file mode 100644
index 0000000..a654e3c
--- /dev/null
+++ b/test/map_samples/trento-gray/trento-gray1.jgw
@@ -0,0 +1,6 @@
+ 0.5000000000000000
+ 0.0
+ 0.0
+ -0.5000000000000000
+ 663980.0000000000000000
+ 5103950.0000000000000000
diff --git a/test/map_samples/trento-gray/trento-gray1.jpg b/test/map_samples/trento-gray/trento-gray1.jpg
new file mode 100644
index 0000000..31823d7
Binary files /dev/null and b/test/map_samples/trento-gray/trento-gray1.jpg differ
diff --git a/test/map_samples/trento-gray/trento-gray2.jgw b/test/map_samples/trento-gray/trento-gray2.jgw
new file mode 100644
index 0000000..7af0d22
--- /dev/null
+++ b/test/map_samples/trento-gray/trento-gray2.jgw
@@ -0,0 +1,6 @@
+ 0.5000000000000000
+ 0.0
+ 0.0
+ -0.5000000000000000
+ 663980.0000000000000000
+ 5103650.0000000000000000
diff --git a/test/map_samples/trento-gray/trento-gray2.jpg b/test/map_samples/trento-gray/trento-gray2.jpg
new file mode 100644
index 0000000..f95e6ed
Binary files /dev/null and b/test/map_samples/trento-gray/trento-gray2.jpg differ
diff --git a/test/map_samples/trento-rgb/trento-rgb1.jgw b/test/map_samples/trento-rgb/trento-rgb1.jgw
new file mode 100644
index 0000000..a654e3c
--- /dev/null
+++ b/test/map_samples/trento-rgb/trento-rgb1.jgw
@@ -0,0 +1,6 @@
+ 0.5000000000000000
+ 0.0
+ 0.0
+ -0.5000000000000000
+ 663980.0000000000000000
+ 5103950.0000000000000000
diff --git a/test/map_samples/trento-rgb/trento-rgb1.jpg b/test/map_samples/trento-rgb/trento-rgb1.jpg
new file mode 100644
index 0000000..c5d947f
Binary files /dev/null and b/test/map_samples/trento-rgb/trento-rgb1.jpg differ
diff --git a/test/map_samples/trento-rgb/trento-rgb2.jgw b/test/map_samples/trento-rgb/trento-rgb2.jgw
new file mode 100644
index 0000000..7af0d22
--- /dev/null
+++ b/test/map_samples/trento-rgb/trento-rgb2.jgw
@@ -0,0 +1,6 @@
+ 0.5000000000000000
+ 0.0
+ 0.0
+ -0.5000000000000000
+ 663980.0000000000000000
+ 5103650.0000000000000000
diff --git a/test/map_samples/trento-rgb/trento-rgb2.jpg b/test/map_samples/trento-rgb/trento-rgb2.jpg
new file mode 100644
index 0000000..b09aa88
Binary files /dev/null and b/test/map_samples/trento-rgb/trento-rgb2.jpg differ
diff --git a/test/map_samples/tuscany-infrared/infrared1.tif b/test/map_samples/tuscany-infrared/infrared1.tif
new file mode 100644
index 0000000..3391c31
Binary files /dev/null and b/test/map_samples/tuscany-infrared/infrared1.tif differ
diff --git a/test/map_samples/tuscany-infrared/infrared2.tfw b/test/map_samples/tuscany-infrared/infrared2.tfw
new file mode 100644
index 0000000..b568ce2
--- /dev/null
+++ b/test/map_samples/tuscany-infrared/infrared2.tfw
@@ -0,0 +1,6 @@
+0.20000000
+0.00000000
+0.00000000
+-0.20000000
+661076.000
+4847595.000
diff --git a/test/map_samples/tuscany-infrared/infrared2.tif b/test/map_samples/tuscany-infrared/infrared2.tif
new file mode 100644
index 0000000..da35d88
Binary files /dev/null and b/test/map_samples/tuscany-infrared/infrared2.tif differ
diff --git a/test/map_samples/usgs-gray/gray1.tif b/test/map_samples/usgs-gray/gray1.tif
new file mode 100644
index 0000000..0f4e7ff
Binary files /dev/null and b/test/map_samples/usgs-gray/gray1.tif differ
diff --git a/test/map_samples/usgs-gray/gray2.tif b/test/map_samples/usgs-gray/gray2.tif
new file mode 100644
index 0000000..cfe57fc
Binary files /dev/null and b/test/map_samples/usgs-gray/gray2.tif differ
diff --git a/test/map_samples/usgs-indiana/indiana1.tif b/test/map_samples/usgs-indiana/indiana1.tif
new file mode 100644
index 0000000..4474169
Binary files /dev/null and b/test/map_samples/usgs-indiana/indiana1.tif differ
diff --git a/test/map_samples/usgs-indiana/indiana2.tif b/test/map_samples/usgs-indiana/indiana2.tif
new file mode 100644
index 0000000..8602894
Binary files /dev/null and b/test/map_samples/usgs-indiana/indiana2.tif differ
diff --git a/test/map_samples/usgs-nile-32/nile1-int32.tif b/test/map_samples/usgs-nile-32/nile1-int32.tif
new file mode 100644
index 0000000..d7f56c0
Binary files /dev/null and b/test/map_samples/usgs-nile-32/nile1-int32.tif differ
diff --git a/test/map_samples/usgs-nile-32/nile2-int32.tif b/test/map_samples/usgs-nile-32/nile2-int32.tif
new file mode 100644
index 0000000..9a1e405
Binary files /dev/null and b/test/map_samples/usgs-nile-32/nile2-int32.tif differ
diff --git a/test/map_samples/usgs-nile-8/nile1-int8.tif b/test/map_samples/usgs-nile-8/nile1-int8.tif
new file mode 100644
index 0000000..4653841
Binary files /dev/null and b/test/map_samples/usgs-nile-8/nile1-int8.tif differ
diff --git a/test/map_samples/usgs-nile-8/nile2-int8.tif b/test/map_samples/usgs-nile-8/nile2-int8.tif
new file mode 100644
index 0000000..1b5ed78
Binary files /dev/null and b/test/map_samples/usgs-nile-8/nile2-int8.tif differ
diff --git a/test/map_samples/usgs-nile-dbl/nile1-dbl.tif b/test/map_samples/usgs-nile-dbl/nile1-dbl.tif
new file mode 100644
index 0000000..b97b4e0
Binary files /dev/null and b/test/map_samples/usgs-nile-dbl/nile1-dbl.tif differ
diff --git a/test/map_samples/usgs-nile-dbl/nile2-dbl.tif b/test/map_samples/usgs-nile-dbl/nile2-dbl.tif
new file mode 100644
index 0000000..c5a0687
Binary files /dev/null and b/test/map_samples/usgs-nile-dbl/nile2-dbl.tif differ
diff --git a/test/map_samples/usgs-nile-flt/nile1-flt.tif b/test/map_samples/usgs-nile-flt/nile1-flt.tif
new file mode 100644
index 0000000..8a0d28c
Binary files /dev/null and b/test/map_samples/usgs-nile-flt/nile1-flt.tif differ
diff --git a/test/map_samples/usgs-nile-flt/nile2-flt.tif b/test/map_samples/usgs-nile-flt/nile2-flt.tif
new file mode 100644
index 0000000..78f820d
Binary files /dev/null and b/test/map_samples/usgs-nile-flt/nile2-flt.tif differ
diff --git a/test/map_samples/usgs-nile-u16/nile1-uint16.tif b/test/map_samples/usgs-nile-u16/nile1-uint16.tif
new file mode 100644
index 0000000..cd70df2
Binary files /dev/null and b/test/map_samples/usgs-nile-u16/nile1-uint16.tif differ
diff --git a/test/map_samples/usgs-nile-u16/nile2-uint16.tif b/test/map_samples/usgs-nile-u16/nile2-uint16.tif
new file mode 100644
index 0000000..badf71c
Binary files /dev/null and b/test/map_samples/usgs-nile-u16/nile2-uint16.tif differ
diff --git a/test/map_samples/usgs-nile-u32/nile1-uint32.tif b/test/map_samples/usgs-nile-u32/nile1-uint32.tif
new file mode 100644
index 0000000..61e4ca3
Binary files /dev/null and b/test/map_samples/usgs-nile-u32/nile1-uint32.tif differ
diff --git a/test/map_samples/usgs-nile-u32/nile2-uint32.tif b/test/map_samples/usgs-nile-u32/nile2-uint32.tif
new file mode 100644
index 0000000..d64c022
Binary files /dev/null and b/test/map_samples/usgs-nile-u32/nile2-uint32.tif differ
diff --git a/test/map_samples/usgs-nile-u8/nile1-uint8.tif b/test/map_samples/usgs-nile-u8/nile1-uint8.tif
new file mode 100644
index 0000000..f502068
Binary files /dev/null and b/test/map_samples/usgs-nile-u8/nile1-uint8.tif differ
diff --git a/test/map_samples/usgs-nile-u8/nile2-uint8.tif b/test/map_samples/usgs-nile-u8/nile2-uint8.tif
new file mode 100644
index 0000000..62ea1aa
Binary files /dev/null and b/test/map_samples/usgs-nile-u8/nile2-uint8.tif differ
diff --git a/test/map_samples/usgs-rgb/rgb1.tif b/test/map_samples/usgs-rgb/rgb1.tif
new file mode 100644
index 0000000..490be01
Binary files /dev/null and b/test/map_samples/usgs-rgb/rgb1.tif differ
diff --git a/test/map_samples/usgs-rgb/rgb2.tif b/test/map_samples/usgs-rgb/rgb2.tif
new file mode 100644
index 0000000..fb09616
Binary files /dev/null and b/test/map_samples/usgs-rgb/rgb2.tif differ
diff --git a/test/map_samples/usgs-srtm/srtm1.tif b/test/map_samples/usgs-srtm/srtm1.tif
new file mode 100644
index 0000000..c87d403
Binary files /dev/null and b/test/map_samples/usgs-srtm/srtm1.tif differ
diff --git a/test/map_samples/usgs-srtm/srtm2.tif b/test/map_samples/usgs-srtm/srtm2.tif
new file mode 100644
index 0000000..04dd4a2
Binary files /dev/null and b/test/map_samples/usgs-srtm/srtm2.tif differ
diff --git a/test/mask1.png b/test/mask1.png
new file mode 100644
index 0000000..72c60d8
Binary files /dev/null and b/test/mask1.png differ
diff --git a/test/mono3s.tif b/test/mono3s.tif
new file mode 100644
index 0000000..96de1d4
Binary files /dev/null and b/test/mono3s.tif differ
diff --git a/test/mono3t.tif b/test/mono3t.tif
new file mode 100644
index 0000000..a7a6784
Binary files /dev/null and b/test/mono3t.tif differ
diff --git a/test/mono4s.tif b/test/mono4s.tif
new file mode 100644
index 0000000..21e4c55
Binary files /dev/null and b/test/mono4s.tif differ
diff --git a/test/mono4t.tif b/test/mono4t.tif
new file mode 100644
index 0000000..eab4e23
Binary files /dev/null and b/test/mono4t.tif differ
diff --git a/test/motorcycle.svg b/test/motorcycle.svg
new file mode 100644
index 0000000..a3e0055
--- /dev/null
+++ b/test/motorcycle.svg
@@ -0,0 +1,365 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="shopping_motorcycle.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata2975">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="1005"
+ inkscape:window-width="1280"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.65172414"
+ inkscape:cx="494.87957"
+ inkscape:cy="344.66669"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ inkscape:current-layer="svg2"
+ showgrid="false"
+ inkscape:window-maximized="1"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="6.1230318e-14 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ id="perspective2441" />
+ <inkscape:perspective
+ id="perspective3452"
+ inkscape:persp3d-origin="30 : 20 : 1"
+ inkscape:vp_z="60 : 30 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 30 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <symbol
+ viewBox="244.5 110 489 219.9"
+ id="symbol-university">
+ <path
+ id="path4460"
+ d="M79,43l57,119c0,0,21-96,104-96s124,106,124,106l43-133l82-17L0,17L79,43z" />
+ <path
+ id="path4462"
+ d="M94,176l-21,39"
+ stroke-width="20"
+ stroke="#000000"
+ fill="none" />
+ <path
+ id="path4464"
+ d="M300,19c0,10.5-22.6,19-50.5,19S199,29.5,199,19s22.6-19,50.5-19S300,8.5,300,19z" />
+ <path
+ id="path4466"
+ d="M112,216l-16-38L64,88c0,0-9-8-4-35s16-24,16-24"
+ stroke-width="20"
+ stroke="#000000"
+ ill="none" />
+ </symbol>
+ <inkscape:perspective
+ id="perspective4471"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4668"
+ inkscape:persp3d-origin="6 : 4 : 1"
+ inkscape:vp_z="12 : 6 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 6 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3826"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3855"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3909"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3950"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3972"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3994"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4016"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4837"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4971"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective6216"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective6764"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective6817"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.79354273,1.2601716)"
+ xlink:href="#linearGradient829"
+ id="radialGradient874"
+ cx="180.2453"
+ cy="198.41902"
+ r="101.58017"
+ fx="180.2453"
+ fy="198.41902" />
+ <linearGradient
+ id="linearGradient829">
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0.341667;"
+ offset="0.0000000"
+ id="stop830" />
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
+ offset="1.0000000"
+ id="stop831" />
+ </linearGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.007004,0.99304475)"
+ xlink:href="#linearGradient829"
+ id="radialGradient832"
+ cx="360.85146"
+ cy="167.47372"
+ r="46.394721"
+ fx="360.85146"
+ fy="167.47372" />
+ <linearGradient
+ id="linearGradient6826">
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0.341667;"
+ offset="0.0000000"
+ id="stop6828" />
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
+ offset="1.0000000"
+ id="stop6830" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.74491357,1.3424376)"
+ xlink:href="#linearGradient855"
+ id="linearGradient850"
+ x1="465.29425"
+ y1="248.24467"
+ x2="463.27056"
+ y2="405.7687"
+ spreadMethod="pad" />
+ <linearGradient
+ id="linearGradient855">
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
+ offset="0.0000000"
+ id="stop856" />
+ <stop
+ style="stop-color: rgb(255, 166, 23); stop-opacity: 0.733333;"
+ offset="1.0000000"
+ id="stop857" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.4586159,0.68558144)"
+ xlink:href="#linearGradient855"
+ id="linearGradient854"
+ x1="157.80581"
+ y1="120.96176"
+ x2="155.40575"
+ y2="231.63491" />
+ <linearGradient
+ id="linearGradient6837">
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
+ offset="0.0000000"
+ id="stop6839" />
+ <stop
+ style="stop-color: rgb(255, 166, 23); stop-opacity: 0.733333;"
+ offset="1.0000000"
+ id="stop6841" />
+ </linearGradient>
+ <inkscape:perspective
+ id="perspective6928"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective10781"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective10806"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <g
+ id="g1327">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 L 1.704,516.927 C 1.704,557.771 22.599,579.156 63.896,579.156 L 515.92,579.156 C 557.227,579.156 578.149,558.841 578.149,516.927 L 578.149,66.804 C 578.149,24.203 557.227,1.768 514.628,1.768 C 514.624,1.768 66.133,1.625 66.275,1.768 z "
+ style="fill:#111;stroke:#eee;stroke-width:3.40799999"
+ id="path1329" />
+ </g>
+ <g
+ id="layer3"
+ inkscape:label="Layout"
+ style="display:none;stroke:#757575;stroke-opacity:1"
+ transform="matrix(48.14969,0,0,48.14969,-536.27327,-33.306752)">
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4134"
+ width="10"
+ height="10"
+ x="1"
+ y="1" />
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4136"
+ width="8"
+ height="8"
+ x="2"
+ y="2" />
+ </g>
+ <g
+ id="g3338"
+ transform="matrix(1.3973279,-0.2437849,0.2437849,1.3973279,-185.07402,-56.183307)" />
+ <g
+ id="g10860"
+ transform="matrix(1.5423079,0,0,1.5423079,-1078.6207,-115.49981)">
+ <path
+ style="fill:#ffffff"
+ d="M 906.49798,124.68388 C 902.04926,107.53608 886.39785,94.837006 867.91544,94.837006 C 845.83361,94.837006 827.99828,112.59145 827.99828,134.63283 C 827.99828,138.35358 828.44316,141.75079 829.37334,145.06711 H 845.38874 C 846.56158,147.81722 847.85576,149.3945 847.85576,149.3945 C 852.66846,156.35068 860.7166,160.83984 869.81626,160.83984 C 884.57792,160.83984 896.58947,148.8283 896.58947,134.06663 C 896.58947,130.66943 897.43877,127.59577 896.02327,124.68388 H 906.49798 z"
+ id="path6039" />
+ <path
+ style="fill:#ffffff"
+ d="M 905.40602,362.69043 C 901.19996,366.93694 895.41662,370.21281 888.90531,370.21281 L 888.86487,283.46276 L 948.88216,266.23408 L 963.92692,295.83829 L 905.40602,362.69043 z"
+ id="path6041" />
+ <path
+ style="fill:#ffffff"
+ d="M 855.01415,164.27749 C 851.05075,159.86921 845.34829,157.07865 838.91787,157.07865 C 832.08302,157.07865 825.97614,160.2332 822.05318,165.20768 L 774.41142,237.96448 C 772.47016,241.19992 771.3782,245.00155 771.3782,249.0054 C 771.3782,256.52778 775.17984,263.07953 780.92273,266.92161 L 844.82254,302.39005 V 362.73087 C 844.82254,371.26433 851.73828,378.22051 860.27173,378.22051 C 868.76474,378.22051 875.72092,371.26433 875.72092,362.73087 V 287.38572 C 875.72092,287.38572 877 [...]
+ id="path6043" />
+ <path
+ style="fill:#ffffff"
+ d="M 1030.132,263.16042 C 1030.7791,263.8075 1031.1026,264.57592 1031.1026,265.62744 C 1031.1026,267.52825 1029.5253,269.10553 1027.6245,269.10553 C 1027.0988,269.10553 1026.7752,269.10553 1026.3708,268.94375 C 1019.5359,266.03187 1015.2085,264.21193 1007.2413,264.21193 C 1001.9837,264.21193 995.4724,266.03187 987.95001,272.0983 L 980.99383,258.34771 C 989.68906,255.75936 996.80701,253.45412 1004.2485,253.45412 C 1016.1387,253.45412 1022.3669,255.92114 1030.132,263.16042 z"
+ id="path6045" />
+ <path
+ style="fill:#ffffff"
+ d="M 764.42202,273.75646 L 831.47637,310.72129 L 831.63815,325.56384 L 755.03927,283.38188 C 749.49859,280.55087 742.05709,278.89271 736.75907,278.89271 C 728.8727,278.89271 724.46442,280.71264 717.67001,283.62453 C 717.22514,283.7863 716.86115,283.7863 716.41628,283.7863 C 714.51546,283.7863 712.89775,282.20903 712.89775,280.30821 C 712.89775,279.29714 713.30218,278.48828 713.90882,277.8412 C 721.67386,270.56147 729.60067,268.1349 741.45045,268.1349 C 747.55733,268.1349 754.91794 [...]
+ id="path6047" />
+ <path
+ style="fill:#ffffff"
+ d="M 770.65023,409.76598 C 792.4894,409.76598 810.2034,392.05199 810.2034,370.17237 C 810.2034,348.29275 792.4894,330.57876 770.65023,330.57876 C 748.81106,330.57876 731.09706,348.29275 731.09706,370.17237 C 731.09706,392.05199 748.81106,409.76598 770.65023,409.76598 z M 713.58528,370.21281 C 713.58528,338.70778 739.1452,313.10742 770.65023,313.10742 C 802.1957,313.10742 827.75563,338.70778 827.75563,370.21281 C 827.75563,401.71784 802.1957,427.31821 770.65023,427.31821 C 739.1452 [...]
+ id="path6049" />
+ <path
+ style="fill:#ffffff"
+ d="M 1006.6751,409.76598 C 1028.5143,409.76598 1046.2687,392.05199 1046.2687,370.17237 C 1046.2687,348.29275 1028.5547,330.57876 1006.6751,330.57876 C 984.79547,330.57876 967.12191,348.29275 967.12191,370.17237 C 967.12191,392.05199 984.83591,409.76598 1006.6751,409.76598 z M 949.61013,370.21281 C 949.61013,338.70778 975.12961,313.10742 1006.6751,313.10742 C 1038.1801,313.10742 1063.74,338.70778 1063.74,370.21281 C 1063.74,401.71784 1038.1801,427.31821 1006.6751,427.31821 C 975.12 [...]
+ id="path6051" />
+ <path
+ style="fill:#ffffff"
+ d="M 994.05689,304.93795 L 966.31305,249.49071 C 962.67319,242.85807 955.59568,238.28803 947.46666,238.28803 H 929.34823 C 925.8297,238.28803 922.95825,241.19992 922.95825,244.75889 C 922.95825,248.31787 925.8297,251.14887 929.34823,251.14887 L 947.46666,251.06799 C 950.49987,251.06799 953.89708,253.13058 955.19125,256.12335 L 981.31738,309.34623 L 994.05689,304.93795 z"
+ id="path6053" />
+ </g>
+</svg>
diff --git a/test/pharmacy.svg b/test/pharmacy.svg
new file mode 100644
index 0000000..f4e5c9b
--- /dev/null
+++ b/test/pharmacy.svg
@@ -0,0 +1,432 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="health_pharmacy.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata2975">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="947"
+ inkscape:window-width="1048"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.92167712"
+ inkscape:cx="117.36066"
+ inkscape:cy="281.19503"
+ inkscape:window-x="11"
+ inkscape:window-y="13"
+ inkscape:current-layer="svg2"
+ showgrid="false"
+ inkscape:window-maximized="0" />
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ id="perspective2441" />
+ <inkscape:perspective
+ id="perspective3452"
+ inkscape:persp3d-origin="30 : 20 : 1"
+ inkscape:vp_z="60 : 30 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 30 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <symbol
+ viewBox="244.5 110 489 219.9"
+ id="symbol-university">
+ <path
+ id="path4460"
+ d="M79,43l57,119c0,0,21-96,104-96s124,106,124,106l43-133l82-17L0,17L79,43z" />
+ <path
+ id="path4462"
+ d="M94,176l-21,39"
+ stroke-width="20"
+ stroke="#000000"
+ fill="none" />
+ <path
+ id="path4464"
+ d="M300,19c0,10.5-22.6,19-50.5,19S199,29.5,199,19s22.6-19,50.5-19S300,8.5,300,19z" />
+ <path
+ id="path4466"
+ d="M112,216l-16-38L64,88c0,0-9-8-4-35s16-24,16-24"
+ stroke-width="20"
+ stroke="#000000"
+ ill="none" />
+ </symbol>
+ <inkscape:perspective
+ id="perspective4471"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4668"
+ inkscape:persp3d-origin="6 : 4 : 1"
+ inkscape:vp_z="12 : 6 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 6 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4904"
+ inkscape:persp3d-origin="16 : 10.666667 : 1"
+ inkscape:vp_z="32 : 16 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 16 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <marker
+ style="overflow:visible;"
+ id="Arrow2Lend"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow2Lend">
+ <path
+ transform="scale(1.1) rotate(180) translate(1,0)"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+ id="path4137" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow1Mend"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Mend">
+ <path
+ transform="scale(0.4) rotate(180) translate(10,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4125" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="TriangleOutL"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="TriangleOutL">
+ <path
+ transform="scale(0.8)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+ id="path4214" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow1Lend"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Lend">
+ <path
+ transform="scale(0.8) rotate(180) translate(12.5,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4119" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="Tail"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Tail">
+ <g
+ transform="scale(-1.2)"
+ id="g4152">
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -3.8048674,-3.9585227 L 0.54352094,0"
+ id="path4154" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -1.2866832,-3.9585227 L 3.0617053,0"
+ id="path4156" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M 1.3053582,-3.9585227 L 5.6537466,0"
+ id="path4158" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -3.8048674,4.1775838 L 0.54352094,0.21974226"
+ id="path4160" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M -1.2866832,4.1775838 L 3.0617053,0.21974226"
+ id="path4162" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;marker-start:none;marker-end:none;stroke-linecap:round"
+ d="M 1.3053582,4.1775838 L 5.6537466,0.21974226"
+ id="path4164" />
+ </g>
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="Arrow1Sstart"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Sstart">
+ <path
+ transform="scale(0.2) translate(6,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4128" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow1Send"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow1Send">
+ <path
+ transform="scale(0.2) rotate(180) translate(6,0)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ id="path4131" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="SemiCircleOut"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="SemiCircleOut">
+ <path
+ transform="scale(0.6) translate(7.125493,0.763446)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;marker-end:none"
+ d="M -2.5,-0.80913858 C -2.5,1.9508614 -4.7400000,4.1908614 -7.5,4.1908614 L -7.5,-5.8091386 C -4.7400000,-5.8091386 -2.5,-3.5691386 -2.5,-0.80913858 z "
+ id="path4235" />
+ </marker>
+ <marker
+ style="overflow:visible;"
+ id="Arrow2Send"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow2Send">
+ <path
+ transform="scale(0.3) rotate(180) translate(-2.3,0)"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+ id="path4149" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="TriangleOutS"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="TriangleOutS">
+ <path
+ transform="scale(0.2)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
+ id="path4220" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="CurveIn"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="CurveIn">
+ <path
+ transform="scale(0.6)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;marker-end:none;fill:none"
+ d="M 4.6254930,-5.0456926 C 1.8654930,-5.0456926 -0.37450702,-2.8056926 -0.37450702,-0.045692580 C -0.37450702,2.7143074 1.8654930,4.9543074 4.6254930,4.9543074"
+ id="path4238" />
+ </marker>
+ <marker
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="InfiniteLineStart"
+ inkscape:stockid="InfiniteLineStart"
+ style="overflow:visible">
+ <g
+ transform="translate(-13,0)"
+ id="g4298">
+ <circle
+ cx="3"
+ cy="0"
+ r="0.8"
+ id="circle4300"
+ d="M 3.8,0 C 3.8,0.44182781 3.4418278,0.80000001 3,0.80000001 2.5581722,0.80000001 2.2,0.44182781 2.2,0 c 0,-0.44182781 0.3581722,-0.80000001 0.8,-0.80000001 0.4418278,0 0.8,0.3581722 0.8,0.80000001 z" />
+ <circle
+ cx="6.5"
+ cy="0"
+ r="0.8"
+ id="circle4302"
+ d="M 7.3,0 C 7.3,0.44182781 6.9418278,0.80000001 6.5,0.80000001 6.0581722,0.80000001 5.7,0.44182781 5.7,0 c 0,-0.44182781 0.3581722,-0.80000001 0.8,-0.80000001 0.4418278,0 0.8,0.3581722 0.8,0.80000001 z" />
+ <circle
+ cx="10"
+ cy="0"
+ r="0.8"
+ id="circle4304"
+ d="M 10.8,0 C 10.8,0.44182781 10.441828,0.80000001 10,0.80000001 9.5581722,0.80000001 9.2,0.44182781 9.2,0 c 0,-0.44182781 0.3581722,-0.80000001 0.8,-0.80000001 0.441828,0 0.8,0.3581722 0.8,0.80000001 z" />
+ </g>
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="StopS"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="StopS">
+ <path
+ transform="scale(0.2)"
+ style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
+ d="M 0.0,5.65 L 0.0,-5.65"
+ id="path4229" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="Arrow2Sstart"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="Arrow2Sstart">
+ <path
+ transform="scale(0.3) translate(-2.3,0)"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round"
+ id="path4146" />
+ </marker>
+ <marker
+ style="overflow:visible"
+ id="DiamondS"
+ refX="0.0"
+ refY="0.0"
+ orient="auto"
+ inkscape:stockid="DiamondS">
+ <path
+ transform="scale(0.2)"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
+ d="M 0,-7.0710768 L -7.0710894,0 L 0,7.0710589 L 7.0710462,0 L 0,-7.0710768 z "
+ id="path4202" />
+ </marker>
+ <marker
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="RazorWire"
+ inkscape:stockid="RazorWire">
+ style="overflow:visible">
+ <path
+ d="M 0.022727273,-0.74009011 L 0.022727273,0.69740989 L -7.7585227,3.0099099 L 10.678977,3.0099099 L 3.4914773,0.69740989 L 3.4914773,-0.74009011 L 10.741477,-2.8963401 L -7.7272727,-2.8963401 L 0.022727273,-0.74009011 z "
+ style="fill:#808080;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.1pt"
+ transform="scale(0.8,0.8)"
+ id="path4286" />
+</marker>
+ <inkscape:perspective
+ id="perspective5233"
+ inkscape:persp3d-origin="16 : 10.666667 : 1"
+ inkscape:vp_z="32 : 16 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 16 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective5412"
+ inkscape:persp3d-origin="250 : 166.66667 : 1"
+ inkscape:vp_z="500 : 250 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 250 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective5571"
+ inkscape:persp3d-origin="202.85715 : 136.19048 : 1"
+ inkscape:vp_z="405.71429 : 204.28572 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 204.28572 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <g
+ id="g1327">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 L 1.704,516.927 C 1.704,557.771 22.599,579.156 63.896,579.156 L 515.92,579.156 C 557.227,579.156 578.149,558.841 578.149,516.927 L 578.149,66.804 C 578.149,24.203 557.227,1.768 514.628,1.768 C 514.624,1.768 66.133,1.625 66.275,1.768 z "
+ style="fill:#111;stroke:#eee;stroke-width:3.40799999"
+ id="path1329" />
+ </g>
+ <g
+ id="layer3"
+ inkscape:label="Layout"
+ style="display:none;stroke:#757575;stroke-opacity:1"
+ transform="matrix(48.14969,0,0,48.14969,-536.27327,-33.306752)">
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4134"
+ width="10"
+ height="10"
+ x="1"
+ y="1" />
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4136"
+ width="8"
+ height="8"
+ x="2"
+ y="2" />
+ </g>
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:10;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect2160"
+ width="285.71429"
+ height="122.85714"
+ x="154.19182"
+ y="223.45724" />
+ <rect
+ style="fill:none;stroke:#ffffff;stroke-width:21.16843796;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="rect3184"
+ width="371.95969"
+ height="371.95969"
+ x="111.06911"
+ y="98.905975" />
+ <rect
+ y="-358.47754"
+ x="142.02866"
+ height="122.85714"
+ width="285.71429"
+ id="rect3186"
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:10;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ transform="matrix(0,1,-1,0,0,0)" />
+</svg>
diff --git a/test/photo.svg b/test/photo.svg
new file mode 100644
index 0000000..d0534c4
--- /dev/null
+++ b/test/photo.svg
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="shopping_photo.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata2975">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="941"
+ inkscape:window-width="1280"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.65172414"
+ inkscape:cx="498.72206"
+ inkscape:cy="373.10457"
+ inkscape:window-x="1276"
+ inkscape:window-y="-4"
+ inkscape:current-layer="svg2"
+ showgrid="false"
+ inkscape:window-maximized="1" />
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="6.1230318e-14 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ id="perspective2441" />
+ <inkscape:perspective
+ id="perspective3452"
+ inkscape:persp3d-origin="30 : 20 : 1"
+ inkscape:vp_z="60 : 30 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 30 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <symbol
+ viewBox="244.5 110 489 219.9"
+ id="symbol-university">
+ <path
+ id="path4460"
+ d="M79,43l57,119c0,0,21-96,104-96s124,106,124,106l43-133l82-17L0,17L79,43z" />
+ <path
+ id="path4462"
+ d="M94,176l-21,39"
+ stroke-width="20"
+ stroke="#000000"
+ fill="none" />
+ <path
+ id="path4464"
+ d="M300,19c0,10.5-22.6,19-50.5,19S199,29.5,199,19s22.6-19,50.5-19S300,8.5,300,19z" />
+ <path
+ id="path4466"
+ d="M112,216l-16-38L64,88c0,0-9-8-4-35s16-24,16-24"
+ stroke-width="20"
+ stroke="#000000"
+ ill="none" />
+ </symbol>
+ <inkscape:perspective
+ id="perspective4471"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4668"
+ inkscape:persp3d-origin="6 : 4 : 1"
+ inkscape:vp_z="12 : 6 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 6 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3826"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3855"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3909"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective11014"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective11066"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective15015"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective15058"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <g
+ id="g1327">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 L 1.704,516.927 C 1.704,557.771 22.599,579.156 63.896,579.156 L 515.92,579.156 C 557.227,579.156 578.149,558.841 578.149,516.927 L 578.149,66.804 C 578.149,24.203 557.227,1.768 514.628,1.768 C 514.624,1.768 66.133,1.625 66.275,1.768 z "
+ style="fill:#111;stroke:#eee;stroke-width:3.40799999"
+ id="path1329" />
+ </g>
+ <g
+ id="layer3"
+ inkscape:label="Layout"
+ style="display:none;stroke:#757575;stroke-opacity:1"
+ transform="matrix(48.14969,0,0,48.14969,-536.27327,-33.306752)">
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4134"
+ width="10"
+ height="10"
+ x="1"
+ y="1" />
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4136"
+ width="8"
+ height="8"
+ x="2"
+ y="2" />
+ </g>
+ <g
+ id="g3338"
+ transform="matrix(1.3973279,-0.2437849,0.2437849,1.3973279,-185.07402,-56.183307)" />
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:5.0999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 230.30587,99.49882 L 204.73195,136.82691 L 377.35595,136.82691 L 354.04434,99.49882 L 230.30587,99.49882 z M 266.04382,103.95789 L 317.91294,103.95789 L 317.91294,133.20391 L 266.04382,133.20391 L 266.04382,103.95789 z M 437.74977,115.2858 L 428.70053,136.58101 L 496.91406,136.58101 L 488.65172,115.2858 L 437.74977,115.2858 z M 105.53462,122.61371 L 101.10836,136.43347 L 146.99389,136.43347 L 143.79715,122.61371 L 105.53462,122.61371 z"
+ id="rect15047"
+ sodipodi:nodetypes="cccccccccccccccccccc" />
+ <path
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none"
+ d="M 78.25,148.84375 C 53.598467,148.84375 33.75,168.69222 33.75,193.34375 L 33.75,431.15625 C 33.75,455.80778 53.598467,475.65625 78.25,475.65625 L 504.8125,475.65625 C 529.46403,475.65625 549.3125,455.80778 549.3125,431.15625 L 549.3125,193.34375 C 549.3125,168.69222 529.46403,148.84375 504.8125,148.84375 L 78.25,148.84375 z M 338.5,191.8125 C 403.75142,191.8125 456.65625,244.68608 456.65625,309.9375 C 456.65625,375.18892 403.75142,428.09375 338.5,428.09375 C 273.24858,428.09375 2 [...]
+ id="rect15867" />
+ <path
+ transform="matrix(0.5974026,0,0,0.5974026,138.66776,124.78389)"
+ d="M 452.64549,309.94708 A 118.14815,118.14815 0 1 1 216.3492,309.94708 A 118.14815,118.14815 0 1 1 452.64549,309.94708 z"
+ sodipodi:ry="118.14815"
+ sodipodi:rx="118.14815"
+ sodipodi:cy="309.94708"
+ sodipodi:cx="334.49734"
+ id="path15871"
+ style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none"
+ sodipodi:type="arc" />
+</svg>
diff --git a/test/plt-striped.tif b/test/plt-striped.tif
new file mode 100644
index 0000000..f1036ce
Binary files /dev/null and b/test/plt-striped.tif differ
diff --git a/test/plt-tiled.tif b/test/plt-tiled.tif
new file mode 100644
index 0000000..0d5ba2b
Binary files /dev/null and b/test/plt-tiled.tif differ
diff --git a/test/png1.png b/test/png1.png
new file mode 100644
index 0000000..c55401d
Binary files /dev/null and b/test/png1.png differ
diff --git a/test/raster_symbolizer_1.xml b/test/raster_symbolizer_1.xml
new file mode 100644
index 0000000..3b39aa3
--- /dev/null
+++ b/test/raster_symbolizer_1.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>style1</Name>
+ <Description>
+ <Title>title: first style</Title>
+ <Abstract>abstract: first style</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <OverlapBehavior>AVERAGE</OverlapBehavior>
+ <ColorMap>
+ <Categorize fallbackValue="#78c818">
+ <LookupValue>Rasterdata</LookupValue>
+ <Value>#00ff00</Value>
+ <Threshold>-417</Threshold>
+ <Value>#00fa00</Value>
+ <Threshold>-333</Threshold>
+ <Value>#14f500</Value>
+ <Threshold>-250</Threshold>
+ <Value>#28f502</Value>
+ <Threshold>-167</Threshold>
+ <Value>#3cf505</Value>
+ <Threshold>-83</Threshold>
+ <Value>#50f50a</Value>
+ <Threshold>-1</Threshold>
+ <Value>#64f014</Value>
+ <Threshold>0</Threshold>
+ <Value>#a3a7a9</Value>
+ <Threshold>30</Threshold>
+ <Value>#78c818</Value>
+ <Threshold>105</Threshold>
+ <Value>#38840c</Value>
+ <Threshold>300</Threshold>
+ <Value>#2c4b04</Value>
+ <Threshold>400</Threshold>
+ <Value>#ffff00</Value>
+ <Threshold>700</Threshold>
+ <Value>#dcdc00</Value>
+ <Threshold>1200</Threshold>
+ <Value>#b47800</Value>
+ <Threshold>1400</Threshold>
+ <Value>#c85000</Value>
+ <Threshold>1600</Threshold>
+ <Value>#be4100</Value>
+ <Threshold>2000</Threshold>
+ <Value>#963000</Value>
+ <Threshold>3000</Threshold>
+ <Value>#3c0200</Value>
+ <Threshold>5000</Threshold>
+ <Value>#ffffff</Value>
+ <Threshold>13000</Threshold>
+ <Value>#ffffff</Value>
+ </Categorize>
+ </ColorMap>
+ <ShadedRelief/>
+</RasterSymbolizer>
diff --git a/test/raster_symbolizer_2.xml b/test/raster_symbolizer_2.xml
new file mode 100644
index 0000000..8053490
--- /dev/null
+++ b/test/raster_symbolizer_2.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>style2</Name>
+ <Description>
+ <Title>title: second style</Title>
+ </Description>
+ <Opacity>0.8</Opacity>
+ <ChannelSelection>
+ <RedChannel>
+ <SourceChannelName>1</SourceChannelName>
+ <ContrastEnhancement>
+ <Histogram/>
+ </ContrastEnhancement>
+ </RedChannel>
+ <GreenChannel>
+ <SourceChannelName>2</SourceChannelName>
+ <ContrastEnhancement>
+ <GammaValue>2.5</GammaValue>
+ </ContrastEnhancement>
+ </GreenChannel>
+ <BlueChannel>
+ <SourceChannelName>3</SourceChannelName>
+ <ContrastEnhancement>
+ <Normalize/>
+ </ContrastEnhancement>
+ </BlueChannel>
+ </ChannelSelection>
+ <OverlapBehavior>LATEST_ON_TOP</OverlapBehavior>
+ <ColorMap>
+ <Interpolate fallbackValue="#dddddd">
+ <LookupValue>Rasterdata</LookupValue>
+ <InterpolationPoint>
+ <Data>0</Data>
+ <Value>#000000</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>255</Data>
+ <Value>#ffffff</Value>
+ </InterpolationPoint>
+ </Interpolate>
+ </ColorMap>
+ <ContrastEnhancement>
+ <GammaValue>1.2</GammaValue>
+ </ContrastEnhancement>
+</RasterSymbolizer>
diff --git a/test/raster_symbolizer_3.xml b/test/raster_symbolizer_3.xml
new file mode 100644
index 0000000..f4aea16
--- /dev/null
+++ b/test/raster_symbolizer_3.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>style3</Name>
+ <ChannelSelection>
+ <GrayChannel>
+ <SourceChannelName>Band.band1</SourceChannelName>
+ </GrayChannel>
+ </ChannelSelection>
+ <ContrastEnhancement>
+ <Normalize/>
+ </ContrastEnhancement>
+</RasterSymbolizer>
diff --git a/test/raster_symbolizer_4.xml b/test/raster_symbolizer_4.xml
new file mode 100644
index 0000000..e2ebd18
--- /dev/null
+++ b/test/raster_symbolizer_4.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CoverageStyle version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/FeatureStyle.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>style1</Name>
+ <Description>
+ <Title>Coverage Style Title</Title>
+ </Description>
+ <Rule>
+ <RasterSymbolizer>
+ <Opacity>1.0</Opacity>
+ <OverlapBehavior>AVERAGE</OverlapBehavior>
+ <ColorMap>
+ <Categorize fallbackValue="#78c818">
+ <LookupValue>Rasterdata</LookupValue>
+ <Value>#00ff00</Value>
+ <Threshold>-417</Threshold>
+ <Value>#00fa00</Value>
+ <Threshold>-333</Threshold>
+ <Value>#14f500</Value>
+ <Threshold>-250</Threshold>
+ <Value>#28f502</Value>
+ <Threshold>-167</Threshold>
+ <Value>#3cf505</Value>
+ <Threshold>-83</Threshold>
+ <Value>#50f50a</Value>
+ <Threshold>-1</Threshold>
+ <Value>#64f014</Value>
+ <Threshold>0</Threshold>
+ <Value>#7deb32</Value>
+ <Threshold>30</Threshold>
+ <Value>#78c818</Value>
+ <Threshold>105</Threshold>
+ <Value>#38840c</Value>
+ <Threshold>300</Threshold>
+ <Value>#2c4b04</Value>
+ <Threshold>400</Threshold>
+ <Value>#ffff00</Value>
+ <Threshold>700</Threshold>
+ <Value>#dcdc00</Value>
+ <Threshold>1200</Threshold>
+ <Value>#b47800</Value>
+ <Threshold>1400</Threshold>
+ <Value>#c85000</Value>
+ <Threshold>1600</Threshold>
+ <Value>#be4100</Value>
+ <Threshold>2000</Threshold>
+ <Value>#963000</Value>
+ <Threshold>3000</Threshold>
+ <Value>#3c0200</Value>
+ <Threshold>5000</Threshold>
+ <Value>#ffffff</Value>
+ <Threshold>13000</Threshold>
+ <Value>#ffffff</Value>
+ </Categorize>
+ </ColorMap>
+ <ShadedRelief>
+ <BrightnessOnly>0</BrightnessOnly>
+ <ReliefFactor>33.5</ReliefFactor>
+ </ShadedRelief>
+ </RasterSymbolizer>
+ </Rule>
+</CoverageStyle>
diff --git a/test/raster_symbolizer_5.xml b/test/raster_symbolizer_5.xml
new file mode 100644
index 0000000..f4b5364
--- /dev/null
+++ b/test/raster_symbolizer_5.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CoverageStyle version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/FeatureStyle.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>style2</Name>
+ <Description>
+ <Title>Coverage Style Title</Title>
+ <Abstract>Coverage Style Abstract</Abstract>
+ </Description>
+ <Rule>
+ <Name>ChannelSelection</Name>
+ <Description>
+ <Title>RGB channel mapping</Title>
+ <Abstract>Abstract: RGB channel mapping</Abstract>
+ </Description>
+ <RasterSymbolizer>
+ <Name>style2</Name>
+ <Opacity>0.8</Opacity>
+ <ChannelSelection>
+ <RedChannel>
+ <SourceChannelName>1</SourceChannelName>
+ <ContrastEnhancement>
+ <Histogram/>
+ </ContrastEnhancement>
+ </RedChannel>
+ <GreenChannel>
+ <SourceChannelName>2</SourceChannelName>
+ <ContrastEnhancement>
+ <GammaValue>2.5</GammaValue>
+ </ContrastEnhancement>
+ </GreenChannel>
+ <BlueChannel>
+ <SourceChannelName>3</SourceChannelName>
+ <ContrastEnhancement>
+ <Normalize/>
+ </ContrastEnhancement>
+ </BlueChannel>
+ </ChannelSelection>
+ <OverlapBehavior>LATEST_ON_TOP</OverlapBehavior>
+ <ColorMap>
+ <Interpolate fallbackValue="#dddddd">
+ <LookupValue>Rasterdata</LookupValue>
+ <InterpolationPoint>
+ <Data>0</Data>
+ <Value>#000000</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>255</Data>
+ <Value>#ffffff</Value>
+ </InterpolationPoint>
+ </Interpolate>
+ </ColorMap>
+ <ContrastEnhancement>
+ <GammaValue>1.2</GammaValue>
+ </ContrastEnhancement>
+ </RasterSymbolizer>
+ </Rule>
+</CoverageStyle>
diff --git a/test/raster_symbolizer_6.xml b/test/raster_symbolizer_6.xml
new file mode 100644
index 0000000..a8ae8ab
--- /dev/null
+++ b/test/raster_symbolizer_6.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CoverageStyle version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/FeatureStyle.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>style3</Name>
+ <Rule>
+ <Name>ChannelSelection</Name>
+ <Description>
+ <Title>Gray channel mapping</Title>
+ </Description>
+ <RasterSymbolizer>
+ <ChannelSelection>
+ <GrayChannel>
+ <SourceChannelName>Band.band1</SourceChannelName>
+ </GrayChannel>
+ </ChannelSelection>
+ <ContrastEnhancement>
+ <Normalize/>
+ </ContrastEnhancement>
+ </RasterSymbolizer>
+ </Rule>
+</CoverageStyle>
diff --git a/test/restaurant.svg b/test/restaurant.svg
new file mode 100644
index 0000000..539b0ca
--- /dev/null
+++ b/test/restaurant.svg
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg:svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ inkscape:version="0.48.1 r9760"
+ sodipodi:docname="food_restaurant.svg">
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="640"
+ inkscape:window-height="480"
+ id="namedview11"
+ showgrid="false"
+ inkscape:zoom="0.45172414"
+ inkscape:cx="290"
+ inkscape:cy="290"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg2" />
+ <svg:metadata
+ id="metadata2975">
+ <RDF>
+ <Work
+ about="">
+ <format>image/svg+xml</format>
+ <type
+ resource="http://purl.org/dc/dcmitype/StillImage" />
+ <license
+ resource="http://web.resource.org/cc/PublicDomain" />
+ <language>en</language>
+ </Work>
+ </RDF>
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </svg:metadata>
+ <svg:defs
+ id="defs4" />
+ <svg:g
+ id="g1327">
+ <svg:path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 l 0,450.123 c 0,40.844 20.894,62.229 62.192,62.229 l 452.024,0 c 41.307,0 62.229,-20.316 62.229,-62.229 l 0,-450.123 c 0,-42.601 -20.922,-65.036 -63.522,-65.036 -0.003,0 -448.494,-0.143 -448.352,0 z"
+ style="fill:#111111;stroke:#eeeeee;stroke-width:3.40799999"
+ id="path1329"
+ inkscape:connector-curvature="0" />
+ </svg:g>
+ <svg:path
+ d="m 203.725,338.602 c 37.643,-17.466 64.864,-67.996 64.864,-127.642 0,-74.115 -61.834,-155.247 -93.849,-155.247 -32.014,0 -93.85,81.132 -93.85,155.247 0,59.646 27.223,110.176 64.865,127.642 l -7.792,176.545 73.553,0 -7.791,-176.545 z"
+ style="fill:#ffffff"
+ id="path2110"
+ inkscape:connector-curvature="0" />
+ <svg:path
+ d="m 430.231,368.602 c 37.642,-17.466 51.389,-39.928 51.389,-99.574 L 471.839,66.214 c 0,-3.875 -3.142,-7.017 -7.018,-7.017 l -4.607,0 c -3.873,0 -7.016,3.141 -7.016,7.017 l 3.26,202.814 -20.259,0 -5.132,-204.789 c 0,-3.875 -3.142,-7.017 -7.018,-7.017 l -5.995,0 c -3.874,0 -7.016,3.142 -7.016,7.017 l 2.775,204.789 -25.137,0 2.775,-204.789 c 0,-3.875 -3.142,-7.017 -7.017,-7.017 l -5.996,0 c -3.875,0 -7.016,3.142 -7.016,7.017 l -5.132,204.789 -19.835,0 3.26,-202.789 c 0,-3.875 -3.142, [...]
+ style="fill:#ffffff"
+ id="path2112"
+ inkscape:connector-curvature="0" />
+</svg:svg>
diff --git a/test/rgb-striped.tif b/test/rgb-striped.tif
new file mode 100644
index 0000000..780ba4a
Binary files /dev/null and b/test/rgb-striped.tif differ
diff --git a/test/rgb-tiled.tif b/test/rgb-tiled.tif
new file mode 100644
index 0000000..7e78219
Binary files /dev/null and b/test/rgb-tiled.tif differ
diff --git a/test/rgb_gamma.xml b/test/rgb_gamma.xml
new file mode 100644
index 0000000..63a8221
--- /dev/null
+++ b/test/rgb_gamma.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>rgb_gamma</Name>
+ <Description>
+ <Title>Natural Color RGB, GammaValue</Title>
+ <Abstract>Natural Color RGB, contrast enhancement: GAMMA Value</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ChannelSelection>
+ <RedChannel>
+ <SourceChannelName>3</SourceChannelName>
+ <ContrastEnhancement>
+ <GammaValue>1.6</GammaValue>
+ </ContrastEnhancement>
+ </RedChannel>
+ <GreenChannel>
+ <SourceChannelName>2</SourceChannelName>
+ <ContrastEnhancement>
+ <GammaValue>1.6</GammaValue>
+ </ContrastEnhancement>
+ </GreenChannel>
+ <BlueChannel>
+ <SourceChannelName>1</SourceChannelName>
+ <ContrastEnhancement>
+ <GammaValue>1.6</GammaValue>
+ </ContrastEnhancement>
+ </BlueChannel>
+ </ChannelSelection>
+</RasterSymbolizer>
diff --git a/test/rgb_histogram.xml b/test/rgb_histogram.xml
new file mode 100644
index 0000000..90aee85
--- /dev/null
+++ b/test/rgb_histogram.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>rgb_histogram</Name>
+ <Description>
+ <Title>Natural Color RGB, Histogram</Title>
+ <Abstract>Natural Color RGB, contrast enhancement: HISTOGRAM</Abstract>
+ </Description>
+ <Opacity>0.7</Opacity>
+ <ChannelSelection>
+ <RedChannel>
+ <SourceChannelName>3</SourceChannelName>
+ </RedChannel>
+ <GreenChannel>
+ <SourceChannelName>2</SourceChannelName>
+ </GreenChannel>
+ <BlueChannel>
+ <SourceChannelName>1</SourceChannelName>
+ </BlueChannel>
+ </ChannelSelection>
+ <ContrastEnhancement>
+ <Histogram/>
+ </ContrastEnhancement>
+</RasterSymbolizer>
diff --git a/test/rgb_histogram2.xml b/test/rgb_histogram2.xml
new file mode 100644
index 0000000..cb0e29a
--- /dev/null
+++ b/test/rgb_histogram2.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>rgb_histogram2</Name>
+ <Description>
+ <Title>Natural Color RGB, Histogram</Title>
+ <Abstract>Natural Color RGB, contrast enhancement: HISTOGRAM</Abstract>
+ </Description>
+ <Opacity>0.7</Opacity>
+ <ChannelSelection>
+ <RedChannel>
+ <SourceChannelName>3</SourceChannelName>
+ <ContrastEnhancement>
+ <Histogram/>
+ </ContrastEnhancement>
+ </RedChannel>
+ <GreenChannel>
+ <SourceChannelName>2</SourceChannelName>
+ <ContrastEnhancement>
+ <Histogram/>
+ </ContrastEnhancement>
+ </GreenChannel>
+ <BlueChannel>
+ <SourceChannelName>1</SourceChannelName>
+ <ContrastEnhancement>
+ <Histogram/>
+ </ContrastEnhancement>
+ </BlueChannel>
+ </ChannelSelection>
+</RasterSymbolizer>
diff --git a/test/rgb_normalize.xml b/test/rgb_normalize.xml
new file mode 100644
index 0000000..7ba09e5
--- /dev/null
+++ b/test/rgb_normalize.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>rgb_normalize</Name>
+ <Description>
+ <Title>Natural Color RGB, Normalize</Title>
+ <Abstract>Natural Color RGB, contrast enhancement: NORMALIZE</Abstract>
+ </Description>
+ <Opacity>0.7</Opacity>
+ <ChannelSelection>
+ <RedChannel>
+ <SourceChannelName>3</SourceChannelName>
+ </RedChannel>
+ <GreenChannel>
+ <SourceChannelName>2</SourceChannelName>
+ </GreenChannel>
+ <BlueChannel>
+ <SourceChannelName>1</SourceChannelName>
+ </BlueChannel>
+ </ChannelSelection>
+ <ContrastEnhancement>
+ <Normalize/>
+ </ContrastEnhancement>
+</RasterSymbolizer>
diff --git a/test/rgb_normalize2.xml b/test/rgb_normalize2.xml
new file mode 100644
index 0000000..59f12b2
--- /dev/null
+++ b/test/rgb_normalize2.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>rgb_normalize2</Name>
+ <Description>
+ <Title>Natural Color RGB, Normalize</Title>
+ <Abstract>Natural Color RGB, contrast enhancement: NORMALIZE</Abstract>
+ </Description>
+ <Opacity>0.7</Opacity>
+ <ChannelSelection>
+ <RedChannel>
+ <SourceChannelName>3</SourceChannelName>
+ <ContrastEnhancement>
+ <Normalize/>
+ </ContrastEnhancement>
+ </RedChannel>
+ <GreenChannel>
+ <SourceChannelName>2</SourceChannelName>
+ <ContrastEnhancement>
+ <Normalize/>
+ </ContrastEnhancement>
+ </GreenChannel>
+ <BlueChannel>
+ <SourceChannelName>1</SourceChannelName>
+ <ContrastEnhancement>
+ <Normalize/>
+ </ContrastEnhancement>
+ </BlueChannel>
+ </ChannelSelection>
+</RasterSymbolizer>
diff --git a/test/scandir4win.h b/test/scandir4win.h
new file mode 100644
index 0000000..82c70b9
--- /dev/null
+++ b/test/scandir4win.h
@@ -0,0 +1,168 @@
+/*
+ * scandir() for win32
+ * this tool should make life easier for people writing for both unix
+and wintel
+ * written by Tom Torfs, 2002/10/31
+ * donated to the public domain; use this code for anything you like
+as long as
+ * it is understood there are absolutely *NO* warranties of any kind,
+even implied
+ */
+
+#ifdef _WIN32
+
+#include <Windows.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#define MAXNAMLEN FILENAME_MAX
+
+/* directory entry structure */
+struct dirent
+{
+ char d_name[MAXNAMLEN + 1]; /* name of directory entry (0 terminated) */
+ ino_t d_ino; /* file serial number -- will be 0 for win32 */
+ short d_namlen; /* length of string in d_name */
+ short d_reclen; /* length of this record */
+};
+
+/* the scandir() function */
+int scandir (const char *dirname,
+ struct dirent ***namelist,
+ int (*select) (const struct dirent *),
+ int (*compar) (const void *, const void *));
+
+/* compare function for scandir() for alphabetic sort (case-insensitive on Win32) */
+int alphasort (const void *d1, const void *d2);
+
+/* case-insensitive strcmp() */
+int istrcmp (const char *s1, const char *s2);
+
+#endif
+
+/*
+ * scandir() for win32
+ * this tool should make life easier for people writing for both unix and wintel
+ * written by Tom Torfs, 2002/10/31
+ * donated to the public domain; use this code for anything you like as long as
+ * it is understood there are absolutely *NO* warranties of any kind, even implied
+ */
+
+int
+scandir (const char *dirname,
+ struct dirent ***namelist,
+ int (*select) (const struct dirent *),
+ int (*compar) (const void *, const void *))
+{
+ WIN32_FIND_DATA wfd;
+ HANDLE hf;
+ struct dirent **plist, **newlist;
+ struct dirent d;
+ int numentries = 0;
+ int allocentries = 255;
+ int i;
+ char path[FILENAME_MAX];
+
+ i = strlen (dirname);
+
+ if (i > sizeof path - 5)
+ return -1;
+
+ strcpy (path, dirname);
+ if (i > 0 && dirname[i - 1] != '\\' && dirname[i - 1] != '/')
+ strcat (path, "\\");
+ strcat (path, "*.*");
+
+ hf = FindFirstFile (path, &wfd);
+ if (hf == INVALID_HANDLE_VALUE)
+ return -1;
+
+ plist = malloc (sizeof *plist * allocentries);
+ if (plist == NULL)
+ {
+ FindClose (hf);
+ return -1;
+ }
+
+ do
+ {
+ if (numentries == allocentries)
+ {
+ allocentries *= 2;
+ newlist = realloc (plist, sizeof *plist * allocentries);
+ if (newlist == NULL)
+ {
+ for (i = 0; i < numentries; i++)
+ free (plist[i]);
+ free (plist);
+ FindClose (hf);
+ return -1;
+ }
+ plist = newlist;
+ }
+
+ strncpy (d.d_name, wfd.cFileName, sizeof d.d_name);
+ d.d_ino = 0;
+ d.d_namlen = strlen (wfd.cFileName);
+ d.d_reclen = sizeof d;
+
+ if (select == NULL || select (&d))
+ {
+ plist[numentries] = malloc (sizeof d);
+ if (plist[numentries] == NULL)
+ {
+ for (i = 0; i < numentries; i++)
+ free (plist[i]);
+ free (plist);
+ FindClose (hf);
+ return -1;
+ };
+ memcpy (plist[numentries], &d, sizeof d);
+ numentries++;
+ }
+ }
+ while (FindNextFile (hf, &wfd));
+
+ FindClose (hf);
+
+ if (numentries == 0)
+ {
+ free (plist);
+ *namelist = NULL;
+ }
+ else
+ {
+ newlist = realloc (plist, sizeof *plist * numentries);
+ if (newlist != NULL)
+ plist = newlist;
+
+ if (compar != NULL)
+ qsort (plist, numentries, sizeof *plist, compar);
+
+ *namelist = plist;
+ }
+
+ return numentries;
+}
+
+int
+alphasort (const void *x1, const void *x2)
+{
+ const struct dirent **d1 = (const struct dirent **) x1;
+ const struct dirent **d2 = (const struct dirent **) x2;
+ return istrcmp ((*d1)->d_name, (*d2)->d_name);
+}
+
+int
+istrcmp (const char *s1, const char *s2)
+{
+ int d;
+ for (;;)
+ {
+ d = tolower (*s1) - tolower (*s2);
+ if (d != 0 || *s1 == '\0' || *s2 == '\0')
+ return d;
+ s1++;
+ s2++;
+ }
+}
diff --git a/test/sql_stmt_security_tests/Makefile.am b/test/sql_stmt_security_tests/Makefile.am
new file mode 100644
index 0000000..804a448
--- /dev/null
+++ b/test/sql_stmt_security_tests/Makefile.am
@@ -0,0 +1,242 @@
+
+EXTRA_DIST = loadraster1.testcase \
+ loadraster2.testcase \
+ loadraster3.testcase \
+ loadraster4.testcase \
+ loadraster5.testcase \
+ loadraster6.testcase \
+ loadraster7.testcase \
+ loadraster8.testcase \
+ loadraster9.testcase \
+ loadraster10.testcase \
+ loadraster11.testcase \
+ loadraster12.testcase \
+ loadraster13.testcase \
+ loadraster14.testcase \
+ loadraster15.testcase \
+ loadraster16.testcase \
+ loadraster17.testcase \
+ loadraster18.testcase \
+ loadraster19.testcase \
+ loadraster20.testcase \
+ loadraster21.testcase \
+ loadraster22.testcase \
+ loadraster23.testcase \
+ loadraster24.testcase \
+ loadrasterdir1.testcase \
+ loadrasterdir2.testcase \
+ loadrasterdir3.testcase \
+ loadrasterdir4.testcase \
+ loadrasterdir5.testcase \
+ loadrasterdir6.testcase \
+ loadrasterdir7.testcase \
+ loadrasterdir8.testcase \
+ loadrasterdir9.testcase \
+ loadrasterdir10.testcase \
+ loadrasterdir11.testcase \
+ loadrasterdir12.testcase \
+ loadrasterdir13.testcase \
+ loadrasterdir14.testcase \
+ loadrasterdir15.testcase \
+ loadrasterdir16.testcase \
+ loadrasterdir17.testcase \
+ loadrasterdir18.testcase \
+ loadrasterdir19.testcase \
+ loadrasterdir20.testcase \
+ loadrasterdir21.testcase \
+ loadrasterdir22.testcase \
+ loadrasterdir23.testcase \
+ loadrasterdir24.testcase \
+ loadrasterdir25.testcase \
+ loadrasterdir26.testcase \
+ loadrasterdir27.testcase \
+ loadrasterdir28.testcase \
+ loadrasterwms1.testcase \
+ loadrasterwms2.testcase \
+ loadrasterwms3.testcase \
+ loadrasterwms4.testcase \
+ loadrasterwms5.testcase \
+ loadrasterwms6.testcase \
+ loadrasterwms7.testcase \
+ loadrasterwms8.testcase \
+ loadrasterwms9.testcase \
+ loadrasterwms10.testcase \
+ loadrasterwms11.testcase \
+ loadrasterwms12.testcase \
+ loadrasterwms13.testcase \
+ loadrasterwms14.testcase \
+ loadrasterwms15.testcase \
+ loadrasterwms16.testcase \
+ loadrasterwms17.testcase \
+ loadrasterwms18.testcase \
+ loadrasterwms19.testcase \
+ writeascii1.testcase \
+ writeascii2.testcase \
+ writeascii3.testcase \
+ writeascii4.testcase \
+ writeascii5.testcase \
+ writeascii6.testcase \
+ writeascii7.testcase \
+ writeascii9.testcase \
+ writeascii10.testcase \
+ writeascii11.testcase \
+ writeascii12.testcase \
+ writeascii13.testcase \
+ writeascii14.testcase \
+ writeascii15.testcase \
+ writeascii16.testcase \
+ writeascii17.testcase \
+ writeascii18.testcase \
+ writebandtiff1.testcase \
+ writebandtiff2.testcase \
+ writebandtiff3.testcase \
+ writebandtiff4.testcase \
+ writebandtiff5.testcase \
+ writebandtiff6.testcase \
+ writebandtiff7.testcase \
+ writebandtiff8.testcase \
+ writebandtiff9.testcase \
+ writebandtiff10.testcase \
+ writebandtiff11.testcase \
+ writebandtiff12.testcase \
+ writebandtiff13.testcase \
+ writebandtiff14.testcase \
+ writebandtiff15.testcase \
+ writebandtiff16.testcase \
+ writebandtiff17.testcase \
+ writebandtiff18.testcase \
+ writebandtiff19.testcase \
+ writebandtiff20.testcase \
+ writebandtiff21.testcase \
+ writebandtiff22.testcase \
+ writebandtiff23.testcase \
+ writebandtiff24.testcase \
+ writebandtiff25.testcase \
+ writebandtiff26.testcase \
+ writebandtiff27.testcase \
+ writebandgeotiff1.testcase \
+ writebandgeotiff2.testcase \
+ writebandgeotiff3.testcase \
+ writebandgeotiff4.testcase \
+ writebandgeotiff5.testcase \
+ writebandgeotiff6.testcase \
+ writebandgeotiff7.testcase \
+ writebandgeotiff8.testcase \
+ writebandgeotiff9.testcase \
+ writebandgeotiff10.testcase \
+ writebandgeotiff11.testcase \
+ writebandgeotiff12.testcase \
+ writebandgeotiff13.testcase \
+ writebandgeotiff14.testcase \
+ writebandgeotiff15.testcase \
+ writebandgeotiff16.testcase \
+ writebandgeotiff17.testcase \
+ writebandgeotiff18.testcase \
+ writebandgeotiff19.testcase \
+ writebandgeotiff20.testcase \
+ writebandgeotiff21.testcase \
+ writebandgeotiff22.testcase \
+ writebandgeotiff23.testcase \
+ writebandgeotiff24.testcase \
+ writebandgeotiff25.testcase \
+ writebandgeotiff26.testcase \
+ writebandgeotiff27.testcase \
+ writebandgeotiff28.testcase \
+ writemonotiff1.testcase \
+ writemonotiff2.testcase \
+ writemonotiff3.testcase \
+ writemonotiff4.testcase \
+ writemonotiff5.testcase \
+ writemonotiff6.testcase \
+ writemonotiff7.testcase \
+ writemonotiff8.testcase \
+ writemonotiff9.testcase \
+ writemonotiff10.testcase \
+ writemonotiff11.testcase \
+ writemonotiff12.testcase \
+ writemonotiff13.testcase \
+ writemonotiff14.testcase \
+ writemonotiff15.testcase \
+ writemonotiff16.testcase \
+ writemonotiff17.testcase \
+ writemonotiff18.testcase \
+ writemonotiff19.testcase \
+ writemonotiff20.testcase \
+ writemonotiff21.testcase \
+ writemonogeotiff1.testcase \
+ writemonogeotiff2.testcase \
+ writemonogeotiff3.testcase \
+ writemonogeotiff4.testcase \
+ writemonogeotiff5.testcase \
+ writemonogeotiff6.testcase \
+ writemonogeotiff7.testcase \
+ writemonogeotiff8.testcase \
+ writemonogeotiff9.testcase \
+ writemonogeotiff10.testcase \
+ writemonogeotiff11.testcase \
+ writemonogeotiff12.testcase \
+ writemonogeotiff13.testcase \
+ writemonogeotiff14.testcase \
+ writemonogeotiff15.testcase \
+ writemonogeotiff16.testcase \
+ writemonogeotiff17.testcase \
+ writemonogeotiff18.testcase \
+ writemonogeotiff19.testcase \
+ writemonogeotiff20.testcase \
+ writemonogeotiff21.testcase \
+ writemonogeotiff22.testcase \
+ writegeotiff1.testcase \
+ writegeotiff2.testcase \
+ writegeotiff3.testcase \
+ writegeotiff4.testcase \
+ writegeotiff5.testcase \
+ writegeotiff6.testcase \
+ writegeotiff7.testcase \
+ writegeotiff8.testcase \
+ writegeotiff9.testcase \
+ writegeotiff10.testcase \
+ writegeotiff11.testcase \
+ writegeotiff12.testcase \
+ writegeotiff13.testcase \
+ writegeotiff14.testcase \
+ writegeotiff15.testcase \
+ writegeotiff16.testcase \
+ writegeotiff17.testcase \
+ writegeotiff18.testcase \
+ writegeotiff19.testcase \
+ writejpeg1.testcase \
+ writejpeg2.testcase \
+ writejpeg3.testcase \
+ writejpeg4.testcase \
+ writejpeg5.testcase \
+ writejpeg6.testcase \
+ writejpeg7.testcase \
+ writejpeg8.testcase \
+ writejpeg9.testcase \
+ writejpeg10.testcase \
+ writejpeg11.testcase \
+ writejpeg12.testcase \
+ writejpeg13.testcase \
+ writejpeg14.testcase \
+ writejpeg15.testcase \
+ writetiff1.testcase \
+ writetiff2.testcase \
+ writetiff3.testcase \
+ writetiff4.testcase \
+ writetiff5.testcase \
+ writetiff6.testcase \
+ writetiff7.testcase \
+ writetiff8.testcase \
+ writetiff9.testcase \
+ writetiff10.testcase \
+ writetiff11.testcase \
+ writetiff12.testcase \
+ writetiff13.testcase \
+ writetiff14.testcase \
+ writetiff15.testcase \
+ writetiff16.testcase \
+ writetiff17.testcase \
+ writetiff18.testcase
+
+
+
diff --git a/test/sql_stmt_security_tests/Makefile.in b/test/sql_stmt_security_tests/Makefile.in
new file mode 100644
index 0000000..f2b5958
--- /dev/null
+++ b/test/sql_stmt_security_tests/Makefile.in
@@ -0,0 +1,684 @@
+# Makefile.in generated by automake 1.13.4 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.
+
+ at 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@
+pkgincludedir = $(includedir)/@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 = test/sql_stmt_security_tests
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(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)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ 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__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAIRO_CFLAGS = @LIBCAIRO_CFLAGS@
+LIBCAIRO_LIBS = @LIBCAIRO_LIBS@
+LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@
+LIBLZMA_LIBS = @LIBLZMA_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
+LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
+LIBTOOL = @LIBTOOL@
+LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@
+LIBWEBP_LIBS = @LIBWEBP_LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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_CXX = @ac_ct_CXX@
+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@
+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@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = loadraster1.testcase \
+ loadraster2.testcase \
+ loadraster3.testcase \
+ loadraster4.testcase \
+ loadraster5.testcase \
+ loadraster6.testcase \
+ loadraster7.testcase \
+ loadraster8.testcase \
+ loadraster9.testcase \
+ loadraster10.testcase \
+ loadraster11.testcase \
+ loadraster12.testcase \
+ loadraster13.testcase \
+ loadraster14.testcase \
+ loadraster15.testcase \
+ loadraster16.testcase \
+ loadraster17.testcase \
+ loadraster18.testcase \
+ loadraster19.testcase \
+ loadraster20.testcase \
+ loadraster21.testcase \
+ loadraster22.testcase \
+ loadraster23.testcase \
+ loadraster24.testcase \
+ loadrasterdir1.testcase \
+ loadrasterdir2.testcase \
+ loadrasterdir3.testcase \
+ loadrasterdir4.testcase \
+ loadrasterdir5.testcase \
+ loadrasterdir6.testcase \
+ loadrasterdir7.testcase \
+ loadrasterdir8.testcase \
+ loadrasterdir9.testcase \
+ loadrasterdir10.testcase \
+ loadrasterdir11.testcase \
+ loadrasterdir12.testcase \
+ loadrasterdir13.testcase \
+ loadrasterdir14.testcase \
+ loadrasterdir15.testcase \
+ loadrasterdir16.testcase \
+ loadrasterdir17.testcase \
+ loadrasterdir18.testcase \
+ loadrasterdir19.testcase \
+ loadrasterdir20.testcase \
+ loadrasterdir21.testcase \
+ loadrasterdir22.testcase \
+ loadrasterdir23.testcase \
+ loadrasterdir24.testcase \
+ loadrasterdir25.testcase \
+ loadrasterdir26.testcase \
+ loadrasterdir27.testcase \
+ loadrasterdir28.testcase \
+ loadrasterwms1.testcase \
+ loadrasterwms2.testcase \
+ loadrasterwms3.testcase \
+ loadrasterwms4.testcase \
+ loadrasterwms5.testcase \
+ loadrasterwms6.testcase \
+ loadrasterwms7.testcase \
+ loadrasterwms8.testcase \
+ loadrasterwms9.testcase \
+ loadrasterwms10.testcase \
+ loadrasterwms11.testcase \
+ loadrasterwms12.testcase \
+ loadrasterwms13.testcase \
+ loadrasterwms14.testcase \
+ loadrasterwms15.testcase \
+ loadrasterwms16.testcase \
+ loadrasterwms17.testcase \
+ loadrasterwms18.testcase \
+ loadrasterwms19.testcase \
+ writeascii1.testcase \
+ writeascii2.testcase \
+ writeascii3.testcase \
+ writeascii4.testcase \
+ writeascii5.testcase \
+ writeascii6.testcase \
+ writeascii7.testcase \
+ writeascii9.testcase \
+ writeascii10.testcase \
+ writeascii11.testcase \
+ writeascii12.testcase \
+ writeascii13.testcase \
+ writeascii14.testcase \
+ writeascii15.testcase \
+ writeascii16.testcase \
+ writeascii17.testcase \
+ writeascii18.testcase \
+ writebandtiff1.testcase \
+ writebandtiff2.testcase \
+ writebandtiff3.testcase \
+ writebandtiff4.testcase \
+ writebandtiff5.testcase \
+ writebandtiff6.testcase \
+ writebandtiff7.testcase \
+ writebandtiff8.testcase \
+ writebandtiff9.testcase \
+ writebandtiff10.testcase \
+ writebandtiff11.testcase \
+ writebandtiff12.testcase \
+ writebandtiff13.testcase \
+ writebandtiff14.testcase \
+ writebandtiff15.testcase \
+ writebandtiff16.testcase \
+ writebandtiff17.testcase \
+ writebandtiff18.testcase \
+ writebandtiff19.testcase \
+ writebandtiff20.testcase \
+ writebandtiff21.testcase \
+ writebandtiff22.testcase \
+ writebandtiff23.testcase \
+ writebandtiff24.testcase \
+ writebandtiff25.testcase \
+ writebandtiff26.testcase \
+ writebandtiff27.testcase \
+ writebandgeotiff1.testcase \
+ writebandgeotiff2.testcase \
+ writebandgeotiff3.testcase \
+ writebandgeotiff4.testcase \
+ writebandgeotiff5.testcase \
+ writebandgeotiff6.testcase \
+ writebandgeotiff7.testcase \
+ writebandgeotiff8.testcase \
+ writebandgeotiff9.testcase \
+ writebandgeotiff10.testcase \
+ writebandgeotiff11.testcase \
+ writebandgeotiff12.testcase \
+ writebandgeotiff13.testcase \
+ writebandgeotiff14.testcase \
+ writebandgeotiff15.testcase \
+ writebandgeotiff16.testcase \
+ writebandgeotiff17.testcase \
+ writebandgeotiff18.testcase \
+ writebandgeotiff19.testcase \
+ writebandgeotiff20.testcase \
+ writebandgeotiff21.testcase \
+ writebandgeotiff22.testcase \
+ writebandgeotiff23.testcase \
+ writebandgeotiff24.testcase \
+ writebandgeotiff25.testcase \
+ writebandgeotiff26.testcase \
+ writebandgeotiff27.testcase \
+ writebandgeotiff28.testcase \
+ writemonotiff1.testcase \
+ writemonotiff2.testcase \
+ writemonotiff3.testcase \
+ writemonotiff4.testcase \
+ writemonotiff5.testcase \
+ writemonotiff6.testcase \
+ writemonotiff7.testcase \
+ writemonotiff8.testcase \
+ writemonotiff9.testcase \
+ writemonotiff10.testcase \
+ writemonotiff11.testcase \
+ writemonotiff12.testcase \
+ writemonotiff13.testcase \
+ writemonotiff14.testcase \
+ writemonotiff15.testcase \
+ writemonotiff16.testcase \
+ writemonotiff17.testcase \
+ writemonotiff18.testcase \
+ writemonotiff19.testcase \
+ writemonotiff20.testcase \
+ writemonotiff21.testcase \
+ writemonogeotiff1.testcase \
+ writemonogeotiff2.testcase \
+ writemonogeotiff3.testcase \
+ writemonogeotiff4.testcase \
+ writemonogeotiff5.testcase \
+ writemonogeotiff6.testcase \
+ writemonogeotiff7.testcase \
+ writemonogeotiff8.testcase \
+ writemonogeotiff9.testcase \
+ writemonogeotiff10.testcase \
+ writemonogeotiff11.testcase \
+ writemonogeotiff12.testcase \
+ writemonogeotiff13.testcase \
+ writemonogeotiff14.testcase \
+ writemonogeotiff15.testcase \
+ writemonogeotiff16.testcase \
+ writemonogeotiff17.testcase \
+ writemonogeotiff18.testcase \
+ writemonogeotiff19.testcase \
+ writemonogeotiff20.testcase \
+ writemonogeotiff21.testcase \
+ writemonogeotiff22.testcase \
+ writegeotiff1.testcase \
+ writegeotiff2.testcase \
+ writegeotiff3.testcase \
+ writegeotiff4.testcase \
+ writegeotiff5.testcase \
+ writegeotiff6.testcase \
+ writegeotiff7.testcase \
+ writegeotiff8.testcase \
+ writegeotiff9.testcase \
+ writegeotiff10.testcase \
+ writegeotiff11.testcase \
+ writegeotiff12.testcase \
+ writegeotiff13.testcase \
+ writegeotiff14.testcase \
+ writegeotiff15.testcase \
+ writegeotiff16.testcase \
+ writegeotiff17.testcase \
+ writegeotiff18.testcase \
+ writegeotiff19.testcase \
+ writejpeg1.testcase \
+ writejpeg2.testcase \
+ writejpeg3.testcase \
+ writejpeg4.testcase \
+ writejpeg5.testcase \
+ writejpeg6.testcase \
+ writejpeg7.testcase \
+ writejpeg8.testcase \
+ writejpeg9.testcase \
+ writejpeg10.testcase \
+ writejpeg11.testcase \
+ writejpeg12.testcase \
+ writejpeg13.testcase \
+ writejpeg14.testcase \
+ writejpeg15.testcase \
+ writetiff1.testcase \
+ writetiff2.testcase \
+ writetiff3.testcase \
+ writetiff4.testcase \
+ writetiff5.testcase \
+ writetiff6.testcase \
+ writetiff7.testcase \
+ writetiff8.testcase \
+ writetiff9.testcase \
+ writetiff10.testcase \
+ writetiff11.testcase \
+ writetiff12.testcase \
+ writetiff13.testcase \
+ writetiff14.testcase \
+ writetiff15.testcase \
+ writetiff16.testcase \
+ writetiff17.testcase \
+ writetiff18.testcase
+
+all: 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) --gnu test/sql_stmt_security_tests/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu test/sql_stmt_security_tests/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):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+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
+all-am: Makefile
+installdirs:
+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)
+
+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
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+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:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool 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-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-am uninstall uninstall-am
+
+
+# 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:
diff --git a/test/sql_stmt_security_tests/loadraster1.testcase b/test/sql_stmt_security_tests/loadraster1.testcase
new file mode 100644
index 0000000..5a4ca19
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster1.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - NULL coverage
+:memory: #use in-memory database
+SELECT RL2_LoadRaster(NULL, 'somepath.tif');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster(NULL, 'somepath.tif')
+-1
diff --git a/test/sql_stmt_security_tests/loadraster10.testcase b/test/sql_stmt_security_tests/loadraster10.testcase
new file mode 100644
index 0000000..363cfe4
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster10.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - DOUBLE worldfile
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 1.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadraster11.testcase b/test/sql_stmt_security_tests/loadraster11.testcase
new file mode 100644
index 0000000..dbea372
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster11.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - BLOB worldfile
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', zeroblob(4))
+-1
diff --git a/test/sql_stmt_security_tests/loadraster12.testcase b/test/sql_stmt_security_tests/loadraster12.testcase
new file mode 100644
index 0000000..6c69629
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster12.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - TEXT worldfile
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 'yes');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 'yes')
+-1
diff --git a/test/sql_stmt_security_tests/loadraster13.testcase b/test/sql_stmt_security_tests/loadraster13.testcase
new file mode 100644
index 0000000..47db795
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster13.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - NULL srid
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadraster14.testcase b/test/sql_stmt_security_tests/loadraster14.testcase
new file mode 100644
index 0000000..92b785a
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster14.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - TEXT srid
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, 'srid');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, 'srid')
+-1
diff --git a/test/sql_stmt_security_tests/loadraster15.testcase b/test/sql_stmt_security_tests/loadraster15.testcase
new file mode 100644
index 0000000..dc3d70e
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster15.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - DOUBLE srid
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, 1.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadraster16.testcase b/test/sql_stmt_security_tests/loadraster16.testcase
new file mode 100644
index 0000000..8a64e49
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster16.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - BLOB srid
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, zeroblob(4))
+-1
diff --git a/test/sql_stmt_security_tests/loadraster17.testcase b/test/sql_stmt_security_tests/loadraster17.testcase
new file mode 100644
index 0000000..a64b3b9
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster17.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - NULL transaction
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 0, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadraster18.testcase b/test/sql_stmt_security_tests/loadraster18.testcase
new file mode 100644
index 0000000..2278930
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster18.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - TEXT transaction
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 1, 'no');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 1, 'no')
+-1
diff --git a/test/sql_stmt_security_tests/loadraster19.testcase b/test/sql_stmt_security_tests/loadraster19.testcase
new file mode 100644
index 0000000..b576a69
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster19.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - DOUBLE transaction
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 1, 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 1, 1.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadraster2.testcase b/test/sql_stmt_security_tests/loadraster2.testcase
new file mode 100644
index 0000000..ea42b9d
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster2.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - NULL path
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alpha', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alpha', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadraster20.testcase b/test/sql_stmt_security_tests/loadraster20.testcase
new file mode 100644
index 0000000..b36fe62
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster20.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - BLOB transaction
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 0, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 0, zeroblob(4))
+-1
diff --git a/test/sql_stmt_security_tests/loadraster21.testcase b/test/sql_stmt_security_tests/loadraster21.testcase
new file mode 100644
index 0000000..75123c2
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster21.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - NULL pyramidize
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadraster22.testcase b/test/sql_stmt_security_tests/loadraster22.testcase
new file mode 100644
index 0000000..1b43d97
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster22.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - TEXT pyramidize
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 'no');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 'no')
+-1
diff --git a/test/sql_stmt_security_tests/loadraster23.testcase b/test/sql_stmt_security_tests/loadraster23.testcase
new file mode 100644
index 0000000..db19c1b
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster23.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - DOUBLE pyramidize
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, 1.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadraster24.testcase b/test/sql_stmt_security_tests/loadraster24.testcase
new file mode 100644
index 0000000..cbac62f
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster24.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - BLOB pyramidize
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', 0, 3003, zeroblob(4))
+-1
diff --git a/test/sql_stmt_security_tests/loadraster3.testcase b/test/sql_stmt_security_tests/loadraster3.testcase
new file mode 100644
index 0000000..1750308
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster3.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - INTEGER path
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alpha', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alpha', 1)
+-1
diff --git a/test/sql_stmt_security_tests/loadraster4.testcase b/test/sql_stmt_security_tests/loadraster4.testcase
new file mode 100644
index 0000000..c532ac5
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster4.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - DOUBLE path
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alpha', 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alpha', 1.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadraster5.testcase b/test/sql_stmt_security_tests/loadraster5.testcase
new file mode 100644
index 0000000..33d175d
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster5.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - BLOB path
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alpha', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alpha', zeroblob(4))
+-1
diff --git a/test/sql_stmt_security_tests/loadraster6.testcase b/test/sql_stmt_security_tests/loadraster6.testcase
new file mode 100644
index 0000000..8cecae4
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster6.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - INT coverage
+:memory: #use in-memory database
+SELECT RL2_LoadRaster(1, 'somepath.tif');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster(1, 'somepath.tif')
+-1
diff --git a/test/sql_stmt_security_tests/loadraster7.testcase b/test/sql_stmt_security_tests/loadraster7.testcase
new file mode 100644
index 0000000..c26e433
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster7.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - DOUBLE coverage
+:memory: #use in-memory database
+SELECT RL2_LoadRaster(1.5, 'somepath.tif');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster(1.5, 'somepath.tif')
+-1
diff --git a/test/sql_stmt_security_tests/loadraster8.testcase b/test/sql_stmt_security_tests/loadraster8.testcase
new file mode 100644
index 0000000..1062ea2
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster8.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - BLOB coverage
+:memory: #use in-memory database
+SELECT RL2_LoadRaster(zeroblob(4), 'somepath.tif');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster(zeroblob(4), 'somepath.tif')
+-1
diff --git a/test/sql_stmt_security_tests/loadraster9.testcase b/test/sql_stmt_security_tests/loadraster9.testcase
new file mode 100644
index 0000000..8552bb8
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadraster9.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRaster - NULL worldfile
+:memory: #use in-memory database
+SELECT RL2_LoadRaster('alplha', 'somepath.tif', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRaster('alplha', 'somepath.tif', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir1.testcase b/test/sql_stmt_security_tests/loadrasterdir1.testcase
new file mode 100644
index 0000000..c4c3d06
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir1.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - NULL coverage
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir(NULL, 'somedir');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir(NULL, 'somedir')
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir10.testcase b/test/sql_stmt_security_tests/loadrasterdir10.testcase
new file mode 100644
index 0000000..5dfe6c5
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir10.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - DOUBLE worldfile
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 1.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir11.testcase b/test/sql_stmt_security_tests/loadrasterdir11.testcase
new file mode 100644
index 0000000..8473244
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir11.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - BLOB worldfile
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', zeroblob(4))
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir12.testcase b/test/sql_stmt_security_tests/loadrasterdir12.testcase
new file mode 100644
index 0000000..d8930ab
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir12.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - TEXT worldfile
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 'yes');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 'yes')
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir13.testcase b/test/sql_stmt_security_tests/loadrasterdir13.testcase
new file mode 100644
index 0000000..74d5683
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir13.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - NULL srid
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir14.testcase b/test/sql_stmt_security_tests/loadrasterdir14.testcase
new file mode 100644
index 0000000..b4d8a77
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir14.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - TEXT srid
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 'srid');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 'srid')
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir15.testcase b/test/sql_stmt_security_tests/loadrasterdir15.testcase
new file mode 100644
index 0000000..a84ce8b
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir15.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - DOUBLE srid
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 1.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir16.testcase b/test/sql_stmt_security_tests/loadrasterdir16.testcase
new file mode 100644
index 0000000..d5bfea3
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir16.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - BLOB srid
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, zeroblob(4))
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir17.testcase b/test/sql_stmt_security_tests/loadrasterdir17.testcase
new file mode 100644
index 0000000..8b857ae
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir17.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - NULL transaction
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 1, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir18.testcase b/test/sql_stmt_security_tests/loadrasterdir18.testcase
new file mode 100644
index 0000000..3b30e3a
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir18.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - TEXT transaction
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 1, 'no');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 1, 'no')
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir19.testcase b/test/sql_stmt_security_tests/loadrasterdir19.testcase
new file mode 100644
index 0000000..890937a
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir19.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - DOUBLE transaction
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 0, 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 0, 1.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir2.testcase b/test/sql_stmt_security_tests/loadrasterdir2.testcase
new file mode 100644
index 0000000..9f03fea
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir2.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - NULL dir path
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alpha', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alpha', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir20.testcase b/test/sql_stmt_security_tests/loadrasterdir20.testcase
new file mode 100644
index 0000000..de5b3cf
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir20.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - BLOB transaction
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 0, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 0, zeroblob(4))
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir21.testcase b/test/sql_stmt_security_tests/loadrasterdir21.testcase
new file mode 100644
index 0000000..889d32f
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir21.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - NULL extension
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir22.testcase b/test/sql_stmt_security_tests/loadrasterdir22.testcase
new file mode 100644
index 0000000..b146064
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir22.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - Integer extension
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', 1)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir23.testcase b/test/sql_stmt_security_tests/loadrasterdir23.testcase
new file mode 100644
index 0000000..98b3ea0
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir23.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - Double extension
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', 1.1);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', 1.1)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir24.testcase b/test/sql_stmt_security_tests/loadrasterdir24.testcase
new file mode 100644
index 0000000..1456acf
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir24.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - BLOB extension
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', zeroblob(4))
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir25.testcase b/test/sql_stmt_security_tests/loadrasterdir25.testcase
new file mode 100644
index 0000000..f85bd0a
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir25.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - NULL pyramidize
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir26.testcase b/test/sql_stmt_security_tests/loadrasterdir26.testcase
new file mode 100644
index 0000000..d7cdf1c
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir26.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - TEXT pyramidize
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 'no');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 'no')
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir27.testcase b/test/sql_stmt_security_tests/loadrasterdir27.testcase
new file mode 100644
index 0000000..059dc7f
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir27.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - DOUBLE pyramidize
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, 1.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir28.testcase b/test/sql_stmt_security_tests/loadrasterdir28.testcase
new file mode 100644
index 0000000..c73ff53
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir28.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - BLOB pyramidize
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', 0, 3003, zeroblob(4))
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir3.testcase b/test/sql_stmt_security_tests/loadrasterdir3.testcase
new file mode 100644
index 0000000..b941808
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir3.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - INTEGER dir path
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alpha', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alpha', 1)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir4.testcase b/test/sql_stmt_security_tests/loadrasterdir4.testcase
new file mode 100644
index 0000000..e0f32a3
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir4.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - DOUBLE dir path
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alpha', 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alpha', 1.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir5.testcase b/test/sql_stmt_security_tests/loadrasterdir5.testcase
new file mode 100644
index 0000000..be3c688
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir5.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - BLOB path
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alpha', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alpha', zeroblob(4))
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir6.testcase b/test/sql_stmt_security_tests/loadrasterdir6.testcase
new file mode 100644
index 0000000..dc16b6d
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir6.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - INT coverage
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir(1, 'somedir');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir(1, 'somedir')
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir7.testcase b/test/sql_stmt_security_tests/loadrasterdir7.testcase
new file mode 100644
index 0000000..a81e781
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir7.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - DOUBLE coverage
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir(1.5, 'somedir');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir(1.5, 'somedir')
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir8.testcase b/test/sql_stmt_security_tests/loadrasterdir8.testcase
new file mode 100644
index 0000000..99ec2e7
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir8.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - BLOB coverage
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir(zeroblob(4), 'somedir');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir(zeroblob(4), 'somedir')
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterdir9.testcase b/test/sql_stmt_security_tests/loadrasterdir9.testcase
new file mode 100644
index 0000000..840a37b
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterdir9.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRastersFromDir - NULL worldfile
+:memory: #use in-memory database
+SELECT RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRastersFromDir('alplha', 'somedir', '.tif', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms1.testcase b/test/sql_stmt_security_tests/loadrasterwms1.testcase
new file mode 100644
index 0000000..acda41a
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms1.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL coverage
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS(NULL, 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS(NULL, 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms10.testcase b/test/sql_stmt_security_tests/loadrasterwms10.testcase
new file mode 100644
index 0000000..70dde6c
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms10.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - Integer Style
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 1, 'image/png', 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 1, 'image/png', 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms11.testcase b/test/sql_stmt_security_tests/loadrasterwms11.testcase
new file mode 100644
index 0000000..332fbed
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms11.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL Resolution
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms12.testcase b/test/sql_stmt_security_tests/loadrasterwms12.testcase
new file mode 100644
index 0000000..81ad37b
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms12.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - TEXT Resolution
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 'alpha');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 'alpha')
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms13.testcase b/test/sql_stmt_security_tests/loadrasterwms13.testcase
new file mode 100644
index 0000000..fc76c4f
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms13.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL vertical Resolution
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms14.testcase b/test/sql_stmt_security_tests/loadrasterwms14.testcase
new file mode 100644
index 0000000..f966f18
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms14.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - TEXT vertical Resolution
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5, 'alpha');
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5, 'alpha')
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms15.testcase b/test/sql_stmt_security_tests/loadrasterwms15.testcase
new file mode 100644
index 0000000..8bac102
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms15.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL Opaque
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 1, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 1, 1, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms16.testcase b/test/sql_stmt_security_tests/loadrasterwms16.testcase
new file mode 100644
index 0000000..45dbc80
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms16.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL SwapXY
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5, 0.5, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5, 0.5, 1, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms17.testcase b/test/sql_stmt_security_tests/loadrasterwms17.testcase
new file mode 100644
index 0000000..9adcc4a
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms17.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - Integer Proxy
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5, 0.5, 1, 0, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5, 0.5, 1, 0, 1)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms18.testcase b/test/sql_stmt_security_tests/loadrasterwms18.testcase
new file mode 100644
index 0000000..3a4134f
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms18.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL Transaction
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 1, 1, 1, 0, 'proxy', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 1, 1, 1, 0, 'proxy', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms19.testcase b/test/sql_stmt_security_tests/loadrasterwms19.testcase
new file mode 100644
index 0000000..5d2d379
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms19.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - Not existing Coverage
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 1, 1, 1, 1, NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 1, 1, 1, 1, NULL, 1)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms2.testcase b/test/sql_stmt_security_tests/loadrasterwms2.testcase
new file mode 100644
index 0000000..4afd410
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms2.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL section
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', NULL, 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', NULL, 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms3.testcase b/test/sql_stmt_security_tests/loadrasterwms3.testcase
new file mode 100644
index 0000000..6358d1f
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms3.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL URL
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', NULL, BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', NULL, BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', 'image/png', 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms4.testcase b/test/sql_stmt_security_tests/loadrasterwms4.testcase
new file mode 100644
index 0000000..112cd8f
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms4.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL Geometry
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', NULL, '1.3.0', 'rivers', 'default', 'image/png', 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', NULL, '1.3.0', 'rivers', 'default', 'image/png', 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms5.testcase b/test/sql_stmt_security_tests/loadrasterwms5.testcase
new file mode 100644
index 0000000..8b2cdb4
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms5.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - Invalid Geometry
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', zeroblob(100), '1.3.0', 'rivers', 'default', 'image/png', 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', zeroblob(100), '1.3.0', 'rivers', 'default', 'image/png', 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms6.testcase b/test/sql_stmt_security_tests/loadrasterwms6.testcase
new file mode 100644
index 0000000..f5ebd2a
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms6.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL Version
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), NULL, 'rivers', 'default', 'image/png', 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), NULL, 'rivers', 'default', 'image/png', 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms7.testcase b/test/sql_stmt_security_tests/loadrasterwms7.testcase
new file mode 100644
index 0000000..c912f71
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms7.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL Layer
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', NULL, 'default', 'image/png', 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', NULL, 'default', 'image/png', 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms8.testcase b/test/sql_stmt_security_tests/loadrasterwms8.testcase
new file mode 100644
index 0000000..36386bc
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms8.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL Style
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', NULL, 'image/png', 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', NULL, 'image/png', 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/loadrasterwms9.testcase b/test/sql_stmt_security_tests/loadrasterwms9.testcase
new file mode 100644
index 0000000..b21133a
--- /dev/null
+++ b/test/sql_stmt_security_tests/loadrasterwms9.testcase
@@ -0,0 +1,7 @@
+RL2_LoadRasterFromWMS - NULL Format
+:memory: #use in-memory database
+SELECT RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', NULL, 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_LoadRasterFromWMS('ctrt10k', 'section', 'http://acme.com', BuildMbr(1, 1, 2, 2, 4326), '1.3.0', 'rivers', 'default', NULL, 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii1.testcase b/test/sql_stmt_security_tests/writeascii1.testcase
new file mode 100644
index 0000000..c1931ae
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii1.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - NULL Coverage
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid(NULL, './test.asc', 1024, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid(NULL, './test.asc', 1024, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii10.testcase b/test/sql_stmt_security_tests/writeascii10.testcase
new file mode 100644
index 0000000..2ae1861
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii10.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - NULL decimal-digits
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, MakePoint(1, 1), 0.5, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, MakePoint(1, 1), 0.5, 1, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii11.testcase b/test/sql_stmt_security_tests/writeascii11.testcase
new file mode 100644
index 0000000..0621996
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii11.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - not existing coverage (1)
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, MakePoint(1, 1), 0.5, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, MakePoint(1, 1), 0.5, 1, 2)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii12.testcase b/test/sql_stmt_security_tests/writeascii12.testcase
new file mode 100644
index 0000000..0cabc95
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii12.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - not existing coverage (2)
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, BuildMbr(1, 1, 10, 10), 1, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, BuildMbr(1, 1, 10, 10), 1, 1, 2)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii13.testcase b/test/sql_stmt_security_tests/writeascii13.testcase
new file mode 100644
index 0000000..7d588ff
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii13.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - invalid width (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 4, 1024, BuildMbr(1, 1, 10, 10), 1, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 4, 1024, BuildMbr(1, 1, 10, 10), 1, 1, 2)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii14.testcase b/test/sql_stmt_security_tests/writeascii14.testcase
new file mode 100644
index 0000000..7a4525b
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii14.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - invalid width (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1000004, 1024, BuildMbr(1, 1, 10, 10), 1, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1000004, 1024, BuildMbr(1, 1, 10, 10), 1, 1, 2)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii15.testcase b/test/sql_stmt_security_tests/writeascii15.testcase
new file mode 100644
index 0000000..0055d94
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii15.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - invalid height (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1, BuildMbr(1, 1, 10, 10), 1, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1, BuildMbr(1, 1, 10, 10), 1, 1, 2)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii16.testcase b/test/sql_stmt_security_tests/writeascii16.testcase
new file mode 100644
index 0000000..7c76746
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii16.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - invalid height (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1000000, BuildMbr(1, 1, 10, 10), 1, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1000000, BuildMbr(1, 1, 10, 10), 1, 1, 2)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii17.testcase b/test/sql_stmt_security_tests/writeascii17.testcase
new file mode 100644
index 0000000..5afbc1c
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii17.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - invalid decimal precision (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1000000, BuildMbr(1, 1, 10, 10), 1, 1, -1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1000000, BuildMbr(1, 1, 10, 10), 1, 1, -1)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii18.testcase b/test/sql_stmt_security_tests/writeascii18.testcase
new file mode 100644
index 0000000..cabee06
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii18.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - invalid decimal precision (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1000000, BuildMbr(1, 1, 10, 10), 1, 1, 50);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1000000, BuildMbr(1, 1, 10, 10), 1, 1, 50)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii2.testcase b/test/sql_stmt_security_tests/writeascii2.testcase
new file mode 100644
index 0000000..4a1d544
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii2.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - NULL Path
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', NULL, 1024, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', NULL, 1024, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii3.testcase b/test/sql_stmt_security_tests/writeascii3.testcase
new file mode 100644
index 0000000..9fe1a50
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii3.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - NULL Width
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', NULL, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', NULL, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii4.testcase b/test/sql_stmt_security_tests/writeascii4.testcase
new file mode 100644
index 0000000..a5131be
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii4.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - NULL Height
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, NULL, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, NULL, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii5.testcase b/test/sql_stmt_security_tests/writeascii5.testcase
new file mode 100644
index 0000000..bebea44
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii5.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - NULL Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, NULL, 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, NULL, 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii6.testcase b/test/sql_stmt_security_tests/writeascii6.testcase
new file mode 100644
index 0000000..1d97858
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii6.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, zeroblob(100), 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, zeroblob(100), 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii7.testcase b/test/sql_stmt_security_tests/writeascii7.testcase
new file mode 100644
index 0000000..63fbb72
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii7.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - NULL resolution
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, MakePoint(1, 1), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, MakePoint(1, 1), NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writeascii9.testcase b/test/sql_stmt_security_tests/writeascii9.testcase
new file mode 100644
index 0000000..ebd35e8
--- /dev/null
+++ b/test/sql_stmt_security_tests/writeascii9.testcase
@@ -0,0 +1,7 @@
+RL2_WriteAsciiGrid - NULL is-centered
+:memory: #use in-memory database
+SELECT RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, MakePoint(1, 1), 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteAsciiGrid('alpha', './test.asc', 1024, 1024, MakePoint(1, 1), 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff1.testcase b/test/sql_stmt_security_tests/writebandgeotiff1.testcase
new file mode 100644
index 0000000..a32aead
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff1.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL Coverage
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff(NULL, './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff(NULL, './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff10.testcase b/test/sql_stmt_security_tests/writebandgeotiff10.testcase
new file mode 100644
index 0000000..fafa6db
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff10.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL compression
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff11.testcase b/test/sql_stmt_security_tests/writebandgeotiff11.testcase
new file mode 100644
index 0000000..1818da1
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff11.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL tile-size
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'JPEG', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'JPEG', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff12.testcase b/test/sql_stmt_security_tests/writebandgeotiff12.testcase
new file mode 100644
index 0000000..0a2e4b8
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff12.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid width (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 4, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'PNG', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 4, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'PNG', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff13.testcase b/test/sql_stmt_security_tests/writebandgeotiff13.testcase
new file mode 100644
index 0000000..1724e98
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff13.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid width (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1000004, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX4', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1000004, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX4', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff14.testcase b/test/sql_stmt_security_tests/writebandgeotiff14.testcase
new file mode 100644
index 0000000..594cb60
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff14.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid height (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 4, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX3', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 4, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX3', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff15.testcase b/test/sql_stmt_security_tests/writebandgeotiff15.testcase
new file mode 100644
index 0000000..0243cc4
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff15.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid height (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1000004, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'DEFLATE', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1000004, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'DEFLATE', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff16.testcase b/test/sql_stmt_security_tests/writebandgeotiff16.testcase
new file mode 100644
index 0000000..a5a5b34
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff16.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid tile-size (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'LZW', 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'LZW', 2)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff17.testcase b/test/sql_stmt_security_tests/writebandgeotiff17.testcase
new file mode 100644
index 0000000..d5c2851
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff17.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid tile-size (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'LZMA', 2000000);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'LZMA', 2000000)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff18.testcase b/test/sql_stmt_security_tests/writebandgeotiff18.testcase
new file mode 100644
index 0000000..ddd17e7
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff18.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - not existing coverage (1)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff19.testcase b/test/sql_stmt_security_tests/writebandgeotiff19.testcase
new file mode 100644
index 0000000..732caad
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff19.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - not existing coverage (2)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff2.testcase b/test/sql_stmt_security_tests/writebandgeotiff2.testcase
new file mode 100644
index 0000000..cf8e92d
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff2.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL Path
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', NULL, 1024, 1024, 0, 1, 2, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', NULL, 1024, 1024, 0, 1, 2, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff20.testcase b/test/sql_stmt_security_tests/writebandgeotiff20.testcase
new file mode 100644
index 0000000..e6da936
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff20.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL red band
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, NULL, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, NULL, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff21.testcase b/test/sql_stmt_security_tests/writebandgeotiff21.testcase
new file mode 100644
index 0000000..fb623d8
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff21.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid red band (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, -1, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, -1, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff22.testcase b/test/sql_stmt_security_tests/writebandgeotiff22.testcase
new file mode 100644
index 0000000..8b216d8
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff22.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid red band (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 500, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 500, 1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff23.testcase b/test/sql_stmt_security_tests/writebandgeotiff23.testcase
new file mode 100644
index 0000000..c4f4e6f
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff23.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL green band
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, NULL, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, NULL, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff24.testcase b/test/sql_stmt_security_tests/writebandgeotiff24.testcase
new file mode 100644
index 0000000..8258b8d
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff24.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid green band (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, -1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, -1, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff25.testcase b/test/sql_stmt_security_tests/writebandgeotiff25.testcase
new file mode 100644
index 0000000..adf6081
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff25.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid green band (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 500, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 500, 2, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff26.testcase b/test/sql_stmt_security_tests/writebandgeotiff26.testcase
new file mode 100644
index 0000000..8686042
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff26.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL blue band
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, NULL, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, NULL, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff27.testcase b/test/sql_stmt_security_tests/writebandgeotiff27.testcase
new file mode 100644
index 0000000..856bacc
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff27.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid blue band (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, -1, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, -1, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff28.testcase b/test/sql_stmt_security_tests/writebandgeotiff28.testcase
new file mode 100644
index 0000000..404e84a
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff28.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - invalid blue band (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 500, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 500, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff3.testcase b/test/sql_stmt_security_tests/writebandgeotiff3.testcase
new file mode 100644
index 0000000..74e3094
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff3.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL Width
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', NULL, 1024, 0, 1, 2, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', NULL, 1024, 0, 1, 2, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff4.testcase b/test/sql_stmt_security_tests/writebandgeotiff4.testcase
new file mode 100644
index 0000000..ddd6620
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff4.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL Height
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, NULL, 0, 1, 2, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, NULL, 0, 1, 2, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff5.testcase b/test/sql_stmt_security_tests/writebandgeotiff5.testcase
new file mode 100644
index 0000000..3511729
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff5.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, NULL, 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, NULL, 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff6.testcase b/test/sql_stmt_security_tests/writebandgeotiff6.testcase
new file mode 100644
index 0000000..af16b9b
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff6.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, zeroblob(100), 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, zeroblob(100), 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff7.testcase b/test/sql_stmt_security_tests/writebandgeotiff7.testcase
new file mode 100644
index 0000000..5baa9ce
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff7.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL resolution
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff8.testcase b/test/sql_stmt_security_tests/writebandgeotiff8.testcase
new file mode 100644
index 0000000..976ce53
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff8.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL vertical resolution
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writebandgeotiff9.testcase b/test/sql_stmt_security_tests/writebandgeotiff9.testcase
new file mode 100644
index 0000000..2971018
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandgeotiff9.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandGeoTiff - NULL with-worldfile
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 1, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff1.testcase b/test/sql_stmt_security_tests/writebandtiff1.testcase
new file mode 100644
index 0000000..c9e0067
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff1.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - NULL Coverage
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff(NULL, './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff(NULL, './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff10.testcase b/test/sql_stmt_security_tests/writebandtiff10.testcase
new file mode 100644
index 0000000..39f8fce
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff10.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - NULL tile-size
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'JPEG', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'JPEG', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff11.testcase b/test/sql_stmt_security_tests/writebandtiff11.testcase
new file mode 100644
index 0000000..3e23a9d
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff11.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid width (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 4, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'PNG', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 4, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'PNG', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff12.testcase b/test/sql_stmt_security_tests/writebandtiff12.testcase
new file mode 100644
index 0000000..b7ac087
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff12.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid width (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1000004, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'FAX4', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1000004, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'FAX4', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff13.testcase b/test/sql_stmt_security_tests/writebandtiff13.testcase
new file mode 100644
index 0000000..997e672
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff13.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid height (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 4, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'FAX3', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 4, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'FAX3', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff14.testcase b/test/sql_stmt_security_tests/writebandtiff14.testcase
new file mode 100644
index 0000000..3f1b503
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff14.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid height (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1000004, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'DEFLATE', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1000004, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'DEFLATE', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff15.testcase b/test/sql_stmt_security_tests/writebandtiff15.testcase
new file mode 100644
index 0000000..91faeb2
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff15.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid tile-size (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'LZW', 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'LZW', 2)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff16.testcase b/test/sql_stmt_security_tests/writebandtiff16.testcase
new file mode 100644
index 0000000..ad1632e
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff16.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid tile-size (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'LZMA', 2000000);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'LZMA', 2000000)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff17.testcase b/test/sql_stmt_security_tests/writebandtiff17.testcase
new file mode 100644
index 0000000..351e6f5
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff17.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - not existing coverage (1)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff18.testcase b/test/sql_stmt_security_tests/writebandtiff18.testcase
new file mode 100644
index 0000000..be3c222
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff18.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - not existing coverage (2)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff19.testcase b/test/sql_stmt_security_tests/writebandtiff19.testcase
new file mode 100644
index 0000000..94ca3f4
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff19.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - NULL red band
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, NULL, 1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, NULL, 1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff2.testcase b/test/sql_stmt_security_tests/writebandtiff2.testcase
new file mode 100644
index 0000000..f4995c6
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff2.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - NULL Path
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', NULL, 1024, 1024, 0, 1, 2, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', NULL, 1024, 1024, 0, 1, 2, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff20.testcase b/test/sql_stmt_security_tests/writebandtiff20.testcase
new file mode 100644
index 0000000..da82af6
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff20.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid red band (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, -1, 1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, -1, 1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff21.testcase b/test/sql_stmt_security_tests/writebandtiff21.testcase
new file mode 100644
index 0000000..4c7d97b
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff21.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid red band (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 500, 1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 500, 1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff22.testcase b/test/sql_stmt_security_tests/writebandtiff22.testcase
new file mode 100644
index 0000000..bcdfced
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff22.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - NULL green band
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, NULL, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, NULL, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff23.testcase b/test/sql_stmt_security_tests/writebandtiff23.testcase
new file mode 100644
index 0000000..e37e81c
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff23.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid green band (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, -1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, -1, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff24.testcase b/test/sql_stmt_security_tests/writebandtiff24.testcase
new file mode 100644
index 0000000..8ff9aa3
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff24.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid green band (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 500, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 500, 2, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff25.testcase b/test/sql_stmt_security_tests/writebandtiff25.testcase
new file mode 100644
index 0000000..c397a17
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff25.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - NULL blue band
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, NULL, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, NULL, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff26.testcase b/test/sql_stmt_security_tests/writebandtiff26.testcase
new file mode 100644
index 0000000..81c26e9
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff26.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid blue band (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, -1, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, -1, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff27.testcase b/test/sql_stmt_security_tests/writebandtiff27.testcase
new file mode 100644
index 0000000..94d09cf
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff27.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - invalid blue band (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 500, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 500, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff3.testcase b/test/sql_stmt_security_tests/writebandtiff3.testcase
new file mode 100644
index 0000000..4d055b5
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff3.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - NULL Width
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', NULL, 1024, 0, 1, 2, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', NULL, 1024, 0, 1, 2, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff4.testcase b/test/sql_stmt_security_tests/writebandtiff4.testcase
new file mode 100644
index 0000000..5864de1
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff4.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandiff - NULL Height
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, NULL, 0, 1, 2, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, NULL, 0, 1, 2, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff5.testcase b/test/sql_stmt_security_tests/writebandtiff5.testcase
new file mode 100644
index 0000000..06b604f
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff5.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - NULL Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, NULL, 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, NULL, 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff6.testcase b/test/sql_stmt_security_tests/writebandtiff6.testcase
new file mode 100644
index 0000000..c1a5f40
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff6.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, zeroblob(100), 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, zeroblob(100), 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff7.testcase b/test/sql_stmt_security_tests/writebandtiff7.testcase
new file mode 100644
index 0000000..4fa386e
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff7.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - NULL resolution
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff8.testcase b/test/sql_stmt_security_tests/writebandtiff8.testcase
new file mode 100644
index 0000000..e8344c1
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff8.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - NULL vertical resolution
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writebandtiff9.testcase b/test/sql_stmt_security_tests/writebandtiff9.testcase
new file mode 100644
index 0000000..14c2c4f
--- /dev/null
+++ b/test/sql_stmt_security_tests/writebandtiff9.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTripleBandTiff - NULL compression
+:memory: #use in-memory database
+SELECT RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTripleBandTiff('alpha', './test.tif', 1024, 1024, 0, 1, 2, MakePoint(1, 1), 0.5, 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff1.testcase b/test/sql_stmt_security_tests/writegeotiff1.testcase
new file mode 100644
index 0000000..8485d96
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff1.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - NULL Coverage
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff(NULL, './test.tif', 1024, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff(NULL, './test.tif', 1024, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff10.testcase b/test/sql_stmt_security_tests/writegeotiff10.testcase
new file mode 100644
index 0000000..dfcd5cd
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff10.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - NULL compression
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 1, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff11.testcase b/test/sql_stmt_security_tests/writegeotiff11.testcase
new file mode 100644
index 0000000..ef62b73
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff11.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - NULL tile-size
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'JPEG', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'JPEG', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff12.testcase b/test/sql_stmt_security_tests/writegeotiff12.testcase
new file mode 100644
index 0000000..1960597
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff12.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - invalid width (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 4, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'PNG', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 4, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'PNG', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff13.testcase b/test/sql_stmt_security_tests/writegeotiff13.testcase
new file mode 100644
index 0000000..d3062ac
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff13.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - invalid width (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1000004, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX4', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1000004, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX4', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff14.testcase b/test/sql_stmt_security_tests/writegeotiff14.testcase
new file mode 100644
index 0000000..d8b85c2
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff14.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - invalid height (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 4, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX3', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 4, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX3', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff15.testcase b/test/sql_stmt_security_tests/writegeotiff15.testcase
new file mode 100644
index 0000000..032f441
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff15.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - invalid height (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1000004, MakePoint(1, 1), 0.5, 0.5, 1, 'DEFLATE', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1000004, MakePoint(1, 1), 0.5, 0.5, 1, 'DEFLATE', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff16.testcase b/test/sql_stmt_security_tests/writegeotiff16.testcase
new file mode 100644
index 0000000..d4fa138
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff16.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - invalid tile-size (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'LZW', 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'LZW', 2)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff17.testcase b/test/sql_stmt_security_tests/writegeotiff17.testcase
new file mode 100644
index 0000000..0bb5d16
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff17.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - invalid tile-size (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'LZMA', 2000000);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'LZMA', 2000000)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff18.testcase b/test/sql_stmt_security_tests/writegeotiff18.testcase
new file mode 100644
index 0000000..b3f026a
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff18.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - not existing coverage (1)
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff19.testcase b/test/sql_stmt_security_tests/writegeotiff19.testcase
new file mode 100644
index 0000000..993b16f
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff19.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - not existing coverage (2)
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, BuildMbr(1, 1, 10, 10), 1, 1, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, BuildMbr(1, 1, 10, 10), 1, 1, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff2.testcase b/test/sql_stmt_security_tests/writegeotiff2.testcase
new file mode 100644
index 0000000..b2f51f3
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff2.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - NULL Path
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', NULL, 1024, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', NULL, 1024, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff3.testcase b/test/sql_stmt_security_tests/writegeotiff3.testcase
new file mode 100644
index 0000000..3e99c04
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff3.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - NULL Width
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', NULL, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', NULL, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff4.testcase b/test/sql_stmt_security_tests/writegeotiff4.testcase
new file mode 100644
index 0000000..a46f447
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff4.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - NULL Height
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, NULL, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, NULL, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff5.testcase b/test/sql_stmt_security_tests/writegeotiff5.testcase
new file mode 100644
index 0000000..e6ff778
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff5.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - NULL Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, NULL, 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, NULL, 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff6.testcase b/test/sql_stmt_security_tests/writegeotiff6.testcase
new file mode 100644
index 0000000..6bc30a1
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff6.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, zeroblob(100), 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, zeroblob(100), 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff7.testcase b/test/sql_stmt_security_tests/writegeotiff7.testcase
new file mode 100644
index 0000000..c17e29b
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff7.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - NULL resolution
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff8.testcase b/test/sql_stmt_security_tests/writegeotiff8.testcase
new file mode 100644
index 0000000..491fdc4
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff8.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - NULL vertical resolution
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writegeotiff9.testcase b/test/sql_stmt_security_tests/writegeotiff9.testcase
new file mode 100644
index 0000000..eb6d882
--- /dev/null
+++ b/test/sql_stmt_security_tests/writegeotiff9.testcase
@@ -0,0 +1,7 @@
+RL2_WriteGeoTiff - NULL with-worldfile
+:memory: #use in-memory database
+SELECT RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteGeoTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 1, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg1.testcase b/test/sql_stmt_security_tests/writejpeg1.testcase
new file mode 100644
index 0000000..b1e91f8
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg1.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - NULL Coverage
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg(NULL, './test.jpg', 1024, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg(NULL, './test.jpg', 1024, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg10.testcase b/test/sql_stmt_security_tests/writejpeg10.testcase
new file mode 100644
index 0000000..414adba
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg10.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - invalid width (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 4, 1024, MakePoint(1, 1), 0.5, 0.5, 80);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 4, 1024, MakePoint(1, 1), 0.5, 0.5, 80)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg11.testcase b/test/sql_stmt_security_tests/writejpeg11.testcase
new file mode 100644
index 0000000..1870123
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg11.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - invalid width (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 1000004, 1024, MakePoint(1, 1), 0.5, 0.5, 80);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 1000004, 1024, MakePoint(1, 1), 0.5, 0.5, 80)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg12.testcase b/test/sql_stmt_security_tests/writejpeg12.testcase
new file mode 100644
index 0000000..d45fec2
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg12.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - invalid height (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 1024, 4, MakePoint(1, 1), 0.5, 0.5, 80);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 1024, 4, MakePoint(1, 1), 0.5, 0.5, 80)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg13.testcase b/test/sql_stmt_security_tests/writejpeg13.testcase
new file mode 100644
index 0000000..6a7b2d4
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg13.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - invalid height (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 1024, 1000004, MakePoint(1, 1), 0.5, 0.5, 80);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 1024, 1000004, MakePoint(1, 1), 0.5, 0.5, 80)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg14.testcase b/test/sql_stmt_security_tests/writejpeg14.testcase
new file mode 100644
index 0000000..4bc50da
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg14.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - not existing coverage (1)
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 101);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 101)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg15.testcase b/test/sql_stmt_security_tests/writejpeg15.testcase
new file mode 100644
index 0000000..e7c4daf
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg15.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - not existing coverage (2)
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, BuildMbr(1, 1, 10, 10), 1, 1, -1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, BuildMbr(1, 1, 10, 10), 1, 1, -1)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg2.testcase b/test/sql_stmt_security_tests/writejpeg2.testcase
new file mode 100644
index 0000000..1085898
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg2.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - NULL Path
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', NULL, 1024, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', NULL, 1024, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg3.testcase b/test/sql_stmt_security_tests/writejpeg3.testcase
new file mode 100644
index 0000000..7105bfd
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg3.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - NULL Width
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', NULL, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', NULL, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg4.testcase b/test/sql_stmt_security_tests/writejpeg4.testcase
new file mode 100644
index 0000000..aef1b38
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg4.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - NULL Height
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 1024, NULL, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 1024, NULL, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg5.testcase b/test/sql_stmt_security_tests/writejpeg5.testcase
new file mode 100644
index 0000000..86f938d
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg5.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - NULL Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, NULL, 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, NULL, 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg6.testcase b/test/sql_stmt_security_tests/writejpeg6.testcase
new file mode 100644
index 0000000..4b486a6
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg6.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, zeroblob(100), 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, zeroblob(100), 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg7.testcase b/test/sql_stmt_security_tests/writejpeg7.testcase
new file mode 100644
index 0000000..51a1039
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg7.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - NULL resolution
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, MakePoint(1, 1), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, MakePoint(1, 1), NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg8.testcase b/test/sql_stmt_security_tests/writejpeg8.testcase
new file mode 100644
index 0000000..c6fac7b
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg8.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - NULL vertical resolution
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, MakePoint(1, 1), 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, MakePoint(1, 1), 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writejpeg9.testcase b/test/sql_stmt_security_tests/writejpeg9.testcase
new file mode 100644
index 0000000..b2eedba
--- /dev/null
+++ b/test/sql_stmt_security_tests/writejpeg9.testcase
@@ -0,0 +1,7 @@
+RL2_WriteJpeg - NULL quality
+:memory: #use in-memory database
+SELECT RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteJpeg('alpha', './test.jpg', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff1.testcase b/test/sql_stmt_security_tests/writemonogeotiff1.testcase
new file mode 100644
index 0000000..a238c07
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff1.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - NULL Coverage
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff(NULL, './test.tif', 1024, 1024, 0, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff(NULL, './test.tif', 1024, 1024, 0, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff10.testcase b/test/sql_stmt_security_tests/writemonogeotiff10.testcase
new file mode 100644
index 0000000..7dd3c18
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff10.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - NULL compression
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff11.testcase b/test/sql_stmt_security_tests/writemonogeotiff11.testcase
new file mode 100644
index 0000000..14addfe
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff11.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - NULL tile-size
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'JPEG', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'JPEG', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff12.testcase b/test/sql_stmt_security_tests/writemonogeotiff12.testcase
new file mode 100644
index 0000000..4ce08d5
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff12.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - invalid width (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 4, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'PNG', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 4, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'PNG', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff13.testcase b/test/sql_stmt_security_tests/writemonogeotiff13.testcase
new file mode 100644
index 0000000..8b5fec6
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff13.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - invalid width (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1000004, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX4', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1000004, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX4', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff14.testcase b/test/sql_stmt_security_tests/writemonogeotiff14.testcase
new file mode 100644
index 0000000..dbc817a
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff14.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - invalid height (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 4, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX3', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 4, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'FAX3', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff15.testcase b/test/sql_stmt_security_tests/writemonogeotiff15.testcase
new file mode 100644
index 0000000..7efb011
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff15.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - invalid height (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1000004, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'DEFLATE', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1000004, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'DEFLATE', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff16.testcase b/test/sql_stmt_security_tests/writemonogeotiff16.testcase
new file mode 100644
index 0000000..4477217
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff16.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - invalid tile-size (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'LZW', 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'LZW', 2)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff17.testcase b/test/sql_stmt_security_tests/writemonogeotiff17.testcase
new file mode 100644
index 0000000..30fa7b8
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff17.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - invalid tile-size (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'LZMA', 2000000);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'LZMA', 2000000)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff18.testcase b/test/sql_stmt_security_tests/writemonogeotiff18.testcase
new file mode 100644
index 0000000..de67512
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff18.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - not existing coverage (1)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff19.testcase b/test/sql_stmt_security_tests/writemonogeotiff19.testcase
new file mode 100644
index 0000000..ebb9876
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff19.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - not existing coverage (2)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, BuildMbr(1, 1, 10, 10), 1, 1, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, BuildMbr(1, 1, 10, 10), 1, 1, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff2.testcase b/test/sql_stmt_security_tests/writemonogeotiff2.testcase
new file mode 100644
index 0000000..c4089b3
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff2.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - NULL Path
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', NULL, 1024, 1024, 0, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', NULL, 1024, 1024, 0, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff20.testcase b/test/sql_stmt_security_tests/writemonogeotiff20.testcase
new file mode 100644
index 0000000..60a92bd
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff20.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - NULL mono band
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, NULL, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, NULL, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff21.testcase b/test/sql_stmt_security_tests/writemonogeotiff21.testcase
new file mode 100644
index 0000000..5ed57b7
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff21.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - invalid mono band (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, -1, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, -1, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff22.testcase b/test/sql_stmt_security_tests/writemonogeotiff22.testcase
new file mode 100644
index 0000000..9f8a2fb
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff22.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - invalid mono band (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 500, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 500, MakePoint(1, 1), 0.5, 0.5, 1, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff3.testcase b/test/sql_stmt_security_tests/writemonogeotiff3.testcase
new file mode 100644
index 0000000..29498b6
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff3.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - NULL Width
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', NULL, 1024, 0, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', NULL, 1024, 0, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff4.testcase b/test/sql_stmt_security_tests/writemonogeotiff4.testcase
new file mode 100644
index 0000000..6641dda
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff4.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - NULL Height
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, NULL, 0, 1, 2, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, NULL, 0, 1, 2, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff5.testcase b/test/sql_stmt_security_tests/writemonogeotiff5.testcase
new file mode 100644
index 0000000..a7163ae
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff5.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - NULL Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, NULL, 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, NULL, 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff6.testcase b/test/sql_stmt_security_tests/writemonogeotiff6.testcase
new file mode 100644
index 0000000..1d75339
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff6.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, zeroblob(100), 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, zeroblob(100), 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff7.testcase b/test/sql_stmt_security_tests/writemonogeotiff7.testcase
new file mode 100644
index 0000000..19d4d40
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff7.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - NULL resolution
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff8.testcase b/test/sql_stmt_security_tests/writemonogeotiff8.testcase
new file mode 100644
index 0000000..53d7f9a
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff8.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - NULL vertical resolution
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writemonogeotiff9.testcase b/test/sql_stmt_security_tests/writemonogeotiff9.testcase
new file mode 100644
index 0000000..cfacefb
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonogeotiff9.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandGeoTiff - NULL with-worldfile
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandGeoTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 1, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff1.testcase b/test/sql_stmt_security_tests/writemonotiff1.testcase
new file mode 100644
index 0000000..1b200fe
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff1.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - NULL Coverage
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff(NULL, './test.tif', 1024, 1024, 0, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff(NULL, './test.tif', 1024, 1024, 0, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff10.testcase b/test/sql_stmt_security_tests/writemonotiff10.testcase
new file mode 100644
index 0000000..0b229fc
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff10.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - NULL tile-size
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'JPEG', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'JPEG', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff11.testcase b/test/sql_stmt_security_tests/writemonotiff11.testcase
new file mode 100644
index 0000000..a8f1a8d
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff11.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - invalid width (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 4, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'PNG', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 4, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'PNG', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff12.testcase b/test/sql_stmt_security_tests/writemonotiff12.testcase
new file mode 100644
index 0000000..00b2e62
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff12.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - invalid width (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1000004, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'FAX4', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1000004, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'FAX4', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff13.testcase b/test/sql_stmt_security_tests/writemonotiff13.testcase
new file mode 100644
index 0000000..983a1cc
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff13.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - invalid height (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 4, 0, MakePoint(1, 1), 0.5, 0.5, 'FAX3', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 4, 0, MakePoint(1, 1), 0.5, 0.5, 'FAX3', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff14.testcase b/test/sql_stmt_security_tests/writemonotiff14.testcase
new file mode 100644
index 0000000..91e88d7
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff14.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - invalid height (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1000004, 0, MakePoint(1, 1), 0.5, 0.5, 'DEFLATE', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1000004, 0, MakePoint(1, 1), 0.5, 0.5, 'DEFLATE', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff15.testcase b/test/sql_stmt_security_tests/writemonotiff15.testcase
new file mode 100644
index 0000000..a443c08
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff15.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - invalid tile-size (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'LZW', 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'LZW', 2)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff16.testcase b/test/sql_stmt_security_tests/writemonotiff16.testcase
new file mode 100644
index 0000000..6d012d5
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff16.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - invalid tile-size (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'LZMA', 2000000);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'LZMA', 2000000)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff17.testcase b/test/sql_stmt_security_tests/writemonotiff17.testcase
new file mode 100644
index 0000000..264921f
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff17.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - not existing coverage (1)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff18.testcase b/test/sql_stmt_security_tests/writemonotiff18.testcase
new file mode 100644
index 0000000..8871302
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff18.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - not existing coverage (2)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff19.testcase b/test/sql_stmt_security_tests/writemonotiff19.testcase
new file mode 100644
index 0000000..874591f
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff19.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - NULL mono band
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, NULL, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, NULL, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff2.testcase b/test/sql_stmt_security_tests/writemonotiff2.testcase
new file mode 100644
index 0000000..2b38c7b
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff2.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - NULL Path
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', NULL, 1024, 1024, 0, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', NULL, 1024, 1024, 0, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff20.testcase b/test/sql_stmt_security_tests/writemonotiff20.testcase
new file mode 100644
index 0000000..0ce96d9
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff20.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - invalid mono band (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, -1, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, -1, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff21.testcase b/test/sql_stmt_security_tests/writemonotiff21.testcase
new file mode 100644
index 0000000..ee5ab1e
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff21.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - invalid mono band (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 500, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 500, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff3.testcase b/test/sql_stmt_security_tests/writemonotiff3.testcase
new file mode 100644
index 0000000..eff5c45
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff3.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - NULL Width
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', NULL, 1024, 0, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', NULL, 1024, 0, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff4.testcase b/test/sql_stmt_security_tests/writemonotiff4.testcase
new file mode 100644
index 0000000..ff58b60
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff4.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandiff - NULL Height
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, NULL, 0, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, NULL, 0, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff5.testcase b/test/sql_stmt_security_tests/writemonotiff5.testcase
new file mode 100644
index 0000000..4da6207
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff5.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - NULL Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, NULL, 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, NULL, 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff6.testcase b/test/sql_stmt_security_tests/writemonotiff6.testcase
new file mode 100644
index 0000000..261a508
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff6.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, zeroblob(100), 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, zeroblob(100), 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff7.testcase b/test/sql_stmt_security_tests/writemonotiff7.testcase
new file mode 100644
index 0000000..fba0b66
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff7.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - NULL resolution
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff8.testcase b/test/sql_stmt_security_tests/writemonotiff8.testcase
new file mode 100644
index 0000000..c186a37
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff8.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - NULL vertical resolution
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writemonotiff9.testcase b/test/sql_stmt_security_tests/writemonotiff9.testcase
new file mode 100644
index 0000000..566adc2
--- /dev/null
+++ b/test/sql_stmt_security_tests/writemonotiff9.testcase
@@ -0,0 +1,7 @@
+RL2_WriteMonoBandTiff - NULL compression
+:memory: #use in-memory database
+SELECT RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteMonoBandTiff('alpha', './test.tif', 1024, 1024, 0, MakePoint(1, 1), 0.5, 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff1.testcase b/test/sql_stmt_security_tests/writetiff1.testcase
new file mode 100644
index 0000000..c323fdb
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff1.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - NULL Coverage
+:memory: #use in-memory database
+SELECT RL2_WriteTiff(NULL, './test.tif', 1024, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff(NULL, './test.tif', 1024, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff10.testcase b/test/sql_stmt_security_tests/writetiff10.testcase
new file mode 100644
index 0000000..264fa68
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff10.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - NULL tile-size
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 'JPEG', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 'JPEG', NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff11.testcase b/test/sql_stmt_security_tests/writetiff11.testcase
new file mode 100644
index 0000000..1f49bef
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff11.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - invalid width (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 4, 1024, MakePoint(1, 1), 0.5, 0.5, 'PNG', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 4, 1024, MakePoint(1, 1), 0.5, 0.5, 'PNG', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff12.testcase b/test/sql_stmt_security_tests/writetiff12.testcase
new file mode 100644
index 0000000..708a88f
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff12.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - invalid width (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1000004, 1024, MakePoint(1, 1), 0.5, 0.5, 'FAX4', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1000004, 1024, MakePoint(1, 1), 0.5, 0.5, 'FAX4', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff13.testcase b/test/sql_stmt_security_tests/writetiff13.testcase
new file mode 100644
index 0000000..bd2e702
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff13.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - invalid height (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 4, MakePoint(1, 1), 0.5, 0.5, 'FAX3', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 4, MakePoint(1, 1), 0.5, 0.5, 'FAX3', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff14.testcase b/test/sql_stmt_security_tests/writetiff14.testcase
new file mode 100644
index 0000000..7d7111a
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff14.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - invalid height (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 1000004, MakePoint(1, 1), 0.5, 0.5, 'DEFLATE', 512);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 1000004, MakePoint(1, 1), 0.5, 0.5, 'DEFLATE', 512)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff15.testcase b/test/sql_stmt_security_tests/writetiff15.testcase
new file mode 100644
index 0000000..9ae69cc
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff15.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - invalid tile-size (too small)
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 'LZW', 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 'LZW', 2)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff16.testcase b/test/sql_stmt_security_tests/writetiff16.testcase
new file mode 100644
index 0000000..07b8d56
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff16.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - invalid tile-size (too big)
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 'LZMA', 2000000);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 'LZMA', 2000000)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff17.testcase b/test/sql_stmt_security_tests/writetiff17.testcase
new file mode 100644
index 0000000..82b8a28
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff17.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - not existing coverage (1)
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 'NONE', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, 'NONE', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff18.testcase b/test/sql_stmt_security_tests/writetiff18.testcase
new file mode 100644
index 0000000..f7ef35c
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff18.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - not existing coverage (2)
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 1024, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 1024, BuildMbr(1, 1, 10, 10), 1, 1, 'JPEG', 256)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff2.testcase b/test/sql_stmt_security_tests/writetiff2.testcase
new file mode 100644
index 0000000..a57beed
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff2.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - NULL Path
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', NULL, 1024, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', NULL, 1024, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff3.testcase b/test/sql_stmt_security_tests/writetiff3.testcase
new file mode 100644
index 0000000..4d1e3ba
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff3.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - NULL Width
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', NULL, 1024, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', NULL, 1024, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff4.testcase b/test/sql_stmt_security_tests/writetiff4.testcase
new file mode 100644
index 0000000..0e48672
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff4.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - NULL Height
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, NULL, MakePoint(1, 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, NULL, MakePoint(1, 1), 1)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff5.testcase b/test/sql_stmt_security_tests/writetiff5.testcase
new file mode 100644
index 0000000..96f5422
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff5.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - NULL Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 1024, NULL, 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 1024, NULL, 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff6.testcase b/test/sql_stmt_security_tests/writetiff6.testcase
new file mode 100644
index 0000000..4e4bf8a
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff6.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - Invalid BLOB Geometry
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 1024, zeroblob(100), 0.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 1024, zeroblob(100), 0.5)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff7.testcase b/test/sql_stmt_security_tests/writetiff7.testcase
new file mode 100644
index 0000000..5fdd73c
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff7.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - NULL resolution
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff8.testcase b/test/sql_stmt_security_tests/writetiff8.testcase
new file mode 100644
index 0000000..4901140
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff8.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - NULL vertical resolution
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, NULL)
+-1
diff --git a/test/sql_stmt_security_tests/writetiff9.testcase b/test/sql_stmt_security_tests/writetiff9.testcase
new file mode 100644
index 0000000..05e9f80
--- /dev/null
+++ b/test/sql_stmt_security_tests/writetiff9.testcase
@@ -0,0 +1,7 @@
+RL2_WriteTiff - NULL compression
+:memory: #use in-memory database
+SELECT RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_WriteTiff('alpha', './test.tif', 1024, 1024, MakePoint(1, 1), 0.5, 0.5, NULL)
+-1
diff --git a/test/sql_stmt_tests/Makefile.am b/test/sql_stmt_tests/Makefile.am
new file mode 100644
index 0000000..753bf94
--- /dev/null
+++ b/test/sql_stmt_tests/Makefile.am
@@ -0,0 +1,447 @@
+
+EXTRA_DIST = createcov_16_mband1.testcase \
+ createcov_16_mband_deflate.testcase \
+ createcov_16_mband_fax3.testcase \
+ createcov_16_mband_fax4.testcase \
+ createcov_16_mband_gif.testcase \
+ createcov_16_mband_jpeg.testcase \
+ createcov_16_mband_lzma.testcase \
+ createcov_16_mband_png.testcase \
+ createcov_16_mband.testcase \
+ createcov_16_mband_webp1.testcase \
+ createcov_16_mband_webp2.testcase \
+ createcov_1bit_mono1.testcase \
+ createcov_1bit_mono_deflate.testcase \
+ createcov_1bit_mono_fax3.testcase \
+ createcov_1bit_mono_fax4.testcase \
+ createcov_1bit_mono_gif.testcase \
+ createcov_1bit_mono_jpeg.testcase \
+ createcov_1bit_mono_lzma.testcase \
+ createcov_1bit_mono_png.testcase \
+ createcov_1bit_mono.testcase \
+ createcov_1bit_mono_webp1.testcase \
+ createcov_1bit_mono_webp2.testcase \
+ createcov_1bit_palette1.testcase \
+ createcov_1bit_palette_gif.testcase \
+ createcov_1bit_palette_png.testcase \
+ createcov_1bit_palette.testcase \
+ createcov_2bit_gray1.testcase \
+ createcov_2bit_gray_gif.testcase \
+ createcov_2bit_gray_jpeg.testcase \
+ createcov_2bit_gray_png.testcase \
+ createcov_2bit_gray.testcase \
+ createcov_2bit_gray_webp1.testcase \
+ createcov_2bit_gray_webp2.testcase \
+ createcov_2bit_palette1.testcase \
+ createcov_2bit_palette_gif.testcase \
+ createcov_2bit_palette_png.testcase \
+ createcov_2bit_palette.testcase \
+ createcov_4bit_gray1.testcase \
+ createcov_4bit_gray_gif.testcase \
+ createcov_4bit_gray_jpeg.testcase \
+ createcov_4bit_gray_png.testcase \
+ createcov_4bit_gray.testcase \
+ createcov_4bit_gray_webp1.testcase \
+ createcov_4bit_gray_webp2.testcase \
+ createcov_4bit_palette1.testcase \
+ createcov_4bit_palette_gif.testcase \
+ createcov_4bit_palette_png.testcase \
+ createcov_4bit_palette.testcase \
+ createcov_8_mband1.testcase \
+ createcov_8_mband_deflate.testcase \
+ createcov_8_mband_fax3.testcase \
+ createcov_8_mband_fax4.testcase \
+ createcov_8_mband_gif.testcase \
+ createcov_8_mband_jpeg.testcase \
+ createcov_8_mband_lzma.testcase \
+ createcov_8_mband_png.testcase \
+ createcov_8_mband.testcase \
+ createcov_8_mband_webp1.testcase \
+ createcov_8_mband_webp2.testcase \
+ createcov_double_grid1.testcase \
+ createcov_double_grid_deflate.testcase \
+ createcov_double_grid_lzma.testcase \
+ createcov_double_grid.testcase \
+ createcov_err1.testcase \
+ createcov_err2.testcase \
+ createcov_err3.testcase \
+ createcov_err4.testcase \
+ createcov_err5.testcase \
+ createcov_err6.testcase \
+ createcov_err7.testcase \
+ createcov_err8.testcase \
+ createcov_err9.testcase \
+ createcov_err10.testcase \
+ createcov_err11.testcase \
+ createcov_err12.testcase \
+ createcov_float_grid1.testcase \
+ createcov_float_grid_deflate.testcase \
+ createcov_float_grid_lzma.testcase \
+ createcov_float_grid.testcase \
+ createcov_int16_grid1.testcase \
+ createcov_int16_grid_deflate.testcase \
+ createcov_int16_grid_lzma.testcase \
+ createcov_int16_grid.testcase \
+ createcov_int32_grid1.testcase \
+ createcov_int32_grid_deflate.testcase \
+ createcov_int32_grid_gif.testcase \
+ createcov_int32_grid_jpeg.testcase \
+ createcov_int32_grid_lzma.testcase \
+ createcov_int32_grid_png.testcase \
+ createcov_int32_grid.testcase \
+ createcov_int32_grid_webp1.testcase \
+ createcov_int32_grid_webp2.testcase \
+ createcov_int8_grid1.testcase \
+ createcov_int8_grid_deflate.testcase \
+ createcov_int8_grid_lzma.testcase \
+ createcov_int8_grid.testcase \
+ createcov_uint16_grid1.testcase \
+ createcov_uint16_grid_deflate.testcase \
+ createcov_uint16_grid_lzma.testcase \
+ createcov_uint16_grid.testcase \
+ createcov_uint32_grid1.testcase \
+ createcov_uint32_grid_deflate.testcase \
+ createcov_uint32_grid_lzma.testcase \
+ createcov_uint32_grid.testcase \
+ createcov_uint8_gray_deflate.testcase \
+ createcov_uint8_gray_fax3.testcase \
+ createcov_uint8_gray_fax4.testcase \
+ createcov_uint8_gray_gif.testcase \
+ createcov_uint8_gray_jpeg.testcase \
+ createcov_uint8_gray_lzma.testcase \
+ createcov_uint8_gray_png.testcase \
+ createcov_uint8_gray.testcase \
+ createcov_uint8_gray_webp1.testcase \
+ createcov_uint8_gray_webp2.testcase \
+ createcov_uint8_grid1.testcase \
+ createcov_uint8_grid_deflate.testcase \
+ createcov_uint8_grid_lzma.testcase \
+ createcov_uint8_grid.testcase \
+ createcov_uint8_palette_deflate.testcase \
+ createcov_uint8_palette_fax3.testcase \
+ createcov_uint8_palette_fax4.testcase \
+ createcov_uint8_palette_gif.testcase \
+ createcov_uint8_palette_jpeg.testcase \
+ createcov_uint8_palette_lzma.testcase \
+ createcov_uint8_palette_png.testcase \
+ createcov_uint8_palette.testcase \
+ createcov_uint8_palette_webp1.testcase \
+ createcov_uint8_palette_webp2.testcase \
+ createcov_uint8_rgb1.testcase \
+ createcov_uint8_rgb_deflate.testcase \
+ createcov_uint8_rgb_fax3.testcase \
+ createcov_uint8_rgb_fax4.testcase \
+ createcov_uint8_rgb_gif.testcase \
+ createcov_uint8_rgb_jpeg.testcase \
+ createcov_uint8_rgb_lzma.testcase \
+ createcov_uint8_rgb_png.testcase \
+ createcov_uint8_rgb.testcase \
+ createcov_uint8_rgb_webp1.testcase \
+ createcov_uint8_rgb_webp2.testcase \
+ createpixel1.testcase \
+ createpixel2.testcase \
+ createpixel3.testcase \
+ createpixel4.testcase \
+ createpixel5.testcase \
+ createpixel6.testcase \
+ createpixel7.testcase \
+ createpixel8.testcase \
+ createpixel9.testcase \
+ createpixel10.testcase \
+ createpixel11.testcase \
+ createpixel12.testcase \
+ createpixel13.testcase \
+ deletesection1.testcase \
+ deletesection2.testcase \
+ deletesection3.testcase \
+ deletesection4.testcase \
+ depyramidize1.testcase \
+ depyramidize2.testcase \
+ depyramidize3.testcase \
+ depyramidize4.testcase \
+ depyramidize5.testcase \
+ depyramidize6.testcase \
+ depyramidize7.testcase \
+ depyramidize8.testcase \
+ depyramidize9.testcase \
+ depyramidize10.testcase \
+ depyramidize11.testcase \
+ depyramidize12.testcase \
+ dropcoverage1.testcase \
+ dropcoverage2.testcase \
+ dropcoverage3.testcase \
+ getmapimage1.testcase \
+ getmapimage2.testcase \
+ getmapimage3.testcase \
+ getmapimage4.testcase \
+ getmapimage5.testcase \
+ getmapimage6.testcase \
+ getmapimage7.testcase \
+ getmapimage8.testcase \
+ getmapimage9.testcase \
+ getmapimage10.testcase \
+ getmapimage1.testcase \
+ getmapimage12.testcase \
+ getmapimage13.testcase \
+ getmapimage14.testcase \
+ getmapimage15.testcase \
+ getmapimage16.testcase \
+ getmapimage17.testcase \
+ getmapimage18.testcase \
+ getmapimage19.testcase \
+ getmapimage20.testcase \
+ gettileimage1.testcase \
+ gettileimage2.testcase \
+ gettileimage3.testcase \
+ gettileimage4.testcase \
+ gettileimage5.testcase \
+ gettileimage6.testcase \
+ getbandhistogram1.testcase \
+ getbandhistogram2.testcase \
+ getbandhistogram3.testcase \
+ getbandhistogram4.testcase \
+ getbandtileimage1.testcase \
+ getbandtileimage2.testcase \
+ getbandtileimage3.testcase \
+ getbandtileimage4.testcase \
+ getbandtileimage5.testcase \
+ getbandtileimage6.testcase \
+ getbandtileimage7.testcase \
+ getbandtileimage8.testcase \
+ getbandtileimage9.testcase \
+ getbandtileimage10.testcase \
+ getbandtileimage11.testcase \
+ getbandtileimage12.testcase \
+ getmonotileimage1.testcase \
+ getmonotileimage2.testcase \
+ getmonotileimage3.testcase \
+ getmonotileimage4.testcase \
+ getmonotileimage5.testcase \
+ getmonotileimage6.testcase \
+ getmonotileimage7.testcase \
+ getmonotileimage8.testcase \
+ getpalettenumentries1.testcase \
+ getpalettenumentries2.testcase \
+ getpalettecolorentry1.testcase \
+ getpalettecolorentry2.testcase \
+ getpalettecolorentry3.testcase \
+ getpixelnumbands1.testcase \
+ getpixelnumbands2.testcase \
+ getpixelnumbands3.testcase \
+ getpixelnumbands4.testcase \
+ getpixelnumbands5.testcase \
+ getpixelnumbands6.testcase \
+ getpixeltype1.testcase \
+ getpixeltype2.testcase \
+ getpixeltype3.testcase \
+ getpixeltype4.testcase \
+ getpixeltype5.testcase \
+ getpixeltype6.testcase \
+ getpixeltype7.testcase \
+ getpixeltype8.testcase \
+ getpixeltype9.testcase \
+ getpixeltype10.testcase \
+ getpixeltype11.testcase \
+ getpixelvalue1.testcase \
+ getpixelvalue2.testcase \
+ getpixelvalue3.testcase \
+ getpixelvalue4.testcase \
+ getpixelvalue5.testcase \
+ getpixelvalue6.testcase \
+ getpixelvalue7.testcase \
+ getpixelvalue8.testcase \
+ getpixelvalue9.testcase \
+ getpixelvalue10.testcase \
+ getpixelsampletype1.testcase \
+ getpixelsampletype2.testcase \
+ getpixelsampletype3.testcase \
+ getpixelsampletype4.testcase \
+ getpixelsampletype5.testcase \
+ getpixelsampletype6.testcase \
+ getpixelsampletype7.testcase \
+ getpixelsampletype8.testcase \
+ getpixelsampletype9.testcase \
+ getpixelsampletype10.testcase \
+ getpixelsampletype11.testcase \
+ getpixelsampletype12.testcase \
+ getpixelsampletype13.testcase \
+ getpixelsampletype14.testcase \
+ getpixelsampletype15.testcase \
+ getpixelsampletype16.testcase \
+ getrasterstats1.testcase \
+ getrasterstats2.testcase \
+ getrasterstats3.testcase \
+ getrasterstats4.testcase \
+ getrasterstats5.testcase \
+ getrasterstats6.testcase \
+ getrasterstats7.testcase \
+ getrasterstats8.testcase \
+ getrasterstats9.testcase \
+ getrasterstats10.testcase \
+ getrasterstats11.testcase \
+ getrasterstats12.testcase \
+ getrasterstats13.testcase \
+ getrasterstats14.testcase \
+ getrasterstats15.testcase \
+ getrasterstats16.testcase \
+ getrasterstats17.testcase \
+ getrasterstats18.testcase \
+ getrasterstats19.testcase \
+ getrasterstats20.testcase \
+ getrasterstats21.testcase \
+ getrasterstats22.testcase \
+ getrasterstats23.testcase \
+ getrasterstats24.testcase \
+ getrasterstats25.testcase \
+ getrasterstats26.testcase \
+ ispixelopaque1.testcase \
+ ispixelopaque2.testcase \
+ ispixelopaque3.testcase \
+ ispixelopaque4.testcase \
+ ispixelopaque5.testcase \
+ ispixeltransparent1.testcase \
+ ispixeltransparent2.testcase \
+ ispixeltransparent3.testcase \
+ ispixeltransparent4.testcase \
+ ispixeltransparent5.testcase \
+ isvalidpalette1.testcase \
+ isvalidpalette2.testcase \
+ isvalidpalette3.testcase \
+ isvalidpalette4.testcase \
+ isvalidpalette5.testcase \
+ isvalidpalette6.testcase \
+ isvalidpalette7.testcase \
+ isvalidpalette8.testcase \
+ isvalidpalette9.testcase \
+ isvalidpalette10.testcase \
+ isvalidpixel1.testcase \
+ isvalidpixel2.testcase \
+ isvalidpixel3.testcase \
+ isvalidpixel4.testcase \
+ isvalidpixel5.testcase \
+ isvalidpixel6.testcase \
+ isvalidpixel7.testcase \
+ isvalidpixel8.testcase \
+ isvalidpixel9.testcase \
+ isvalidpixel10.testcase \
+ isvalidpixel11.testcase \
+ isvalidpixel12.testcase \
+ isvalidpixel13.testcase \
+ isvalidpixel14.testcase \
+ isvalidpixel15.testcase \
+ isvalidpixel16.testcase \
+ isvalidpixel17.testcase \
+ isvalidpixel18.testcase \
+ isvalidpixel19.testcase \
+ isvalidpixel20.testcase \
+ isvalidpixel21.testcase \
+ isvalidpixel22.testcase \
+ isvalidpixel23.testcase \
+ isvalidstats1.testcase \
+ isvalidstats2.testcase \
+ isvalidstats3.testcase \
+ isvalidstats4.testcase \
+ isvalidstats5.testcase \
+ isvalidstats6.testcase \
+ isvalidstats7.testcase \
+ isvalidstats8.testcase \
+ isvalidstats9.testcase \
+ isvalidstats10.testcase \
+ isvalidstats11.testcase \
+ isvalidstats12.testcase \
+ isvalidstats13.testcase \
+ isvalidstats14.testcase \
+ isvalidstats15.testcase \
+ isvalidstats16.testcase \
+ isvalidstats17.testcase \
+ isvalidstats18.testcase \
+ isvalidtile1.testcase \
+ isvalidtile2.testcase \
+ isvalidtile3.testcase \
+ isvalidtile4.testcase \
+ setpixelopaque1.testcase \
+ paletteequals1.testcase \
+ paletteequals2.testcase \
+ paletteequals3.testcase \
+ pixelequals1.testcase \
+ pixelequals2.testcase \
+ pixelequals3.testcase \
+ pixelequals4.testcase \
+ pixelequals5.testcase \
+ pixelequals6.testcase \
+ pixelequals7.testcase \
+ pixelequals8.testcase \
+ pyramidize1.testcase \
+ pyramidize2.testcase \
+ pyramidize3.testcase \
+ pyramidize4.testcase \
+ pyramidize5.testcase \
+ pyramidize6.testcase \
+ pyramidize7.testcase \
+ pyramidize8.testcase \
+ pyramidize9.testcase \
+ pyramidize10.testcase \
+ pyramidize11.testcase \
+ pyramidize12.testcase \
+ pyramidize13.testcase \
+ pyramidize14.testcase \
+ pyramidize15.testcase \
+ pyramidize16.testcase \
+ setcoverageinfos1.testcase \
+ setcoverageinfos2.testcase \
+ setcoverageinfos3.testcase \
+ setcoverageinfos4.testcase \
+ setpalettecolorentry1.testcase \
+ setpalettecolorentry2.testcase \
+ setpalettecolorentry3.testcase \
+ setpalettecolorentry4.testcase \
+ setpixelopaque2.testcase \
+ setpixeltransparent1.testcase \
+ setpixeltransparent2.testcase \
+ setpixelvalue1.testcase \
+ setpixelvalue2.testcase \
+ setpixelvalue3.testcase \
+ setpixelvalue4.testcase \
+ setpixelvalue5.testcase \
+ setpixelvalue6.testcase \
+ setpixelvalue7.testcase \
+ setpixelvalue8.testcase \
+ setpixelvalue9.testcase \
+ setpixelvalue10.testcase \
+ setpixelvalue11.testcase \
+ setpixelvalue12.testcase \
+ setpixelvalue13.testcase \
+ setpixelvalue14.testcase \
+ setpixelvalue15.testcase \
+ setpixelvalue16.testcase \
+ setpixelvalue17.testcase \
+ setpixelvalue18.testcase \
+ setpixelvalue19.testcase \
+ setpixelvalue20.testcase \
+ setpixelvalue21.testcase \
+ setpixelvalue22.testcase \
+ setpixelvalue23.testcase \
+ setpixelvalue24.testcase \
+ setpixelvalue25.testcase \
+ testpixel_1bit_mono.testcase \
+ testpixel_1bit_plt.testcase \
+ testpixel_2bit_gray.testcase \
+ testpixel_2bit_plt.testcase \
+ testpixel_4bit_gray.testcase \
+ testpixel_4bit_plt.testcase \
+ testpixel_double_grid.testcase \
+ testpixel_float_grid.testcase \
+ testpixel_int16_grid.testcase \
+ testpixel_int32_grid.testcase \
+ testpixel_int8_grid.testcase \
+ testpixel_uint16_grid.testcase \
+ testpixel_uint16_mband.testcase \
+ testpixel_uint16_rgb.testcase \
+ testpixel_uint32_grid.testcase \
+ testpixel_uint8_gray.testcase \
+ testpixel_uint8_grid.testcase \
+ testpixel_uint8_mband.testcase \
+ testpixel_uint8_plt.testcase \
+ testpixel_uint8_rgb.testcase \
+ targetcpu.testcase
+ version.testcase
diff --git a/test/sql_stmt_tests/Makefile.in b/test/sql_stmt_tests/Makefile.in
new file mode 100644
index 0000000..b3e685b
--- /dev/null
+++ b/test/sql_stmt_tests/Makefile.in
@@ -0,0 +1,892 @@
+# Makefile.in generated by automake 1.13.4 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.
+
+ at 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@
+pkgincludedir = $(includedir)/@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 = test/sql_stmt_tests
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(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)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ 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__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAIRO_CFLAGS = @LIBCAIRO_CFLAGS@
+LIBCAIRO_LIBS = @LIBCAIRO_LIBS@
+LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@
+LIBLZMA_LIBS = @LIBLZMA_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
+LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
+LIBTOOL = @LIBTOOL@
+LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@
+LIBWEBP_LIBS = @LIBWEBP_LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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_CXX = @ac_ct_CXX@
+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@
+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@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = createcov_16_mband1.testcase \
+ createcov_16_mband_deflate.testcase \
+ createcov_16_mband_fax3.testcase \
+ createcov_16_mband_fax4.testcase \
+ createcov_16_mband_gif.testcase \
+ createcov_16_mband_jpeg.testcase \
+ createcov_16_mband_lzma.testcase \
+ createcov_16_mband_png.testcase \
+ createcov_16_mband.testcase \
+ createcov_16_mband_webp1.testcase \
+ createcov_16_mband_webp2.testcase \
+ createcov_1bit_mono1.testcase \
+ createcov_1bit_mono_deflate.testcase \
+ createcov_1bit_mono_fax3.testcase \
+ createcov_1bit_mono_fax4.testcase \
+ createcov_1bit_mono_gif.testcase \
+ createcov_1bit_mono_jpeg.testcase \
+ createcov_1bit_mono_lzma.testcase \
+ createcov_1bit_mono_png.testcase \
+ createcov_1bit_mono.testcase \
+ createcov_1bit_mono_webp1.testcase \
+ createcov_1bit_mono_webp2.testcase \
+ createcov_1bit_palette1.testcase \
+ createcov_1bit_palette_gif.testcase \
+ createcov_1bit_palette_png.testcase \
+ createcov_1bit_palette.testcase \
+ createcov_2bit_gray1.testcase \
+ createcov_2bit_gray_gif.testcase \
+ createcov_2bit_gray_jpeg.testcase \
+ createcov_2bit_gray_png.testcase \
+ createcov_2bit_gray.testcase \
+ createcov_2bit_gray_webp1.testcase \
+ createcov_2bit_gray_webp2.testcase \
+ createcov_2bit_palette1.testcase \
+ createcov_2bit_palette_gif.testcase \
+ createcov_2bit_palette_png.testcase \
+ createcov_2bit_palette.testcase \
+ createcov_4bit_gray1.testcase \
+ createcov_4bit_gray_gif.testcase \
+ createcov_4bit_gray_jpeg.testcase \
+ createcov_4bit_gray_png.testcase \
+ createcov_4bit_gray.testcase \
+ createcov_4bit_gray_webp1.testcase \
+ createcov_4bit_gray_webp2.testcase \
+ createcov_4bit_palette1.testcase \
+ createcov_4bit_palette_gif.testcase \
+ createcov_4bit_palette_png.testcase \
+ createcov_4bit_palette.testcase \
+ createcov_8_mband1.testcase \
+ createcov_8_mband_deflate.testcase \
+ createcov_8_mband_fax3.testcase \
+ createcov_8_mband_fax4.testcase \
+ createcov_8_mband_gif.testcase \
+ createcov_8_mband_jpeg.testcase \
+ createcov_8_mband_lzma.testcase \
+ createcov_8_mband_png.testcase \
+ createcov_8_mband.testcase \
+ createcov_8_mband_webp1.testcase \
+ createcov_8_mband_webp2.testcase \
+ createcov_double_grid1.testcase \
+ createcov_double_grid_deflate.testcase \
+ createcov_double_grid_lzma.testcase \
+ createcov_double_grid.testcase \
+ createcov_err1.testcase \
+ createcov_err2.testcase \
+ createcov_err3.testcase \
+ createcov_err4.testcase \
+ createcov_err5.testcase \
+ createcov_err6.testcase \
+ createcov_err7.testcase \
+ createcov_err8.testcase \
+ createcov_err9.testcase \
+ createcov_err10.testcase \
+ createcov_err11.testcase \
+ createcov_err12.testcase \
+ createcov_float_grid1.testcase \
+ createcov_float_grid_deflate.testcase \
+ createcov_float_grid_lzma.testcase \
+ createcov_float_grid.testcase \
+ createcov_int16_grid1.testcase \
+ createcov_int16_grid_deflate.testcase \
+ createcov_int16_grid_lzma.testcase \
+ createcov_int16_grid.testcase \
+ createcov_int32_grid1.testcase \
+ createcov_int32_grid_deflate.testcase \
+ createcov_int32_grid_gif.testcase \
+ createcov_int32_grid_jpeg.testcase \
+ createcov_int32_grid_lzma.testcase \
+ createcov_int32_grid_png.testcase \
+ createcov_int32_grid.testcase \
+ createcov_int32_grid_webp1.testcase \
+ createcov_int32_grid_webp2.testcase \
+ createcov_int8_grid1.testcase \
+ createcov_int8_grid_deflate.testcase \
+ createcov_int8_grid_lzma.testcase \
+ createcov_int8_grid.testcase \
+ createcov_uint16_grid1.testcase \
+ createcov_uint16_grid_deflate.testcase \
+ createcov_uint16_grid_lzma.testcase \
+ createcov_uint16_grid.testcase \
+ createcov_uint32_grid1.testcase \
+ createcov_uint32_grid_deflate.testcase \
+ createcov_uint32_grid_lzma.testcase \
+ createcov_uint32_grid.testcase \
+ createcov_uint8_gray_deflate.testcase \
+ createcov_uint8_gray_fax3.testcase \
+ createcov_uint8_gray_fax4.testcase \
+ createcov_uint8_gray_gif.testcase \
+ createcov_uint8_gray_jpeg.testcase \
+ createcov_uint8_gray_lzma.testcase \
+ createcov_uint8_gray_png.testcase \
+ createcov_uint8_gray.testcase \
+ createcov_uint8_gray_webp1.testcase \
+ createcov_uint8_gray_webp2.testcase \
+ createcov_uint8_grid1.testcase \
+ createcov_uint8_grid_deflate.testcase \
+ createcov_uint8_grid_lzma.testcase \
+ createcov_uint8_grid.testcase \
+ createcov_uint8_palette_deflate.testcase \
+ createcov_uint8_palette_fax3.testcase \
+ createcov_uint8_palette_fax4.testcase \
+ createcov_uint8_palette_gif.testcase \
+ createcov_uint8_palette_jpeg.testcase \
+ createcov_uint8_palette_lzma.testcase \
+ createcov_uint8_palette_png.testcase \
+ createcov_uint8_palette.testcase \
+ createcov_uint8_palette_webp1.testcase \
+ createcov_uint8_palette_webp2.testcase \
+ createcov_uint8_rgb1.testcase \
+ createcov_uint8_rgb_deflate.testcase \
+ createcov_uint8_rgb_fax3.testcase \
+ createcov_uint8_rgb_fax4.testcase \
+ createcov_uint8_rgb_gif.testcase \
+ createcov_uint8_rgb_jpeg.testcase \
+ createcov_uint8_rgb_lzma.testcase \
+ createcov_uint8_rgb_png.testcase \
+ createcov_uint8_rgb.testcase \
+ createcov_uint8_rgb_webp1.testcase \
+ createcov_uint8_rgb_webp2.testcase \
+ createpixel1.testcase \
+ createpixel2.testcase \
+ createpixel3.testcase \
+ createpixel4.testcase \
+ createpixel5.testcase \
+ createpixel6.testcase \
+ createpixel7.testcase \
+ createpixel8.testcase \
+ createpixel9.testcase \
+ createpixel10.testcase \
+ createpixel11.testcase \
+ createpixel12.testcase \
+ createpixel13.testcase \
+ deletesection1.testcase \
+ deletesection2.testcase \
+ deletesection3.testcase \
+ deletesection4.testcase \
+ depyramidize1.testcase \
+ depyramidize2.testcase \
+ depyramidize3.testcase \
+ depyramidize4.testcase \
+ depyramidize5.testcase \
+ depyramidize6.testcase \
+ depyramidize7.testcase \
+ depyramidize8.testcase \
+ depyramidize9.testcase \
+ depyramidize10.testcase \
+ depyramidize11.testcase \
+ depyramidize12.testcase \
+ dropcoverage1.testcase \
+ dropcoverage2.testcase \
+ dropcoverage3.testcase \
+ getmapimage1.testcase \
+ getmapimage2.testcase \
+ getmapimage3.testcase \
+ getmapimage4.testcase \
+ getmapimage5.testcase \
+ getmapimage6.testcase \
+ getmapimage7.testcase \
+ getmapimage8.testcase \
+ getmapimage9.testcase \
+ getmapimage10.testcase \
+ getmapimage1.testcase \
+ getmapimage12.testcase \
+ getmapimage13.testcase \
+ getmapimage14.testcase \
+ getmapimage15.testcase \
+ getmapimage16.testcase \
+ getmapimage17.testcase \
+ getmapimage18.testcase \
+ getmapimage19.testcase \
+ getmapimage20.testcase \
+ gettileimage1.testcase \
+ gettileimage2.testcase \
+ gettileimage3.testcase \
+ gettileimage4.testcase \
+ gettileimage5.testcase \
+ gettileimage6.testcase \
+ getbandhistogram1.testcase \
+ getbandhistogram2.testcase \
+ getbandhistogram3.testcase \
+ getbandhistogram4.testcase \
+ getbandtileimage1.testcase \
+ getbandtileimage2.testcase \
+ getbandtileimage3.testcase \
+ getbandtileimage4.testcase \
+ getbandtileimage5.testcase \
+ getbandtileimage6.testcase \
+ getbandtileimage7.testcase \
+ getbandtileimage8.testcase \
+ getbandtileimage9.testcase \
+ getbandtileimage10.testcase \
+ getbandtileimage11.testcase \
+ getbandtileimage12.testcase \
+ getmonotileimage1.testcase \
+ getmonotileimage2.testcase \
+ getmonotileimage3.testcase \
+ getmonotileimage4.testcase \
+ getmonotileimage5.testcase \
+ getmonotileimage6.testcase \
+ getmonotileimage7.testcase \
+ getmonotileimage8.testcase \
+ getpalettenumentries1.testcase \
+ getpalettenumentries2.testcase \
+ getpalettecolorentry1.testcase \
+ getpalettecolorentry2.testcase \
+ getpalettecolorentry3.testcase \
+ getpixelnumbands1.testcase \
+ getpixelnumbands2.testcase \
+ getpixelnumbands3.testcase \
+ getpixelnumbands4.testcase \
+ getpixelnumbands5.testcase \
+ getpixelnumbands6.testcase \
+ getpixeltype1.testcase \
+ getpixeltype2.testcase \
+ getpixeltype3.testcase \
+ getpixeltype4.testcase \
+ getpixeltype5.testcase \
+ getpixeltype6.testcase \
+ getpixeltype7.testcase \
+ getpixeltype8.testcase \
+ getpixeltype9.testcase \
+ getpixeltype10.testcase \
+ getpixeltype11.testcase \
+ getpixelvalue1.testcase \
+ getpixelvalue2.testcase \
+ getpixelvalue3.testcase \
+ getpixelvalue4.testcase \
+ getpixelvalue5.testcase \
+ getpixelvalue6.testcase \
+ getpixelvalue7.testcase \
+ getpixelvalue8.testcase \
+ getpixelvalue9.testcase \
+ getpixelvalue10.testcase \
+ getpixelsampletype1.testcase \
+ getpixelsampletype2.testcase \
+ getpixelsampletype3.testcase \
+ getpixelsampletype4.testcase \
+ getpixelsampletype5.testcase \
+ getpixelsampletype6.testcase \
+ getpixelsampletype7.testcase \
+ getpixelsampletype8.testcase \
+ getpixelsampletype9.testcase \
+ getpixelsampletype10.testcase \
+ getpixelsampletype11.testcase \
+ getpixelsampletype12.testcase \
+ getpixelsampletype13.testcase \
+ getpixelsampletype14.testcase \
+ getpixelsampletype15.testcase \
+ getpixelsampletype16.testcase \
+ getrasterstats1.testcase \
+ getrasterstats2.testcase \
+ getrasterstats3.testcase \
+ getrasterstats4.testcase \
+ getrasterstats5.testcase \
+ getrasterstats6.testcase \
+ getrasterstats7.testcase \
+ getrasterstats8.testcase \
+ getrasterstats9.testcase \
+ getrasterstats10.testcase \
+ getrasterstats11.testcase \
+ getrasterstats12.testcase \
+ getrasterstats13.testcase \
+ getrasterstats14.testcase \
+ getrasterstats15.testcase \
+ getrasterstats16.testcase \
+ getrasterstats17.testcase \
+ getrasterstats18.testcase \
+ getrasterstats19.testcase \
+ getrasterstats20.testcase \
+ getrasterstats21.testcase \
+ getrasterstats22.testcase \
+ getrasterstats23.testcase \
+ getrasterstats24.testcase \
+ getrasterstats25.testcase \
+ getrasterstats26.testcase \
+ ispixelopaque1.testcase \
+ ispixelopaque2.testcase \
+ ispixelopaque3.testcase \
+ ispixelopaque4.testcase \
+ ispixelopaque5.testcase \
+ ispixeltransparent1.testcase \
+ ispixeltransparent2.testcase \
+ ispixeltransparent3.testcase \
+ ispixeltransparent4.testcase \
+ ispixeltransparent5.testcase \
+ isvalidpalette1.testcase \
+ isvalidpalette2.testcase \
+ isvalidpalette3.testcase \
+ isvalidpalette4.testcase \
+ isvalidpalette5.testcase \
+ isvalidpalette6.testcase \
+ isvalidpalette7.testcase \
+ isvalidpalette8.testcase \
+ isvalidpalette9.testcase \
+ isvalidpalette10.testcase \
+ isvalidpixel1.testcase \
+ isvalidpixel2.testcase \
+ isvalidpixel3.testcase \
+ isvalidpixel4.testcase \
+ isvalidpixel5.testcase \
+ isvalidpixel6.testcase \
+ isvalidpixel7.testcase \
+ isvalidpixel8.testcase \
+ isvalidpixel9.testcase \
+ isvalidpixel10.testcase \
+ isvalidpixel11.testcase \
+ isvalidpixel12.testcase \
+ isvalidpixel13.testcase \
+ isvalidpixel14.testcase \
+ isvalidpixel15.testcase \
+ isvalidpixel16.testcase \
+ isvalidpixel17.testcase \
+ isvalidpixel18.testcase \
+ isvalidpixel19.testcase \
+ isvalidpixel20.testcase \
+ isvalidpixel21.testcase \
+ isvalidpixel22.testcase \
+ isvalidpixel23.testcase \
+ isvalidstats1.testcase \
+ isvalidstats2.testcase \
+ isvalidstats3.testcase \
+ isvalidstats4.testcase \
+ isvalidstats5.testcase \
+ isvalidstats6.testcase \
+ isvalidstats7.testcase \
+ isvalidstats8.testcase \
+ isvalidstats9.testcase \
+ isvalidstats10.testcase \
+ isvalidstats11.testcase \
+ isvalidstats12.testcase \
+ isvalidstats13.testcase \
+ isvalidstats14.testcase \
+ isvalidstats15.testcase \
+ isvalidstats16.testcase \
+ isvalidstats17.testcase \
+ isvalidstats18.testcase \
+ isvalidtile1.testcase \
+ isvalidtile2.testcase \
+ isvalidtile3.testcase \
+ isvalidtile4.testcase \
+ setpixelopaque1.testcase \
+ paletteequals1.testcase \
+ paletteequals2.testcase \
+ paletteequals3.testcase \
+ pixelequals1.testcase \
+ pixelequals2.testcase \
+ pixelequals3.testcase \
+ pixelequals4.testcase \
+ pixelequals5.testcase \
+ pixelequals6.testcase \
+ pixelequals7.testcase \
+ pixelequals8.testcase \
+ pyramidize1.testcase \
+ pyramidize2.testcase \
+ pyramidize3.testcase \
+ pyramidize4.testcase \
+ pyramidize5.testcase \
+ pyramidize6.testcase \
+ pyramidize7.testcase \
+ pyramidize8.testcase \
+ pyramidize9.testcase \
+ pyramidize10.testcase \
+ pyramidize11.testcase \
+ pyramidize12.testcase \
+ pyramidize13.testcase \
+ pyramidize14.testcase \
+ pyramidize15.testcase \
+ pyramidize16.testcase \
+ setcoverageinfos1.testcase \
+ setcoverageinfos2.testcase \
+ setcoverageinfos3.testcase \
+ setcoverageinfos4.testcase \
+ setpalettecolorentry1.testcase \
+ setpalettecolorentry2.testcase \
+ setpalettecolorentry3.testcase \
+ setpalettecolorentry4.testcase \
+ setpixelopaque2.testcase \
+ setpixeltransparent1.testcase \
+ setpixeltransparent2.testcase \
+ setpixelvalue1.testcase \
+ setpixelvalue2.testcase \
+ setpixelvalue3.testcase \
+ setpixelvalue4.testcase \
+ setpixelvalue5.testcase \
+ setpixelvalue6.testcase \
+ setpixelvalue7.testcase \
+ setpixelvalue8.testcase \
+ setpixelvalue9.testcase \
+ setpixelvalue10.testcase \
+ setpixelvalue11.testcase \
+ setpixelvalue12.testcase \
+ setpixelvalue13.testcase \
+ setpixelvalue14.testcase \
+ setpixelvalue15.testcase \
+ setpixelvalue16.testcase \
+ setpixelvalue17.testcase \
+ setpixelvalue18.testcase \
+ setpixelvalue19.testcase \
+ setpixelvalue20.testcase \
+ setpixelvalue21.testcase \
+ setpixelvalue22.testcase \
+ setpixelvalue23.testcase \
+ setpixelvalue24.testcase \
+ setpixelvalue25.testcase \
+ testpixel_1bit_mono.testcase \
+ testpixel_1bit_plt.testcase \
+ testpixel_2bit_gray.testcase \
+ testpixel_2bit_plt.testcase \
+ testpixel_4bit_gray.testcase \
+ testpixel_4bit_plt.testcase \
+ testpixel_double_grid.testcase \
+ testpixel_float_grid.testcase \
+ testpixel_int16_grid.testcase \
+ testpixel_int32_grid.testcase \
+ testpixel_int8_grid.testcase \
+ testpixel_uint16_grid.testcase \
+ testpixel_uint16_mband.testcase \
+ testpixel_uint16_rgb.testcase \
+ testpixel_uint32_grid.testcase \
+ testpixel_uint8_gray.testcase \
+ testpixel_uint8_grid.testcase \
+ testpixel_uint8_mband.testcase \
+ testpixel_uint8_plt.testcase \
+ testpixel_uint8_rgb.testcase \
+ targetcpu.testcase
+
+all: 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) --gnu test/sql_stmt_tests/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu test/sql_stmt_tests/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):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+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
+all-am: Makefile
+installdirs:
+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)
+
+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
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+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:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ cscopelist-am ctags-am distclean distclean-generic \
+ distclean-libtool 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-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-am uninstall uninstall-am
+
+ version.testcase
+
+# 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:
diff --git a/test/sql_stmt_tests/createcov_16_mband.testcase b/test/sql_stmt_tests/createcov_16_mband.testcase
new file mode 100644
index 0000000..8e172be
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_16_mband.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 MULTIBAND
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_multiband', 'UINT16', 'MULTIBAND', 4, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_multiband', 'UINT16', 'MULTIBAND', 4, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_16_mband1.testcase b/test/sql_stmt_tests/createcov_16_mband1.testcase
new file mode 100644
index 0000000..948942c
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_16_mband1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 MULTIBAND invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_multiband1', 'UINT16', 'MULTIBAND', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_multiband1', 'UINT16', 'MULTIBAND', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_16_mband_deflate.testcase b/test/sql_stmt_tests/createcov_16_mband_deflate.testcase
new file mode 100644
index 0000000..ce1d022
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_16_mband_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 MULTIBAND DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_multiband_deflate', 'UINT16', 'MULTIBAND', 4, 'DEFLATE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_multiband_deflate', 'UINT16', 'MULTIBAND', 4, 'DEFLATE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_16_mband_fax3.testcase b/test/sql_stmt_tests/createcov_16_mband_fax3.testcase
new file mode 100644
index 0000000..f78b49a
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_16_mband_fax3.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 MULTIBAND FAX3
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_multiband_fax3', 'UINT16', 'MULTIBAND', 4, 'FAX3', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_multiband_fax3', 'UINT16', 'MULTIBAND', 4, 'FAX3', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_16_mband_fax4.testcase b/test/sql_stmt_tests/createcov_16_mband_fax4.testcase
new file mode 100644
index 0000000..f17e582
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_16_mband_fax4.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 MULTIBAND FAX4
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_multiband_fax4', 'UINT16', 'MULTIBAND', 4, 'FAX4', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_multiband_fax4', 'UINT16', 'MULTIBAND', 4, 'FAX4', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_16_mband_gif.testcase b/test/sql_stmt_tests/createcov_16_mband_gif.testcase
new file mode 100644
index 0000000..d425e39
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_16_mband_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 MULTIBAND GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_multiband_gif', 'UINT16', 'MULTIBAND', 4, 'GIF', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_multiband_gif', 'UINT16', 'MULTIBAND', 4, 'GIF', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_16_mband_jpeg.testcase b/test/sql_stmt_tests/createcov_16_mband_jpeg.testcase
new file mode 100644
index 0000000..3c45395
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_16_mband_jpeg.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 MULTIBAND JPEG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_multiband_jpeg', 'UINT16', 'MULTIBAND', 4, 'JPEG', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_multiband_jpeg', 'UINT16', 'MULTIBAND', 4, 'JPEG', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_16_mband_lzma.testcase b/test/sql_stmt_tests/createcov_16_mband_lzma.testcase
new file mode 100644
index 0000000..6b4acb3
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_16_mband_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 MULTIBAND LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_multiband_lzma', 'UINT16', 'MULTIBAND', 4, 'LZMA', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_multiband_lzma', 'UINT16', 'MULTIBAND', 4, 'LZMA', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_16_mband_png.testcase b/test/sql_stmt_tests/createcov_16_mband_png.testcase
new file mode 100644
index 0000000..935d850
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_16_mband_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 MULTIBAND PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_multiband_png', 'UINT16', 'MULTIBAND', 4, 'PNG', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_multiband_png', 'UINT16', 'MULTIBAND', 4, 'PNG', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_16_mband_webp1.testcase b/test/sql_stmt_tests/createcov_16_mband_webp1.testcase
new file mode 100644
index 0000000..600a90b
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_16_mband_webp1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 MULTIBAND LOSSY WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_multiband_webp1', 'UINT16', 'MULTIBAND', 4, 'WEBP', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_multiband_webp1', 'UINT16', 'MULTIBAND', 4, 'WEBP', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_16_mband_webp2.testcase b/test/sql_stmt_tests/createcov_16_mband_webp2.testcase
new file mode 100644
index 0000000..14758af
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_16_mband_webp2.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 MULTIBAND LOSSLESS WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_multiband_webp2', 'UINT16', 'MULTIBAND', 4, 'LL_WEBP', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_multiband_webp2', 'UINT16', 'MULTIBAND', 4, 'LL_WEBP', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_1bit_mono.testcase b/test/sql_stmt_tests/createcov_1bit_mono.testcase
new file mode 100644
index 0000000..07ad7cc
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_mono.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT MONOCHROME
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_mono', '1-BIT', 'MONOCHROME', 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, RL2_SetPixelValue(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1), 0, 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_mono', '1-BIT', 'MONOCHROME', 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, RL2_SetPixelValue(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1), 0, 1))
+1
diff --git a/test/sql_stmt_tests/createcov_1bit_mono1.testcase b/test/sql_stmt_tests/createcov_1bit_mono1.testcase
new file mode 100644
index 0000000..6cedd9e
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_mono1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT MONOCHROME invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_mono1', '1-BIT', 'MONOCHROME', 2, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_mono1', '1-BIT', 'MONOCHROME', 2, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_1bit_mono_deflate.testcase b/test/sql_stmt_tests/createcov_1bit_mono_deflate.testcase
new file mode 100644
index 0000000..902f763
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_mono_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT MONOCHROME DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_mono_deflate', '1-BIT', 'MONOCHROME', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_mono_deflate', '1-BIT', 'MONOCHROME', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_1bit_mono_fax3.testcase b/test/sql_stmt_tests/createcov_1bit_mono_fax3.testcase
new file mode 100644
index 0000000..5424b97
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_mono_fax3.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT MONOCHROME FAX3
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_mono_fax3', '1-BIT', 'MONOCHROME', 1, 'FAX3', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_mono_fax3', '1-BIT', 'MONOCHROME', 1, 'FAX3', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_1bit_mono_fax4.testcase b/test/sql_stmt_tests/createcov_1bit_mono_fax4.testcase
new file mode 100644
index 0000000..544f949
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_mono_fax4.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT MONOCHROME FAX4
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_mono_fax4', '1-BIT', 'MONOCHROME', 1, 'FAX4', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_mono_fax4', '1-BIT', 'MONOCHROME', 1, 'FAX4', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_1bit_mono_gif.testcase b/test/sql_stmt_tests/createcov_1bit_mono_gif.testcase
new file mode 100644
index 0000000..0e233c1
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_mono_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT MONOCHROME GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_mono_gif', '1-BIT', 'MONOCHROME', 1, 'GIF', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_mono_gif', '1-BIT', 'MONOCHROME', 1, 'GIF', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_1bit_mono_jpeg.testcase b/test/sql_stmt_tests/createcov_1bit_mono_jpeg.testcase
new file mode 100644
index 0000000..f4de5ee
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_mono_jpeg.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT MONOCHROME JPEG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_mono_jpeg', '1-BIT', 'MONOCHROME', 1, 'JPEG', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_mono_jpeg', '1-BIT', 'MONOCHROME', 1, 'JPEG', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_1bit_mono_lzma.testcase b/test/sql_stmt_tests/createcov_1bit_mono_lzma.testcase
new file mode 100644
index 0000000..185d0cd
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_mono_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT MONOCHROME LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_mono_lzma', '1-BIT', 'MONOCHROME', 1, 'LZMA', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_mono_lzma', '1-BIT', 'MONOCHROME', 1, 'LZMA', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_1bit_mono_png.testcase b/test/sql_stmt_tests/createcov_1bit_mono_png.testcase
new file mode 100644
index 0000000..2e6781c
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_mono_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT MONOCHROME PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_mono_gif', '1-BIT', 'MONOCHROME', 1, 'PNG', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_mono_gif', '1-BIT', 'MONOCHROME', 1, 'PNG', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_1bit_mono_webp1.testcase b/test/sql_stmt_tests/createcov_1bit_mono_webp1.testcase
new file mode 100644
index 0000000..6ed3131
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_mono_webp1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT MONOCHROME LOSSY WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_mono_webp1', '1-BIT', 'MONOCHROME', 1, 'WEBP', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_mono_webp1', '1-BIT', 'MONOCHROME', 1, 'WEBP', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_1bit_mono_webp2.testcase b/test/sql_stmt_tests/createcov_1bit_mono_webp2.testcase
new file mode 100644
index 0000000..3a2d952
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_mono_webp2.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT MONOCHROME LOSSLESS WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_mono_webp2', '1-BIT', 'MONOCHROME', 1, 'LL_WEBP', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_mono_webp2', '1-BIT', 'MONOCHROME', 1, 'LL_WEBP', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_1bit_palette.testcase b/test/sql_stmt_tests/createcov_1bit_palette.testcase
new file mode 100644
index 0000000..be9f0cc
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_palette.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT PALETTE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_palette', '1-BIT', 'PALETTE', 1, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_palette', '1-BIT', 'PALETTE', 1, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_1bit_palette1.testcase b/test/sql_stmt_tests/createcov_1bit_palette1.testcase
new file mode 100644
index 0000000..86db406
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_palette1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT PALETTE invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_palette1', '1-BIT', 'PALETTE', 2, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_palette1', '1-BIT', 'PALETTE', 2, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_1bit_palette_gif.testcase b/test/sql_stmt_tests/createcov_1bit_palette_gif.testcase
new file mode 100644
index 0000000..661fb82
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_palette_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT PALETTE GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_palette_gif', '1-BIT', 'PALETTE', 1, 'GIF', 100, 256, 256, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_palette_gif', '1-BIT', 'PALETTE', 1, 'GIF', 100, 256, 256, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_1bit_palette_png.testcase b/test/sql_stmt_tests/createcov_1bit_palette_png.testcase
new file mode 100644
index 0000000..815bf79
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_1bit_palette_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 1-BIT PALETTE PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('1bit_palette_png', '1-BIT', 'PALETTE', 1, 'PNG', 100, 256, 256, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('1bit_palette_png', '1-BIT', 'PALETTE', 1, 'PNG', 100, 256, 256, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_2bit_gray.testcase b/test/sql_stmt_tests/createcov_2bit_gray.testcase
new file mode 100644
index 0000000..bbdb12d
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_2bit_gray.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 2-BIT GRAYSCALE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('2bit_gray', '2-BIT', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('2bit_gray', '2-BIT', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_2bit_gray1.testcase b/test/sql_stmt_tests/createcov_2bit_gray1.testcase
new file mode 100644
index 0000000..ba0bcc3
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_2bit_gray1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 2-BIT GRAYSCALE invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('2bit_gray1', '2-BIT', 'GRAYSCALE', 2, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('2bit_gray1', '2-BIT', 'GRAYSCALE', 2, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_2bit_gray_gif.testcase b/test/sql_stmt_tests/createcov_2bit_gray_gif.testcase
new file mode 100644
index 0000000..ee44b81
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_2bit_gray_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 2-BIT GRAYSCALE GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('2bit_gray_gif', '2-BIT', 'GRAYSCALE', 1, 'GIF', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('2bit_gray_gif', '2-BIT', 'GRAYSCALE', 1, 'GIF', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_2bit_gray_jpeg.testcase b/test/sql_stmt_tests/createcov_2bit_gray_jpeg.testcase
new file mode 100644
index 0000000..161d3f6
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_2bit_gray_jpeg.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 2-BIT GRAYSCALE JPEG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('2bit_gray_jpeg', '2-BIT', 'GRAYSCALE', 1, 'JPEG', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('2bit_gray_jpeg', '2-BIT', 'GRAYSCALE', 1, 'JPEG', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_2bit_gray_png.testcase b/test/sql_stmt_tests/createcov_2bit_gray_png.testcase
new file mode 100644
index 0000000..ed3aa53
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_2bit_gray_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 2-BIT GRAYSCALE PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('2bit_gray_png', '2-BIT', 'GRAYSCALE', 1, 'PNG', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('2bit_gray_png', '2-BIT', 'GRAYSCALE', 1, 'PNG', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_2bit_gray_webp1.testcase b/test/sql_stmt_tests/createcov_2bit_gray_webp1.testcase
new file mode 100644
index 0000000..bde0548
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_2bit_gray_webp1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 2-BIT GRAYSCALE LOSSY WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('2bit_gray_webp1', '2-BIT', 'GRAYSCALE', 1, 'WEBP', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('2bit_gray_webp1', '2-BIT', 'GRAYSCALE', 1, 'WEBP', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_2bit_gray_webp2.testcase b/test/sql_stmt_tests/createcov_2bit_gray_webp2.testcase
new file mode 100644
index 0000000..218d977
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_2bit_gray_webp2.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 2-BIT GRAYSCALE LOSSLESS WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('2bit_gray_webp2', '2-BIT', 'GRAYSCALE', 1, 'LL_WEBP', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('2bit_gray_webp2', '2-BIT', 'GRAYSCALE', 1, 'LL_WEBP', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_2bit_palette.testcase b/test/sql_stmt_tests/createcov_2bit_palette.testcase
new file mode 100644
index 0000000..7176689
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_2bit_palette.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 2-BIT PALETTE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('2bit_palette', '2-BIT', 'PALETTE', 1, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('2bit_palette', '2-BIT', 'PALETTE', 1, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_2bit_palette1.testcase b/test/sql_stmt_tests/createcov_2bit_palette1.testcase
new file mode 100644
index 0000000..4ea8cec
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_2bit_palette1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 2-BIT PALETTE invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('2bit_palette1', '2-BIT', 'PALETTE', 2, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('2bit_palette1', '2-BIT', 'PALETTE', 2, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_2bit_palette_gif.testcase b/test/sql_stmt_tests/createcov_2bit_palette_gif.testcase
new file mode 100644
index 0000000..956a553
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_2bit_palette_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 2-BIT PALETTE GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('2bit_palette_gif', '2-BIT', 'PALETTE', 1, 'GIF', 100, 256, 256, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('2bit_palette_gif', '2-BIT', 'PALETTE', 1, 'GIF', 100, 256, 256, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_2bit_palette_png.testcase b/test/sql_stmt_tests/createcov_2bit_palette_png.testcase
new file mode 100644
index 0000000..95c0c72
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_2bit_palette_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 2-BIT PALETTE PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('2bit_palette_png', '2-BIT', 'PALETTE', 1, 'PNG', 100, 256, 256, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('2bit_palette_png', '2-BIT', 'PALETTE', 1, 'PNG', 100, 256, 256, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_4bit_gray.testcase b/test/sql_stmt_tests/createcov_4bit_gray.testcase
new file mode 100644
index 0000000..42590b1
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_4bit_gray.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 4-BIT GRAYSCALE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('4bit_gray', '4-BIT', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('4bit_gray', '4-BIT', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_4bit_gray1.testcase b/test/sql_stmt_tests/createcov_4bit_gray1.testcase
new file mode 100644
index 0000000..eb712d8
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_4bit_gray1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 4-BIT GRAYSCALE invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('4bit_gray1', '4-BIT', 'GRAYSCALE', 2, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('4bit_gray1', '4-BIT', 'GRAYSCALE', 2, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_4bit_gray_gif.testcase b/test/sql_stmt_tests/createcov_4bit_gray_gif.testcase
new file mode 100644
index 0000000..47fa06c
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_4bit_gray_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 4-BIT GRAYSCALE GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('4bit_gray_gif', '4-BIT', 'GRAYSCALE', 1, 'GIF', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('4bit_gray_gif', '4-BIT', 'GRAYSCALE', 1, 'GIF', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_4bit_gray_jpeg.testcase b/test/sql_stmt_tests/createcov_4bit_gray_jpeg.testcase
new file mode 100644
index 0000000..197043d
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_4bit_gray_jpeg.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 4-BIT GRAYSCALE JPEG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('4bit_gray_jpeg', '4-BIT', 'GRAYSCALE', 1, 'JPEG', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('4bit_gray_jpeg', '4-BIT', 'GRAYSCALE', 1, 'JPEG', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_4bit_gray_png.testcase b/test/sql_stmt_tests/createcov_4bit_gray_png.testcase
new file mode 100644
index 0000000..e819086
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_4bit_gray_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 4-BIT GRAYSCALE PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('4bit_gray_png', '4-BIT', 'GRAYSCALE', 1, 'PNG', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('4bit_gray_png', '4-BIT', 'GRAYSCALE', 1, 'PNG', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_4bit_gray_webp1.testcase b/test/sql_stmt_tests/createcov_4bit_gray_webp1.testcase
new file mode 100644
index 0000000..a7a8813
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_4bit_gray_webp1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 4-BIT GRAYSCALE LOSSY WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('4bit_gray_webp1', '4-BIT', 'GRAYSCALE', 1, 'WEBP', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('4bit_gray_webp1', '4-BIT', 'GRAYSCALE', 1, 'WEBP', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_4bit_gray_webp2.testcase b/test/sql_stmt_tests/createcov_4bit_gray_webp2.testcase
new file mode 100644
index 0000000..4edb57c
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_4bit_gray_webp2.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 4-BIT GRAYSCALE LOSSLESS WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('4bit_gray_webp2', '4-BIT', 'GRAYSCALE', 1, 'LL_WEBP', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('4bit_gray_webp2', '4-BIT', 'GRAYSCALE', 1, 'LL_WEBP', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_4bit_palette.testcase b/test/sql_stmt_tests/createcov_4bit_palette.testcase
new file mode 100644
index 0000000..bc531d8
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_4bit_palette.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 4-BIT PALETTE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('4bit_palette', '4-BIT', 'PALETTE', 1, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('4bit_palette', '4-BIT', 'PALETTE', 1, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_4bit_palette1.testcase b/test/sql_stmt_tests/createcov_4bit_palette1.testcase
new file mode 100644
index 0000000..940d172
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_4bit_palette1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 4-BIT PALETTE invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('4bit_palette1', '4-BIT', 'PALETTE', 2, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('4bit_palette1', '4-BIT', 'PALETTE', 2, 'NONE', 100, 256, 256, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_4bit_palette_gif.testcase b/test/sql_stmt_tests/createcov_4bit_palette_gif.testcase
new file mode 100644
index 0000000..36038b3
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_4bit_palette_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 4-BIT PALETTE GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('4bit_palette_gif', '4-BIT', 'PALETTE', 1, 'GIF', 100, 256, 256, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('4bit_palette_gif', '4-BIT', 'PALETTE', 1, 'GIF', 100, 256, 256, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_4bit_palette_png.testcase b/test/sql_stmt_tests/createcov_4bit_palette_png.testcase
new file mode 100644
index 0000000..d8bd5f1
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_4bit_palette_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - 4-BIT PALETTE PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('4bit_palette_png', '4-BIT', 'PALETTE', 1, 'PNG', 100, 256, 256, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('4bit_palette_png', '4-BIT', 'PALETTE', 1, 'PNG', 100, 256, 256, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_8_mband.testcase b/test/sql_stmt_tests/createcov_8_mband.testcase
new file mode 100644
index 0000000..648368d
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_8_mband.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 MULTIBAND
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_multiband', 'UINT8', 'MULTIBAND', 4, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_multiband', 'UINT8', 'MULTIBAND', 4, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_8_mband1.testcase b/test/sql_stmt_tests/createcov_8_mband1.testcase
new file mode 100644
index 0000000..e21654b
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_8_mband1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 MULTIBAND invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_multiband1', 'UINT8', 'MULTIBAND', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_multiband1', 'UINT8', 'MULTIBAND', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_8_mband_deflate.testcase b/test/sql_stmt_tests/createcov_8_mband_deflate.testcase
new file mode 100644
index 0000000..8ff4135
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_8_mband_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 MULTIBAND DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_multiband_deflate', 'UINT8', 'MULTIBAND', 4, 'DEFLATE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_multiband_deflate', 'UINT8', 'MULTIBAND', 4, 'DEFLATE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_8_mband_fax3.testcase b/test/sql_stmt_tests/createcov_8_mband_fax3.testcase
new file mode 100644
index 0000000..93a1cc5
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_8_mband_fax3.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 MULTIBAND FAX3
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_multiband_fax3', 'UINT8', 'MULTIBAND', 4, 'FAX3', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_multiband_fax3', 'UINT8', 'MULTIBAND', 4, 'FAX3', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_8_mband_fax4.testcase b/test/sql_stmt_tests/createcov_8_mband_fax4.testcase
new file mode 100644
index 0000000..3423780
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_8_mband_fax4.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 MULTIBAND FAX4
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_multiband_fax4', 'UINT8', 'MULTIBAND', 4, 'FAX4', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_multiband_fax4', 'UINT8', 'MULTIBAND', 4, 'FAX4', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_8_mband_gif.testcase b/test/sql_stmt_tests/createcov_8_mband_gif.testcase
new file mode 100644
index 0000000..771a95d
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_8_mband_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 MULTIBAND GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_multiband_gif', 'UINT8', 'MULTIBAND', 4, 'GIF', -100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_multiband_gif', 'UINT8', 'MULTIBAND', 4, 'GIF', -100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_8_mband_jpeg.testcase b/test/sql_stmt_tests/createcov_8_mband_jpeg.testcase
new file mode 100644
index 0000000..c921b4d
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_8_mband_jpeg.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 MULTIBAND JPEG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_multiband_jpeg', 'UINT8', 'MULTIBAND', 4, 'JPEG', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_multiband_jpeg', 'UINT8', 'MULTIBAND', 4, 'JPEG', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_8_mband_lzma.testcase b/test/sql_stmt_tests/createcov_8_mband_lzma.testcase
new file mode 100644
index 0000000..aea4983
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_8_mband_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 MULTIBAND LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_multiband_lzma', 'UINT8', 'MULTIBAND', 4, 'LZMA', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_multiband_lzma', 'UINT8', 'MULTIBAND', 4, 'LZMA', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_8_mband_png.testcase b/test/sql_stmt_tests/createcov_8_mband_png.testcase
new file mode 100644
index 0000000..3b61c5b
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_8_mband_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 MULTIBAND PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_multiband_png', 'UINT8', 'MULTIBAND', 4, 'PNG', 1000, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_multiband_png', 'UINT8', 'MULTIBAND', 4, 'PNG', 1000, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_8_mband_webp1.testcase b/test/sql_stmt_tests/createcov_8_mband_webp1.testcase
new file mode 100644
index 0000000..fed6700
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_8_mband_webp1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 MULTIBAND LOSSY WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_multiband_webp1', 'UINT8', 'MULTIBAND', 4, 'WEBP', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_multiband_webp1', 'UINT8', 'MULTIBAND', 4, 'WEBP', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_8_mband_webp2.testcase b/test/sql_stmt_tests/createcov_8_mband_webp2.testcase
new file mode 100644
index 0000000..f019c84
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_8_mband_webp2.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 MULTIBAND LOSSLESS WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_multiband_webp2', 'UINT8', 'MULTIBAND', 4, 'LL_WEBP', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_multiband_webp2', 'UINT8', 'MULTIBAND', 4, 'LL_WEBP', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_double_grid.testcase b/test/sql_stmt_tests/createcov_double_grid.testcase
new file mode 100644
index 0000000..66b8b65
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_double_grid.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - DOUBLE GRID
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('double_grid', 'DOUBLE', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('double_grid', 'DOUBLE', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_double_grid1.testcase b/test/sql_stmt_tests/createcov_double_grid1.testcase
new file mode 100644
index 0000000..29c8eb0
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_double_grid1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - DOUBLE GRID invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('double_grid1', 'DOUBLE', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('double_grid1', 'DOUBLE', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_double_grid_deflate.testcase b/test/sql_stmt_tests/createcov_double_grid_deflate.testcase
new file mode 100644
index 0000000..185e466
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_double_grid_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - DOUBLE GRID DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('double_grid_deflate', 'DOUBLE', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('double_grid_deflate', 'DOUBLE', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_double_grid_lzma.testcase b/test/sql_stmt_tests/createcov_double_grid_lzma.testcase
new file mode 100644
index 0000000..0b83e10
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_double_grid_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - DOUBLE GRID LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('double_grid_lzma', 'DOUBLE', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('double_grid_lzma', 'DOUBLE', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_err1.testcase b/test/sql_stmt_tests/createcov_err1.testcase
new file mode 100644
index 0000000..0c6f87b
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NULL name
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage(NULL, 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage(NULL, 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+-1
diff --git a/test/sql_stmt_tests/createcov_err10.testcase b/test/sql_stmt_tests/createcov_err10.testcase
new file mode 100644
index 0000000..e67e461
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err10.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NULL horz-resolution
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, NULL, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, NULL, 1.0, NULL)
+-1
diff --git a/test/sql_stmt_tests/createcov_err11.testcase b/test/sql_stmt_tests/createcov_err11.testcase
new file mode 100644
index 0000000..d51b109
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err11.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NULL vert-resolution
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0, NULL, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0, NULL, NULL)
+-1
diff --git a/test/sql_stmt_tests/createcov_err12.testcase b/test/sql_stmt_tests/createcov_err12.testcase
new file mode 100644
index 0000000..866e4b9
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err12.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - TEXT no-data
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, 'nodata');
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, 'nodata')
+-1
diff --git a/test/sql_stmt_tests/createcov_err2.testcase b/test/sql_stmt_tests/createcov_err2.testcase
new file mode 100644
index 0000000..daf64b7
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err2.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NULL sample
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('invalid', NULL, 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('invalid', NULL, 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+-1
diff --git a/test/sql_stmt_tests/createcov_err3.testcase b/test/sql_stmt_tests/createcov_err3.testcase
new file mode 100644
index 0000000..4009c4e
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err3.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NULL pixel
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('invalid', 'UINT8', NULL, 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('invalid', 'UINT8', NULL, 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+-1
diff --git a/test/sql_stmt_tests/createcov_err4.testcase b/test/sql_stmt_tests/createcov_err4.testcase
new file mode 100644
index 0000000..9720a81
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err4.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NULL Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', NULL, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', NULL, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+-1
diff --git a/test/sql_stmt_tests/createcov_err5.testcase b/test/sql_stmt_tests/createcov_err5.testcase
new file mode 100644
index 0000000..a1f00c9
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err5.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NULL compression
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, NULL, 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, NULL, 100, 512, 512, 3003, 1.0, 1.0, NULL)
+-1
diff --git a/test/sql_stmt_tests/createcov_err6.testcase b/test/sql_stmt_tests/createcov_err6.testcase
new file mode 100644
index 0000000..6d97ccc
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err6.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NULL quality
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', NULL, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', NULL, 512, 512, 3003, 1.0, 1.0, NULL)
+-1
diff --git a/test/sql_stmt_tests/createcov_err7.testcase b/test/sql_stmt_tests/createcov_err7.testcase
new file mode 100644
index 0000000..b61ed91
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err7.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NULL tile width
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, NULL, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, NULL, 512, 3003, 1.0, 1.0, NULL)
+-1
diff --git a/test/sql_stmt_tests/createcov_err8.testcase b/test/sql_stmt_tests/createcov_err8.testcase
new file mode 100644
index 0000000..118288a
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err8.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NULL tile height
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, NULL, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, NULL, 3003, 1.0, 1.0, NULL)
+-1
diff --git a/test/sql_stmt_tests/createcov_err9.testcase b/test/sql_stmt_tests/createcov_err9.testcase
new file mode 100644
index 0000000..38acc7b
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_err9.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NULL SRID
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, NULL, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('invalid', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, NULL, 1.0, 1.0, NULL)
+-1
diff --git a/test/sql_stmt_tests/createcov_float_grid.testcase b/test/sql_stmt_tests/createcov_float_grid.testcase
new file mode 100644
index 0000000..065db46
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_float_grid.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - FLOAT GRID
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('float_grid', 'FLOAT', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('float_grid', 'FLOAT', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_float_grid1.testcase b/test/sql_stmt_tests/createcov_float_grid1.testcase
new file mode 100644
index 0000000..7bf1581
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_float_grid1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - FLOAT GRID invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('float_grid1', 'FLOAT', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('float_grid1', 'FLOAT', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_float_grid_deflate.testcase b/test/sql_stmt_tests/createcov_float_grid_deflate.testcase
new file mode 100644
index 0000000..0cffdfc
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_float_grid_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - FLOAT GRID DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('float_grid_deflate', 'FLOAT', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('float_grid_deflate', 'FLOAT', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_float_grid_lzma.testcase b/test/sql_stmt_tests/createcov_float_grid_lzma.testcase
new file mode 100644
index 0000000..4231e76
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_float_grid_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - FLOAT GRID LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('float_grid_lzma', 'FLOAT', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('float_grid_lzma', 'FLOAT', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_int16_grid.testcase b/test/sql_stmt_tests/createcov_int16_grid.testcase
new file mode 100644
index 0000000..3526cda
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int16_grid.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT16 GRID
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int16_grid1', 'INT16', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int16_grid1', 'INT16', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_int16_grid1.testcase b/test/sql_stmt_tests/createcov_int16_grid1.testcase
new file mode 100644
index 0000000..73a4161
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int16_grid1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT16 GRID invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int16_grid1', 'INT16', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int16_grid1', 'INT16', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_int16_grid_deflate.testcase b/test/sql_stmt_tests/createcov_int16_grid_deflate.testcase
new file mode 100644
index 0000000..a1c5b5f
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int16_grid_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT16 GRID DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int16_grid_deflate', 'INT16', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int16_grid_deflate', 'INT16', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_int16_grid_lzma.testcase b/test/sql_stmt_tests/createcov_int16_grid_lzma.testcase
new file mode 100644
index 0000000..9f23adf
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int16_grid_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT16 GRID LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int16_grid_lzma', 'INT16', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int16_grid_lzma', 'INT16', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_int32_grid.testcase b/test/sql_stmt_tests/createcov_int32_grid.testcase
new file mode 100644
index 0000000..b48bde1
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int32_grid.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT32 GRID
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int32_grid', 'INT32', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int32_grid', 'INT32', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_int32_grid1.testcase b/test/sql_stmt_tests/createcov_int32_grid1.testcase
new file mode 100644
index 0000000..4a4c86c
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int32_grid1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT32 GRID invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int32_grid', 'INT32', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int32_grid', 'INT32', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_int32_grid_deflate.testcase b/test/sql_stmt_tests/createcov_int32_grid_deflate.testcase
new file mode 100644
index 0000000..b04ccf4
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int32_grid_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT32 GRID DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int32_grid_deflate', 'INT32', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int32_grid_deflate', 'INT32', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_int32_grid_gif.testcase b/test/sql_stmt_tests/createcov_int32_grid_gif.testcase
new file mode 100644
index 0000000..69f6547
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int32_grid_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT32 GRID GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int32_grid_gif', 'INT32', 'DATAGRID', 1, 'GIF', 100, 512, 512, 3003, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int32_grid_gif', 'INT32', 'DATAGRID', 1, 'GIF', 100, 512, 512, 3003, 1)
+0
diff --git a/test/sql_stmt_tests/createcov_int32_grid_jpeg.testcase b/test/sql_stmt_tests/createcov_int32_grid_jpeg.testcase
new file mode 100644
index 0000000..72c4f37
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int32_grid_jpeg.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT32 GRID JPEG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int32_grid_jpeg', 'INT32', 'DATAGRID', 1, 'JPEG', 100, 512, 512, 3003, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int32_grid_jpeg', 'INT32', 'DATAGRID', 1, 'JPEG', 100, 512, 512, 3003, 1)
+0
diff --git a/test/sql_stmt_tests/createcov_int32_grid_lzma.testcase b/test/sql_stmt_tests/createcov_int32_grid_lzma.testcase
new file mode 100644
index 0000000..f99861c
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int32_grid_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT32 GRID LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int32_grid_lzma', 'INT32', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int32_grid_lzma', 'INT32', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_int32_grid_png.testcase b/test/sql_stmt_tests/createcov_int32_grid_png.testcase
new file mode 100644
index 0000000..b2ed85e
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int32_grid_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT32 GRID PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int32_grid_png', 'INT32', 'DATAGRID', 1, 'PNG', 100, 512, 512, 3003, 1.0, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int32_grid_png', 'INT32', 'DATAGRID', 1, 'PNG', 100, 512, 512, 3003, 1.0, 1)
+0
diff --git a/test/sql_stmt_tests/createcov_int32_grid_webp1.testcase b/test/sql_stmt_tests/createcov_int32_grid_webp1.testcase
new file mode 100644
index 0000000..3a46d85
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int32_grid_webp1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT32 GRID LOSSY WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int32_grid_webp1', 'INT32', 'DATAGRID', 1, 'WEBP', 100, 512, 512, 3003, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int32_grid_webp1', 'INT32', 'DATAGRID', 1, 'WEBP', 100, 512, 512, 3003, 1)
+0
diff --git a/test/sql_stmt_tests/createcov_int32_grid_webp2.testcase b/test/sql_stmt_tests/createcov_int32_grid_webp2.testcase
new file mode 100644
index 0000000..08550c0
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int32_grid_webp2.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT32 GRID LOSSLESS WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int32_grid_webp2', 'INT32', 'DATAGRID', 1, 'LL_WEBP', 100, 512, 512, 3003, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int32_grid_webp2', 'INT32', 'DATAGRID', 1, 'LL_WEBP', 100, 512, 512, 3003, 1)
+0
diff --git a/test/sql_stmt_tests/createcov_int8_grid.testcase b/test/sql_stmt_tests/createcov_int8_grid.testcase
new file mode 100644
index 0000000..14576c7
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int8_grid.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT8 GRID
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int8_grid', 'INT8', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int8_grid', 'INT8', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_int8_grid1.testcase b/test/sql_stmt_tests/createcov_int8_grid1.testcase
new file mode 100644
index 0000000..705fb95
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int8_grid1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT8 GRID invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int8_grid1', 'INT8', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int8_grid1', 'INT8', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_int8_grid_deflate.testcase b/test/sql_stmt_tests/createcov_int8_grid_deflate.testcase
new file mode 100644
index 0000000..816dc43
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int8_grid_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - INT8 GRID DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int8_grid_deflate', 'INT8', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int8_grid_deflate', 'INT8', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_int8_grid_lzma.testcase b/test/sql_stmt_tests/createcov_int8_grid_lzma.testcase
new file mode 100644
index 0000000..ef04a01
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_int8_grid_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - NIT8 GRID LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('int8_grid_lzma', 'INT8', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('int8_grid_lzma', 'INT8', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint16_grid.testcase b/test/sql_stmt_tests/createcov_uint16_grid.testcase
new file mode 100644
index 0000000..4a28427
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint16_grid.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 GRID
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_grid', 'UINT16', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_grid', 'UINT16', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint16_grid1.testcase b/test/sql_stmt_tests/createcov_uint16_grid1.testcase
new file mode 100644
index 0000000..8a1d5ba
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint16_grid1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 GRID invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_grid1', 'UINT16', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_grid1', 'UINT16', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_uint16_grid_deflate.testcase b/test/sql_stmt_tests/createcov_uint16_grid_deflate.testcase
new file mode 100644
index 0000000..17f1fdc
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint16_grid_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT16 GRID DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_grid_deflate', 'UINT16', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_grid_deflate', 'UINT16', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint16_grid_lzma.testcase b/test/sql_stmt_tests/createcov_uint16_grid_lzma.testcase
new file mode 100644
index 0000000..668d8f2
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint16_grid_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UNIT16 GRID LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint16_grid_lzma', 'UINT16', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint16_grid_lzma', 'UINT16', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint32_grid.testcase b/test/sql_stmt_tests/createcov_uint32_grid.testcase
new file mode 100644
index 0000000..4fcc4fe
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint32_grid.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT32 GRID
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint32_grid', 'UINT32', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint32_grid', 'UINT32', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint32_grid1.testcase b/test/sql_stmt_tests/createcov_uint32_grid1.testcase
new file mode 100644
index 0000000..29f79a7
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint32_grid1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT32 GRID invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint32_grid1', 'UINT32', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint32_grid1', 'UINT32', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_uint32_grid_deflate.testcase b/test/sql_stmt_tests/createcov_uint32_grid_deflate.testcase
new file mode 100644
index 0000000..00634cd
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint32_grid_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT32 GRID DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint32_grid_deflate', 'UINT32', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint32_grid_deflate', 'UINT32', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint32_grid_lzma.testcase b/test/sql_stmt_tests/createcov_uint32_grid_lzma.testcase
new file mode 100644
index 0000000..692a7b4
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint32_grid_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UNIT32 GRID LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint32_grid_lzma', 'UINT32', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint32_grid_lzma', 'UINT32', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_gray.testcase b/test/sql_stmt_tests/createcov_uint8_gray.testcase
new file mode 100644
index 0000000..ac5a026
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_gray.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRAYSCALE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_gray', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_gray', 'UINT8', 'GRAYSCALE', 1, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_gray_deflate.testcase b/test/sql_stmt_tests/createcov_uint8_gray_deflate.testcase
new file mode 100644
index 0000000..0a6cb5f
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_gray_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRAYSCALE DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_gray_deflate', 'UINT8', 'GRAYSCALE', 1, 'DEFLATE', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_gray_deflate', 'UINT8', 'GRAYSCALE', 1, 'DEFLATE', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_gray_fax3.testcase b/test/sql_stmt_tests/createcov_uint8_gray_fax3.testcase
new file mode 100644
index 0000000..fc2b656
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_gray_fax3.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRAYSCALE FAX3
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_gray_fax3', 'UINT8', 'GRAYSCALE', 1, 'FAX3', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_gray_fax3', 'UINT8', 'GRAYSCALE', 1, 'FAX3', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_gray_fax4.testcase b/test/sql_stmt_tests/createcov_uint8_gray_fax4.testcase
new file mode 100644
index 0000000..b1e1993
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_gray_fax4.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRAYSCALE FAX4
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_gray_fax4', 'UINT8', 'GRAYSCALE', 1, 'FAX4', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_gray_fax4', 'UINT8', 'GRAYSCALE', 1, 'FAX4', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_gray_gif.testcase b/test/sql_stmt_tests/createcov_uint8_gray_gif.testcase
new file mode 100644
index 0000000..2620282
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_gray_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRAYSCALE GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_gray_gif', 'UINT8', 'GRAYSCALE', 1, 'GIF', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_gray_gif', 'UINT8', 'GRAYSCALE', 1, 'GIF', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_gray_jpeg.testcase b/test/sql_stmt_tests/createcov_uint8_gray_jpeg.testcase
new file mode 100644
index 0000000..361a85f
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_gray_jpeg.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRAYSCALE JPEG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_gray_jpeg', 'UINT8', 'GRAYSCALE', 1, 'JPEG', 80, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_gray_jpeg', 'UINT8', 'GRAYSCALE', 1, 'JPEG', 80, 512, 512, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_gray_lzma.testcase b/test/sql_stmt_tests/createcov_uint8_gray_lzma.testcase
new file mode 100644
index 0000000..a8724ad
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_gray_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRAYSCALE LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_gray_lzma', 'UINT8', 'GRAYSCALE', 1, 'LZMA', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_gray_lzma', 'UINT8', 'GRAYSCALE', 1, 'LZMA', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_gray_png.testcase b/test/sql_stmt_tests/createcov_uint8_gray_png.testcase
new file mode 100644
index 0000000..82d5e4f
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_gray_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRAYSCALE PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_gray_png', 'UINT8', 'GRAYSCALE', 1, 'PNG', 80, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_gray_png', 'UINT8', 'GRAYSCALE', 1, 'PNG', 80, 512, 512, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_gray_webp1.testcase b/test/sql_stmt_tests/createcov_uint8_gray_webp1.testcase
new file mode 100644
index 0000000..d22cc29
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_gray_webp1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRAYSCALE LOSSY WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_gray_webp1', 'UINT8', 'GRAYSCALE', 1, 'WEBP', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_gray_webp1', 'UINT8', 'GRAYSCALE', 1, 'WEBP', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_gray_webp2.testcase b/test/sql_stmt_tests/createcov_uint8_gray_webp2.testcase
new file mode 100644
index 0000000..dea1883
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_gray_webp2.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRAYSCALE LOSSLESS WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_gray_webp2', 'UINT8', 'GRAYSCALE', 1, 'LL_WEBP', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_gray_webp2', 'UINT8', 'GRAYSCALE', 1, 'LL_WEBP', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_grid.testcase b/test/sql_stmt_tests/createcov_uint8_grid.testcase
new file mode 100644
index 0000000..ebbe6c4
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_grid.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRID
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_grid', 'UINT8', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_grid', 'UINT8', 'DATAGRID', 1, 'NONE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_grid1.testcase b/test/sql_stmt_tests/createcov_uint8_grid1.testcase
new file mode 100644
index 0000000..2c11263
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_grid1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRID invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_grid1', 'UINT8', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_grid1', 'UINT8', 'DATAGRID', 2, 'NONE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_grid_deflate.testcase b/test/sql_stmt_tests/createcov_uint8_grid_deflate.testcase
new file mode 100644
index 0000000..7cb28d9
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_grid_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 GRID DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_grid_deflate', 'UINT8', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_grid_deflate', 'UINT8', 'DATAGRID', 1, 'DEFLATE', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_grid_lzma.testcase b/test/sql_stmt_tests/createcov_uint8_grid_lzma.testcase
new file mode 100644
index 0000000..fdd46cf
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_grid_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UNIT8 GRID LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_grid_lzma', 'UINT8', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_grid_lzma', 'UINT8', 'DATAGRID', 1, 'LZMA', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_palette.testcase b/test/sql_stmt_tests/createcov_uint8_palette.testcase
new file mode 100644
index 0000000..fba09d4
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_palette.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 PALETTE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_palette', 'UINT8', 'PALETTE', 1, 'NONE', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_palette', 'UINT8', 'PALETTE', 1, 'NONE', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_palette_deflate.testcase b/test/sql_stmt_tests/createcov_uint8_palette_deflate.testcase
new file mode 100644
index 0000000..d861cae
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_palette_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 PALETTE DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_palette_deflate', 'UINT8', 'PALETTE', 1, 'DEFLATE', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_palette_deflate', 'UINT8', 'PALETTE', 1, 'DEFLATE', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_palette_fax3.testcase b/test/sql_stmt_tests/createcov_uint8_palette_fax3.testcase
new file mode 100644
index 0000000..d79ec58
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_palette_fax3.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 PALETTE FAX3
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_palette_fax3', 'UINT8', 'PALETTE', 1, 'FAX3', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_palette_fax3', 'UINT8', 'PALETTE', 1, 'FAX3', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_palette_fax4.testcase b/test/sql_stmt_tests/createcov_uint8_palette_fax4.testcase
new file mode 100644
index 0000000..4584815
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_palette_fax4.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 PALETTE FAX3
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_palette_fax4', 'UINT8', 'PALETTE', 1, 'FAX4', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_palette_fax4', 'UINT8', 'PALETTE', 1, 'FAX4', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_palette_gif.testcase b/test/sql_stmt_tests/createcov_uint8_palette_gif.testcase
new file mode 100644
index 0000000..97f6d14
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_palette_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 PALETTE GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_palette_gif', 'UINT8', 'PALETTE', 1, 'GIF', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_palette_gif', 'UINT8', 'PALETTE', 1, 'GIF', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_palette_jpeg.testcase b/test/sql_stmt_tests/createcov_uint8_palette_jpeg.testcase
new file mode 100644
index 0000000..1392be2
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_palette_jpeg.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 PALETTE JPEG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_palette_jpeg', 'UINT8', 'PALETTE', 1, 'JPEG', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_palette_jpeg', 'UINT8', 'PALETTE', 1, 'JPEG', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_palette_lzma.testcase b/test/sql_stmt_tests/createcov_uint8_palette_lzma.testcase
new file mode 100644
index 0000000..a0fbcf8
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_palette_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 PALETTE LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_palette_lzma', 'UINT8', 'PALETTE', 1, 'LZMA', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_palette_lzma', 'UINT8', 'PALETTE', 1, 'LZMA', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_palette_png.testcase b/test/sql_stmt_tests/createcov_uint8_palette_png.testcase
new file mode 100644
index 0000000..644e315
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_palette_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 PALETTE PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_palette_png', 'UINT8', 'PALETTE', 1, 'PNG', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_palette_png', 'UINT8', 'PALETTE', 1, 'PNG', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_palette_webp1.testcase b/test/sql_stmt_tests/createcov_uint8_palette_webp1.testcase
new file mode 100644
index 0000000..4bbc603
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_palette_webp1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 PALETTE LOSSY WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_palette_webp1', 'UINT8', 'PALETTE', 1, 'WEBP', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_palette_webp1', 'UINT8', 'PALETTE', 1, 'WEBP', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_palette_webp2.testcase b/test/sql_stmt_tests/createcov_uint8_palette_webp2.testcase
new file mode 100644
index 0000000..a44f701
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_palette_webp2.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 PALETTE LOSSLESS WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_palette_webp2', 'UINT8', 'PALETTE', 1, 'LL_WEBP', 10, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_palette_webp2', 'UINT8', 'PALETTE', 1, 'LL_WEBP', 10, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_rgb.testcase b/test/sql_stmt_tests/createcov_uint8_rgb.testcase
new file mode 100644
index 0000000..65ca69e
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_rgb.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 RGB
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_rgb1', 'UINT8', 'RGB', 3, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_rgb1', 'UINT8', 'RGB', 3, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_rgb1.testcase b/test/sql_stmt_tests/createcov_uint8_rgb1.testcase
new file mode 100644
index 0000000..343f14a
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_rgb1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 RGB invalid Bands
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_rgb1', 'UINT8', 'RGB', 2, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_rgb1', 'UINT8', 'RGB', 2, 'NONE', 100, 512, 512, 3003, 1.0, 1.0, NULL)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_rgb_deflate.testcase b/test/sql_stmt_tests/createcov_uint8_rgb_deflate.testcase
new file mode 100644
index 0000000..c62d452
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_rgb_deflate.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 RGB DEFLATE
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_rgb_deflate', 'UINT8', 'RGB', 3, 'DEFLATE', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_rgb_deflate', 'UINT8', 'RGB', 3, 'DEFLATE', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_rgb_fax3.testcase b/test/sql_stmt_tests/createcov_uint8_rgb_fax3.testcase
new file mode 100644
index 0000000..930d88b
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_rgb_fax3.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 RGB FAX3
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_rgb_fax3', 'UINT8', 'RGB', 3, 'FAX3', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_rgb_fax3', 'UINT8', 'RGB', 3, 'FAX3', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_rgb_fax4.testcase b/test/sql_stmt_tests/createcov_uint8_rgb_fax4.testcase
new file mode 100644
index 0000000..8a65eb4
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_rgb_fax4.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 RGB FAX4
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_rgb_fax4', 'UINT8', 'RGB', 3, 'FAX4', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_rgb_fax4', 'UINT8', 'RGB', 3, 'FAX4', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_rgb_gif.testcase b/test/sql_stmt_tests/createcov_uint8_rgb_gif.testcase
new file mode 100644
index 0000000..8d5d44c
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_rgb_gif.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 RGB GIF
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_rgb_gif', 'UINT8', 'RGB', 3, 'GIF', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_rgb_gif', 'UINT8', 'RGB', 3, 'GIF', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_rgb_jpeg.testcase b/test/sql_stmt_tests/createcov_uint8_rgb_jpeg.testcase
new file mode 100644
index 0000000..91554c2
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_rgb_jpeg.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 RGB JPEG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_rgb_jpeg', 'UINT8', 'RGB', 3, 'JPEG', 80, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_rgb_jpeg', 'UINT8', 'RGB', 3, 'JPEG', 80, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_rgb_lzma.testcase b/test/sql_stmt_tests/createcov_uint8_rgb_lzma.testcase
new file mode 100644
index 0000000..6bcc433
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_rgb_lzma.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 RGB LZMA
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_rgb_lzma', 'UINT8', 'RGB', 3, 'LZMA', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_rgb_lzma', 'UINT8', 'RGB', 3, 'LZMA', 100, 512, 512, 3003, 1.0)
+0
diff --git a/test/sql_stmt_tests/createcov_uint8_rgb_png.testcase b/test/sql_stmt_tests/createcov_uint8_rgb_png.testcase
new file mode 100644
index 0000000..7eb0efc
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_rgb_png.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 RGB PNG
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_rgb_png', 'UINT8', 'RGB', 3, 'PNG', 100, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_rgb_png', 'UINT8', 'RGB', 3, 'PNG', 100, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_rgb_webp1.testcase b/test/sql_stmt_tests/createcov_uint8_rgb_webp1.testcase
new file mode 100644
index 0000000..180da3e
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_rgb_webp1.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 RGB LOSSY WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_rgb_webp1', 'UINT8', 'RGB', 3, 'WEBP', 80, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_rgb_webp1', 'UINT8', 'RGB', 3, 'WEBP', 80, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createcov_uint8_rgb_webp2.testcase b/test/sql_stmt_tests/createcov_uint8_rgb_webp2.testcase
new file mode 100644
index 0000000..22db3b1
--- /dev/null
+++ b/test/sql_stmt_tests/createcov_uint8_rgb_webp2.testcase
@@ -0,0 +1,7 @@
+RL2_CreateCoverage - UINT8 RGB LOSSLESS WEBP
+:memory: #use in-memory database
+SELECT RL2_CreateCoverage('uint8_rgb_webp2', 'UINT8', 'RGB', 3, 'LL_WEBP', 80, 512, 512, 3003, 1.0);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreateCoverage('uint8_rgb_webp2', 'UINT8', 'RGB', 3, 'LL_WEBP', 80, 512, 512, 3003, 1.0)
+1
diff --git a/test/sql_stmt_tests/createpixel1.testcase b/test/sql_stmt_tests/createpixel1.testcase
new file mode 100644
index 0000000..77da5f8
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel1.testcase
@@ -0,0 +1,7 @@
+CreatePixel - NULL sample
+:memory: #use in-memory database
+SELECT RL2_CreatePixel(NULL, 'GRAYSCALE', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel(NULL, 'GRAYSCALE', 1)
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel10.testcase b/test/sql_stmt_tests/createpixel10.testcase
new file mode 100644
index 0000000..4268fce
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel10.testcase
@@ -0,0 +1,7 @@
+CreatePixel - Text bands
+:memory: #use in-memory database
+SELECT RL2_CreatePixel('UINT8', 'GRAYSCALE', 'a');
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel('UINT8', 'GRAYSCALE', 'a')
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel11.testcase b/test/sql_stmt_tests/createpixel11.testcase
new file mode 100644
index 0000000..7b86ba1
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel11.testcase
@@ -0,0 +1,7 @@
+CreatePixel - Double bands
+:memory: #use in-memory database
+SELECT RL2_CreatePixel('UINT8', 'GRAYSCALE', 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel('UINT8', 'GRAYSCALE', 1.5)
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel12.testcase b/test/sql_stmt_tests/createpixel12.testcase
new file mode 100644
index 0000000..c6a443c
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel12.testcase
@@ -0,0 +1,7 @@
+CreatePixel - BLOB bands
+:memory: #use in-memory database
+SELECT RL2_CreatePixel('UINT8', 'GRAYSCALE', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel('UINT8', 'GRAYSCALE', zeroblob(4))
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel13.testcase b/test/sql_stmt_tests/createpixel13.testcase
new file mode 100644
index 0000000..d15cfd3
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel13.testcase
@@ -0,0 +1,7 @@
+CreatePixel - invalid
+:memory: #use in-memory database
+SELECT RL2_CreatePixel('UINT8', 'GRAYSCALE', 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel('UINT8', 'GRAYSCALE', 2)
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel2.testcase b/test/sql_stmt_tests/createpixel2.testcase
new file mode 100644
index 0000000..5e718a2
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel2.testcase
@@ -0,0 +1,7 @@
+CreatePixel - INT sample
+:memory: #use in-memory database
+SELECT RL2_CreatePixel(1, 'GRAYSCALE', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel(1, 'GRAYSCALE', 1)
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel3.testcase b/test/sql_stmt_tests/createpixel3.testcase
new file mode 100644
index 0000000..57a4164
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel3.testcase
@@ -0,0 +1,7 @@
+CreatePixel - DOUBLE sample
+:memory: #use in-memory database
+SELECT RL2_CreatePixel(1.6, 'GRAYSCALE', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel(1.6, 'GRAYSCALE', 1)
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel4.testcase b/test/sql_stmt_tests/createpixel4.testcase
new file mode 100644
index 0000000..26268e7
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel4.testcase
@@ -0,0 +1,7 @@
+CreatePixel - BLOB sample
+:memory: #use in-memory database
+SELECT RL2_CreatePixel(zeroblob(4), 'GRAYSCALE', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel(zeroblob(4), 'GRAYSCALE', 1)
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel5.testcase b/test/sql_stmt_tests/createpixel5.testcase
new file mode 100644
index 0000000..7dd6134
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel5.testcase
@@ -0,0 +1,7 @@
+CreatePixel - NULL pixel type
+:memory: #use in-memory database
+SELECT RL2_CreatePixel('UINT8', NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel('UINT8', NULL, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel6.testcase b/test/sql_stmt_tests/createpixel6.testcase
new file mode 100644
index 0000000..65ba45e
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel6.testcase
@@ -0,0 +1,7 @@
+CreatePixel - Integer pixel type
+:memory: #use in-memory database
+SELECT RL2_CreatePixel('UINT8', 1, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel('UINT8', 1, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel7.testcase b/test/sql_stmt_tests/createpixel7.testcase
new file mode 100644
index 0000000..06fa471
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel7.testcase
@@ -0,0 +1,7 @@
+CreatePixel - Float pixel type
+:memory: #use in-memory database
+SELECT RL2_CreatePixel('UINT8', 1.1, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel('UINT8', 1.1, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel8.testcase b/test/sql_stmt_tests/createpixel8.testcase
new file mode 100644
index 0000000..4d0a337
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel8.testcase
@@ -0,0 +1,7 @@
+CreatePixel - BLOB pixel type
+:memory: #use in-memory database
+SELECT RL2_CreatePixel('UINT8', zeroblob(4), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel('UINT8', zeroblob(4), 1)
+(NULL)
diff --git a/test/sql_stmt_tests/createpixel9.testcase b/test/sql_stmt_tests/createpixel9.testcase
new file mode 100644
index 0000000..a0470b3
--- /dev/null
+++ b/test/sql_stmt_tests/createpixel9.testcase
@@ -0,0 +1,7 @@
+CreatePixel - NULL bands
+:memory: #use in-memory database
+SELECT RL2_CreatePixel('UINT8', 'GRAYSCALE', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_CreatePixel('UINT8', 'GRAYSCALE', NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/deletesection1.testcase b/test/sql_stmt_tests/deletesection1.testcase
new file mode 100644
index 0000000..7f3f873
--- /dev/null
+++ b/test/sql_stmt_tests/deletesection1.testcase
@@ -0,0 +1,7 @@
+DeleteSection - NULL coverage
+:memory: #use in-memory database
+SELECT RL2_DeleteSection(NULL, 'alpha');
+1 # rows (not including the header row)
+1 # columns
+RL2_DeleteSection(NULL, 'alpha')
+-1
diff --git a/test/sql_stmt_tests/deletesection2.testcase b/test/sql_stmt_tests/deletesection2.testcase
new file mode 100644
index 0000000..aac90ed
--- /dev/null
+++ b/test/sql_stmt_tests/deletesection2.testcase
@@ -0,0 +1,7 @@
+DeleteSection - NULL section
+:memory: #use in-memory database
+SELECT RL2_DeleteSection('alpha', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_DeleteSection('alpha', NULL)
+-1
diff --git a/test/sql_stmt_tests/deletesection3.testcase b/test/sql_stmt_tests/deletesection3.testcase
new file mode 100644
index 0000000..ee6d115
--- /dev/null
+++ b/test/sql_stmt_tests/deletesection3.testcase
@@ -0,0 +1,7 @@
+DeleteSection - NULL transaction
+:memory: #use in-memory database
+SELECT RL2_DeleteSection('alpha', 'beta', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_DeleteSection('alpha', 'beta', NULL)
+-1
diff --git a/test/sql_stmt_tests/deletesection4.testcase b/test/sql_stmt_tests/deletesection4.testcase
new file mode 100644
index 0000000..817e0ed
--- /dev/null
+++ b/test/sql_stmt_tests/deletesection4.testcase
@@ -0,0 +1,7 @@
+DeleteSection - not existing
+:memory: #use in-memory database
+SELECT RL2_DeleteSection('alpha', 'beta', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_DeleteSection('alpha', 'beta', 1)
+0
diff --git a/test/sql_stmt_tests/depyramidize1.testcase b/test/sql_stmt_tests/depyramidize1.testcase
new file mode 100644
index 0000000..cd41c62
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize1.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - NULL Coverage
+:memory: #use in-memory database
+SELECT rl2_depyramidize(NULL);
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize(NULL)
+-1
diff --git a/test/sql_stmt_tests/depyramidize10.testcase b/test/sql_stmt_tests/depyramidize10.testcase
new file mode 100644
index 0000000..e05c9a1
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize10.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - BLOB Transaction
+:memory: #use in-memory database
+SELECT rl2_depyramidize('coverage', 'section', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize('coverage', 'section', zeroblob(4))
+-1
diff --git a/test/sql_stmt_tests/depyramidize11.testcase b/test/sql_stmt_tests/depyramidize11.testcase
new file mode 100644
index 0000000..b550970
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize11.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - DOUBLE Transaction
+:memory: #use in-memory database
+SELECT rl2_depyramidize('coverage', 'section', 1.1);
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize('coverage', 'section', 1.1)
+-1
diff --git a/test/sql_stmt_tests/depyramidize12.testcase b/test/sql_stmt_tests/depyramidize12.testcase
new file mode 100644
index 0000000..9971ed7
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize12.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - TEXT Transaction
+:memory: #use in-memory database
+SELECT rl2_depyramidize('coverage', 'section', 'no');
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize('coverage', 'section', 'no')
+-1
diff --git a/test/sql_stmt_tests/depyramidize2.testcase b/test/sql_stmt_tests/depyramidize2.testcase
new file mode 100644
index 0000000..2afcf91
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize2.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - BLOB Coverage
+:memory: #use in-memory database
+SELECT rl2_depyramidize(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize(zeroblob(4))
+-1
diff --git a/test/sql_stmt_tests/depyramidize3.testcase b/test/sql_stmt_tests/depyramidize3.testcase
new file mode 100644
index 0000000..c1b9bac
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize3.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - INT Coverage
+:memory: #use in-memory database
+SELECT rl2_depyramidize(1);
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize(1)
+-1
diff --git a/test/sql_stmt_tests/depyramidize4.testcase b/test/sql_stmt_tests/depyramidize4.testcase
new file mode 100644
index 0000000..6a5ec99
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize4.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - DOUBLE Coverage
+:memory: #use in-memory database
+SELECT rl2_depyramidize(1.1);
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize(1.1)
+-1
diff --git a/test/sql_stmt_tests/depyramidize5.testcase b/test/sql_stmt_tests/depyramidize5.testcase
new file mode 100644
index 0000000..f2d9b38
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize5.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - NULL Section
+:memory: #use in-memory database
+SELECT rl2_depyramidize('coverage', NULL);
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize('coverage', NULL)
+0
diff --git a/test/sql_stmt_tests/depyramidize6.testcase b/test/sql_stmt_tests/depyramidize6.testcase
new file mode 100644
index 0000000..9f14629
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize6.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - INT Section
+:memory: #use in-memory database
+SELECT rl2_depyramidize('coverage', 1);
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize('coverage', 1)
+-1
diff --git a/test/sql_stmt_tests/depyramidize7.testcase b/test/sql_stmt_tests/depyramidize7.testcase
new file mode 100644
index 0000000..260cbb3
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize7.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - DOUBLE Section
+:memory: #use in-memory database
+SELECT rl2_depyramidize('coverage', 1.1);
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize('coverage', 1.1)
+-1
diff --git a/test/sql_stmt_tests/depyramidize8.testcase b/test/sql_stmt_tests/depyramidize8.testcase
new file mode 100644
index 0000000..145426a
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize8.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - BLOB Section
+:memory: #use in-memory database
+SELECT rl2_depyramidize('coverage', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize('coverage', zeroblob(4))
+-1
diff --git a/test/sql_stmt_tests/depyramidize9.testcase b/test/sql_stmt_tests/depyramidize9.testcase
new file mode 100644
index 0000000..35e227a
--- /dev/null
+++ b/test/sql_stmt_tests/depyramidize9.testcase
@@ -0,0 +1,7 @@
+rl2_depyramidize - NULL Transaction
+:memory: #use in-memory database
+SELECT rl2_depyramidize('coverage', 'section', NULL);
+1 # rows (not including the header row)
+1 # columns
+rl2_depyramidize('coverage', 'section', NULL)
+-1
diff --git a/test/sql_stmt_tests/dropcoverage1.testcase b/test/sql_stmt_tests/dropcoverage1.testcase
new file mode 100644
index 0000000..8219ae5
--- /dev/null
+++ b/test/sql_stmt_tests/dropcoverage1.testcase
@@ -0,0 +1,7 @@
+DropCoverage - NULL coverage
+:memory: #use in-memory database
+SELECT RL2_DropCoverage(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_DropCoverage(NULL)
+-1
diff --git a/test/sql_stmt_tests/dropcoverage2.testcase b/test/sql_stmt_tests/dropcoverage2.testcase
new file mode 100644
index 0000000..8a0f88d
--- /dev/null
+++ b/test/sql_stmt_tests/dropcoverage2.testcase
@@ -0,0 +1,7 @@
+DropCoverage - NULL transaction
+:memory: #use in-memory database
+SELECT RL2_DropCoverage('alpha', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_DropCoverage('alpha', NULL)
+-1
diff --git a/test/sql_stmt_tests/dropcoverage3.testcase b/test/sql_stmt_tests/dropcoverage3.testcase
new file mode 100644
index 0000000..188e5a7
--- /dev/null
+++ b/test/sql_stmt_tests/dropcoverage3.testcase
@@ -0,0 +1,7 @@
+DropCoverage - not existing
+:memory: #use in-memory database
+SELECT RL2_DropCoverage('alpha', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_DropCoverage('alpha', 1)
+0
diff --git a/test/sql_stmt_tests/getbandhistogram1.testcase b/test/sql_stmt_tests/getbandhistogram1.testcase
new file mode 100644
index 0000000..acd87b4
--- /dev/null
+++ b/test/sql_stmt_tests/getbandhistogram1.testcase
@@ -0,0 +1,7 @@
+GetBandHistogramFromImage - NULL BLOB image
+:memory: #use in-memory database
+SELECT RL2_GetBandHistogramFromImage(NULL, 'image/png', 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandHistogramFromImage(NULL, 'image/png', 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandhistogram2.testcase b/test/sql_stmt_tests/getbandhistogram2.testcase
new file mode 100644
index 0000000..b2bbb45
--- /dev/null
+++ b/test/sql_stmt_tests/getbandhistogram2.testcase
@@ -0,0 +1,7 @@
+GetBandHistogramFromImage - invalid BLOB image
+:memory: #use in-memory database
+SELECT RL2_GetBandHistogramFromImage(zeroblob(100), 'image/png', 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandHistogramFromImage(zeroblob(100), 'image/png', 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandhistogram3.testcase b/test/sql_stmt_tests/getbandhistogram3.testcase
new file mode 100644
index 0000000..d1b7d41
--- /dev/null
+++ b/test/sql_stmt_tests/getbandhistogram3.testcase
@@ -0,0 +1,7 @@
+GetBandHistogramFromImage - NULL mime-type
+:memory: #use in-memory database
+SELECT RL2_GetBandHistogramFromImage(zeroblob(100), NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandHistogramFromImage(zeroblob(100), NULL, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandhistogram4.testcase b/test/sql_stmt_tests/getbandhistogram4.testcase
new file mode 100644
index 0000000..7adb364
--- /dev/null
+++ b/test/sql_stmt_tests/getbandhistogram4.testcase
@@ -0,0 +1,7 @@
+GetBandHistogramFromImage - NULL band index
+:memory: #use in-memory database
+SELECT RL2_GetBandHistogramFromImage(zeroblob(100), 'image/png', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandHistogramFromImage(zeroblob(100), 'image/png', NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage1.testcase b/test/sql_stmt_tests/getbandtileimage1.testcase
new file mode 100644
index 0000000..a0c3348
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage1.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - NULL coverage
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage(NULL, 1, 0, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage(NULL, 1, 0, 1, 2)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage10.testcase b/test/sql_stmt_tests/getbandtileimage10.testcase
new file mode 100644
index 0000000..4a8afe7
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage10.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - invalid red-band
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage('alpha', 1, -1, 1, 2, '#ffffff', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage('alpha', 1, -1, 1, 2, '#ffffff', 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage11.testcase b/test/sql_stmt_tests/getbandtileimage11.testcase
new file mode 100644
index 0000000..6c943ed
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage11.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - invalid green-band
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage('alpha', 1, 0, -1, 2, '#ffffff', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage('alpha', 1, 0, -1, 2, '#ffffff', 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage12.testcase b/test/sql_stmt_tests/getbandtileimage12.testcase
new file mode 100644
index 0000000..7c519eb
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage12.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - invalid blue-band
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage('alpha', 1, 0, 1, 256, '#ffffff', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage('alpha', 1, 0, 1, 256, '#ffffff', 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage2.testcase b/test/sql_stmt_tests/getbandtileimage2.testcase
new file mode 100644
index 0000000..3de0558
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage2.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - NULL tile-id
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage('alpha', NULL, 0, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage('alpha', NULL, 0, 1, 2)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage3.testcase b/test/sql_stmt_tests/getbandtileimage3.testcase
new file mode 100644
index 0000000..7e8326b
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage3.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - NULL red-band
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage('alpha', 1, NULL, 1, 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage('alpha', 1, NULL, 1, 2)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage4.testcase b/test/sql_stmt_tests/getbandtileimage4.testcase
new file mode 100644
index 0000000..eefb65d
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage4.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - NULL green-band
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage('alpha', 1, 0, NULL, 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage('alpha', 1, 0, NULL, 2)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage5.testcase b/test/sql_stmt_tests/getbandtileimage5.testcase
new file mode 100644
index 0000000..9263598
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage5.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - NULL blue-band
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage('alpha', 1, 0, 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage('alpha', 1, 0, 1, NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage6.testcase b/test/sql_stmt_tests/getbandtileimage6.testcase
new file mode 100644
index 0000000..c1f293b
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage6.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - NULL background color
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage('alpha', 1, 0, 1, 2, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage('alpha', 1, 0, 1, 2, NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage7.testcase b/test/sql_stmt_tests/getbandtileimage7.testcase
new file mode 100644
index 0000000..23f82e1
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage7.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - not existing coverage
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage('alpha', 1, 0, 1, 2, '#ffffff');
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage('alpha', 1, 0, 1, 2, '#ffffff')
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage8.testcase b/test/sql_stmt_tests/getbandtileimage8.testcase
new file mode 100644
index 0000000..6cbfa72
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage8.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - invalid background color
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage('alpha', 1, 0, 1, 2, 'blue');
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage('alpha', 1, 0, 1, 2, 'blue')
+(NULL)
diff --git a/test/sql_stmt_tests/getbandtileimage9.testcase b/test/sql_stmt_tests/getbandtileimage9.testcase
new file mode 100644
index 0000000..9ee8ea3
--- /dev/null
+++ b/test/sql_stmt_tests/getbandtileimage9.testcase
@@ -0,0 +1,7 @@
+RL2_GetTripleBandTileImage - NULL transparent
+:memory: #use in-memory database
+SELECT RL2_GetTripleBandTileImage('alpha', 1, 0, 1, 2, '#ffffff', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTripleBandTileImage('alpha', 1, 0, 1, 2, '#ffffff', NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage1.testcase b/test/sql_stmt_tests/getmapimage1.testcase
new file mode 100644
index 0000000..e74a87c
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage1.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - NULL coverage
+:memory: #use in-memory database
+SELECT RL2_GetMapImage(NULL, BuildMbr(1, 1, 10, 10), 640, 480);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage(NULL, BuildMbr(1, 1, 10, 10), 640, 480)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage10.testcase b/test/sql_stmt_tests/getmapimage10.testcase
new file mode 100644
index 0000000..06f769a
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage10.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - Invalid BLOB geometry
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', zeroblob(100), 640, 480, 'default', 'image/png', '#ffffff', 1, 100, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', zeroblob(100), 640, 480, 'default', 'image/png', '#ffffff', 1, 100, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage12.testcase b/test/sql_stmt_tests/getmapimage12.testcase
new file mode 100644
index 0000000..982f0ae
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage12.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - Invalid width (too small)
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 6, 480, 'default', 'image/png', '#ffffff', 1, 100, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 6, 480, 'default', 'image/png', '#ffffff', 1, 100, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage13.testcase b/test/sql_stmt_tests/getmapimage13.testcase
new file mode 100644
index 0000000..d423d97
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage13.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - Invalid width (too big)
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 6666, 480, 'default', 'image/png', '#ffffff', 1, 100, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 6666, 480, 'default', 'image/png', '#ffffff', 1, 100, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage14.testcase b/test/sql_stmt_tests/getmapimage14.testcase
new file mode 100644
index 0000000..3dc5b1f
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage14.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - Invalid height (too small)
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 8, 'default', 'image/png', '#ffffff', 1, 100, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 8, 'default', 'image/png', '#ffffff', 1, 100, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage15.testcase b/test/sql_stmt_tests/getmapimage15.testcase
new file mode 100644
index 0000000..1849acb
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage15.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - Invalid height (too big)
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 8888, 'default', 'image/png', '#ffffff', 1, 100, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 8888, 'default', 'image/png', '#ffffff', 1, 100, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage16.testcase b/test/sql_stmt_tests/getmapimage16.testcase
new file mode 100644
index 0000000..9a5c4b6
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage16.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - Invalid style
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'gothic', 'image/png', '#ffffff', 1, 100, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'gothic', 'image/png', '#ffffff', 1, 100, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage17.testcase b/test/sql_stmt_tests/getmapimage17.testcase
new file mode 100644
index 0000000..31040ea
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage17.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - Invalid format
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'text/plain', '#ffffff', 1, 100, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'text/plain', '#ffffff', 1, 100, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage18.testcase b/test/sql_stmt_tests/getmapimage18.testcase
new file mode 100644
index 0000000..fccbad6
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage18.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - not existing coverage
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/jpeg', '#ffffff', 1, 80, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/jpeg', '#ffffff', 1, 80, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage19.testcase b/test/sql_stmt_tests/getmapimage19.testcase
new file mode 100644
index 0000000..e31b8d3
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage19.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - NULL background color
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/jpeg', NULL, 1, 80, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/jpeg', NULL, 1, 80, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage2.testcase b/test/sql_stmt_tests/getmapimage2.testcase
new file mode 100644
index 0000000..657686c
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage2.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - NULL BBOX
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', NULL, 640, 480);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', NULL, 640, 480)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage20.testcase b/test/sql_stmt_tests/getmapimage20.testcase
new file mode 100644
index 0000000..e4633c3
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage20.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - invalid background color
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/jpeg', 'magenta', 1, 80, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/jpeg', 'magenta', 1, 80, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage3.testcase b/test/sql_stmt_tests/getmapimage3.testcase
new file mode 100644
index 0000000..0041752
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage3.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - NULL width
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), NULL, 480);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), NULL, 480)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage4.testcase b/test/sql_stmt_tests/getmapimage4.testcase
new file mode 100644
index 0000000..ca6cc9e
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage4.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - NULL height
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage5.testcase b/test/sql_stmt_tests/getmapimage5.testcase
new file mode 100644
index 0000000..0b10899
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage5.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - NULL style
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage6.testcase b/test/sql_stmt_tests/getmapimage6.testcase
new file mode 100644
index 0000000..ec4f55b
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage6.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - NULL format
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage7.testcase b/test/sql_stmt_tests/getmapimage7.testcase
new file mode 100644
index 0000000..fd511b8
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage7.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - NULL transparent
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/png', '#ffffff', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/png', '#ffffff', NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage8.testcase b/test/sql_stmt_tests/getmapimage8.testcase
new file mode 100644
index 0000000..46e832b
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage8.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - NULL quality
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/png', '#ffffff', 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/png', '#ffffff', 1, NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getmapimage9.testcase b/test/sql_stmt_tests/getmapimage9.testcase
new file mode 100644
index 0000000..6461417
--- /dev/null
+++ b/test/sql_stmt_tests/getmapimage9.testcase
@@ -0,0 +1,7 @@
+RL2_GetMapImage - NULL reaspect
+:memory: #use in-memory database
+SELECT RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/png', '#ffffff', 1, 100, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMapImage('landsat', BuildMbr(1, 1, 10, 10), 640, 480, 'default', 'image/png', '#ffffff', 1, 100, NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getmonotileimage1.testcase b/test/sql_stmt_tests/getmonotileimage1.testcase
new file mode 100644
index 0000000..b5649d6
--- /dev/null
+++ b/test/sql_stmt_tests/getmonotileimage1.testcase
@@ -0,0 +1,7 @@
+RL2_GetMonoBandTileImage - NULL coverage
+:memory: #use in-memory database
+SELECT RL2_GetMonoBandTileImage(NULL, 1, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMonoBandTileImage(NULL, 1, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmonotileimage2.testcase b/test/sql_stmt_tests/getmonotileimage2.testcase
new file mode 100644
index 0000000..b8f7af4
--- /dev/null
+++ b/test/sql_stmt_tests/getmonotileimage2.testcase
@@ -0,0 +1,7 @@
+RL2_GetMonoBandTileImage - NULL tile-id
+:memory: #use in-memory database
+SELECT RL2_GetMonoBandTileImage('alpha', NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMonoBandTileImage('alpha', NULL, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getmonotileimage3.testcase b/test/sql_stmt_tests/getmonotileimage3.testcase
new file mode 100644
index 0000000..74fb993
--- /dev/null
+++ b/test/sql_stmt_tests/getmonotileimage3.testcase
@@ -0,0 +1,7 @@
+RL2_GetMonoBandTileImage - NULL mono-band
+:memory: #use in-memory database
+SELECT RL2_GetMonoBandTileImage('alpha', 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMonoBandTileImage('alpha', 1, NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getmonotileimage4.testcase b/test/sql_stmt_tests/getmonotileimage4.testcase
new file mode 100644
index 0000000..5f70474
--- /dev/null
+++ b/test/sql_stmt_tests/getmonotileimage4.testcase
@@ -0,0 +1,7 @@
+RL2_GetMonoBandTileImage - NULL background color
+:memory: #use in-memory database
+SELECT RL2_GetMonoBandTileImage('alpha', 1, 0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMonoBandTileImage('alpha', 1, 0, NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getmonotileimage5.testcase b/test/sql_stmt_tests/getmonotileimage5.testcase
new file mode 100644
index 0000000..66f2974
--- /dev/null
+++ b/test/sql_stmt_tests/getmonotileimage5.testcase
@@ -0,0 +1,7 @@
+RL2_GetMonoBandTileImage - not existing coverage
+:memory: #use in-memory database
+SELECT RL2_GetMonoBandTileImage('alpha', 1, 0, '#ffffff');
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMonoBandTileImage('alpha', 1, 0, '#ffffff')
+(NULL)
diff --git a/test/sql_stmt_tests/getmonotileimage6.testcase b/test/sql_stmt_tests/getmonotileimage6.testcase
new file mode 100644
index 0000000..ab241fe
--- /dev/null
+++ b/test/sql_stmt_tests/getmonotileimage6.testcase
@@ -0,0 +1,7 @@
+RL2_GetMonoBandTileImage - invalid background color
+:memory: #use in-memory database
+SELECT RL2_GetMonoBandTileImage('alpha', 1, 0, 'blue');
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMonoBandTileImage('alpha', 1, 0, 'blue')
+(NULL)
diff --git a/test/sql_stmt_tests/getmonotileimage7.testcase b/test/sql_stmt_tests/getmonotileimage7.testcase
new file mode 100644
index 0000000..10cb069
--- /dev/null
+++ b/test/sql_stmt_tests/getmonotileimage7.testcase
@@ -0,0 +1,7 @@
+RL2_GetMonoBandTileImage - NULL transparent
+:memory: #use in-memory database
+SELECT RL2_GetMonoBandTileImage('alpha', 1, 0, '#ffffff', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMonoBandTileImage('alpha', 1, 0, '#ffffff', NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getmonotileimage8.testcase b/test/sql_stmt_tests/getmonotileimage8.testcase
new file mode 100644
index 0000000..2609fa4
--- /dev/null
+++ b/test/sql_stmt_tests/getmonotileimage8.testcase
@@ -0,0 +1,7 @@
+RL2_GetMonoBandTileImage - invalid mono-band
+:memory: #use in-memory database
+SELECT RL2_GetMonoBandTileImage('alpha', 1, -1, '#ffffff', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetMonoBandTileImage('alpha', 1, -1, '#ffffff', 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getpalettecolorentry1.testcase b/test/sql_stmt_tests/getpalettecolorentry1.testcase
new file mode 100644
index 0000000..b5885db
--- /dev/null
+++ b/test/sql_stmt_tests/getpalettecolorentry1.testcase
@@ -0,0 +1,7 @@
+GetPaletteColorEntry - NULL palette
+:memory: #use in-memory database
+SELECT RL2_GetPaletteColorEntry(NULL, 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPaletteColorEntry(NULL, 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getpalettecolorentry2.testcase b/test/sql_stmt_tests/getpalettecolorentry2.testcase
new file mode 100644
index 0000000..69ed0b5
--- /dev/null
+++ b/test/sql_stmt_tests/getpalettecolorentry2.testcase
@@ -0,0 +1,7 @@
+GetPaletteColorEntry - BLOB palette
+:memory: #use in-memory database
+SELECT RL2_GetPaletteColorEntry(zeroblob(100), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPaletteColorEntry(zeroblob(100), 0)
+(NULL)
diff --git a/test/sql_stmt_tests/getpalettecolorentry3.testcase b/test/sql_stmt_tests/getpalettecolorentry3.testcase
new file mode 100644
index 0000000..64d4532
--- /dev/null
+++ b/test/sql_stmt_tests/getpalettecolorentry3.testcase
@@ -0,0 +1,7 @@
+GetPaletteColorEntry - NULL index
+:memory: #use in-memory database
+SELECT RL2_GetPaletteColorEntry(zeroblob(100), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPaletteColorEntry(zeroblob(100), NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getpalettenumentries1.testcase b/test/sql_stmt_tests/getpalettenumentries1.testcase
new file mode 100644
index 0000000..effb910
--- /dev/null
+++ b/test/sql_stmt_tests/getpalettenumentries1.testcase
@@ -0,0 +1,7 @@
+GetPaletteNumEntries - NULL palette
+:memory: #use in-memory database
+SELECT RL2_GetPaletteNumEntries(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPaletteNumEntries(NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getpalettenumentries2.testcase b/test/sql_stmt_tests/getpalettenumentries2.testcase
new file mode 100644
index 0000000..c6a556d
--- /dev/null
+++ b/test/sql_stmt_tests/getpalettenumentries2.testcase
@@ -0,0 +1,7 @@
+GetPaletteNumEntries - BLOB palette
+:memory: #use in-memory database
+SELECT RL2_GetPaletteNumEntries(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPaletteNumEntries(zeroblob(100))
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelnumbands1.testcase b/test/sql_stmt_tests/getpixelnumbands1.testcase
new file mode 100644
index 0000000..1ec7163
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelnumbands1.testcase
@@ -0,0 +1,7 @@
+GetPixelNumBands - ok
+:memory: #use in-memory database
+SELECT RL2_GetPixelNumBands(RL2_CreatePixel('UINT8', 'RGB', 3));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelNumBands(RL2_CreatePixel('UINT8', 'RGB', 3))
+3
diff --git a/test/sql_stmt_tests/getpixelnumbands2.testcase b/test/sql_stmt_tests/getpixelnumbands2.testcase
new file mode 100644
index 0000000..c32ae16
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelnumbands2.testcase
@@ -0,0 +1,7 @@
+GetPixelNumBands - NULL pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelNumBands(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelNumBands(NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelnumbands3.testcase b/test/sql_stmt_tests/getpixelnumbands3.testcase
new file mode 100644
index 0000000..222f4b3
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelnumbands3.testcase
@@ -0,0 +1,7 @@
+GetPixelNumBands - TEXT pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelNumBands('pixel');
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelNumBands('pixel')
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelnumbands4.testcase b/test/sql_stmt_tests/getpixelnumbands4.testcase
new file mode 100644
index 0000000..9e274f8
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelnumbands4.testcase
@@ -0,0 +1,7 @@
+GetPixelNumBands - Integer pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelNumBands(1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelNumBands(1)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelnumbands5.testcase b/test/sql_stmt_tests/getpixelnumbands5.testcase
new file mode 100644
index 0000000..62838f7
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelnumbands5.testcase
@@ -0,0 +1,7 @@
+GetPixelNumBands - Double pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelNumBands(1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelNumBands(1.5)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelnumbands6.testcase b/test/sql_stmt_tests/getpixelnumbands6.testcase
new file mode 100644
index 0000000..e215de5
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelnumbands6.testcase
@@ -0,0 +1,7 @@
+GetPixelNumBands - invalid BLOB pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelNumBands(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelNumBands(zeroblob(100))
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelsampletype1.testcase b/test/sql_stmt_tests/getpixelsampletype1.testcase
new file mode 100644
index 0000000..09c2741
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype1.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - 1-BIT
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1))
+1-BIT
diff --git a/test/sql_stmt_tests/getpixelsampletype10.testcase b/test/sql_stmt_tests/getpixelsampletype10.testcase
new file mode 100644
index 0000000..d854383
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype10.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - DOUBLE
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(RL2_CreatePixel('DOUBLE', 'DATAGRID', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(RL2_CreatePixel('DOUBLE', 'DATAGRID', 1))
+DOUBLE
diff --git a/test/sql_stmt_tests/getpixelsampletype11.testcase b/test/sql_stmt_tests/getpixelsampletype11.testcase
new file mode 100644
index 0000000..6807e1c
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype11.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - NULL pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelsampletype12.testcase b/test/sql_stmt_tests/getpixelsampletype12.testcase
new file mode 100644
index 0000000..80966d1
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype12.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - TEXT pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType('pixel');
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType('pixel')
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelsampletype13.testcase b/test/sql_stmt_tests/getpixelsampletype13.testcase
new file mode 100644
index 0000000..ae22c53
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype13.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - Integer pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(1)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelsampletype14.testcase b/test/sql_stmt_tests/getpixelsampletype14.testcase
new file mode 100644
index 0000000..5dc9fcd
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype14.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - Double pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(1.5)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelsampletype15.testcase b/test/sql_stmt_tests/getpixelsampletype15.testcase
new file mode 100644
index 0000000..4986caa
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype15.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - Invalid BLOB pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(zeroblob(100))
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelsampletype16.testcase b/test/sql_stmt_tests/getpixelsampletype16.testcase
new file mode 100644
index 0000000..71c292c
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype16.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - UINT32
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(RL2_CreatePixel('UINT32', 'DATAGRID', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(RL2_CreatePixel('UINT32', 'DATAGRID', 1))
+UINT32
diff --git a/test/sql_stmt_tests/getpixelsampletype2.testcase b/test/sql_stmt_tests/getpixelsampletype2.testcase
new file mode 100644
index 0000000..7d65038
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype2.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - 2-BIT
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(RL2_CreatePixel('2-BIT', 'PALETTE', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(RL2_CreatePixel('2-BIT', 'PALETTE', 1))
+2-BIT
diff --git a/test/sql_stmt_tests/getpixelsampletype3.testcase b/test/sql_stmt_tests/getpixelsampletype3.testcase
new file mode 100644
index 0000000..e3f1255
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype3.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - 4-BIT
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(RL2_CreatePixel('4-BIT', 'PALETTE', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(RL2_CreatePixel('4-BIT', 'PALETTE', 1))
+4-BIT
diff --git a/test/sql_stmt_tests/getpixelsampletype4.testcase b/test/sql_stmt_tests/getpixelsampletype4.testcase
new file mode 100644
index 0000000..3bf710b
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype4.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - UINT8
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(RL2_CreatePixel('UINT8', 'RGB', 3));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(RL2_CreatePixel('UINT8', 'RGB', 3))
+UINT8
diff --git a/test/sql_stmt_tests/getpixelsampletype5.testcase b/test/sql_stmt_tests/getpixelsampletype5.testcase
new file mode 100644
index 0000000..7fc0f39
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype5.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - UINT16
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(RL2_CreatePixel('UINT16', 'RGB', 3));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(RL2_CreatePixel('UINT16', 'RGB', 3))
+UINT16
diff --git a/test/sql_stmt_tests/getpixelsampletype6.testcase b/test/sql_stmt_tests/getpixelsampletype6.testcase
new file mode 100644
index 0000000..2b991dc
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype6.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - INT8
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(RL2_CreatePixel('INT8', 'DATAGRID', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(RL2_CreatePixel('INT8', 'DATAGRID', 1))
+INT8
diff --git a/test/sql_stmt_tests/getpixelsampletype7.testcase b/test/sql_stmt_tests/getpixelsampletype7.testcase
new file mode 100644
index 0000000..d8d0a43
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype7.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - INT16
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(RL2_CreatePixel('INT16', 'DATAGRID', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(RL2_CreatePixel('INT16', 'DATAGRID', 1))
+INT16
diff --git a/test/sql_stmt_tests/getpixelsampletype8.testcase b/test/sql_stmt_tests/getpixelsampletype8.testcase
new file mode 100644
index 0000000..c555e0b
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype8.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - INT32
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(RL2_CreatePixel('INT32', 'DATAGRID', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(RL2_CreatePixel('INT32', 'DATAGRID', 1))
+INT32
diff --git a/test/sql_stmt_tests/getpixelsampletype9.testcase b/test/sql_stmt_tests/getpixelsampletype9.testcase
new file mode 100644
index 0000000..fd0b37b
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelsampletype9.testcase
@@ -0,0 +1,7 @@
+GetPixelSampleType - FLOAT
+:memory: #use in-memory database
+SELECT RL2_GetPixelSampleType(RL2_CreatePixel('FLOAT', 'DATAGRID', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelSampleType(RL2_CreatePixel('FLOAT', 'DATAGRID', 1))
+FLOAT
diff --git a/test/sql_stmt_tests/getpixeltype1.testcase b/test/sql_stmt_tests/getpixeltype1.testcase
new file mode 100644
index 0000000..fb33130
--- /dev/null
+++ b/test/sql_stmt_tests/getpixeltype1.testcase
@@ -0,0 +1,7 @@
+GetPixelType - MONOCHROME
+:memory: #use in-memory database
+SELECT RL2_GetPixelType(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelType(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1))
+MONOCHROME
diff --git a/test/sql_stmt_tests/getpixeltype10.testcase b/test/sql_stmt_tests/getpixeltype10.testcase
new file mode 100644
index 0000000..32ba374
--- /dev/null
+++ b/test/sql_stmt_tests/getpixeltype10.testcase
@@ -0,0 +1,7 @@
+GetPixelType - Double pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelType(1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelType(1.5)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixeltype11.testcase b/test/sql_stmt_tests/getpixeltype11.testcase
new file mode 100644
index 0000000..602d9a0
--- /dev/null
+++ b/test/sql_stmt_tests/getpixeltype11.testcase
@@ -0,0 +1,7 @@
+GetPixelType - invalid BLOB pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelType(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelType(zeroblob(100))
+(NULL)
diff --git a/test/sql_stmt_tests/getpixeltype2.testcase b/test/sql_stmt_tests/getpixeltype2.testcase
new file mode 100644
index 0000000..fdf06c1
--- /dev/null
+++ b/test/sql_stmt_tests/getpixeltype2.testcase
@@ -0,0 +1,7 @@
+GetPixelType - PALETTE
+:memory: #use in-memory database
+SELECT RL2_GetPixelType(RL2_CreatePixel('UINT8', 'PALETTE', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelType(RL2_CreatePixel('UINT8', 'PALETTE', 1))
+PALETTE
diff --git a/test/sql_stmt_tests/getpixeltype3.testcase b/test/sql_stmt_tests/getpixeltype3.testcase
new file mode 100644
index 0000000..66eb99e
--- /dev/null
+++ b/test/sql_stmt_tests/getpixeltype3.testcase
@@ -0,0 +1,7 @@
+GetPixelType - GRAYSCALE
+:memory: #use in-memory database
+SELECT RL2_GetPixelType(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelType(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1))
+GRAYSCALE
diff --git a/test/sql_stmt_tests/getpixeltype4.testcase b/test/sql_stmt_tests/getpixeltype4.testcase
new file mode 100644
index 0000000..68fce89
--- /dev/null
+++ b/test/sql_stmt_tests/getpixeltype4.testcase
@@ -0,0 +1,7 @@
+GetPixelType - RGB
+:memory: #use in-memory database
+SELECT RL2_GetPixelType(RL2_CreatePixel('UINT8', 'RGB', 3));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelType(RL2_CreatePixel('UINT8', 'RGB', 3))
+RGB
diff --git a/test/sql_stmt_tests/getpixeltype5.testcase b/test/sql_stmt_tests/getpixeltype5.testcase
new file mode 100644
index 0000000..6711f31
--- /dev/null
+++ b/test/sql_stmt_tests/getpixeltype5.testcase
@@ -0,0 +1,7 @@
+GetPixelType - DATAGRID
+:memory: #use in-memory database
+SELECT RL2_GetPixelType(RL2_CreatePixel('UINT8', 'DATAGRID', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelType(RL2_CreatePixel('UINT8', 'DATAGRID', 1))
+DATAGRID
diff --git a/test/sql_stmt_tests/getpixeltype6.testcase b/test/sql_stmt_tests/getpixeltype6.testcase
new file mode 100644
index 0000000..47732d7
--- /dev/null
+++ b/test/sql_stmt_tests/getpixeltype6.testcase
@@ -0,0 +1,7 @@
+GetPixelType - MULTIBAND
+:memory: #use in-memory database
+SELECT RL2_GetPixelType(RL2_CreatePixel('UINT8', 'MULTIBAND', 5));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelType(RL2_CreatePixel('UINT8', 'MULTIBAND', 5))
+MULTIBAND
diff --git a/test/sql_stmt_tests/getpixeltype7.testcase b/test/sql_stmt_tests/getpixeltype7.testcase
new file mode 100644
index 0000000..05b8dbb
--- /dev/null
+++ b/test/sql_stmt_tests/getpixeltype7.testcase
@@ -0,0 +1,7 @@
+GetPixelType - NULL pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelType(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelType(NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixeltype8.testcase b/test/sql_stmt_tests/getpixeltype8.testcase
new file mode 100644
index 0000000..38921ec
--- /dev/null
+++ b/test/sql_stmt_tests/getpixeltype8.testcase
@@ -0,0 +1,7 @@
+GetPixelType - TEXT pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelType('pixel');
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelType('pixel')
+(NULL)
diff --git a/test/sql_stmt_tests/getpixeltype9.testcase b/test/sql_stmt_tests/getpixeltype9.testcase
new file mode 100644
index 0000000..496009a
--- /dev/null
+++ b/test/sql_stmt_tests/getpixeltype9.testcase
@@ -0,0 +1,7 @@
+GetPixelType - Integer pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelType(1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelType(1)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelvalue1.testcase b/test/sql_stmt_tests/getpixelvalue1.testcase
new file mode 100644
index 0000000..64b6a76
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelvalue1.testcase
@@ -0,0 +1,7 @@
+GetPixelValue - NULL pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(NULL, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelvalue10.testcase b/test/sql_stmt_tests/getpixelvalue10.testcase
new file mode 100644
index 0000000..c837620
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelvalue10.testcase
@@ -0,0 +1,7 @@
+GetPixelValue - invalid band
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelvalue2.testcase b/test/sql_stmt_tests/getpixelvalue2.testcase
new file mode 100644
index 0000000..6f0e5d5
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelvalue2.testcase
@@ -0,0 +1,7 @@
+GetPixelValue - Integer pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(1, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(1, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelvalue3.testcase b/test/sql_stmt_tests/getpixelvalue3.testcase
new file mode 100644
index 0000000..d050e43
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelvalue3.testcase
@@ -0,0 +1,7 @@
+GetPixelValue - Double pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(1.6, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(1.6, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelvalue4.testcase b/test/sql_stmt_tests/getpixelvalue4.testcase
new file mode 100644
index 0000000..aae4167
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelvalue4.testcase
@@ -0,0 +1,7 @@
+GetPixelValue - invalid BLOB pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(zeroblob(100), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(zeroblob(100), 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelvalue5.testcase b/test/sql_stmt_tests/getpixelvalue5.testcase
new file mode 100644
index 0000000..74fd85c
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelvalue5.testcase
@@ -0,0 +1,7 @@
+GetPixelValue - text pixel
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue('pixel', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue('pixel', 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelvalue6.testcase b/test/sql_stmt_tests/getpixelvalue6.testcase
new file mode 100644
index 0000000..cb7d059
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelvalue6.testcase
@@ -0,0 +1,7 @@
+GetPixelValue - NULL band
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelvalue7.testcase b/test/sql_stmt_tests/getpixelvalue7.testcase
new file mode 100644
index 0000000..204831f
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelvalue7.testcase
@@ -0,0 +1,7 @@
+GetPixelValue - Text band
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 'one');
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 'one')
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelvalue8.testcase b/test/sql_stmt_tests/getpixelvalue8.testcase
new file mode 100644
index 0000000..bc366c0
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelvalue8.testcase
@@ -0,0 +1,7 @@
+GetPixelValue - Double band
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 1.5)
+(NULL)
diff --git a/test/sql_stmt_tests/getpixelvalue9.testcase b/test/sql_stmt_tests/getpixelvalue9.testcase
new file mode 100644
index 0000000..9b1ed6d
--- /dev/null
+++ b/test/sql_stmt_tests/getpixelvalue9.testcase
@@ -0,0 +1,7 @@
+GetPixelValue - BLOB band
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), zeroblob(4))
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats1.testcase b/test/sql_stmt_tests/getrasterstats1.testcase
new file mode 100644
index 0000000..4703fe4
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats1.testcase
@@ -0,0 +1,7 @@
+RL2_GetRasterStatistics_NoDataPixelsCount - NULL BLOB
+:memory: #use in-memory database
+SELECT RL2_GetRasterStatistics_NoDataPixelsCount(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetRasterStatistics_NoDataPixelsCount(NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats10.testcase b/test/sql_stmt_tests/getrasterstats10.testcase
new file mode 100644
index 0000000..61775dc
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats10.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Min - Invalid BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Min(zeroblob(100), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Min(zeroblob(100), 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats11.testcase b/test/sql_stmt_tests/getrasterstats11.testcase
new file mode 100644
index 0000000..9c72b43
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats11.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Min - NULL band index
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Min(zeroblob(100), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Min(zeroblob(100), NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats12.testcase b/test/sql_stmt_tests/getrasterstats12.testcase
new file mode 100644
index 0000000..aaae96c
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats12.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Max - NULL BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Max(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Max(NULL, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats13.testcase b/test/sql_stmt_tests/getrasterstats13.testcase
new file mode 100644
index 0000000..fb57479
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats13.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Max - Invalid BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Max(zeroblob(100), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Max(zeroblob(100), 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats14.testcase b/test/sql_stmt_tests/getrasterstats14.testcase
new file mode 100644
index 0000000..7f7605e
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats14.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Max - NULL band index
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Max(zeroblob(100), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Max(zeroblob(100), NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats15.testcase b/test/sql_stmt_tests/getrasterstats15.testcase
new file mode 100644
index 0000000..82b0ec6
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats15.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Avg - NULL BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Avg(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Avg(NULL, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats16.testcase b/test/sql_stmt_tests/getrasterstats16.testcase
new file mode 100644
index 0000000..5520705
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats16.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Avg - Invalid BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Avg(zeroblob(100), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Avg(zeroblob(100), 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats17.testcase b/test/sql_stmt_tests/getrasterstats17.testcase
new file mode 100644
index 0000000..f76211d
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats17.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Avg - NULL band index
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Avg(zeroblob(100), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Avg(zeroblob(100), NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats18.testcase b/test/sql_stmt_tests/getrasterstats18.testcase
new file mode 100644
index 0000000..7f27b56
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats18.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Var - NULL BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Var(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Var(NULL, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats19.testcase b/test/sql_stmt_tests/getrasterstats19.testcase
new file mode 100644
index 0000000..79faeaa
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats19.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Var - Invalid BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Var(zeroblob(100), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Var(zeroblob(100), 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats2.testcase b/test/sql_stmt_tests/getrasterstats2.testcase
new file mode 100644
index 0000000..38c267a
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats2.testcase
@@ -0,0 +1,7 @@
+RL2_GetRasterStatistics_NoDataPixelsCount - Invalid BLOB
+:memory: #use in-memory database
+SELECT RL2_GetRasterStatistics_NoDataPixelsCount(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetRasterStatistics_NoDataPixelsCount(zeroblob(100))
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats20.testcase b/test/sql_stmt_tests/getrasterstats20.testcase
new file mode 100644
index 0000000..3dc025a
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats20.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Var - NULL band index
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Var(zeroblob(100), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Var(zeroblob(100), NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats21.testcase b/test/sql_stmt_tests/getrasterstats21.testcase
new file mode 100644
index 0000000..a886fd0
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats21.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_StdDev - NULL BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_StdDev(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_StdDev(NULL, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats22.testcase b/test/sql_stmt_tests/getrasterstats22.testcase
new file mode 100644
index 0000000..400cea0
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats22.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_StdDev - Invalid BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_StdDev(zeroblob(100), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_StdDev(zeroblob(100), 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats23.testcase b/test/sql_stmt_tests/getrasterstats23.testcase
new file mode 100644
index 0000000..cb9469c
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats23.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_StdDev - NULL band index
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_StdDev(zeroblob(100), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_StdDev(zeroblob(100), NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats24.testcase b/test/sql_stmt_tests/getrasterstats24.testcase
new file mode 100644
index 0000000..30cd4ba
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats24.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Histogram - NULL BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Histogram(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Histogram(NULL, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats25.testcase b/test/sql_stmt_tests/getrasterstats25.testcase
new file mode 100644
index 0000000..b8a7412
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats25.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Histogram - Invalid BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Histogram(zeroblob(100), 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Histogram(zeroblob(100), 1)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats26.testcase b/test/sql_stmt_tests/getrasterstats26.testcase
new file mode 100644
index 0000000..e5ee415
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats26.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Histogram - NULL band index
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Histogram(zeroblob(100), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Histogram(zeroblob(100), NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats3.testcase b/test/sql_stmt_tests/getrasterstats3.testcase
new file mode 100644
index 0000000..b2422b9
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats3.testcase
@@ -0,0 +1,7 @@
+RL2_GetRasterStatistics_ValidPixelsCount - NULL BLOB
+:memory: #use in-memory database
+SELECT RL2_GetRasterStatistics_ValidPixelsCount(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetRasterStatistics_ValidPixelsCount(NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats4.testcase b/test/sql_stmt_tests/getrasterstats4.testcase
new file mode 100644
index 0000000..1ff839c
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats4.testcase
@@ -0,0 +1,7 @@
+RL2_GetRasterStatistics_ValidPixelsCount - Invalid BLOB
+:memory: #use in-memory database
+SELECT RL2_GetRasterStatistics_ValidPixelsCount(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetRasterStatistics_ValidPixelsCount(zeroblob(100))
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats5.testcase b/test/sql_stmt_tests/getrasterstats5.testcase
new file mode 100644
index 0000000..25f6de0
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats5.testcase
@@ -0,0 +1,7 @@
+RL2_GetRasterStatistics_SampleType - NULL BLOB
+:memory: #use in-memory database
+SELECT RL2_GetRasterStatistics_SampleType(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetRasterStatistics_SampleType(NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats6.testcase b/test/sql_stmt_tests/getrasterstats6.testcase
new file mode 100644
index 0000000..e1037d6
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats6.testcase
@@ -0,0 +1,7 @@
+RL2_GetRasterStatistics_SampleType - Invalid BLOB
+:memory: #use in-memory database
+SELECT RL2_GetRasterStatistics_SampleType(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetRasterStatistics_SampleType(zeroblob(100))
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats7.testcase b/test/sql_stmt_tests/getrasterstats7.testcase
new file mode 100644
index 0000000..6bf0209
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats7.testcase
@@ -0,0 +1,7 @@
+RL2_GetRasterStatistics_BandsCount - NULL BLOB
+:memory: #use in-memory database
+SELECT RL2_GetRasterStatistics_BandsCount(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetRasterStatistics_BandsCount(NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats8.testcase b/test/sql_stmt_tests/getrasterstats8.testcase
new file mode 100644
index 0000000..c37276a
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats8.testcase
@@ -0,0 +1,7 @@
+RL2_GetRasterStatistics_BandsCount - Invalid BLOB
+:memory: #use in-memory database
+SELECT RL2_GetRasterStatistics_BandsCount(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_GetRasterStatistics_BandsCount(zeroblob(100))
+(NULL)
diff --git a/test/sql_stmt_tests/getrasterstats9.testcase b/test/sql_stmt_tests/getrasterstats9.testcase
new file mode 100644
index 0000000..94864e7
--- /dev/null
+++ b/test/sql_stmt_tests/getrasterstats9.testcase
@@ -0,0 +1,7 @@
+RL2_GetBandStatistics_Min - NULL BLOB
+:memory: #use in-memory database
+SELECT RL2_GetBandStatistics_Min(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetBandStatistics_Min(NULL, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/gettileimage1.testcase b/test/sql_stmt_tests/gettileimage1.testcase
new file mode 100644
index 0000000..3e36bb8
--- /dev/null
+++ b/test/sql_stmt_tests/gettileimage1.testcase
@@ -0,0 +1,7 @@
+RL2_GetTileImage - NULL coverage
+:memory: #use in-memory database
+SELECT RL2_GetTileImage(NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTileImage(NULL, 1)
+(NULL)
diff --git a/test/sql_stmt_tests/gettileimage2.testcase b/test/sql_stmt_tests/gettileimage2.testcase
new file mode 100644
index 0000000..cd2203b
--- /dev/null
+++ b/test/sql_stmt_tests/gettileimage2.testcase
@@ -0,0 +1,7 @@
+RL2_GetTileImage - NULL tile-id
+:memory: #use in-memory database
+SELECT RL2_GetTileImage('alpha', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTileImage('alpha', NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/gettileimage3.testcase b/test/sql_stmt_tests/gettileimage3.testcase
new file mode 100644
index 0000000..6976378
--- /dev/null
+++ b/test/sql_stmt_tests/gettileimage3.testcase
@@ -0,0 +1,7 @@
+RL2_GetTileImage - NULL background color
+:memory: #use in-memory database
+SELECT RL2_GetTileImage('alpha', 1, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTileImage('alpha', 1, NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/gettileimage4.testcase b/test/sql_stmt_tests/gettileimage4.testcase
new file mode 100644
index 0000000..648a5a5
--- /dev/null
+++ b/test/sql_stmt_tests/gettileimage4.testcase
@@ -0,0 +1,7 @@
+RL2_GetTileImage - not existing coverage
+:memory: #use in-memory database
+SELECT RL2_GetTileImage('alpha', 1, '#ffffff');
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTileImage('alpha', 1, '#ffffff')
+(NULL)
diff --git a/test/sql_stmt_tests/gettileimage5.testcase b/test/sql_stmt_tests/gettileimage5.testcase
new file mode 100644
index 0000000..029404a
--- /dev/null
+++ b/test/sql_stmt_tests/gettileimage5.testcase
@@ -0,0 +1,7 @@
+RL2_GetTileImage - invalid background color
+:memory: #use in-memory database
+SELECT RL2_GetTileImage('alpha', 1, 'blue');
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTileImage('alpha', 1, 'blue')
+(NULL)
diff --git a/test/sql_stmt_tests/gettileimage6.testcase b/test/sql_stmt_tests/gettileimage6.testcase
new file mode 100644
index 0000000..e689787
--- /dev/null
+++ b/test/sql_stmt_tests/gettileimage6.testcase
@@ -0,0 +1,7 @@
+RL2_GetTileImage - NULL transparent
+:memory: #use in-memory database
+SELECT RL2_GetTileImage('alpha', 1, '#ffffff', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetTileImage('alpha', 1, '#ffffff', NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/ispixelopaque1.testcase b/test/sql_stmt_tests/ispixelopaque1.testcase
new file mode 100644
index 0000000..bce58f5
--- /dev/null
+++ b/test/sql_stmt_tests/ispixelopaque1.testcase
@@ -0,0 +1,7 @@
+IsOpaquePixel - TRUE (default)
+:memory: #use in-memory database
+SELECT RL2_IsOpaquePixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsOpaquePixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1))
+1
diff --git a/test/sql_stmt_tests/ispixelopaque2.testcase b/test/sql_stmt_tests/ispixelopaque2.testcase
new file mode 100644
index 0000000..a7081f2
--- /dev/null
+++ b/test/sql_stmt_tests/ispixelopaque2.testcase
@@ -0,0 +1,7 @@
+IsOpaquePixel - TRUE
+:memory: #use in-memory database
+SELECT RL2_IsOpaquePixel(RL2_SetOpaquePixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1)));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsOpaquePixel(RL2_SetOpaquePixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1)))
+1
diff --git a/test/sql_stmt_tests/ispixelopaque3.testcase b/test/sql_stmt_tests/ispixelopaque3.testcase
new file mode 100644
index 0000000..0a59e43
--- /dev/null
+++ b/test/sql_stmt_tests/ispixelopaque3.testcase
@@ -0,0 +1,7 @@
+IsOpaquePixel - FALSE
+:memory: #use in-memory database
+SELECT RL2_IsOpaquePixel(RL2_SetTransparentPixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1)));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsOpaquePixel(RL2_SetTransparentPixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1)))
+0
diff --git a/test/sql_stmt_tests/ispixelopaque4.testcase b/test/sql_stmt_tests/ispixelopaque4.testcase
new file mode 100644
index 0000000..c61398b
--- /dev/null
+++ b/test/sql_stmt_tests/ispixelopaque4.testcase
@@ -0,0 +1,7 @@
+IsOpaquePixel - NULL pixel
+:memory: #use in-memory database
+SELECT RL2_IsOpaquePixel(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsOpaquePixel(NULL)
+-1
diff --git a/test/sql_stmt_tests/ispixelopaque5.testcase b/test/sql_stmt_tests/ispixelopaque5.testcase
new file mode 100644
index 0000000..15cd7f0
--- /dev/null
+++ b/test/sql_stmt_tests/ispixelopaque5.testcase
@@ -0,0 +1,7 @@
+IsOpaquePixel - invalid BLOB pixel
+:memory: #use in-memory database
+SELECT RL2_IsOpaquePixel(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsOpaquePixel(zeroblob(100))
+-1
diff --git a/test/sql_stmt_tests/ispixeltransparent1.testcase b/test/sql_stmt_tests/ispixeltransparent1.testcase
new file mode 100644
index 0000000..bb23e6c
--- /dev/null
+++ b/test/sql_stmt_tests/ispixeltransparent1.testcase
@@ -0,0 +1,7 @@
+IsTransparentPixel - FALSE (default)
+:memory: #use in-memory database
+SELECT RL2_IsTransparentPixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsTransparentPixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1))
+0
diff --git a/test/sql_stmt_tests/ispixeltransparent2.testcase b/test/sql_stmt_tests/ispixeltransparent2.testcase
new file mode 100644
index 0000000..43e9339
--- /dev/null
+++ b/test/sql_stmt_tests/ispixeltransparent2.testcase
@@ -0,0 +1,7 @@
+IsTransparentPixel - FALSE
+:memory: #use in-memory database
+SELECT RL2_IsTransparentPixel(RL2_SetOpaquePixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1)));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsTransparentPixel(RL2_SetOpaquePixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1)))
+0
diff --git a/test/sql_stmt_tests/ispixeltransparent3.testcase b/test/sql_stmt_tests/ispixeltransparent3.testcase
new file mode 100644
index 0000000..0dfc807
--- /dev/null
+++ b/test/sql_stmt_tests/ispixeltransparent3.testcase
@@ -0,0 +1,7 @@
+IsTransparentPixel - TRUE
+:memory: #use in-memory database
+SELECT RL2_IsTransparentPixel(RL2_SetTransparentPixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1)));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsTransparentPixel(RL2_SetTransparentPixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1)))
+1
diff --git a/test/sql_stmt_tests/ispixeltransparent4.testcase b/test/sql_stmt_tests/ispixeltransparent4.testcase
new file mode 100644
index 0000000..ef371cf
--- /dev/null
+++ b/test/sql_stmt_tests/ispixeltransparent4.testcase
@@ -0,0 +1,7 @@
+IsTransparentPixel - NULL pixel
+:memory: #use in-memory database
+SELECT RL2_IsTransparentPixel(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsTransparentPixel(NULL)
+-1
diff --git a/test/sql_stmt_tests/ispixeltransparent5.testcase b/test/sql_stmt_tests/ispixeltransparent5.testcase
new file mode 100644
index 0000000..2291ae2
--- /dev/null
+++ b/test/sql_stmt_tests/ispixeltransparent5.testcase
@@ -0,0 +1,7 @@
+IsTransparentPixel - invalid BLOB pixel
+:memory: #use in-memory database
+SELECT RL2_IsTransparentPixel(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsTransparentPixel(zeroblob(100))
+-1
diff --git a/test/sql_stmt_tests/isvalidpalette1.testcase b/test/sql_stmt_tests/isvalidpalette1.testcase
new file mode 100644
index 0000000..6128f86
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpalette1.testcase
@@ -0,0 +1,7 @@
+IsValidRasterPalette - NULL palette
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterPalette(NULL, 'UINT8');
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterPalette(NULL, 'UINT8')
+-1
diff --git a/test/sql_stmt_tests/isvalidpalette10.testcase b/test/sql_stmt_tests/isvalidpalette10.testcase
new file mode 100644
index 0000000..83afe37
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpalette10.testcase
@@ -0,0 +1,7 @@
+IsValidRasterPalette - invalid BLOB palette INT32
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterPalette(zeroblob(100), 'INT32');
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterPalette(zeroblob(100), 'INT32')
+0
diff --git a/test/sql_stmt_tests/isvalidpalette2.testcase b/test/sql_stmt_tests/isvalidpalette2.testcase
new file mode 100644
index 0000000..5d4e8b5
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpalette2.testcase
@@ -0,0 +1,7 @@
+IsValidRasterPalette - invalid BLOB palette UINT8
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterPalette(zeroblob(100), 'UINT8');
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterPalette(zeroblob(100), 'UINT8')
+0
diff --git a/test/sql_stmt_tests/isvalidpalette3.testcase b/test/sql_stmt_tests/isvalidpalette3.testcase
new file mode 100644
index 0000000..8200de3
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpalette3.testcase
@@ -0,0 +1,7 @@
+IsValidRasterPalette - NULL sample-type
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterPalette(zeroblob(100), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterPalette(zeroblob(100), NULL)
+-1
diff --git a/test/sql_stmt_tests/isvalidpalette4.testcase b/test/sql_stmt_tests/isvalidpalette4.testcase
new file mode 100644
index 0000000..919e441
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpalette4.testcase
@@ -0,0 +1,7 @@
+IsValidRasterPalette - invalid BLOB palette FLOAT
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterPalette(zeroblob(100), 'FLOAT');
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterPalette(zeroblob(100), 'FLOAT')
+0
diff --git a/test/sql_stmt_tests/isvalidpalette5.testcase b/test/sql_stmt_tests/isvalidpalette5.testcase
new file mode 100644
index 0000000..3f60625
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpalette5.testcase
@@ -0,0 +1,7 @@
+IsValidRasterPalette - invalid BLOB palette DOUBLE
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterPalette(zeroblob(100), 'DOUBLE');
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterPalette(zeroblob(100), 'DOUBLE')
+0
diff --git a/test/sql_stmt_tests/isvalidpalette6.testcase b/test/sql_stmt_tests/isvalidpalette6.testcase
new file mode 100644
index 0000000..5f5c2fb
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpalette6.testcase
@@ -0,0 +1,7 @@
+IsValidRasterPalette - invalid BLOB palette INT8
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterPalette(zeroblob(100), 'INT8');
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterPalette(zeroblob(100), 'INT8')
+0
diff --git a/test/sql_stmt_tests/isvalidpalette7.testcase b/test/sql_stmt_tests/isvalidpalette7.testcase
new file mode 100644
index 0000000..6beb7ff
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpalette7.testcase
@@ -0,0 +1,7 @@
+IsValidRasterPalette - invalid BLOB palette UINT16
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterPalette(zeroblob(100), 'UINT16');
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterPalette(zeroblob(100), 'UINT16')
+0
diff --git a/test/sql_stmt_tests/isvalidpalette8.testcase b/test/sql_stmt_tests/isvalidpalette8.testcase
new file mode 100644
index 0000000..c235266
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpalette8.testcase
@@ -0,0 +1,7 @@
+IsValidRasterPalette - invalid BLOB palette INT16
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterPalette(zeroblob(100), 'INT16');
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterPalette(zeroblob(100), 'INT16')
+0
diff --git a/test/sql_stmt_tests/isvalidpalette9.testcase b/test/sql_stmt_tests/isvalidpalette9.testcase
new file mode 100644
index 0000000..f10db05
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpalette9.testcase
@@ -0,0 +1,7 @@
+IsValidRasterPalette - invalid BLOB palette UINT32
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterPalette(zeroblob(100), 'UINT32');
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterPalette(zeroblob(100), 'UINT32')
+0
diff --git a/test/sql_stmt_tests/isvalidpixel1.testcase b/test/sql_stmt_tests/isvalidpixel1.testcase
new file mode 100644
index 0000000..c9932f7
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel1.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - 1-BIT MONOCHROME
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1), '1-BIT', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1), '1-BIT', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel10.testcase b/test/sql_stmt_tests/isvalidpixel10.testcase
new file mode 100644
index 0000000..016bbe6
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel10.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - UINT16 RGB
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'RGB', 3), 'UINT16', 3);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'RGB', 3), 'UINT16', 3)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel11.testcase b/test/sql_stmt_tests/isvalidpixel11.testcase
new file mode 100644
index 0000000..9f94ad7
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel11.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - INT8 DATAGRID
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('INT8', 'DATAGRID', 1), 'INT8', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('INT8', 'DATAGRID', 1), 'INT8', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel12.testcase b/test/sql_stmt_tests/isvalidpixel12.testcase
new file mode 100644
index 0000000..0353a37
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel12.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - UINT8 DATAGRID
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('UINT8', 'DATAGRID', 1), 'UINT8', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('UINT8', 'DATAGRID', 1), 'UINT8', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel13.testcase b/test/sql_stmt_tests/isvalidpixel13.testcase
new file mode 100644
index 0000000..30cba95
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel13.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - INT16 DATAGRID
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('INT16', 'DATAGRID', 1), 'INT16', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('INT16', 'DATAGRID', 1), 'INT16', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel14.testcase b/test/sql_stmt_tests/isvalidpixel14.testcase
new file mode 100644
index 0000000..ad2a9e7
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel14.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - UINT16 DATAGRID
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'DATAGRID', 1), 'UINT16', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'DATAGRID', 1), 'UINT16', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel15.testcase b/test/sql_stmt_tests/isvalidpixel15.testcase
new file mode 100644
index 0000000..c051ce3
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel15.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - INT32 DATAGRID
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('INT32', 'DATAGRID', 1), 'INT32', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('INT32', 'DATAGRID', 1), 'INT32', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel16.testcase b/test/sql_stmt_tests/isvalidpixel16.testcase
new file mode 100644
index 0000000..079517b
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel16.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - UINT32 DATAGRID
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('UINT32', 'DATAGRID', 1), 'UINT32', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('UINT32', 'DATAGRID', 1), 'UINT32', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel17.testcase b/test/sql_stmt_tests/isvalidpixel17.testcase
new file mode 100644
index 0000000..309770a
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel17.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - FLOAT DATAGRID
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('FLOAT', 'DATAGRID', 1), 'FLOAT', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('FLOAT', 'DATAGRID', 1), 'FLOAT', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel18.testcase b/test/sql_stmt_tests/isvalidpixel18.testcase
new file mode 100644
index 0000000..5ee80e7
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel18.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - DOUBLE DATAGRID
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('DOUBLE', 'DATAGRID', 1), 'DOUBLE', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('DOUBLE', 'DATAGRID', 1), 'DOUBLE', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel19.testcase b/test/sql_stmt_tests/isvalidpixel19.testcase
new file mode 100644
index 0000000..3af79d1
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel19.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - UINT8 MULTIBAND
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('UINT8', 'MULTIBAND', 5), 'UINT8', 5);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('UINT8', 'MULTIBAND', 5), 'UINT8', 5)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel2.testcase b/test/sql_stmt_tests/isvalidpixel2.testcase
new file mode 100644
index 0000000..05e2284
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel2.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - 1-BIT PALETTE
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('1-BIT', 'PALETTE', 1), '1-BIT', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('1-BIT', 'PALETTE', 1), '1-BIT', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel20.testcase b/test/sql_stmt_tests/isvalidpixel20.testcase
new file mode 100644
index 0000000..6baf634
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel20.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - UINT16 MULTIBAND
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'MULTIBAND', 5), 'UINT16', 5);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'MULTIBAND', 5), 'UINT16', 5)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel21.testcase b/test/sql_stmt_tests/isvalidpixel21.testcase
new file mode 100644
index 0000000..0c1e276
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel21.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - NULL sample
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'MULTIBAND', 5), NULL, 5);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'MULTIBAND', 5), NULL, 5)
+-1
diff --git a/test/sql_stmt_tests/isvalidpixel22.testcase b/test/sql_stmt_tests/isvalidpixel22.testcase
new file mode 100644
index 0000000..f750704
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel22.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - NULL bands
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'MULTIBAND', 5), 'UINT16', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'MULTIBAND', 5), 'UINT16', NULL)
+-1
diff --git a/test/sql_stmt_tests/isvalidpixel23.testcase b/test/sql_stmt_tests/isvalidpixel23.testcase
new file mode 100644
index 0000000..d9639d0
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel23.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - NULL pixel
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(NULL, 'UINT16', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(NULL, 'UINT16', NULL)
+-1
diff --git a/test/sql_stmt_tests/isvalidpixel3.testcase b/test/sql_stmt_tests/isvalidpixel3.testcase
new file mode 100644
index 0000000..90afb95
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel3.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - 2-BIT PALETTE
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('2-BIT', 'PALETTE', 1), '2-BIT', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('2-BIT', 'PALETTE', 1), '2-BIT', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel4.testcase b/test/sql_stmt_tests/isvalidpixel4.testcase
new file mode 100644
index 0000000..8f21be3
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel4.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - 4-BIT PALETTE
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('4-BIT', 'PALETTE', 1), '4-BIT', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('4-BIT', 'PALETTE', 1), '4-BIT', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel5.testcase b/test/sql_stmt_tests/isvalidpixel5.testcase
new file mode 100644
index 0000000..38a62f4
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel5.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - 2-BIT GRAYSCALE
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('2-BIT', 'GRAYSCALE', 1), '2-BIT', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('2-BIT', 'GRAYSCALE', 1), '2-BIT', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel6.testcase b/test/sql_stmt_tests/isvalidpixel6.testcase
new file mode 100644
index 0000000..2d35572
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel6.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - 4-BIT GRAYSCALE
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('4-BIT', 'GRAYSCALE', 1), '4-BIT', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('4-BIT', 'GRAYSCALE', 1), '4-BIT', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel7.testcase b/test/sql_stmt_tests/isvalidpixel7.testcase
new file mode 100644
index 0000000..aaef6c7
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel7.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - UINT8 GRAYSCALE
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 'UINT8', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 'UINT8', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel8.testcase b/test/sql_stmt_tests/isvalidpixel8.testcase
new file mode 100644
index 0000000..e603551
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel8.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - UINT16 GRAYSCALE
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'GRAYSCALE', 1), 'UINT16', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('UINT16', 'GRAYSCALE', 1), 'UINT16', 1)
+1
diff --git a/test/sql_stmt_tests/isvalidpixel9.testcase b/test/sql_stmt_tests/isvalidpixel9.testcase
new file mode 100644
index 0000000..7da446c
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidpixel9.testcase
@@ -0,0 +1,7 @@
+IsValidPixel - UINT8 RGB
+:memory: #use in-memory database
+SELECT RL2_IsValidPixel(RL2_CreatePixel('UINT8', 'RGB', 3), 'UINT8', 3);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidPixel(RL2_CreatePixel('UINT8', 'RGB', 3), 'UINT8', 3)
+1
diff --git a/test/sql_stmt_tests/isvalidstats1.testcase b/test/sql_stmt_tests/isvalidstats1.testcase
new file mode 100644
index 0000000..2d181c4
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats1.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - NULL coverage
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(NULL, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(NULL, zeroblob(4))
+-1
diff --git a/test/sql_stmt_tests/isvalidstats10.testcase b/test/sql_stmt_tests/isvalidstats10.testcase
new file mode 100644
index 0000000..76497e0
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats10.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid INT16
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), 'INT16', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), 'INT16', 1)
+0
diff --git a/test/sql_stmt_tests/isvalidstats11.testcase b/test/sql_stmt_tests/isvalidstats11.testcase
new file mode 100644
index 0000000..319518a
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats11.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid UINT32
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), 'UINT32', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), 'UINT32', 1)
+0
diff --git a/test/sql_stmt_tests/isvalidstats12.testcase b/test/sql_stmt_tests/isvalidstats12.testcase
new file mode 100644
index 0000000..5d50c5a
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats12.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid INT32
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), 'INT32', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), 'INT32', 1)
+0
diff --git a/test/sql_stmt_tests/isvalidstats13.testcase b/test/sql_stmt_tests/isvalidstats13.testcase
new file mode 100644
index 0000000..ce319c7
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats13.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid FLOAT
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), 'FLOAT', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), 'FLOAT', 1)
+0
diff --git a/test/sql_stmt_tests/isvalidstats14.testcase b/test/sql_stmt_tests/isvalidstats14.testcase
new file mode 100644
index 0000000..167bbf8
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats14.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid DOUBLE
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), 'DOUBLE', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), 'DOUBLE', 1)
+0
diff --git a/test/sql_stmt_tests/isvalidstats15.testcase b/test/sql_stmt_tests/isvalidstats15.testcase
new file mode 100644
index 0000000..cdf77e1
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats15.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid 1-BIT
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), '1-BIT', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), '1-BIT', 1)
+0
diff --git a/test/sql_stmt_tests/isvalidstats16.testcase b/test/sql_stmt_tests/isvalidstats16.testcase
new file mode 100644
index 0000000..c2c7494
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats16.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid 2-BIT
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), '2-BIT', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), '2-BIT', 1)
+0
diff --git a/test/sql_stmt_tests/isvalidstats17.testcase b/test/sql_stmt_tests/isvalidstats17.testcase
new file mode 100644
index 0000000..7bb4100
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats17.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid 4-BIT
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), '4-BIT', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), '4-BIT', 1)
+0
diff --git a/test/sql_stmt_tests/isvalidstats18.testcase b/test/sql_stmt_tests/isvalidstats18.testcase
new file mode 100644
index 0000000..b17f2d6
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats18.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid bands
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), 'MULTIBANDS', 257);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), 'MULTIBANDS', 257)
+0
diff --git a/test/sql_stmt_tests/isvalidstats2.testcase b/test/sql_stmt_tests/isvalidstats2.testcase
new file mode 100644
index 0000000..ff8a6ff
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats2.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - NULL stats
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics('alpha', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics('alpha', NULL)
+-1
diff --git a/test/sql_stmt_tests/isvalidstats3.testcase b/test/sql_stmt_tests/isvalidstats3.testcase
new file mode 100644
index 0000000..209ceff
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats3.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid stats
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics('alpha', zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics('alpha', zeroblob(100))
+-1
diff --git a/test/sql_stmt_tests/isvalidstats4.testcase b/test/sql_stmt_tests/isvalidstats4.testcase
new file mode 100644
index 0000000..5b8545a
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats4.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - NULL stats (3 args)
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(NULL, 'UINT8', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(NULL, 'UINT8', 1)
+-1
diff --git a/test/sql_stmt_tests/isvalidstats5.testcase b/test/sql_stmt_tests/isvalidstats5.testcase
new file mode 100644
index 0000000..b908f38
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats5.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - NULL sample-type
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), NULL, 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), NULL, 1)
+-1
diff --git a/test/sql_stmt_tests/isvalidstats6.testcase b/test/sql_stmt_tests/isvalidstats6.testcase
new file mode 100644
index 0000000..d561bb8
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats6.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - NULL bands
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), 'UINT8', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), 'UINT8', NULL)
+-1
diff --git a/test/sql_stmt_tests/isvalidstats7.testcase b/test/sql_stmt_tests/isvalidstats7.testcase
new file mode 100644
index 0000000..7cdedeb
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats7.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid UINT8
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), 'UINT8', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), 'UINT8', 1)
+0
diff --git a/test/sql_stmt_tests/isvalidstats8.testcase b/test/sql_stmt_tests/isvalidstats8.testcase
new file mode 100644
index 0000000..4bb4d1a
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats8.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid INT8
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), 'INT8', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), 'INT8', 1)
+0
diff --git a/test/sql_stmt_tests/isvalidstats9.testcase b/test/sql_stmt_tests/isvalidstats9.testcase
new file mode 100644
index 0000000..418e279
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidstats9.testcase
@@ -0,0 +1,7 @@
+IsValidRasterStatistics - invalid UINT16
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterStatistics(zeroblob(100), 'UINT16', 1);
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterStatistics(zeroblob(100), 'UINT16', 1)
+0
diff --git a/test/sql_stmt_tests/isvalidtile1.testcase b/test/sql_stmt_tests/isvalidtile1.testcase
new file mode 100644
index 0000000..af59c2e
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidtile1.testcase
@@ -0,0 +1,7 @@
+IsValidRasterTile - NULL coverage
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterTile(NULL, 1, zeroblob(100), zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterTile(NULL, 1, zeroblob(100), zeroblob(100))
+-1
diff --git a/test/sql_stmt_tests/isvalidtile2.testcase b/test/sql_stmt_tests/isvalidtile2.testcase
new file mode 100644
index 0000000..015d82a
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidtile2.testcase
@@ -0,0 +1,7 @@
+IsValidRasterTile - NULL level
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterTile('alpha', NULL, zeroblob(100), zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterTile('alpha', NULL, zeroblob(100), zeroblob(100))
+-1
diff --git a/test/sql_stmt_tests/isvalidtile3.testcase b/test/sql_stmt_tests/isvalidtile3.testcase
new file mode 100644
index 0000000..6fde567
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidtile3.testcase
@@ -0,0 +1,7 @@
+IsValidRasterTile - NULL odd-blok
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterTile('alpha', 1, NULL, zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterTile('alpha', 1, NULL, zeroblob(100))
+-1
diff --git a/test/sql_stmt_tests/isvalidtile4.testcase b/test/sql_stmt_tests/isvalidtile4.testcase
new file mode 100644
index 0000000..f26aaeb
--- /dev/null
+++ b/test/sql_stmt_tests/isvalidtile4.testcase
@@ -0,0 +1,7 @@
+IsValidRasterTile - TEXT even-blok
+:memory: #use in-memory database
+SELECT RL2_IsValidRasterTile('alpha', 1, zeroblob(100), 'alpha');
+1 # rows (not including the header row)
+1 # columns
+RL2_IsValidRasterTile('alpha', 1, zeroblob(100), 'alpha')
+-1
diff --git a/test/sql_stmt_tests/paletteequals1.testcase b/test/sql_stmt_tests/paletteequals1.testcase
new file mode 100644
index 0000000..399323f
--- /dev/null
+++ b/test/sql_stmt_tests/paletteequals1.testcase
@@ -0,0 +1,7 @@
+PaletteEquals - NULL palette #1
+:memory: #use in-memory database
+SELECT RL2_PaletteEquals(NULL, zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_PaletteEquals(NULL, zeroblob(100))
+-1
diff --git a/test/sql_stmt_tests/paletteequals2.testcase b/test/sql_stmt_tests/paletteequals2.testcase
new file mode 100644
index 0000000..4c0a3ba
--- /dev/null
+++ b/test/sql_stmt_tests/paletteequals2.testcase
@@ -0,0 +1,7 @@
+PaletteEquals - NULL palette #2
+:memory: #use in-memory database
+SELECT RL2_PaletteEquals(zeroblob(100), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_PaletteEquals(zeroblob(100), NULL)
+-1
diff --git a/test/sql_stmt_tests/paletteequals3.testcase b/test/sql_stmt_tests/paletteequals3.testcase
new file mode 100644
index 0000000..c18ddcd
--- /dev/null
+++ b/test/sql_stmt_tests/paletteequals3.testcase
@@ -0,0 +1,7 @@
+PaletteEquals - invalid palettes
+:memory: #use in-memory database
+SELECT RL2_PaletteEquals(zeroblob(100), zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_PaletteEquals(zeroblob(100), zeroblob(100))
+-1
diff --git a/test/sql_stmt_tests/pixelequals1.testcase b/test/sql_stmt_tests/pixelequals1.testcase
new file mode 100644
index 0000000..a604cb3
--- /dev/null
+++ b/test/sql_stmt_tests/pixelequals1.testcase
@@ -0,0 +1,7 @@
+PixelEquals - TRUE
+:memory: #use in-memory database
+SELECT RL2_PixelEquals(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128), RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128));
+1 # rows (not including the header row)
+1 # columns
+RL2_PixelEquals(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128), RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128))
+1
diff --git a/test/sql_stmt_tests/pixelequals2.testcase b/test/sql_stmt_tests/pixelequals2.testcase
new file mode 100644
index 0000000..4812f76
--- /dev/null
+++ b/test/sql_stmt_tests/pixelequals2.testcase
@@ -0,0 +1,7 @@
+PixelEquals - FALSE (1)
+:memory: #use in-memory database
+SELECT RL2_PixelEquals(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128), RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 127));
+1 # rows (not including the header row)
+1 # columns
+RL2_PixelEquals(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128), RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 127))
+0
diff --git a/test/sql_stmt_tests/pixelequals3.testcase b/test/sql_stmt_tests/pixelequals3.testcase
new file mode 100644
index 0000000..4650f9f
--- /dev/null
+++ b/test/sql_stmt_tests/pixelequals3.testcase
@@ -0,0 +1,7 @@
+PixelEquals - FALSE (2)
+:memory: #use in-memory database
+SELECT RL2_PixelEquals(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128), RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'PALETTE', 1), 0, 128));
+1 # rows (not including the header row)
+1 # columns
+RL2_PixelEquals(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128), RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'PALETTE', 1), 0, 128))
+0
diff --git a/test/sql_stmt_tests/pixelequals4.testcase b/test/sql_stmt_tests/pixelequals4.testcase
new file mode 100644
index 0000000..bea1e5f
--- /dev/null
+++ b/test/sql_stmt_tests/pixelequals4.testcase
@@ -0,0 +1,7 @@
+PixelEquals - FALSE (3)
+:memory: #use in-memory database
+SELECT RL2_PixelEquals(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128), RL2_SetTransparentPixel(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128)));
+1 # rows (not including the header row)
+1 # columns
+RL2_PixelEquals(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128), RL2_SetTransparentPixel(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128)))
+0
diff --git a/test/sql_stmt_tests/pixelequals5.testcase b/test/sql_stmt_tests/pixelequals5.testcase
new file mode 100644
index 0000000..7ffb840
--- /dev/null
+++ b/test/sql_stmt_tests/pixelequals5.testcase
@@ -0,0 +1,7 @@
+PixelEquals - NULL pixel-1
+:memory: #use in-memory database
+SELECT RL2_PixelEquals(NULL, RL2_SetTransparentPixel(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128)));
+1 # rows (not including the header row)
+1 # columns
+RL2_PixelEquals(NULL, RL2_SetTransparentPixel(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128)))
+-1
diff --git a/test/sql_stmt_tests/pixelequals6.testcase b/test/sql_stmt_tests/pixelequals6.testcase
new file mode 100644
index 0000000..f99a2cc
--- /dev/null
+++ b/test/sql_stmt_tests/pixelequals6.testcase
@@ -0,0 +1,7 @@
+PixelEquals - NULL pixel-2
+:memory: #use in-memory database
+SELECT RL2_PixelEquals(RL2_SetTransparentPixel(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128)), NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_PixelEquals(RL2_SetTransparentPixel(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128)), NULL)
+-1
diff --git a/test/sql_stmt_tests/pixelequals7.testcase b/test/sql_stmt_tests/pixelequals7.testcase
new file mode 100644
index 0000000..aecffc5
--- /dev/null
+++ b/test/sql_stmt_tests/pixelequals7.testcase
@@ -0,0 +1,7 @@
+PixelEquals - invalid BLOB pixel-1
+:memory: #use in-memory database
+SELECT RL2_PixelEquals(zeroblob(4), RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128));
+1 # rows (not including the header row)
+1 # columns
+RL2_PixelEquals(zeroblob(4), RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128))
+-1
diff --git a/test/sql_stmt_tests/pixelequals8.testcase b/test/sql_stmt_tests/pixelequals8.testcase
new file mode 100644
index 0000000..471132b
--- /dev/null
+++ b/test/sql_stmt_tests/pixelequals8.testcase
@@ -0,0 +1,7 @@
+PixelEquals - invalid BLOB pixel-2
+:memory: #use in-memory database
+SELECT RL2_PixelEquals(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128), zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_PixelEquals(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 128), zeroblob(4))
+-1
diff --git a/test/sql_stmt_tests/pyramidize1.testcase b/test/sql_stmt_tests/pyramidize1.testcase
new file mode 100644
index 0000000..1e8e8e9
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize1.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - NULL Coverage
+:memory: #use in-memory database
+SELECT rl2_pyramidize(NULL);
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize(NULL)
+-1
diff --git a/test/sql_stmt_tests/pyramidize10.testcase b/test/sql_stmt_tests/pyramidize10.testcase
new file mode 100644
index 0000000..09e2733
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize10.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - BLOB forced-rebuild
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', 'section', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', 'section', zeroblob(4))
+-1
diff --git a/test/sql_stmt_tests/pyramidize11.testcase b/test/sql_stmt_tests/pyramidize11.testcase
new file mode 100644
index 0000000..d6563a6
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize11.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - DOUBLE forced-rebuild
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', 'section', 1.1);
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', 'section', 1.1)
+-1
diff --git a/test/sql_stmt_tests/pyramidize12.testcase b/test/sql_stmt_tests/pyramidize12.testcase
new file mode 100644
index 0000000..5b11c0c
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize12.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - TEXT forced-rebuild
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', 'section', 'yes');
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', 'section', 'yes')
+-1
diff --git a/test/sql_stmt_tests/pyramidize13.testcase b/test/sql_stmt_tests/pyramidize13.testcase
new file mode 100644
index 0000000..4d238c9
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize13.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - NULL Transaction
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', 'section', 0, NULL);
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', 'section', 0, NULL)
+-1
diff --git a/test/sql_stmt_tests/pyramidize14.testcase b/test/sql_stmt_tests/pyramidize14.testcase
new file mode 100644
index 0000000..05bcac2
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize14.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - BLOB Transaction
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', 'section', 0, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', 'section', 0, zeroblob(4))
+-1
diff --git a/test/sql_stmt_tests/pyramidize15.testcase b/test/sql_stmt_tests/pyramidize15.testcase
new file mode 100644
index 0000000..5783707
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize15.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - DOUBLE Transaction
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', 'section', 1, 1.1);
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', 'section', 1, 1.1)
+-1
diff --git a/test/sql_stmt_tests/pyramidize16.testcase b/test/sql_stmt_tests/pyramidize16.testcase
new file mode 100644
index 0000000..4382003
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize16.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - TEXT Transaction
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', 'section', 1, 'no');
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', 'section', 1, 'no')
+-1
diff --git a/test/sql_stmt_tests/pyramidize2.testcase b/test/sql_stmt_tests/pyramidize2.testcase
new file mode 100644
index 0000000..4023c6d
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize2.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - BLOB Coverage
+:memory: #use in-memory database
+SELECT rl2_pyramidize(zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize(zeroblob(4))
+-1
diff --git a/test/sql_stmt_tests/pyramidize3.testcase b/test/sql_stmt_tests/pyramidize3.testcase
new file mode 100644
index 0000000..352e4fa
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize3.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - INT Coverage
+:memory: #use in-memory database
+SELECT rl2_pyramidize(1);
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize(1)
+-1
diff --git a/test/sql_stmt_tests/pyramidize4.testcase b/test/sql_stmt_tests/pyramidize4.testcase
new file mode 100644
index 0000000..42def4d
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize4.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - DOUBLE Coverage
+:memory: #use in-memory database
+SELECT rl2_pyramidize(1.1);
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize(1.1)
+-1
diff --git a/test/sql_stmt_tests/pyramidize5.testcase b/test/sql_stmt_tests/pyramidize5.testcase
new file mode 100644
index 0000000..0e741ef
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize5.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - NULL Section
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', NULL);
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', NULL)
+0
diff --git a/test/sql_stmt_tests/pyramidize6.testcase b/test/sql_stmt_tests/pyramidize6.testcase
new file mode 100644
index 0000000..e54c19f
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize6.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - INT Section
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', 1);
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', 1)
+-1
diff --git a/test/sql_stmt_tests/pyramidize7.testcase b/test/sql_stmt_tests/pyramidize7.testcase
new file mode 100644
index 0000000..178a839
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize7.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - DOUBLE Section
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', 1.1);
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', 1.1)
+-1
diff --git a/test/sql_stmt_tests/pyramidize8.testcase b/test/sql_stmt_tests/pyramidize8.testcase
new file mode 100644
index 0000000..1300a07
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize8.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - BLOB Section
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', zeroblob(4))
+-1
diff --git a/test/sql_stmt_tests/pyramidize9.testcase b/test/sql_stmt_tests/pyramidize9.testcase
new file mode 100644
index 0000000..2b3d756
--- /dev/null
+++ b/test/sql_stmt_tests/pyramidize9.testcase
@@ -0,0 +1,7 @@
+rl2_pyramidize - NULL forced-rebuild
+:memory: #use in-memory database
+SELECT rl2_pyramidize('coverage', 'section', NULL);
+1 # rows (not including the header row)
+1 # columns
+rl2_pyramidize('coverage', 'section', NULL)
+-1
diff --git a/test/sql_stmt_tests/setcoverageinfos1.testcase b/test/sql_stmt_tests/setcoverageinfos1.testcase
new file mode 100644
index 0000000..8177b70
--- /dev/null
+++ b/test/sql_stmt_tests/setcoverageinfos1.testcase
@@ -0,0 +1,7 @@
+SetCoevrageInfos - NULL coverage name
+:memory: #use in-memory database
+SELECT RL2_SetCoverageInfos(NULL, 'title', 'abstract');
+1 # rows (not including the header row)
+1 # columns
+RL2_SetCoverageInfos(NULL, 'title', 'abstract')
+-1
diff --git a/test/sql_stmt_tests/setcoverageinfos2.testcase b/test/sql_stmt_tests/setcoverageinfos2.testcase
new file mode 100644
index 0000000..6f65bd0
--- /dev/null
+++ b/test/sql_stmt_tests/setcoverageinfos2.testcase
@@ -0,0 +1,7 @@
+SetCoevrageInfos - NULL title
+:memory: #use in-memory database
+SELECT RL2_SetCoverageInfos('coverage', NULL, 'abstract');
+1 # rows (not including the header row)
+1 # columns
+RL2_SetCoverageInfos('coverage', NULL, 'abstract')
+-1
diff --git a/test/sql_stmt_tests/setcoverageinfos3.testcase b/test/sql_stmt_tests/setcoverageinfos3.testcase
new file mode 100644
index 0000000..507eb1d
--- /dev/null
+++ b/test/sql_stmt_tests/setcoverageinfos3.testcase
@@ -0,0 +1,7 @@
+SetCoevrageInfos - NULL abstract
+:memory: #use in-memory database
+SELECT RL2_SetCoverageInfos('coverage', 'title', NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetCoverageInfos('coverage', 'title', NULL)
+-1
diff --git a/test/sql_stmt_tests/setcoverageinfos4.testcase b/test/sql_stmt_tests/setcoverageinfos4.testcase
new file mode 100644
index 0000000..f126d39
--- /dev/null
+++ b/test/sql_stmt_tests/setcoverageinfos4.testcase
@@ -0,0 +1,7 @@
+SetCoevrageInfos - not existing coverage
+:memory: #use in-memory database
+SELECT RL2_SetCoverageInfos('coverage', 'title', 'abstract');
+1 # rows (not including the header row)
+1 # columns
+RL2_SetCoverageInfos('coverage', 'title', 'abstract')
+0
diff --git a/test/sql_stmt_tests/setpalettecolorentry1.testcase b/test/sql_stmt_tests/setpalettecolorentry1.testcase
new file mode 100644
index 0000000..072e9b8
--- /dev/null
+++ b/test/sql_stmt_tests/setpalettecolorentry1.testcase
@@ -0,0 +1,7 @@
+SetPaletteColorEntry - NULL palette
+:memory: #use in-memory database
+SELECT RL2_SetPaletteColorEntry(NULL, 0, '#ff0000');
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPaletteColorEntry(NULL, 0, '#ff0000')
+(NULL)
diff --git a/test/sql_stmt_tests/setpalettecolorentry2.testcase b/test/sql_stmt_tests/setpalettecolorentry2.testcase
new file mode 100644
index 0000000..8f5881e
--- /dev/null
+++ b/test/sql_stmt_tests/setpalettecolorentry2.testcase
@@ -0,0 +1,7 @@
+SetPaletteColorEntry - BLOB palette
+:memory: #use in-memory database
+SELECT RL2_SetPaletteColorEntry(zeroblob(100), 0, '#ff0000');
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPaletteColorEntry(zeroblob(100), 0, '#ff0000')
+(NULL)
diff --git a/test/sql_stmt_tests/setpalettecolorentry3.testcase b/test/sql_stmt_tests/setpalettecolorentry3.testcase
new file mode 100644
index 0000000..cef3962
--- /dev/null
+++ b/test/sql_stmt_tests/setpalettecolorentry3.testcase
@@ -0,0 +1,7 @@
+SetPaletteColorEntry - NULL index
+:memory: #use in-memory database
+SELECT RL2_SetPaletteColorEntry(zeroblob(100), NULL, '#ff0000');
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPaletteColorEntry(zeroblob(100), NULL, '#ff0000')
+(NULL)
diff --git a/test/sql_stmt_tests/setpalettecolorentry4.testcase b/test/sql_stmt_tests/setpalettecolorentry4.testcase
new file mode 100644
index 0000000..407afc4
--- /dev/null
+++ b/test/sql_stmt_tests/setpalettecolorentry4.testcase
@@ -0,0 +1,7 @@
+SetPaletteColorEntry - NULL color
+:memory: #use in-memory database
+SELECT RL2_SetPaletteColorEntry(zeroblob(100), 0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPaletteColorEntry(zeroblob(100), 0, NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelopaque1.testcase b/test/sql_stmt_tests/setpixelopaque1.testcase
new file mode 100644
index 0000000..8be94ae
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelopaque1.testcase
@@ -0,0 +1,7 @@
+SetOpaquePixel - invalid BLOB pixel
+:memory: #use in-memory database
+SELECT RL2_SetOpaquePixel(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_SetOpaquePixel(zeroblob(100))
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelopaque2.testcase b/test/sql_stmt_tests/setpixelopaque2.testcase
new file mode 100644
index 0000000..7d68001
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelopaque2.testcase
@@ -0,0 +1,7 @@
+SetOpaquePixel - NULL pixel
+:memory: #use in-memory database
+SELECT RL2_SetOpaquePixel(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetOpaquePixel(NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixeltransparent1.testcase b/test/sql_stmt_tests/setpixeltransparent1.testcase
new file mode 100644
index 0000000..7b135b2
--- /dev/null
+++ b/test/sql_stmt_tests/setpixeltransparent1.testcase
@@ -0,0 +1,7 @@
+SetTransparentPixel - invalid BLOB pixel
+:memory: #use in-memory database
+SELECT RL2_SetTransparentPixel(zeroblob(100));
+1 # rows (not including the header row)
+1 # columns
+RL2_SetTransparentPixel(zeroblob(100))
+(NULL)
diff --git a/test/sql_stmt_tests/setpixeltransparent2.testcase b/test/sql_stmt_tests/setpixeltransparent2.testcase
new file mode 100644
index 0000000..0effe9b
--- /dev/null
+++ b/test/sql_stmt_tests/setpixeltransparent2.testcase
@@ -0,0 +1,7 @@
+SetTransparentPixel - NULL pixel
+:memory: #use in-memory database
+SELECT RL2_SetTransparentPixel(NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetTransparentPixel(NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue1.testcase b/test/sql_stmt_tests/setpixelvalue1.testcase
new file mode 100644
index 0000000..22ad77b
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue1.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - invalid band
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 1, 255);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 1, 255)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue10.testcase b/test/sql_stmt_tests/setpixelvalue10.testcase
new file mode 100644
index 0000000..a19a4ec
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue10.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - BLOB value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, zeroblob(4));
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, zeroblob(4))
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue11.testcase b/test/sql_stmt_tests/setpixelvalue11.testcase
new file mode 100644
index 0000000..e0d9ce8
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue11.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - mismatching Double value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 1.5);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 1.5)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue12.testcase b/test/sql_stmt_tests/setpixelvalue12.testcase
new file mode 100644
index 0000000..c6ec193
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue12.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - mismatching 1-BIT value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1), 0, 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1), 0, 2)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue13.testcase b/test/sql_stmt_tests/setpixelvalue13.testcase
new file mode 100644
index 0000000..9570d50
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue13.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - negative 1-BIT value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1), 0, -2);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1), 0, -2)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue14.testcase b/test/sql_stmt_tests/setpixelvalue14.testcase
new file mode 100644
index 0000000..e2b2178
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue14.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - mismatching 2-BIT value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('2-BIT', 'PALETTE', 1), 0, 4);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('2-BIT', 'PALETTE', 1), 0, 4)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue15.testcase b/test/sql_stmt_tests/setpixelvalue15.testcase
new file mode 100644
index 0000000..a24ab46
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue15.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - negative 2-BIT value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('2-BIT', 'PALETTE', 1), 0, -4);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('2-BIT', 'PALETTE', 1), 0, -4)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue16.testcase b/test/sql_stmt_tests/setpixelvalue16.testcase
new file mode 100644
index 0000000..745f4a6
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue16.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - mismatching 4-BIT value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('4-BIT', 'PALETTE', 1), 0, 16);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('4-BIT', 'PALETTE', 1), 0, 16)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue17.testcase b/test/sql_stmt_tests/setpixelvalue17.testcase
new file mode 100644
index 0000000..40faca2
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue17.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - negative 4-BIT value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('4-BIT', 'PALETTE', 1), 0, -16);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('4-BIT', 'PALETTE', 1), 0, -16)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue18.testcase b/test/sql_stmt_tests/setpixelvalue18.testcase
new file mode 100644
index 0000000..25967a0
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue18.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - mismatching UINT8 value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'PALETTE', 1), 0, 256);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'PALETTE', 1), 0, 256)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue19.testcase b/test/sql_stmt_tests/setpixelvalue19.testcase
new file mode 100644
index 0000000..cbb0f60
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue19.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - negative UINT8 value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'PALETTE', 1), 0, -256);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'PALETTE', 1), 0, -256)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue2.testcase b/test/sql_stmt_tests/setpixelvalue2.testcase
new file mode 100644
index 0000000..e85d862
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue2.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - NULL pixel
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(NULL, 0, 255);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(NULL, 0, 255)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue20.testcase b/test/sql_stmt_tests/setpixelvalue20.testcase
new file mode 100644
index 0000000..de9a157
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue20.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - mismatching UINT16 value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT16', 'DATAGRID', 1), 0, 65536);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT16', 'DATAGRID', 1), 0, 65536)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue21.testcase b/test/sql_stmt_tests/setpixelvalue21.testcase
new file mode 100644
index 0000000..7d08fa4
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue21.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - negative UINT16 value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT16', 'DATAGRID', 1), 0, -32768);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT16', 'DATAGRID', 1), 0, -32768)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue22.testcase b/test/sql_stmt_tests/setpixelvalue22.testcase
new file mode 100644
index 0000000..a30941a
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue22.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - mismatching INT8 (+) value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('INT8', 'DATAGRID', 1), 0, 128);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('INT8', 'DATAGRID', 1), 0, 128)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue23.testcase b/test/sql_stmt_tests/setpixelvalue23.testcase
new file mode 100644
index 0000000..f809738
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue23.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - mismatching INT8 (-) value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('INT8', 'DATAGRID', 1), 0, -129);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('INT8', 'DATAGRID', 1), 0, -129)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue24.testcase b/test/sql_stmt_tests/setpixelvalue24.testcase
new file mode 100644
index 0000000..2e6902c
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue24.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - mismatching INT16 (+) value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('INT16', 'DATAGRID', 1), 0, 32768);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('INT16', 'DATAGRID', 1), 0, 32768)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue25.testcase b/test/sql_stmt_tests/setpixelvalue25.testcase
new file mode 100644
index 0000000..7560e97
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue25.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - mismatching INT16 (-) value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('INT16', 'DATAGRID', 1), 0, -32769);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('INT16', 'DATAGRID', 1), 0, -32769)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue3.testcase b/test/sql_stmt_tests/setpixelvalue3.testcase
new file mode 100644
index 0000000..30d9e68
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue3.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - invalid BLOB pixel
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(zeroblob(100), 0, 255);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(zeroblob(100), 0, 255)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue4.testcase b/test/sql_stmt_tests/setpixelvalue4.testcase
new file mode 100644
index 0000000..5d8502e
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue4.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - NULL band
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), NULL, 255);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), NULL, 255)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue5.testcase b/test/sql_stmt_tests/setpixelvalue5.testcase
new file mode 100644
index 0000000..07c5dba
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue5.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - Text band
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 'one', 255);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 'one', 255)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue6.testcase b/test/sql_stmt_tests/setpixelvalue6.testcase
new file mode 100644
index 0000000..90ed11f
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue6.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - Double band
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 1.5, 255);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 1.5, 255)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue7.testcase b/test/sql_stmt_tests/setpixelvalue7.testcase
new file mode 100644
index 0000000..557862d
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue7.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - BLOB band
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), zeroblob(4), 255);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), zeroblob(4), 255)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue8.testcase b/test/sql_stmt_tests/setpixelvalue8.testcase
new file mode 100644
index 0000000..2af70a8
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue8.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - NULL value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, NULL);
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, NULL)
+(NULL)
diff --git a/test/sql_stmt_tests/setpixelvalue9.testcase b/test/sql_stmt_tests/setpixelvalue9.testcase
new file mode 100644
index 0000000..0135a6b
--- /dev/null
+++ b/test/sql_stmt_tests/setpixelvalue9.testcase
@@ -0,0 +1,7 @@
+SetPixelValue - TEXT value
+:memory: #use in-memory database
+SELECT RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 'value');
+1 # rows (not including the header row)
+1 # columns
+RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 'value')
+(NULL)
diff --git a/test/sql_stmt_tests/targetcpu.testcase b/test/sql_stmt_tests/targetcpu.testcase
new file mode 100644
index 0000000..d80cf01
--- /dev/null
+++ b/test/sql_stmt_tests/targetcpu.testcase
@@ -0,0 +1,7 @@
+rl2_target_cpu
+:memory: #use in-memory database
+SELECT rl2_target_cpu() IS NOT NULL;
+1 # rows (not including the header row)
+1 # columns
+rl2_target_cpu() IS NOT NULL
+1
diff --git a/test/sql_stmt_tests/testpixel_1bit_mono.testcase b/test/sql_stmt_tests/testpixel_1bit_mono.testcase
new file mode 100644
index 0000000..ebd9d82
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_1bit_mono.testcase
@@ -0,0 +1,7 @@
+TestPixel - 1-BIT MONOCHROME (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1), 0, 1), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('1-BIT', 'MONOCHROME', 1), 0, 1), 0)
+1
diff --git a/test/sql_stmt_tests/testpixel_1bit_plt.testcase b/test/sql_stmt_tests/testpixel_1bit_plt.testcase
new file mode 100644
index 0000000..2e4144e
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_1bit_plt.testcase
@@ -0,0 +1,7 @@
+TestPixel - 1-BIT Palette (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('1-BIT', 'PALETTE', 1), 0, 1), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('1-BIT', 'PALETTE', 1), 0, 1), 0)
+1
diff --git a/test/sql_stmt_tests/testpixel_2bit_gray.testcase b/test/sql_stmt_tests/testpixel_2bit_gray.testcase
new file mode 100644
index 0000000..bb63983
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_2bit_gray.testcase
@@ -0,0 +1,7 @@
+TestPixel - 2-BIT Gray (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('2-BIT', 'GRAYSCALE', 1), 0, 3), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('2-BIT', 'GRAYSCALE', 1), 0, 3), 0)
+3
diff --git a/test/sql_stmt_tests/testpixel_2bit_plt.testcase b/test/sql_stmt_tests/testpixel_2bit_plt.testcase
new file mode 100644
index 0000000..b36fd81
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_2bit_plt.testcase
@@ -0,0 +1,7 @@
+TestPixel - 2-BIT Palette (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('2-BIT', 'PALETTE', 1), 0, 3), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('2-BIT', 'PALETTE', 1), 0, 3), 0)
+3
diff --git a/test/sql_stmt_tests/testpixel_4bit_gray.testcase b/test/sql_stmt_tests/testpixel_4bit_gray.testcase
new file mode 100644
index 0000000..6868e0f
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_4bit_gray.testcase
@@ -0,0 +1,7 @@
+TestPixel - 4-BIT Gray (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('4-BIT', 'GRAYSCALE', 1), 0, 15), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('4-BIT', 'GRAYSCALE', 1), 0, 15), 0)
+15
diff --git a/test/sql_stmt_tests/testpixel_4bit_plt.testcase b/test/sql_stmt_tests/testpixel_4bit_plt.testcase
new file mode 100644
index 0000000..d8ce09b
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_4bit_plt.testcase
@@ -0,0 +1,7 @@
+TestPixel - 4-BIT Palette (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('4-BIT', 'PALETTE', 1), 0, 15), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('4-BIT', 'PALETTE', 1), 0, 15), 0)
+15
diff --git a/test/sql_stmt_tests/testpixel_double_grid.testcase b/test/sql_stmt_tests/testpixel_double_grid.testcase
new file mode 100644
index 0000000..1b2d669
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_double_grid.testcase
@@ -0,0 +1,7 @@
+TestPixel - DOUBLE GRID (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('DOUBLE', 'DATAGRID', 1), 0, 10000002.5), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('DOUBLE', 'DATAGRID', 1), 0, 10000002.5), 0)
+10000002.5
diff --git a/test/sql_stmt_tests/testpixel_float_grid.testcase b/test/sql_stmt_tests/testpixel_float_grid.testcase
new file mode 100644
index 0000000..aa71001
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_float_grid.testcase
@@ -0,0 +1,7 @@
+TestPixel - FLOAT GRID (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('FLOAT', 'DATAGRID', 1), 0, 2), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('FLOAT', 'DATAGRID', 1), 0, 2), 0)
+2.0
diff --git a/test/sql_stmt_tests/testpixel_int16_grid.testcase b/test/sql_stmt_tests/testpixel_int16_grid.testcase
new file mode 100644
index 0000000..0617bd1
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_int16_grid.testcase
@@ -0,0 +1,7 @@
+TestPixel - INT16 GRID (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('INT16', 'DATAGRID', 1), 0, -16000), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('INT16', 'DATAGRID', 1), 0, -16000), 0)
+-16000
diff --git a/test/sql_stmt_tests/testpixel_int32_grid.testcase b/test/sql_stmt_tests/testpixel_int32_grid.testcase
new file mode 100644
index 0000000..1116017
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_int32_grid.testcase
@@ -0,0 +1,7 @@
+TestPixel - INT32 GRID (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('INT32', 'DATAGRID', 1), 0, -1000000), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('INT32', 'DATAGRID', 1), 0, -1000000), 0)
+-1000000
diff --git a/test/sql_stmt_tests/testpixel_int8_grid.testcase b/test/sql_stmt_tests/testpixel_int8_grid.testcase
new file mode 100644
index 0000000..f1298d0
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_int8_grid.testcase
@@ -0,0 +1,7 @@
+TestPixel - INT8 GRID (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('INT8', 'DATAGRID', 1), 0, -120), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('INT8', 'DATAGRID', 1), 0, -120), 0)
+-120
diff --git a/test/sql_stmt_tests/testpixel_uint16_grid.testcase b/test/sql_stmt_tests/testpixel_uint16_grid.testcase
new file mode 100644
index 0000000..5b83fca
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_uint16_grid.testcase
@@ -0,0 +1,7 @@
+TestPixel - UINT16 GRID (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT16', 'DATAGRID', 1), 0, 32000), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT16', 'DATAGRID', 1), 0, 32000), 0)
+32000
diff --git a/test/sql_stmt_tests/testpixel_uint16_mband.testcase b/test/sql_stmt_tests/testpixel_uint16_mband.testcase
new file mode 100644
index 0000000..2ef2969
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_uint16_mband.testcase
@@ -0,0 +1,7 @@
+TestPixel - UINT16 MULTIBAND (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT16', 'MULTIBAND', 4), 3, 1000), 3);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT16', 'MULTIBAND', 4), 3, 1000), 3)
+1000
diff --git a/test/sql_stmt_tests/testpixel_uint16_rgb.testcase b/test/sql_stmt_tests/testpixel_uint16_rgb.testcase
new file mode 100644
index 0000000..d1e7533
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_uint16_rgb.testcase
@@ -0,0 +1,7 @@
+TestPixel - UINT16 RGB (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT16', 'RGB', 3), 2, 32000), 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT16', 'RGB', 3), 2, 32000), 2)
+32000
diff --git a/test/sql_stmt_tests/testpixel_uint32_grid.testcase b/test/sql_stmt_tests/testpixel_uint32_grid.testcase
new file mode 100644
index 0000000..979ab2c
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_uint32_grid.testcase
@@ -0,0 +1,7 @@
+TestPixel - UINT32 GRID (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT32', 'DATAGRID', 1), 0, 1000000), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT32', 'DATAGRID', 1), 0, 1000000), 0)
+1000000
diff --git a/test/sql_stmt_tests/testpixel_uint8_gray.testcase b/test/sql_stmt_tests/testpixel_uint8_gray.testcase
new file mode 100644
index 0000000..458c21f
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_uint8_gray.testcase
@@ -0,0 +1,7 @@
+TestPixel - UINT8 Gray (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 255), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'GRAYSCALE', 1), 0, 255), 0)
+255
diff --git a/test/sql_stmt_tests/testpixel_uint8_grid.testcase b/test/sql_stmt_tests/testpixel_uint8_grid.testcase
new file mode 100644
index 0000000..3a7f65d
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_uint8_grid.testcase
@@ -0,0 +1,7 @@
+TestPixel - UINT8 GRID (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'DATAGRID', 1), 0, 250), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'DATAGRID', 1), 0, 250), 0)
+250
diff --git a/test/sql_stmt_tests/testpixel_uint8_mband.testcase b/test/sql_stmt_tests/testpixel_uint8_mband.testcase
new file mode 100644
index 0000000..decafd6
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_uint8_mband.testcase
@@ -0,0 +1,7 @@
+TestPixel - UINT8 MULTIBAND (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'MULTIBAND', 4), 3, 255), 3);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'MULTIBAND', 4), 3, 255), 3)
+255
diff --git a/test/sql_stmt_tests/testpixel_uint8_plt.testcase b/test/sql_stmt_tests/testpixel_uint8_plt.testcase
new file mode 100644
index 0000000..2cb9696
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_uint8_plt.testcase
@@ -0,0 +1,7 @@
+TestPixel - UINT8 Palette (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'PALETTE', 1), 0, 255), 0);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'PALETTE', 1), 0, 255), 0)
+255
diff --git a/test/sql_stmt_tests/testpixel_uint8_rgb.testcase b/test/sql_stmt_tests/testpixel_uint8_rgb.testcase
new file mode 100644
index 0000000..42174ba
--- /dev/null
+++ b/test/sql_stmt_tests/testpixel_uint8_rgb.testcase
@@ -0,0 +1,7 @@
+TestPixel - UINT8 RGB (ok)
+:memory: #use in-memory database
+SELECT RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'RGB', 3), 2, 255), 2);
+1 # rows (not including the header row)
+1 # columns
+RL2_GetPixelValue(RL2_SetPixelValue(RL2_CreatePixel('UINT8', 'RGB', 3), 2, 255), 2)
+255
diff --git a/test/srtm_brightness.xml b/test/srtm_brightness.xml
new file mode 100644
index 0000000..ccf3aad
--- /dev/null
+++ b/test/srtm_brightness.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>srtm_brightness</Name>
+ <Description>
+ <Title>"srtm_plus" Interpolated RasterSymbolizer</Title>
+ <Abstract>An SLD/SE 1.1.0 RasterSymbolizer derived from an original GRASS GIS color rule; normal Shaded Relief effect - Brightness Only</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ColorMap>
+ <Interpolate fallbackValue="#ffffff">
+ <LookupValue>Rasterdata</LookupValue>
+ <InterpolationPoint>
+ <Data>-11000.00000000</Data>
+ <Value>#000000</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-8000.00000000</Data>
+ <Value>#000032</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-5000.00000000</Data>
+ <Value>#0a0a64</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-3000.00000000</Data>
+ <Value>#1e1e96</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-1000.00000000</Data>
+ <Value>#4646c8</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-100.00000000</Data>
+ <Value>#6464e1</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>0.00000000</Data>
+ <Value>#aaaaff</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>0.10000000</Data>
+ <Value>#399769</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>100.00000000</Data>
+ <Value>#75c25d</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>500.00000000</Data>
+ <Value>#e6e680</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>1000.00000000</Data>
+ <Value>#ca9e4b</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>2000.00000000</Data>
+ <Value>#b99a64</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>3000.00000000</Data>
+ <Value>#dcdcdc</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>5000.00000000</Data>
+ <Value>#ffffff</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>8850.00000000</Data>
+ <Value>#6464c8</Value>
+ </InterpolationPoint>
+ </Interpolate>
+ </ColorMap>
+ <ShadedRelief>
+ <BrightnessOnly>1</BrightnessOnly>
+ </ShadedRelief>
+</RasterSymbolizer>
diff --git a/test/srtm_categ.xml b/test/srtm_categ.xml
new file mode 100644
index 0000000..44da80d
--- /dev/null
+++ b/test/srtm_categ.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>srtm_categ</Name>
+ <Description>
+ <Title>"srtm" Categorized RasterSymbolizer</Title>
+ <Abstract>An SLD/SE 1.1.0 RasterSymbolizer derived from an original GRASS GIS color rule</Abstract>
+ </Description>
+ <Opacity>0.8</Opacity>
+ <ColorMap>
+ <Categorize fallbackValue="#ffffff">
+ <LookupValue>Rasterdata</LookupValue>
+ <Value>#000000</Value>
+ <Threshold>-11000.00000000</Threshold>
+ <Value>#000000</Value>
+ <Threshold>-500.00000000</Threshold>
+ <Value>#00000a</Value>
+ <Threshold>-300.00000000</Threshold>
+ <Value>#000014</Value>
+ <Threshold>-200.00000000</Threshold>
+ <Value>#000046</Value>
+ <Threshold>-100.00000000</Threshold>
+ <Value>#000082</Value>
+ <Threshold>-50.00000000</Threshold>
+ <Value>#0000cd</Value>
+ <Threshold>0.00000000</Threshold>
+ <Value>#bcd4e6</Value>
+ <Threshold>0.10000000</Threshold>
+ <Value>#399769</Value>
+ <Threshold>100.00000000</Threshold>
+ <Value>#75c25d</Value>
+ <Threshold>200.00000000</Threshold>
+ <Value>#e6e680</Value>
+ <Threshold>500.00000000</Threshold>
+ <Value>#ca9e4b</Value>
+ <Threshold>1000.00000000</Threshold>
+ <Value>#d6bb62</Value>
+ <Threshold>2000.00000000</Threshold>
+ <Value>#b99a64</Value>
+ <Threshold>3000.00000000</Threshold>
+ <Value>#dcdcdc</Value>
+ <Threshold>5000.00000000</Threshold>
+ <Value>#fafafa</Value>
+ <Threshold>8850.00000000</Threshold>
+ <Value>#ffffff</Value>
+ </Categorize>
+ </ColorMap>
+</RasterSymbolizer>
diff --git a/test/srtm_interp.xml b/test/srtm_interp.xml
new file mode 100644
index 0000000..6be6a92
--- /dev/null
+++ b/test/srtm_interp.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>srtm_interp</Name>
+ <Description>
+ <Title>"srtm_plus" Interpolated RasterSymbolizer</Title>
+ <Abstract>An SLD/SE 1.1.0 RasterSymbolizer derived from an original GRASS GIS color rule</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ColorMap>
+ <Interpolate fallbackValue="#ffffff">
+ <LookupValue>Rasterdata</LookupValue>
+ <InterpolationPoint>
+ <Data>-11000.00000000</Data>
+ <Value>#000000</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-8000.00000000</Data>
+ <Value>#000032</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-5000.00000000</Data>
+ <Value>#0a0a64</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-3000.00000000</Data>
+ <Value>#1e1e96</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-1000.00000000</Data>
+ <Value>#4646c8</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-100.00000000</Data>
+ <Value>#6464e1</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>0.00000000</Data>
+ <Value>#aaaaff</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>0.10000000</Data>
+ <Value>#399769</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>100.00000000</Data>
+ <Value>#75c25d</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>500.00000000</Data>
+ <Value>#e6e680</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>1000.00000000</Data>
+ <Value>#ca9e4b</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>2000.00000000</Data>
+ <Value>#b99a64</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>3000.00000000</Data>
+ <Value>#dcdcdc</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>5000.00000000</Data>
+ <Value>#ffffff</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>8850.00000000</Data>
+ <Value>#6464c8</Value>
+ </InterpolationPoint>
+ </Interpolate>
+ </ColorMap>
+</RasterSymbolizer>
diff --git a/test/srtm_relief_25.xml b/test/srtm_relief_25.xml
new file mode 100644
index 0000000..6f3bc75
--- /dev/null
+++ b/test/srtm_relief_25.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>srtm_relief_25</Name>
+ <Description>
+ <Title>"srtm_plus" Interpolated RasterSymbolizer</Title>
+ <Abstract>An SLD/SE 1.1.0 RasterSymbolizer derived from an original GRASS GIS color rule; bland Shaded Relief effect</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ColorMap>
+ <Interpolate fallbackValue="#ffffff">
+ <LookupValue>Rasterdata</LookupValue>
+ <InterpolationPoint>
+ <Data>-11000.00000000</Data>
+ <Value>#000000</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-8000.00000000</Data>
+ <Value>#000032</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-5000.00000000</Data>
+ <Value>#0a0a64</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-3000.00000000</Data>
+ <Value>#1e1e96</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-1000.00000000</Data>
+ <Value>#4646c8</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-100.00000000</Data>
+ <Value>#6464e1</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>0.00000000</Data>
+ <Value>#aaaaff</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>0.10000000</Data>
+ <Value>#399769</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>100.00000000</Data>
+ <Value>#75c25d</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>500.00000000</Data>
+ <Value>#e6e680</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>1000.00000000</Data>
+ <Value>#ca9e4b</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>2000.00000000</Data>
+ <Value>#b99a64</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>3000.00000000</Data>
+ <Value>#dcdcdc</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>5000.00000000</Data>
+ <Value>#ffffff</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>8850.00000000</Data>
+ <Value>#6464c8</Value>
+ </InterpolationPoint>
+ </Interpolate>
+ </ColorMap>
+ <ShadedRelief>
+ <ReliefFactor>25.0</ReliefFactor>
+ </ShadedRelief>
+</RasterSymbolizer>
diff --git a/test/srtm_relief_75.xml b/test/srtm_relief_75.xml
new file mode 100644
index 0000000..b6d69f1
--- /dev/null
+++ b/test/srtm_relief_75.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RasterSymbolizer version="1.1.0" xsi:schemaLocation="http://www.opengis.net/se http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd" xmlns="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <Name>srtm_relief_75</Name>
+ <Description>
+ <Title>"srtm_plus" Interpolated RasterSymbolizer</Title>
+ <Abstract>An SLD/SE 1.1.0 RasterSymbolizer derived from an original GRASS GIS color rule; strong Shaded Relief effect</Abstract>
+ </Description>
+ <Opacity>1.0</Opacity>
+ <ColorMap>
+ <Interpolate fallbackValue="#ffffff">
+ <LookupValue>Rasterdata</LookupValue>
+ <InterpolationPoint>
+ <Data>-11000.00000000</Data>
+ <Value>#000000</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-8000.00000000</Data>
+ <Value>#000032</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-5000.00000000</Data>
+ <Value>#0a0a64</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-3000.00000000</Data>
+ <Value>#1e1e96</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-1000.00000000</Data>
+ <Value>#4646c8</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>-100.00000000</Data>
+ <Value>#6464e1</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>0.00000000</Data>
+ <Value>#aaaaff</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>0.10000000</Data>
+ <Value>#399769</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>100.00000000</Data>
+ <Value>#75c25d</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>500.00000000</Data>
+ <Value>#e6e680</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>1000.00000000</Data>
+ <Value>#ca9e4b</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>2000.00000000</Data>
+ <Value>#b99a64</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>3000.00000000</Data>
+ <Value>#dcdcdc</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>5000.00000000</Data>
+ <Value>#ffffff</Value>
+ </InterpolationPoint>
+ <InterpolationPoint>
+ <Data>8850.00000000</Data>
+ <Value>#6464c8</Value>
+ </InterpolationPoint>
+ </Interpolate>
+ </ColorMap>
+ <ShadedRelief>
+ <ReliefFactor>75.0</ReliefFactor>
+ </ShadedRelief>
+</RasterSymbolizer>
diff --git a/test/supermarket.svg b/test/supermarket.svg
new file mode 100644
index 0000000..9223ec1
--- /dev/null
+++ b/test/supermarket.svg
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="supermarket.svg"
+ sodipodi:docbase="s:\Data\FacilityIcons"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata2975">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="783"
+ inkscape:window-width="1103"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.46083856"
+ inkscape:cx="318.83568"
+ inkscape:cy="319.23647"
+ inkscape:window-x="91"
+ inkscape:window-y="88"
+ inkscape:current-layer="svg2"
+ showgrid="false" />
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ id="perspective2441" />
+ <inkscape:perspective
+ id="perspective2466"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <g
+ id="g1327">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 L 1.704,516.927 C 1.704,557.771 22.599,579.156 63.896,579.156 L 515.92,579.156 C 557.227,579.156 578.149,558.841 578.149,516.927 L 578.149,66.804 C 578.149,24.203 557.227,1.768 514.628,1.768 C 514.624,1.768 66.133,1.625 66.275,1.768 z "
+ style="fill:#111;stroke:#eee;stroke-width:3.40799999"
+ id="path1329" />
+ </g>
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:28.1733551;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 538.75588,90.924252 L 489.34651,118.92063 L 426.02351,388.57001 L 426.02351,445.69918 L 137.1468,445.69918"
+ id="path2492"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:28.1733551;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 479.06925,164.57688 L 56.196494,164.57688 L 105.86424,358.40271 L 425.39502,402.94461 L 479.06925,164.57688 z"
+ id="path3264"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ id="path3268"
+ d="M 128.06871,165.73536 L 128.06871,343.20709"
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:18.7822361;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="cc" />
+ <path
+ sodipodi:nodetypes="cc"
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:18.7822361;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 86.424707,243.00115 L 445.19209,243.00115"
+ id="path3280" />
+ <path
+ transform="matrix(1.0862609,0,0,1.1358574,373.78132,-86.8033)"
+ sodipodi:open="true"
+ sodipodi:end="6.2832427"
+ sodipodi:start="0.00024710373"
+ d="M -184.12699,498.68445 A 29.153439,29.153439 0 1 1 -184.12699,498.67892"
+ sodipodi:ry="29.153439"
+ sodipodi:rx="29.153439"
+ sodipodi:cy="498.67725"
+ sodipodi:cx="-213.28043"
+ id="path3284"
+ style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:20;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ transform="matrix(1.0862609,0,0,1.1358574,618.76176,-84.803297)"
+ sodipodi:open="true"
+ sodipodi:end="6.2832427"
+ sodipodi:start="0.00024710373"
+ d="M -184.12699,498.68445 A 29.153439,29.153439 0 1 1 -184.12699,498.67892"
+ sodipodi:ry="29.153439"
+ sodipodi:rx="29.153439"
+ sodipodi:cy="498.67725"
+ sodipodi:cx="-213.28043"
+ id="path3316"
+ style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:20;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ sodipodi:type="arc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:18.7822361;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 215.1525,165.73536 L 215.1525,363.25095"
+ id="path3318"
+ sodipodi:nodetypes="cc" />
+ <path
+ id="path3320"
+ d="M 306.2363,165.73536 L 306.2363,372.15933"
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:18.7822361;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:18.7822361;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 395.3201,165.73536 L 395.3201,385.5219"
+ id="path3322"
+ sodipodi:nodetypes="cc" />
+ <path
+ id="path3324"
+ d="M 104.24147,322.08495 L 427.37533,322.08495"
+ style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:18.7822361;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="cc" />
+</svg>
diff --git a/test/test1.c b/test/test1.c
new file mode 100644
index 0000000..1c53a17
--- /dev/null
+++ b/test/test1.c
@@ -0,0 +1,1352 @@
+/*
+
+ test1.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+test_rgb_jpeg (const char *path)
+{
+ unsigned char *buffer;
+ int buf_size;
+ unsigned int width;
+ unsigned int height;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ rl2PixelPtr pxl;
+ char sample_8;
+ unsigned char sample_u8;
+ short sample_16;
+ unsigned short sample_u16;
+ int sample_32;
+ unsigned int sample_u32;
+ float sample_flt;
+ double sample_dbl;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ unsigned char compression;
+ int is_compressed;
+ unsigned int tile_width;
+ unsigned int tile_height;
+ int srid;
+ double minX;
+ double minY;
+ double maxX;
+ double maxY;
+ rl2RasterPtr rst;
+ rl2SectionPtr img = rl2_section_from_jpeg (path);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_get_section_name (img) == NULL)
+ {
+ fprintf (stderr, "\"%s\" missing section name\n", path);
+ return 0;
+ }
+
+ if (rl2_get_section_compression (img, &compression) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" Unable to get compression mode\n", path);
+ return 0;
+ }
+
+ if (compression != RL2_COMPRESSION_JPEG)
+ {
+ fprintf (stderr, "\"%s\" invalid compression mode\n", path);
+ return 0;
+ }
+
+ if (rl2_is_section_uncompressed (img, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get uncompressed\n", path);
+ return 0;
+ }
+
+ if (is_compressed != RL2_FALSE)
+ {
+ fprintf (stderr, "\"%s\" invalid compression lossless\n", path);
+ return 0;
+ }
+
+ if (rl2_is_section_compression_lossy (img, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get compression lossy\n", path);
+ return 0;
+ }
+
+ if (is_compressed != RL2_TRUE)
+ {
+ fprintf (stderr, "\"%s\" invalid compression lossy\n", path);
+ return 0;
+ }
+
+ if (rl2_get_section_tile_size (img, &tile_width, &tile_height) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get tile size\n", path);
+ return 0;
+ }
+ if (tile_width != RL2_TILESIZE_UNDEFINED)
+ {
+ fprintf (stderr, "\"%s\" invalid tile section tile width\n", path);
+ return 0;
+ }
+ if (tile_height != RL2_TILESIZE_UNDEFINED)
+ {
+ fprintf (stderr, "\"%s\" invalid tile section tile height\n", path);
+ return 0;
+ }
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "\"%s\" invalid raster pointer\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_size (rst, &width, &height) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get image size\n", path);
+ return 0;
+ }
+
+ if (width != 558)
+ {
+ fprintf (stderr, "\"%s\" invalid image width\n", path);
+ return 0;
+ }
+
+ if (height != 543)
+ {
+ fprintf (stderr, "\"%s\" invalid image height\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_srid (rst, &srid) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get image SRID\n", path);
+ return 0;
+ }
+
+ if (srid != RL2_GEOREFERENCING_NONE)
+ {
+ fprintf (stderr, "\"%s\" mismatiching image SRID\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_extent (rst, &minX, &minY, &maxX, &maxY) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get image extent\n", path);
+ return 0;
+ }
+
+ if (minX != 0.0)
+ {
+ fprintf (stderr, "\"%s\" invalid image MinX\n", path);
+ return 0;
+ }
+
+ if (minY != 0.0)
+ {
+ fprintf (stderr, "\"%s\" invalid image MinX\n", path);
+ return 0;
+ }
+
+ if (maxX != 558.0)
+ {
+ fprintf (stderr, "\"%s\" invalid image MaxX\n", path);
+ return 0;
+ }
+
+ if (maxY != 543.0)
+ {
+ fprintf (stderr, "\"%s\" invalid image MaxX\n", path);
+ return 0;
+ }
+
+ if (rl2_section_to_png (img, "./from_rgb_jpeg.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (120 * width * 3) + (120 * 3);
+
+ if (*(p_data1 + 0) != 205 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 204)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #1: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 196 || *(p_data2 + 1) != 194 || *(p_data2 + 2) != 197)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+
+ if (*(p_data1 + 0) != 205 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 204
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 196 || *(p_data2 + 1) != 194 || *(p_data2 + 2) != 197
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 205 || *(p_data1 + 2) != 203
+ || *(p_data1 + 3) != 204)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 196 || *(p_data2 + 2) != 194
+ || *(p_data2 + 3) != 197)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (120 * width * 3) + (120 * 3);
+ if (*(p_data1 + 0) != 204 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 205)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 197 || *(p_data2 + 1) != 194 || *(p_data2 + 2) != 196)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 204 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 205
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 197 || *(p_data2 + 1) != 194 || *(p_data2 + 2) != 196
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_band_to_uint8 (rst, RL2_RED_BAND, &buffer, &buf_size) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RED band data: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (120 * width) + 120;
+ if (*p_data1 != 205)
+ {
+ fprintf (stderr, "Unexpected RED pixel #1: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ if (*p_data2 != 196)
+ {
+ fprintf (stderr, "Unexpected RED pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_band_to_uint8 (rst, RL2_GREEN_BAND, &buffer, &buf_size) !=
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get GREEN band data: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (120 * width) + 120;
+ if (*p_data1 != 203)
+ {
+ fprintf (stderr, "Unexpected GREEN pixel #1: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ if (*p_data2 != 194)
+ {
+ fprintf (stderr, "Unexpected GREEN pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_band_to_uint8 (rst, RL2_BLUE_BAND, &buffer, &buf_size) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BLUE band data: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (120 * width) + 120;
+ if (*p_data1 != 204)
+ {
+ fprintf (stderr, "Unexpected BLUE pixel #1: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ if (*p_data2 != 197)
+ {
+ fprintf (stderr, "Unexpected BLUE pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_bands_to_RGB
+ (rst, RL2_GREEN_BAND, RL2_RED_BAND, RL2_BLUE_BAND, &buffer,
+ &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB band data: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (120 * width * 3) + (120 * 3);
+ if (*(p_data1 + 0) != 203 || *(p_data1 + 1) != 205 || *(p_data1 + 2) != 204)
+ {
+ fprintf (stderr, "Unexpected RGB band pixel #1: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 194 || *(p_data2 + 1) != 196 || *(p_data2 + 2) != 197)
+ {
+ fprintf (stderr, "Unexpected RGB band pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr,
+ "Unable to create Pixel for Raster: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to create get Pixel Type: from_palette_jpeg.png\n");
+ return 0;
+ }
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_RGB)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (num_bands != 3)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_int8 (pxl, &sample_8) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample INT8: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_int8 (pxl, 1) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample INT8: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (pxl, RL2_RED_BAND, &sample_u8) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample RED: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (sample_u8 != 205)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel RED Sample value %d: from_rgb_jpeg.png\n",
+ sample_u8);
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (pxl, RL2_GREEN_BAND, &sample_u8) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample GREEN: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (sample_u8 != 203)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GREEN Sample value %d: from_rgb_jpeg.png\n",
+ sample_u8);
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (pxl, RL2_BLUE_BAND, &sample_u8) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample BLUE: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (sample_u8 != 204)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel BLUE Sample value %d: from_rgb_jpeg.png\n",
+ sample_u8);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (pxl, 0, sample_u8) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample UINT8: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_int16 (pxl, &sample_16) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample INT16: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_int16 (pxl, 1) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample INT16: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 0, &sample_u16) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample UINT16: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 0, 1) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample UINT16: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_int32 (pxl, &sample_32) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample INT32: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_int32 (pxl, 1) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample INT32: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint32 (pxl, &sample_u32) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample UINT32: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint32 (pxl, 1) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample UINT32: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_float (pxl, &sample_flt) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample FLOAT: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_float (pxl, 1.5) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample FLOAT: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_double (pxl, &sample_dbl) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample DOUBLE: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_double (pxl, 1.5) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample DOUBLE: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_transparent (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel IsTransparent: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_FALSE)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel IsTransparent: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_opaque (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel IsOpaque: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_TRUE)
+ {
+ fprintf (stderr, "Unexpected Pixel IsOpaque: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_opaque (pxl) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetOpaque: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_transparent (pxl) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetTransparent: from_rgb_jpeg.png\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+ unlink ("./from_rgb_jpeg.png");
+
+ if (rl2_section_to_lossy_webp (img, "./from_rgb_jpeg_10.webp", 10) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_rgb_jpeg_10.webp\n");
+ return 0;
+ }
+ unlink ("./from_rgb_jpeg_10.webp");
+
+ if (rl2_section_to_lossless_webp (img, "./from_rgb_jpeg.webp") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_rgb_jpeg.webp\n");
+ return 0;
+ }
+ unlink ("./from_rgb_jpeg.webp");
+
+ rl2_destroy_section (img);
+ return 1;
+}
+
+static int
+test_gray_jpeg (const char *path)
+{
+ unsigned char *buffer;
+ int buf_size;
+ int width = 558;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ unsigned char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+ rl2SectionPtr img = rl2_section_from_jpeg (path);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_section_to_png (img, "./from_gray_jpeg.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "\"%s\" invalid raster pointer\n", path);
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: from_gray_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (120 * width * 3) + (120 * 3);
+ if (*(p_data1 + 0) != 203 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 203)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 195 || *(p_data2 + 1) != 195 || *(p_data2 + 2) != 195)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: from_gray_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: from_gray_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 203 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 203
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 195 || *(p_data2 + 1) != 195 || *(p_data2 + 2) != 195
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: from_gray_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 203
+ || *(p_data1 + 3) != 203)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 195 || *(p_data2 + 2) != 195
+ || *(p_data2 + 3) != 195)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: from_gray_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: from_gray_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (120 * width * 3) + (120 * 3);
+ if (*(p_data1 + 0) != 203 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 203)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 195 || *(p_data2 + 1) != 195 || *(p_data2 + 2) != 195)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: from_gray_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: from_gray_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 203 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 203
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 195 || *(p_data2 + 1) != 195 || *(p_data2 + 2) != 195
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: from_gray_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_uint8 (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get UINT8 data: from_gray_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (120 * width) + 120;
+ if (*p_data1 != 203)
+ {
+ fprintf (stderr, "Unexpected UINT8 pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+ if (*p_data2 != 195)
+ {
+ fprintf (stderr, "Unexpected UINT8 pixel #2: from_gray_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_band_to_uint8 (rst, RL2_RED_BAND, &buffer, &buf_size) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr, "Error RED band data: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint8 (rst, RL2_GREEN_BAND, &buffer, &buf_size) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Error to get GREEN band data: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint8 (rst, RL2_BLUE_BAND, &buffer, &buf_size) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr, "Error BLUE band data: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr,
+ "Unable to create Pixel for Raster: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to create get Pixel Type: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_GRAYSCALE)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (pxl, RL2_GRAYSCALE_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample GRAY: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (sample != 203)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GRAY Sample value %d: from_gray_jpeg.png\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (pxl, 0, sample) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample UINT8: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+ unlink ("./from_gray_jpeg.png");
+
+ if (rl2_section_to_lossy_webp (img, "./from_gray_jpeg_10.webp", 10) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_gray_jpeg_10.webp\n");
+ return 0;
+ }
+ unlink ("./from_gray_jpeg_10.webp");
+
+ if (rl2_section_to_lossless_webp (img, "./from_gray_jpeg.webp") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_gray_jpeg.webp\n");
+ return 0;
+ }
+ unlink ("./from_gray_jpeg.webp");
+
+ rl2_destroy_section (img);
+ return 1;
+}
+
+static int
+test_palette_png (const char *path)
+{
+ unsigned char *buffer;
+ int buf_size;
+ unsigned int width;
+ unsigned int height;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ unsigned char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned short num_entries;
+ unsigned char compression;
+ int is_compressed;
+ unsigned int tile_width;
+ unsigned int tile_height;
+ int srid;
+ double minX;
+ double minY;
+ double maxX;
+ double maxY;
+ gaiaGeomCollPtr geom;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+ rl2SectionPtr img = rl2_section_from_png (path);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_get_section_name (img) == NULL)
+ {
+ fprintf (stderr, "\"%s\" missing section name\n", path);
+ return 0;
+ }
+
+ if (rl2_get_section_compression (img, &compression) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get compression mode\n", path);
+ return 0;
+ }
+
+ if (compression != RL2_COMPRESSION_PNG)
+ {
+ fprintf (stderr, "\"%s\" invalid compression mode\n", path);
+ return 0;
+ }
+
+ if (rl2_is_section_uncompressed (img, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get invalid uncompressed\n", path);
+ return 0;
+ }
+
+ if (is_compressed != RL2_FALSE)
+ {
+ fprintf (stderr, "\"%s\" invalid uncompressed\n", path);
+ return 0;
+ }
+
+ if (rl2_is_section_compression_lossless (img, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get compression lossless\n", path);
+ return 0;
+ }
+
+ if (is_compressed != RL2_TRUE)
+ {
+ fprintf (stderr, "\"%s\" invalid compression lossless\n", path);
+ return 0;
+ }
+
+ if (rl2_is_section_compression_lossy (img, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get compression lossy\n", path);
+ return 0;
+ }
+
+ if (is_compressed != RL2_FALSE)
+ {
+ fprintf (stderr, "\"%s\" invalid compression lossy\n", path);
+ return 0;
+ }
+
+ if (rl2_get_section_tile_size (img, &tile_width, &tile_height) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get tile size\n", path);
+ return 0;
+ }
+ if (tile_width != RL2_TILESIZE_UNDEFINED)
+ {
+ fprintf (stderr, "\"%s\" invalid tile section tile width\n", path);
+ return 0;
+ }
+ if (tile_height != RL2_TILESIZE_UNDEFINED)
+ {
+ fprintf (stderr, "\"%s\" invalid tile section tile height\n", path);
+ return 0;
+ }
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "\"%s\" invalid raster pointer\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_size (rst, &width, &height) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get image size\n", path);
+ return 0;
+ }
+
+ if (width != 563)
+ {
+ fprintf (stderr, "\"%s\" invalid image width\n", path);
+ return 0;
+ }
+
+ if (height != 408)
+ {
+ fprintf (stderr, "\"%s\" invalid image height\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_srid (rst, &srid) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get image SRID\n", path);
+ return 0;
+ }
+
+ if (srid != RL2_GEOREFERENCING_NONE)
+ {
+ fprintf (stderr, "\"%s\" mismatching image SRID\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_extent (rst, &minX, &minY, &maxX, &maxY) != RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" unable to get image extent\n", path);
+ return 0;
+ }
+
+ if (minX != 0.0)
+ {
+ fprintf (stderr, "\"%s\" invalid image MinX\n", path);
+ return 0;
+ }
+
+ if (minY != 0.0)
+ {
+ fprintf (stderr, "\"%s\" invalid image MinX\n", path);
+ return 0;
+ }
+
+ if (maxX != 563.0)
+ {
+ fprintf (stderr, "\"%s\" invalid image MaxX\n", path);
+ return 0;
+ }
+
+ if (maxY != 408.0)
+ {
+ fprintf (stderr, "\"%s\" invalid image MaxX\n", path);
+ return 0;
+ }
+
+ geom = rl2_get_raster_bbox (rst);
+ if (geom != NULL)
+ {
+ fprintf (stderr, "\"%s\" unexpected image BBOX\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_palette (rst) == NULL)
+ {
+ fprintf (stderr, "\"%s\" invalid palette\n", path);
+ return 0;
+ }
+
+ if (rl2_get_palette_entries (rl2_get_raster_palette (rst), &num_entries) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "\"%s\" Unable to get palette # entries\n", path);
+ return 0;
+ }
+
+ if (num_entries != 30)
+ {
+ fprintf (stderr, "\"%s\" invalid palette # entries\n", path);
+ return 0;
+ }
+
+ if (rl2_section_to_jpeg (img, "./from_palette_png.jpg", 20) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_palette_png.jpg\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: from_palette_png.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (19 * width * 3) + (20 * 3);
+ p_data2 = buffer + (120 * width * 3) + (120 * 3);
+ if (*(p_data1 + 0) != 237 || *(p_data1 + 1) != 28 || *(p_data1 + 2) != 36)
+ {;
+ fprintf (stderr, "Unexpected RGB pixel #1: from_palette_png.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 250 || *(p_data2 + 1) != 250 || *(p_data2 + 2) != 250)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: from_palette_png.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: from_palette_png.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (19 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 237 || *(p_data1 + 1) != 28 || *(p_data1 + 2) != 36
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: from_palette_png.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 250 || *(p_data2 + 1) != 250 || *(p_data2 + 2) != 250
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: from_palette_png.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (19 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 237 || *(p_data1 + 2) != 28
+ || *(p_data1 + 3) != 36)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: from_palette_png.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 250 || *(p_data2 + 2) != 250
+ || *(p_data2 + 3) != 250)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: from_palette_png.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: from_palette_png.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (19 * width * 3) + (20 * 3);
+ p_data2 = buffer + (120 * width * 3) + (120 * 3);
+ if (*(p_data1 + 0) != 36 || *(p_data1 + 1) != 28 || *(p_data1 + 2) != 237)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: from_palette_png.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 250 || *(p_data2 + 1) != 250 || *(p_data2 + 2) != 250)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: from_palette_png.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: from_palette_png.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (19 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 36 || *(p_data1 + 1) != 28 || *(p_data1 + 2) != 237
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: from_palette_png.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 250 || *(p_data2 + 1) != 250 || *(p_data2 + 2) != 250
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: from_palette_png.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr,
+ "Unable to create Pixel for Raster: from_palette_png.png\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: from_palette_png.png\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to create get Pixel Type: from_palette_png.png\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SampleType: from_palette_png.png\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: from_palette_png.png\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: from_palette_png.png\n");
+ return 0;
+ }
+
+
+ rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands);
+ if (rl2_get_pixel_sample_uint8 (pxl, RL2_PALETTE_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel GetSample PALETTE: from_palette_png.png\n");
+ return 0;
+ }
+
+ if (sample != 29)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel PALETTE Sample value %d: from_palette_png.png\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (pxl, 0, sample) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample UINT8: from_palette_png.png\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: from_palette_png.png\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+ unlink ("./from_palette_png.jpg");
+
+ if (rl2_section_to_gif (img, "./from_palette_png.gif") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_palette_png.gif\n");
+ return 0;
+ }
+ unlink ("./from_palette_png.gif");
+
+ if (rl2_section_to_lossy_webp (img, "./from_palette_png_10.webp", 10) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_palette_png_10.webp\n");
+ return 0;
+ }
+ unlink ("./from_palette_png_10.webp");
+
+ if (rl2_section_to_lossless_webp (img, "./from_palette_png.webp") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_palette_png.webp\n");
+ return 0;
+ }
+ unlink ("./from_palette_png.webp");
+
+ rl2_destroy_section (img);
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ if (!test_rgb_jpeg ("./jpeg1.jpg"))
+ return -1;
+
+ if (!test_gray_jpeg ("./jpeg2.jpg"))
+ return -2;
+
+ if (!test_palette_png ("./png1.png"))
+ return -3;
+
+ return 0;
+}
diff --git a/test/test10.c b/test/test10.c
new file mode 100644
index 0000000..1eff3c5
--- /dev/null
+++ b/test/test10.c
@@ -0,0 +1,607 @@
+/*
+
+ test10.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2SectionPtr
+create_4gray ()
+{
+/* creating a synthetic "4gray" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024;
+ int idx = 0;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 256; row += 4)
+ {
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 4)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 3)
+ ix = 0;
+ }
+ }
+ idx++;
+ if (idx > 3)
+ idx = 0;
+ }
+
+ for (row = 256; row < 512; row += 8)
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 8)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 3)
+ ix = 0;
+ }
+ }
+ idx++;
+ if (idx > 3)
+ idx = 0;
+ }
+
+ for (row = 512; row < 768; row++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 8)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 3)
+ ix = 0;
+ }
+ }
+
+ for (row = 768; row < 1024; row += 8)
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = idx;
+ }
+ idx++;
+ if (idx > 3)
+ idx = 0;
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_2_BIT, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("4gray", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_4grays (rl2SectionPtr img)
+{
+/* testing 4-GRAYS buffer functions */
+ unsigned char *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ unsigned char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "4-GRAYS invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: 4-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (510 * 3);
+ if (*(p_data1 + 0) != 170 || *(p_data1 + 1) != 170 || *(p_data1 + 2) != 170)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #1: 4-GRAYS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: 4-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: 4-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 170 || *(p_data1 + 1) != 170 || *(p_data1 + 2) != 170
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: 4-GRAYS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 255
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: 4-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: 4-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 170 || *(p_data1 + 2) != 170
+ || *(p_data1 + 3) != 170)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: 4-GRAYS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 255
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: 4-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: 4-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (510 * 3);
+ if (*(p_data1 + 0) != 170 || *(p_data1 + 1) != 170 || *(p_data1 + 2) != 170)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: 4-GRAYS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: 4-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: 4-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 170 || *(p_data1 + 1) != 170 || *(p_data1 + 2) != 170
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: 4-GRAYS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 255
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: 4-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_2bit (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get 2-BIT data: 4-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 2)
+ {
+ fprintf (stderr, "Unexpected 2-BIT pixel #1: 4-GRAYS\n");
+ return 0;
+ }
+ if (*p_data2 != 3)
+ {
+ fprintf (stderr, "Unexpected 2-BIT pixel #2: 4-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: 4-GRAYS\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: 4-GRAYS\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: 4-GRAYS\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_2_BIT)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: 4-GRAYS\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_GRAYSCALE)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: 4-GRAYS\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: 4-GRAYS\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_2bit (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel 2-BIT: 4-GRAYS\n");
+ return 0;
+ }
+
+ if (sample != 2)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel 2-BIT Sample value %d: 4-GRAYS\n", sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_2bit (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample 2-BIT: 4-GRAYS\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_2bit (pxl, 4) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample 2-BIT (exceeding value): 4-GRAYS\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: 4-GRAYS\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *blob_odd_png;
+ int blob_odd_sz_png;
+ unsigned char *blob_even_png;
+ int blob_even_sz_png;
+ unsigned char *blob_odd_gif;
+ int blob_odd_sz_gif;
+ unsigned char *blob_even_gif;
+ int blob_even_sz_gif;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int endian = naturalEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_4gray ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: 4gray\n");
+ return -1;
+ }
+
+ if (rl2_section_to_jpeg (img, "./4gray.jpg", 70) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 4gray.jpg\n");
+ return -2;
+ }
+
+ if (rl2_section_to_png (img, "./4gray.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 4gray.png\n");
+ return -3;
+ }
+
+ if (!test_4grays (img))
+ return -4;
+
+ rl2_destroy_section (img);
+
+ unlink ("./4gray.jpg");
+
+ img = rl2_section_from_png ("./4gray.png");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./4gray.png");
+ return -5;
+ }
+
+ unlink ("./4gray.png");
+
+ if (rl2_section_to_png (img, "./from_4gray.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_4gray.png\n");
+ return -6;
+ }
+
+ unlink ("./from_4gray.png");
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -7;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -8;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_PNG, &blob_odd_png, &blob_odd_sz_png,
+ &blob_even_png, &blob_even_sz_png, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - PNG\n");
+ return -9;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd_png, blob_odd_sz_png, blob_even_png,
+ blob_even_sz_png, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_GIF, &blob_odd_gif, &blob_odd_sz_gif,
+ &blob_even_gif, &blob_even_sz_gif, 0, endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - GIF\n");
+ return -10;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -11;
+ }
+
+ img = rl2_create_section ("4gray 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - uncompressed\n");
+ return -12;
+ }
+
+ if (rl2_section_to_png (img, "./4gray_1_1_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 4gray_1_1_uncompressed.png\n");
+ return -13;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./4gray_1_1_uncompressed.png");
+
+ if (rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - uncompressed\n");
+ return -14;
+ }
+
+ if (rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:4 - uncompressed\n");
+ return -15;
+ }
+
+ if (rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:8 - uncompressed\n");
+ return -16;
+ }
+ free (blob_odd);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - png\n");
+ return -17;
+ }
+
+ img = rl2_create_section ("4gray 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - png\n");
+ return -18;
+ }
+
+ if (rl2_section_to_png (img, "./4gray_1_1_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 4gray_1_1_png.png\n");
+ return -19;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./4gray_1_1_png.png");
+
+ if (rl2_raster_decode
+ (RL2_SCALE_2, blob_odd_png, blob_odd_sz_png, blob_even_png,
+ blob_even_sz_png, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - png\n");
+ return -20;
+ }
+ free (blob_odd_png);
+
+ return 0;
+}
diff --git a/test/test11.c b/test/test11.c
new file mode 100644
index 0000000..f9906a3
--- /dev/null
+++ b/test/test11.c
@@ -0,0 +1,387 @@
+/*
+
+ test11.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static rl2SectionPtr
+create_grid_8 ()
+{
+/* creating a synthetic "grid_8" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024;
+ char sample = -128;
+ unsigned char *bufpix = malloc (bufsize);
+ char *p = (char *) bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = sample;
+ if (sample == 127)
+ sample = -128;
+ else
+ sample++;
+ }
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_INT8, RL2_PIXEL_DATAGRID, 1,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("grid_8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_grid_8 (rl2SectionPtr img)
+{
+/* testing GRID-8 buffer functions */
+ unsigned char *ubuffer;
+ char *buffer;
+ int buf_size;
+ int width = 1024;
+ char *p_data1;
+ char *p_data2;
+ char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "GRID-8 invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB data: GRID-8\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGBA data: GRID-8\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_ARGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get ARGB data: GRID-8\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGR (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGR data: GRID-8\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGRA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGRA data: GRID-8\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_int8 (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get INT8 data: GRID-8\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != -108)
+ {
+ fprintf (stderr, "Unexpected INT8 pixel #1: GRID-8\n");
+ return 0;
+ }
+ if (*p_data2 != 126)
+ {
+ fprintf (stderr, "Unexpected INT8 pixel #2: GRID-8\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: GRID-8\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel (20,20) from Raster: GRID-8\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to create get Pixel Type: from_palette_png.png\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_INT8)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: GRID-8\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: GRID-8\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: GRID-8\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_int8 (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel INT8: GRID-8\n");
+ return 0;
+ }
+
+ if (sample != -108)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel INT8 Sample value %d: GRID-8\n", sample);
+ return 0;
+ }
+
+ if (rl2_is_pixel_transparent (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel Transparency: GRID-8\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: GRID-8\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_opaque (pxl, &is_transparent) != RL2_OK)
+
+ {
+ fprintf (stderr, "Unable to get Pixel Opacity: GRID-8\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_TRUE)
+
+ {
+ fprintf (stderr, "Unexpected Pixel Opacity: GRID-8\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_int8 (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample INT8: GRID-8\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Pixel (20,20) into Raster: GRID-8\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_grid_8 ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grid_8\n");
+ return -1;
+ }
+
+ if (!test_grid_8 (img))
+ return -2;
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -3;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -4;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -5;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -6;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -7;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -8;
+ }
+ rl2_destroy_raster (raster);
+ free (blob_odd);
+ free (blob_even);
+
+ return 0;
+}
diff --git a/test/test12.c b/test/test12.c
new file mode 100644
index 0000000..13c71e0
--- /dev/null
+++ b/test/test12.c
@@ -0,0 +1,387 @@
+/*
+
+ test12.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2SectionPtr
+create_grid_u8 ()
+{
+/* creating a synthetic "grid_u8" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024;
+ unsigned char sample = 0;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = sample;
+ if (sample == 255)
+ sample = 0;
+ else
+ sample++;
+ }
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 1,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("grid_u8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_grid_u8 (rl2SectionPtr img)
+{
+/* testing GRID-U8 buffer functions */
+ unsigned char *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ unsigned char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "GRID-U8 invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB data: GRID-U8\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGBA data: GRID-U8\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get ARGB data: GRID-U8\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGR data: GRID-U8\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGRA data: GRID-U8\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_uint8 (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get UINT8 data: GRID-U8\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 20)
+ {
+ fprintf (stderr, "Unexpected UINT8 pixel #1: GRID-U8\n");
+ return 0;
+ }
+ if (*p_data2 != 254)
+ {
+ fprintf (stderr, "Unexpected UINT8 pixel #2: GRID-U8\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: GRID-U8\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: GRID-U8\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: GRID-U8\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: GRID-U8\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: GRID-U8\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: GRID-U8\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (pxl, RL2_DATAGRID_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel UINT8: GRID-U8\n");
+ return 0;
+ }
+
+ if (sample != 20)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel UINT8 Sample value %d: GRID-U8\n", sample);
+ return 0;
+ }
+
+ if (rl2_is_pixel_transparent (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel Transparency: GRID-U8\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: GRID-U8\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_opaque (pxl, &is_transparent) != RL2_OK)
+
+ {
+ fprintf (stderr, "Unexpected Pixel Opacity: GRID-U8\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_TRUE)
+
+ {
+ fprintf (stderr, "Unexpected Pixel Opacity: GRID-U8\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (pxl, RL2_DATAGRID_BAND, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample UINT8: GRID-U8\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: GRID-U8\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int endian = naturalEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_grid_u8 ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grid_u8\n");
+ return -1;
+ }
+
+ if (!test_grid_u8 (img))
+ return -2;
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -3;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -4;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -5;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -6;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -7;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -8;
+ }
+ rl2_destroy_raster (raster);
+ free (blob_odd);
+ free (blob_even);
+
+ return 0;
+}
diff --git a/test/test13.c b/test/test13.c
new file mode 100644
index 0000000..0303646
--- /dev/null
+++ b/test/test13.c
@@ -0,0 +1,462 @@
+/*
+
+ test13.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2SectionPtr
+create_grid_16 ()
+{
+/* creating a synthetic "grid_16" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (short);
+ short sample = -32768;
+ unsigned char *bufpix = malloc (bufsize);
+ short *p = (short *) bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = sample;
+ if (sample == 32767)
+ sample = -32768;
+ else
+ sample++;
+ }
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_INT16, RL2_PIXEL_DATAGRID, 1,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("grid_16", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_grid_16 (rl2SectionPtr img)
+{
+/* testing GRID-16 buffer functions */
+ unsigned char *ubuffer;
+ short *buffer;
+ int buf_size;
+ int width = 1024;
+ short *p_data1;
+ short *p_data2;
+ short sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "GRID-16 invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB data: GRID-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGBA data: GRID-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_ARGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get ARGB data: GRID-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGR (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGR data: GRID-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGRA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGRA data: GRID-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_int16 (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get INT16 data: GRID-16\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != -12268)
+ {
+ fprintf (stderr, "Unexpected INT16 pixel #1: GRID-16\n");
+ return 0;
+ }
+ if (*p_data2 != -15874)
+ {
+ fprintf (stderr, "Unexpected INT16 pixel #2: GRID-16\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: GRID-16\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: GRID-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: GRID-16\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_INT16)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: GRID-16\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: GRID-16\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: GRID-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_int16 (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel INT16: GRID-16\n");
+ return 0;
+ }
+
+ if (sample != -12268)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel INT16 Sample value %d: GRID-16\n", sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_int16 (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample INT16: GRID-16\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_transparent (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel Transparency: GRID-16\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: GRID-16\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_opaque (pxl, &is_transparent) != RL2_OK)
+
+ {
+ fprintf (stderr, "Unable to get Pixel Opacity: GRID-16\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_TRUE)
+
+ {
+ fprintf (stderr, "Unexpected Pixel Opacity: GRID-16\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: GRID-16\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *anti_odd;
+ int anti_odd_sz;
+ unsigned char *anti_even;
+ int anti_even_sz;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int endian = naturalEndian ();
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_grid_16 ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grid_16\n");
+ return -1;
+ }
+
+ if (!test_grid_16 (img))
+ return -2;
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -3;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -4;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &anti_odd, &anti_odd_sz, &anti_even,
+ &anti_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed (anti-endian)\n");
+ return -5;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -6;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -7;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -8;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -9;
+ }
+ rl2_destroy_raster (raster);
+ free (blob_odd);
+ free (blob_even);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:1 - uncompressed (anti-endian)\n");
+ return -10;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:2 - uncompressed (anti-endian)\n");
+ return -11;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:4 - uncompressed (anti-endian)\n");
+ return -12;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:8 - uncompressed (anti-endian)\n");
+ return -13;
+ }
+ rl2_destroy_raster (raster);
+ free (anti_odd);
+ free (anti_even);
+
+ return 0;
+}
diff --git a/test/test14.c b/test/test14.c
new file mode 100644
index 0000000..4911b33
--- /dev/null
+++ b/test/test14.c
@@ -0,0 +1,463 @@
+/*
+
+ test14.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2SectionPtr
+create_grid_u16 ()
+{
+/* creating a synthetic "grid_u16" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (unsigned short);
+ unsigned short sample = 0;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned short *p = (unsigned short *) bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = sample;
+ if (sample == 65535)
+ sample = 0;
+ else
+ sample++;
+ }
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_UINT16, RL2_PIXEL_DATAGRID, 1,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("grid_u16", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_grid_u16 (rl2SectionPtr img)
+{
+/* testing GRID-U16 buffer functions */
+ unsigned char *ubuffer;
+ unsigned short *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned short *p_data1;
+ unsigned short *p_data2;
+ unsigned short sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "GRID-U16 invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB data: GRID-U16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGBA data: GRID-U16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_ARGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get ARGB data: GRID-U16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGR (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGR data: GRID-U16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGRA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGRA data: GRID-U16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_uint16 (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get UINT16 data: GRID-U16\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 20500)
+ {
+ fprintf (stderr, "Unexpected UINT16 pixel #1: GRID-U16\n");
+ return 0;
+ }
+ if (*p_data2 != 16894)
+ {
+ fprintf (stderr, "Unexpected UINT16 pixel #2: GRID-U16\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: GRID-U16\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: GRID-U16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: GRID-U16\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT16)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: GRID-U16\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: GRID-U16\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: GRID-U16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, RL2_DATAGRID_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel UINT16: GRID-U16\n");
+ return 0;
+ }
+
+ if (sample != 20500)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel UINT16 Sample value %d: GRID-U16\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_is_pixel_transparent (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel Transparency: GRID-U16\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: GRID-U16\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_opaque (pxl, &is_transparent) != RL2_OK)
+
+ {
+ fprintf (stderr, "Unable to get Pixel Opacity: GRID-U16\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_TRUE)
+
+ {
+ fprintf (stderr, "Unexpected Pixel Opacity: GRID-U16\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, RL2_DATAGRID_BAND, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample UINT16: GRID-U16\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: GRID-U16\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *anti_odd;
+ int anti_odd_sz;
+ unsigned char *anti_even;
+ int anti_even_sz;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int endian = naturalEndian ();
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_grid_u16 ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grid_u16\n");
+ return -1;
+ }
+
+ if (!test_grid_u16 (img))
+ return -2;
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -3;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -4;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &anti_odd, &anti_odd_sz, &anti_even,
+ &anti_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed (anti-endian)\n");
+ return -5;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -6;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -7;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -8;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -9;
+ }
+ rl2_destroy_raster (raster);
+ free (blob_odd);
+ free (blob_even);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:1 - uncompressed (anti-endian)\n");
+ return -10;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:2 - uncompressed (anti-endian)\n");
+ return -11;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:4 - uncompressed (anti-endian)\n");
+ return -12;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:8 - uncompressed (anti-endian)\n");
+ return -13;
+ }
+ rl2_destroy_raster (raster);
+ free (anti_odd);
+ free (anti_even);
+
+ return 0;
+}
diff --git a/test/test15.c b/test/test15.c
new file mode 100644
index 0000000..7597404
--- /dev/null
+++ b/test/test15.c
@@ -0,0 +1,456 @@
+/*
+
+ test15.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2SectionPtr
+create_grid_32 ()
+{
+/* creating a synthetic "grid_32" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (int);
+ int sample = -50000;
+ unsigned char *bufpix = malloc (bufsize);
+ int *p = (int *) bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = sample++;
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_INT32, RL2_PIXEL_DATAGRID, 1,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("grid_32", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_grid_32 (rl2SectionPtr img)
+{
+/* testing GRID-32 buffer functions */
+ unsigned char *ubuffer;
+ int *buffer;
+ int buf_size;
+ int width = 1024;
+ int *p_data1;
+ int *p_data2;
+ int sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "GRID-32 invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB data: GRID-32\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGBA data: GRID-32\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_ARGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get ARGB data: GRID-32\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGR (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGR data: GRID-32\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGRA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGRA data: GRID-32\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_int32 (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get INT32 data: GRID-32\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != -29500)
+ {
+ fprintf (stderr, "Unexpected INT32 pixel #1: GRID-32\n");
+ return 0;
+ }
+ if (*p_data2 != 687790)
+ {
+ fprintf (stderr, "Unexpected INT32 pixel #2: GRID-32\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: GRID-32\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: GRID-32\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: GRID-32\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_INT32)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: GRID-32\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: GRID-32\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: GRID-32\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_int32 (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel INT32: GRID-32\n");
+ return 0;
+ }
+
+ if (sample != -29500)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel INT32 Sample value %d: GRID-32\n", sample);
+ return 0;
+ }
+
+ if (rl2_is_pixel_transparent (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel Transparency: GRID-32\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: GRID-32\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_opaque (pxl, &is_transparent) != RL2_OK)
+
+ {
+ fprintf (stderr, "Unable to get Pixel Opacity: GRID-32\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_TRUE)
+
+ {
+ fprintf (stderr, "Unexpected Pixel Opacity: GRID-32\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_int32 (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample INT32: GRID-32\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: GRID-32\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *anti_odd;
+ int anti_odd_sz;
+ unsigned char *anti_even;
+ int anti_even_sz;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int endian = naturalEndian ();
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_grid_32 ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grid_32\n");
+ return -1;
+ }
+
+ if (!test_grid_32 (img))
+ return -2;
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -3;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -4;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &anti_odd, &anti_odd_sz, &anti_even,
+ &anti_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed (anti-endian)\n");
+ return -5;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -6;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -7;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -8;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -9;
+ }
+ rl2_destroy_raster (raster);
+ free (blob_odd);
+ free (blob_even);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:1 - uncompressed (anti-endian)\n");
+ return -10;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:2 - uncompressed (anti-endian)\n");
+ return -11;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:4 - uncompressed (anti-endian)\n");
+ return -12;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:8 - uncompressed (anti-endian)\n");
+ return -13;
+ }
+ rl2_destroy_raster (raster);
+ free (anti_odd);
+ free (anti_even);
+
+ return 0;
+}
diff --git a/test/test16.c b/test/test16.c
new file mode 100644
index 0000000..d8daaf5
--- /dev/null
+++ b/test/test16.c
@@ -0,0 +1,457 @@
+/*
+
+ test16.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2SectionPtr
+create_grid_u32 ()
+{
+/* creating a synthetic "grid_u32" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (unsigned int);
+ unsigned int sample = 124346;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned int *p = (unsigned int *) bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = sample++;
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_UINT32, RL2_PIXEL_DATAGRID, 1,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("grid_u32", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_grid_u32 (rl2SectionPtr img)
+{
+/* testing GRID-U32 buffer functions */
+ unsigned char *ubuffer;
+ unsigned int *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned int *p_data1;
+ unsigned int *p_data2;
+ unsigned int sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "GRID-U32 invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB data: GRID-U32\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGBA data: GRID-U32\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_ARGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get ARGB data: GRID-U32\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGR (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGR data: GRID-U32\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGRA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGRA data: GRID-U32\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_uint32 (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get UINT32 data: GRID-U32\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 144846)
+ {
+ fprintf (stderr, "Unexpected UINT32 pixel #1: GRID-U32\n");
+ return 0;
+ }
+ if (*p_data2 != 862136)
+ {
+ fprintf (stderr, "Unexpected UINT32 pixel #2: GRID-U32\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: GRID-U32\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: GRID-U32\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: GRID-U32\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT32)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: GRID-U32\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: GRID-U32\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: GRID-U32\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint32 (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel UINT32: GRID-U32\n");
+ return 0;
+ }
+
+ if (sample != 144846)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel UINT32 Sample value %d: GRID-U32\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_is_pixel_transparent (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel Transparency: GRID-U32\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: GRID-U32\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_opaque (pxl, &is_transparent) != RL2_OK)
+
+ {
+ fprintf (stderr, "Unable to get Pixel Opacity: GRID-U32\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_TRUE)
+
+ {
+ fprintf (stderr, "Unexpected Pixel Opacity: GRID-U32\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint32 (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample UINT32: GRID-U32\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: GRID-U32\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *anti_odd;
+ int anti_odd_sz;
+ unsigned char *anti_even;
+ int anti_even_sz;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int endian = naturalEndian ();
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_grid_u32 ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grid_u32\n");
+ return -1;
+ }
+
+ if (!test_grid_u32 (img))
+ return -2;
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -3;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -4;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &anti_odd, &anti_odd_sz, &anti_even,
+ &anti_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed (anti-endian)\n");
+ return -5;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -6;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -7;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -8;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -9;
+ }
+ rl2_destroy_raster (raster);
+ free (blob_odd);
+ free (blob_even);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:1 - uncompressed (anti-endian)\n");
+ return -10;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:2 - uncompressed (anti-endian)\n");
+ return -11;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:4 - uncompressed (anti-endian)\n");
+ return -12;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:8 - uncompressed (anti-endian)\n");
+ return -13;
+ }
+ rl2_destroy_raster (raster);
+ free (anti_odd);
+ free (anti_even);
+
+ return 0;
+}
diff --git a/test/test17.c b/test/test17.c
new file mode 100644
index 0000000..acb37c1
--- /dev/null
+++ b/test/test17.c
@@ -0,0 +1,460 @@
+/*
+
+ test17.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2SectionPtr
+create_grid_float ()
+{
+/* creating a synthetic "grid_flt" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (float);
+ float sample = -1000.5;
+ unsigned char *bufpix = malloc (bufsize);
+ float *p = (float *) bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = sample;
+ sample += 0.5;
+ }
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_FLOAT, RL2_PIXEL_DATAGRID, 1,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("grid_flt", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_grid_float (rl2SectionPtr img)
+{
+/* testing GRID-FLT buffer functions */
+ unsigned char *ubuffer;
+ float *buffer;
+ int buf_size;
+ int width = 1024;
+ float *p_data1;
+ float *p_data2;
+ float sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "GRID-FLT invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB data: GRID-FLT\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGBA data: GRID-FLT\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_ARGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get ARGB data: GRID-FLT\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGR (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGR data: GRID-FLT\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGRA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGRA data: GRID-FLT\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_float (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get FLOAT data: GRID-FLT\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 9249.5)
+ {
+ fprintf (stderr, "Unexpected FLOAT pixel #1: GRID-FLT\n");
+ return 0;
+ }
+ if (*p_data2 != 367894.5)
+ {
+ fprintf (stderr, "Unexpected FLOAT pixel #2: GRID-FLT\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: GRID-FLT\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: GRID-FLT\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: GRID-FLT\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_FLOAT)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: GRID-FLT\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: GRID-FLT\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: GRID-FLT\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_float (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel FLOAT: GRID-FLT\n");
+ return 0;
+ }
+
+ if (sample != 9249.5)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel FLOAT Sample value %1.6f: GRID-FLT\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_is_pixel_transparent (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel Transparency: GRID-FLT\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: GRID-FLT\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_opaque (pxl, &is_transparent) != RL2_OK)
+
+ {
+ fprintf (stderr, "Unable to get Pixel Opacity: GRID-FLT\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_TRUE)
+
+ {
+ fprintf (stderr, "Unexpected Pixel Opacity: GRID-FLT\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_float (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample FLOAT: GRID-FLT\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: GRID-FLT\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *anti_odd;
+ int anti_odd_sz;
+ unsigned char *anti_even;
+ int anti_even_sz;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int endian = naturalEndian ();
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_grid_float ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grid_float\n");
+ return -1;
+ }
+
+ if (!test_grid_float (img))
+ return -2;
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -3;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -4;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &anti_odd, &anti_odd_sz, &anti_even,
+ &anti_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed (anti-endian)\n");
+ return -5;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -6;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -7;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -8;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -9;
+ }
+ rl2_destroy_raster (raster);
+ free (blob_odd);
+ free (blob_even);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:1 - uncompressed (anti-endian)\n");
+ return -10;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:2 - uncompressed (anti-endian)\n");
+ return -11;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:4 - uncompressed (anti-endian)\n");
+ return -12;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:8 - uncompressed (anti-endian)\n");
+ return -13;
+ }
+ rl2_destroy_raster (raster);
+ free (anti_odd);
+ free (anti_even);
+
+ return 0;
+}
diff --git a/test/test18.c b/test/test18.c
new file mode 100644
index 0000000..698dec3
--- /dev/null
+++ b/test/test18.c
@@ -0,0 +1,460 @@
+/*
+
+ test18.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2SectionPtr
+create_grid_double ()
+{
+/* creating a synthetic "grid_dbl" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (double);
+ double sample = -12000.5;
+ unsigned char *bufpix = malloc (bufsize);
+ double *p = (double *) bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = sample;
+ sample += 0.5;
+ }
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_DOUBLE, RL2_PIXEL_DATAGRID, 1,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("grid_dbl", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_grid_double (rl2SectionPtr img)
+{
+/* testing GRID-DOUBLE buffer functions */
+ unsigned char *ubuffer;
+ double *buffer;
+ int buf_size;
+ int width = 1024;
+ double *p_data1;
+ double *p_data2;
+ double sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "GRID-DBL invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB data: GRID-DBL\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGBA data: GRID-DBL\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_ARGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get ARGB data: GRID-DBL\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGR (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGR data: GRID-DBL\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGRA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGRA data: GRID-DBL\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_double (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get DOUBLE data: GRID-DBL\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != -1750.5)
+ {
+ fprintf (stderr, "Unexpected DOUBLE pixel #1: GRID-DBL\n");
+ return 0;
+ }
+ if (*p_data2 != 356894.5)
+ {
+ fprintf (stderr, "Unexpected DOUBLE pixel #2: GRID-DBL\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: GRID-DBL\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: GRID-DBL\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: GRID-DBL\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_DOUBLE)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: GRID-DBL\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: GRID-DBL\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: GRID-DBL\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_double (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel DOUBLE: GRID-DBL\n");
+ return 0;
+ }
+
+ if (sample != -1750.5)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel DOUBLE Sample value %1.f: GRID-DBL\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_is_pixel_transparent (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel Transparency: GRID-DBL\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: GRID-DBL\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_opaque (pxl, &is_transparent) != RL2_OK)
+
+ {
+ fprintf (stderr, "Unable to get Pixel Opacity: GRID-DBL\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_TRUE)
+
+ {
+ fprintf (stderr, "Unexpected Pixel Opacity: GRID-DBL\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_double (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample DOUBLE: GRID-DBL\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: GRID-DBL\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *anti_odd;
+ int anti_odd_sz;
+ unsigned char *anti_even;
+ int anti_even_sz;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int endian = naturalEndian ();
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_grid_double ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grid_double\n");
+ return -1;
+ }
+
+ if (!test_grid_double (img))
+ return -2;
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -3;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -4;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &anti_odd, &anti_odd_sz, &anti_even,
+ &anti_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -5;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -6;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -7;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -8;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -9;
+ }
+ rl2_destroy_raster (raster);
+ free (blob_odd);
+ free (blob_even);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:1 - uncompressed (anti-endian)\n");
+ return -10;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:2 - uncompressed (anti-endian)\n");
+ return -11;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:4 - uncompressed (anti-endian)\n");
+ return -12;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:8 - uncompressed (anti-endian)\n");
+ return -13;
+ }
+ rl2_destroy_raster (raster);
+ free (anti_odd);
+ free (anti_even);
+
+ return 0;
+}
diff --git a/test/test19.c b/test/test19.c
new file mode 100644
index 0000000..b463fb7
--- /dev/null
+++ b/test/test19.c
@@ -0,0 +1,588 @@
+/*
+
+ test20.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static rl2SectionPtr
+create_grid_multi16 ()
+{
+/* creating a synthetic "grid_multi8" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (unsigned short) * 5;
+ unsigned short band1 = 0;
+ unsigned short band2 = 65535;
+ unsigned short band3 = 10000;
+ unsigned short band4 = 20000;
+ unsigned short band5 = 30000;
+ unsigned short *bufpix = malloc (bufsize);
+ unsigned short *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = band1;
+ *p++ = band2;
+ *p++ = band3;
+ *p++ = band4;
+ *p++ = band5;
+ if (band1 == 65535)
+ band1 = 0;
+ else
+ band1++;
+ if (band2 == 0)
+ band2 = 65535;
+ else
+ band2--;
+ if (band3 == 65535)
+ band3 = 0;
+ else
+ band3++;
+ if (band4 == 0)
+ band4 = 65535;
+ else
+ band4--;
+ if (band5 == 65535)
+ band5 = 0;
+ else
+ band5++;
+ }
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_UINT16, RL2_PIXEL_MULTIBAND,
+ 5, (unsigned char *) bufpix, bufsize, NULL, NULL, 0,
+ NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("grid_multi16", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_grid_multi16 (rl2SectionPtr img)
+{
+/* testing GRID-MULTI16 buffer functions */
+ unsigned char *ubuffer;
+ unsigned short *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned short *p_data1;
+ unsigned short *p_data2;
+ unsigned short sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "MULTI-16 invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB data: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGBA data: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_ARGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get ARGB data: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGR (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGR data: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGRA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGRA data: MULTI-8\n");
+ return 0;
+ }
+
+ if (rl2_raster_bands_to_RGB (rst, 0, 3, 4, &ubuffer, &buf_size) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB band data: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint16 (rst, 2, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Band#2 data: MULTI-16\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 30500)
+ {
+ fprintf (stderr, "Unexpected Band#2 pixel #1: MULTI-16\n");
+ return 0;
+ }
+ if (*p_data2 != 26894)
+ {
+ fprintf (stderr, "Unexpected Band#2 pixel #2: MULTI-16\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_band_to_uint16 (rst, 4, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Band#4 data: MULTI-16\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 50500)
+ {
+ fprintf (stderr, "Unexpected Band#4 pixel #1: MULTI-16\n");
+ return 0;
+ }
+ if (*p_data2 != 46894)
+ {
+ fprintf (stderr, "Unexpected Band#4 pixel #2: MULTI-16\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT16)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: MULTI-16\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_MULTIBAND)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: MULTI-16\n");
+ return 0;
+ }
+
+ if (num_bands != 5)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_transparent (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: MULTI-16\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_opaque (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel Opacity: MULTI-16\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_TRUE)
+ {
+ fprintf (stderr, "Unexpected Pixel Opacity: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 0, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#0: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample != 20500)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel Sample Band#0 value %d: MULTI-16\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 0, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#0: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 1, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#1: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample != 45035)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel Sample Band#1 value %d: MULTI-16\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 1, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#1: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 2, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#2: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample != 30500)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel Sample Band#2 value %d: MULTI-16\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 2, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#2: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 3, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#3: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample != 65036)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel Sample Band#3 value %d: MULTI-16\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 3, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#3: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 4, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#4: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample != 50500)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel Sample Band#4 value %d: MULTI-16\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 4, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#4: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 5, &sample) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#5: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 5, sample) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#5: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: MULTI-16\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *anti_odd;
+ int anti_odd_sz;
+ unsigned char *anti_even;
+ int anti_even_sz;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_grid_multi16 ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grid_multi16\n");
+ return -1;
+ }
+
+ if (!test_grid_multi16 (img))
+ return -2;
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -3;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -4;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &anti_odd, &anti_odd_sz, &anti_even,
+ &anti_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed (anti-endian)\n");
+ return -5;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -6;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -7;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -8;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -9;
+ }
+ rl2_destroy_raster (raster);
+ free (blob_odd);
+ free (blob_even);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:1 - uncompressed (anti-endian)\n");
+ return -10;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:2 - uncompressed (anti-endian)\n");
+ return -11;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:4 - uncompressed (anti-endian)\n");
+ return -12;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:8 - uncompressed (anti-endian)\n");
+ return -13;
+ }
+ rl2_destroy_raster (raster);
+ free (anti_odd);
+ free (anti_even);
+
+ return 0;
+}
diff --git a/test/test2.c b/test/test2.c
new file mode 100644
index 0000000..f8f3d75
--- /dev/null
+++ b/test/test2.c
@@ -0,0 +1,988 @@
+/*
+
+ test2.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static rl2SectionPtr
+create_rainbow ()
+{
+/* creating a synthetic "rainbow" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ int bufsize = 1024 * 1024 * 3;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ red = 0;
+ for (row = 0; row < 256; row++)
+ {
+ green = 0;
+ blue = 255;
+ for (col = 0; col < 256; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = blue;
+ green++;
+ blue--;
+ }
+ for (col = 256; col < 512; col++)
+ {
+ *p++ = red;
+ *p++ = 127;
+ *p++ = 127;
+ }
+ green = 255;
+ blue = 0;
+ for (col = 512; col < 768; col++)
+ {
+ *p++ = 255 - red;
+ *p++ = green;
+ *p++ = blue;
+ green--;
+ blue++;
+ }
+ for (col = 768; col < 1024; col++)
+ {
+ *p++ = 127;
+ *p++ = red;
+ *p++ = red;
+ }
+ red++;
+ }
+
+ green = 0;
+ for (row = 256; row < 512; row++)
+ {
+ red = 0;
+ blue = 255;
+ for (col = 0; col < 256; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = blue;
+ red++;
+ blue--;
+ }
+ for (col = 256; col < 512; col++)
+ {
+ *p++ = 127;
+ *p++ = green;
+ *p++ = 127;
+ }
+ red = 255;
+ blue = 0;
+ for (col = 512; col < 768; col++)
+ {
+ *p++ = red;
+ *p++ = 255 - green;
+ *p++ = blue;
+ red--;
+ blue++;
+ }
+ for (col = 768; col < 1024; col++)
+ {
+ *p++ = green;
+ *p++ = 127;
+ *p++ = green;
+ }
+ green++;
+ }
+
+ blue = 0;
+ for (row = 512; row < 768; row++)
+ {
+ red = 0;
+ green = 255;
+ for (col = 0; col < 256; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = blue;
+ red++;
+ green--;
+ }
+ for (col = 256; col < 512; col++)
+ {
+ *p++ = 127;
+ *p++ = 127;
+ *p++ = blue;
+ }
+ red = 255;
+ green = 0;
+ for (col = 512; col < 768; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = 255 - blue;
+ red--;
+ green++;
+ }
+ for (col = 768; col < 1024; col++)
+ {
+ *p++ = blue;
+ *p++ = blue;
+ *p++ = 127;
+ }
+ blue++;
+ }
+
+ red = 0;
+ for (row = 768; row < 1024; row++)
+ {
+ for (col = 0; col < 256; col++)
+ {
+ *p++ = 0;
+ *p++ = 0;
+ *p++ = 0;
+ }
+ for (col = 256; col < 512; col++)
+ {
+ *p++ = red;
+ *p++ = red;
+ *p++ = red;
+ }
+ green = 255;
+ blue = 0;
+ for (col = 512; col < 768; col++)
+ {
+ *p++ = 255 - red;
+ *p++ = 255 - red;
+ *p++ = 255 - red;
+ }
+ for (col = 768; col < 1024; col++)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ }
+ red++;
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ {
+ free (bufpix);
+ return NULL;
+ }
+
+ scn = rl2_create_section ("rainbow", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *blob_odd_zip;
+ int blob_odd_sz_zip;
+ unsigned char *blob_even_zip;
+ int blob_even_sz_zip;
+ unsigned char *blob_odd_lzma;
+ int blob_odd_sz_lzma;
+ unsigned char *blob_even_lzma;
+ int blob_even_sz_lzma;
+ unsigned char *blob_odd_jpeg;
+ int blob_odd_sz_jpeg;
+ unsigned char *blob_even_jpeg;
+ int blob_even_sz_jpeg;
+ unsigned char *blob_odd_lossy_webp;
+ int blob_odd_sz_lossy_webp;
+ unsigned char *blob_even_lossy_webp;
+ int blob_even_sz_lossy_webp;
+ unsigned char *blob_odd_lossless_webp;
+ int blob_odd_sz_lossless_webp;
+ unsigned char *blob_even_lossless_webp;
+ int blob_even_sz_lossless_webp;
+ unsigned char *blob_odd_png;
+ int blob_odd_sz_png;
+ unsigned char *blob_even_png;
+ int blob_even_sz_png;
+ unsigned char *blob_odd_gif;
+ int blob_odd_sz_gif;
+ unsigned char *blob_even_gif;
+ int blob_even_sz_gif;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_rainbow ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: rainbow\n");
+ return -1;
+ }
+
+ if (rl2_section_to_jpeg (img, "./rainbow.jpg", 70) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow.jpg\n");
+ return -2;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow.png\n");
+ return -3;
+ }
+
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow.jpg");
+
+ img = rl2_section_from_png ("./rainbow.png");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./rainbow.png");
+ return -4;
+ }
+
+ unlink ("./rainbow.png");
+
+ if (rl2_section_to_png (img, "./from_rainbow.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_rainbow.png\n");
+ return -5;
+ }
+
+ unlink ("./from_rainbow.png");
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -6;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -7;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_DEFLATE, &blob_odd_zip, &blob_odd_sz_zip,
+ &blob_even_zip, &blob_even_sz_zip, 0, anti_endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - DEFLATE compressed\n");
+ return -8;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_LZMA, &blob_odd_lzma, &blob_odd_sz_lzma,
+ &blob_even_lzma, &blob_even_sz_lzma, 0, anti_endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - LZMA compressed\n");
+ return -9;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_JPEG, &blob_odd_jpeg, &blob_odd_sz_jpeg,
+ &blob_even_jpeg, &blob_even_sz_jpeg, 70, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - JPEG compressed\n");
+ return -10;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd_jpeg, blob_odd_sz_jpeg,
+ blob_even_jpeg, blob_even_sz_jpeg, NULL,
+ NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_LOSSY_WEBP, &blob_odd_lossy_webp,
+ &blob_odd_sz_lossy_webp, &blob_even_lossy_webp,
+ &blob_even_sz_lossy_webp, 10, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - lossy WEBP compressed\n");
+ return -11;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_LOSSLESS_WEBP, &blob_odd_lossless_webp,
+ &blob_odd_sz_lossless_webp, &blob_even_lossless_webp,
+ &blob_even_sz_lossless_webp, 10, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - lossless WEBP compressed\n");
+ return -12;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_PNG, &blob_odd_png, &blob_odd_sz_png,
+ &blob_even_png, &blob_even_sz_png, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - PNG compressed\n");
+ return -13;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_GIF, &blob_odd_gif, &blob_odd_sz_gif,
+ &blob_even_gif, &blob_even_sz_gif, 0, anti_endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - GIF compressed\n");
+ return -14;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -15;
+ }
+
+ img = rl2_create_section ("rainbow 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - uncompressed\n");
+ return -16;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_1_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_1_uncompressed.png\n");
+ return -17;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_1_uncompressed.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -18;
+ }
+
+ img = rl2_create_section ("rainbow 1:2", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:2 - uncompressed\n");
+ return -19;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_2_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_2_uncompressed.png\n");
+ return -20;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_2_uncompressed.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -21;
+ }
+
+ img = rl2_create_section ("rainbow 1:4", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:4 - uncompressed\n");
+ return -22;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_4_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_4_uncompressed.png\n");
+ return -23;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_4_uncompressed.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -24;
+ }
+
+ img = rl2_create_section ("rainbow 1:8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:8 - uncompressed\n");
+ return -25;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_8_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_8_uncompressed.png\n");
+ return -26;
+ }
+ rl2_destroy_section (img);
+ free (blob_odd);
+ free (blob_even);
+
+ unlink ("./rainbow_1_8_uncompressed.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_jpeg, blob_odd_sz_jpeg,
+ blob_even_jpeg, blob_even_sz_jpeg, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - jpeg\n");
+ return -51;
+ }
+
+ img = rl2_create_section ("rainbow 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - jpeg\n");
+ return -52;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_1_jpeg.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_1_jpeg.png\n");
+ return -53;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_1_jpeg.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd_jpeg, blob_odd_sz_jpeg,
+ blob_even_jpeg, blob_even_sz_jpeg, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - jpeg\n");
+ return -54;
+ }
+
+ img = rl2_create_section ("rainbow 1:2", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:2 - jpeg\n");
+ return -55;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_2_jpeg.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_2_jpeg.png\n");
+ return -56;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_2_jpeg.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd_jpeg, blob_odd_sz_jpeg,
+ blob_even_jpeg, blob_even_sz_jpeg, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - jpeg\n");
+ return -57;
+ }
+
+ img = rl2_create_section ("rainbow 1:4", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:4 - jpeg\n");
+ return -58;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_4_jpeg.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_4_jpeg.png\n");
+ return -59;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_4_jpeg.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd_jpeg, blob_odd_sz_jpeg,
+ blob_even_jpeg, blob_even_sz_jpeg, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - jpeg\n");
+ return -60;
+ }
+
+ img = rl2_create_section ("rainbow 1:8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:8 - jpeg\n");
+ return -61;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_8_jpeg.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_8_jpeg.png\n");
+ return -62;
+ }
+ rl2_destroy_section (img);
+ free (blob_odd_jpeg);
+ free (blob_even_jpeg);
+
+ unlink ("./rainbow_1_8_jpeg.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_lossy_webp,
+ blob_odd_sz_lossy_webp, blob_even_lossy_webp,
+ blob_even_sz_lossy_webp, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - lossy webp\n");
+ return -63;
+ }
+
+ img = rl2_create_section ("rainbow 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - lossy webp\n");
+ return -64;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_1_lossy_webp.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_1_lossy_webp.png\n");
+ return -65;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_1_lossy_webp.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd_lossy_webp,
+ blob_odd_sz_lossy_webp, blob_even_lossy_webp,
+ blob_even_sz_lossy_webp, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - lossy webp\n");
+ return -66;
+ }
+
+ img = rl2_create_section ("rainbow 1:2", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:2 - lossy webp\n");
+ return -67;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_2_lossy_webp.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_2_lossy_webp.png\n");
+ return -68;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_2_lossy_webp.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd_lossy_webp,
+ blob_odd_sz_lossy_webp, blob_even_lossy_webp,
+ blob_even_sz_lossy_webp, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - lossy webp\n");
+ return -69;
+ }
+
+ img = rl2_create_section ("rainbow 1:4", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:4 - lossy webp\n");
+ return -70;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_4_lossy_webp.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_4_lossy_webp.png\n");
+ return -71;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_4_lossy_webp.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd_lossy_webp,
+ blob_odd_sz_lossy_webp, blob_even_lossy_webp,
+ blob_even_sz_lossy_webp, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - lossy webp\n");
+ return -72;
+ }
+
+ img = rl2_create_section ("rainbow 1:8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:8 - lossy webp\n");
+ return -73;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_8_lossy_webp.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_8_lossy_webp.png\n");
+ return -74;
+ }
+ rl2_destroy_section (img);
+ free (blob_odd_lossy_webp);
+ free (blob_even_lossy_webp);
+
+ unlink ("./rainbow_1_8_lossy_webp.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_lossless_webp,
+ blob_odd_sz_lossless_webp, blob_even_lossless_webp,
+ blob_even_sz_lossless_webp, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - lossless webp\n");
+ return -75;
+ }
+
+ img = rl2_create_section ("rainbow 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - lossless webp\n");
+ return -76;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_1_lossless_webp.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_1_lossless_webp.png\n");
+ return -77;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_1_lossless_webp.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd_lossless_webp,
+ blob_odd_sz_lossless_webp, blob_even_lossless_webp,
+ blob_even_sz_lossless_webp, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - lossless webp\n");
+ return -78;
+ }
+
+ img = rl2_create_section ("rainbow 1:2", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:2 - lossless webp\n");
+ return -79;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_2_lossless_webp.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_2_lossless_webp.png\n");
+ return -80;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_2_lossless_webp.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd_lossless_webp,
+ blob_odd_sz_lossless_webp, blob_even_lossless_webp,
+ blob_even_sz_lossless_webp, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - lossless webp\n");
+ return -81;
+ }
+
+ img = rl2_create_section ("rainbow 1:4", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:4 - lossless webp\n");
+ return -82;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_4_lossless_webp.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_4_lossless_webp.png\n");
+ return -83;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_4_lossless_webp.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd_lossless_webp,
+ blob_odd_sz_lossless_webp, blob_even_lossless_webp,
+ blob_even_sz_lossless_webp, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - lossless webp\n");
+ return -84;
+ }
+
+ img = rl2_create_section ("rainbow 1:8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:8 - lossless webp\n");
+ return -85;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_8_lossless_webp.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_8_lossless_webp.png\n");
+ return -86;
+ }
+ rl2_destroy_section (img);
+ free (blob_odd_lossless_webp);
+ free (blob_even_lossless_webp);
+
+ unlink ("./rainbow_1_8_lossless_webp.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - png\n");
+ return -87;
+ }
+
+ img = rl2_create_section ("rainbow 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - png\n");
+ return -88;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_1_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_1_png.png\n");
+ return -89;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_1_png.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - png\n");
+ return -90;
+ }
+
+ img = rl2_create_section ("rainbow 1:2", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:2 - png\n");
+ return -91;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_2_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_2_png.png\n");
+ return -92;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_2_png.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - png\n");
+ return -93;
+ }
+
+ img = rl2_create_section ("rainbow 1:4", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:4 - png\n");
+ return -94;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_4_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_4_png.png\n");
+ return -95;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./rainbow_1_4_png.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - png\n");
+ return -96;
+ }
+
+ img = rl2_create_section ("rainbow 1:8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:8 - png\n");
+ return -97;
+ }
+
+ if (rl2_section_to_png (img, "./rainbow_1_8_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: rainbow_1_8_png.png\n");
+ return -98;
+ }
+ rl2_destroy_section (img);
+ free (blob_odd_png);
+ free (blob_even_png);
+
+ unlink ("./rainbow_1_8_png.png");
+
+ return 0;
+}
diff --git a/test/test20.c b/test/test20.c
new file mode 100644
index 0000000..b463fb7
--- /dev/null
+++ b/test/test20.c
@@ -0,0 +1,588 @@
+/*
+
+ test20.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static rl2SectionPtr
+create_grid_multi16 ()
+{
+/* creating a synthetic "grid_multi8" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (unsigned short) * 5;
+ unsigned short band1 = 0;
+ unsigned short band2 = 65535;
+ unsigned short band3 = 10000;
+ unsigned short band4 = 20000;
+ unsigned short band5 = 30000;
+ unsigned short *bufpix = malloc (bufsize);
+ unsigned short *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = band1;
+ *p++ = band2;
+ *p++ = band3;
+ *p++ = band4;
+ *p++ = band5;
+ if (band1 == 65535)
+ band1 = 0;
+ else
+ band1++;
+ if (band2 == 0)
+ band2 = 65535;
+ else
+ band2--;
+ if (band3 == 65535)
+ band3 = 0;
+ else
+ band3++;
+ if (band4 == 0)
+ band4 = 65535;
+ else
+ band4--;
+ if (band5 == 65535)
+ band5 = 0;
+ else
+ band5++;
+ }
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_UINT16, RL2_PIXEL_MULTIBAND,
+ 5, (unsigned char *) bufpix, bufsize, NULL, NULL, 0,
+ NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("grid_multi16", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_grid_multi16 (rl2SectionPtr img)
+{
+/* testing GRID-MULTI16 buffer functions */
+ unsigned char *ubuffer;
+ unsigned short *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned short *p_data1;
+ unsigned short *p_data2;
+ unsigned short sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "MULTI-16 invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB data: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGBA data: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_ARGB (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get ARGB data: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGR (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGR data: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGRA (rst, &ubuffer, &buf_size) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get BGRA data: MULTI-8\n");
+ return 0;
+ }
+
+ if (rl2_raster_bands_to_RGB (rst, 0, 3, 4, &ubuffer, &buf_size) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - get RGB band data: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint16 (rst, 2, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Band#2 data: MULTI-16\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 30500)
+ {
+ fprintf (stderr, "Unexpected Band#2 pixel #1: MULTI-16\n");
+ return 0;
+ }
+ if (*p_data2 != 26894)
+ {
+ fprintf (stderr, "Unexpected Band#2 pixel #2: MULTI-16\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_band_to_uint16 (rst, 4, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Band#4 data: MULTI-16\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 50500)
+ {
+ fprintf (stderr, "Unexpected Band#4 pixel #1: MULTI-16\n");
+ return 0;
+ }
+ if (*p_data2 != 46894)
+ {
+ fprintf (stderr, "Unexpected Band#4 pixel #2: MULTI-16\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT16)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: MULTI-16\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_MULTIBAND)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: MULTI-16\n");
+ return 0;
+ }
+
+ if (num_bands != 5)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_transparent (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: MULTI-16\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected Pixel Transparency: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_is_pixel_opaque (pxl, &is_transparent) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Pixel Opacity: MULTI-16\n");
+ return 0;
+ }
+
+ if (is_transparent != RL2_TRUE)
+ {
+ fprintf (stderr, "Unexpected Pixel Opacity: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 0, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#0: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample != 20500)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel Sample Band#0 value %d: MULTI-16\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 0, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#0: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 1, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#1: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample != 45035)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel Sample Band#1 value %d: MULTI-16\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 1, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#1: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 2, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#2: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample != 30500)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel Sample Band#2 value %d: MULTI-16\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 2, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#2: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 3, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#3: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample != 65036)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel Sample Band#3 value %d: MULTI-16\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 3, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#3: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 4, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#4: MULTI-16\n");
+ return 0;
+ }
+
+ if (sample != 50500)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel Sample Band#4 value %d: MULTI-16\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 4, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#4: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (pxl, 5, &sample) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected Pixel Sample Band#5: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (pxl, 5, sample) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample Band#5: MULTI-16\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: MULTI-16\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *anti_odd;
+ int anti_odd_sz;
+ unsigned char *anti_even;
+ int anti_even_sz;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_grid_multi16 ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grid_multi16\n");
+ return -1;
+ }
+
+ if (!test_grid_multi16 (img))
+ return -2;
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -3;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -4;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &anti_odd, &anti_odd_sz, &anti_even,
+ &anti_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed (anti-endian)\n");
+ return -5;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -6;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -7;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -8;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -9;
+ }
+ rl2_destroy_raster (raster);
+ free (blob_odd);
+ free (blob_even);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:1 - uncompressed (anti-endian)\n");
+ return -10;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:2 - uncompressed (anti-endian)\n");
+ return -11;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:4 - uncompressed (anti-endian)\n");
+ return -12;
+ }
+ rl2_destroy_raster (raster);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, anti_odd, anti_odd_sz, anti_even,
+ anti_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to Decode 1:8 - uncompressed (anti-endian)\n");
+ return -13;
+ }
+ rl2_destroy_raster (raster);
+ free (anti_odd);
+ free (anti_even);
+
+ return 0;
+}
diff --git a/test/test3.c b/test/test3.c
new file mode 100644
index 0000000..0d1406d
--- /dev/null
+++ b/test/test3.c
@@ -0,0 +1,627 @@
+/*
+
+ test3.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static rl2SectionPtr
+create_grayband ()
+{
+/* creating a synthetic "grayband" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ unsigned char gray;
+ int bufsize = 1024 * 1024;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ gray = 0;
+ for (row = 0; row < 256; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = gray;
+ gray++;
+ }
+
+ gray = 255;
+ for (row = 256; row < 512; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = gray;
+ gray--;
+ }
+
+ gray = 0;
+ for (row = 512; row < 768; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = gray;
+ gray++;
+ }
+
+ gray = 255;
+ for (row = 768; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = gray;
+ gray--;
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ {
+ free (bufpix);
+ return NULL;
+ }
+
+ scn = rl2_create_section ("grayband", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *blob_odd_jpeg;
+ int blob_odd_sz_jpeg;
+ unsigned char *blob_even_jpeg;
+ int blob_even_sz_jpeg;
+ unsigned char *blob_odd_lossy_webp;
+ int blob_odd_sz_lossy_webp;
+ unsigned char *blob_even_lossy_webp;
+ int blob_even_sz_lossy_webp;
+ unsigned char *blob_odd_lossless_webp;
+ int blob_odd_sz_lossless_webp;
+ unsigned char *blob_even_lossless_webp;
+ int blob_even_sz_lossless_webp;
+ unsigned char *blob_odd_png;
+ int blob_odd_sz_png;
+ unsigned char *blob_even_png;
+ int blob_even_sz_png;
+ unsigned char *blob_odd_gif;
+ int blob_odd_sz_gif;
+ unsigned char *blob_even_gif;
+ int blob_even_sz_gif;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_grayband ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grayband\n");
+ return -1;
+ }
+
+ if (rl2_section_to_jpeg (img, "./grayband.jpg", 70) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband.jpg\n");
+ return -2;
+ }
+
+ if (rl2_section_to_png (img, "./grayband.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband.png\n");
+ return -3;
+ }
+
+ rl2_destroy_section (img);
+
+ unlink ("./grayband.jpg");
+
+ img = rl2_section_from_png ("./grayband.png");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./grayband.png");
+ return -4;
+ }
+
+ unlink ("./grayband.png");
+
+ if (rl2_section_to_png (img, "./from_grayband.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_grayband.png\n");
+ return -5;
+ }
+
+ unlink ("./from_grayband.png");
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -6;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -7;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_JPEG, &blob_odd_jpeg, &blob_odd_sz_jpeg,
+ &blob_even_jpeg, &blob_even_sz_jpeg, 70, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - JPEG compressed\n");
+ return -8;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd_jpeg, blob_odd_sz_jpeg,
+ blob_even_jpeg, blob_even_sz_jpeg, NULL,
+ NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_LOSSY_WEBP, &blob_odd_lossy_webp,
+ &blob_odd_sz_lossy_webp, &blob_even_lossy_webp,
+ &blob_even_sz_lossy_webp, 10, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - lossy WEBP compressed\n");
+ return -9;
+ }
+ if (blob_odd_lossy_webp != NULL)
+ free (blob_odd_lossy_webp);
+ if (blob_even_lossy_webp != NULL)
+ free (blob_even_lossy_webp);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_LOSSLESS_WEBP, &blob_odd_lossless_webp,
+ &blob_odd_sz_lossless_webp, &blob_even_lossless_webp,
+ &blob_even_sz_lossless_webp, 10, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - lossless WEBP compressed\n");
+ return -10;
+ }
+ if (blob_odd_lossless_webp != NULL)
+ free (blob_odd_lossless_webp);
+ if (blob_even_lossless_webp != NULL)
+ free (blob_even_lossless_webp);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_PNG, &blob_odd_png, &blob_odd_sz_png,
+ &blob_even_png, &blob_even_sz_png, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - PNG compressed\n");
+ return -11;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_GIF, &blob_odd_gif, &blob_odd_sz_gif,
+ &blob_even_gif, &blob_even_sz_gif, 0, anti_endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - GIF compressed\n");
+ return -12;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -13;
+ }
+
+ img = rl2_create_section ("grayband 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - uncompressed\n");
+ return -14;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_1_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_1_uncompressed.png\n");
+ return -15;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./grayband_1_1_uncompressed.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -16;
+ }
+
+ img = rl2_create_section ("grayband 1:2", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:2 - uncompressed\n");
+ return -17;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_2_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_2_uncompressed.png\n");
+ return -18;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./grayband_1_2_uncompressed.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -19;
+ }
+
+ img = rl2_create_section ("grayband 1:4", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:4 - uncompressed\n");
+ return -20;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_4_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_4_uncompressed.png\n");
+ return -21;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./grayband_1_4_uncompressed.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -22;
+ }
+
+ img = rl2_create_section ("grayband 1:8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:8 - uncompressed\n");
+ return -23;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_8_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_8_uncompressed.png\n");
+ return -24;
+ }
+ rl2_destroy_section (img);
+ free (blob_odd);
+ free (blob_even);
+
+ unlink ("./grayband_1_8_uncompressed.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_jpeg, blob_odd_sz_jpeg,
+ blob_even_jpeg, blob_even_sz_jpeg, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - jpeg\n");
+ return -25;
+ }
+
+ img = rl2_create_section ("grayband 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - jpeg\n");
+ return -26;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_1_jpeg.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_1_jpeg.png\n");
+ return -27;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./grayband_1_1_jpeg.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd_jpeg, blob_odd_sz_jpeg,
+ blob_even_jpeg, blob_even_sz_jpeg, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - jpeg\n");
+ return -28;
+ }
+
+ img = rl2_create_section ("grayband 1:2", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:2 - jpeg\n");
+ return -29;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_2_jpeg.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_2_jpeg.png\n");
+ return -30;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./grayband_1_2_jpeg.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd_jpeg, blob_odd_sz_jpeg,
+ blob_even_jpeg, blob_even_sz_jpeg, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - jpeg\n");
+ return -31;
+ }
+
+ img = rl2_create_section ("grayband 1:4", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:4 - jpeg\n");
+ return -32;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_4_jpeg.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_4_jpeg.png\n");
+ return -33;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./grayband_1_4_jpeg.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd_jpeg, blob_odd_sz_jpeg,
+ blob_even_jpeg, blob_even_sz_jpeg, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - jpeg\n");
+ return -34;
+ }
+
+ img = rl2_create_section ("grayband 1:8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:8 - jpeg\n");
+ return -35;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_8_jpeg.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_8_jpeg.png\n");
+ return -35;
+ }
+ rl2_destroy_section (img);
+ free (blob_odd_jpeg);
+
+ unlink ("./grayband_1_8_jpeg.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - png\n");
+ return -36;
+ }
+
+ img = rl2_create_section ("grayband 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - png\n");
+ return -37;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_1_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_1_png.png\n");
+ return -38;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./grayband_1_1_png.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - png\n");
+ return -39;
+ }
+
+ img = rl2_create_section ("grayband 1:2", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:2 - png\n");
+ return -40;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_2_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_2_png.png\n");
+ return -41;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./grayband_1_2_png.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - png\n");
+ return -42;
+ }
+
+ img = rl2_create_section ("grayband 1:4", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:4 - png\n");
+ return -43;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_4_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_4_png.png\n");
+ return -44;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./grayband_1_4_png.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - png\n");
+ return -45;
+ }
+
+ img = rl2_create_section ("grayband 1:8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:8 - png\n");
+ return -46;
+ }
+
+ if (rl2_section_to_png (img, "./grayband_1_8_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: grayband_1_8_png.png\n");
+ return -47;
+ }
+ rl2_destroy_section (img);
+ free (blob_odd_png);
+ free (blob_even_png);
+
+ unlink ("./grayband_1_8_png.png");
+
+ return 0;
+}
diff --git a/test/test4.c b/test/test4.c
new file mode 100644
index 0000000..c99787b
--- /dev/null
+++ b/test/test4.c
@@ -0,0 +1,896 @@
+/*
+
+ test4.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2SectionPtr
+create_monochrome ()
+{
+/* creating a synthetic "monochrome" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024;
+ int mode = 0;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = 0;
+ }
+ p = bufpix;
+
+ for (row = 0; row < 256; row += 4)
+ {
+ int mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 4;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 4;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 4;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 4;
+ mode2 = 1;
+ }
+ }
+ if (mode)
+ mode = 0;
+ else
+ mode = 1;
+ }
+
+ for (row = 256; row < 512; row += 8)
+ {
+ int mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ if (mode)
+ mode = 0;
+ else
+ mode = 1;
+ }
+
+ for (row = 512; row < 768; row++)
+ {
+ int mode2 = 1;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ }
+
+ mode = 1;
+ for (row = 768; row < 1024; row += 8)
+ {
+ int x;
+ for (x = 0; x < 8; x++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ if (mode)
+ *p++ = 1;
+ else
+ p++;
+ }
+ }
+ if (mode)
+ mode = 0;
+ else
+ mode = 1;
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME,
+ 1, bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ {
+ free (bufpix);
+ return NULL;
+ }
+
+ scn = rl2_create_section ("monochrome", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+}
+
+static int
+test_monochrome (rl2SectionPtr img)
+{
+/* testing MONOCHROME buffer functions */
+ unsigned char *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ unsigned char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "MONOCHROME invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: MONOCHROME\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (530 * 3);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 255 || *(p_data1 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #1: MONOCHROME\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 0 || *(p_data2 + 1) != 0 || *(p_data2 + 2) != 0)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: MONOCHROME\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: MONOCHROME\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (530 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 255 || *(p_data1 + 2) != 255
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: MONOCHROME\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 0 || *(p_data2 + 1) != 0 || *(p_data2 + 2) != 0
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: MONOCHROME\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: MONOCHROME\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (530 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 255 || *(p_data1 + 2) != 255
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: MONOCHROME\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 0 || *(p_data2 + 2) != 0
+ || *(p_data2 + 3) != 0)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: MONOCHROME\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: MONOCHROME\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (530 * 3);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 255 || *(p_data1 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: MONOCHROME\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 0 || *(p_data2 + 1) != 0 || *(p_data2 + 2) != 0)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: MONOCHROME\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: MONOCHROME\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (530 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 255 || *(p_data1 + 2) != 255
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: MONOCHROME\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 0 || *(p_data2 + 1) != 0 || *(p_data2 + 2) != 0
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: MONOCHROME\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_1bit (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get 1-BIT data: MONOCHROME\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 530;
+ if (*p_data1 != 0)
+ {
+ fprintf (stderr, "Unexpected 1-BIT pixel #1: MONOCHROME\n");
+ return 0;
+ }
+ if (*p_data2 != 1)
+ {
+ fprintf (stderr, "Unexpected 1-BIT pixel #2: MONOCHROME\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: MONOCHROME\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: MONOCHROME\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: MONOCHROME\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_1_BIT)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: MONOCHROME\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_MONOCHROME)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: MONOCHROME\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: MONOCHROME\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_1bit (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel 1-BIT: MONOCHROME\n");
+ return 0;
+ }
+
+ if (sample != 0)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel 1-BIT Sample value %d: MONOCHROME\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_1bit (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample 1-BIT: MONOCHROME\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_1bit (pxl, 2) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample 1-BIT (exceeding value): MONOCHROME\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: MONOCHROME\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *blob_odd_zip;
+ int blob_odd_sz_zip;
+ unsigned char *blob_even_zip;
+ int blob_even_sz_zip;
+ unsigned char *blob_odd_lzma;
+ int blob_odd_sz_lzma;
+ unsigned char *blob_even_lzma;
+ int blob_even_sz_lzma;
+ unsigned char *blob_odd_jpeg;
+ int blob_odd_sz_jpeg;
+ unsigned char *blob_even_jpeg;
+ int blob_even_sz_jpeg;
+ unsigned char *blob_odd_png;
+ int blob_odd_sz_png;
+ unsigned char *blob_even_png;
+ int blob_even_sz_png;
+ unsigned char *blob_odd_gif;
+ int blob_odd_sz_gif;
+ unsigned char *blob_even_gif;
+ int blob_even_sz_gif;
+ unsigned char *blob_odd_fax;
+ int blob_odd_sz_fax;
+ unsigned char *blob_even_fax;
+ int blob_even_sz_fax;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int endian = naturalEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_monochrome ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: monochrome\n");
+ return -1;
+ }
+
+ if (rl2_section_to_jpeg (img, "./monochrome.jpg", 70) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: monochrome.jpg\n");
+ return -2;
+ }
+
+ if (rl2_section_to_png (img, "./monochrome.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: monochrome.png\n");
+ return -3;
+ }
+
+ if (!test_monochrome (img))
+ return -4;
+ rl2_destroy_section (img);
+
+ unlink ("./monochrome.jpg");
+
+ img = rl2_section_from_png ("./monochrome.png");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./monochrome.png");
+ return -5;
+ }
+
+ unlink ("./monochrome.png");
+
+ if (rl2_section_to_png (img, "./from_monochrome.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_monochrome.png\n");
+ return -6;
+ }
+
+ unlink ("./from_monochrome.png");
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -7;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -8;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_CCITTFAX4, &blob_odd_fax, &blob_odd_sz_fax,
+ &blob_even_fax, &blob_even_sz_fax, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - FAX4\n");
+ return -9;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd_fax, blob_odd_sz_fax, blob_even_fax,
+ blob_even_sz_fax, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_DEFLATE, &blob_odd_zip, &blob_odd_sz_zip,
+ &blob_even_zip, &blob_even_sz_zip, 0, endian) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - DEFLATE compressed\n");
+ return -103;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_LZMA, &blob_odd_lzma, &blob_odd_sz_lzma,
+ &blob_even_lzma, &blob_even_sz_lzma, 0, endian) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - LZMA compressed\n");
+ return -10;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_JPEG, &blob_odd_jpeg, &blob_odd_sz_jpeg,
+ &blob_even_jpeg, &blob_even_sz_jpeg, 70, endian) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - JPEG compressed\n");
+ return -11;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_PNG, &blob_odd_png, &blob_odd_sz_png,
+ &blob_even_png, &blob_even_sz_png, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - png\n");
+ return -12;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_GIF, &blob_odd_gif, &blob_odd_sz_gif,
+ &blob_even_gif, &blob_even_sz_gif, 0, endian) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result - GIF compressed\n");
+ return -13;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -14;
+ }
+
+ img = rl2_create_section ("monochrome 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - uncompressed\n");
+ return -15;
+ }
+
+ if (rl2_section_to_png (img, "./monochrome_1_1_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to write: monochrome_1_1_uncompressed.png\n");
+ return -16;
+ }
+ rl2_destroy_section (img);
+ free (blob_odd);
+
+ unlink ("./monochrome_1_1_uncompressed.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_fax, blob_odd_sz_fax,
+ blob_even_fax, blob_even_sz_fax, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - fax\n");
+ return -21;
+ }
+
+ img = rl2_create_section ("monochrome 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - fax\n");
+ return -22;
+ }
+
+ if (rl2_section_to_png (img, "./monochrome_1_1_fax.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: monochrome_1_1_fax.png\n");
+ return -23;
+ }
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd_fax, blob_odd_sz_fax,
+ blob_even_fax, blob_even_sz_fax, NULL);
+ if (raster != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - fax\n");
+ return -24;
+ }
+ free (blob_odd_lzma);
+
+ unlink ("./monochrome_1_1_fax.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - png\n");
+ return -25;
+ }
+
+ img = rl2_create_section ("monochrome 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - png\n");
+ return -26;
+ }
+
+ if (rl2_section_to_png (img, "./monochrome_1_1_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: monochrome_1_1_png.png\n");
+ return -27;
+ }
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - png\n");
+ return -28;
+ }
+ free (blob_odd_png);
+
+ unlink ("./monochrome_1_1_png.png");
+
+ return 0;
+}
diff --git a/test/test5.c b/test/test5.c
new file mode 100644
index 0000000..19ba613
--- /dev/null
+++ b/test/test5.c
@@ -0,0 +1,881 @@
+/*
+
+ test5.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2PalettePtr
+create_palette ()
+{
+/* creating a "bicolor" palette */
+ rl2PalettePtr palette = rl2_create_palette (2);
+ if (palette == NULL)
+ goto error;
+ if (rl2_set_palette_color (palette, 0, 255, 255, 204) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 1, 128, 204, 232) != RL2_OK)
+ goto error;
+ return palette;
+ error:
+ return NULL;
+}
+
+static rl2SectionPtr
+create_bicolor ()
+{
+/* creating a synthetic "bicolor" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ rl2PalettePtr palette = create_palette ();
+ int row;
+ int col;
+ int bufsize = 1024 * 1024;
+ int mode = 0;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+ if (palette == NULL)
+ goto error;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = 0;
+ }
+ p = bufpix;
+
+ for (row = 0; row < 256; row += 4)
+ {
+ int mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 4;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 4;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 4;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 4;
+ mode2 = 1;
+ }
+ }
+ if (mode)
+ mode = 0;
+ else
+ mode = 1;
+ }
+
+ for (row = 256; row < 512; row += 8)
+ {
+ int mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ if (mode)
+ mode = 0;
+ else
+ mode = 1;
+ }
+
+ for (row = 512; row < 768; row++)
+ {
+ int mode2 = 1;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ *p++ = 1;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ }
+
+ mode = 1;
+ for (row = 768; row < 1024; row += 8)
+ {
+ int x;
+ for (x = 0; x < 8; x++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ if (mode)
+ *p++ = 1;
+ else
+ p++;
+ }
+ }
+ if (mode)
+ mode = 0;
+ else
+ mode = 1;
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_1_BIT, RL2_PIXEL_PALETTE, 1,
+ bufpix, bufsize, palette, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("bicolor", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return NULL;
+}
+
+static int
+test_bicolor (rl2SectionPtr img)
+{
+/* testing BICOLOR buffer functions */
+ unsigned char *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ unsigned char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "BICOLOR invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: BICOLOR\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (530 * 3);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 255 || *(p_data1 + 2) != 204)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #1: BICOLOR\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 128 || *(p_data2 + 1) != 204 || *(p_data2 + 2) != 232)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: BICOLOR\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: BICOLOR\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (530 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 255 || *(p_data1 + 2) != 204
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: BICOLOR\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 128 || *(p_data2 + 1) != 204 || *(p_data2 + 2) != 232
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: BICOLOR\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: BICOLOR\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (530 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 255 || *(p_data1 + 2) != 255
+ || *(p_data1 + 3) != 204)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: BICOLOR\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 128 || *(p_data2 + 2) != 204
+ || *(p_data2 + 3) != 232)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: BICOLOR\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: BICOLOR\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (530 * 3);
+ if (*(p_data1 + 0) != 204 || *(p_data1 + 1) != 255 || *(p_data1 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: BICOLOR\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 232 || *(p_data2 + 1) != 204 || *(p_data2 + 2) != 128)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: BICOLOR\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: BICOLOR\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (530 * 4);
+ if (*(p_data1 + 0) != 204 || *(p_data1 + 1) != 255 || *(p_data1 + 2) != 255
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: BICOLOR\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 232 || *(p_data2 + 1) != 204 || *(p_data2 + 2) != 128
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: BICOLOR\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_1bit (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get 1-BIT data: BICOLOR\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 530;
+ if (*p_data1 != 0)
+ {
+ fprintf (stderr, "Unexpected 1-BIT pixel #1: BICOLOR\n");
+ return 0;
+ }
+ if (*p_data2 != 1)
+ {
+ fprintf (stderr, "Unexpected 1-BIT pixel #2: BICOLOR\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: BICOLOR\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: BICOLOR\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: BICOLOR\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_1_BIT)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: BICOLOR\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: BICOLOR\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: BICOLOR\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_1bit (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel 1-BIT: BICOLOR\n");
+ return 0;
+ }
+
+ if (sample != 0)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel 1-BIT Sample value %d: BICOLOR\n", sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_1bit (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample 1-BIT: BICOLOR\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_1bit (pxl, 2) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample 1-BIT (exceeding value): BICOLOR\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: BICOLOR\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *blob_odd_zip;
+ int blob_odd_sz_zip;
+ unsigned char *blob_even_zip;
+ int blob_even_sz_zip;
+ unsigned char *blob_odd_lzma;
+ int blob_odd_sz_lzma;
+ unsigned char *blob_even_lzma;
+ int blob_even_sz_lzma;
+ unsigned char *blob_odd_png;
+ int blob_odd_sz_png;
+ unsigned char *blob_even_png;
+ int blob_even_sz_png;
+ unsigned char *blob_odd_gif;
+ int blob_odd_sz_gif;
+ unsigned char *blob_even_gif;
+ int blob_even_sz_gif;
+ int endian = naturalEndian ();
+ rl2PalettePtr palette;
+ rl2PalettePtr plt2;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_bicolor ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: bicolor\n");
+ return -1;
+ }
+
+ if (rl2_section_to_jpeg (img, "./bicolor.jpg", 70) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: bicolor.jpg\n");
+ return -2;
+ }
+
+ if (rl2_section_to_png (img, "./bicolor.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: bicolor.png\n");
+ return -3;
+ }
+
+ if (!test_bicolor (img))
+ return -4;
+
+ rl2_destroy_section (img);
+
+ unlink ("./bicolor.jpg");
+
+ img = rl2_section_from_png ("./bicolor.png");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./bicolor.png");
+ return -5;
+ }
+
+ unlink ("./bicolor.png");
+
+ if (rl2_section_to_png (img, "./from_bicolor.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_bicolor.png\n");
+ return -6;
+ }
+
+ unlink ("./from_bicolor.png");
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -7;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -8;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_DEFLATE, &blob_odd_zip, &blob_odd_sz_zip,
+ &blob_even_zip, &blob_even_sz_zip, 0, endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - compressed DEFLATE\n");
+ return -9;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_LZMA, &blob_odd_lzma, &blob_odd_sz_lzma,
+ &blob_even_lzma, &blob_even_sz_lzma, 0, endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - compressed LZMA\n");
+ return -10;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_PNG, &blob_odd_png, &blob_odd_sz_png,
+ &blob_even_png, &blob_even_sz_png, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - compressed PNG\n");
+ return -11;
+ }
+
+ plt2 = rl2_clone_palette (rl2_get_raster_palette (raster));
+ stats =
+ rl2_get_raster_statistics (blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, plt2, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_GIF, &blob_odd_gif, &blob_odd_sz_gif,
+ &blob_even_gif, &blob_even_sz_gif, 0, endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - compressed GIF\n");
+ return -12;
+ }
+
+ rl2_destroy_section (img);
+
+ palette = create_palette ();
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, palette);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -13;
+ }
+
+ img = rl2_create_section ("bicolor 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - uncompressed\n");
+ return -14;
+ }
+
+ if (rl2_section_to_png (img, "./bicolor_1_1_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: bicolor_1_1_uncompressed.png\n");
+ return -15;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./bicolor_1_1_uncompressed.png");
+
+ if (rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - uncompressed\n");
+ return -16;
+ }
+
+ if (rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:4 - uncompressed\n");
+ return -17;
+ }
+
+ if (rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:8 - uncompressed\n");
+ return -18;
+ }
+ free (blob_odd);
+
+
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - png\n");
+ return -31;
+ }
+
+ img = rl2_create_section ("bicolor 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - png\n");
+ return -32;
+ }
+
+ if (rl2_section_to_png (img, "./bicolor_1_1_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: bicolor_1_1_png.png\n");
+ return -33;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./bicolor_1_1_png.png");
+
+ if (rl2_raster_decode
+ (RL2_SCALE_2, blob_odd_png, blob_odd_sz_png, blob_even_png,
+ blob_even_sz_png, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - png\n");
+ return -34;
+ }
+ free (blob_odd_png);
+
+ return 0;
+}
diff --git a/test/test6.c b/test/test6.c
new file mode 100644
index 0000000..20f9e6f
--- /dev/null
+++ b/test/test6.c
@@ -0,0 +1,637 @@
+/*
+
+ test6.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2PalettePtr
+create_palette ()
+{
+/* creating a "4colors" image */
+ rl2PalettePtr palette = rl2_create_palette (4);
+ if (palette == NULL)
+ goto error;
+ if (rl2_set_palette_color (palette, 0, 255, 255, 204) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 1, 204, 255, 255) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 2, 255, 204, 255) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 3, 204, 204, 204) != RL2_OK)
+ goto error;
+ return palette;
+ error:
+ return NULL;
+}
+
+static rl2SectionPtr
+create_4colors ()
+{
+/* creating a synthetic "4colors" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ rl2PalettePtr palette = create_palette ();
+ int row;
+ int col;
+ int bufsize = 1024 * 1024;
+ int idx = 0;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+ if (palette == NULL)
+ goto error;
+
+ for (row = 0; row < 256; row += 4)
+ {
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 4)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 3)
+ ix = 0;
+ }
+ }
+ idx++;
+ if (idx > 3)
+ idx = 0;
+ }
+
+ for (row = 256; row < 512; row += 8)
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 8)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 3)
+ ix = 0;
+ }
+ }
+ idx++;
+ if (idx > 3)
+ idx = 0;
+ }
+
+ for (row = 512; row < 768; row++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 8)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 3)
+ ix = 0;
+ }
+ }
+
+ for (row = 768; row < 1024; row += 8)
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = idx;
+ }
+ idx++;
+ if (idx > 3)
+ idx = 0;
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_2_BIT, RL2_PIXEL_PALETTE, 1,
+ bufpix, bufsize, palette, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("4colors", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return NULL;
+}
+
+static int
+test_4colors (rl2SectionPtr img)
+{
+/* testing 4-COLORS buffer functions */
+ unsigned char *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ unsigned char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "4-COLORS invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: 4-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (510 * 3);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 204 || *(p_data1 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #1: 4-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 204 || *(p_data2 + 1) != 204 || *(p_data2 + 2) != 204)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: 4-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: 4-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 204 || *(p_data1 + 2) != 255
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: 4-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 204 || *(p_data2 + 1) != 204 || *(p_data2 + 2) != 204
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: 4-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: 4-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 255 || *(p_data1 + 2) != 204
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: 4-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 204 || *(p_data2 + 2) != 204
+ || *(p_data2 + 3) != 204)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: 4-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: 4-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (510 * 3);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 204 || *(p_data1 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: 4-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 204 || *(p_data2 + 1) != 204 || *(p_data2 + 2) != 204)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: 4-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: 4-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 204 || *(p_data1 + 2) != 255
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: 4-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 204 || *(p_data2 + 1) != 204 || *(p_data2 + 2) != 204
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: 4-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_2bit (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get 2-BIT data: 4-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 2)
+ {
+ fprintf (stderr, "Unexpected 2-BIT pixel #1: 4-COLORS\n");
+ return 0;
+ }
+ if (*p_data2 != 3)
+ {
+ fprintf (stderr, "Unexpected 2-BIT pixel #2: 4-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: 4-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: 4-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: 4-COLORS\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_2_BIT)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: 4-COLORS\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: 4-COLORS\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: 4-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_2bit (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel 2-BIT: 4-COLORS\n");
+ return 0;
+ }
+
+ if (sample != 2)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel 2-BIT Sample value %d: 4-COLORS\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_2bit (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample 2-BIT: 4-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_2bit (pxl, 4) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample 2-BIT (exceeding value): 4-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: 4-COLORS\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *blob_odd_png;
+ int blob_odd_sz_png;
+ unsigned char *blob_even_png;
+ int blob_even_sz_png;
+ unsigned char *blob_odd_gif;
+ int blob_odd_sz_gif;
+ unsigned char *blob_even_gif;
+ int blob_even_sz_gif;
+ int endian = naturalEndian ();
+ rl2PalettePtr palette;
+ rl2PalettePtr plt2;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_4colors ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: 4colors\n");
+ return -1;
+ }
+
+ if (rl2_section_to_jpeg (img, "./4colors.jpg", 70) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 4colors.jpg\n");
+ return -2;
+ }
+
+ if (rl2_section_to_png (img, "./4colors.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 4colors.png\n");
+ return -3;
+ }
+
+ if (!test_4colors (img))
+ return -4;
+
+ rl2_destroy_section (img);
+
+ unlink ("./4colors.jpg");
+
+ img = rl2_section_from_png ("./4colors.png");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./4colors.png");
+ return -5;
+ }
+
+ unlink ("./4colors.png");
+
+ if (rl2_section_to_png (img, "./from_4colors.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_4colors.png\n");
+ return -6;
+ }
+
+ unlink ("./from_4colors.png");
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -7;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -8;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_PNG, &blob_odd_png, &blob_odd_sz_png,
+ &blob_even_png, &blob_even_sz_png, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - PNG\n");
+ return -9;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_GIF, &blob_odd_gif, &blob_odd_sz_gif,
+ &blob_even_gif, &blob_even_sz_gif, 0, endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - GIF\n");
+ return -10;
+ }
+
+ plt2 = rl2_clone_palette (rl2_get_raster_palette (raster));
+ stats =
+ rl2_get_raster_statistics (blob_odd_png, blob_odd_sz_png, blob_even_png,
+ blob_even_sz_png, plt2, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ rl2_destroy_section (img);
+
+ palette = create_palette ();
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, palette);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -11;
+ }
+
+ img = rl2_create_section ("4colors 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - uncompressed\n");
+ return -12;
+ }
+
+ if (rl2_section_to_png (img, "./4colors_1_1_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 4colors_1_1_uncompressed.png\n");
+ return -13;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./4colors_1_1_uncompressed.png");
+
+ if (rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - uncompressed\n");
+ return -14;
+ }
+
+ if (rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:4 - uncompressed\n");
+ return -15;
+ }
+
+ if (rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:8 - uncompressed\n");
+ return -16;
+ }
+ free (blob_odd);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - png\n");
+ return -17;
+ }
+
+ img = rl2_create_section ("4colors 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - png\n");
+ return -18;
+ }
+
+ if (rl2_section_to_png (img, "./4colors_1_1_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 4colors_1_1_png.png\n");
+ return -19;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./4colors_1_1_png.png");
+
+ if (rl2_raster_decode
+ (RL2_SCALE_2, blob_odd_png, blob_odd_sz_png, blob_even_png,
+ blob_even_sz_png, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - png\n");
+ return -20;
+ }
+ free (blob_odd_png);
+
+ return 0;
+}
diff --git a/test/test7.c b/test/test7.c
new file mode 100644
index 0000000..c1d272e
--- /dev/null
+++ b/test/test7.c
@@ -0,0 +1,841 @@
+/*
+
+ test7.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+naturalEndian ()
+{
+/* ensures to always encode in the natural endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 0;
+ return 1;
+}
+
+static rl2PalettePtr
+create_palette ()
+{
+/* creating a "256colors" palette */
+ int idx;
+ const char *rgb[] = {
+ "#FFB6C1", "#FFC0CB", "#DC143C", "#FFF0F5", "#DB7093", "#FF69B4",
+ "#FF1493", "#C71585", "#DA70D6", "#D8BFD8",
+ "#DDA0DD", "#EE82EE", "#FF00FF", "#FF00FF", "#8B008B", "#800080",
+ "#BA55D3", "#9400D3", "#9932CC", "#4B0082",
+ "#8A2BE2", "#9370DB", "#7B68EE", "#6A5ACD", "#483D8B", "#F8F8FF",
+ "#E6E6FA", "#0000FF", "#0000CD", "#00008B",
+ "#000080", "#191970", "#4169E1", "#6495ED", "#B0C4DE",
+ "#778899", "#708090", "#1E90FF", "#F0F8FF", "#4682B4", "#87CEFA",
+ "#87CEEB", "#00BFFF", "#ADD8E6", "#B0E0E6",
+ "#5F9EA0", "#00CED1", "#F0FFFF", "#E0FFFF", "#AFEEEE", "#00FFFF",
+ "#008B8B", "#008080", "#2F4F4F", "#48D1CC",
+ "#20B2AA", "#40E0D0", "#7FFFD4", "#66CDAA", "#00FA9A", "#F5FFFA",
+ "#00FF7F", "#3CB371", "#2E8B57", "#F0FFF0",
+ "#98FB98", "#90EE90", "#32CD32", "#00FF00", "#228B22", "#008000",
+ "#006400", "#7CFC00", "#7FFF00", "#ADFF2F",
+ "#556B2F", "#9ACD32", "#6B8E23", "#FFFFF0", "#F5F5DC", "#FFFFE0",
+ "#FAFAD2", "#FFFF00", "#808000", "#BDB76B",
+ "#EEE8AA", "#FFFACD", "#F0E68C", "#FFD700", "#FFF8DC", "#DAA520",
+ "#B8860B", "#FFFAF0",
+ "#FDF5E6", "#F5DEB3", "#FFA500", "#FFE4B5", "#FFEFD5", "#FFEBCD",
+ "#FFDEAD", "#FAEBD7", "#D2B48C", "#DEB887",
+ "#FF8C00", "#FFE4C4", "#FAF0E6", "#CD853F", "#FFDAB9", "#F4A460",
+ "#D2691E", "#8B4513", "#FFF5EE", "#A0522D",
+ "#FFA07A", "#FF7F50", "#FF4500", "#E9967A", "#FF6347", "#FA8072",
+ "#FFE4E1", "#F08080", "#FFFAFA", "#BC8F8F",
+ "#CD5C5C", "#FF0000", "#A52A2A", "#B22222", "#8B0000", "#800000",
+ "#FFFFFF", "#F5F5F5", "#DCDCDC", "#D3D3D3",
+ "#C0C0C0", "#A9A9A9", "#808080", "#696969", "#000000", NULL
+ };
+ const char *p_rgb;
+ rl2PalettePtr palette;
+
+ idx = 0;
+ while (1)
+ {
+ p_rgb = rgb[idx];
+ if (p_rgb == NULL)
+ break;
+ idx++;
+ }
+ palette = rl2_create_palette (idx);
+ if (palette == NULL)
+ goto error;
+ idx = 0;
+ while (1)
+ {
+ p_rgb = rgb[idx];
+ if (p_rgb == NULL)
+ break;
+ if (rl2_set_palette_hexrgb (palette, idx, p_rgb) != RL2_OK)
+ goto error;
+ idx++;
+ }
+ return palette;
+ error:
+ return NULL;
+}
+
+static rl2SectionPtr
+create_256colors ()
+{
+/* creating a synthetic "256colors" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ rl2PalettePtr palette = create_palette ();
+ int row;
+ int col;
+ int bufsize = 1024 * 1024;
+ int idx;
+ unsigned short max;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ if (palette == NULL)
+ goto error;
+
+ rl2_get_palette_entries (palette, &max);
+ max--;
+ idx = 0;
+ for (row = 0; row < 256; row += 4)
+ {
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 4)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > max)
+ ix = 0;
+ }
+ }
+ idx++;
+ if (idx > max)
+ idx = 0;
+ }
+
+ for (row = 256; row < 512; row += 8)
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 8)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > max)
+ ix = 0;
+ }
+ }
+ idx++;
+ if (idx > max)
+ idx = 0;
+ }
+
+ idx = max;
+ for (row = 0; row < 256; row += 4)
+ {
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 4)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix--;
+ if (ix < 0)
+ ix = max;
+ }
+ }
+ idx--;
+ if (idx < 0)
+ idx = max;
+ }
+
+ for (row = 256; row < 512; row += 8)
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 8)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix--;
+ if (ix < 0)
+ ix = max;
+ }
+ }
+ idx--;
+ if (idx < 0)
+ idx = max;
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_UINT8, RL2_PIXEL_PALETTE, 1,
+ bufpix, bufsize, palette, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("256colors", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return NULL;
+}
+
+static int
+test_256colors (rl2SectionPtr img)
+{
+/* testing 256-COLORS buffer functions */
+ unsigned char *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ unsigned char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "256-COLORS invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: 256-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (510 * 3);
+ if (*(p_data1 + 0) != 221 || *(p_data1 + 1) != 160 || *(p_data1 + 2) != 221)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #1: 256-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 228 || *(p_data2 + 2) != 181)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: 256-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: 256-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 221 || *(p_data1 + 1) != 160 || *(p_data1 + 2) != 221
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: 256-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 228 || *(p_data2 + 2) != 181
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: 256-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: 4-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 221 || *(p_data1 + 2) != 160
+ || *(p_data1 + 3) != 221)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: 256-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 228
+ || *(p_data2 + 3) != 181)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: 256-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: 256-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (510 * 3);
+ if (*(p_data1 + 0) != 221 || *(p_data1 + 1) != 160 || *(p_data1 + 2) != 221)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: 4-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 181 || *(p_data2 + 1) != 228 || *(p_data2 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: 256-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: 256-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 221 || *(p_data1 + 1) != 160 || *(p_data1 + 2) != 221
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: 256-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 181 || *(p_data2 + 1) != 228 || *(p_data2 + 2) != 255
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: 256-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_uint8 (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get UINT8 data: 256-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 10)
+ {
+ fprintf (stderr, "Unexpected UINT8 pixel #1: 256-COLORS\n");
+ return 0;
+ }
+ if (*p_data2 != 96)
+ {
+ fprintf (stderr, "Unexpected UINT8 pixel #2: 256-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: 256-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: 256-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: 256-COLORS\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: 256-COLORS\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: 256-COLORS\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: 256-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (pxl, RL2_PALETTE_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel UINT8: 256-COLORS\n");
+ return 0;
+ }
+
+ if (sample != 10)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel UINT8 Sample value %d: 256-COLORS\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (pxl, RL2_PALETTE_BAND, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample UINT8: 256-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (pxl, RL2_PALETTE_BAND, 255) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample UINT8: 256-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected SetPixel (20,20) into Raster (exceeding max-palette): 256-COLORS\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *blob_odd_png;
+ int blob_odd_sz_png;
+ unsigned char *blob_even_png;
+ int blob_even_sz_png;
+ unsigned char *blob_odd_gif;
+ int blob_odd_sz_gif;
+ unsigned char *blob_even_gif;
+ int blob_even_sz_gif;
+ int endian = naturalEndian ();
+ rl2PalettePtr palette;
+ rl2PalettePtr plt2;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_256colors ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: 256colors\n");
+ return -1;
+ }
+
+ if (rl2_section_to_jpeg (img, "./256colors.jpg", 70) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 256colors.jpg\n");
+ return -2;
+ }
+
+ if (rl2_section_to_png (img, "./256colors.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 256colors.png\n");
+ return -3;
+ }
+
+ if (!test_256colors (img))
+ return -4;
+
+ rl2_destroy_section (img);
+
+ unlink ("./256colors.jpg");
+
+ img = rl2_section_from_png ("./256colors.png");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./256colors.png");
+ return -5;
+ }
+
+ unlink ("./256colors.png");
+
+ if (rl2_section_to_png (img, "./from_256colors.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_256colors.png\n");
+ return -6;
+ }
+
+ unlink ("./from_256colors.png");
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -6;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -7;
+ }
+
+ plt2 = rl2_clone_palette (rl2_get_raster_palette (raster));
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, plt2, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_PNG, &blob_odd_png, &blob_odd_sz_png,
+ &blob_even_png, &blob_even_sz_png, 0, endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - PNG\n");
+ return -8;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_GIF, &blob_odd_gif, &blob_odd_sz_gif,
+ &blob_even_gif, &blob_even_sz_gif, 0, endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - GIF\n");
+ return -9;
+ }
+
+ rl2_destroy_section (img);
+
+ palette = create_palette ();
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, palette);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -10;
+ }
+
+ img = rl2_create_section ("256color 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - uncompressed\n");
+ return -11;
+ }
+
+ if (rl2_section_to_png (img, "./256color_1_1_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 256color_1_1_uncompressed.png\n");
+ return -12;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./256color_1_1_uncompressed.png");
+
+ palette = create_palette ();
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, palette);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed\n");
+ return -13;
+ }
+
+ img = rl2_create_section ("256color 1:2", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:2 - uncompressed\n");
+ return -14;
+ }
+
+ if (rl2_section_to_png (img, "./256color_1_2_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 256color_1_2_uncompressed.png\n");
+ return -15;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./256color_1_2_uncompressed.png");
+
+ palette = create_palette ();
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, palette);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed\n");
+ return -16;
+ }
+
+ img = rl2_create_section ("256color 1:4", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:4 - uncompressed\n");
+ return -17;
+ }
+
+ if (rl2_section_to_png (img, "./256color_1_4_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 256color_1_4_uncompressed.png\n");
+ return -18;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./256color_1_4_uncompressed.png");
+
+ palette = create_palette ();
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, palette);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed\n");
+ return -19;
+ }
+
+ img = rl2_create_section ("256color 1:8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:8 - uncompressed\n");
+ return -20;
+ }
+
+ if (rl2_section_to_png (img, "./256color_1_8_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 256color_1_8_uncompressed.png\n");
+ return -21;
+ }
+ rl2_destroy_section (img);
+ free (blob_odd);
+ free (blob_even);
+
+ unlink ("./256color_1_8_uncompressed.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - png\n");
+ return -22;
+ }
+
+ img = rl2_create_section ("256color 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - png\n");
+ return -23;
+ }
+
+ if (rl2_section_to_png (img, "./256color_1_1_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 256color_1_1_png.png\n");
+ return -24;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./256color_1_1_png.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - png\n");
+ return -25;
+ }
+
+ img = rl2_create_section ("256color 1:2", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:2 - png\n");
+ return -26;
+ }
+
+ if (rl2_section_to_png (img, "./256color_1_2_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 256color_1_2_png.png\n");
+ return -27;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./256color_1_2_png.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - png\n");
+ return -28;
+ }
+
+ img = rl2_create_section ("256color 1:4", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:4 - png\n");
+ return -29;
+ }
+
+ if (rl2_section_to_png (img, "./256color_1_4_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 256color_1_4_png.png\n");
+ return -30;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./256color_1_4_png.png");
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - png\n");
+ return -31;
+ }
+
+ img = rl2_create_section ("256color 1:8", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:8 - png\n");
+ return -32;
+ }
+
+ if (rl2_section_to_png (img, "./256color_1_8_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 256color_1_8_png.png\n");
+ return -33;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./256color_1_8_png.png");
+
+ free (blob_odd_png);
+ free (blob_even_png);
+
+ return 0;
+}
diff --git a/test/test8.c b/test/test8.c
new file mode 100644
index 0000000..9a8349c
--- /dev/null
+++ b/test/test8.c
@@ -0,0 +1,661 @@
+/*
+
+ test8.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static rl2PalettePtr
+create_palette ()
+{
+/* creating a "16colors" palette */
+ rl2PalettePtr palette = rl2_create_palette (16);
+ if (palette == NULL)
+ goto error;
+ if (rl2_set_palette_color (palette, 0, 0, 0, 0) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 1, 157, 157, 157) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 2, 255, 255, 255) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 3, 190, 38, 51) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 4, 224, 111, 139) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 5, 73, 60, 43) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 6, 164, 100, 34) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 7, 235, 137, 49) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 8, 247, 226, 107) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 9, 47, 72, 78) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 10, 68, 137, 26) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 11, 163, 206, 39) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 12, 27, 38, 50) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 13, 0, 87, 132) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 14, 49, 162, 242) != RL2_OK)
+ goto error;
+ if (rl2_set_palette_color (palette, 15, 255, 0, 255) != RL2_OK)
+ goto error;
+ return palette;
+ error:
+ return NULL;
+}
+
+static rl2SectionPtr
+create_16colors ()
+{
+/* creating a synthetic "16colors" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ rl2PalettePtr palette = create_palette ();
+ int row;
+ int col;
+ int bufsize = 1024 * 1024;
+ int idx = 0;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+ if (palette == NULL)
+ goto error;
+
+ for (row = 0; row < 256; row += 4)
+ {
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 4)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 15)
+ ix = 0;
+ }
+ }
+ idx++;
+ if (idx > 15)
+ idx = 0;
+ }
+
+ for (row = 256; row < 512; row += 8)
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 8)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 15)
+ ix = 0;
+ }
+ }
+ idx++;
+ if (idx > 15)
+ idx = 0;
+ }
+
+ for (row = 512; row < 768; row++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 8)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 15)
+ ix = 0;
+ }
+ }
+
+ for (row = 768; row < 1024; row += 8)
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = idx;
+ }
+ idx++;
+ if (idx > 15)
+ idx = 0;
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_4_BIT, RL2_PIXEL_PALETTE, 1,
+ bufpix, bufsize, palette, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("16colors", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ return NULL;
+}
+
+static int
+test_16colors (rl2SectionPtr img)
+{
+/* testing 16-COLORS buffer functions */
+ unsigned char *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ unsigned char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "16-COLORS invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: 16-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (510 * 3);
+ if (*(p_data1 + 0) != 68 || *(p_data1 + 1) != 137 || *(p_data1 + 2) != 26)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #1: 16-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 0 || *(p_data2 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: 16-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: 16-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 68 || *(p_data1 + 1) != 137 || *(p_data1 + 2) != 26
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: 16-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 0 || *(p_data2 + 2) != 255
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: 16-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: 16-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 68 || *(p_data1 + 2) != 137
+ || *(p_data1 + 3) != 26)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: 16-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 0
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: 16-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: 16-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (510 * 3);
+ if (*(p_data1 + 0) != 26 || *(p_data1 + 1) != 137 || *(p_data1 + 2) != 68)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: 16-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 0 || *(p_data2 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: 16-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: 16-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 26 || *(p_data1 + 1) != 137 || *(p_data1 + 2) != 68
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: 16-COLORS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 0 || *(p_data2 + 2) != 255
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: 16-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_4bit (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get 4-BIT data: 16-COLORS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 10)
+ {
+ fprintf (stderr, "Unexpected 4-BIT pixel #1: 16-COLORS\n");
+ return 0;
+ }
+ if (*p_data2 != 15)
+ {
+ fprintf (stderr, "Unexpected 4-BIT pixel #2: 16-COLORS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: 16-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: 16-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: 16-COLORS\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_4_BIT)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: 16-COLORS\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: 16-COLORS\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: 16-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_4bit (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel 4-BIT: 16-COLORS\n");
+ return 0;
+ }
+
+ if (sample != 10)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel 4-BIT Sample value %d: 16-COLORS\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_4bit (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample 4-BIT: 16-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_4bit (pxl, 16) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample 4-BIT (exceeding value): 16-COLORS\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: 16-COLORS\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *blob_odd_png;
+ int blob_odd_sz_png;
+ unsigned char *blob_even_png;
+ int blob_even_sz_png;
+ unsigned char *blob_odd_gif;
+ int blob_odd_sz_gif;
+ unsigned char *blob_even_gif;
+ int blob_even_sz_gif;
+ int anti_endian = antiEndian ();
+ rl2PalettePtr palette;
+ rl2PalettePtr plt2;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_16colors ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: 16colors\n");
+ return -1;
+ }
+
+ if (rl2_section_to_jpeg (img, "./16colors.jpg", 70) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 16colors.jpg\n");
+ return -2;
+ }
+
+ if (rl2_section_to_png (img, "./16colors.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 16colors.png\n");
+ return -3;
+ }
+
+ if (!test_16colors (img))
+ return -4;
+
+ rl2_destroy_section (img);
+
+ unlink ("./16colors.jpg");
+
+ img = rl2_section_from_png ("./16colors.png");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./16colors.png");
+ return -5;
+ }
+
+ unlink ("./16colors.png");
+
+ if (rl2_section_to_png (img, "./from_16colors.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_16colors.png\n");
+ return -6;
+ }
+
+ unlink ("./from_16colors.png");
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -7;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -8;
+ }
+
+ plt2 = rl2_clone_palette (rl2_get_raster_palette (raster));
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, plt2, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_PNG, &blob_odd_png, &blob_odd_sz_png,
+ &blob_even_png, &blob_even_sz_png, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - PNG\n");
+ return -9;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_GIF, &blob_odd_gif, &blob_odd_sz_gif,
+ &blob_even_gif, &blob_even_sz_gif, 0, anti_endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - GIF\n");
+ return -10;
+ }
+
+ rl2_destroy_section (img);
+
+ palette = create_palette ();
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, palette);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -11;
+ }
+
+ img = rl2_create_section ("16colors 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - uncompressed\n");
+ return -12;
+ }
+
+ if (rl2_section_to_png (img, "./16colors_1_1_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 16colors_1_1_uncompressed.png\n");
+ return -13;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./16colors_1_1_uncompressed.png");
+
+ if (rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - uncompressed\n");
+ return -14;
+ }
+
+ if (rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:4 - uncompressed\n");
+ return -15;
+ }
+
+ if (rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:8 - uncompressed\n");
+ return -16;
+ }
+ free (blob_odd);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - png\n");
+ return -17;
+ }
+
+ img = rl2_create_section ("16colors 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - png\n");
+ return -18;
+ }
+
+ if (rl2_section_to_png (img, "./16colors_1_1_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 16colors_1_1_png.png\n");
+ return -19;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./16colors_1_1_png.png");
+
+ if (rl2_raster_decode
+ (RL2_SCALE_2, blob_odd_png, blob_odd_sz_png, blob_even_png,
+ blob_even_sz_png, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - png\n");
+ return -20;
+ }
+ free (blob_odd_png);
+
+ return 0;
+}
diff --git a/test/test9.c b/test/test9.c
new file mode 100644
index 0000000..3029f16
--- /dev/null
+++ b/test/test9.c
@@ -0,0 +1,608 @@
+/*
+
+ test9.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+antiEndian ()
+{
+/* ensures to always encode in the opposite endian order */
+ union cvt
+ {
+ unsigned char byte[4];
+ int int_value;
+ } convert;
+ convert.int_value = 1;
+ if (convert.byte[0] == 0)
+ return 1;
+ return 0;
+}
+
+static rl2SectionPtr
+create_16gray ()
+{
+/* creating a synthetic "16gray" image */
+ rl2SectionPtr scn;
+ rl2RasterPtr rst;
+ int row;
+ int col;
+ int bufsize = 1024 * 1024;
+ int idx = 0;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 256; row += 4)
+ {
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 4)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 15)
+ ix = 0;
+ }
+ }
+ idx++;
+ if (idx > 15)
+ idx = 0;
+ }
+
+ for (row = 256; row < 512; row += 8)
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 8)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 15)
+ ix = 0;
+ }
+ }
+ idx++;
+ if (idx > 15)
+ idx = 0;
+ }
+
+ for (row = 512; row < 768; row++)
+ {
+ int ix = idx;
+ for (col = 0; col < 1024; col += 8)
+ {
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ *p++ = ix;
+ ix++;
+ if (ix > 15)
+ ix = 0;
+ }
+ }
+
+ for (row = 768; row < 1024; row += 8)
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ for (col = 0; col < 1024; col++)
+ *p++ = idx;
+ }
+ idx++;
+ if (idx > 15)
+ idx = 0;
+ }
+
+ rst =
+ rl2_create_raster (1024, 1024, RL2_SAMPLE_4_BIT, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, bufsize, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ goto error;
+
+ scn = rl2_create_section ("16gray", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (scn == NULL)
+ rl2_destroy_raster (rst);
+ return scn;
+ error:
+ free (bufpix);
+ return NULL;
+}
+
+static int
+test_16grays (rl2SectionPtr img)
+{
+/* testing 16-GRAYS buffer functions */
+ unsigned char *buffer;
+ int buf_size;
+ int width = 1024;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ unsigned char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ rl2PixelPtr pxl;
+ rl2RasterPtr rst;
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "16-GRAYS invalid raster pointer\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: 16-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (510 * 3);
+ if (*(p_data1 + 0) != 171 || *(p_data1 + 1) != 171 || *(p_data1 + 2) != 171)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #1: 16-GRAYS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: 16-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: 16-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 171 || *(p_data1 + 1) != 171 || *(p_data1 + 2) != 171
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: 16-GRAYS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 255
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: 16-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: 16-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 255 || *(p_data1 + 1) != 171 || *(p_data1 + 2) != 171
+ || *(p_data1 + 3) != 171)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: 16-GRAYS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 255
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: 16-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: 16-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (720 * width * 3) + (510 * 3);
+ if (*(p_data1 + 0) != 171 || *(p_data1 + 1) != 171 || *(p_data1 + 2) != 171)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: 16-GRAYS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 255)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: 16-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: 16-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (720 * width * 4) + (510 * 4);
+ if (*(p_data1 + 0) != 171 || *(p_data1 + 1) != 171 || *(p_data1 + 2) != 171
+ || *(p_data1 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: 16-GRAYS\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 255 || *(p_data2 + 2) != 255
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: 16-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_4bit (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get 4-BIT data: 16-GRAYS\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width) + 20;
+ p_data2 = buffer + (720 * width) + 510;
+ if (*p_data1 != 10)
+ {
+ fprintf (stderr, "Unexpected 4-BIT pixel #1: 16-GRAYS\n");
+ return 0;
+ }
+ if (*p_data2 != 15)
+ {
+ fprintf (stderr, "Unexpected 4-BIT pixel #2: 16-GRAYS\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr, "Unable to create Pixel for Raster: 16-GRAYS\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: 16-GRAYS\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_type (pxl, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to create get Pixel Type: 16-GRAYS\n");
+ return 0;
+ }
+
+ if (sample_type != RL2_SAMPLE_4_BIT)
+ {
+ fprintf (stderr, "Unexpected Pixel SampleType: 16-GRAYS\n");
+ return 0;
+ }
+
+ if (pixel_type != RL2_PIXEL_GRAYSCALE)
+ {
+ fprintf (stderr, "Unexpected Pixel Type: 16-GRAYS\n");
+ return 0;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected Pixel # Bands: 16-GRAYS\n");
+ return 0;
+ }
+
+ if (rl2_get_pixel_sample_4bit (pxl, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel 4-BIT: 16-GRAYS\n");
+ return 0;
+ }
+
+ if (sample != 10)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel 4-BIT Sample value %d: 16-GRAYS\n",
+ sample);
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_4bit (pxl, sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Pixel SetSample 4-BIT: 16-GRAYS\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_4bit (pxl, 16) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected Pixel SetSample 4-BIT (exceeding value): 16-GRAYS\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: 16-GRAYS\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2SectionPtr img;
+ rl2RasterPtr raster;
+ rl2RasterStatisticsPtr stats;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ unsigned char *blob_odd_png;
+ int blob_odd_sz_png;
+ unsigned char *blob_even_png;
+ int blob_even_sz_png;
+ unsigned char *blob_odd_gif;
+ int blob_odd_sz_gif;
+ unsigned char *blob_even_gif;
+ int blob_even_sz_gif;
+ unsigned char *blob_stat;
+ int blob_stat_size;
+ int anti_endian = antiEndian ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ img = create_16gray ();
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create image: 16gray\n");
+ return -1;
+ }
+
+ if (rl2_section_to_jpeg (img, "./16gray.jpg", 70) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 16gray.jpg\n");
+ return -2;
+ }
+
+ if (rl2_section_to_png (img, "./16gray.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 16gray.png\n");
+ return -3;
+ }
+
+ if (!test_16grays (img))
+ return -4;
+
+ rl2_destroy_section (img);
+
+ unlink ("./16gray.jpg");
+
+ img = rl2_section_from_png ("./16gray.png");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./16gray.png");
+ return -5;
+ }
+
+ unlink ("./16gray.png");
+
+ if (rl2_section_to_png (img, "./from_16gray.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_16gray.png\n");
+ return -6;
+ }
+
+ unlink ("./from_16gray.png");
+
+ raster = rl2_get_section_raster (img);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the raster pointer\n");
+ return -7;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed\n");
+ return -8;
+ }
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_PNG, &blob_odd_png, &blob_odd_sz_png,
+ &blob_even_png, &blob_even_sz_png, 0, anti_endian) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - PNG\n");
+ return -9;
+ }
+
+ stats =
+ rl2_get_raster_statistics (blob_odd_png, blob_odd_sz_png, blob_even_png,
+ blob_even_sz_png, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics\n");
+ return -100;
+ }
+ if (rl2_serialize_dbms_raster_statistics
+ (stats, &blob_stat, &blob_stat_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to serialize Raster Statistics\n");
+ return -101;
+ }
+ rl2_destroy_raster_statistics (stats);
+ stats = rl2_deserialize_dbms_raster_statistics (blob_stat, blob_stat_size);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to deserialize Raster Statistics\n");
+ return -102;
+ }
+ free (blob_stat);
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_raster_encode
+ (raster, RL2_COMPRESSION_GIF, &blob_odd_gif, &blob_odd_sz_gif,
+ &blob_even_gif, &blob_even_sz_gif, 0, anti_endian) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result - GIF\n");
+ return -10;
+ }
+
+ rl2_destroy_section (img);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed\n");
+ return -11;
+ }
+
+ img = rl2_create_section ("16gray 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - uncompressed\n");
+ return -12;
+ }
+
+ if (rl2_section_to_png (img, "./16gray_1_1_uncompressed.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 16gray_1_1_uncompressed.png\n");
+ return -13;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./16gray_1_1_uncompressed.png");
+
+ if (rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - uncompressed\n");
+ return -14;
+ }
+
+ if (rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:4 - uncompressed\n");
+ return -15;
+ }
+
+ if (rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:8 - uncompressed\n");
+ return -16;
+ }
+ free (blob_odd);
+
+ raster =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd_png, blob_odd_sz_png,
+ blob_even_png, blob_even_sz_png, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - png\n");
+ return -17;
+ }
+
+ img = rl2_create_section ("16gray 1:1", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Section 1:1 - png\n");
+ return -18;
+ }
+
+ if (rl2_section_to_png (img, "./16gray_1_1_png.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: 16gray_1_1_png.png\n");
+ return -19;
+ }
+ rl2_destroy_section (img);
+
+ unlink ("./16gray_1_1_png.png");
+
+ if (rl2_raster_decode
+ (RL2_SCALE_2, blob_odd_png, blob_odd_sz_png, blob_even_png,
+ blob_even_sz_png, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Decode 1:2 - png\n");
+ return -20;
+ }
+ free (blob_odd_png);
+
+ return 0;
+}
diff --git a/test/test_coverage.c b/test/test_coverage.c
new file mode 100644
index 0000000..85055c3
--- /dev/null
+++ b/test/test_coverage.c
@@ -0,0 +1,1299 @@
+/*
+
+ test_coverage.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+int
+main (int argc, char *argv[])
+{
+ rl2CoveragePtr coverage;
+ rl2PixelPtr no_data;
+ rl2PixelPtr pix2;
+ char int8;
+ unsigned char uint8;
+ short int16;
+ unsigned short uint16;
+ int int32;
+ unsigned int uint32;
+ float flt32;
+ double flt64;
+ unsigned char sample;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ int is_transparent;
+ unsigned char compression;
+ int is_compressed;
+ int srid;
+ int quality;
+ unsigned int tileWidth;
+ unsigned int tileHeight;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ if (rl2_create_coverage (NULL, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - NULL name\n");
+ return -1;
+ }
+
+ if (rl2_create_coverage ("alpha", 0xff, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - invalid sample\n");
+ return -2;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, 0xff, 3,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - invalid pixel\n");
+ return -3;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 0,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - invalid bands\n");
+ return -4;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ 0xff, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - invalid compression\n");
+ return -5;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_NONE, 0, 0, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - invalid tile width\n");
+ return -6;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_NONE, 0, 1024, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - invalid tile height\n");
+ return -7;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_NONE, 0, 510, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - invalid tile width (x8)\n");
+ return -8;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_NONE, 0, 1024, 510, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - invalid tile height (x8)\n");
+ return -9;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_MONOCHROME, 3,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - monochrome\n");
+ return -10;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 3,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - monochrome\n");
+ return -11;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1,
+ RL2_COMPRESSION_JPEG, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - monochrome/jpeg\n");
+ return -12;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT16, RL2_PIXEL_PALETTE, 3,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - palette\n");
+ return -13;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_4_BIT, RL2_PIXEL_PALETTE, 1,
+ RL2_COMPRESSION_JPEG, 70, 1024, 1024,
+ NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - palette/jpeg\n");
+ return -14;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_4_BIT, RL2_PIXEL_PALETTE, 2,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - palette/jpeg\n");
+ return -15;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 2,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - grayscale bands\n");
+ return -16;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT16, RL2_PIXEL_GRAYSCALE, 1,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - grayscale 16\n");
+ return -17;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 2,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - rgb bands\n");
+ return -18;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT16, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) == NULL)
+ {
+ fprintf (stderr, "Invalid coverage - rgb 16\n");
+ return -19;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_GIF, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - rgb/gif\n");
+ return -20;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 1,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - multiband bands\n");
+ return -21;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_FLOAT, RL2_PIXEL_MULTIBAND, 3,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - multiband float\n");
+ return -22;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT16, RL2_PIXEL_MULTIBAND, 3,
+ RL2_COMPRESSION_GIF, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - multiband/gif\n");
+ return -23;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_FLOAT, RL2_PIXEL_DATAGRID, 2,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - multiband bands\n");
+ return -24;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_2_BIT, RL2_PIXEL_DATAGRID, 1,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - datagrid 2 bit\n");
+ return -25;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT16, RL2_PIXEL_DATAGRID, 1,
+ RL2_COMPRESSION_JPEG, 0, 1024, 1024, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid coverage - datagrid/jpeg\n");
+ return -26;
+ }
+
+ coverage = rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_JPEG, 0, 1024, 1024, NULL);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "Unable to create a valid coverage\n");
+ return -27;
+ }
+
+ if (rl2_coverage_georeference (coverage, 4326, 0.5, 0.5) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set georeferencing: coverage\n");
+ return -28;
+ }
+
+ if (rl2_get_coverage_name (coverage) == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the coverage name\n");
+ return -29;
+ }
+
+ if (rl2_get_coverage_type (coverage, &sample_type, &pixel_type, &num_bands)
+ != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get coverage type\n");
+ return -30;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected coverage sample\n");
+ return -31;
+ }
+
+ if (pixel_type != RL2_PIXEL_RGB)
+ {
+ fprintf (stderr, "Unexpected coverage pixel\n");
+ return -32;
+ }
+
+ if (num_bands != 3)
+ {
+ fprintf (stderr, "Unexpected coverage # bands\n");
+ return -33;
+ }
+
+ if (rl2_get_coverage_compression (coverage, &compression, &quality) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get coverage compression\n");
+ return -34;
+ }
+
+ if (compression != RL2_COMPRESSION_JPEG)
+ {
+ fprintf (stderr, "Unexpected coverage compression\n");
+ return -35;
+ }
+
+ if (rl2_is_coverage_uncompressed (coverage, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get coverage not compressed\n");
+ return -36;
+ }
+
+ if (is_compressed != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected coverage not compressed\n");
+ return -37;
+ }
+
+ if (rl2_is_coverage_compression_lossless (coverage, &is_compressed) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get coverage compression lossless\n");
+ return -38;
+ }
+
+ if (is_compressed != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected coverage compression lossless\n");
+ return -39;
+ }
+
+ if (rl2_is_coverage_compression_lossy (coverage, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get coverage compression lossy\n");
+ return -40;
+ }
+
+ if (is_compressed != RL2_TRUE)
+ {
+ fprintf (stderr, "Unexpected coverage compression lossy\n");
+ return -41;
+ }
+
+ if (rl2_get_coverage_tile_size (coverage, &tileWidth, &tileHeight) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get coverage tile size\n");
+ return -42;
+ }
+
+ if (tileWidth != 1024)
+ {
+ fprintf (stderr, "Unexpected coverage tile width\n");
+ return -43;
+ }
+
+ if (tileHeight != 1024)
+ {
+ fprintf (stderr, "Unexpected coverage tile height\n");
+ return -44;
+ }
+
+ if (rl2_get_coverage_srid (coverage, &srid) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get coverage SRID\n");
+ return -45;
+ }
+
+ if (srid != 4326)
+ {
+ fprintf (stderr, "Unexpected coverage SRID\n");
+ return -46;
+ }
+
+ rl2_destroy_coverage (coverage);
+
+ rl2_destroy_coverage (NULL);
+
+ if (rl2_coverage_georeference (NULL, 4326, 0.5, 0.5) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: georeferencing NULL coverage\n");
+ return -47;
+ }
+
+ if (rl2_get_coverage_name (NULL) != NULL)
+ {
+ fprintf (stderr, "ERROR: NULL coverage name\n");
+ return -48;
+ }
+
+ if (rl2_get_coverage_type (NULL, &sample_type, &pixel_type, &num_bands) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL coverage type\n");
+ return -49;
+ }
+
+ if (rl2_get_coverage_compression (NULL, &compression, &quality) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL coverage compression\n");
+ return -50;
+ }
+
+ if (rl2_is_coverage_uncompressed (NULL, &is_compressed) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL coverage not compressed\n");
+ return -51;
+ }
+
+ if (rl2_is_coverage_compression_lossless (NULL, &is_compressed) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL coverage compression lossless\n");
+ return -52;
+ }
+
+ if (rl2_is_coverage_compression_lossy (NULL, &is_compressed) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL coverage compression lossy\n");
+ return -53;
+ }
+
+ if (rl2_get_coverage_tile_size (NULL, &tileWidth, &tileHeight) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL coverage tile width\n");
+ return -54;
+ }
+
+ if (rl2_get_coverage_srid (NULL, &srid) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL coverage SRID\n");
+ return -56;
+ }
+
+ if (rl2_get_coverage_no_data (NULL) != NULL)
+ {
+ fprintf (stderr, "ERROR: NULL coverage NoData\n");
+ return -57;
+ }
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel\n");
+ return -58;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_RED_BAND, 0) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Red NoData #1\n");
+ return -59;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, 255) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Green NoData #1\n");
+ return -60;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, 0) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Blue NoData #1\n");
+ return -61;
+ }
+
+ coverage = rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_JPEG, 20, 1024, 1024,
+ no_data);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "Unable to create a valid coverage\n");
+ return -62;
+ }
+
+ no_data = rl2_get_coverage_no_data (coverage);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to get NoData from coverage #1\n");
+ return -63;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_RED_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RED NoData from coverage #1\n");
+ return -64;
+ }
+
+ if (sample != 0)
+ {
+ fprintf (stderr, "Unexpected RED NoData from coverage #1\n");
+ return -65;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get GREEN NoData from coverage #1\n");
+ return -66;
+ }
+
+ if (sample != 255)
+ {
+ fprintf (stderr, "Unexpected GREEN NoData from coverage #1\n");
+ return -67;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BLUE NoData from coverage #1\n");
+ return -68;
+ }
+
+ if (sample != 0)
+ {
+ fprintf (stderr, "Unexpected BLUE NoData from coverage #1\n");
+ return -69;
+ }
+
+ no_data = rl2_create_coverage_pixel (coverage);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a pixel for coverage #1\n");
+ return -70;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_RED_BAND, 255) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Red NoData #2\n");
+ return -71;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, 0) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Green NoData #2\n");
+ return -72;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, 255) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Blue NoData #2\n");
+ return -73;
+ }
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_get_coverage_no_data (coverage);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to get NoData from coverage #2\n");
+ return -74;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_RED_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RED NoData from coverage #2\n");
+ return -75;
+ }
+
+ if (sample != 0)
+ {
+ fprintf (stderr, "Unexpected RED NoData from coverage #2\n");
+ return -76;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get GREEN NoData from coverage #2\n");
+ return -77;
+ }
+
+ if (sample != 255)
+ {
+ fprintf (stderr, "Unexpected GREEN NoData from coverage #2\n");
+ return -78;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BLUE NoData from coverage #2\n");
+ return -79;
+ }
+
+ if (sample != 0)
+ {
+ fprintf (stderr, "Unexpected BLUE NoData from coverage #2\n");
+ return -80;
+ }
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel\n");
+ return -81;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_JPEG, 30, 1024, 1024,
+ no_data) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create coverage (invalid NoData)\n");
+ return -82;
+ }
+
+ rl2_destroy_pixel (no_data);
+
+ rl2_destroy_coverage (coverage);
+
+ coverage =
+ rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 2,
+ RL2_COMPRESSION_NONE, 0, 1024, 1024, NULL);
+
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "Unable to create coverage (invalid NoData)\n");
+ return -83;
+ }
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT16, RL2_PIXEL_MULTIBAND, 3);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel\n");
+ return -84;
+ }
+
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 3);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel\n");
+ return -85;
+ }
+
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 2);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel\n");
+ return -86;
+ }
+ rl2_destroy_pixel (no_data);
+
+ if (rl2_is_coverage_uncompressed (coverage, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get coverage not compressed\n");
+ return -87;
+ }
+
+ if (is_compressed != RL2_TRUE)
+ {
+ fprintf (stderr, "Unexpected coverage not compressed\n");
+ return -88;
+ }
+
+ rl2_destroy_coverage (coverage);
+
+ coverage =
+ rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 2,
+ RL2_COMPRESSION_LZMA, 0, 1024, 1024, NULL);
+
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "Unable to create coverage (invalid NoData)\n");
+ return -89;
+ }
+
+ if (rl2_is_coverage_compression_lossless (coverage, &is_compressed) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get coverage compression lossless\n");
+ return -90;
+ }
+
+ if (is_compressed != RL2_TRUE)
+ {
+ fprintf (stderr, "Unexpected coverage compression lossless\n");
+ return -91;
+ }
+
+ if (rl2_is_coverage_compression_lossy (coverage, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get coverage compression lossy\n");
+ return -92;
+ }
+
+ if (is_compressed != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected coverage compression lossy\n");
+ return -93;
+ }
+
+ rl2_destroy_coverage (coverage);
+
+ if (rl2_get_coverage_no_data (NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: get NoData (NULL coverage)\n");
+ return -94;
+ }
+
+ if (rl2_create_coverage_pixel (NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: get pixel (NULL coverage)\n");
+ return -94;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_JPEG, 60, 1025, 1024,
+ no_data) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create coverage (invalid NoData)\n");
+ return -96;
+ }
+
+ if (rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ RL2_COMPRESSION_JPEG, 70, 1024, 1025,
+ no_data) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create coverage (invalid NoData)\n");
+ return -97;
+ }
+
+ if (rl2_create_pixel (0xff, RL2_PIXEL_RGB, 3) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a pixel (invalid sample)\n");
+ return -98;
+ }
+
+ if (rl2_create_pixel (RL2_SAMPLE_UINT8, 0xff, 3) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a pixel (invalid type)\n");
+ return -99;
+ }
+
+ if (rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 1) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a pixel (RGB invalid Bands)\n");
+ return -100;
+ }
+
+ if (rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 2) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a pixel (Gray invalid Bands)\n");
+ return -101;
+ }
+
+ if (rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 1) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a pixel (MultiBand invalid Bands)\n");
+ return -102;
+ }
+
+ rl2_free (NULL);
+
+ rl2_destroy_pixel (NULL);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 2);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel\n");
+ return -103;
+ }
+
+ if (rl2_compare_pixels (no_data, NULL) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: compare pixels (valid, NULL)\n");
+ return -104;
+ }
+
+ if (rl2_compare_pixels (NULL, no_data) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: compare pixels (NULL, valid)\n");
+ return -105;
+ }
+
+ if (rl2_compare_pixels (NULL, NULL) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: compare pixels (NULL, NULL)\n");
+ return -106;
+ }
+
+ pix2 = rl2_create_pixel (RL2_SAMPLE_UINT16, RL2_PIXEL_MULTIBAND, 2);
+ if (pix2 == NULL)
+ {
+ fprintf (stderr, "Unable to create a MultiBand16 pixel\n");
+ return -107;
+ }
+
+ if (rl2_compare_pixels (no_data, pix2) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: compare pixels (mismatching sample)\n");
+ return -108;
+ }
+
+ rl2_destroy_pixel (pix2);
+
+ pix2 = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3);
+ if (pix2 == NULL)
+ {
+ fprintf (stderr, "Unable to create an RGB pixel\n");
+ return -109;
+ }
+
+ if (rl2_compare_pixels (no_data, pix2) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: compare pixels (mismatching type)\n");
+ return -110;
+ }
+
+ rl2_destroy_pixel (pix2);
+
+ pix2 = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 6);
+ if (pix2 == NULL)
+ {
+ fprintf (stderr, "Unable to create a MultiBand8 pixel\n");
+ return -111;
+ }
+
+ if (rl2_compare_pixels (no_data, pix2) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: compare pixels (mismatching Bands)\n");
+ return -112;
+ }
+
+ rl2_destroy_pixel (pix2);
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_INT8, RL2_PIXEL_DATAGRID, 1);
+ pix2 = rl2_create_pixel (RL2_SAMPLE_INT8, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL || pix2 == NULL)
+ {
+ fprintf (stderr, "Unable to create INT8 pixels for comparison\n");
+ return -113;
+ }
+ rl2_set_pixel_sample_int8 (no_data, -1);
+ rl2_set_pixel_sample_int8 (pix2, -2);
+
+ if (rl2_compare_pixels (no_data, pix2) != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected result: compare pixels (INT8)\n");
+ return -114;
+ }
+ rl2_destroy_pixel (pix2);
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 1);
+ pix2 = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL || pix2 == NULL)
+ {
+ fprintf (stderr, "Unable to create UINT8 pixels for comparison\n");
+ return -115;
+ }
+ rl2_set_pixel_sample_uint8 (no_data, RL2_DATAGRID_BAND, 0);
+ rl2_set_pixel_sample_uint8 (pix2, RL2_DATAGRID_BAND, 1);
+
+ if (rl2_compare_pixels (no_data, pix2) != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected result: compare pixels (UINT8)\n");
+ return -116;
+ }
+ rl2_destroy_pixel (pix2);
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_INT16, RL2_PIXEL_DATAGRID, 1);
+ pix2 = rl2_create_pixel (RL2_SAMPLE_INT16, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL || pix2 == NULL)
+ {
+ fprintf (stderr, "Unable to create INT16 pixels for comparison\n");
+ return -117;
+ }
+ rl2_set_pixel_sample_int16 (no_data, -1);
+ rl2_set_pixel_sample_int16 (pix2, -2);
+
+ if (rl2_compare_pixels (no_data, pix2) != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected result: compare pixels (INT16)\n");
+ return -118;
+ }
+ rl2_destroy_pixel (pix2);
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT16, RL2_PIXEL_DATAGRID, 1);
+ pix2 = rl2_create_pixel (RL2_SAMPLE_UINT16, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL || pix2 == NULL)
+ {
+ fprintf (stderr, "Unable to create UINT16 pixels for comparison\n");
+ return -119;
+ }
+ rl2_set_pixel_sample_uint16 (no_data, RL2_DATAGRID_BAND, 0);
+ rl2_set_pixel_sample_uint16 (pix2, RL2_DATAGRID_BAND, 1);
+
+ if (rl2_compare_pixels (no_data, pix2) != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected result: compare pixels (UINT16)\n");
+ return -120;
+ }
+ rl2_destroy_pixel (pix2);
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_INT32, RL2_PIXEL_DATAGRID, 1);
+ pix2 = rl2_create_pixel (RL2_SAMPLE_INT32, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL || pix2 == NULL)
+ {
+ fprintf (stderr, "Unable to create INT32 pixels for comparison\n");
+ return -121;
+ }
+ rl2_set_pixel_sample_int32 (no_data, -1);
+ rl2_set_pixel_sample_int32 (pix2, -2);
+
+ if (rl2_compare_pixels (no_data, pix2) != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected result: compare pixels (INT32)\n");
+ return -122;
+ }
+ rl2_destroy_pixel (pix2);
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT32, RL2_PIXEL_DATAGRID, 1);
+ pix2 = rl2_create_pixel (RL2_SAMPLE_UINT32, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL || pix2 == NULL)
+ {
+ fprintf (stderr, "Unable to create UINT32 pixels for comparison\n");
+ return -123;
+ }
+ rl2_set_pixel_sample_uint32 (no_data, 0);
+ rl2_set_pixel_sample_uint32 (pix2, 1);
+
+ if (rl2_compare_pixels (no_data, pix2) != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected result: compare pixels (UINT32)\n");
+ return -124;
+ }
+ rl2_destroy_pixel (pix2);
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_FLOAT, RL2_PIXEL_DATAGRID, 1);
+ pix2 = rl2_create_pixel (RL2_SAMPLE_FLOAT, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL || pix2 == NULL)
+ {
+ fprintf (stderr, "Unable to create FLOAT pixels for comparison\n");
+ return -125;
+ }
+ rl2_set_pixel_sample_float (no_data, 0.5);
+ rl2_set_pixel_sample_float (pix2, 1.5);
+
+ if (rl2_compare_pixels (no_data, pix2) != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected result: compare pixels (FLOAT)\n");
+ return -126;
+ }
+ rl2_destroy_pixel (pix2);
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_DOUBLE, RL2_PIXEL_DATAGRID, 1);
+ pix2 = rl2_create_pixel (RL2_SAMPLE_DOUBLE, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL || pix2 == NULL)
+ {
+ fprintf (stderr, "Unable to create DOUBLE pixels for comparison\n");
+ return -127;
+ }
+ rl2_set_pixel_sample_double (no_data, 0.5);
+ rl2_set_pixel_sample_double (pix2, 1.5);
+
+ if (rl2_compare_pixels (no_data, pix2) != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected result: compare pixels (DOUBLE)\n");
+ return -128;
+ }
+ rl2_destroy_pixel (pix2);
+ rl2_destroy_pixel (no_data);
+
+ if (rl2_get_pixel_type (NULL, &sample_type, &pixel_type, &num_bands) ==
+ RL2_OK)
+ {
+ fprintf (stderr, "Unexpected result: pixel sample (NULL)\n");
+ return -129;
+ }
+
+ if (rl2_get_pixel_sample_1bit (NULL, &uint8) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: get pixel sample 1bit (NULL)\n");
+ return -132;
+ }
+
+ if (rl2_set_pixel_sample_1bit (NULL, 0) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: set pixel sample 1bit (NULL)\n");
+ return -133;
+ }
+
+ if (rl2_get_pixel_sample_2bit (NULL, &uint8) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: get pixel sample 2bit (NULL)\n");
+ return -134;
+ }
+
+ if (rl2_set_pixel_sample_2bit (NULL, 0) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: set pixel sample 2bit (NULL)\n");
+ return -135;
+ }
+
+ if (rl2_get_pixel_sample_4bit (NULL, &uint8) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: get pixel sample 4bit (NULL)\n");
+ return -136;
+ }
+
+ if (rl2_set_pixel_sample_4bit (NULL, 0) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: set pixel sample 4bit (NULL)\n");
+ return -137;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (NULL, RL2_DATAGRID_BAND, &uint8) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample uint8 (NULL)\n");
+ return -138;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (NULL, RL2_DATAGRID_BAND, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample uint8 (NULL)\n");
+ return -139;
+ }
+
+ if (rl2_get_pixel_sample_int8 (NULL, &int8) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: get pixel sample int8 (NULL)\n");
+ return -140;
+ }
+
+ if (rl2_set_pixel_sample_int8 (NULL, 0) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: set pixel sample int8 (NULL)\n");
+ return -141;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (NULL, RL2_DATAGRID_BAND, &uint16) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample uint16 (NULL)\n");
+ return -142;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (NULL, RL2_DATAGRID_BAND, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample uint16 (NULL)\n");
+ return -143;
+ }
+
+ if (rl2_get_pixel_sample_int16 (NULL, &int16) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample int16 (NULL)\n");
+ return -144;
+ }
+
+ if (rl2_set_pixel_sample_int16 (NULL, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample int16 (NULL)\n");
+ return -145;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (NULL, RL2_DATAGRID_BAND, &uint16) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample uint16 (NULL)\n");
+ return -142;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (NULL, RL2_DATAGRID_BAND, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample uint16 (NULL)\n");
+ return -143;
+ }
+
+ if (rl2_get_pixel_sample_int32 (NULL, &int32) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample int32 (NULL)\n");
+ return -144;
+ }
+
+ if (rl2_set_pixel_sample_int32 (NULL, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample int32 (NULL)\n");
+ return -145;
+ }
+
+ if (rl2_get_pixel_sample_uint32 (NULL, &uint32) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample uint32 (NULL)\n");
+ return -146;
+ }
+
+ if (rl2_set_pixel_sample_uint32 (NULL, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample uint32 (NULL)\n");
+ return -147;
+ }
+
+ if (rl2_get_pixel_sample_float (NULL, &flt32) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample FLOAT (NULL)\n");
+ return -148;
+ }
+
+ if (rl2_set_pixel_sample_float (NULL, 0.5) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample FLOAT (NULL)\n");
+ return -149;
+ }
+
+ if (rl2_get_pixel_sample_double (NULL, &flt64) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample DOUBLE (NULL)\n");
+ return -150;
+ }
+
+ if (rl2_set_pixel_sample_double (NULL, 0.5) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample DOUBLE (NULL)\n");
+ return -151;
+ }
+
+ if (rl2_is_pixel_transparent (NULL, &is_transparent) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: is pixel transparent (NULL)\n");
+ return -152;
+ }
+
+ if (rl2_is_pixel_opaque (NULL, &is_transparent) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: is pixel opaque (NULL)\n");
+ return -153;
+ }
+
+ if (rl2_set_pixel_transparent (NULL) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: set pixel transparent (NULL)\n");
+ return -154;
+ }
+
+ if (rl2_set_pixel_opaque (NULL) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: set pixel opaque (NULL)\n");
+ return -155;
+ }
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_DOUBLE, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create DOUBLE pixels for testing\n");
+ return -156;
+ }
+
+ if (rl2_get_pixel_sample_1bit (no_data, &uint8) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample 1bit (invalid)\n");
+ return -157;
+ }
+
+ if (rl2_set_pixel_sample_1bit (no_data, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample 1bit (invalid)\n");
+ return -158;
+ }
+
+ if (rl2_get_pixel_sample_2bit (no_data, &uint8) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample 2bit (invalid)\n");
+ return -159;
+ }
+
+ if (rl2_set_pixel_sample_2bit (no_data, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample 2bit (invalid)\n");
+ return -160;
+ }
+
+ if (rl2_get_pixel_sample_4bit (no_data, &uint8) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample 4bit (invalid)\n");
+ return -161;
+ }
+
+ if (rl2_set_pixel_sample_4bit (no_data, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample 4bit (invalid)\n");
+ return -162;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_DATAGRID_BAND, &uint8) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample uint8 (invalid)\n");
+ return -163;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_DATAGRID_BAND, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample uint8 (invalid)\n");
+ return -164;
+ }
+
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create UINT8 pixels for testing\n");
+ return -165;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, -1, &uint8) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample uint8 (invalid)\n");
+ return -166;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, -1, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample uint8 (invalid)\n");
+ return -167;
+ }
+
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT16, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create UINT16 pixels for testing\n");
+ return -168;
+ }
+
+ if (rl2_get_pixel_sample_uint16 (no_data, -1, &uint16) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: get pixel sample uint16 (invalid)\n");
+ return -169;
+ }
+
+ if (rl2_set_pixel_sample_uint16 (no_data, -1, 0) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: set pixel sample uint16 (invalid)\n");
+ return -170;
+ }
+
+ rl2_destroy_pixel (no_data);
+
+ return 0;
+}
diff --git a/test/test_gif.c b/test/test_gif.c
new file mode 100644
index 0000000..ad14019
--- /dev/null
+++ b/test/test_gif.c
@@ -0,0 +1,79 @@
+/*
+
+ test_gif.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+test_gif (const char *path)
+{
+ rl2SectionPtr img = rl2_section_from_gif (path);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_section_to_png (img, "./from_gif.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_gif.png\n");
+ return 0;
+ }
+ unlink ("./from_gif.png");
+
+ rl2_destroy_section (img);
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ if (!test_gif ("./gif1.gif"))
+ return -1;
+
+ return 0;
+}
diff --git a/test/test_load_wms.c b/test/test_load_wms.c
new file mode 100644
index 0000000..c727278
--- /dev/null
+++ b/test/test_load_wms.c
@@ -0,0 +1,429 @@
+/*
+
+ test_load_wms.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+get_base_resolution (sqlite3 * sqlite, const char *coverage, double *x_res,
+ double *y_res)
+{
+/* attempting to retrieve the Coverage's base resolution */
+ char *sql;
+ sqlite3_stmt *stmt;
+ int ret;
+ int ok = 0;
+
+ sql = sqlite3_mprintf ("SELECT horz_resolution, vert_resolution "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ *x_res = sqlite3_column_double (stmt, 0);
+ *y_res = sqlite3_column_double (stmt, 1);
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+}
+
+static int
+do_export_geotiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a GeoTiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_gt_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 0);
+ sqlite3_bind_text (stmt, 9, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ char *sql;
+ gaiaGeomCollPtr geom;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* creating an RGB DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.2f)",
+ "rgb10k", "UINT8", "RGB", 3, "JPEG", 80,
+ 512, 512, 3003, 0.5);
+ ret = execute_check (db_handle, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", "rgb10k",
+ err_msg);
+ sqlite3_free (err_msg);
+ return -4;
+ }
+
+/* creating a Grayscale DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.2f)",
+ "gray10k", "UINT8", "GRAYSCALE", 1, "JPEG", 80,
+ 512, 512, 3003, 1.0);
+ ret = execute_check (db_handle, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", "gray10k",
+ err_msg);
+ sqlite3_free (err_msg);
+ return -5;
+ }
+
+/* creating a Monochrome DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.2f, %1.2f, "
+ "RL2_SetPixelValue(RL2_CreatePixel(%Q, %Q, 1), 0, 0))",
+ "ctrt10k", "1-BIT", "MONOCHROME", 1, "FAX4", 100,
+ 512, 512, 3003, 0.5, 0.5, "1-BIT", "MONOCHROME");
+ ret = execute_check (db_handle, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", "ctrt10k",
+ err_msg);
+ sqlite3_free (err_msg);
+ return -6;
+ }
+
+/* loading from WMS (RGB) */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRasterFromWMS(%Q, %Q, %Q, %s, %Q, %Q, NULL, %Q, %1.1f)",
+ "rgb10k", "firenze",
+ "http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsofc&map_resolution=91&language=ita&",
+ "BuildCircleMbr(1681700, 4849150, 500.0, 3003)", "1.3.0",
+ "rt_ofc.10k10", "image/jpeg", 0.5);
+ ret = execute_check (db_handle, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRasterFromWMS \"%s\" error: %s\n", "rgb10k",
+ err_msg);
+ sqlite3_free (err_msg);
+ return -7;
+ }
+
+/* loading from WMS (Grayscale) */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRasterFromWMS(%Q, %Q, %Q, %s, %Q, %Q, NULL, %Q, %1.1f)",
+ "gray10k", "firenze",
+ "http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsofc&map_resolution=91&language=ita&",
+ "BuildCircleMbr(1681700, 4849150, 1000.0, 3003)", "1.3.0",
+ "rt_ofc.10k88", "image/jpeg", 1.0);
+ ret = execute_check (db_handle, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRasterFromWMS \"%s\" error: %s\n", "gray10k",
+ err_msg);
+ sqlite3_free (err_msg);
+ return -8;
+ }
+
+/* loading from WMS (Monochrome) */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRasterFromWMS(%Q, %Q, %Q, %s, %Q, %Q, NULL, %Q, %1.1f)",
+ "ctrt10k", "firenze",
+ "http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsctr&map_resolution=91&language=ita&",
+ "BuildCircleMbr(1681700, 4849150, 500.0, 3003)", "1.3.0", "rt_ctr.10k",
+ "image/png", 0.5);
+ ret = execute_check (db_handle, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRasterFromWMS \"%s\" error: %s\n", "ctrt10k",
+ err_msg);
+ sqlite3_free (err_msg);
+ return -9;
+ }
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_Pyramidize(%Q, %Q, 1, 1)", "ctrt10k", "firenze");
+ ret = execute_check (db_handle, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", "ctrt10k", err_msg);
+ sqlite3_free (err_msg);
+ return -10;
+ }
+
+/* export tests */
+ geom = get_center_point (db_handle, "rgb10k");
+ if (geom == NULL)
+ return -11;
+ if (!do_export_geotiff (db_handle, "rgb10k", geom, 1))
+ return -12;
+ if (!do_export_geotiff (db_handle, "rgb10k", geom, 2))
+ return -13;
+ if (!do_export_geotiff (db_handle, "rgb10k", geom, 4))
+ return -14;
+ if (!do_export_geotiff (db_handle, "rgb10k", geom, 8))
+ return -15;
+ gaiaFreeGeomColl (geom);
+ geom = get_center_point (db_handle, "rgb10k");
+ if (geom == NULL)
+ return -16;
+ if (!do_export_geotiff (db_handle, "gray10k", geom, 1))
+ return -17;
+ if (!do_export_geotiff (db_handle, "gray10k", geom, 2))
+ return -18;
+ if (!do_export_geotiff (db_handle, "gray10k", geom, 4))
+ return -19;
+ if (!do_export_geotiff (db_handle, "gray10k", geom, 8))
+ return -20;
+ gaiaFreeGeomColl (geom);
+ geom = get_center_point (db_handle, "ctrt10k");
+ if (geom == NULL)
+ return -21;
+ if (!do_export_geotiff (db_handle, "ctrt10k", geom, 1))
+ return -22;
+ if (!do_export_geotiff (db_handle, "ctrt10k", geom, 2))
+ return -23;
+ if (!do_export_geotiff (db_handle, "ctrt10k", geom, 4))
+ return -24;
+ if (!do_export_geotiff (db_handle, "ctrt10k", geom, 8))
+ return -25;
+ gaiaFreeGeomColl (geom);
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_ascii.c b/test/test_map_ascii.c
new file mode 100644
index 0000000..8198234
--- /dev/null
+++ b/test/test_map_ascii.c
@@ -0,0 +1,1461 @@
+/*
+
+ test_map_ascii.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+do_export_ascii (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting an ASCII Grid */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ double res = 1.0 * (double) scale;
+
+ path = sqlite3_mprintf ("./%s_%d.asc", coverage, scale);
+
+ sql = "SELECT RL2_WriteAsciiGrid(?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, res);
+ sqlite3_bind_int (stmt, 7, 1);
+ sqlite3_bind_int (stmt, 8, 2);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+static int
+test_histogram (sqlite3 * sqlite, const char *coverage)
+{
+/* testing Band Histogram */
+ int ret = 0;
+ char *path = sqlite3_mprintf ("histogram_%s.png", coverage);
+ char *sql =
+ sqlite3_mprintf
+ ("SELECT BlobToFile(RL2_GetBandStatistics_Histogram(statistics, 0), %Q) "
+ "FROM raster_coverages WHERE Lower(coverage_name) = Lower(%Q)", path,
+ coverage);
+ if (execute_check (sqlite, sql) == SQLITE_OK)
+ ret = 1;
+ sqlite3_free (sql);
+ unlink (path);
+ sqlite3_free (path);
+ return ret;
+}
+
+static int
+test_statistics (sqlite3 * sqlite, const char *coverage, int *retcode)
+{
+/* testing Coverage and Band statistics */
+ int ret;
+ char *err_msg = NULL;
+ char *sql;
+ char **results;
+ int rows;
+ int columns;
+ const char *string;
+ int intval;
+
+/* testing RasterStatistics */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_GetRasterStatistics_NoDataPixelsCount(statistics), "
+ "RL2_GetRasterStatistics_ValidPixelsCount(statistics), "
+ "RL2_GetRasterStatistics_SampleType(statistics), "
+ "RL2_GetRasterStatistics_BandsCount(statistics) "
+ "FROM raster_coverages WHERE Lower(coverage_name) = Lower(%Q)",
+ coverage);
+ ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &err_msg);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+ if (rows != 1 || columns != 4)
+ {
+ fprintf (stderr, "Unexpected error: bad result: %i/%i.\n", rows,
+ columns);
+ *retcode += -2;
+ return 0;
+ }
+
+/* NoData Pixels */
+ string = results[4];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (NoDataPixelsCount)\n");
+ *retcode += -3;
+ return 0;
+ }
+
+/* Valid Pixels */
+ string = results[5];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (ValidPixelsCount)\n");
+ *retcode += -5;
+ return 0;
+ }
+
+/* Sample Type */
+ string = results[6];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (SampleType)\n");
+ *retcode += -7;
+ return 0;
+ }
+
+/* Bands */
+ string = results[7];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (BandsCount)\n");
+ *retcode += -9;
+ return 0;
+ }
+ intval = atoi (string);
+ if (intval != 1)
+ {
+ fprintf (stderr, "Unexpected BandsCount: %d\n", intval);
+ *retcode += -10;
+ return 0;
+ }
+
+ sqlite3_free_table (results);
+
+/* testing BandStatistics */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_GetBandStatistics_Min(statistics, 0), "
+ "RL2_GetBandStatistics_Max(statistics, 0), "
+ "RL2_GetBandStatistics_Avg(statistics, 0), "
+ "RL2_GetBandStatistics_Var(statistics, 0), "
+ "RL2_GetBandStatistics_StdDev(statistics, 0) "
+ "FROM raster_coverages WHERE Lower(coverage_name) = Lower(%Q)",
+ coverage);
+ ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &err_msg);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+ if (rows != 1 || columns != 5)
+ {
+ fprintf (stderr, "Unexpected error: bad result: %i/%i.\n", rows,
+ columns);
+ *retcode += -2;
+ return 0;
+ }
+
+/* Min */
+ string = results[5];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (Band Min)\n");
+ *retcode += -12;
+ return 0;
+ }
+
+/* Max */
+ string = results[6];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (Band Max)\n");
+ *retcode += -14;
+ return 0;
+ }
+
+/* Avg */
+ string = results[7];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (Band Avg)\n");
+ *retcode += -16;
+ return 0;
+ }
+
+/* Var */
+ string = results[8];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (Band Var)\n");
+ *retcode += -18;
+ return 0;
+ }
+
+/* StdDev */
+ string = results[9];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (Band StdDev)\n");
+ *retcode += -20;
+ return 0;
+ }
+
+ sqlite3_free_table (results);
+
+/* Histogram */
+ if (test_histogram (sqlite, coverage) != 1)
+ {
+ fprintf (stderr, "Unable to create an Histogram \"%s\"\n", coverage);
+ *retcode += 21;
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char sample,
+ unsigned char compression, int tile_sz, int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty;
+ char *sql;
+ int tile_size;
+ gaiaGeomCollPtr geom;
+
+/* setting the coverage name */
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT16:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT16:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT32:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT32:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_FLOAT:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ pixel_name = "DATAGRID";
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ sample_name = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ sample_name = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ sample_name = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample_name = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ sample_name = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample_name = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample_name = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample_name = "DOUBLE";
+ break;
+ };
+ num_bands = 1;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ compression_name = "NONE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ compression_name = "DEFLATE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_LZMA:
+ compression_name = "LZMA";
+ qlty = 100;
+ break;
+ };
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.8f, %1.8f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 3003,
+ 1.0, 1.0);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 3003, 1)", coverage,
+ "map_samples/ascii", ".asc");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "ascii1");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 3003, 1)",
+ coverage, "map_samples/ascii/ascii1.asc");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+/* export tests */
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -5;
+ return 0;
+ }
+ if (!do_export_ascii (sqlite, coverage, geom, 1))
+ {
+ *retcode += -6;
+ return 0;
+ }
+ if (!do_export_ascii (sqlite, coverage, geom, 2))
+ {
+ *retcode += -7;
+ return 0;
+ }
+ if (!do_export_ascii (sqlite, coverage, geom, 4))
+ {
+ *retcode += -8;
+ return 0;
+ }
+ if (!do_export_ascii (sqlite, coverage, geom, 8))
+ {
+ *retcode += -9;
+ return 0;
+ }
+ gaiaFreeGeomColl (geom);
+
+ *retcode += -10;
+ if (!test_statistics (sqlite, coverage, retcode))
+ return 0;
+
+ if (compression == RL2_COMPRESSION_DEFLATE)
+ {
+ /* testing a Monolithic Pyramid */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_PyramidizeMonolithic(%Q, 1, 1)",
+ coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "PyramidizeMonolithic \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -11;
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+static int
+drop_coverage (sqlite3 * sqlite, unsigned char sample,
+ unsigned char compression, int tile_sz, int *retcode)
+{
+/* dropping some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ char *sql;
+
+/* setting the coverage name */
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT16:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT16:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT32:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT32:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_FLOAT:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* dropping the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_DropCoverage(%Q, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DropCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2AsciiGridDestinationPtr ascii;
+ unsigned char *pixels;
+ const char *path;
+ unsigned int width;
+ unsigned int height;
+ double x;
+ double y;
+ double res;
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* ASCII Grid tests */
+ ret = -100;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -150;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -170;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -250;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -270;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -350;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -370;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -400;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -420;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+ ret = -450;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -470;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+
+/* dropping all ASCII Grid Coverages */
+ ret = -110;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -130;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -160;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -180;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -210;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -230;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -260;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+ ret = -310;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -330;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -360;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -380;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -410;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -430;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+ ret = -460;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -480;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+
+/* testing an ASCII destination */
+ pixels = malloc (100 * 200);
+ memset (pixels, 0, 100 * 200);
+ ascii =
+ rl2_create_ascii_grid_destination ("test_ascii.asc", 100, 200, 1.5,
+ 10.0, 20.0, 1, 0, 2, pixels,
+ 100 * 200, RL2_SAMPLE_UINT8);
+ if (ascii == NULL)
+ {
+ fprintf (stderr,
+ "ERROR: unable to create an ASCII Grid destination\n");
+ return 500;
+ }
+ path = rl2_get_ascii_grid_destination_path (ascii);
+ if (path == NULL)
+ {
+ fprintf (stderr, "ERROR: unexpected NULL ASCII Grid path\n");
+ return 501;
+ }
+ if (strcmp (path, "test_ascii.asc") != 0)
+ {
+ fprintf (stderr, "ERROR: unexpected ASCII Grid path: %s\n", path);
+ return 502;
+ }
+ if (rl2_get_ascii_grid_destination_size (ascii, &width, &height) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to get ASCII Grid dimensions\n");
+ return 503;
+ }
+ if (width != 100)
+ {
+ fprintf (stderr, "ERROR: unexpected ASCII Grid Width: %u\n", width);
+ return 504;
+ }
+ if (height != 200)
+ {
+ fprintf (stderr, "ERROR: unexpected ASCII Grid Height: %u\n", height);
+ return 505;
+ }
+ if (rl2_get_ascii_grid_destination_tiepoint (ascii, &x, &y) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to get ASCII Grid tiepoint\n");
+ return 506;
+ }
+ if (x != 10.0)
+ {
+ fprintf (stderr, "ERROR: unexpected ASCII Grid X tiepoint: %1.2f\n",
+ x);
+ return 507;
+ }
+ if (y != 20.0)
+ {
+ fprintf (stderr, "ERROR: unexpected ASCII Grid Y tiepoint: %1.2f\n",
+ y);
+ return 508;
+ }
+ if (rl2_get_ascii_grid_destination_resolution (ascii, &res) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to get ASCII Grid resolution\n");
+ return 509;
+ }
+ if (res != 1.5)
+ {
+ fprintf (stderr, "ERROR: unexpected ASCII Grid resolution: %1.2f\n",
+ res);
+ return 510;
+ }
+ rl2_destroy_ascii_grid_destination (ascii);
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_gray.c b/test/test_map_gray.c
new file mode 100644
index 0000000..67c81dc
--- /dev/null
+++ b/test/test_map_gray.c
@@ -0,0 +1,1168 @@
+/*
+
+ test_map_gray.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_512 512
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+get_base_resolution (sqlite3 * sqlite, const char *coverage, double *x_res,
+ double *y_res)
+{
+/* attempting to retrieve the Coverage's base resolution */
+ char *sql;
+ sqlite3_stmt *stmt;
+ int ret;
+ int ok = 0;
+
+ sql = sqlite3_mprintf ("SELECT horz_resolution, vert_resolution "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ *x_res = sqlite3_column_double (stmt, 0);
+ *y_res = sqlite3_column_double (stmt, 1);
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+}
+
+static int
+do_export_geotiff (sqlite3 * sqlite, const char *coverage, const char *type,
+ gaiaGeomCollPtr geom, int scale)
+{
+/* exporting a GeoTiff + Worldfile */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_%s_gt_%d.tif", coverage, type, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 1);
+ sqlite3_bind_text (stmt, 9, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_%s_gt_%d.tfw", coverage, type, scale);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_tiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a Tiff (no Worldfile) */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_plain_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteTiff(?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_text (stmt, 8, "LZW", 3, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+static int
+do_export_image (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ double radius, const char *suffix)
+{
+/* exporting a PNG/JPEG/TIFF/PDF image */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ const char *mime_type = "text/plain";
+
+ path = sqlite3_mprintf ("./%s_%1.0f%s", coverage, radius, suffix);
+
+ sql =
+ "SELECT RL2_GetMapImage(?, ST_Buffer(?, ?), 512, 512, 'default', ?, '#ffffff', 0, 80)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 2, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 3, radius);
+ if (strcmp (suffix, ".png") == 0)
+ mime_type = "image/png";
+ if (strcmp (suffix, ".jpg") == 0)
+ mime_type = "image/jpeg";
+ if (strcmp (suffix, ".tif") == 0)
+ mime_type = "image/tiff";
+ if (strcmp (suffix, ".pdf") == 0)
+ mime_type = "application/x-pdf";
+ sqlite3_bind_text (stmt, 4, mime_type, strlen (mime_type),
+ SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ FILE *out;
+ blob = (unsigned char *) sqlite3_column_blob (stmt, 0);
+ blob_size = sqlite3_column_bytes (stmt, 0);
+ out = fopen (path, "wb");
+ if (out != NULL)
+ {
+ /* writing the output image */
+ if ((int) fwrite (blob, 1, blob_size, out) == blob_size)
+ retcode = 1;
+ fclose (out);
+ }
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to GetMap \"%s\"\n", path);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char pixel, unsigned char compression,
+ int tile_sz, int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty;
+ char *sql;
+ int tile_size;
+ gaiaGeomCollPtr geom;
+
+/* setting the coverage name */
+ switch (pixel)
+ {
+ case RL2_PIXEL_GRAYSCALE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_none_256";
+ break;
+ case TILE_512:
+ coverage = "gray_none_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_png_256";
+ break;
+ case TILE_512:
+ coverage = "gray_png_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_png_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_JPEG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_jpeg_256";
+ break;
+ case TILE_512:
+ coverage = "gray_jpeg_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_jpeg_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_webp_256";
+ break;
+ case TILE_512:
+ coverage = "gray_webp_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_webp_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_llwebp_256";
+ break;
+ case TILE_512:
+ coverage = "gray_llwebp_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_llwebp_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt_none_256";
+ break;
+ case TILE_512:
+ coverage = "plt_none_512";
+ break;
+ case TILE_1024:
+ coverage = "plt_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt_png_256";
+ break;
+ case TILE_512:
+ coverage = "plt_png_512";
+ break;
+ case TILE_1024:
+ coverage = "plt_png_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ sample_name = "UINT8";
+ switch (pixel)
+ {
+ case RL2_PIXEL_GRAYSCALE:
+ pixel_name = "GRAYSCALE";
+ break;
+ case RL2_PIXEL_PALETTE:
+ pixel_name = "PALETTE";
+ break;
+ };
+ num_bands = 1;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ compression_name = "NONE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_PNG:
+ compression_name = "PNG";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_JPEG:
+ compression_name = "JPEG";
+ qlty = 80;
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ compression_name = "WEBP";
+ qlty = 80;
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ compression_name = "LL_WEBP";
+ qlty = 100;
+ break;
+ };
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_512:
+ tile_size = 512;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %d, %d)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 26914,
+ 1, 1);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 26914, 0, 1)", coverage,
+ "map_samples/usgs-gray", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+ if (pixel == RL2_PIXEL_GRAYSCALE)
+ {
+/* building the Pyramid Levels */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, NULL, 0, 1)",
+ coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "gray1");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 26914, 0, 1)",
+ coverage, "map_samples/usgs-gray/gray1.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -5;
+ return 0;
+ }
+
+ if (pixel == RL2_PIXEL_GRAYSCALE)
+ {
+/* building the Pyramid Levels */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, %Q, 1, 1)", coverage,
+ "gray2");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -6;
+ return 0;
+ }
+
+/* destroying the Pyramid Levels */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_DePyramidize(%Q, NULL, 1)",
+ coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DePyramidize \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -7;
+ return 0;
+ }
+
+/* building yet again the Pyramid Levels */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, %Q, 1, 1)", coverage,
+ "gray2");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -8;
+ return 0;
+ }
+ }
+
+/* export tests */
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -9;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "norm", geom, 1))
+ {
+ *retcode += -10;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "norm", geom, 2))
+ {
+ *retcode += -11;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "norm", geom, 4))
+ {
+ *retcode += -12;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "norm", geom, 8))
+ {
+ *retcode += -13;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 1))
+ {
+ *retcode += -14;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 2))
+ {
+ *retcode += -15;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 4))
+ {
+ *retcode += -16;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 8))
+ {
+ *retcode += -17;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 256.0, ".jpg"))
+ {
+ *retcode += -18;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 290.0, ".jpg"))
+ {
+ *retcode += -19;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 256.0, ".png"))
+ {
+ *retcode += -20;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 60.0, ".png"))
+ {
+ *retcode += -21;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 256.0, ".tif"))
+ {
+ *retcode += -22;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 60.0, ".tif"))
+ {
+ *retcode += -23;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 256.0, ".pdf"))
+ {
+ *retcode += -24;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 60.0, ".pdf"))
+ {
+ *retcode += -25;
+ return 0;
+ }
+
+
+ if (strcmp (coverage, "gray_jpeg_512") == 0)
+ {
+ /* testing a Monolithic Pyramid */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_PyramidizeMonolithic(%Q, 2, 1)",
+ coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "PyramidizeMonolithic \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -26;
+ return 0;
+ }
+
+ /* export tests */
+ if (geom == NULL)
+ {
+ *retcode += -27;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "mono", geom, 1))
+ {
+ *retcode += -28;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "mono", geom, 2))
+ {
+ *retcode += -29;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "mono", geom, 4))
+ {
+ *retcode += -30;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "mono", geom, 8))
+ {
+ *retcode += -31;
+ return 0;
+ }
+ }
+
+ gaiaFreeGeomColl (geom);
+
+ return 1;
+}
+
+static int
+drop_coverage (sqlite3 * sqlite, unsigned char pixel, unsigned char compression,
+ int tile_sz, int *retcode)
+{
+/* dropping some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ char *sql;
+
+/* setting the coverage name */
+ switch (pixel)
+ {
+ case RL2_PIXEL_GRAYSCALE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_none_256";
+ break;
+ case TILE_512:
+ coverage = "gray_none_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_png_256";
+ break;
+ case TILE_512:
+ coverage = "gray_png_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_png_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_JPEG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_jpeg_256";
+ break;
+ case TILE_512:
+ coverage = "gray_jpeg_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_jpeg_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_webp_256";
+ break;
+ case TILE_512:
+ coverage = "gray_webp_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_webp_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_llwebp_256";
+ break;
+ case TILE_512:
+ coverage = "gray_llwebp_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_llwebp_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt_none_256";
+ break;
+ case TILE_512:
+ coverage = "plt_none_512";
+ break;
+ case TILE_1024:
+ coverage = "plt_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt_png_256";
+ break;
+ case TILE_512:
+ coverage = "plt_png_512";
+ break;
+ case TILE_1024:
+ coverage = "plt_png_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* dropping the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_DropCoverage(%Q, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DropCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* GRAYSCALE tests */
+ ret = -100;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_512, &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_1024, &ret))
+ return ret;
+ ret = -400;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_256,
+ &ret))
+ return ret;
+ ret = -420;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_512,
+ &ret))
+ return ret;
+ ret = -440;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_1024,
+ &ret))
+ return ret;
+ ret = -500;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_256, &ret))
+ return ret;
+ ret = -520;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_512, &ret))
+ return ret;
+ ret = -540;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_1024, &ret))
+ return ret;
+
+/* PALETTE tests */
+ ret = -600;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -620;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -640;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -700;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -720;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -740;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+
+/* dropping all GRAYSCALE Coverages */
+ ret = -170;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -180;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -190;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -270;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -290;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+ ret = -370;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_256, &ret))
+ return ret;
+ ret = -380;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_512, &ret))
+ return ret;
+ ret = -390;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_1024, &ret))
+ return ret;
+ ret = -470;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_256,
+ &ret))
+ return ret;
+ ret = -480;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_512,
+ &ret))
+ return ret;
+ ret = -490;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_1024,
+ &ret))
+ return ret;
+ ret = -570;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_256, &ret))
+ return ret;
+ ret = -580;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_512, &ret))
+ return ret;
+ ret = -590;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_1024, &ret))
+ return ret;
+
+/* dropping all PALETTE Coverages */
+ ret = -670;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -680;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -690;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -770;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -780;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -790;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_indiana.c b/test/test_map_indiana.c
new file mode 100644
index 0000000..ee915eb
--- /dev/null
+++ b/test/test_map_indiana.c
@@ -0,0 +1,924 @@
+/*
+
+ test_map_indiana.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+#include "spatialite/gaiaaux.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_512 512
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+get_max_tile_id (sqlite3 * sqlite, const char *coverage)
+{
+/* retriving the Max tile_id for a given Coverage */
+ char *sql;
+ char *table;
+ char *xtable;
+ sqlite3_stmt *stmt;
+ int ret;
+ int max = 0;
+
+ table = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("SELECT Max(tile_id) FROM \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ max = sqlite3_column_int (stmt, 0);
+ }
+ sqlite3_finalize (stmt);
+ return max;
+}
+
+static int
+do_export_tile_image (sqlite3 * sqlite, const char *coverage, int tile_id)
+{
+/* attempting to export a visible Tile */
+ char *sql;
+ char *path;
+ int ret;
+ int transparent = 1;
+
+ if (tile_id <= 1)
+ transparent = 0;
+
+ if (tile_id < 0)
+ tile_id = get_max_tile_id (sqlite, coverage);
+ path = sqlite3_mprintf ("./%s_tile_%d.png", coverage, tile_id);
+ sql =
+ sqlite3_mprintf
+ ("SELECT BlobToFile(RL2_GetTileImage(%Q, %d, '#e0ffe0', %d), %Q)",
+ coverage, tile_id, transparent, path);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ unlink (path);
+ sqlite3_free (path);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr,
+ "ERROR: Unable to export an Image from \"%s\" tile_id=%d\n",
+ coverage, tile_id);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+get_base_resolution (sqlite3 * sqlite, const char *coverage, double *x_res,
+ double *y_res)
+{
+/* attempting to retrieve the Coverage's base resolution */
+ char *sql;
+ sqlite3_stmt *stmt;
+ int ret;
+ int ok = 0;
+
+ sql = sqlite3_mprintf ("SELECT horz_resolution, vert_resolution "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ *x_res = sqlite3_column_double (stmt, 0);
+ *y_res = sqlite3_column_double (stmt, 1);
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+}
+
+static int
+do_export_geotiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a GeoTiff + Worldfile */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_gt_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 1);
+ sqlite3_bind_text (stmt, 9, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_gt_%d.tfw", coverage, scale);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_tiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a Tiff (no Worldfile) */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_plain_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteTiff(?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_text (stmt, 8, "DEFLATE", 7, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_tiff_tfw (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale)
+{
+/* exporting a Tiff (+ Worldfile) */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_tfw_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteTiffTfw(?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_text (stmt, 8, "DEFLATE", 7, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_tfw_%d.tfw", coverage, scale);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+static int
+do_export_image (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ double radius, const char *suffix)
+{
+/* exporting a PNG/JPEG/TIFF/PDF image */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ const char *mime_type = "text/plain";
+
+ path = sqlite3_mprintf ("./%s_%1.0f%s", coverage, radius, suffix);
+
+ sql =
+ "SELECT RL2_GetMapImage(?, ST_Buffer(?, ?), 512, 512, 'default', ?, '#ffffff', 1, 80)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 2, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 3, radius);
+ if (strcmp (suffix, ".png") == 0)
+ mime_type = "image/png";
+ if (strcmp (suffix, ".jpg") == 0)
+ mime_type = "image/jpeg";
+ if (strcmp (suffix, ".tif") == 0)
+ mime_type = "image/tiff";
+ if (strcmp (suffix, ".pdf") == 0)
+ mime_type = "application/x-pdf";
+ sqlite3_bind_text (stmt, 4, mime_type, strlen (mime_type),
+ SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ FILE *out;
+ blob = (unsigned char *) sqlite3_column_blob (stmt, 0);
+ blob_size = sqlite3_column_bytes (stmt, 0);
+ out = fopen (path, "wb");
+ if (out != NULL)
+ {
+ /* writing the output image */
+ if ((int) fwrite (blob, 1, blob_size, out) == blob_size)
+ retcode = 1;
+ fclose (out);
+ }
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to GetMap \"%s\"\n", path);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char pixel, unsigned char compression,
+ int tile_sz, int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty;
+ char *sql;
+ int tile_size;
+ gaiaGeomCollPtr geom;
+
+/* setting the coverage name */
+ switch (pixel)
+ {
+ case RL2_PIXEL_PALETTE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt_none_256";
+ break;
+ case TILE_512:
+ coverage = "plt_none_512";
+ break;
+ case TILE_1024:
+ coverage = "plt_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt_png_256";
+ break;
+ case TILE_512:
+ coverage = "plt_png_512";
+ break;
+ case TILE_1024:
+ coverage = "plt_png_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ sample_name = "4-BIT";
+ pixel_name = "PALETTE";
+ num_bands = 1;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ compression_name = "NONE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_PNG:
+ compression_name = "PNG";
+ qlty = 100;
+ break;
+ };
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_512:
+ tile_size = 512;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.4f, %1.4f, "
+ "RL2_SetPixelValue(RL2_CreatePixel(%Q, %Q, 1), 0, 0))",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 26716,
+ 2.4384, 2.4384, sample_name, pixel_name);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 26716, 0, 1)", coverage,
+ "map_samples/usgs-indiana", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "indiana1");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 26716, 0, 1)",
+ coverage, "map_samples/usgs-indiana/indiana1.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+/* building the Pyramid Levels */
+ sql = sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, NULL, 0, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -5;
+ return 0;
+ }
+
+/* destroying Pyramid Levels on the second section */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_DePyramidize(%Q, 'indiana2', 1)",
+ coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DePyramidize \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -6;
+ return 0;
+ }
+
+/* building yet again the Pyramid Levels */
+ sql = sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, NULL, 0, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -7;
+ return 0;
+ }
+
+/* export tests */
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -8;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 1))
+ {
+ *retcode += -9;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 1))
+ {
+ *retcode += -19;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 2))
+ {
+ *retcode += -11;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 2))
+ {
+ *retcode += -12;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 4))
+ {
+ *retcode += -13;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 4))
+ {
+ *retcode += -14;
+ return 0;
+ }
+ if (!do_export_tiff_tfw (sqlite, coverage, geom, 4))
+ {
+ *retcode += -15;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 624.3, ".jpg"))
+ {
+ *retcode += -16;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 300.0, ".jpg"))
+ {
+ *retcode += -17;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 624.3, ".png"))
+ {
+ *retcode += -18;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 700.0, ".png"))
+ {
+ *retcode += -19;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 624.3, ".tif"))
+ {
+ *retcode += -20;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 700.0, ".tif"))
+ {
+ *retcode += -21;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 624.3, ".pdf"))
+ {
+ *retcode += -22;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 700.0, ".pdf"))
+ {
+ *retcode += -23;
+ return 0;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* testing GetTileImage() */
+ if (!do_export_tile_image (sqlite, coverage, 1))
+ {
+ *retcode += -24;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, 3))
+ {
+ *retcode += -25;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, -1))
+ {
+ *retcode += -26;
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+drop_coverage (sqlite3 * sqlite, unsigned char pixel, unsigned char compression,
+ int tile_sz, int *retcode)
+{
+/* dropping some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ char *sql;
+
+/* setting the coverage name */
+ switch (pixel)
+ {
+ case RL2_PIXEL_PALETTE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt_none_256";
+ break;
+ case TILE_512:
+ coverage = "plt_none_512";
+ break;
+ case TILE_1024:
+ coverage = "plt_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt_png_256";
+ break;
+ case TILE_512:
+ coverage = "plt_png_512";
+ break;
+ case TILE_1024:
+ coverage = "plt_png_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* dropping the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_DropCoverage(%Q, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DropCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* GRAYSCALE tests */
+ ret = -100;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+
+/* dropping all PALETTE Coverages */
+ ret = -170;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -180;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -190;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -270;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -290;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_infrared.c b/test/test_map_infrared.c
new file mode 100644
index 0000000..3d6171e
--- /dev/null
+++ b/test/test_map_infrared.c
@@ -0,0 +1,1644 @@
+/*
+
+ test_map_infrared.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+#include "spatialite/gaiaaux.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_512 512
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+get_max_tile_id (sqlite3 * sqlite, const char *coverage)
+{
+/* retriving the Max tile_id for a given Coverage */
+ char *sql;
+ char *table;
+ char *xtable;
+ sqlite3_stmt *stmt;
+ int ret;
+ int max = 0;
+
+ table = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("SELECT Max(tile_id) FROM \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ max = sqlite3_column_int (stmt, 0);
+ }
+ sqlite3_finalize (stmt);
+ return max;
+}
+
+static int
+do_export_tile_image (sqlite3 * sqlite, const char *coverage, int tile_id,
+ int band_mix)
+{
+/* attempting to export a visible Tile */
+ char *sql;
+ char *path;
+ int ret;
+ int transparent = 1;
+ unsigned char red_band = 0;
+ unsigned char green_band = 1;
+ unsigned char blue_band = 2;
+
+ if (band_mix == 1)
+ {
+ red_band = 3;
+ green_band = 1;
+ blue_band = 2;
+ }
+ if (band_mix == 2)
+ {
+ red_band = 0;
+ green_band = 1;
+ blue_band = 3;
+ }
+ if (tile_id <= 1)
+ transparent = 0;
+ if (tile_id < 0)
+ tile_id = get_max_tile_id (sqlite, coverage);
+ path = sqlite3_mprintf ("./%s_tile_%d_%d.png", coverage, tile_id, band_mix);
+ sql =
+ sqlite3_mprintf
+ ("SELECT BlobToFile(RL2_GetTripleBandTileImage(%Q, %d, %d, %d, %d, '#e0ffe0', %d), %Q)",
+ coverage, tile_id, red_band, green_band, blue_band, transparent, path);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ unlink (path);
+ sqlite3_free (path);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr,
+ "ERROR: Unable to export an Image from \"%s\" tile_id=%d\n",
+ coverage, tile_id);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+do_export_mono_tile_image (sqlite3 * sqlite, const char *coverage, int tile_id,
+ int band_mix)
+{
+/* attempting to export a visible Tile (Mono-Band) */
+ char *sql;
+ char *path;
+ int ret;
+ int transparent = 1;
+ unsigned char mono_band = 0;
+
+ if (band_mix == 1)
+ mono_band = 2;
+ if (band_mix == 2)
+ mono_band = 3;
+ if (tile_id <= 1)
+ transparent = 0;
+ if (tile_id < 0)
+ tile_id = get_max_tile_id (sqlite, coverage);
+ path =
+ sqlite3_mprintf ("./%s_mono_tile_%d_%d.png", coverage, tile_id,
+ band_mix);
+ sql =
+ sqlite3_mprintf
+ ("SELECT BlobToFile(RL2_GetMonoBandTileImage(%Q, %d, %d, '#e0ffe0', %d), %Q)",
+ coverage, tile_id, mono_band, transparent, path);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ unlink (path);
+ sqlite3_free (path);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr,
+ "ERROR: Unable to export an Image from \"%s\" tile_id=%d\n",
+ coverage, tile_id);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+get_base_resolution (sqlite3 * sqlite, const char *coverage, double *x_res,
+ double *y_res)
+{
+/* attempting to retrieve the Coverage's base resolution */
+ char *sql;
+ sqlite3_stmt *stmt;
+ int ret;
+ int ok = 0;
+
+ sql = sqlite3_mprintf ("SELECT horz_resolution, vert_resolution "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ *x_res = sqlite3_column_double (stmt, 0);
+ *y_res = sqlite3_column_double (stmt, 1);
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+}
+
+static int
+do_export_geotiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a GeoTiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_gt_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 0);
+ sqlite3_bind_text (stmt, 9, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_band_composed_geotiff (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix,
+ int with_worldfile)
+{
+/* exporting a GeoTiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char red_band = 0;
+ unsigned char green_band = 1;
+ unsigned char blue_band = 2;
+
+ if (band_mix == 1)
+ {
+ red_band = 3;
+ green_band = 1;
+ blue_band = 2;
+ }
+ if (band_mix == 2)
+ {
+ red_band = 0;
+ green_band = 1;
+ blue_band = 3;
+ }
+
+ path = sqlite3_mprintf ("./%s_bc_gt_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql =
+ "SELECT RL2_WriteTripleBandGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, red_band);
+ sqlite3_bind_int (stmt, 6, green_band);
+ sqlite3_bind_int (stmt, 7, blue_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 8, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 9, xx_res);
+ sqlite3_bind_double (stmt, 10, yy_res);
+ sqlite3_bind_int (stmt, 11, with_worldfile);
+ sqlite3_bind_text (stmt, 12, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_bc_gt_%d_%d.tfw", coverage, scale, band_mix);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_band_composed_tiff (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix)
+{
+/* exporting a plain Tiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char red_band = 0;
+ unsigned char green_band = 1;
+ unsigned char blue_band = 2;
+
+ if (band_mix == 1)
+ {
+ red_band = 3;
+ green_band = 1;
+ blue_band = 2;
+ }
+ if (band_mix == 2)
+ {
+ red_band = 0;
+ green_band = 1;
+ blue_band = 3;
+ }
+
+ path = sqlite3_mprintf ("./%s_bc_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteTripleBandTiff(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, red_band);
+ sqlite3_bind_int (stmt, 6, green_band);
+ sqlite3_bind_int (stmt, 7, blue_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 8, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 9, xx_res);
+ sqlite3_bind_double (stmt, 10, yy_res);
+ sqlite3_bind_text (stmt, 11, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_band_composed_tiff_tfw (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix)
+{
+/* exporting a Tiff+TFW */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char red_band = 0;
+ unsigned char green_band = 1;
+ unsigned char blue_band = 2;
+
+ if (band_mix == 1)
+ {
+ red_band = 3;
+ green_band = 1;
+ blue_band = 2;
+ }
+ if (band_mix == 2)
+ {
+ red_band = 0;
+ green_band = 1;
+ blue_band = 3;
+ }
+
+ path = sqlite3_mprintf ("./%s_bc_tfw_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteTripleBandTiffTfw(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, red_band);
+ sqlite3_bind_int (stmt, 6, green_band);
+ sqlite3_bind_int (stmt, 7, blue_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 8, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 9, xx_res);
+ sqlite3_bind_double (stmt, 10, yy_res);
+ sqlite3_bind_text (stmt, 11, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_bc_tfw_%d_%d.tfw", coverage, scale, band_mix);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_mono_band_geotiff (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix,
+ int with_worldfile)
+{
+/* exporting a GeoTiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char mono_band = 0;
+
+ if (band_mix == 1)
+ mono_band = 1;
+ if (band_mix == 2)
+ mono_band = 3;
+
+ path =
+ sqlite3_mprintf ("./%s_mono_gt_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteMonoBandGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, mono_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 6, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 7, xx_res);
+ sqlite3_bind_double (stmt, 8, yy_res);
+ sqlite3_bind_int (stmt, 9, with_worldfile);
+ sqlite3_bind_text (stmt, 10, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path =
+ sqlite3_mprintf ("./%s_mono_gt_%d_%d.tfw", coverage, scale, band_mix);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_mono_band_tiff (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix)
+{
+/* exporting a plain Tiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char mono_band = 0;
+
+ if (band_mix == 1)
+ mono_band = 1;
+ if (band_mix == 2)
+ mono_band = 3;
+
+ path = sqlite3_mprintf ("./%s_mono_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteMonoBandTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, mono_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 6, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 7, xx_res);
+ sqlite3_bind_double (stmt, 8, yy_res);
+ sqlite3_bind_text (stmt, 9, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_mono_band_tiff_tfw (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix)
+{
+/* exporting a Tiff+TFW */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char mono_band = 0;
+
+ if (band_mix == 1)
+ mono_band = 1;
+ if (band_mix == 2)
+ mono_band = 3;
+
+ path =
+ sqlite3_mprintf ("./%s_mono_tfw_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteMonoBandTiffTfw(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, mono_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 6, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 7, xx_res);
+ sqlite3_bind_double (stmt, 8, yy_res);
+ sqlite3_bind_text (stmt, 9, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path =
+ sqlite3_mprintf ("./%s_mono_tfw_%d_%d.tfw", coverage, scale, band_mix);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_map_image (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, const char *style,
+ const char *suffix, int monolithic)
+{
+/* exporting a Map Image (full rendered) */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ const char *format = "text/plain";
+
+ if (strcmp (suffix, "png") == 0)
+ format = "image/png";
+ if (strcmp (suffix, "jpg") == 0)
+ format = "image/jpeg";
+ if (strcmp (suffix, "tif") == 0)
+ format = "image/tiff";
+ if (strcmp (suffix, "pdf") == 0)
+ format = "application/x-pdf";
+
+ path =
+ sqlite3_mprintf ("./%s_%s_map_%s.%s", coverage,
+ monolithic ? "mono" : "sect", style, suffix);
+
+ sql =
+ "SELECT BlobToFile(RL2_GetMapImage(?, ST_Buffer(?, 100), ?, ?, ?, ?, ?, ?), ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 2, blob, blob_size, free);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_text (stmt, 5, style, strlen (style), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 6, format, strlen (format), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 7, "#ffe0e0", 7, SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 8, 1);
+ sqlite3_bind_text (stmt, 9, path, strlen (path), SQLITE_STATIC);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char compression, int tile_sz,
+ int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty;
+ int tile_size;
+ char *sql;
+ gaiaGeomCollPtr geom;
+ int test_map_image = 0;
+
+/* setting the coverage name */
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "infrared_none_256";
+ break;
+ case TILE_512:
+ coverage = "infrared_none_512";
+ break;
+ case TILE_1024:
+ coverage = "infrared_none_1024";
+ test_map_image = 1;
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "infrared_zip_256";
+ break;
+ case TILE_512:
+ coverage = "infrared_zip_512";
+ break;
+ case TILE_1024:
+ coverage = "infrared_zip_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "infrared_lzma_256";
+ break;
+ case TILE_512:
+ coverage = "infrared_lzma_512";
+ break;
+ case TILE_1024:
+ coverage = "infrared_lzma_1024";
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ sample_name = "UINT8";
+ pixel_name = "MULTIBAND";
+ num_bands = 4;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ compression_name = "NONE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ compression_name = "DEFLATE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_LZMA:
+ compression_name = "LZMA";
+ qlty = 100;
+ break;
+ };
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_512:
+ tile_size = 512;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.2f, %1.2f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 32632,
+ 0.2, 0.2);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading the first section */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRaster(%Q, %Q, 0, 32632, 0, 1)", coverage,
+ "map_samples/tuscany-infrared/infrared1.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRasters #1 \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* loading the second section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 1, 32632, 0, 1)",
+ coverage,
+ "map_samples/tuscany-infrared/infrared2.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster #2 \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-building the Pyramid Levels */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, %Q, 1, 1)", coverage,
+ "infrared2");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+/* destroying the Pyramid Levels */
+ sql = sqlite3_mprintf ("SELECT RL2_DePyramidize(%Q, NULL, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DePyramidize \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -5;
+ return 0;
+ }
+
+/* building yet again the Pyramid Levels */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, %Q, 1, 1)", coverage,
+ "infrared2");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -6;
+ return 0;
+ }
+
+/* export tests */
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -7;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 1))
+ {
+ *retcode += -8;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 2))
+ {
+ *retcode += -9;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 4))
+ {
+ *retcode += -10;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 8))
+ {
+ *retcode += -11;
+ return 0;
+ }
+
+/* testing TripleBand (Geo)TIFF export */
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 1, 0, 0))
+ {
+ *retcode += -12;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 1, 1, 0))
+ {
+ *retcode += -13;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 1, 2, 1))
+ {
+ *retcode += -14;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 4, 0, 0))
+ {
+ *retcode += -15;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 4, 1, 1))
+ {
+ *retcode += -16;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 4, 2, 0))
+ {
+ *retcode += -17;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 8, 0, 1))
+ {
+ *retcode += -18;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 8, 1, 0))
+ {
+ *retcode += -19;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 8, 2, 0))
+ {
+ *retcode += -20;
+ return 0;
+ }
+
+ if (!do_export_band_composed_tiff (sqlite, coverage, geom, 1, 0))
+ {
+ *retcode += -21;
+ return 0;
+ }
+ if (!do_export_band_composed_tiff (sqlite, coverage, geom, 1, 1))
+ {
+ *retcode += -22;
+ return 0;
+ }
+ if (!do_export_band_composed_tiff (sqlite, coverage, geom, 1, 2))
+ {
+ *retcode += -23;
+ return 0;
+ }
+
+ if (!do_export_band_composed_tiff_tfw (sqlite, coverage, geom, 1, 0))
+ {
+ *retcode += -24;
+ return 0;
+ }
+ if (!do_export_band_composed_tiff_tfw (sqlite, coverage, geom, 1, 1))
+ {
+ *retcode += -25;
+ return 0;
+ }
+ if (!do_export_band_composed_tiff_tfw (sqlite, coverage, geom, 1, 2))
+ {
+ *retcode += -26;
+ return 0;
+ }
+
+/* testing MonoBand (Geo)TIFF export */
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 1, 0, 0))
+ {
+ *retcode += -27;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 1, 1, 0))
+ {
+ *retcode += -28;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 1, 2, 1))
+ {
+ *retcode += -29;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 4, 0, 0))
+ {
+ *retcode += -30;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 4, 1, 1))
+ {
+ *retcode += -31;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 4, 2, 0))
+ {
+ *retcode += -32;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 8, 0, 1))
+ {
+ *retcode += -33;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 8, 1, 0))
+ {
+ *retcode += -34;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 8, 2, 0))
+ {
+ *retcode += -35;
+ return 0;
+ }
+
+ if (!do_export_mono_band_tiff (sqlite, coverage, geom, 1, 0))
+ {
+ *retcode += -36;
+ return 0;
+ }
+ if (!do_export_mono_band_tiff (sqlite, coverage, geom, 1, 1))
+ {
+ *retcode += -37;
+ return 0;
+ }
+ if (!do_export_mono_band_tiff (sqlite, coverage, geom, 1, 2))
+ {
+ *retcode += -38;
+ return 0;
+ }
+
+ if (!do_export_mono_band_tiff_tfw (sqlite, coverage, geom, 1, 0))
+ {
+ *retcode += -39;
+ return 0;
+ }
+ if (!do_export_mono_band_tiff_tfw (sqlite, coverage, geom, 1, 1))
+ {
+ *retcode += -40;
+ return 0;
+ }
+ if (!do_export_mono_band_tiff_tfw (sqlite, coverage, geom, 1, 2))
+ {
+ *retcode += -41;
+ return 0;
+ }
+ if (!test_map_image)
+ goto skip;
+
+/* loading the RasterSymbolizers */
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "ir_false_color1.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #1 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -42;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "ir_false_color1_gamma.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #1 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -43;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "ir_gray.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #2 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -44;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "ir_gray_gamma.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #3 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -45;
+ return 0;
+ }
+
+/* testing GetMapImage - IR false color */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color1", "png", 0))
+ {
+ *retcode += 46;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color1", "jpg", 0))
+ {
+ *retcode += 47;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color1", "tif", 0))
+ {
+ *retcode += 48;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color1", "pdf", 0))
+ {
+ *retcode += 49;
+ return 0;
+ }
+
+/* testing GetMapImage - IR false color - GammaValue */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color1_gamma", "png", 0))
+ {
+ *retcode += 50;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color1_gamma", "jpg", 0))
+ {
+ *retcode += 51;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color1_gamma", "tif", 0))
+ {
+ *retcode += 52;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color1_gamma", "pdf", 0))
+ {
+ *retcode += 53;
+ return 0;
+ }
+
+/* testing GetMapImage - IR gray */
+ if (!do_export_map_image (sqlite, coverage, geom, "ir_gray", "png", 0))
+ {
+ *retcode += 54;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "ir_gray", "jpg", 0))
+ {
+ *retcode += 55;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "ir_gray", "tif", 0))
+ {
+ *retcode += 56;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "ir_gray", "pdf", 0))
+ {
+ *retcode += 57;
+ return 0;
+ }
+
+/* testing GetMapImage - IR gray - GammaValue */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_gray_gamma", "png", 0))
+ {
+ *retcode += 58;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_gray_gamma", "jpg", 0))
+ {
+ *retcode += 59;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_gray_gamma", "tif", 0))
+ {
+ *retcode += 60;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_gray_gamma", "pdf", 0))
+ {
+ *retcode += 61;
+ return 0;
+ }
+ skip:
+ gaiaFreeGeomColl (geom);
+
+/* testing GetTileImage() */
+ if (!do_export_tile_image (sqlite, coverage, 1, 0))
+ {
+ *retcode += -62;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, 1, 1))
+ {
+ *retcode += -63;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, 1, 2))
+ {
+ *retcode += -64;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, -1, 0))
+ {
+ *retcode += -65;
+ return 0;
+ }
+
+/* testing GetTileImage() - Mono-Band */
+ if (!do_export_mono_tile_image (sqlite, coverage, 1, 0))
+ {
+ *retcode += -66;
+ return 0;
+ }
+ if (!do_export_mono_tile_image (sqlite, coverage, 1, 1))
+ {
+ *retcode += -67;
+ return 0;
+ }
+ if (!do_export_mono_tile_image (sqlite, coverage, 1, 2))
+ {
+ *retcode += -68;
+ return 0;
+ }
+ if (!do_export_mono_tile_image (sqlite, coverage, -1, 0))
+ {
+ *retcode += -69;
+ return 0;
+ }
+
+ if (compression == RL2_COMPRESSION_NONE && tile_sz == TILE_1024)
+ {
+ /* testing a Monolithic Pyramid */
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -70;
+ return 0;
+ }
+ sql =
+ sqlite3_mprintf ("SELECT RL2_PyramidizeMonolithic(%Q, 1, 1)",
+ coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "PyramidizeMonolithic \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -71;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color1", "jpg", 1))
+ {
+ *retcode += 71;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color1_gamma", "jpg", 1))
+ {
+ *retcode += 72;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_gray", "jpg", 1))
+ {
+ *retcode += 73;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_gray_gamma", "jpg", 1))
+ {
+ *retcode += 74;
+ return 0;
+ }
+ gaiaFreeGeomColl (geom);
+ }
+
+ return 1;
+}
+
+static int
+drop_coverage (sqlite3 * sqlite, unsigned char compression, int tile_sz,
+ int *retcode)
+{
+/* dropping some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ char *sql;
+
+/* setting the coverage name */
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "infrared_none_256";
+ break;
+ case TILE_512:
+ coverage = "infrared_none_512";
+ break;
+ case TILE_1024:
+ coverage = "infrared_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "infrared_zip_256";
+ break;
+ case TILE_512:
+ coverage = "infrared_zip_512";
+ break;
+ case TILE_1024:
+ coverage = "infrared_zip_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "infrared_lzma_256";
+ break;
+ case TILE_512:
+ coverage = "infrared_lzma_512";
+ break;
+ case TILE_1024:
+ coverage = "infrared_lzma_1024";
+ break;
+ };
+ break;
+ };
+
+/* dropping the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_DropCoverage(%Q, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DropCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateStylingTables()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateStylingTables() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return 4;
+ }
+
+/* tests */
+ ret = -100;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_512, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_512, &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* dropping all Coverages */
+ ret = -170;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -180;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -190;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -270;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_512, &ret))
+ return ret;
+ ret = -290;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -370;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -380;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_512, &ret))
+ return ret;
+ ret = -390;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_mono.c b/test/test_map_mono.c
new file mode 100644
index 0000000..0e09ed0
--- /dev/null
+++ b/test/test_map_mono.c
@@ -0,0 +1,1177 @@
+/*
+
+ test_map_mono.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+#include "spatialite/gaiaaux.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_512 512
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+get_max_tile_id (sqlite3 * sqlite, const char *coverage)
+{
+/* retriving the Max tile_id for a given Coverage */
+ char *sql;
+ char *table;
+ char *xtable;
+ sqlite3_stmt *stmt;
+ int ret;
+ int max = 0;
+
+ table = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("SELECT Max(tile_id) FROM \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ max = sqlite3_column_int (stmt, 0);
+ }
+ sqlite3_finalize (stmt);
+ return max;
+}
+
+static int
+do_export_tile_image (sqlite3 * sqlite, const char *coverage, int tile_id)
+{
+/* attempting to export a visible Tile */
+ char *sql;
+ char *path;
+ int ret;
+ int transparent = 1;
+
+ if (tile_id <= 1)
+ transparent = 0;
+
+ if (tile_id < 0)
+ tile_id = get_max_tile_id (sqlite, coverage);
+ path = sqlite3_mprintf ("./%s_tile_%d.png", coverage, tile_id);
+ sql =
+ sqlite3_mprintf
+ ("SELECT BlobToFile(RL2_GetTileImage(%Q, %d, '#e0ffe0', %d), %Q)",
+ coverage, tile_id, transparent, path);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ unlink (path);
+ sqlite3_free (path);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr,
+ "ERROR: Unable to export an Image from \"%s\" tile_id=%d\n",
+ coverage, tile_id);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+get_base_resolution (sqlite3 * sqlite, const char *coverage, double *x_res,
+ double *y_res)
+{
+/* attempting to retrieve the Coverage's base resolution */
+ char *sql;
+ sqlite3_stmt *stmt;
+ int ret;
+ int ok = 0;
+
+ sql = sqlite3_mprintf ("SELECT horz_resolution, vert_resolution "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ *x_res = sqlite3_column_double (stmt, 0);
+ *y_res = sqlite3_column_double (stmt, 1);
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+}
+
+static int
+do_export_geotiff (sqlite3 * sqlite, const char *coverage, const char *type,
+ gaiaGeomCollPtr geom, int scale, const char *compression)
+{
+/* exporting a GeoTiff + Worldfile */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_%s_gt_%d.tif", coverage, type, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 1);
+ sqlite3_bind_text (stmt, 9, compression, strlen (compression),
+ SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_%s_gt_%d.tfw", coverage, type, scale);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_tiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale, const char *compression)
+{
+/* exporting a Tiff (no Worldfile) */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_plain_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteTiff(?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_text (stmt, 8, compression, strlen (compression),
+ SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_tiff_tfw (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, const char *compression)
+{
+/* exporting a Tiff (+ Worldfile) */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_plain_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteTiffTfw(?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_text (stmt, 8, compression, strlen (compression),
+ SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_plain_%d.tfw", coverage, scale);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+static int
+do_export_image (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ double radius, const char *suffix, int transparent)
+{
+/* exporting a PNG/JPEG/TIFF/PDF image */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ const char *mime_type = "text/plain";
+
+ path = sqlite3_mprintf ("./%s_%1.0f%s", coverage, radius, suffix);
+
+ sql =
+ "SELECT RL2_GetMapImage(?, ST_Buffer(?, ?), 512, 512, 'default', ?, '#ffffff', ?, 80)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 2, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 3, radius);
+ if (strcmp (suffix, ".png") == 0)
+ mime_type = "image/png";
+ if (strcmp (suffix, ".jpg") == 0)
+ mime_type = "image/jpeg";
+ if (strcmp (suffix, ".tif") == 0)
+ mime_type = "image/tiff";
+ if (strcmp (suffix, ".pdf") == 0)
+ mime_type = "application/x-pdf";
+ sqlite3_bind_text (stmt, 4, mime_type, strlen (mime_type),
+ SQLITE_TRANSIENT);
+ sqlite3_bind_int (stmt, 5, transparent);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ FILE *out;
+ blob = (unsigned char *) sqlite3_column_blob (stmt, 0);
+ blob_size = sqlite3_column_bytes (stmt, 0);
+ out = fopen (path, "wb");
+ if (out != NULL)
+ {
+ /* writing the output image */
+ if ((int) fwrite (blob, 1, blob_size, out) == blob_size)
+ retcode = 1;
+ fclose (out);
+ }
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to GetMap \"%s\"\n", path);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char pixel,
+ unsigned char compression, int tile_sz, int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ const char *alt_compression_name = "NONE";
+ int qlty;
+ char *sql;
+ int tile_size;
+ gaiaGeomCollPtr geom;
+
+/* setting the coverage name */
+ switch (pixel)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "mono_none_256";
+ break;
+ case TILE_512:
+ coverage = "mono_none_512";
+ break;
+ case TILE_1024:
+ coverage = "mono_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "mono_png_256";
+ break;
+ case TILE_512:
+ coverage = "mono_png_512";
+ break;
+ case TILE_1024:
+ coverage = "mono_png_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_CCITTFAX4:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "mono_fax4_256";
+ break;
+ case TILE_512:
+ coverage = "mono_fax4_256_512";
+ break;
+ case TILE_1024:
+ coverage = "mono_fax4_256_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt1_none_256";
+ break;
+ case TILE_512:
+ coverage = "plt1_none_512";
+ break;
+ case TILE_1024:
+ coverage = "plt1_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt1_png_256";
+ break;
+ case TILE_512:
+ coverage = "plt1_png_512";
+ break;
+ case TILE_1024:
+ coverage = "plt1_png_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ sample_name = "1-BIT";
+ switch (pixel)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ pixel_name = "MONOCHROME";
+ break;
+ case RL2_PIXEL_PALETTE:
+ pixel_name = "PALETTE";
+ break;
+ };
+ num_bands = 1;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ compression_name = "NONE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_PNG:
+ compression_name = "PNG";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_CCITTFAX4:
+ compression_name = "FAX4";
+ qlty = 100;
+ break;
+ };
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_512:
+ tile_size = 512;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.2f, %1.2f, "
+ "RL2_SetPixelValue(RL2_CreatePixel(%Q, %Q, 1), 0, 0))",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 3003,
+ 0.5, 0.5, sample_name, pixel_name);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 3003, 0, 1)", coverage,
+ "map_samples/ctrt", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "cap1");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 3003, 1, 1)",
+ coverage, "map_samples/ctrt/cap1.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+/* building the Pyramid Levels */
+ sql = sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, NULL, 0, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -5;
+ return 0;
+ }
+
+/* export tests */
+ if (pixel == RL2_PIXEL_MONOCHROME)
+ compression_name = "FAX3";
+ else
+ compression_name = "NONE";
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -6;
+ return 0;
+ }
+ if (!do_export_geotiff
+ (sqlite, coverage, "norm", geom, 1, compression_name))
+ {
+ *retcode += -7;
+ return 0;
+ }
+
+ if (!do_export_geotiff
+ (sqlite, coverage, "norm", geom, 2, alt_compression_name))
+ {
+ *retcode += -8;
+ return 0;
+ }
+ if (!do_export_geotiff
+ (sqlite, coverage, "norm", geom, 4, alt_compression_name))
+ {
+ *retcode += -9;
+ return 0;
+ }
+ if (!do_export_geotiff
+ (sqlite, coverage, "norm", geom, 8, alt_compression_name))
+ {
+ *retcode += -10;
+ return 0;
+ }
+
+ if (!do_export_tiff (sqlite, coverage, geom, 1, compression_name))
+ {
+ *retcode += -11;
+ return 0;
+ }
+
+ if (!do_export_tiff (sqlite, coverage, geom, 2, alt_compression_name))
+ {
+ *retcode += -12;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 4, alt_compression_name))
+ {
+ *retcode += -13;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 8, alt_compression_name))
+ {
+ *retcode += -14;
+ return 0;
+ }
+
+ if (!do_export_tiff_tfw (sqlite, coverage, geom, 2, alt_compression_name))
+ {
+ *retcode += -15;
+ return 0;
+ }
+ if (!do_export_tiff_tfw (sqlite, coverage, geom, 4, alt_compression_name))
+ {
+ *retcode += -16;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 128.0, ".jpg", 1))
+ {
+ *retcode += -17;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 290.0, ".jpg", 0))
+ {
+ *retcode += -18;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 128.0, ".png", 1))
+ {
+ *retcode += -19;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 60.0, ".png", 1))
+ {
+ *retcode += -20;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 66.0, ".png", 0))
+ {
+ *retcode += -21;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 128.0, ".tif", 1))
+ {
+ *retcode += -23;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 290.0, ".tif", 0))
+ {
+ *retcode += -24;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 128.0, ".pdf", 1))
+ {
+ *retcode += -25;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 290.0, ".pdf", 0))
+ {
+ *retcode += -26;
+ return 0;
+ }
+
+ gaiaFreeGeomColl (geom);
+
+/* testing GetTileImage() */
+ if (!do_export_tile_image (sqlite, coverage, 1))
+ {
+ *retcode += -27;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, 27))
+ {
+ *retcode += -28;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, -1))
+ {
+ *retcode += -29;
+ return 0;
+ }
+
+ if (strcmp (coverage, "mono_fax4_256") == 0
+ || strcmp (coverage, "plt1_png_512") == 0)
+ {
+ /* testing a Monolithic Pyramid */
+ geom = get_center_point (sqlite, coverage);
+ sql =
+ sqlite3_mprintf ("SELECT RL2_PyramidizeMonolithic(%Q, 1, 1)",
+ coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "PyramidizeMonolithic \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -30;
+ return 0;
+ }
+
+ /* export tests */
+ if (geom == NULL)
+ {
+ *retcode += -31;
+ return 0;
+ }
+ if (!do_export_geotiff
+ (sqlite, coverage, "mono", geom, 1, compression_name))
+ {
+ *retcode += -32;
+ return 0;
+ }
+ if (!do_export_geotiff
+ (sqlite, coverage, "mono", geom, 2, alt_compression_name))
+ {
+ *retcode += -33;
+ return 0;
+ }
+ if (!do_export_geotiff
+ (sqlite, coverage, "mono", geom, 4, alt_compression_name))
+ {
+ *retcode += -34;
+ return 0;
+ }
+ if (!do_export_geotiff
+ (sqlite, coverage, "mono", geom, 8, alt_compression_name))
+ {
+ *retcode += -35;
+ return 0;
+ }
+ gaiaFreeGeomColl (geom);
+ }
+
+ return 1;
+}
+
+static int
+drop_coverage (sqlite3 * sqlite, unsigned char pixel,
+ unsigned char compression, int tile_sz, int *retcode)
+{
+/* dropping some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ char *sql;
+
+/* setting the coverage name */
+ switch (pixel)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "mono_none_256";
+ break;
+ case TILE_512:
+ coverage = "mono_none_512";
+ break;
+ case TILE_1024:
+ coverage = "mono_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "mono_png_256";
+ break;
+ case TILE_512:
+ coverage = "mono_png_512";
+ break;
+ case TILE_1024:
+ coverage = "mono_png_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_CCITTFAX4:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "mono_fax4_256";
+ break;
+ case TILE_512:
+ coverage = "mono_fax4_256_512";
+ break;
+ case TILE_1024:
+ coverage = "mono_fax4_256_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt1_none_256";
+ break;
+ case TILE_512:
+ coverage = "plt1_none_512";
+ break;
+ case TILE_1024:
+ coverage = "plt1_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "plt1_png_256";
+ break;
+ case TILE_512:
+ coverage = "plt1_png_512";
+ break;
+ case TILE_1024:
+ coverage = "plt1_png_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* dropping the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_DropCoverage(%Q, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DropCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* MONOCHROME tests */
+ ret = -100;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_NONE, TILE_1024,
+ &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_CCITTFAX4, TILE_256,
+ &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_CCITTFAX4, TILE_512,
+ &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_CCITTFAX4, TILE_1024,
+ &ret))
+ return ret;
+
+/* PALETTE tests */
+ ret = -400;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -420;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -440;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -500;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -520;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -540;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+
+/* dropping all MONOCHROME Coverages */
+ ret = -170;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -180;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -190;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_NONE, TILE_1024,
+ &ret))
+ return ret;
+ ret = -270;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -290;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+ ret = -370;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_CCITTFAX4, TILE_256,
+ &ret))
+ return ret;
+ ret = -380;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_CCITTFAX4, TILE_512,
+ &ret))
+ return ret;
+ ret = -390;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_CCITTFAX4, TILE_1024,
+ &ret))
+ return ret;
+
+/* dropping all PALETTE Coverages */
+ ret = -470;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -480;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -490;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -570;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -580;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -590;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_nile_32.c b/test/test_map_nile_32.c
new file mode 100644
index 0000000..064e40f
--- /dev/null
+++ b/test/test_map_nile_32.c
@@ -0,0 +1,417 @@
+/*
+
+ test_map_nile_32.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char sample, int tile_sz,
+ int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty = 100;
+ char *sql;
+ int tile_size;
+
+/* setting the coverage name */
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_FLOAT:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_1024";
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ pixel_name = "DATAGRID";
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ sample_name = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ sample_name = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ sample_name = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample_name = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ sample_name = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample_name = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample_name = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample_name = "DOUBLE";
+ break;
+ };
+ num_bands = 1;
+ compression_name = "NONE";
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.8f, %1.8f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 4326,
+ 0.0008333333333333, 0.0008333333333333);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 4326, 0, 1)", coverage,
+ "map_samples/usgs-nile-32", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "nile1-int32");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 4326, 0, 1)",
+ coverage,
+ "map_samples/usgs-nile-32/nile1-int32.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* SRTM NILE-INT32 (GRID) tests */
+ ret = -100;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_1024, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_256, &ret))
+ return ret;
+ ret = -160;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_1024, &ret))
+ return ret;
+ ret = -180;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_256, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_1024, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_256, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_1024, &ret))
+ return ret;
+ ret = -260;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_1024, &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_256, &ret))
+ return ret;
+ ret = -360;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_1024, &ret))
+ return ret;
+ ret = -380;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_256, &ret))
+ return ret;
+ ret = -400;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_nile_8.c b/test/test_map_nile_8.c
new file mode 100644
index 0000000..9899b8c
--- /dev/null
+++ b/test/test_map_nile_8.c
@@ -0,0 +1,416 @@
+/*
+
+ test_map_nile_8.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char sample, int tile_sz,
+ int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty = 100;
+ char *sql;
+ int tile_size;
+
+/* setting the coverage name */
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_FLOAT:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_1024";
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ pixel_name = "DATAGRID";
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ sample_name = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ sample_name = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ sample_name = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample_name = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ sample_name = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample_name = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample_name = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample_name = "DOUBLE";
+ break;
+ };
+ num_bands = 1;
+ compression_name = "NONE";
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.8f, %1.8f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 4326,
+ 0.0008333333333333, 0.0008333333333333);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 4326, 0, 1)", coverage,
+ "map_samples/usgs-nile-8", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "nile1-int8");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 4326, 0, 1)",
+ coverage, "map_samples/usgs-nile-8/nile1-int8.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* SRTM NILE-INT8 (GRID) tests */
+ ret = -100;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_1024, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_256, &ret))
+ return ret;
+ ret = -160;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_1024, &ret))
+ return ret;
+ ret = -180;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_256, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_1024, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_256, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_1024, &ret))
+ return ret;
+ ret = -260;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_1024, &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_256, &ret))
+ return ret;
+ ret = -360;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_1024, &ret))
+ return ret;
+ ret = -380;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_256, &ret))
+ return ret;
+ ret = -400;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_nile_dbl.c b/test/test_map_nile_dbl.c
new file mode 100644
index 0000000..d200473
--- /dev/null
+++ b/test/test_map_nile_dbl.c
@@ -0,0 +1,416 @@
+/*
+
+ test_map_nile_dbl.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char sample, int tile_sz,
+ int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty = 100;
+ char *sql;
+ int tile_size;
+
+/* setting the coverage name */
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_FLOAT:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_1024";
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ pixel_name = "DATAGRID";
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ sample_name = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ sample_name = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ sample_name = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample_name = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ sample_name = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample_name = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample_name = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample_name = "DOUBLE";
+ break;
+ };
+ num_bands = 1;
+ compression_name = "NONE";
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.8f, %1.8f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 4326,
+ 0.0008333333333333, 0.0008333333333333);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 4326, 0, 1)", coverage,
+ "map_samples/usgs-nile-dbl", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "nile1-dbl");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 4326, 0, 1)",
+ coverage, "map_samples/usgs-nile-dbl/nile1-dbl.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* SRTM NILE-DOUBLE (GRID) tests */
+ ret = -100;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_1024, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_256, &ret))
+ return ret;
+ ret = -160;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_1024, &ret))
+ return ret;
+ ret = -180;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_256, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_1024, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_256, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_1024, &ret))
+ return ret;
+ ret = -260;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_1024, &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_256, &ret))
+ return ret;
+ ret = -360;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_1024, &ret))
+ return ret;
+ ret = -380;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_256, &ret))
+ return ret;
+ ret = -400;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_nile_flt.c b/test/test_map_nile_flt.c
new file mode 100644
index 0000000..8c87787
--- /dev/null
+++ b/test/test_map_nile_flt.c
@@ -0,0 +1,416 @@
+/*
+
+ test_map_nile_flt.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char sample, int tile_sz,
+ int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty = 100;
+ char *sql;
+ int tile_size;
+
+/* setting the coverage name */
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_FLOAT:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_1024";
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ pixel_name = "DATAGRID";
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ sample_name = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ sample_name = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ sample_name = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample_name = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ sample_name = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample_name = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample_name = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample_name = "DOUBLE";
+ break;
+ };
+ num_bands = 1;
+ compression_name = "NONE";
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.8f, %1.8f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 4326,
+ 0.0008333333333333, 0.0008333333333333);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 4326, 0, 1)", coverage,
+ "map_samples/usgs-nile-flt", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "nile1-flt");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 4326, 0, 1)",
+ coverage, "map_samples/usgs-nile-flt/nile1-flt.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* SRTM NILE-FLOAT (GRID) tests */
+ ret = -100;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_1024, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_256, &ret))
+ return ret;
+ ret = -160;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_1024, &ret))
+ return ret;
+ ret = -180;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_256, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_1024, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_256, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_1024, &ret))
+ return ret;
+ ret = -260;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_1024, &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_256, &ret))
+ return ret;
+ ret = -360;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_1024, &ret))
+ return ret;
+ ret = -380;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_256, &ret))
+ return ret;
+ ret = -400;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_nile_u16.c b/test/test_map_nile_u16.c
new file mode 100644
index 0000000..d19520c
--- /dev/null
+++ b/test/test_map_nile_u16.c
@@ -0,0 +1,417 @@
+/*
+
+ test_map_nile_u16.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char sample, int tile_sz,
+ int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty = 100;
+ char *sql;
+ int tile_size;
+
+/* setting the coverage name */
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_FLOAT:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_1024";
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ pixel_name = "DATAGRID";
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ sample_name = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ sample_name = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ sample_name = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample_name = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ sample_name = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample_name = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample_name = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample_name = "DOUBLE";
+ break;
+ };
+ num_bands = 1;
+ compression_name = "NONE";
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.8f, %1.8f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 4326,
+ 0.0008333333333333, 0.0008333333333333);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 4326, 0, 1)", coverage,
+ "map_samples/usgs-nile-u16", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "nile1-uint16");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 4326, 0, 1)",
+ coverage,
+ "map_samples/usgs-nile-u16/nile1-uint16.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* SRTM NILE-UINT16 (GRID) tests */
+ ret = -100;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_1024, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_256, &ret))
+ return ret;
+ ret = -160;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_1024, &ret))
+ return ret;
+ ret = -180;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_256, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_1024, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_256, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_1024, &ret))
+ return ret;
+ ret = -260;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_1024, &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_256, &ret))
+ return ret;
+ ret = -360;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_1024, &ret))
+ return ret;
+ ret = -380;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_256, &ret))
+ return ret;
+ ret = -400;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_nile_u32.c b/test/test_map_nile_u32.c
new file mode 100644
index 0000000..6990e47
--- /dev/null
+++ b/test/test_map_nile_u32.c
@@ -0,0 +1,417 @@
+/*
+
+ test_map_nile_u32.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char sample, int tile_sz,
+ int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty = 100;
+ char *sql;
+ int tile_size;
+
+/* setting the coverage name */
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_FLOAT:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_1024";
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ pixel_name = "DATAGRID";
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ sample_name = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ sample_name = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ sample_name = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample_name = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ sample_name = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample_name = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample_name = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample_name = "DOUBLE";
+ break;
+ };
+ num_bands = 1;
+ compression_name = "NONE";
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.8f, %1.8f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 4326,
+ 0.0008333333333333, 0.0008333333333333);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 4326, 0, 1)", coverage,
+ "map_samples/usgs-nile-u32", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "nile1-uint32");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 4326, 0, 1)",
+ coverage,
+ "map_samples/usgs-nile-u32/nile1-uint32.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* SRTM NILE-UINT32 (GRID) tests */
+ ret = -100;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_1024, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_256, &ret))
+ return ret;
+ ret = -160;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_1024, &ret))
+ return ret;
+ ret = -180;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_256, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_1024, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_256, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_1024, &ret))
+ return ret;
+ ret = -260;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_1024, &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_256, &ret))
+ return ret;
+ ret = -360;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_1024, &ret))
+ return ret;
+ ret = -380;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_256, &ret))
+ return ret;
+ ret = -400;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_nile_u8.c b/test/test_map_nile_u8.c
new file mode 100644
index 0000000..d219a29
--- /dev/null
+++ b/test/test_map_nile_u8.c
@@ -0,0 +1,417 @@
+/*
+
+ test_map_nile_u8.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char sample, int tile_sz,
+ int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty = 100;
+ char *sql;
+ int tile_size;
+
+/* setting the coverage name */
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT16:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT32:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_FLOAT:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_1024";
+ break;
+ };
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_1024";
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ pixel_name = "DATAGRID";
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ sample_name = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ sample_name = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ sample_name = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample_name = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ sample_name = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample_name = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample_name = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample_name = "DOUBLE";
+ break;
+ };
+ num_bands = 1;
+ compression_name = "NONE";
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.8f, %1.8f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 4326,
+ 0.0008333333333333, 0.0008333333333333);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 4326, 0, 1)", coverage,
+ "map_samples/usgs-nile-u8", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "nile1-uint8");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 4326, 0, 1)",
+ coverage,
+ "map_samples/usgs-nile-u8/nile1-uint8.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* SRTM NILE-UINT8 (GRID) tests */
+ ret = -100;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT8, TILE_1024, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_256, &ret))
+ return ret;
+ ret = -160;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT8, TILE_1024, &ret))
+ return ret;
+ ret = -180;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_256, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT16, TILE_1024, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_256, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT16, TILE_1024, &ret))
+ return ret;
+ ret = -260;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!test_coverage (db_handle, RL2_SAMPLE_INT32, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage (db_handle, RL2_SAMPLE_UINT32, TILE_1024, &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_256, &ret))
+ return ret;
+ ret = -360;
+ if (!test_coverage (db_handle, RL2_SAMPLE_FLOAT, TILE_1024, &ret))
+ return ret;
+ ret = -380;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_256, &ret))
+ return ret;
+ ret = -400;
+ if (!test_coverage (db_handle, RL2_SAMPLE_DOUBLE, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_noref.c b/test/test_map_noref.c
new file mode 100644
index 0000000..1e82fd9
--- /dev/null
+++ b/test/test_map_noref.c
@@ -0,0 +1,859 @@
+/*
+
+ test_map_noref.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+get_base_resolution (sqlite3 * sqlite, const char *coverage, double *x_res,
+ double *y_res)
+{
+/* attempting to retrieve the Coverage's base resolution */
+ char *sql;
+ sqlite3_stmt *stmt;
+ int ret;
+ int ok = 0;
+
+ sql = sqlite3_mprintf ("SELECT horz_resolution, vert_resolution "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ *x_res = sqlite3_column_double (stmt, 0);
+ *y_res = sqlite3_column_double (stmt, 1);
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+}
+
+static int
+do_export_tiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a plain Tiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteTiff(?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_text (stmt, 8, "NONE", 7, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+static int
+do_export_image (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ double radius, const char *suffix)
+{
+/* exporting a PNG/JPEG/TIFF/PDF image */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ const char *mime_type = "text/plain";
+
+ path = sqlite3_mprintf ("./%s_%1.0f%s", coverage, radius, suffix);
+
+ sql =
+ "SELECT RL2_GetMapImage(?, ST_Buffer(?, ?), 512, 512, 'default', ?, '#ffffff', 1, 80)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 2, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 3, radius);
+ if (strcmp (suffix, ".png") == 0)
+ mime_type = "image/png";
+ if (strcmp (suffix, ".jpg") == 0)
+ mime_type = "image/jpeg";
+ if (strcmp (suffix, ".tif") == 0)
+ mime_type = "image/tiff";
+ if (strcmp (suffix, ".pdf") == 0)
+ mime_type = "application/x-pdf";
+ sqlite3_bind_text (stmt, 4, mime_type, strlen (mime_type),
+ SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ FILE *out;
+ blob = (unsigned char *) sqlite3_column_blob (stmt, 0);
+ blob_size = sqlite3_column_bytes (stmt, 0);
+ out = fopen (path, "wb");
+ if (out != NULL)
+ {
+ /* writing the output image */
+ if ((int) fwrite (blob, 1, blob_size, out) == blob_size)
+ retcode = 1;
+ fclose (out);
+ }
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to GetMap \"%s\"\n", path);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, const char *prefix, unsigned char pixel,
+ unsigned char compression, int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty;
+ char *sql;
+ int tile_size;
+ gaiaGeomCollPtr geom;
+ char *cov_name;
+ const char *file_path;
+
+/* setting the file path */
+ if (strcmp (prefix, "noref-rgb") == 0)
+ file_path = "./rgb-striped.tif";
+ if (strcmp (prefix, "noref-gray") == 0)
+ file_path = "./gray-striped.tif";
+ if (strcmp (prefix, "noref-mono") == 0)
+ file_path = "./mono3s.tif";
+ if (strcmp (prefix, "noref-plt") == 0)
+ file_path = "plt-striped.tif";
+
+/* setting the coverage name */
+ switch (pixel)
+ {
+ case RL2_PIXEL_RGB:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "rgb_none_256";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "rgb_png_256";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "rgb_jpeg_256";
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ coverage = "rgb_webp_256";
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ coverage = "rgb_llwebp_256";
+ break;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "gray_none_256";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "gray_png_256";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "gray_jpeg_256";
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ coverage = "gray_webp_256";
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ coverage = "gray_llwebp_256";
+ break;
+ };
+ break;
+ case RL2_PIXEL_MONOCHROME:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "mono_none_256";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "mono_png_256";
+ break;
+ case RL2_COMPRESSION_CCITTFAX4:
+ coverage = "mono_fax4_256";
+ break;
+ };
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "plt_none_256";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "plt_png_256";
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ sample_name = "UINT8";
+ switch (pixel)
+ {
+ case RL2_PIXEL_RGB:
+ num_bands = 3;
+ pixel_name = "RGB";
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ num_bands = 1;
+ pixel_name = "GRAYSCALE";
+ break;
+ case RL2_PIXEL_MONOCHROME:
+ num_bands = 1;
+ pixel_name = "MONOCHROME";
+ sample_name = "1-BIT";
+ break;
+ case RL2_PIXEL_PALETTE:
+ num_bands = 1;
+ pixel_name = "PALETTE";
+ break;
+ };
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ compression_name = "NONE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_PNG:
+ compression_name = "PNG";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_JPEG:
+ compression_name = "JPEG";
+ qlty = 80;
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ compression_name = "WEBP";
+ qlty = 80;
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ compression_name = "LL_WEBP";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_CCITTFAX4:
+ compression_name = "FAX4";
+ qlty = 100;
+ break;
+ };
+ tile_size = 256;
+
+/* creating the DBMS Coverage */
+ cov_name = sqlite3_mprintf ("%s_%s", prefix, coverage);
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.16f, %1.16f)",
+ cov_name, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, -1,
+ 1.0, 1.0);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", cov_name,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading the not-referenced image */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, -1, 1, 1)",
+ cov_name, file_path);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", cov_name, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+/* building the Pyramid Levels */
+ sql = sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, NULL, 0, 1)", cov_name);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", cov_name, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -5;
+ return 0;
+ }
+
+/* export tests */
+ geom = get_center_point (sqlite, cov_name);
+ if (geom == NULL)
+ {
+ *retcode += -6;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, cov_name, geom, 1))
+ {
+ *retcode += -7;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, cov_name, geom, 2))
+ {
+ *retcode += -8;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, cov_name, geom, 4))
+ {
+ *retcode += -9;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, cov_name, geom, 8))
+ {
+ *retcode += -10;
+ return 0;
+ }
+ if (!do_export_image (sqlite, cov_name, geom, 256, ".jpg"))
+ {
+ *retcode += -11;
+ return 0;
+ }
+ if (!do_export_image (sqlite, cov_name, geom, 1111, ".jpg"))
+ {
+ *retcode += -12;
+ return 0;
+ }
+ if (!do_export_image (sqlite, cov_name, geom, 256, ".png"))
+ {
+ *retcode += -13;
+ return 0;
+ }
+ if (!do_export_image (sqlite, cov_name, geom, 1111, ".png"))
+ {
+ *retcode += -14;
+ return 0;
+ }
+ if (!do_export_image (sqlite, cov_name, geom, 256, ".tif"))
+ {
+ *retcode += -15;
+ return 0;
+ }
+ if (!do_export_image (sqlite, cov_name, geom, 1111, ".tif"))
+ {
+ *retcode += -16;
+ return 0;
+ }
+ if (!do_export_image (sqlite, cov_name, geom, 256, ".pdf"))
+ {
+ *retcode += -17;
+ return 0;
+ }
+ if (!do_export_image (sqlite, cov_name, geom, 1111, ".pdf"))
+ {
+ *retcode += -18;
+ return 0;
+ }
+ gaiaFreeGeomColl (geom);
+ sqlite3_free (cov_name);
+
+ return 1;
+}
+
+static int
+drop_coverage (sqlite3 * sqlite, const char *prefix, unsigned char pixel,
+ unsigned char compression, int *retcode)
+{
+/* dropping some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ char *cov_name;
+ char *sql;
+
+/* setting the coverage name */
+ switch (pixel)
+ {
+ case RL2_PIXEL_RGB:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "rgb_none_256";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "rgb_png_256";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "rgb_jpeg_256";
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ coverage = "rgb_webp_256";
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ coverage = "rgb_llwebp_256";
+ break;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "gray_none_256";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "gray_png_256";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "gray_jpeg_256";
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ coverage = "gray_webp_256";
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ coverage = "gray_llwebp_256";
+ break;
+ };
+ break;
+ case RL2_PIXEL_MONOCHROME:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "mono_none_256";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "mono_png_256";
+ break;
+ case RL2_COMPRESSION_CCITTFAX4:
+ coverage = "mono_fax4_256";
+ break;
+ };
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "plt_none_256";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "plt_png_256";
+ break;
+ };
+ break;
+ };
+
+/* dropping the DBMS Coverage */
+ cov_name = sqlite3_mprintf ("%s_%s", prefix, coverage);
+ sql = sqlite3_mprintf ("SELECT RL2_DropCoverage(%Q, 1)", cov_name);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DropCoverage \"%s\" error: %s\n", cov_name,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ sqlite3_free (cov_name);
+ return 0;
+ }
+ sqlite3_free (cov_name);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* RGB tests */
+ ret = -100;
+ if (!test_coverage
+ (db_handle, "noref-rgb", RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage
+ (db_handle, "noref-rgb", RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage
+ (db_handle, "noref-rgb", RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, &ret))
+ return ret;
+ ret = -160;
+ if (!test_coverage
+ (db_handle, "noref-rgb", RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSY_WEBP,
+ &ret))
+ return ret;
+ ret = -170;
+ if (!test_coverage
+ (db_handle, "noref-rgb", RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSLESS_WEBP,
+ &ret))
+ return ret;
+
+/* GRAYSCALE tests */
+ ret = -300;
+ if (!test_coverage
+ (db_handle, "noref-gray", RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE,
+ &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage
+ (db_handle, "noref-gray", RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG,
+ &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage
+ (db_handle, "noref-gray", RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG,
+ &ret))
+ return ret;
+ ret = -360;
+ if (!test_coverage
+ (db_handle, "noref-gray", RL2_PIXEL_GRAYSCALE,
+ RL2_COMPRESSION_LOSSY_WEBP, &ret))
+ return ret;
+ ret = -380;
+ if (!test_coverage
+ (db_handle, "noref-gray", RL2_PIXEL_GRAYSCALE,
+ RL2_COMPRESSION_LOSSLESS_WEBP, &ret))
+ return ret;
+
+/* MONOCHROME tests */
+ ret = -500;
+ if (!test_coverage
+ (db_handle, "noref-mono", RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_NONE,
+ &ret))
+ return ret;
+ ret = -520;
+ if (!test_coverage
+ (db_handle, "noref-mono", RL2_PIXEL_MONOCHROME,
+ RL2_COMPRESSION_CCITTFAX4, &ret))
+ return ret;
+ ret = -540;
+ if (!test_coverage
+ (db_handle, "noref-mono", RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_PNG,
+ &ret))
+ return ret;
+
+/* PALETTE tests */
+ ret = -700;
+ if (!test_coverage
+ (db_handle, "noref-plt", RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, &ret))
+ return ret;
+ ret = -720;
+ if (!test_coverage
+ (db_handle, "noref-plt", RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, &ret))
+ return ret;
+
+/* dropping all RGB Coverages */
+ ret = -200;
+ if (!drop_coverage
+ (db_handle, "noref-rgb", RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, &ret))
+ return ret;
+ ret = -210;
+ if (!drop_coverage
+ (db_handle, "noref-rgb", RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, &ret))
+ return ret;
+ ret = -220;
+ if (!drop_coverage
+ (db_handle, "noref-rgb", RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, &ret))
+ return ret;
+ ret = -230;
+ if (!drop_coverage
+ (db_handle, "noref-rgb", RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSY_WEBP,
+ &ret))
+ return ret;
+ ret = -240;
+ if (!drop_coverage
+ (db_handle, "noref-rgb", RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSLESS_WEBP,
+ &ret))
+ return ret;
+
+/* dropping all GRAYSCALE Coverages */
+ ret = -400;
+ if (!drop_coverage
+ (db_handle, "noref-gray", RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE,
+ &ret))
+ return ret;
+ ret = -410;
+ if (!drop_coverage
+ (db_handle, "noref-gray", RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG,
+ &ret))
+ return ret;
+ ret = -420;
+ if (!drop_coverage
+ (db_handle, "noref-gray", RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG,
+ &ret))
+ return ret;
+ ret = -430;
+ if (!drop_coverage
+ (db_handle, "noref-gray", RL2_PIXEL_GRAYSCALE,
+ RL2_COMPRESSION_LOSSY_WEBP, &ret))
+ return ret;
+ ret = -440;
+ if (!drop_coverage
+ (db_handle, "noref-gray", RL2_PIXEL_GRAYSCALE,
+ RL2_COMPRESSION_LOSSLESS_WEBP, &ret))
+ return ret;
+
+/* dropping all MONOCHROME Coverages */
+ ret = -600;
+ if (!drop_coverage
+ (db_handle, "noref-mono", RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_NONE,
+ &ret))
+ return ret;
+ ret = -610;
+ if (!drop_coverage
+ (db_handle, "noref-mono", RL2_PIXEL_MONOCHROME,
+ RL2_COMPRESSION_CCITTFAX4, &ret))
+ return ret;
+ ret = -620;
+ if (!drop_coverage
+ (db_handle, "noref-mono", RL2_PIXEL_MONOCHROME, RL2_COMPRESSION_PNG,
+ &ret))
+ return ret;
+
+/* dropping all PALETTE Coverages */
+ ret = -800;
+ if (!drop_coverage
+ (db_handle, "noref-plt", RL2_PIXEL_PALETTE, RL2_COMPRESSION_NONE, &ret))
+ return ret;
+ ret = -810;
+ if (!drop_coverage
+ (db_handle, "noref-plt", RL2_PIXEL_PALETTE, RL2_COMPRESSION_PNG, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_orbetello.c b/test/test_map_orbetello.c
new file mode 100644
index 0000000..e01f0fc
--- /dev/null
+++ b/test/test_map_orbetello.c
@@ -0,0 +1,1989 @@
+/*
+
+ test_map_orbetello.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+#include "spatialite/gaiaaux.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_512 512
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+execute_check_blob (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning a BLOB */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+get_max_tile_id (sqlite3 * sqlite, const char *coverage)
+{
+/* retriving the Max tile_id for a given Coverage */
+ char *sql;
+ char *table;
+ char *xtable;
+ sqlite3_stmt *stmt;
+ int ret;
+ int max = 0;
+
+ table = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("SELECT Max(tile_id) FROM \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ max = sqlite3_column_int (stmt, 0);
+ }
+ sqlite3_finalize (stmt);
+ return max;
+}
+
+static int
+do_export_tile_image (sqlite3 * sqlite, const char *coverage, int tile_id,
+ int band_mix)
+{
+/* attempting to export a visible Tile */
+ char *sql;
+ char *path;
+ int ret;
+ int transparent = 1;
+ unsigned char red_band = 2;
+ unsigned char green_band = 1;
+ unsigned char blue_band = 0;
+
+ if (band_mix == 1)
+ {
+ red_band = 3;
+ green_band = 1;
+ blue_band = 0;
+ }
+ if (band_mix == 2)
+ {
+ red_band = 2;
+ green_band = 1;
+ blue_band = 3;
+ }
+ if (tile_id <= 1)
+ transparent = 0;
+ if (tile_id < 0)
+ tile_id = get_max_tile_id (sqlite, coverage);
+ path = sqlite3_mprintf ("./%s_tile_%d_%d.png", coverage, tile_id, band_mix);
+ sql =
+ sqlite3_mprintf
+ ("SELECT BlobToFile(RL2_GetTripleBandTileImage(%Q, %d, %d, %d, %d, '#e0ffe0', %d), %Q)",
+ coverage, tile_id, red_band, green_band, blue_band, transparent, path);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ unlink (path);
+ sqlite3_free (path);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr,
+ "ERROR: Unable to export an Image from \"%s\" tile_id=%d\n",
+ coverage, tile_id);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+do_export_mono_tile_image (sqlite3 * sqlite, const char *coverage, int tile_id,
+ int band_mix)
+{
+/* attempting to export a visible Tile (Mono-Band) */
+ char *sql;
+ char *path;
+ int ret;
+ int transparent = 1;
+ unsigned char mono_band = 0;
+
+ if (band_mix == 1)
+ mono_band = 2;
+ if (band_mix == 2)
+ mono_band = 3;
+ if (tile_id <= 1)
+ transparent = 0;
+ if (tile_id < 0)
+ tile_id = get_max_tile_id (sqlite, coverage);
+ path =
+ sqlite3_mprintf ("./%s_mono_tile_%d_%d.png", coverage, tile_id,
+ band_mix);
+ sql =
+ sqlite3_mprintf
+ ("SELECT BlobToFile(RL2_GetMonoBandTileImage(%Q, %d, %d, '#e0ffe0', %d), %Q)",
+ coverage, tile_id, mono_band, transparent, path);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ unlink (path);
+ sqlite3_free (path);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr,
+ "ERROR: Unable to export an Image from \"%s\" tile_id=%d\n",
+ coverage, tile_id);
+ return 0;
+ }
+/* testing GetBandHistogramFromImage() */
+ if (tile_id == 1)
+ {
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_GetBandHistogramFromImage(RL2_GetMonoBandTileImage(%Q, %d, %d, '#e0ffe0', %d), 'image/png', 0)",
+ coverage, tile_id, mono_band, transparent);
+ ret = execute_check_blob (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr,
+ "ERROR: Unable to test RL2_GetBandHistogramFromImage()\n");
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int
+get_base_resolution (sqlite3 * sqlite, const char *coverage, double *x_res,
+ double *y_res)
+{
+/* attempting to retrieve the Coverage's base resolution */
+ char *sql;
+ sqlite3_stmt *stmt;
+ int ret;
+ int ok = 0;
+
+ sql = sqlite3_mprintf ("SELECT horz_resolution, vert_resolution "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ *x_res = sqlite3_column_double (stmt, 0);
+ *y_res = sqlite3_column_double (stmt, 1);
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+}
+
+static int
+do_export_geotiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a GeoTiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_gt_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 0);
+ sqlite3_bind_text (stmt, 9, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_band_composed_geotiff (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix,
+ int with_worldfile)
+{
+/* exporting a GeoTiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char red_band = 2;
+ unsigned char green_band = 1;
+ unsigned char blue_band = 0;
+
+ if (band_mix == 1)
+ {
+ red_band = 3;
+ green_band = 1;
+ blue_band = 0;
+ }
+ if (band_mix == 2)
+ {
+ red_band = 2;
+ green_band = 1;
+ blue_band = 3;
+ }
+
+ path = sqlite3_mprintf ("./%s_bc_gt_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql =
+ "SELECT RL2_WriteTripleBandGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, red_band);
+ sqlite3_bind_int (stmt, 6, green_band);
+ sqlite3_bind_int (stmt, 7, blue_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 8, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 9, xx_res);
+ sqlite3_bind_double (stmt, 10, yy_res);
+ sqlite3_bind_int (stmt, 11, with_worldfile);
+ sqlite3_bind_text (stmt, 12, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_bc_gt_%d_%d.tfw", coverage, scale, band_mix);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_band_composed_tiff (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix)
+{
+/* exporting a plain Tiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char red_band = 2;
+ unsigned char green_band = 1;
+ unsigned char blue_band = 0;
+
+ if (band_mix == 1)
+ {
+ red_band = 3;
+ green_band = 1;
+ blue_band = 0;
+ }
+ if (band_mix == 2)
+ {
+ red_band = 2;
+ green_band = 1;
+ blue_band = 3;
+ }
+
+ path = sqlite3_mprintf ("./%s_bc_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+ sql = "SELECT RL2_WriteTripleBandTiff(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, red_band);
+ sqlite3_bind_int (stmt, 6, green_band);
+ sqlite3_bind_int (stmt, 7, blue_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 8, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 9, xx_res);
+ sqlite3_bind_double (stmt, 10, yy_res);
+ sqlite3_bind_text (stmt, 11, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_band_composed_tiff_tfw (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix)
+{
+/* exporting a Tiff+TFW */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char red_band = 2;
+ unsigned char green_band = 1;
+ unsigned char blue_band = 0;
+
+ if (band_mix == 1)
+ {
+ red_band = 3;
+ green_band = 1;
+ blue_band = 0;
+ }
+ if (band_mix == 2)
+ {
+ red_band = 2;
+ green_band = 1;
+ blue_band = 3;
+ }
+
+ path = sqlite3_mprintf ("./%s_bc_tfw_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteTripleBandTiffTfw(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, red_band);
+ sqlite3_bind_int (stmt, 6, green_band);
+ sqlite3_bind_int (stmt, 7, blue_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 8, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 9, xx_res);
+ sqlite3_bind_double (stmt, 10, yy_res);
+ sqlite3_bind_text (stmt, 11, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_bc_tfw_%d_%d.tfw", coverage, scale, band_mix);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_mono_band_geotiff (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix,
+ int with_worldfile)
+{
+/* exporting a GeoTiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char mono_band = 0;
+
+ if (band_mix == 1)
+ mono_band = 1;
+ if (band_mix == 2)
+ mono_band = 3;
+
+ path =
+ sqlite3_mprintf ("./%s_mono_gt_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteMonoBandGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, mono_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 6, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 7, xx_res);
+ sqlite3_bind_double (stmt, 8, yy_res);
+ sqlite3_bind_int (stmt, 9, with_worldfile);
+ sqlite3_bind_text (stmt, 10, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path =
+ sqlite3_mprintf ("./%s_mono_gt_%d_%d.tfw", coverage, scale, band_mix);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_mono_band_tiff (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix)
+{
+/* exporting a plain Tiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char mono_band = 0;
+
+ if (band_mix == 1)
+ mono_band = 1;
+ if (band_mix == 2)
+ mono_band = 3;
+
+ path = sqlite3_mprintf ("./%s_mono_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteMonoBandTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, mono_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 6, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 7, xx_res);
+ sqlite3_bind_double (stmt, 8, yy_res);
+ sqlite3_bind_text (stmt, 9, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_mono_band_tiff_tfw (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale, int band_mix)
+{
+/* exporting a Tiff+TFW */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ unsigned char mono_band = 0;
+
+ if (band_mix == 1)
+ mono_band = 1;
+ if (band_mix == 2)
+ mono_band = 3;
+
+ path =
+ sqlite3_mprintf ("./%s_mono_tfw_%d_%d.tif", coverage, scale, band_mix);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteMonoBandTiffTfw(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_int (stmt, 5, mono_band);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 6, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 7, xx_res);
+ sqlite3_bind_double (stmt, 8, yy_res);
+ sqlite3_bind_text (stmt, 9, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path =
+ sqlite3_mprintf ("./%s_mono_tfw_%d_%d.tfw", coverage, scale, band_mix);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_map_image (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, const char *style,
+ const char *suffix, int monolithic)
+{
+/* exporting a Map Image (full rendered) */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ const char *format = "text/plain";
+
+ if (strcmp (suffix, "png") == 0)
+ format = "image/png";
+ if (strcmp (suffix, "jpg") == 0)
+ format = "image/jpeg";
+ if (strcmp (suffix, "tif") == 0)
+ format = "image/tiff";
+ if (strcmp (suffix, "pdf") == 0)
+ format = "application/x-pdf";
+
+ path =
+ sqlite3_mprintf ("./%s_%s_map_%s.%s", coverage,
+ monolithic ? "mono" : "sect", style, suffix);
+
+ sql =
+ "SELECT BlobToFile(RL2_GetMapImage(?, ST_Buffer(?, 2000), ?, ?, ?, ?, ?, ?), ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 2, blob, blob_size, free);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_text (stmt, 5, style, strlen (style), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 6, format, strlen (format), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 7, "#ffe0e0", 7, SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 8, 1);
+ sqlite3_bind_text (stmt, 9, path, strlen (path), SQLITE_STATIC);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char compression, int tile_sz,
+ int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty;
+ int tile_size;
+ char *sql;
+ gaiaGeomCollPtr geom;
+ int test_map_image = 0;
+
+/* setting the coverage name */
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "orbetello_none_256";
+ test_map_image = 1;
+ break;
+ case TILE_512:
+ coverage = "orbetello_none_512";
+ break;
+ case TILE_1024:
+ coverage = "orbetello_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "orbetello_zip_256";
+ break;
+ case TILE_512:
+ coverage = "orbetello_zip_512";
+ break;
+ case TILE_1024:
+ coverage = "orbetello_zip_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "orbetello_lzma_256";
+ break;
+ case TILE_512:
+ coverage = "orbetello_lzma_512";
+ break;
+ case TILE_1024:
+ coverage = "orbetello_lzma_1024";
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ sample_name = "UINT16";
+ pixel_name = "MULTIBAND";
+ num_bands = 4;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ compression_name = "NONE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ compression_name = "DEFLATE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_LZMA:
+ compression_name = "LZMA";
+ qlty = 100;
+ break;
+ };
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_512:
+ tile_size = 512;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.2f, %1.2f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 32632,
+ 4.06, 4.06);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading the first section */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRaster(%Q, %Q, 1, 32632, 0, 1)", coverage,
+ "map_samples/orbview3-orbetello/orbetello2.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRasters #1 \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* loading the second section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 32632, 0, 1)",
+ coverage,
+ "map_samples/orbview3-orbetello/orbetello1.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster #2 \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-building the Pyramid Levels */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, %Q, 1, 1)", coverage,
+ "orbetello1");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+/* destroying the Pyramid Levels */
+ sql = sqlite3_mprintf ("SELECT RL2_DePyramidize(%Q, NULL, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DePyramidize \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -5;
+ return 0;
+ }
+
+/* building yet again the Pyramid Levels */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, %Q, 1, 1)", coverage,
+ "orbetello1");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -6;
+ return 0;
+ }
+
+/* export tests */
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -7;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 1))
+ {
+ *retcode += -8;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 2))
+ {
+ *retcode += -9;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 4))
+ {
+ *retcode += -10;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 8))
+ {
+ *retcode += -11;
+ return 0;
+ }
+
+/* testing BandComposed (Geo)TIFF export */
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 1, 0, 0))
+ {
+ *retcode += -12;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 1, 1, 0))
+ {
+ *retcode += -13;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 1, 2, 1))
+ {
+ *retcode += -14;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 4, 0, 0))
+ {
+ *retcode += -15;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 4, 1, 1))
+ {
+ *retcode += -16;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 4, 2, 0))
+ {
+ *retcode += -17;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 8, 0, 1))
+ {
+ *retcode += -18;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 8, 1, 0))
+ {
+ *retcode += -19;
+ return 0;
+ }
+ if (!do_export_band_composed_geotiff (sqlite, coverage, geom, 8, 2, 0))
+ {
+ *retcode += -20;
+ return 0;
+ }
+
+ if (!do_export_band_composed_tiff (sqlite, coverage, geom, 1, 0))
+ {
+ *retcode += -21;
+ return 0;
+ }
+ if (!do_export_band_composed_tiff (sqlite, coverage, geom, 1, 1))
+ {
+ *retcode += -22;
+ return 0;
+ }
+ if (!do_export_band_composed_tiff (sqlite, coverage, geom, 1, 2))
+ {
+ *retcode += -23;
+ return 0;
+ }
+
+ if (!do_export_band_composed_tiff_tfw (sqlite, coverage, geom, 1, 0))
+ {
+ *retcode += -24;
+ return 0;
+ }
+ if (!do_export_band_composed_tiff_tfw (sqlite, coverage, geom, 1, 1))
+ {
+ *retcode += -25;
+ return 0;
+ }
+ if (!do_export_band_composed_tiff_tfw (sqlite, coverage, geom, 1, 2))
+ {
+ *retcode += -26;
+ return 0;
+ }
+
+/* testing MonoBand (Geo)TIFF export */
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 1, 0, 0))
+ {
+ *retcode += -27;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 1, 1, 0))
+ {
+ *retcode += -28;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 1, 2, 1))
+ {
+ *retcode += -29;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 4, 0, 0))
+ {
+ *retcode += -30;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 4, 1, 1))
+ {
+ *retcode += -31;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 4, 2, 0))
+ {
+ *retcode += -32;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 8, 0, 1))
+ {
+ *retcode += -33;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 8, 1, 0))
+ {
+ *retcode += -34;
+ return 0;
+ }
+ if (!do_export_mono_band_geotiff (sqlite, coverage, geom, 8, 2, 0))
+ {
+ *retcode += -35;
+ return 0;
+ }
+
+ if (!do_export_mono_band_tiff (sqlite, coverage, geom, 1, 0))
+ {
+ *retcode += -36;
+ return 0;
+ }
+ if (!do_export_mono_band_tiff (sqlite, coverage, geom, 1, 1))
+ {
+ *retcode += -37;
+ return 0;
+ }
+ if (!do_export_mono_band_tiff (sqlite, coverage, geom, 1, 2))
+ {
+ *retcode += -38;
+ return 0;
+ }
+
+ if (!do_export_mono_band_tiff_tfw (sqlite, coverage, geom, 1, 0))
+ {
+ *retcode += -39;
+ return 0;
+ }
+ if (!do_export_mono_band_tiff_tfw (sqlite, coverage, geom, 1, 1))
+ {
+ *retcode += -40;
+ return 0;
+ }
+ if (!do_export_mono_band_tiff_tfw (sqlite, coverage, geom, 1, 2))
+ {
+ *retcode += -41;
+ return 0;
+ }
+ if (!test_map_image)
+ goto skip;
+
+/* loading the RasterSymbolizers */
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "ir_false_color2.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #1 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -42;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "ir_false_color2_gamma.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #1 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -43;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "ir_gray.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #2 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -44;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "ir_gray_gamma.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #3 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -45;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "rgb_histogram.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #4 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -46;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "rgb_normalize.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #5 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -47;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "rgb_normalize2.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #6 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -48;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "rgb_histogram2.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #7 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -50;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "rgb_gamma.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #8 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -51;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "gray_normalize2.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #9 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -52;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "gray_histogram2.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #10 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -53;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "gray_gamma2.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #11 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -54;
+ return 0;
+ }
+
+/* testing GetMapImage - IR false color */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color2", "png", 0))
+ {
+ *retcode += 55;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color2", "jpg", 0))
+ {
+ *retcode += 56;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color2", "tif", 0))
+ {
+ *retcode += 57;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color2", "pdf", 0))
+ {
+ *retcode += 58;
+ return 0;
+ }
+
+/* testing GetMapImage - IR false color - GammaValue */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color2_gamma", "png", 0))
+ {
+ *retcode += 59;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color2_gamma", "jpg", 0))
+ {
+ *retcode += 60;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color2_gamma", "tif", 0))
+ {
+ *retcode += 61;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_false_color2_gamma", "pdf", 0))
+ {
+ *retcode += 62;
+ return 0;
+ }
+
+/* testing GetMapImage - IR gray */
+ if (!do_export_map_image (sqlite, coverage, geom, "ir_gray", "png", 0))
+ {
+ *retcode += 63;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "ir_gray", "jpg", 0))
+ {
+ *retcode += 64;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "ir_gray", "tif", 0))
+ {
+ *retcode += 65;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "ir_gray", "pdf", 0))
+ {
+ *retcode += 66;
+ return 0;
+ }
+
+/* testing GetMapImage - IR gray - GammaValue */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_gray_gamma", "png", 0))
+ {
+ *retcode += 67;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_gray_gamma", "jpg", 0))
+ {
+ *retcode += 68;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_gray_gamma", "tif", 0))
+ {
+ *retcode += 69;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "ir_gray_gamma", "pdf", 0))
+ {
+ *retcode += 70;
+ return 0;
+ }
+
+/* testing GetMapImage - RGB Normalize */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_normalize", "png", 0))
+ {
+ *retcode += 71;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_normalize", "jpg", 0))
+ {
+ *retcode += 72;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_normalize", "tif", 0))
+ {
+ *retcode += 73;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_normalize", "pdf", 0))
+ {
+ *retcode += 74;
+ return 0;
+ }
+
+/* testing GetMapImage - RGB Histogram */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_histogram", "png", 0))
+ {
+ *retcode += 75;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_histogram", "jpg", 0))
+ {
+ *retcode += 76;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_histogram", "tif", 0))
+ {
+ *retcode += 77;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_histogram", "pdf", 0))
+ {
+ *retcode += 78;
+ return 0;
+ }
+
+/* testing GetMapImage - RGB Normalize */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_normalize2", "png", 0))
+ {
+ *retcode += 79;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_normalize2", "jpg", 0))
+ {
+ *retcode += 80;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_normalize2", "tif", 0))
+ {
+ *retcode += 81;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_normalize2", "pdf", 0))
+ {
+ *retcode += 82;
+ return 0;
+ }
+
+/* testing GetMapImage - RGB Histogram */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_histogram2", "png", 0))
+ {
+ *retcode += 83;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_histogram2", "jpg", 0))
+ {
+ *retcode += 84;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_histogram2", "tif", 0))
+ {
+ *retcode += 85;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_histogram2", "pdf", 0))
+ {
+ *retcode += 86;
+ return 0;
+ }
+
+/* testing GetMapImage - RGB GammaValue */
+ if (!do_export_map_image (sqlite, coverage, geom, "rgb_gamma", "png", 0))
+ {
+ *retcode += 87;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "rgb_gamma", "jpg", 0))
+ {
+ *retcode += 88;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "rgb_gamma", "tif", 0))
+ {
+ *retcode += 89;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "rgb_gamma", "pdf", 0))
+ {
+ *retcode += 90;
+ return 0;
+ }
+
+/* testing GetMapImage - Gray Normalize */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "gray_normalize2", "png", 0))
+ {
+ *retcode += 91;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "gray_normalize2", "jpg", 0))
+ {
+ *retcode += 92;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "gray_normalize2", "tif", 0))
+ {
+ *retcode += 93;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "gray_normalize2", "pdf", 0))
+ {
+ *retcode += 94;
+ return 0;
+ }
+
+/* testing GetMapImage - GRAY Histogram */
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "gray_histogram2", "png", 0))
+ {
+ *retcode += 95;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "gray_histogram2", "jpg", 0))
+ {
+ *retcode += 96;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "gray_histogram2", "tif", 0))
+ {
+ *retcode += 97;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "gray_histogram2", "pdf", 0))
+ {
+ *retcode += 98;
+ return 0;
+ }
+
+/* testing GetMapImage - GRAY GammaValue */
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_gamma2", "png", 0))
+ {
+ *retcode += 99;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_gamma2", "jpg", 0))
+ {
+ *retcode += 100;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_gamma2", "tif", 0))
+ {
+ *retcode += 101;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_gamma2", "pdf", 0))
+ {
+ *retcode += 102;
+ return 0;
+ }
+ skip:
+ gaiaFreeGeomColl (geom);
+
+/* testing GetTileImage() */
+ if (!do_export_tile_image (sqlite, coverage, 1, 0))
+ {
+ *retcode += -62;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, 1, 1))
+ {
+ *retcode += -63;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, 1, 2))
+ {
+ *retcode += -64;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, -1, 0))
+ {
+ *retcode += -65;
+ return 0;
+ }
+
+/* testing GetTileImage() - Mono-Band */
+ if (!do_export_mono_tile_image (sqlite, coverage, 1, 0))
+ {
+ *retcode += -66;
+ return 0;
+ }
+ if (!do_export_mono_tile_image (sqlite, coverage, 1, 1))
+ {
+ *retcode += -67;
+ return 0;
+ }
+ if (!do_export_mono_tile_image (sqlite, coverage, 1, 2))
+ {
+ *retcode += -68;
+ return 0;
+ }
+ if (!do_export_mono_tile_image (sqlite, coverage, -1, 0))
+ {
+ *retcode += -69;
+ return 0;
+ }
+
+ if (compression == RL2_COMPRESSION_NONE && tile_sz == TILE_256)
+ {
+ /* testing a Monolithic Pyramid */
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -70;
+ return 0;
+ }
+ sql =
+ sqlite3_mprintf ("SELECT RL2_PyramidizeMonolithic(%Q, 1, 1)",
+ coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "PyramidizeMonolithic \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -71;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "rgb_histogram2", "jpg", 1))
+ {
+ *retcode += 71;
+ return 0;
+ }
+ if (!do_export_map_image
+ (sqlite, coverage, geom, "gray_histogram2", "jpg", 1))
+ {
+ *retcode += 72;
+ return 0;
+ }
+ gaiaFreeGeomColl (geom);
+ }
+
+ return 1;
+}
+
+static int
+drop_coverage (sqlite3 * sqlite, unsigned char compression, int tile_sz,
+ int *retcode)
+{
+/* dropping some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ char *sql;
+
+/* setting the coverage name */
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "orbetello_none_256";
+ break;
+ case TILE_512:
+ coverage = "orbetello_none_512";
+ break;
+ case TILE_1024:
+ coverage = "orbetello_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "orbetello_zip_256";
+ break;
+ case TILE_512:
+ coverage = "orbetello_zip_512";
+ break;
+ case TILE_1024:
+ coverage = "orbetello_zip_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "orbetello_lzma_256";
+ break;
+ case TILE_512:
+ coverage = "orbetello_lzma_512";
+ break;
+ case TILE_1024:
+ coverage = "orbetello_lzma_1024";
+ break;
+ };
+ break;
+ };
+
+/* setting a Title and Abstract for this DBMS Coverage */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_SetCoverageInfos(%Q, %Q, %Q)", coverage,
+ "this is a tile", "this is an abstact");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "SetCoverageInfos \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* dropping the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_DropCoverage(%Q, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DropCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateStylingTables()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateStylingTables() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return 4;
+ }
+
+/* tests */
+ ret = -100;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_512, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_512, &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* dropping all Coverages */
+ ret = -170;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -180;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -190;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -270;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_512, &ret))
+ return ret;
+ ret = -290;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -370;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -380;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_512, &ret))
+ return ret;
+ ret = -390;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_rgb.c b/test/test_map_rgb.c
new file mode 100644
index 0000000..6449305
--- /dev/null
+++ b/test/test_map_rgb.c
@@ -0,0 +1,1360 @@
+/*
+
+ test_map_rgb.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+#include "spatialite/gaiaaux.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_512 512
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+get_max_tile_id (sqlite3 * sqlite, const char *coverage)
+{
+/* retriving the Max tile_id for a given Coverage */
+ char *sql;
+ char *table;
+ char *xtable;
+ sqlite3_stmt *stmt;
+ int ret;
+ int max = 0;
+
+ table = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("SELECT Max(tile_id) FROM \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ max = sqlite3_column_int (stmt, 0);
+ }
+ sqlite3_finalize (stmt);
+ return max;
+}
+
+static int
+do_export_tile_image (sqlite3 * sqlite, const char *coverage, int tile_id)
+{
+/* attempting to export a visible Tile */
+ char *sql;
+ char *path;
+ int ret;
+ int transparent = 1;
+
+ if (tile_id <= 1)
+ transparent = 0;
+ if (tile_id < 0)
+ tile_id = get_max_tile_id (sqlite, coverage);
+ path = sqlite3_mprintf ("./%s_tile_%d.png", coverage, tile_id);
+ sql =
+ sqlite3_mprintf
+ ("SELECT BlobToFile(RL2_GetTileImage(%Q, %d, '#e0ffe0', %d), %Q)",
+ coverage, tile_id, transparent, path);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ unlink (path);
+ sqlite3_free (path);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr,
+ "ERROR: Unable to export an Image from \"%s\" tile_id=%d\n",
+ coverage, tile_id);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+get_base_resolution (sqlite3 * sqlite, const char *coverage, double *x_res,
+ double *y_res)
+{
+/* attempting to retrieve the Coverage's base resolution */
+ char *sql;
+ sqlite3_stmt *stmt;
+ int ret;
+ int ok = 0;
+
+ sql = sqlite3_mprintf ("SELECT horz_resolution, vert_resolution "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ *x_res = sqlite3_column_double (stmt, 0);
+ *y_res = sqlite3_column_double (stmt, 1);
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+}
+
+static int
+do_export_geotiff (sqlite3 * sqlite, const char *coverage, const char *type,
+ gaiaGeomCollPtr geom, int scale)
+{
+/* exporting a GeoTiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_%s_gt_%d.tif", coverage, type, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 0);
+ sqlite3_bind_text (stmt, 9, "JPEG", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_tiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a Tiff + Worldfile */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_tfw_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteTiffTfw(?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_text (stmt, 8, "DEFLATE", 7, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_tfw_%d.tfw", coverage, scale);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+static int
+do_export_image (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ double radius, const char *suffix)
+{
+/* exporting a PNG/JPEG/TIFF/PDF image */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ const char *mime_type = "text/plain";
+
+ path = sqlite3_mprintf ("./%s_%1.0f%s", coverage, radius, suffix);
+
+ sql =
+ "SELECT RL2_GetMapImage(?, ST_Buffer(?, ?), 512, 512, 'default', ?, '#ffffff', 1, 80)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 2, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 3, radius);
+ if (strcmp (suffix, ".png") == 0)
+ mime_type = "image/png";
+ if (strcmp (suffix, ".jpg") == 0)
+ mime_type = "image/jpeg";
+ if (strcmp (suffix, ".tif") == 0)
+ mime_type = "image/tiff";
+ if (strcmp (suffix, ".pdf") == 0)
+ mime_type = "application/x-pdf";
+ sqlite3_bind_text (stmt, 4, mime_type, strlen (mime_type),
+ SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ FILE *out;
+ blob = (unsigned char *) sqlite3_column_blob (stmt, 0);
+ blob_size = sqlite3_column_bytes (stmt, 0);
+ out = fopen (path, "wb");
+ if (out != NULL)
+ {
+ /* writing the output image */
+ if ((int) fwrite (blob, 1, blob_size, out) == blob_size)
+ retcode = 1;
+ fclose (out);
+ }
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to GetMap \"%s\"\n", path);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char pixel,
+ unsigned char compression, int tile_sz, int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty;
+ char *sql;
+ int tile_size;
+ gaiaGeomCollPtr geom;
+
+/* setting the coverage name */
+ switch (pixel)
+ {
+ case RL2_PIXEL_RGB:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "rgb_none_256";
+ break;
+ case TILE_512:
+ coverage = "rgb_none_512";
+ break;
+ case TILE_1024:
+ coverage = "rgb_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "rgb_png_256";
+ break;
+ case TILE_512:
+ coverage = "rgb_png_512";
+ break;
+ case TILE_1024:
+ coverage = "rgb_png_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_JPEG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "rgb_jpeg_256";
+ break;
+ case TILE_512:
+ coverage = "rgb_jpeg_512";
+ break;
+ case TILE_1024:
+ coverage = "rgb_jpeg_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "rgb_webp_256";
+ break;
+ case TILE_512:
+ coverage = "rgb_webp_512";
+ break;
+ case TILE_1024:
+ coverage = "rgb_webp_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "rgb_llwebp_256";
+ break;
+ case TILE_512:
+ coverage = "rgb_llwebp_512";
+ break;
+ case TILE_1024:
+ coverage = "rgb_llwebp_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_none_256";
+ break;
+ case TILE_512:
+ coverage = "gray_none_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_png_256";
+ break;
+ case TILE_512:
+ coverage = "gray_png_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_png_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_JPEG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_jpeg_256";
+ break;
+ case TILE_512:
+ coverage = "gray_jpeg_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_jpeg_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_webp_256";
+ break;
+ case TILE_512:
+ coverage = "gray_webp_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_webp_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_llwebp_256";
+ break;
+ case TILE_512:
+ coverage = "gray_llwebp_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_llwebp_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ sample_name = "UINT8";
+ switch (pixel)
+ {
+ case RL2_PIXEL_RGB:
+ num_bands = 3;
+ pixel_name = "RGB";
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ num_bands = 1;
+ pixel_name = "GRAYSCALE";
+ break;
+ };
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ compression_name = "NONE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_PNG:
+ compression_name = "PNG";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_JPEG:
+ compression_name = "JPEG";
+ qlty = 80;
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ compression_name = "WEBP";
+ qlty = 80;
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ compression_name = "LL_WEBP";
+ qlty = 100;
+ break;
+ };
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_512:
+ tile_size = 512;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.16f, %1.16f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 26914,
+ 0.152400030480006134, 0.152400030480006134);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 26914, 0, 1)", coverage,
+ "map_samples/usgs-rgb", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "rgb1");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 26914, 1, 1)",
+ coverage, "map_samples/usgs-rgb/rgb1.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+/* building the Pyramid Levels */
+ sql = sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, NULL, 0, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -5;
+ return 0;
+ }
+
+/* export tests */
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -6;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "norm", geom, 1))
+ {
+ *retcode += -7;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "norm", geom, 2))
+ {
+ *retcode += -8;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "norm", geom, 4))
+ {
+ *retcode += -9;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "norm", geom, 8))
+ {
+ *retcode += -10;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 1))
+ {
+ *retcode += -11;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 2))
+ {
+ *retcode += -12;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 4))
+ {
+ *retcode += -13;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 8))
+ {
+ *retcode += -14;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 39.015, ".jpg"))
+ {
+ *retcode += -15;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 69.0, ".jpg"))
+ {
+ *retcode += -16;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 39.015, ".png"))
+ {
+ *retcode += -17;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 16.0, ".png"))
+ {
+ *retcode += -18;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 39.015, ".tif"))
+ {
+ *retcode += -19;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 16.0, ".tif"))
+ {
+ *retcode += -20;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 39.015, ".pdf"))
+ {
+ *retcode += -21;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 16.0, ".pdf"))
+ {
+ *retcode += -22;
+ return 0;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* testing GetTileImage() */
+ if (!do_export_tile_image (sqlite, coverage, 1))
+ {
+ *retcode += -23;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, 2))
+ {
+ *retcode += -24;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, -1))
+ {
+ *retcode += -25;
+ return 0;
+ }
+
+ if (strcmp (coverage, "rgb_jpeg_512") == 0)
+ {
+ /* testing a Monolithic Pyramid */
+ geom = get_center_point (sqlite, coverage);
+ sql =
+ sqlite3_mprintf ("SELECT RL2_PyramidizeMonolithic(%Q, 1, 1)",
+ coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "PyramidizeMonolithic \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -26;
+ return 0;
+ }
+
+ /* export tests */
+ if (geom == NULL)
+ {
+ *retcode += -27;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "mono", geom, 1))
+ {
+ *retcode += -28;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "mono", geom, 2))
+ {
+ *retcode += -29;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "mono", geom, 4))
+ {
+ *retcode += -30;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, "mono", geom, 8))
+ {
+ *retcode += -31;
+ return 0;
+ }
+ gaiaFreeGeomColl (geom);
+ }
+
+ return 1;
+}
+
+static int
+drop_coverage (sqlite3 * sqlite, unsigned char pixel,
+ unsigned char compression, int tile_sz, int *retcode)
+{
+/* dropping some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ char *sql;
+
+/* setting the coverage name */
+ switch (pixel)
+ {
+ case RL2_PIXEL_RGB:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "rgb_none_256";
+ break;
+ case TILE_512:
+ coverage = "rgb_none_512";
+ break;
+ case TILE_1024:
+ coverage = "rgb_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "rgb_png_256";
+ break;
+ case TILE_512:
+ coverage = "rgb_png_512";
+ break;
+ case TILE_1024:
+ coverage = "rgb_png_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_JPEG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "rgb_jpeg_256";
+ break;
+ case TILE_512:
+ coverage = "rgb_jpeg_512";
+ break;
+ case TILE_1024:
+ coverage = "rgb_jpeg_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "rgb_webp_256";
+ break;
+ case TILE_512:
+ coverage = "rgb_webp_512";
+ break;
+ case TILE_1024:
+ coverage = "rgb_webp_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "rgb_llwebp_256";
+ break;
+ case TILE_512:
+ coverage = "rgb_llwebp_512";
+ break;
+ case TILE_1024:
+ coverage = "rgb_llwebp_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_none_256";
+ break;
+ case TILE_512:
+ coverage = "gray_none_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_PNG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_png_256";
+ break;
+ case TILE_512:
+ coverage = "gray_png_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_png_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_JPEG:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_jpeg_256";
+ break;
+ case TILE_512:
+ coverage = "gray_jpeg_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_jpeg_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_webp_256";
+ break;
+ case TILE_512:
+ coverage = "gray_webp_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_webp_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_llwebp_256";
+ break;
+ case TILE_512:
+ coverage = "gray_llwebp_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_llwebp_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* dropping the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_DropCoverage(%Q, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DropCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* RGB tests */
+ ret = -100;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, TILE_512, &ret))
+ return ret;
+ ret = -340;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, TILE_1024, &ret))
+ return ret;
+ ret = -400;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSY_WEBP, TILE_256, &ret))
+ return ret;
+ ret = -420;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSY_WEBP, TILE_512, &ret))
+ return ret;
+ ret = -440;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSY_WEBP, TILE_1024, &ret))
+ return ret;
+ ret = -500;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSLESS_WEBP, TILE_256,
+ &ret))
+ return ret;
+ ret = -520;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSLESS_WEBP, TILE_512,
+ &ret))
+ return ret;
+ ret = -540;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSLESS_WEBP, TILE_1024,
+ &ret))
+ return ret;
+
+/* GRAYSCALE tests */
+ ret = -600;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -620;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -640;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -700;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -720;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -740;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+ ret = -800;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_256, &ret))
+ return ret;
+ ret = -820;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_512, &ret))
+ return ret;
+ ret = -840;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_1024, &ret))
+ return ret;
+ ret = -900;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_256,
+ &ret))
+ return ret;
+ ret = -920;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_512,
+ &ret))
+ return ret;
+ ret = -940;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_1024,
+ &ret))
+ return ret;
+ ret = -1000;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_256, &ret))
+ return ret;
+ ret = -1020;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_512, &ret))
+ return ret;
+ ret = -1040;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_1024, &ret))
+ return ret;
+
+/* dropping all RGB Coverages */
+ ret = -170;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -180;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -190;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -270;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -290;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+ ret = -370;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, TILE_256, &ret))
+ return ret;
+ ret = -380;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, TILE_512, &ret))
+ return ret;
+ ret = -390;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, TILE_1024, &ret))
+ return ret;
+ ret = -470;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSY_WEBP, TILE_256, &ret))
+ return ret;
+ ret = -480;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSY_WEBP, TILE_512, &ret))
+ return ret;
+ ret = -490;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSY_WEBP, TILE_1024, &ret))
+ return ret;
+ ret = -570;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSLESS_WEBP, TILE_256,
+ &ret))
+ return ret;
+ ret = -580;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSLESS_WEBP, TILE_512,
+ &ret))
+ return ret;
+ ret = -590;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_LOSSLESS_WEBP, TILE_1024,
+ &ret))
+ return ret;
+
+/* dropping all GRAYSCALE Coverages */
+ ret = -670;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -680;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -690;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -770;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_256, &ret))
+ return ret;
+ ret = -780;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_512, &ret))
+ return ret;
+ ret = -790;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, TILE_1024, &ret))
+ return ret;
+ ret = -870;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_256, &ret))
+ return ret;
+ ret = -880;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_512, &ret))
+ return ret;
+ ret = -890;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, TILE_1024, &ret))
+ return ret;
+ ret = -970;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_256,
+ &ret))
+ return ret;
+ ret = -980;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_512,
+ &ret))
+ return ret;
+ ret = -990;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSY_WEBP, TILE_1024,
+ &ret))
+ return ret;
+ ret = -1070;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_256, &ret))
+ return ret;
+ ret = -1080;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_512, &ret))
+ return ret;
+ ret = -1090;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_LOSSLESS_WEBP,
+ TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_srtm.c b/test/test_map_srtm.c
new file mode 100644
index 0000000..518e3ee
--- /dev/null
+++ b/test/test_map_srtm.c
@@ -0,0 +1,2056 @@
+/*
+
+ test_map_srtm.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+#include "spatialite/gaiaaux.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+get_max_tile_id (sqlite3 * sqlite, const char *coverage)
+{
+/* retriving the Max tile_id for a given Coverage */
+ char *sql;
+ char *table;
+ char *xtable;
+ sqlite3_stmt *stmt;
+ int ret;
+ int max = 0;
+
+ table = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("SELECT Max(tile_id) FROM \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ max = sqlite3_column_int (stmt, 0);
+ }
+ sqlite3_finalize (stmt);
+ return max;
+}
+
+static int
+do_export_tile_image (sqlite3 * sqlite, const char *coverage, int tile_id,
+ int transparent)
+{
+/* attempting to export a visible Tile */
+ char *sql;
+ char *path;
+ int ret;
+
+ if (tile_id < 0)
+ tile_id = get_max_tile_id (sqlite, coverage);
+ path =
+ sqlite3_mprintf ("./%s_mono_tile_%d_%d.png", coverage, tile_id,
+ transparent);
+ sql =
+ sqlite3_mprintf
+ ("SELECT BlobToFile(RL2_GetTileImage(%Q, %d, '#e0ffe0', %d), %Q)",
+ coverage, tile_id, transparent, path);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ unlink (path);
+ sqlite3_free (path);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr,
+ "ERROR: Unable to export an Image from \"%s\" tile_id=%d\n",
+ coverage, tile_id);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+get_base_resolution (sqlite3 * sqlite, const char *coverage, double *x_res,
+ double *y_res)
+{
+/* attempting to retrieve the Coverage's base resolution */
+ char *sql;
+ sqlite3_stmt *stmt;
+ int ret;
+ int ok = 0;
+
+ sql = sqlite3_mprintf ("SELECT horz_resolution, vert_resolution "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ *x_res = sqlite3_column_double (stmt, 0);
+ *y_res = sqlite3_column_double (stmt, 1);
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+}
+
+static int
+do_export_geotiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a GeoTiff + Worldfile */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_gt_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 1);
+ sqlite3_bind_text (stmt, 9, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_gt_%d.tfw", coverage, scale);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_tiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a Tiff (no Worldfile) */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_plain_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteTiff(?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_text (stmt, 8, "DEFLATE", 7, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_map_image (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, const char *style,
+ const char *suffix)
+{
+/* exporting a Map Image (full rendered) */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ const char *format = "text/plain";
+
+ if (strcmp (suffix, "png") == 0)
+ format = "image/png";
+ if (strcmp (suffix, "jpg") == 0)
+ format = "image/jpeg";
+ if (strcmp (suffix, "tif") == 0)
+ format = "image/tiff";
+ if (strcmp (suffix, "pdf") == 0)
+ format = "application/x-pdf";
+
+ path = sqlite3_mprintf ("./%s_map_%s.%s", coverage, style, suffix);
+
+ sql =
+ "SELECT BlobToFile(RL2_GetMapImage(?, ST_Buffer(?, 0.65), ?, ?, ?, ?, ?, ?), ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 2, blob, blob_size, free);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ sqlite3_bind_text (stmt, 5, style, strlen (style), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 6, format, strlen (format), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 7, "#ffe0e0", 7, SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 8, 1);
+ sqlite3_bind_text (stmt, 9, path, strlen (path), SQLITE_STATIC);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char sample,
+ unsigned char compression, int tile_sz, int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty;
+ char *sql;
+ int tile_size;
+ gaiaGeomCollPtr geom;
+ int test_map_image = 0;
+
+/* setting the coverage name */
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_none_1024";
+ test_map_image = 1;
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_none_256";
+ test_map_image = 1;
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT16:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_none_1024";
+ test_map_image = 1;
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT16:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_none_256";
+ test_map_image = 1;
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT32:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_none_1024";
+ test_map_image = 1;
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT32:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_none_1024";
+ test_map_image = 1;
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_FLOAT:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_none_1024";
+ test_map_image = 1;
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_none_256";
+ test_map_image = 1;
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ pixel_name = "DATAGRID";
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ sample_name = "INT8";
+ break;
+ case RL2_SAMPLE_UINT8:
+ sample_name = "UINT8";
+ break;
+ case RL2_SAMPLE_INT16:
+ sample_name = "INT16";
+ break;
+ case RL2_SAMPLE_UINT16:
+ sample_name = "UINT16";
+ break;
+ case RL2_SAMPLE_INT32:
+ sample_name = "INT32";
+ break;
+ case RL2_SAMPLE_UINT32:
+ sample_name = "UINT32";
+ break;
+ case RL2_SAMPLE_FLOAT:
+ sample_name = "FLOAT";
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ sample_name = "DOUBLE";
+ break;
+ };
+ num_bands = 1;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ compression_name = "NONE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ compression_name = "DEFLATE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_LZMA:
+ compression_name = "LZMA";
+ qlty = 100;
+ break;
+ };
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.8f, %1.8f, "
+ "RL2_SetPixelValue(RL2_CreatePixel(%Q, %Q, 1), 0, 0))",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 4326,
+ 0.0008333333333333, 0.0008333333333333, sample_name,
+ pixel_name);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 4326, 0, 1)", coverage,
+ "map_samples/usgs-srtm", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "srtm1");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 4326, 0, 1)",
+ coverage, "map_samples/usgs-srtm/srtm1.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+/* export tests */
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -5;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 1))
+ {
+ *retcode += -6;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 2))
+ {
+ *retcode += -7;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 4))
+ {
+ *retcode += -8;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 8))
+ {
+ *retcode += -9;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 1))
+ {
+ *retcode += -10;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 2))
+ {
+ *retcode += -11;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 4))
+ {
+ *retcode += -12;
+ return 0;
+ }
+ if (!do_export_tiff (sqlite, coverage, geom, 8))
+ {
+ *retcode += -13;
+ return 0;
+ }
+ if (!test_map_image)
+ goto skip;
+
+/* testing GetMapImage - no style */
+ if (!do_export_map_image (sqlite, coverage, geom, "default", "png"))
+ {
+ *retcode += 14;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "default", "jpg"))
+ {
+ *retcode += 15;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "default", "tif"))
+ {
+ *retcode += 16;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "default", "pdf"))
+ {
+ *retcode += 17;
+ return 0;
+ }
+
+/* loading the RasterSymbolizers */
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "srtm_categ.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #1 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -19;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "srtm_interp.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #2 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -20;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "gray_gamma.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #3 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -21;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "gray_histogram.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #4 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -22;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "gray_normalize.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #5 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -23;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "srtm_relief_25.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #6 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -24;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "srtm_relief_75.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #7 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -25;
+ return 0;
+ }
+ sql = sqlite3_mprintf ("SELECT RegisterRasterStyledLayer(%Q, "
+ "XB_Create(XB_LoadXML(%Q), 1, 1))", coverage,
+ "srtm_brightness.xml");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterRasterStyledLayer #7 \"%s\" error: %s\n",
+ coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -26;
+ return 0;
+ }
+
+/* testing GetMapImage - Categorize Color Map */
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_categ", "png"))
+ {
+ *retcode += 27;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_categ", "jpg"))
+ {
+ *retcode += 28;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_categ", "tif"))
+ {
+ *retcode += 29;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_categ", "pdf"))
+ {
+ *retcode += 30;
+ return 0;
+ }
+
+/* testing GetMapImage - Categorize Color Map */
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_interp", "png"))
+ {
+ *retcode += 31;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_interp", "jpg"))
+ {
+ *retcode += 32;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_interp", "tif"))
+ {
+ *retcode += 33;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_interp", "pdf"))
+ {
+ *retcode += 34;
+ return 0;
+ }
+
+/* testing GetMapImage - Gray GammaValue */
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_gamma", "png"))
+ {
+ *retcode += 35;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_gamma", "jpg"))
+ {
+ *retcode += 36;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_gamma", "tif"))
+ {
+ *retcode += 37;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_gamma", "pdf"))
+ {
+ *retcode += 38;
+ return 0;
+ }
+
+/* testing GetMapImage - Gray Histogram */
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_histogram", "png"))
+ {
+ *retcode += 39;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_histogram", "jpg"))
+ {
+ *retcode += 40;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_histogram", "tif"))
+ {
+ *retcode += 41;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_histogram", "pdf"))
+ {
+ *retcode += 42;
+ return 0;
+ }
+
+/* testing GetMapImage - Gray Normalize */
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_normalize", "png"))
+ {
+ *retcode += 43;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_normalize", "jpg"))
+ {
+ *retcode += 44;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_normalize", "tif"))
+ {
+ *retcode += 45;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "gray_normalize", "pdf"))
+ {
+ *retcode += 46;
+ return 0;
+ }
+
+/* testing GetMapImage - ShadedRelief ReliefFactor 25 */
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_relief_25", "png"))
+ {
+ *retcode += 47;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_relief_25", "jpg"))
+ {
+ *retcode += 48;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_relief_25", "tif"))
+ {
+ *retcode += 49;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_relief_25", "pdf"))
+ {
+ *retcode += 50;
+ return 0;
+ }
+
+/* testing GetMapImage - ShadedRelief ReliefFactor 75 */
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_relief_75", "png"))
+ {
+ *retcode += 51;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_relief_75", "jpg"))
+ {
+ *retcode += 52;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_relief_75", "tif"))
+ {
+ *retcode += 53;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_relief_75", "pdf"))
+ {
+ *retcode += 54;
+ return 0;
+ }
+
+/* testing GetMapImage - ShadedRelief BrightnessOnly */
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_brightness", "png"))
+ {
+ *retcode += 55;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_brightness", "jpg"))
+ {
+ *retcode += 56;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_brightness", "tif"))
+ {
+ *retcode += 57;
+ return 0;
+ }
+ if (!do_export_map_image (sqlite, coverage, geom, "srtm_brightness", "pdf"))
+ {
+ *retcode += 58;
+ return 0;
+ }
+ skip:
+ gaiaFreeGeomColl (geom);
+
+/* testing GetTileImage() */
+ if (!do_export_tile_image (sqlite, coverage, 1, 0))
+ {
+ *retcode += -59;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, 1, 1))
+ {
+ *retcode += -60;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, -1, 0))
+ {
+ *retcode += -61;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, -1, 1))
+ {
+ *retcode += -62;
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+drop_coverage (sqlite3 * sqlite, unsigned char sample,
+ unsigned char compression, int tile_sz, int *retcode)
+{
+/* dropping some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ char *sql;
+
+/* setting the coverage name */
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_8_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_8_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT8:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u8_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u8_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT16:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_16_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_16_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT16:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u16_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u16_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_INT32:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_32_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_32_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_UINT32:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_u32_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_u32_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_FLOAT:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_flt_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_flt_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_none_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_deflate_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_deflate_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_LZMA:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "grid_dbl_lzma_256";
+ break;
+ case TILE_1024:
+ coverage = "grid_dbl_lzma_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* dropping the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_DropCoverage(%Q, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DropCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateStylingTables()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateStylingTables() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return 4;
+ }
+
+/* SRTM (GRID) tests */
+ ret = -100;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -300;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -320;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* UINT16 tests */
+ ret = -150;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -170;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -250;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -270;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_DEFLATE, TILE_1024,
+ &ret))
+ return ret;
+ ret = -350;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -370;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* INT32 tests */
+ ret = -400;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -420;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -500;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -520;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -600;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -620;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* UINT32 tests */
+ ret = -450;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -470;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -550;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -570;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_DEFLATE, TILE_1024,
+ &ret))
+ return ret;
+ ret = -650;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -670;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* FLOAT tests */
+ ret = -700;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -720;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -800;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -820;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -900;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -920;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* INT8 tests */
+ ret = -750;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -770;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -850;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -870;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -950;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -970;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* DOUBLE tests */
+ ret = -1000;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -1020;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -1100;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -1120;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_DEFLATE, TILE_1024,
+ &ret))
+ return ret;
+ ret = -1200;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -1220;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* UINT8 tests */
+ ret = -1050;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -1070;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -1150;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -1170;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -1250;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -1270;
+ if (!test_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* dropping all SRTM INT16 Coverages */
+ ret = -130;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -140;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -230;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -240;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -330;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -340;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT16, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* dropping all SRTM UINT16 Coverages */
+ ret = -180;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -190;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -280;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -290;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_DEFLATE, TILE_1024,
+ &ret))
+ return ret;
+ ret = -380;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -390;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT16, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* dropping all INT32 Coverages */
+ ret = -430;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -440;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -530;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -540;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -630;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -640;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT32, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* dropping all UINT32 Coverages */
+ ret = -480;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -490;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -580;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -590;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_DEFLATE, TILE_1024,
+ &ret))
+ return ret;
+ ret = -680;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -690;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT32, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* dropping all FLOAT Coverages */
+ ret = -740;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -750;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -840;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -850;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -940;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -950;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_FLOAT, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* dropping all INT8 Coverages */
+ ret = -780;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -790;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -880;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -890;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -980;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -990;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_INT8, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* dropping all DOUBLE Coverages */
+ ret = -1030;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -1040;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -1130;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -1140;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_DEFLATE, TILE_1024,
+ &ret))
+ return ret;
+ ret = -1230;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -1240;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_DOUBLE, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* dropping all UINT8 Coverages */
+ ret = -1030;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -1040;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -1130;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -1140;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+ ret = -1230;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_LZMA, TILE_256, &ret))
+ return ret;
+ ret = -1240;
+ if (!drop_coverage
+ (db_handle, RL2_SAMPLE_UINT8, RL2_COMPRESSION_LZMA, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_trento.c b/test/test_map_trento.c
new file mode 100644
index 0000000..b6a17c5
--- /dev/null
+++ b/test/test_map_trento.c
@@ -0,0 +1,1039 @@
+/*
+
+ test_map_trento.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+#include "spatialite/gaiaaux.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_512 512
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+get_max_tile_id (sqlite3 * sqlite, const char *coverage)
+{
+/* retriving the Max tile_id for a given Coverage */
+ char *sql;
+ char *table;
+ char *xtable;
+ sqlite3_stmt *stmt;
+ int ret;
+ int max = 0;
+
+ table = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("SELECT Max(tile_id) FROM \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ max = sqlite3_column_int (stmt, 0);
+ }
+ sqlite3_finalize (stmt);
+ return max;
+}
+
+static int
+do_export_tile_image (sqlite3 * sqlite, const char *coverage, int tile_id)
+{
+/* attempting to export a visible Tile */
+ char *sql;
+ char *path;
+ int ret;
+ int transparent = 1;
+
+ if (tile_id <= 1)
+ transparent = 0;
+ if (tile_id < 0)
+ tile_id = get_max_tile_id (sqlite, coverage);
+ path = sqlite3_mprintf ("./%s_tile_%d.png", coverage, tile_id);
+ sql =
+ sqlite3_mprintf
+ ("SELECT BlobToFile(RL2_GetTileImage(%Q, %d, '#e0ffe0', %d), %Q)",
+ coverage, tile_id, transparent, path);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ unlink (path);
+ sqlite3_free (path);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr,
+ "ERROR: Unable to export an Image from \"%s\" tile_id=%d\n",
+ coverage, tile_id);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+get_base_resolution (sqlite3 * sqlite, const char *coverage, double *x_res,
+ double *y_res)
+{
+/* attempting to retrieve the Coverage's base resolution */
+ char *sql;
+ sqlite3_stmt *stmt;
+ int ret;
+ int ok = 0;
+
+ sql = sqlite3_mprintf ("SELECT horz_resolution, vert_resolution "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ *x_res = sqlite3_column_double (stmt, 0);
+ *y_res = sqlite3_column_double (stmt, 1);
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+}
+
+static int
+do_export_geotiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a GeoTiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_gt_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 0);
+ sqlite3_bind_text (stmt, 9, "JPEG", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_jpeg (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a JPEG [no Worldfile] */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_%d.jpg", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteJpeg(?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 90);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+do_export_jpeg_jgw (sqlite3 * sqlite, const char *coverage,
+ gaiaGeomCollPtr geom, int scale)
+{
+/* exporting a JPEG + Worldfile */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_jgw_%d.jpg", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteJpegJgw(?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 40);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ path = sqlite3_mprintf ("./%s_jgw_%d.jgw", coverage, scale);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+static int
+do_export_image (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ double radius, const char *suffix)
+{
+/* exporting a PNG/JPEG/TIFF/PDF image */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+ const char *mime_type = "text/plain";
+
+ path = sqlite3_mprintf ("./%s_%1.0f%s", coverage, radius, suffix);
+
+ sql =
+ "SELECT RL2_GetMapImage(?, ST_Buffer(?, ?), 512, 512, 'default', ?, '#ffffff', 1, 80)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 2, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 3, radius);
+ if (strcmp (suffix, ".png") == 0)
+ mime_type = "image/png";
+ if (strcmp (suffix, ".jpg") == 0)
+ mime_type = "image/jpeg";
+ if (strcmp (suffix, ".tif") == 0)
+ mime_type = "image/tiff";
+ if (strcmp (suffix, ".pdf") == 0)
+ mime_type = "application/x-pdf";
+ sqlite3_bind_text (stmt, 4, mime_type, strlen (mime_type),
+ SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ FILE *out;
+ blob = (unsigned char *) sqlite3_column_blob (stmt, 0);
+ blob_size = sqlite3_column_bytes (stmt, 0);
+ out = fopen (path, "wb");
+ if (out != NULL)
+ {
+ /* writing the output image */
+ if ((int) fwrite (blob, 1, blob_size, out) == blob_size)
+ retcode = 1;
+ fclose (out);
+ }
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to GetMap \"%s\"\n", path);
+ unlink (path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char pixel, unsigned char compression,
+ int type, int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ const char *indir;
+ const char *delsect;
+ const char *reload;
+ int qlty;
+ char *sql;
+ int tile_size;
+ gaiaGeomCollPtr geom;
+
+ if (!type)
+ {
+ indir = "map_samples/trento-gray";
+ delsect = "trento-gray1";
+ reload = "map_samples/trento-gray/trento-gray1.jpg";
+ }
+ else
+ {
+ indir = "map_samples/trento-rgb";
+ delsect = "trento-rgb1";
+ reload = "map_samples/trento-rgb/trento-rgb1.jpg";
+ }
+
+/* setting the coverage name */
+ switch (type)
+ {
+ case 0:
+ switch (pixel)
+ {
+ case RL2_PIXEL_RGB:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "gray_rgb_none_512";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "gray_rgb_png_512";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "gray_rgb_jpeg_512";
+ break;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "gray_gray_none_512";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "gray_gray_png_512";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "gray_gray_jpeg_512";
+ break;
+ };
+ break;
+ };
+ break;
+ case 1:
+ switch (pixel)
+ {
+ case RL2_PIXEL_RGB:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "rgb_rgb_none_512";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "rgb_rgb_png_512";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "rgb_rgb_jpeg_512";
+ break;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "rgb_gray_none_512";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "rgb_gray_png_512";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "rgb_gray_jpeg_512";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ sample_name = "UINT8";
+ switch (pixel)
+ {
+ case RL2_PIXEL_RGB:
+ num_bands = 3;
+ pixel_name = "RGB";
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ num_bands = 1;
+ pixel_name = "GRAYSCALE";
+ break;
+ };
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ compression_name = "NONE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_PNG:
+ compression_name = "PNG";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_JPEG:
+ compression_name = "JPEG";
+ qlty = 80;
+ break;
+ };
+ tile_size = 512;
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.16f, %1.16f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 32632,
+ 0.5, 0.5);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 32632, 0, 1)", coverage,
+ indir, ".jpg");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, delsect);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 32632, 1, 1)",
+ coverage, reload);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+/* building the Pyramid Levels */
+ sql = sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, NULL, 0, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -5;
+ return 0;
+ }
+
+/* export tests */
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -6;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 1))
+ {
+ *retcode += -7;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 2))
+ {
+ *retcode += -8;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 4))
+ {
+ *retcode += -9;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 8))
+ {
+ *retcode += -10;
+ return 0;
+ }
+ if (!do_export_jpeg (sqlite, coverage, geom, 1))
+ {
+ *retcode += -11;
+ return 0;
+ }
+ if (!do_export_jpeg (sqlite, coverage, geom, 2))
+ {
+ *retcode += -12;
+ return 0;
+ }
+ if (!do_export_jpeg (sqlite, coverage, geom, 4))
+ {
+ *retcode += -13;
+ return 0;
+ }
+ if (!do_export_jpeg (sqlite, coverage, geom, 8))
+ {
+ *retcode += -14;
+ return 0;
+ }
+ if (!do_export_jpeg_jgw (sqlite, coverage, geom, 1))
+ {
+ *retcode += -15;
+ return 0;
+ }
+ if (!do_export_jpeg_jgw (sqlite, coverage, geom, 2))
+ {
+ *retcode += -16;
+ return 0;
+ }
+ if (!do_export_jpeg_jgw (sqlite, coverage, geom, 4))
+ {
+ *retcode += -17;
+ return 0;
+ }
+ if (!do_export_jpeg_jgw (sqlite, coverage, geom, 8))
+ {
+ *retcode += -18;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 600.015, ".png"))
+ {
+ *retcode += -19;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 20.3, ".png"))
+ {
+ *retcode += -20;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 256.0, ".png"))
+ {
+ *retcode += -21;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 600.015, ".pdf"))
+ {
+ *retcode += -22;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 20.3, ".pdf"))
+ {
+ *retcode += -23;
+ return 0;
+ }
+ if (!do_export_image (sqlite, coverage, geom, 256.0, ".pdf"))
+ {
+ *retcode += -24;
+ return 0;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* testing GetTileImage() */
+ if (!do_export_tile_image (sqlite, coverage, 1))
+ {
+ *retcode += -23;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, 2))
+ {
+ *retcode += -24;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, -1))
+ {
+ *retcode += -25;
+ return 0;
+ }
+
+ return 1;
+}
+
+static int
+drop_coverage (sqlite3 * sqlite, unsigned char pixel, unsigned char compression,
+ int type, int *retcode)
+{
+/* dropping some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ char *sql;
+
+/* setting the coverage name */
+ switch (type)
+ {
+ case 0:
+ switch (pixel)
+ {
+ case RL2_PIXEL_RGB:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "gray_rgb_none_512";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "gray_rgb_png_512";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "gray_rgb_jpeg_512";
+ break;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "gray_gray_none_512";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "gray_gray_png_512";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "gray_gray_jpeg_512";
+ break;
+ };
+ break;
+ };
+ break;
+ case 1:
+ switch (pixel)
+ {
+ case RL2_PIXEL_RGB:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "rgb_rgb_none_512";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "rgb_rgb_png_512";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "rgb_rgb_jpeg_512";
+ break;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ coverage = "rgb_gray_none_512";
+ break;
+ case RL2_COMPRESSION_PNG:
+ coverage = "rgb_gray_png_512";
+ break;
+ case RL2_COMPRESSION_JPEG:
+ coverage = "rgb_gray_jpeg_512";
+ break;
+ };
+ break;
+ };
+ break;
+ }
+
+/* dropping the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_DropCoverage(%Q, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DropCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* RGB tests */
+ ret = -100;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, 1, &ret))
+ return ret;
+ ret = -130;
+ if (!test_coverage (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, 1, &ret))
+ return ret;
+ ret = -160;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, 1, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, 0, &ret))
+ return ret;
+ ret = -230;
+ if (!test_coverage (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, 0, &ret))
+ return ret;
+ ret = -260;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, 0, &ret))
+ return ret;
+
+/* GRAYSCALE tests */
+ ret = -600;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, 1, &ret))
+ return ret;
+ ret = -630;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, 1, &ret))
+ return ret;
+ ret = -660;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, 1, &ret))
+ return ret;
+ ret = -700;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, 0, &ret))
+ return ret;
+ ret = -730;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, 0, &ret))
+ return ret;
+ ret = -760;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, 0, &ret))
+ return ret;
+
+/* dropping all RGB Coverages */
+ ret = -300;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, 1, &ret))
+ return ret;
+ ret = -330;
+ if (!drop_coverage (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, 1, &ret))
+ return ret;
+ ret = -360;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, 1, &ret))
+ return ret;
+ ret = -400;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_NONE, 0, &ret))
+ return ret;
+ ret = -430;
+ if (!drop_coverage (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_PNG, 0, &ret))
+ return ret;
+ ret = -460;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_RGB, RL2_COMPRESSION_JPEG, 0, &ret))
+ return ret;
+
+/* dropping all GRAYSCALE Coverages */
+ ret = -800;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, 1, &ret))
+ return ret;
+ ret = -830;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, 1, &ret))
+ return ret;
+ ret = -860;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, 1, &ret))
+ return ret;
+ ret = -900;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, 0, &ret))
+ return ret;
+ ret = -930;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_PNG, 0, &ret))
+ return ret;
+ ret = -960;
+ if (!drop_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_JPEG, 0, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_map_trieste.c b/test/test_map_trieste.c
new file mode 100644
index 0000000..f7ede7e
--- /dev/null
+++ b/test/test_map_trieste.c
@@ -0,0 +1,898 @@
+/*
+
+ test_map_trieste.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+#include "spatialite/gaiaaux.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+#define TILE_256 256
+#define TILE_512 512
+#define TILE_1024 1024
+
+static int
+execute_check (sqlite3 * sqlite, const char *sql)
+{
+/* executing an SQL statement returning True/False */
+ sqlite3_stmt *stmt;
+ int ret;
+ int retcode = 0;
+
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return SQLITE_ERROR;
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ if (retcode == 1)
+ return SQLITE_OK;
+ return SQLITE_ERROR;
+}
+
+static int
+get_max_tile_id (sqlite3 * sqlite, const char *coverage)
+{
+/* retriving the Max tile_id for a given Coverage */
+ char *sql;
+ char *table;
+ char *xtable;
+ sqlite3_stmt *stmt;
+ int ret;
+ int max = 0;
+
+ table = sqlite3_mprintf ("%s_tile_data", coverage);
+ xtable = gaiaDoubleQuotedSql (table);
+ sqlite3_free (table);
+ sql = sqlite3_mprintf ("SELECT Max(tile_id) FROM \"%s\"", xtable);
+ free (xtable);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ max = sqlite3_column_int (stmt, 0);
+ }
+ sqlite3_finalize (stmt);
+ return max;
+}
+
+static int
+do_export_tile_image (sqlite3 * sqlite, const char *coverage, int tile_id)
+{
+/* attempting to export a visible Tile */
+ char *sql;
+ char *path;
+ int ret;
+ int transparent = 1;
+
+ if (tile_id <= 1)
+ transparent = 0;
+ if (tile_id < 0)
+ tile_id = get_max_tile_id (sqlite, coverage);
+ path = sqlite3_mprintf ("./%s_tile_%d.png", coverage, tile_id);
+ sql =
+ sqlite3_mprintf
+ ("SELECT BlobToFile(RL2_GetTileImage(%Q, %d, '#e0ffe0', %d), %Q)",
+ coverage, tile_id, transparent, path);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ unlink (path);
+ sqlite3_free (path);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr,
+ "ERROR: Unable to export an Image from \"%s\" tile_id=%d\n",
+ coverage, tile_id);
+ return 0;
+ }
+ return 1;
+}
+
+static int
+get_base_resolution (sqlite3 * sqlite, const char *coverage, double *x_res,
+ double *y_res)
+{
+/* attempting to retrieve the Coverage's base resolution */
+ char *sql;
+ sqlite3_stmt *stmt;
+ int ret;
+ int ok = 0;
+
+ sql = sqlite3_mprintf ("SELECT horz_resolution, vert_resolution "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return 0;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ *x_res = sqlite3_column_double (stmt, 0);
+ *y_res = sqlite3_column_double (stmt, 1);
+ ok = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return ok;
+}
+
+static int
+do_export_geotiff (sqlite3 * sqlite, const char *coverage, gaiaGeomCollPtr geom,
+ int scale)
+{
+/* exporting a GeoTiff */
+ char *sql;
+ char *path;
+ sqlite3_stmt *stmt;
+ int ret;
+ double x_res;
+ double y_res;
+ double xx_res;
+ double yy_res;
+ unsigned char *blob;
+ int blob_size;
+ int retcode = 0;
+
+ path = sqlite3_mprintf ("./%s_gt_%d.tif", coverage, scale);
+
+ if (!get_base_resolution (sqlite, coverage, &x_res, &y_res))
+ return 0;
+ xx_res = x_res * (double) scale;
+ yy_res = y_res * (double) scale;
+
+ sql = "SELECT RL2_WriteGeoTiff(?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return 0;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, 1024);
+ sqlite3_bind_int (stmt, 4, 1024);
+ gaiaToSpatiaLiteBlobWkb (geom, &blob, &blob_size);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, free);
+ sqlite3_bind_double (stmt, 6, xx_res);
+ sqlite3_bind_double (stmt, 7, yy_res);
+ sqlite3_bind_int (stmt, 8, 0);
+ sqlite3_bind_text (stmt, 9, "NONE", 4, SQLITE_TRANSIENT);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ retcode = 1;
+ }
+ sqlite3_finalize (stmt);
+ unlink (path);
+ if (!retcode)
+ fprintf (stderr, "ERROR: unable to export \"%s\"\n", path);
+ sqlite3_free (path);
+ return retcode;
+}
+
+static gaiaGeomCollPtr
+get_center_point (sqlite3 * sqlite, const char *coverage)
+{
+/* attempting to retrieve the Coverage's Center Point */
+ char *sql;
+ sqlite3_stmt *stmt;
+ gaiaGeomCollPtr geom = NULL;
+ int ret;
+
+ sql = sqlite3_mprintf ("SELECT MakePoint("
+ "extent_minx + ((extent_maxx - extent_minx) / 2.0), "
+ "extent_miny + ((extent_maxy - extent_miny) / 2.0)) "
+ "FROM raster_coverages WHERE coverage_name = %Q",
+ coverage);
+ ret = sqlite3_prepare_v2 (sqlite, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ return NULL;
+
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 0);
+ int blob_sz = sqlite3_column_bytes (stmt, 0);
+ geom = gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ }
+ }
+ sqlite3_finalize (stmt);
+ return geom;
+}
+
+static int
+test_statistics (sqlite3 * sqlite, const char *coverage, int *retcode)
+{
+/* testing Coverage and Band statistics */
+ int ret;
+ char *err_msg = NULL;
+ char *sql;
+ char **results;
+ int rows;
+ int columns;
+ const char *string;
+ int intval;
+
+/* testing RasterStatistics */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_GetRasterStatistics_NoDataPixelsCount(statistics), "
+ "RL2_GetRasterStatistics_ValidPixelsCount(statistics), "
+ "RL2_GetRasterStatistics_SampleType(statistics), "
+ "RL2_GetRasterStatistics_BandsCount(statistics) "
+ "FROM raster_coverages WHERE Lower(coverage_name) = Lower(%Q)",
+ coverage);
+ ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &err_msg);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+ if (rows != 1 || columns != 4)
+ {
+ fprintf (stderr, "Unexpected error: bad result: %i/%i.\n", rows,
+ columns);
+ *retcode += -2;
+ return 0;
+ }
+
+/* NoData Pixels */
+ string = results[4];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (NoDataPixelsCount)\n");
+ *retcode += -3;
+ return 0;
+ }
+
+/* Valid Pixels */
+ string = results[5];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (ValidPixelsCount)\n");
+ *retcode += -5;
+ return 0;
+ }
+ intval = atoi (string);
+ if (intval != 719996)
+ {
+ fprintf (stderr, "Unexpected ValidPixelsCount: %d\n", intval);
+ *retcode += -6;
+ return 0;
+ }
+
+/* Sample Type */
+ string = results[6];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (SampleType)\n");
+ *retcode += -7;
+ return 0;
+ }
+ if (strcmp (string, "UINT16") != 0)
+ {
+ fprintf (stderr, "Unexpected SampleType: %s\n", string);
+ *retcode += -8;
+ return 0;
+ }
+
+/* Bands */
+ string = results[7];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (BandsCount)\n");
+ *retcode += -9;
+ return 0;
+ }
+ intval = atoi (string);
+ if (intval != 1)
+ {
+ fprintf (stderr, "Unexpected BandsCount: %d\n", intval);
+ *retcode += -10;
+ return 0;
+ }
+
+ sqlite3_free_table (results);
+
+/* testing BandStatistics */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_GetBandStatistics_Min(statistics, 0), "
+ "RL2_GetBandStatistics_Max(statistics, 0), "
+ "RL2_GetBandStatistics_Avg(statistics, 0), "
+ "RL2_GetBandStatistics_Var(statistics, 0), "
+ "RL2_GetBandStatistics_StdDev(statistics, 0) "
+ "FROM raster_coverages WHERE Lower(coverage_name) = Lower(%Q)",
+ coverage);
+ ret = sqlite3_get_table (sqlite, sql, &results, &rows, &columns, &err_msg);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+ if (rows != 1 || columns != 5)
+ {
+ fprintf (stderr, "Unexpected error: bad result: %i/%i.\n", rows,
+ columns);
+ *retcode += -2;
+ return 0;
+ }
+
+/* Min */
+ string = results[5];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (Band Min)\n");
+ *retcode += -12;
+ return 0;
+ }
+ intval = atoi (string);
+ if (intval != 6)
+ {
+ fprintf (stderr, "Unexpected Band Min: %d\n", intval);
+ *retcode += -13;
+ return 0;
+ }
+
+/* Max */
+ string = results[6];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (Band Max)\n");
+ *retcode += -14;
+ return 0;
+ }
+ intval = atoi (string);
+ if (intval != 1841)
+ {
+ fprintf (stderr, "Unexpected Band Max: %d\n", intval);
+ *retcode += -15;
+ return 0;
+ }
+
+/* Avg */
+ string = results[7];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (Band Avg)\n");
+ *retcode += -16;
+ return 0;
+ }
+ intval = atoi (string);
+ if (intval != 183)
+ {
+ fprintf (stderr, "Unexpected Band Avg: %d\n", intval);
+ *retcode += -17;
+ return 0;
+ }
+
+/* Var */
+ string = results[8];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (Band Var)\n");
+ *retcode += -18;
+ return 0;
+ }
+
+/* StdDev */
+ string = results[9];
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL (Band StdDev)\n");
+ *retcode += -20;
+ return 0;
+ }
+
+ sqlite3_free_table (results);
+
+ return 1;
+}
+
+static int
+test_coverage (sqlite3 * sqlite, unsigned char pixel, unsigned char compression,
+ int tile_sz, int *retcode)
+{
+/* testing some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ const char *sample_name;
+ const char *pixel_name;
+ unsigned char num_bands;
+ const char *compression_name;
+ int qlty;
+ int tile_size;
+ char *sql;
+ gaiaGeomCollPtr geom;
+
+/* setting the coverage name */
+ switch (pixel)
+ {
+ case RL2_PIXEL_GRAYSCALE:
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_none_256";
+ break;
+ case TILE_512:
+ coverage = "gray_none_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_zip_256";
+ break;
+ case TILE_512:
+ coverage = "gray_zip_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_zip_1024";
+ break;
+ };
+ break;
+ };
+ break;
+ };
+
+/* preparing misc Coverage's parameters */
+ sample_name = "UINT16";
+ pixel_name = "DATAGRID";
+ num_bands = 1;
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ compression_name = "NONE";
+ qlty = 100;
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ compression_name = "DEFLATE";
+ qlty = 100;
+ break;
+ };
+ switch (tile_sz)
+ {
+ case TILE_256:
+ tile_size = 256;
+ break;
+ case TILE_512:
+ tile_size = 512;
+ break;
+ case TILE_1024:
+ tile_size = 1024;
+ break;
+ };
+
+/* creating the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_CreateCoverage("
+ "%Q, %Q, %Q, %d, %Q, %d, %d, %d, %d, %1.2f, %1.2f)",
+ coverage, sample_name, pixel_name, num_bands,
+ compression_name, qlty, tile_size, tile_size, 32633,
+ 1.01, 1.01);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+/* loading from directory */
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_LoadRastersFromDir(%Q, %Q, %Q, 0, 32633, 0, 1)", coverage,
+ "map_samples/orbview3-trieste", ".tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRastersFromDir \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -2;
+ return 0;
+ }
+
+/* building the Pyramid Levels */
+ sql = sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, NULL, 0, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -3;
+ return 0;
+ }
+
+/* deleting the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_DeleteSection(%Q, %Q, 1)",
+ coverage, "trieste1");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DeleteSection \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -4;
+ return 0;
+ }
+
+/* re-loading yet again the first section */
+ sql = sqlite3_mprintf ("SELECT RL2_LoadRaster(%Q, %Q, 0, 32633, 0, 1)",
+ coverage,
+ "map_samples/orbview3-trieste/trieste1.tif");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "LoadRaster \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -5;
+ return 0;
+ }
+
+/* building the Pyramid Levels */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, %Q, 1, 1)", coverage,
+ "trieste2");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -6;
+ return 0;
+ }
+
+/* destroying the Pyramid Levels */
+ sql = sqlite3_mprintf ("SELECT RL2_DePyramidize(%Q, NULL, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DePyramidize \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -7;
+ return 0;
+ }
+
+/* building yet again the Pyramid Levels */
+ sql =
+ sqlite3_mprintf ("SELECT RL2_Pyramidize(%Q, %Q, 1, 1)", coverage,
+ "trieste2");
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Pyramidize \"%s\" error: %s\n", coverage, err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -8;
+ return 0;
+ }
+
+/* export tests */
+ geom = get_center_point (sqlite, coverage);
+ if (geom == NULL)
+ {
+ *retcode += -9;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 1))
+ {
+ *retcode += -10;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 2))
+ {
+ *retcode += -11;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 4))
+ {
+ *retcode += -12;
+ return 0;
+ }
+ if (!do_export_geotiff (sqlite, coverage, geom, 8))
+ {
+ *retcode += -13;
+ return 0;
+ }
+ gaiaFreeGeomColl (geom);
+
+/* testing GetTileImage() */
+ if (!do_export_tile_image (sqlite, coverage, 1))
+ {
+ *retcode += -23;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, 2))
+ {
+ *retcode += -24;
+ return 0;
+ }
+ if (!do_export_tile_image (sqlite, coverage, -1))
+ {
+ *retcode += -25;
+ return 0;
+ }
+
+ *retcode += -26;
+ if (!test_statistics (sqlite, coverage, retcode))
+ return 0;
+
+ return 1;
+}
+
+static int
+drop_coverage (sqlite3 * sqlite, unsigned char compression, int tile_sz,
+ int *retcode)
+{
+/* dropping some DBMS Coverage */
+ int ret;
+ char *err_msg = NULL;
+ const char *coverage;
+ char *sql;
+
+/* setting the coverage name */
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_none_256";
+ break;
+ case TILE_512:
+ coverage = "gray_none_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_none_1024";
+ break;
+ };
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ switch (tile_sz)
+ {
+ case TILE_256:
+ coverage = "gray_zip_256";
+ break;
+ case TILE_512:
+ coverage = "gray_zip_512";
+ break;
+ case TILE_1024:
+ coverage = "gray_zip_1024";
+ break;
+ };
+ break;
+ };
+
+/* dropping the DBMS Coverage */
+ sql = sqlite3_mprintf ("SELECT RL2_DropCoverage(%Q, 1)", coverage);
+ ret = execute_check (sqlite, sql);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "DropCoverage \"%s\" error: %s\n", coverage,
+ err_msg);
+ sqlite3_free (err_msg);
+ *retcode += -1;
+ return 0;
+ }
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+
+/* GRAYSCALE tests */
+ ret = -100;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -120;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -140;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -200;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_DEFLATE, TILE_256,
+ &ret))
+ return ret;
+ ret = -220;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_DEFLATE, TILE_512,
+ &ret))
+ return ret;
+ ret = -240;
+ if (!test_coverage
+ (db_handle, RL2_PIXEL_GRAYSCALE, RL2_COMPRESSION_DEFLATE, TILE_1024,
+ &ret))
+ return ret;
+
+/* dropping all GRAYSCALE Coverages */
+ ret = -170;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_256, &ret))
+ return ret;
+ ret = -180;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_512, &ret))
+ return ret;
+ ret = -190;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_NONE, TILE_1024, &ret))
+ return ret;
+ ret = -270;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_256, &ret))
+ return ret;
+ ret = -280;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_512, &ret))
+ return ret;
+ ret = -290;
+ if (!drop_coverage (db_handle, RL2_COMPRESSION_DEFLATE, TILE_1024, &ret))
+ return ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_mask.c b/test/test_mask.c
new file mode 100644
index 0000000..7364624
--- /dev/null
+++ b/test/test_mask.c
@@ -0,0 +1,1157 @@
+/*
+
+ test_mask.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+test_rgb_jpeg (const char *path, const char *mask_path)
+{
+ rl2RasterPtr rst;
+ rl2RasterPtr mask;
+ rl2SectionPtr mask_img;
+ unsigned int width;
+ unsigned int height;
+ unsigned int width2;
+ unsigned int height2;
+ unsigned char *rgbbuf;
+ int rgbbuf_sz;
+ unsigned char *mskbuf;
+ int mskbuf_sz;
+ unsigned char *buffer;
+ int buf_size;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ rl2PixelPtr pxl;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ int transparent;
+
+ rl2SectionPtr img = rl2_section_from_jpeg (path);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", path);
+ return 0;
+ }
+
+ mask_img = rl2_section_from_png (mask_path);
+ if (mask_img == NULL)
+ {
+ fprintf (stderr, "X Unable to read: %s\n", mask_path);
+ return 0;
+ }
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to get the raster: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_size (rst, &width, &height) != RL2_OK)
+ {
+ fprintf (stderr, "Invalid width/height: %s\n", path);
+ return 0;
+ }
+
+ mask = rl2_get_section_raster (mask_img);
+ if (mask == NULL)
+ {
+ fprintf (stderr, "Unable to get the raster: %s\n", mask_path);
+ return 0;
+ }
+
+ if (rl2_get_raster_size (mask, &width2, &height2) != RL2_OK)
+ {
+ fprintf (stderr, "Invalid width/height: %s\n", mask_path);
+ return 0;
+ }
+
+ if (width == width2 && height == height2)
+ ;
+ else
+ {
+ fprintf (stderr, "Mismatching width/height: %s %s\n", path,
+ mask_path);
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &rgbbuf, &rgbbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw buffer: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_raster_data_to_1bit (mask, &mskbuf, &mskbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw buffer: %s\n", mask_path);
+ return 0;
+ }
+
+ rl2_destroy_section (img);
+ rl2_destroy_section (mask_img);
+
+ rst = rl2_create_raster (width, height, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ rgbbuf, rgbbuf_sz, NULL, mskbuf, mskbuf_sz, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to create the output raster+mask\n");
+ return 0;
+ }
+
+ img =
+ rl2_create_section ("beta", RL2_COMPRESSION_JPEG,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create the output section+mask\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: masked_rgb.jpg\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (120 * width * 3) + (120 * 3);
+ if (*(p_data1 + 0) != 205 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 204)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #1: masked_rgb.jpg\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 196 || *(p_data2 + 1) != 194 || *(p_data2 + 2) != 197)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: masked_rgb.jpg\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: masked_rgb.jpg\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 205 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 204
+ || *(p_data1 + 3) != 0)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: masked_rgb.jpg\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 196 || *(p_data2 + 1) != 194 || *(p_data2 + 2) != 197
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: masked_rgb.jpg\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: masked_rgb.jpg\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 0 || *(p_data1 + 1) != 205 || *(p_data1 + 2) != 203
+ || *(p_data1 + 3) != 204)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: masked_rgb.jpg\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 196 || *(p_data2 + 2) != 194
+ || *(p_data2 + 3) != 197)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: masked_rgb.jpg\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: masked_rgb.jpg\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (120 * width * 3) + (120 * 3);
+ if (*(p_data1 + 0) != 204 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 205)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: masked_rgb.jpg\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 197 || *(p_data2 + 1) != 194 || *(p_data2 + 2) != 196)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: masked_rgb.jpg\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: masked_rgb.jpg\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+
+ if (*(p_data1 + 0) != 204 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 205
+ || *(p_data1 + 3) != 0)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: masked_rgb.jpg\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 197 || *(p_data2 + 1) != 194 || *(p_data2 + 2) != 196
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: masked_rgb.jpg\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr,
+ "Unable to create Pixel for Raster: masked_rgb.jpg\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: masked_rgb.jpg\n");
+ return 0;
+ }
+
+ rl2_get_pixel_sample_uint8 (pxl, RL2_RED_BAND, &red);
+ rl2_get_pixel_sample_uint8 (pxl, RL2_GREEN_BAND, &green);
+ rl2_get_pixel_sample_uint8 (pxl, RL2_BLUE_BAND, &blue);
+ rl2_is_pixel_transparent (pxl, &transparent);
+ if (red != 205 || green != 203 || blue != 204 || transparent != RL2_TRUE)
+ {
+ fprintf (stderr, "Unexpected pixel #1: masked_rgb.jpg\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: masked_rgb.jpg\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 120, 120) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (120,120) from Raster: masked_rgb.jpg\n");
+ return 0;
+ }
+
+ rl2_get_pixel_sample_uint8 (pxl, RL2_RED_BAND, &red);
+ rl2_get_pixel_sample_uint8 (pxl, RL2_GREEN_BAND, &green);
+ rl2_get_pixel_sample_uint8 (pxl, RL2_BLUE_BAND, &blue);
+ rl2_is_pixel_transparent (pxl, &transparent);
+ if (red != 196 || green != 194 || blue != 197 || transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected pixel #2: masked_rgb.jpg\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 120, 120) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: masked_rgb.jpg\n");
+ return 0;
+ }
+ rl2_destroy_pixel (pxl);
+
+ if (rl2_section_to_jpeg (img, "./masked_rgb.jpg", 80) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: masked_rgb.jpg\n");
+ return 0;
+ }
+ unlink ("./masked_rgb_20.jpg");
+
+ if (rl2_section_to_lossy_webp (img, "./masked_rgb_20.webp", 20) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: masked_rgb_20.webp\n");
+ return 0;
+ }
+ unlink ("./masked_rgb_20.webp");
+
+ if (rl2_section_to_lossless_webp (img, "./masked_rgb.webp") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: masked_rgb.webp\n");
+ return 0;
+ }
+ unlink ("./masked_rgb.webp");
+ unlink ("./masked_rgb.jpg");
+
+ rl2_destroy_section (img);
+ return 1;
+}
+
+static int
+test_gray_jpeg (const char *path, const char *mask_path)
+{
+ rl2RasterPtr rst;
+ rl2RasterPtr mask;
+ rl2SectionPtr mask_img;
+ unsigned int width;
+ unsigned int height;
+ unsigned int width2;
+ unsigned int height2;
+ unsigned char *graybuf;
+ int graybuf_sz;
+ unsigned char *mskbuf;
+ int mskbuf_sz;
+
+ rl2SectionPtr img = rl2_section_from_jpeg (path);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", path);
+ return 0;
+ }
+
+ mask_img = rl2_section_from_png (mask_path);
+ if (mask_img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", mask_path);
+ return 0;
+ }
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to get the raster: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_size (rst, &width, &height) != RL2_OK)
+ {
+ fprintf (stderr, "Invalid width/height: %s\n", path);
+ return 0;
+ }
+
+ mask = rl2_get_section_raster (mask_img);
+ if (mask == NULL)
+ {
+ fprintf (stderr, "Unable to get the raster: %s\n", mask_path);
+ return 0;
+ }
+
+ if (rl2_get_raster_size (mask, &width2, &height2) != RL2_OK)
+ {
+ fprintf (stderr, "Invalid width/height: %s\n", mask_path);
+ return 0;
+ }
+
+ if (width == width2 && height == height2)
+ ;
+ else
+ {
+ fprintf (stderr, "Mismatching width/height: %s %s\n", path,
+ mask_path);
+ return 0;
+ }
+
+ if (rl2_raster_data_to_uint8 (rst, &graybuf, &graybuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw buffer: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_raster_data_to_1bit (mask, &mskbuf, &mskbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw buffer: %s\n", mask_path);
+ return 0;
+ }
+
+ rl2_destroy_section (img);
+ rl2_destroy_section (mask_img);
+
+ rst =
+ rl2_create_raster (width, height, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE,
+ 1, graybuf, graybuf_sz, NULL, mskbuf, mskbuf_sz,
+ NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to create the output raster+mask\n");
+ return 0;
+ }
+
+ img =
+ rl2_create_section ("beta", RL2_COMPRESSION_JPEG,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create the output section+mask\n");
+ return 0;
+ }
+
+ if (rl2_section_to_jpeg (img, "./masked_gray.jpg", 80) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: masked_gray.jpg\n");
+ return 0;
+ }
+ unlink ("./masked_gray.jpg");
+
+ if (rl2_section_to_lossy_webp (img, "./masked_gray_20.webp", 20) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: masked_gray_20.webp\n");
+ return 0;
+ }
+ unlink ("./masked_gray_20.webp");
+
+ if (rl2_section_to_lossless_webp (img, "./masked_gray.webp") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: masked_gray.webp\n");
+ return 0;
+ }
+ unlink ("./masked_gray.webp");
+
+ rl2_destroy_section (img);
+ return 1;
+}
+
+static int
+test_rgb_png (const char *path, const char *mask_path)
+{
+ rl2RasterPtr rst;
+ rl2RasterPtr mask;
+ rl2SectionPtr mask_img;
+ unsigned int width;
+ unsigned int height;
+ unsigned int width2;
+ unsigned int height2;
+ unsigned char *rgbbuf;
+ int rgbbuf_sz;
+ unsigned char *mskbuf;
+ int mskbuf_sz;
+
+ rl2SectionPtr img = rl2_section_from_jpeg (path);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", path);
+ return 0;
+ }
+
+ mask_img = rl2_section_from_png (mask_path);
+ if (mask_img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", mask_path);
+ return 0;
+ }
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to get the raster: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_size (rst, &width, &height) != RL2_OK)
+ {
+ fprintf (stderr, "Invalid width/height: %s\n", path);
+ return 0;
+ }
+
+ mask = rl2_get_section_raster (mask_img);
+ if (mask == NULL)
+ {
+ fprintf (stderr, "Unable to get the raster: %s\n", mask_path);
+ return 0;
+ }
+
+ if (rl2_get_raster_size (mask, &width2, &height2) != RL2_OK)
+ {
+ fprintf (stderr, "Invalid width/height: %s\n", mask_path);
+ return 0;
+ }
+
+ if (width == width2 && height == height2)
+ ;
+ else
+ {
+ fprintf (stderr, "Mismatching width/height: %s %s\n", path,
+ mask_path);
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &rgbbuf, &rgbbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw buffer: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_raster_data_to_1bit (mask, &mskbuf, &mskbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw buffer: %s\n", mask_path);
+ return 0;
+ }
+
+ rl2_destroy_section (img);
+ rl2_destroy_section (mask_img);
+
+ rst = rl2_create_raster (width, height, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ rgbbuf, rgbbuf_sz, NULL, mskbuf, mskbuf_sz, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to create the output raster+mask\n");
+ return 0;
+ }
+
+ img =
+ rl2_create_section ("beta", RL2_COMPRESSION_PNG, RL2_TILESIZE_UNDEFINED,
+ RL2_TILESIZE_UNDEFINED, rst);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create the output section+mask\n");
+ return 0;
+ }
+
+ if (rl2_section_to_png (img, "./masked_rgb.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: masked_rgb.png\n");
+ return 0;
+ }
+
+ rl2_destroy_section (img);
+
+ img = rl2_section_from_png ("./masked_rgb.png");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./masked_rgb.png");
+ return 0;
+ }
+
+ if (rl2_section_to_png (img, "./from_masked_rgb.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_masked_rgb.png\n");
+ return 0;
+ }
+ unlink ("./from_masked_rgb.png");
+ unlink ("./masked_rgb.png");
+
+ rl2_destroy_section (img);
+ return 1;
+}
+
+static int
+test_gray_png (const char *path, const char *mask_path)
+{
+ rl2RasterPtr rst;
+ rl2RasterPtr mask;
+ rl2SectionPtr mask_img;
+ unsigned int width;
+ unsigned int height;
+ unsigned int width2;
+ unsigned int height2;
+ unsigned char *graybuf;
+ int graybuf_sz;
+ unsigned char *mskbuf;
+ int mskbuf_sz;
+ unsigned char *buffer;
+ int buf_size;
+ unsigned char *p_data1;
+ unsigned char *p_data2;
+ rl2PixelPtr pxl;
+ unsigned char gray;
+ int transparent;
+ unsigned char *blob_odd;
+ int blob_odd_sz;
+ unsigned char *blob_even;
+ int blob_even_sz;
+ rl2RasterStatisticsPtr stats;
+ rl2RasterStatisticsPtr cumul_stats;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned char xnum_bands;
+ double no_data;
+ double count;
+ double min;
+ double max;
+ double mean;
+ double variance;
+ double stddev;
+
+ rl2SectionPtr img = rl2_section_from_jpeg (path);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", path);
+ return 0;
+ }
+
+ mask_img = rl2_section_from_png (mask_path);
+ if (mask_img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", mask_path);
+ return 0;
+ }
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to get the raster: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_size (rst, &width, &height) != RL2_OK)
+ {
+ fprintf (stderr, "Invalid width/height: %s\n", path);
+ return 0;
+ }
+
+ mask = rl2_get_section_raster (mask_img);
+ if (mask == NULL)
+ {
+ fprintf (stderr, "Unable to get the raster: %s\n", mask_path);
+ return 0;
+ }
+
+ if (rl2_get_raster_size (mask, &width2, &height2) != RL2_OK)
+ {
+ fprintf (stderr, "Invalid width/height: %s\n", mask_path);
+ return 0;
+ }
+
+ if (width == width2 && height == height2)
+ ;
+ else
+ {
+ fprintf (stderr, "Mismatching width/height: %s %s\n", path,
+ mask_path);
+ return 0;
+ }
+
+ if (rl2_raster_data_to_uint8 (rst, &graybuf, &graybuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw buffer: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_raster_data_to_1bit (mask, &mskbuf, &mskbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw buffer: %s\n", mask_path);
+ return 0;
+ }
+
+ rl2_destroy_section (img);
+ rl2_destroy_section (mask_img);
+
+ rst =
+ rl2_create_raster (width, height, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE,
+ 1, graybuf, graybuf_sz, NULL, mskbuf, mskbuf_sz,
+ NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to create the output raster+mask\n");
+ return 0;
+ }
+
+ if (rl2_raster_encode
+ (rst, RL2_COMPRESSION_NONE, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, 1) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - uncompressed with mask\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_type (rst, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get the Raster Type\n");
+ return 0;
+ }
+ rl2_destroy_raster (rst);
+ cumul_stats = rl2_create_raster_statistics (sample_type, 0);
+ if (cumul_stats != NULL)
+ {
+ fprintf (stderr, "Unexpeted cumulative statistics 0 Bands\n");
+ return 0;
+ }
+ cumul_stats = rl2_create_raster_statistics (sample_type, num_bands);
+ if (cumul_stats == NULL)
+ {
+ fprintf (stderr, "Unable to create cumulative statistics\n");
+ return 0;
+ }
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics #1\n");
+ return 0;
+ }
+ if (rl2_aggregate_raster_statistics (stats, cumul_stats) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to aggregate Raster Statistics #1\n");
+ return 0;
+ }
+ rl2_destroy_raster_statistics (stats);
+
+ rst =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - uncompressed with mask\n");
+ return 0;
+ }
+ rl2_destroy_raster (rst);
+
+ rst =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - uncompressed with mask\n");
+ return 0;
+ }
+ rl2_destroy_raster (rst);
+
+ rst =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - uncompressed with mask\n");
+ return 0;
+ }
+ rl2_destroy_raster (rst);
+
+ rst =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - uncompressed with mask\n");
+ return 0;
+ }
+ free (blob_odd);
+ free (blob_even);
+
+ if (rl2_raster_encode
+ (rst, RL2_COMPRESSION_PNG, &blob_odd, &blob_odd_sz, &blob_even,
+ &blob_even_sz, 0, 1) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to Encode - PNG with mask\n");
+ return 0;
+ }
+ rl2_destroy_raster (rst);
+
+ stats =
+ rl2_get_raster_statistics (blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL, NULL);
+ if (stats == NULL)
+ {
+ fprintf (stderr, "Unable to get Raster Statistics #2\n");
+ return 0;
+ }
+ if (rl2_aggregate_raster_statistics (stats, cumul_stats) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to aggregate Raster Statistics #2\n");
+ return 0;
+ }
+ if (rl2_get_band_statistics (NULL, 0, &min, &max, &mean, &variance, &stddev)
+ != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected success on get Band Statistics (NULL)\n");
+ return 0;
+ }
+ if (rl2_get_band_statistics
+ (stats, 4, &min, &max, &mean, &variance, &stddev) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected success on get Band Statistics (band#4)\n");
+ return 0;
+ }
+ if (rl2_get_band_statistics
+ (stats, 0, &min, &max, &mean, &variance, &stddev) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Band Statistics #1\n");
+ return 0;
+ }
+ rl2_destroy_raster_statistics (stats);
+
+ if (rl2_get_raster_statistics_summary
+ (NULL, &no_data, &count, &sample_type, &xnum_bands) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected success on get Statistics Summary (NULL)\n");
+ return 0;
+ }
+ if (rl2_get_raster_statistics_summary
+ (cumul_stats, &no_data, &count, &sample_type, &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get a Statistics Summary\n");
+ return 0;
+ }
+ if (no_data != 269318.0)
+ {
+ fprintf (stderr, "Unexpected result - NO-DATA count: %1.1f\n",
+ no_data);
+ return 0;
+ }
+ if (count != 336670.0)
+ {
+ fprintf (stderr, "Unexpected result - Valid Pixels count: %1.1f\n",
+ count);
+ return 0;
+ }
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected result - Statistics Sample Type: %02x\n",
+ sample_type);
+ return 0;
+ }
+ if (num_bands != xnum_bands)
+ {
+ fprintf (stderr, "Unexpected result - Statistics # Bands: %02x\n",
+ xnum_bands);
+ return 0;
+ }
+
+ if (rl2_get_band_statistics
+ (cumul_stats, 0, &min, &max, &mean, &variance, &stddev) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Band Statistics #2\n");
+ return 0;
+ }
+ if (min != 47.0)
+ {
+ fprintf (stderr, "Unexpected result - Band #2 Min: %1.1f\n", min);
+ return 0;
+ }
+ if (max != 255.0)
+ {
+ fprintf (stderr, "Unexpected result - Band #2 Max: %1.1f\n", max);
+ return 0;
+ }
+ if (mean >= 171.4 && mean <= 171.5)
+ ;
+ else
+ {
+ fprintf (stderr, "Unexpected result - Band #2 Mean: %1.1f\n", mean);
+ return 0;
+ }
+ if (variance >= 1089.98 && variance <= 1089.99)
+ ;
+ else
+ {
+ fprintf (stderr, "Unexpected result - Band #2 Variance: %1.2f\n",
+ variance);
+ return 0;
+ }
+ if (stddev >= 33.01 && stddev <= 33.02)
+ ;
+ else
+ {
+ fprintf (stderr, "Unexpected result - Band #2 StdDeviation: %1.2f\n",
+ stddev);
+ return 0;
+ }
+ rl2_destroy_raster_statistics (cumul_stats);
+
+ rst =
+ rl2_raster_decode (RL2_SCALE_8, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:8 - PNG with mask\n");
+ return 0;
+ }
+ rl2_destroy_raster (rst);
+
+ rst =
+ rl2_raster_decode (RL2_SCALE_4, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:4 - PNG with mask\n");
+ return 0;
+ }
+ rl2_destroy_raster (rst);
+
+ rst =
+ rl2_raster_decode (RL2_SCALE_2, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:2 - PNG with mask\n");
+ return 0;
+ }
+ rl2_destroy_raster (rst);
+
+ rst =
+ rl2_raster_decode (RL2_SCALE_1, blob_odd, blob_odd_sz, blob_even,
+ blob_even_sz, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to Decode 1:1 - PNG with mask\n");
+ return 0;
+ }
+ free (blob_odd);
+ free (blob_even);
+
+ img =
+ rl2_create_section ("beta", RL2_COMPRESSION_PNG, RL2_TILESIZE_UNDEFINED,
+ RL2_TILESIZE_UNDEFINED, rst);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create the output section+mask\n");
+ return 0;
+ }
+
+ if (rl2_section_to_png (img, "./masked_gray.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: masked_gray.png\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGB data: from_gray_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (120 * width * 3) + (120 * 3);
+ if (*(p_data1 + 0) != 203 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 203)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 195 || *(p_data2 + 1) != 195 || *(p_data2 + 2) != 195)
+ {
+ fprintf (stderr, "Unexpected RGB pixel #2: from_gray_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: from_gray_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 203 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 203
+ || *(p_data1 + 3) != 0)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 195 || *(p_data2 + 1) != 195 || *(p_data2 + 2) != 195
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected RGBA pixel #2: from_rgb_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_ARGB (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ARGB data: from_gray_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 0 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 203
+ || *(p_data1 + 3) != 203)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 255 || *(p_data2 + 1) != 195 || *(p_data2 + 2) != 195
+ || *(p_data2 + 3) != 195)
+ {
+ fprintf (stderr, "Unexpected ARGB pixel #2: from_gray_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGR (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGR data: from_gray_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 3) + (20 * 3);
+ p_data2 = buffer + (120 * width * 3) + (120 * 3);
+ if (*(p_data1 + 0) != 203 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 203)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 195 || *(p_data2 + 1) != 195 || *(p_data2 + 2) != 195)
+ {
+ fprintf (stderr, "Unexpected BGR pixel #2: from_gray_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ if (rl2_raster_data_to_BGRA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BGRA data: from_gray_jpeg.png\n");
+ return 0;
+ }
+ p_data1 = buffer + (20 * width * 4) + (20 * 4);
+ p_data2 = buffer + (120 * width * 4) + (120 * 4);
+ if (*(p_data1 + 0) != 203 || *(p_data1 + 1) != 203 || *(p_data1 + 2) != 203
+ || *(p_data1 + 3) != 0)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+ if (*(p_data2 + 0) != 195 || *(p_data2 + 1) != 195 || *(p_data2 + 2) != 195
+ || *(p_data2 + 3) != 255)
+ {
+ fprintf (stderr, "Unexpected BGRA pixel #2: from_gray_jpeg.png\n");
+ return 0;
+ }
+ rl2_free (buffer);
+
+ pxl = rl2_create_raster_pixel (rst);
+ if (pxl == NULL)
+ {
+ fprintf (stderr,
+ "Unable to create Pixel for Raster: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (20,20) from Raster: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ rl2_get_pixel_sample_uint8 (pxl, RL2_GRAYSCALE_BAND, &gray);
+ rl2_is_pixel_transparent (pxl, &transparent);
+ if (gray != 203 || transparent != RL2_TRUE)
+ {
+ fprintf (stderr, "Unexpected pixel #1: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 20, 20) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (20,20) into Raster: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_get_raster_pixel (rst, pxl, 120, 120) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to get Pixel (120,120) from Raster: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ rl2_get_pixel_sample_uint8 (pxl, RL2_GRAYSCALE_BAND, &gray);
+ rl2_is_pixel_transparent (pxl, &transparent);
+ if (gray != 195 || transparent != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected pixel #2: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ if (rl2_set_raster_pixel (rst, pxl, 120, 120) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to set Pixel (1201,20) into Raster: from_gray_jpeg.png\n");
+ return 0;
+ }
+
+ rl2_destroy_pixel (pxl);
+
+ rl2_destroy_section (img);
+
+ img = rl2_section_from_png ("./masked_gray.png");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./masked_gray.png");
+ return 0;
+ }
+
+ if (rl2_section_to_png (img, "./from_masked_gray.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_masked_gray.png\n");
+ return 0;
+ }
+ unlink ("./from_masked_gray.png");
+ unlink ("./masked_gray.png");
+
+ rl2_destroy_section (img);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ if (!test_rgb_jpeg ("./jpeg1.jpg", "./mask1.png"))
+ return -1;
+
+ if (!test_gray_jpeg ("./jpeg2.jpg", "./mask1.png"))
+ return -2;
+
+ if (!test_rgb_png ("./jpeg1.jpg", "./mask1.png"))
+ return -3;
+
+ if (!test_gray_png ("./jpeg2.jpg", "./mask1.png"))
+ return -4;
+
+ return 0;
+}
diff --git a/test/test_paint.c b/test/test_paint.c
new file mode 100644
index 0000000..71eb1f5
--- /dev/null
+++ b/test/test_paint.c
@@ -0,0 +1,534 @@
+/*
+
+ test_paint.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2graphics.h"
+
+static int
+do_paint_test (rl2GraphicsContextPtr ctx)
+{
+ unsigned char *buffer;
+ int buf_size;
+ unsigned int width;
+ unsigned int height;
+ rl2GraphicsBitmapPtr bmp;
+ rl2GraphicsPatternPtr pattern;
+ rl2RasterPtr rst;
+ rl2SectionPtr img;
+ unsigned char *rgba;
+ unsigned char *p_rgba;
+ int row;
+ int col;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ unsigned char alpha;
+ rl2GraphicsFontPtr font;
+ double pre_x;
+ double pre_y;
+ double w;
+ double h;
+ double post_x;
+ double post_y;
+
+/* loading a sample Image (RGB) */
+ img = rl2_section_from_jpeg ("./jpeg1.jpg");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./jpeg1.jpg");
+ return -10;
+ }
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "\"%s\" invalid raster pointer\n", "./jpeg1.jpg");
+ return -11;
+ }
+ rl2_get_raster_size (rst, &width, &height);
+ if (width != 558)
+ {
+ fprintf (stderr, "\"%s\" unexpected raster width %d\n", "./jpeg1.jpg",
+ width);
+ return -12;
+ }
+ if (height != 543)
+ {
+ fprintf (stderr, "\"%s\" unexpected raster width %d\n", "./jpeg1.jpg",
+ height);
+ return -13;
+ }
+
+/* extracting RGBA data */
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: \"%s\"\n", "./jpeg1.jpg");
+ return -14;
+ }
+ rl2_destroy_section (img);
+
+/* creating a Graphics Bitmap */
+ bmp = rl2_graph_create_bitmap (buffer, width, height);
+ if (bmp == NULL)
+ {
+ fprintf (stderr, "Unable to create a Graphics Bitmap\n");
+ return -15;
+ }
+
+/* rendering the Bitmap */
+ if (!rl2_graph_draw_bitmap (ctx, bmp, 256, 256))
+ {
+ fprintf (stderr,
+ "Unable to render the Bitmap #1 into the Graphics backend\n");
+ return -16;
+ }
+ rl2_graph_destroy_bitmap (bmp);
+
+/* loading a sample Image (Grayscale) */
+ img = rl2_section_from_jpeg ("./jpeg2.jpg");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./jpeg2.jpg");
+ return -17;
+ }
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "\"%s\" invalid raster pointer\n", "./jpeg2.jpg");
+ return -18;
+ }
+ rl2_get_raster_size (rst, &width, &height);
+ if (width != 558)
+ {
+ fprintf (stderr, "\"%s\" unexpected raster width %d\n", "./jpeg2.jpg",
+ width);
+ return -19;
+ }
+ if (height != 543)
+ {
+ fprintf (stderr, "\"%s\" unexpected raster width %d\n", "./jpeg2.jpg",
+ height);
+ return -20;
+ }
+
+/* extracting RGBA data */
+ if (rl2_raster_data_to_RGBA (rst, &buffer, &buf_size) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RGBA data: \"%s\"\n", "./jpeg2.jpg");
+ return -21;
+ }
+ rl2_destroy_section (img);
+
+/* creating a Graphics Bitmap */
+ bmp = rl2_graph_create_bitmap (buffer, width, height);
+ if (bmp == NULL)
+ {
+ fprintf (stderr, "Unable to create a Graphics Bitmap\n");
+ return -22;
+ }
+
+/* rendering the Bitmap */
+ if (!rl2_graph_draw_bitmap (ctx, bmp, 700, 600))
+ {
+ fprintf (stderr,
+ "Unable to render the Bitmap #2 into the Graphics backend\n");
+ return -23;
+ }
+ rl2_graph_destroy_bitmap (bmp);
+
+/* setting up a RED dotted pen */
+ if (!rl2_graph_set_pen (ctx, 255, 0, 0, 255, 8.0, RL2_PENSTYLE_DOT))
+ {
+ fprintf (stderr, "Unable to set a Red Dotted Pen\n");
+ return -24;
+ }
+
+/* setting up a Green solid semi-transparent Brush */
+ if (!rl2_graph_set_brush (ctx, 0, 255, 0, 128))
+ {
+ fprintf (stderr, "Unable to set a Green semi-transparent Brush\n");
+ return -25;
+ }
+
+/* drawing a rectangle */
+ if (!rl2_graph_draw_rectangle (ctx, 650, 500, 200, 200))
+ {
+ fprintf (stderr, "Unable to draw a rectangle\n");
+ return -26;
+ }
+
+/* drawing a rounded rectangle */
+ if (!rl2_graph_draw_rounded_rectangle (ctx, 650, 950, 300, 100, 30))
+ {
+ fprintf (stderr, "Unable to draw a rounded rectangle\n");
+ return -27;
+ }
+
+/* setting up a Black solid pen */
+ if (!rl2_graph_set_pen (ctx, 0, 0, 0, 255, 2.0, RL2_PENSTYLE_SOLID))
+ {
+ fprintf (stderr, "Unable to set a Black solid Pen\n");
+ return -28;
+ }
+
+/* setting up a Yellow/Blue linear gradient Brush */
+ if (!rl2_graph_set_linear_gradient_brush
+ (ctx, 1024, 1500, 200, 100, 255, 255, 0, 255, 0, 0, 255, 255))
+ {
+ fprintf (stderr,
+ "Unable to set a Yellow/Blue linear gradient Brush\n");
+ return -29;
+ }
+
+/* drawing an Ellipse */
+ if (!rl2_graph_draw_ellipse (ctx, 1024, 1500, 200, 100))
+ {
+ fprintf (stderr, "Unable to draw an ellipse\n");
+ return -30;
+ }
+
+/* setting up a Yellow/Red linear gradient Brush */
+ if (!rl2_graph_set_linear_gradient_brush
+ (ctx, 1500, 1500, 200, 200, 255, 255, 0, 255, 255, 0, 0, 255))
+ {
+ fprintf (stderr,
+ "Unable to set a Yellow/Red linear gradient Brush\n");
+ return -31;
+ }
+
+/* drawing a Circular Sector */
+ if (!rl2_graph_draw_circle_sector (ctx, 1500, 1500, 100, 270, 180))
+ {
+ fprintf (stderr, "Unable to draw a circular sector\n");
+ return -32;
+ }
+
+/* setting up a Red solid pen */
+ if (!rl2_graph_set_pen (ctx, 255, 0, 0, 255, 16.0, RL2_PENSTYLE_SOLID))
+ {
+ fprintf (stderr, "Unable to set a Red solid Pen\n");
+ return -33;
+ }
+
+/* creating an RGBA buffer */
+ rgba = malloc (64 * 64 * 4);
+ p_rgba = rgba;
+ for (row = 0; row < 64; row++)
+ {
+ for (col = 0; col < 64; col++)
+ {
+ if (row >= 32)
+ {
+ if (col >= 32)
+ {
+ red = 0;
+ green = 255;
+ blue = 0;
+ alpha = 128;
+ }
+ else
+ {
+ red = 0;
+ green = 255;
+ blue = 255;
+ alpha = 255;
+ }
+ }
+ else
+ {
+ if (col >= 32)
+ {
+ red = 0;
+ green = 0;
+ blue = 0;
+ alpha = 0;
+ }
+ else
+ {
+ red = 255;
+ green = 255;
+ blue = 0;
+ alpha = 255;
+ }
+ }
+ *p_rgba++ = red;
+ *p_rgba++ = green;
+ *p_rgba++ = blue;
+ *p_rgba++ = alpha;
+ }
+ }
+
+/* creating and setting up a pattern brush */
+ pattern = rl2_graph_create_pattern (rgba, 64, 64);
+ if (pattern == NULL)
+ {
+ fprintf (stderr, "Unable to create a Pattern Brush\n");
+ return -34;
+ }
+ if (!rl2_graph_set_pattern_brush (ctx, pattern))
+ {
+ fprintf (stderr, "Unable to set up a pattern brush\n");
+ return -35;
+ }
+ if (!rl2_graph_stroke_line (ctx, 300, 300, 600, 600))
+ {
+ fprintf (stderr, "Unable to stroke a line\n");
+ return -36;
+ }
+
+/* arbitrary path */
+ if (!rl2_graph_move_to_point (ctx, 50, 1400))
+ {
+ fprintf (stderr, "Unable to move to point\n");
+ return -37;
+ }
+ if (!rl2_graph_add_line_to_path (ctx, 250, 1250))
+ {
+ fprintf (stderr, "Unable to move to point #1\n");
+ return -38;
+ }
+ if (!rl2_graph_add_line_to_path (ctx, 500, 1400))
+ {
+ fprintf (stderr, "Unable to move to point #2\n");
+ return -39;
+ }
+ if (!rl2_graph_add_line_to_path (ctx, 750, 1250))
+ {
+ fprintf (stderr, "Unable to move to point #3\n");
+ return -40;
+ }
+ if (!rl2_graph_add_line_to_path (ctx, 1000, 1400))
+ {
+ fprintf (stderr, "Unable to move to point #4\n");
+ return -41;
+ }
+ if (!rl2_graph_add_line_to_path (ctx, 1000, 1500))
+ {
+ fprintf (stderr, "Unable to move to point #4\n");
+ return -42;
+ }
+ if (!rl2_graph_add_line_to_path (ctx, 50, 1500))
+ {
+ fprintf (stderr, "Unable to move to point #5\n");
+ return -43;
+ }
+ if (!rl2_graph_close_subpath (ctx))
+ {
+ fprintf (stderr, "Unable to close a sub-path\n");
+ return -44;
+ }
+ if (!rl2_graph_fill_path (ctx, 1))
+ {
+ fprintf (stderr, "Unable to fill a path\n");
+ return -45;
+ }
+ if (!rl2_graph_stroke_path (ctx, 0))
+ {
+ fprintf (stderr, "Unable to stroke a path\n");
+ return -46;
+ }
+
+ rl2_graph_destroy_pattern (pattern);
+
+/* creating and setting up a Green bold italic font */
+ font =
+ rl2_graph_create_font (32, RL2_FONTSTYLE_ITALIC, RL2_FONTWEIGHT_BOLD);
+ if (pattern == NULL)
+ {
+ fprintf (stderr, "Unable to create a Font\n");
+ return -47;
+ }
+ if (!rl2_graph_font_set_color (font, 0, 255, 0, 255))
+ {
+ fprintf (stderr, "Unable to set the font color\n");
+ return -48;
+ }
+ if (!rl2_graph_set_font (ctx, font))
+ {
+ fprintf (stderr, "Unable to set up a font\n");
+ return -49;
+ }
+ if (!rl2_graph_draw_text (ctx, "Armageddon", 1000, 100, 120))
+ {
+ fprintf (stderr, "Unable to print text #1\n");
+ return -50;
+ }
+ rl2_graph_destroy_font (font);
+
+/* creating and setting up a Black outlined font */
+ font =
+ rl2_graph_create_font (32, RL2_FONTSTYLE_NORMAL, RL2_FONTWEIGHT_BOLD);
+ if (pattern == NULL)
+ {
+ fprintf (stderr, "Unable to create a Font #2\n");
+ return -51;
+ }
+ if (!rl2_graph_font_set_color (font, 0, 0, 0, 255))
+ {
+ fprintf (stderr, "Unable to set the font color #2\n");
+ return -52;
+ }
+ if (!rl2_graph_font_set_outline (font, 1.5))
+ {
+ fprintf (stderr, "Unable to set the font outline\n");
+ return -53;
+ }
+ if (!rl2_graph_set_font (ctx, font))
+ {
+ fprintf (stderr, "Unable to set up a font #2\n");
+ return -54;
+ }
+ if (!rl2_graph_draw_text (ctx, "Walhalla", 300, 400, 0))
+ {
+ fprintf (stderr, "Unable to print text #2\n");
+ return -55;
+ }
+ if (!rl2_graph_get_text_extent
+ (ctx, "Walhalla", &pre_x, &pre_y, &w, &h, &post_x, &post_y))
+ {
+ fprintf (stderr, "Unable to measure text\n");
+ return -56;
+ }
+
+ rl2_graph_destroy_font (font);
+
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2GraphicsContextPtr svg;
+ rl2GraphicsContextPtr pdf;
+ rl2GraphicsContextPtr ctx;
+ rl2RasterPtr rst;
+ rl2SectionPtr img;
+ int ret;
+ unsigned char *rgb;
+ unsigned char *alpha;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+/* testing the SVG backend */
+ svg = rl2_graph_create_svg_context ("./test_paint.svg", 2048, 2048);
+ if (svg == NULL)
+ {
+ fprintf (stderr, "Unable to create an SVG backend\n");
+ return -1;
+ }
+ ret = do_paint_test (svg);
+ if (ret < 0)
+ return ret;
+ rl2_graph_destroy_context (svg);
+ unlink ("./test_paint.svg");
+
+/* testing the PDF backend */
+ pdf =
+ rl2_graph_create_pdf_context ("./test_paint.pdf", 300, 11.7, 8.3, 1.0,
+ 1.0);
+ if (pdf == NULL)
+ {
+ fprintf (stderr, "Unable to create a PDF backend\n");
+ return -2;
+ }
+ ret = do_paint_test (pdf);
+ if (ret < 0)
+ return ret;
+ rl2_graph_destroy_context (pdf);
+ unlink ("./test_paint.pdf");
+
+/* testing an ordinary graphics backend */
+ ctx = rl2_graph_create_context (2048, 2048);
+ if (ctx == NULL)
+ {
+ fprintf (stderr, "Unable to create an ordinary graphics backend\n");
+ return -3;
+ }
+ ret = do_paint_test (ctx);
+ if (ret < 0)
+ return ret;
+ rgb = rl2_graph_get_context_rgb_array (ctx);
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "invalid RGB buffer from Graphics Context\n");
+ return -4;
+ }
+ alpha = rl2_graph_get_context_alpha_array (ctx);
+ if (alpha == NULL)
+ {
+ fprintf (stderr, "invalid Alpha buffer from Graphics Context\n");
+ return -5;
+ }
+ free (alpha);
+ rl2_graph_destroy_context (ctx);
+
+/* exporting a PNG image */
+ rst = rl2_create_raster (2048, 2048, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ rgb, 2048 * 2048 * 3, NULL, NULL, 0, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to create the output raster+mask\n");
+ return -6;
+ }
+ img =
+ rl2_create_section ("beta", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create the output section+mask\n");
+ return -7;
+ }
+ if (rl2_section_to_png (img, "./test_paint.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: test_paint.png\n");
+ return -8;
+ }
+ rl2_destroy_section (img);
+ unlink ("./test_paint.png");
+
+ return 0;
+}
diff --git a/test/test_palette.c b/test/test_palette.c
new file mode 100644
index 0000000..8e33459
--- /dev/null
+++ b/test/test_palette.c
@@ -0,0 +1,813 @@
+/*
+
+ test_palette.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+rl2PalettePtr
+create_monochrome_palette ()
+{
+/* creating a MONOCHROME palette */
+ rl2PalettePtr palette = rl2_create_palette (2);
+ rl2_set_palette_color (palette, 0, 255, 255, 255);
+ rl2_set_palette_color (palette, 1, 0, 0, 0);
+ return palette;
+}
+
+rl2PalettePtr
+create_gray4_palette ()
+{
+/* creating a GRAY-4 palette */
+ rl2PalettePtr palette = rl2_create_palette (4);
+ rl2_set_palette_color (palette, 0, 0, 0, 0);
+ rl2_set_palette_color (palette, 1, 86, 86, 86);
+ rl2_set_palette_color (palette, 2, 170, 170, 170);
+ rl2_set_palette_color (palette, 3, 255, 255, 255);
+ return palette;
+}
+
+rl2PalettePtr
+create_gray16_palette ()
+{
+/* creating a GRAY-16 palette */
+ rl2PalettePtr palette = rl2_create_palette (16);
+ rl2_set_palette_color (palette, 0, 0, 0, 0);
+ rl2_set_palette_color (palette, 1, 17, 17, 17);
+ rl2_set_palette_color (palette, 2, 34, 34, 34);
+ rl2_set_palette_color (palette, 3, 51, 51, 51);
+ rl2_set_palette_color (palette, 4, 68, 68, 68);
+ rl2_set_palette_color (palette, 5, 85, 85, 85);
+ rl2_set_palette_color (palette, 6, 102, 102, 102);
+ rl2_set_palette_color (palette, 7, 119, 119, 119);
+ rl2_set_palette_color (palette, 8, 137, 137, 137);
+ rl2_set_palette_color (palette, 9, 154, 154, 154);
+ rl2_set_palette_color (palette, 10, 171, 171, 171);
+ rl2_set_palette_color (palette, 11, 188, 188, 188);
+ rl2_set_palette_color (palette, 12, 205, 205, 205);
+ rl2_set_palette_color (palette, 13, 222, 222, 222);
+ rl2_set_palette_color (palette, 14, 239, 239, 239);
+ rl2_set_palette_color (palette, 15, 255, 255, 255);
+ return palette;
+}
+
+rl2PalettePtr
+create_gray256_palette ()
+{
+/* creating a GRAY-256 palette */
+ int i;
+ rl2PalettePtr palette = rl2_create_palette (256);
+ for (i = 0; i < 256; i++)
+ rl2_set_palette_color (palette, i, i, i, i);
+ return palette;
+}
+
+rl2PalettePtr
+create_bicolor_palette ()
+{
+/* creating a BICOLOR palette */
+ rl2PalettePtr palette = rl2_create_palette (2);
+ rl2_set_palette_color (palette, 0, 255, 0, 255);
+ rl2_set_palette_color (palette, 1, 255, 0, 255);
+ return palette;
+}
+
+rl2PalettePtr
+create_rgb4_palette ()
+{
+/* creating an RGB-4 palette */
+ rl2PalettePtr palette = rl2_create_palette (4);
+ rl2_set_palette_color (palette, 0, 255, 0, 0);
+ rl2_set_palette_color (palette, 1, 255, 86, 86);
+ rl2_set_palette_color (palette, 2, 255, 170, 170);
+ rl2_set_palette_color (palette, 3, 255, 255, 255);
+ return palette;
+}
+
+rl2PalettePtr
+create_rgb16_palette ()
+{
+/* creating an RGB-16 palette */
+ rl2PalettePtr palette = rl2_create_palette (16);
+ rl2_set_palette_color (palette, 0, 255, 0, 0);
+ rl2_set_palette_color (palette, 1, 255, 17, 17);
+ rl2_set_palette_color (palette, 2, 255, 34, 34);
+ rl2_set_palette_color (palette, 3, 255, 51, 51);
+ rl2_set_palette_color (palette, 4, 68, 255, 68);
+ rl2_set_palette_color (palette, 5, 85, 255, 85);
+ rl2_set_palette_color (palette, 6, 102, 255, 102);
+ rl2_set_palette_color (palette, 7, 119, 255, 119);
+ rl2_set_palette_color (palette, 8, 137, 255, 137);
+ rl2_set_palette_color (palette, 9, 154, 255, 154);
+ rl2_set_palette_color (palette, 10, 171, 171, 255);
+ rl2_set_palette_color (palette, 11, 188, 188, 255);
+ rl2_set_palette_color (palette, 12, 205, 205, 255);
+ rl2_set_palette_color (palette, 13, 222, 222, 255);
+ rl2_set_palette_color (palette, 14, 239, 239, 255);
+ rl2_set_palette_color (palette, 15, 255, 255, 255);
+ return palette;
+}
+
+rl2PalettePtr
+create_rgb256_palette ()
+{
+/* creating an RGB-256 palette */
+ int i;
+ rl2PalettePtr palette = rl2_create_palette (256);
+ for (i = 0; i < 256; i++)
+ rl2_set_palette_color (palette, i, 255 - i, i, 128);
+ return palette;
+}
+
+static int
+test_sql_palette (unsigned char *blob, int blob_size, unsigned char *blob2,
+ int blob_size2, int *retcode)
+{
+ int ret;
+ sqlite3 *db_handle;
+ const char *sql;
+ sqlite3_stmt *stmt;
+ unsigned char *blob3 = NULL;
+ int blob_size3;
+ void *cache = spatialite_alloc_connection ();
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return 0;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+
+ sql = "SELECT RL2_GetPaletteNumEntries(?), RL2_GetPaletteNumEntries(?), "
+ "RL2_GetPaletteColorEntry(?, 0), RL2_GetPaletteColorEntry(?, 0), "
+ "RL2_SetPaletteColorEntry(?, 123, '#c000ff'), RL2_PaletteEquals(?, ?), "
+ "RL2_PaletteEquals(?, ?)";
+ ret = sqlite3_prepare_v2 (db_handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "ERROR: SQL palette stmt #1\n");
+ *retcode -= 1;
+ return 0;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_blob (stmt, 1, blob, blob_size, SQLITE_STATIC);
+ sqlite3_bind_blob (stmt, 2, blob2, blob_size2, SQLITE_STATIC);
+ sqlite3_bind_blob (stmt, 3, blob, blob_size, SQLITE_STATIC);
+ sqlite3_bind_blob (stmt, 4, blob2, blob_size2, SQLITE_STATIC);
+ sqlite3_bind_blob (stmt, 5, blob, blob_size, SQLITE_STATIC);
+ sqlite3_bind_blob (stmt, 6, blob, blob_size, SQLITE_STATIC);
+ sqlite3_bind_blob (stmt, 7, blob2, blob_size2, SQLITE_STATIC);
+ sqlite3_bind_blob (stmt, 8, blob, blob_size, SQLITE_STATIC);
+ sqlite3_bind_blob (stmt, 9, blob, blob_size, SQLITE_STATIC);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) != SQLITE_INTEGER)
+ {
+ fprintf (stderr,
+ "ERROR: invalid Palette NumEntries #1\n");
+ *retcode -= 2;
+ goto error;
+ }
+ if (sqlite3_column_int (stmt, 0) != 256)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected Palette NumEntries #1: %d\n",
+ sqlite3_column_int (stmt, 0));
+ *retcode -= 3;
+ goto error;
+ }
+ if (sqlite3_column_type (stmt, 1) != SQLITE_INTEGER)
+ {
+ fprintf (stderr,
+ "ERROR: invalid Palette NumEntries #2\n");
+ *retcode -= 4;
+ goto error;
+ }
+ if (sqlite3_column_int (stmt, 1) != 2)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected Palette NumEntries #2: %d\n",
+ sqlite3_column_int (stmt, 1));
+ *retcode -= 5;
+ goto error;
+ }
+ if (sqlite3_column_type (stmt, 2) != SQLITE_TEXT)
+ {
+ fprintf (stderr,
+ "ERROR: invalid Palette ColorEntry #1\n");
+ *retcode -= 6;
+ goto error;
+ }
+ if (strcmp
+ ("#000000",
+ (const char *) sqlite3_column_text (stmt, 2)) != 0)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected Palette ColorEntry #1: %s\n",
+ sqlite3_column_text (stmt, 2));
+ *retcode -= 7;
+ goto error;
+ }
+ if (sqlite3_column_type (stmt, 3) != SQLITE_TEXT)
+ {
+ fprintf (stderr,
+ "ERROR: invalid Palette ColorEntry #2\n");
+ *retcode -= 8;
+ goto error;
+ }
+ if (strcmp
+ ("#ffffff",
+ (const char *) sqlite3_column_text (stmt, 3)) != 0)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected Palette ColorEntry #2: %s\n",
+ sqlite3_column_text (stmt, 3));
+ *retcode -= 9;
+ goto error;
+ }
+ if (sqlite3_column_type (stmt, 4) != SQLITE_BLOB)
+ {
+ fprintf (stderr, "ERROR: invalid Palette SetColor\n");
+ *retcode -= 10;
+ goto error;
+ }
+ blob_size3 = sqlite3_column_bytes (stmt, 4);
+ blob3 = malloc (blob_size3);
+ memcpy (blob3, sqlite3_column_blob (stmt, 4), blob_size3);
+ if (sqlite3_column_type (stmt, 5) != SQLITE_INTEGER)
+ {
+ fprintf (stderr, "ERROR: invalid Palette Equals #1\n");
+ *retcode -= 11;
+ goto error;
+ }
+ if (sqlite3_column_int (stmt, 5) != 0)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected Palette Equals #1: %d\n",
+ sqlite3_column_int (stmt, 5));
+ *retcode -= 12;
+ goto error;
+ }
+ if (sqlite3_column_type (stmt, 6) != SQLITE_INTEGER)
+ {
+ fprintf (stderr, "ERROR: invalid Palette Equals #2\n");
+ *retcode -= 13;
+ goto error;
+ }
+ if (sqlite3_column_int (stmt, 6) != 1)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected Palette Equals #2: %d\n",
+ sqlite3_column_int (stmt, 7));
+ *retcode -= 14;
+ goto error;
+ }
+ }
+ else
+ {
+ fprintf (stderr, "ERROR: SQL palette step #1\n");
+ *retcode -= 15;
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+
+ sql = "SELECT RL2_PaletteEquals(?, ?)";
+ ret = sqlite3_prepare_v2 (db_handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "ERROR: SQL palette stmt #2\n");
+ *retcode -= 16;
+ return 0;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_blob (stmt, 1, blob, blob_size, SQLITE_STATIC);
+ sqlite3_bind_blob (stmt, 2, blob3, blob_size3, SQLITE_STATIC);
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) != SQLITE_INTEGER)
+ {
+ fprintf (stderr, "ERROR: invalid Palette Equals #3\n");
+ *retcode -= 17;
+ goto error;
+ }
+ if (sqlite3_column_int (stmt, 0) != 0)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected Palette Equals #3: %d\n",
+ sqlite3_column_int (stmt, 7));
+ *retcode -= 18;
+ goto error;
+ }
+ }
+ else
+ {
+ fprintf (stderr, "ERROR: SQL palette step #2\n");
+ *retcode -= 19;
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ free (blob);
+ free (blob2);
+ if (blob3 != NULL)
+ free (blob3);
+ return 1;
+
+ error:
+ sqlite3_finalize (stmt);
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ free (blob);
+ free (blob2);
+ if (blob3 != NULL)
+ free (blob3);
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2PalettePtr palette;
+ rl2PalettePtr plt2;
+ unsigned short num_entries;
+ unsigned char *r;
+ unsigned char *g;
+ unsigned char *b;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char *blob;
+ int blob_size;
+ unsigned char *blob2;
+ int blob_size2;
+ int retcode;
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+ if (rl2_create_palette (-1) != NULL)
+ {
+ fprintf (stderr, "Unexpected valid palette - negative # entries\n");
+ return -1;
+ }
+
+ palette = rl2_create_palette (0);
+ if (palette == NULL)
+ {
+ fprintf (stderr, "Unexpected invalid palette - ZERO # entries\n");
+ return -2;
+ }
+ rl2_destroy_palette (palette);
+ if (rl2_create_palette (257) != NULL)
+ {
+ fprintf (stderr, "Unexpected valid palette - 257 # entries\n");
+ return -3;
+ }
+
+ palette = rl2_create_palette (2);
+ if (palette == NULL)
+ {
+ fprintf (stderr, "Unable to create a valid palette\n");
+ return -4;
+ }
+
+ if (rl2_set_palette_color (palette, 0, 0, 0, 0) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set palette color #0\n");
+ return -5;
+ }
+
+ if (rl2_set_palette_hexrgb (palette, 1, "#aBcDeF") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set palette color #1\n");
+ return -6;
+ }
+
+ if (rl2_get_palette_entries (palette, &num_entries) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get palette # entries\n");
+ return -7;
+ }
+
+ if (num_entries != 2)
+ {
+ fprintf (stderr, "Unexpected palette # entries\n");
+ return -8;
+ }
+
+ if (rl2_get_palette_colors (palette, &num_entries, &r, &g, &b) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to retrieve palette colors\n");
+ return -9;
+ }
+ if (num_entries != 2)
+ {
+ fprintf (stderr, "Unexpected palette # colors\n");
+ return -10;
+ }
+ if (*(r + 0) != 0 || *(g + 0) != 0 || *(b + 0) != 0)
+ {
+ fprintf (stderr, "Mismatching color #0\n");
+ return -11;
+ }
+ if (*(r + 1) != 0xab || *(g + 1) != 0xcd || *(b + 1) != 0xef)
+ {
+ fprintf (stderr, "Mismatching color #1\n");
+ return -11;
+ }
+ rl2_free (r);
+ rl2_free (g);
+ rl2_free (b);
+ if (rl2_set_palette_color (NULL, 0, 0, 0, 0) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL palette set color\n");
+ return -12;
+ }
+
+ if (rl2_set_palette_color (palette, -1, 0, 0, 0) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: palette set color (negative index)\n");
+ return -13;
+ }
+
+ if (rl2_set_palette_color (palette, 2, 0, 0, 0) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: palette set color (exceeding index)\n");
+ return -14;
+ }
+
+ if (rl2_set_palette_hexrgb (NULL, 1, "#aBcDeF") != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set palette HEX color\n");
+ return -15;
+ }
+
+ if (rl2_set_palette_hexrgb (palette, -1, "#aBcDeF") != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unable to set palette HEX color (negative index)\n");
+ return -16;
+ }
+
+ if (rl2_set_palette_hexrgb (palette, 2, "#aBcDeF") != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unable to set palette HEX color (exceeding index)\n");
+ return -17;
+ }
+
+ if (rl2_set_palette_hexrgb (palette, 1, "aBcDeF") != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set palette color - invalid-hex #1\n");
+ return -18;
+ }
+
+ if (rl2_set_palette_hexrgb (palette, 1, "aBcDeF#") != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set palette color - invalid-hex #2\n");
+ return -19;
+ }
+
+ if (rl2_set_palette_hexrgb (palette, 1, "#zBcDeF") != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set palette color - invalid-hex #3\n");
+ return -20;
+ }
+
+ if (rl2_set_palette_hexrgb (palette, 1, "#aBcDeZ") != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set palette color - invalid-hex #4\n");
+ return -21;
+ }
+
+ if (rl2_set_palette_hexrgb (palette, 1, "#aBcGef") != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set palette color - invalid-hex #5\n");
+ return -22;
+ }
+
+ if (rl2_set_palette_hexrgb (palette, 1, NULL) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set palette color - NULL-hex\n");
+ return -23;
+ }
+
+ rl2_destroy_palette (palette);
+ rl2_destroy_palette (NULL);
+ if (rl2_get_palette_entries (NULL, &num_entries) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL palette # entries\n");
+ return -24;
+ }
+
+ if (rl2_get_palette_colors (NULL, &num_entries, &r, &g, &b) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL palette - get colors\n");
+ return -25;
+ }
+
+ palette = create_rgb256_palette ();
+ if (rl2_get_palette_type (palette, &sample_type, &pixel_type) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to get the Palette type - 256-RGB\n");
+ return -26;
+ }
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr,
+ "ERROR: palette 256-RGB - unexpected sample type %02x\n",
+ sample_type);
+ return -27;
+ }
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr,
+ "ERROR: palette 256-RGB - unexpected pixel type %02x\n",
+ pixel_type);
+ return -27;
+ }
+ rl2_destroy_palette (palette);
+ palette = create_rgb16_palette ();
+ if (rl2_get_palette_type (palette, &sample_type, &pixel_type) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to get the Palette type - 16-RGB\n");
+ return -28;
+ }
+ if (sample_type != RL2_SAMPLE_4_BIT)
+ {
+ fprintf (stderr,
+ "ERROR: palette 16-RGB - unexpected sample type %02x\n",
+ sample_type);
+ return -29;
+ }
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr,
+ "ERROR: palette 16-RGB - unexpected pixel type %02x\n",
+ pixel_type);
+ return -30;
+ }
+ rl2_destroy_palette (palette);
+ palette = create_rgb4_palette ();
+ if (rl2_get_palette_type (palette, &sample_type, &pixel_type) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to get the Palette type - 4-RGB\n");
+ return -31;
+ }
+ if (sample_type != RL2_SAMPLE_2_BIT)
+ {
+ fprintf (stderr,
+ "ERROR: palette 4-RGB - unexpected sample type %02x\n",
+ sample_type);
+ return -32;
+ }
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr,
+ "ERROR: palette 4-RGB - unexpected pixel type %02x\n",
+ pixel_type);
+ return -33;
+ }
+ rl2_destroy_palette (palette);
+ palette = create_bicolor_palette ();
+ if (rl2_get_palette_type (palette, &sample_type, &pixel_type) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to get the Palette type - BICOLOR\n");
+ return -34;
+ }
+ if (sample_type != RL2_SAMPLE_1_BIT)
+ {
+ fprintf (stderr,
+ "ERROR: palette BICOLOR - unexpected sample type %02x\n",
+ sample_type);
+ return -35;
+ }
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr,
+ "ERROR: palette BICOLOR - unexpected pixel type %02x\n",
+ pixel_type);
+ return -36;
+ }
+ rl2_destroy_palette (palette);
+ palette = create_gray256_palette ();
+ if (rl2_get_palette_type (palette, &sample_type, &pixel_type) != RL2_OK)
+ {
+ fprintf (stderr,
+ "ERROR: unable to get the Palette type - 256-GRAY\n");
+ return -37;
+ }
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr,
+ "ERROR: palette 256-GRAY - unexpected sample type %02x\n",
+ sample_type);
+ return -38;
+ }
+ if (pixel_type != RL2_PIXEL_GRAYSCALE)
+ {
+ fprintf (stderr,
+ "ERROR: palette 256-GRAY - unexpected pixel type %02x\n",
+ pixel_type);
+ return -39;
+ }
+ rl2_destroy_palette (palette);
+ palette = create_gray16_palette ();
+ if (rl2_get_palette_type (palette, &sample_type, &pixel_type) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to get the Palette type - 16-GRAY\n");
+ return -40;
+ }
+ if (sample_type != RL2_SAMPLE_4_BIT)
+ {
+ fprintf (stderr,
+ "ERROR: palette 16-GRAY - unexpected sample type %02x\n",
+ sample_type);
+ return -41;
+ }
+ if (pixel_type != RL2_PIXEL_GRAYSCALE)
+ {
+ fprintf (stderr,
+ "ERROR: palette 16-GRAY - unexpected pixel type %02x\n",
+ pixel_type);
+ return -42;
+ }
+ rl2_destroy_palette (palette);
+ palette = create_gray4_palette ();
+ if (rl2_get_palette_type (palette, &sample_type, &pixel_type) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to get the Palette type - 4-GRAY\n");
+ return -43;
+ }
+ if (sample_type != RL2_SAMPLE_2_BIT)
+ {
+ fprintf (stderr,
+ "ERROR: palette 4-GRAY - unexpected sample type %02x\n",
+ sample_type);
+ return -44;
+ }
+ if (pixel_type != RL2_PIXEL_GRAYSCALE)
+ {
+ fprintf (stderr,
+ "ERROR: palette 4-GRAY - unexpected pixel type %02x\n",
+ pixel_type);
+ return -45;
+ }
+ rl2_destroy_palette (palette);
+ palette = create_monochrome_palette ();
+ if (rl2_get_palette_type (palette, &sample_type, &pixel_type) != RL2_OK)
+ {
+ fprintf (stderr,
+ "ERROR: unable to get the Palette type - MONOCHROME\n");
+ return -46;
+ }
+ if (sample_type != RL2_SAMPLE_1_BIT)
+ {
+ fprintf (stderr,
+ "ERROR: palette MONOCHROME - unexpected sample type %02x\n",
+ sample_type);
+ return -47;
+ }
+ if (pixel_type != RL2_PIXEL_MONOCHROME)
+ {
+ fprintf (stderr,
+ "ERROR: palette MONOCHROME - unexpected pixel type %02x\n",
+ pixel_type);
+ return -48;
+ }
+ if (rl2_serialize_dbms_palette (palette, &blob, &blob_size) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unable to serialize a palette\n");
+ return -49;
+ }
+ rl2_destroy_palette (palette);
+ palette = rl2_deserialize_dbms_palette (blob, blob_size);
+ free (blob);
+ if (palette == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to deserialize a palette\n");
+ return -50;
+ }
+ plt2 = rl2_clone_palette (palette);
+ rl2_destroy_palette (palette);
+ if (plt2 == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to clone a palette\n");
+ return 51;
+ }
+ if (rl2_serialize_dbms_palette (NULL, &blob, &blob_size) == RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unexpected NULL palette serialization\n");
+ return -53;
+ }
+ if (rl2_deserialize_dbms_palette (NULL, blob_size) != NULL)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected palette deserialization from NULL BLOB\n");
+ return -54;
+ }
+ if (rl2_deserialize_dbms_palette (blob, 0) != NULL)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected palette deserialization from zero-length BLOB\n");
+ return -55;
+ }
+ if (rl2_clone_palette (NULL) != NULL)
+ {
+ fprintf (stderr, "ERROR: unexpected cloned NULL palette\n");
+ return -56;
+ }
+
+ palette = create_gray256_palette ();
+ if (palette == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to create a palette\n");
+ return -57;
+ }
+ if (rl2_serialize_dbms_palette (palette, &blob, &blob_size) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unexpected NULL palette serialization\n");
+ return -58;
+ }
+ rl2_destroy_palette (palette);
+ palette = create_monochrome_palette ();
+ if (palette == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to create a palette\n");
+ return -59;
+ }
+ if (rl2_serialize_dbms_palette (palette, &blob2, &blob_size2) != RL2_OK)
+ {
+ fprintf (stderr, "ERROR: unexpected NULL palette serialization\n");
+ return -60;
+ }
+ rl2_destroy_palette (palette);
+ retcode = -61;
+ if (!test_sql_palette (blob, blob_size, blob2, blob_size2, &retcode))
+ return retcode;
+ return 0;
+}
diff --git a/test/test_raster.c b/test/test_raster.c
new file mode 100644
index 0000000..849191e
--- /dev/null
+++ b/test/test_raster.c
@@ -0,0 +1,1862 @@
+/*
+
+ test_raster.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <memory.h>
+#include <float.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static rl2PalettePtr
+build_palette (int num)
+{
+ int i;
+ rl2PalettePtr plt = rl2_create_palette (num);
+ for (i = 0; i < num; i++)
+ rl2_set_palette_color (plt, i, 255 - i, 255 - i, 255 - i);
+ return plt;
+}
+
+int
+main (int argc, char *argv[])
+{
+ rl2PalettePtr palette;
+ rl2RasterPtr raster;
+ rl2PixelPtr no_data;
+ rl2PixelPtr pixel;
+ rl2SectionPtr img;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ unsigned int width;
+ unsigned int height;
+ int srid;
+ double minX;
+ double minY;
+ double maxX;
+ double maxY;
+ double hResolution;
+ double vResolution;
+ unsigned char sample;
+ unsigned char *mask;
+ gaiaGeomCollPtr geom = NULL;
+ unsigned char *bufpix = malloc (256 * 256);
+ memset (bufpix, 255, 256 * 256);
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+
+ if (rl2_create_raster (0, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 0 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid raster - ZERO width\n");
+ return -1;
+ }
+
+ if (rl2_create_raster (256, 0, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 0, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid raster - ZERO height\n");
+ return -2;
+ }
+
+ if (rl2_create_raster (256, 256, 0xff, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid raster - invalid sample\n");
+ return -3;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, 0xff, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid raster - invalid pixel\n");
+ return -4;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ NULL, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid raster - NULL pixmap\n");
+ return -5;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 255 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Invalid raster - mismatching pixmap size\n");
+ return -6;
+ }
+
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRAYSCALE/256\n");
+ return -7;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type GRAYSCALE/256r\n");
+ return -8;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected raster sample GRAYSCALE/256r\n");
+ return -9;
+ }
+
+ if (pixel_type != RL2_PIXEL_GRAYSCALE)
+ {
+ fprintf (stderr, "Unexpected raster pixel GRAYSCALE/256\n");
+ return -10;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands GRAYSCALE/256\n");
+ return -11;
+ }
+
+ if (rl2_get_raster_size (raster, &width, &height) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster size\n");
+ return -12;
+ }
+
+ if (width != 256)
+ {
+ fprintf (stderr, "Unexpected raster tile width\n");
+ return -13;
+ }
+
+ if (height != 256)
+ {
+ fprintf (stderr, "Unexpected raster tile height\n");
+ return -14;
+ }
+
+ if (rl2_raster_georeference_center (raster, 4326, 0.5, 0.5, 11.5, 42.5) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to georeference a raster (Center point)\n");
+ return -15;
+ }
+
+ if (rl2_get_raster_srid (raster, &srid) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster SRID\n");
+ return -16;
+ }
+
+ if (srid != 4326)
+ {
+ fprintf (stderr, "Unexpected raster SRID\n");
+ return -17;
+ }
+
+ if (rl2_get_raster_extent (raster, &minX, &minY, &maxX, &maxY) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster extent (Center point)\n");
+ return -18;
+ }
+
+ if (minX != -52.5)
+ {
+ fprintf (stderr, "Unexpected raster MinX (Center point)\n");
+ return -19;
+ }
+
+ if (minY != -21.5)
+ {
+ fprintf (stderr, "Unexpected raster MinY (Center point)\n");
+ return -20;
+ }
+
+ if (maxX != 75.5)
+ {
+ fprintf (stderr, "Unexpected raster MaxX (Center point)\n");
+ return -21;
+ }
+
+ if (maxY != 106.5)
+ {
+ fprintf (stderr, "Unexpected raster MaxY (Center point)\n");
+ return -22;
+ }
+
+ geom = rl2_get_raster_bbox (raster);
+ if (geom == NULL)
+ {
+ fprintf (stderr, "Unable to get raster BBOX (Center point)\n");
+ return -250;
+ }
+ gaiaFreeGeomColl (geom);
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (256 * 256);
+ memset (bufpix, 0, 256 * 256);
+ memset (bufpix + (256 * 128), 1, 256);
+ memset (bufpix + (256 * 129), 1, 256);
+ memset (bufpix + (256 * 130), 1, 256);
+ memset (bufpix + (256 * 131), 1, 256);
+ memset (bufpix + (256 * 136), 1, 256);
+ memset (bufpix + (256 * 137), 1, 256);
+ memset (bufpix + (256 * 138), 1, 256);
+ memset (bufpix + (256 * 139), 1, 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a MONOCHROME raster\n");
+ return -23;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster sample MONOCHROME\n");
+ return -24;
+ }
+
+ if (sample_type != RL2_SAMPLE_1_BIT)
+ {
+ fprintf (stderr, "Unexpected raster sample MONOCHROME\n");
+ return -25;
+ }
+
+ if (pixel_type != RL2_PIXEL_MONOCHROME)
+ {
+ fprintf (stderr, "Unexpected raster pixel MONOCHROME\n");
+ return -26;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands MONOCHROME\n");
+ return -27;
+ }
+
+ if (rl2_raster_georeference_upper_left
+ (raster, 4326, 0.5, 0.5, -52.5, 106.5) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to georeference a raster (UpperLeft corner)\n");
+ return -28;
+ }
+
+ if (rl2_get_raster_extent (raster, &minX, &minY, &maxX, &maxY) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster extent (UpperLeft corner)\n");
+ return -29;
+ }
+
+ if (minX != -52.5)
+ {
+ fprintf (stderr, "Unexpected raster MinX (UpperLeft corner)\n");
+ return -30;
+ }
+
+ if (minY != -21.5)
+ {
+ fprintf (stderr, "Unexpected raster MinY (UpperLeft corner)\n");
+ return -31;
+ }
+
+ if (maxX != 75.5)
+ {
+ fprintf (stderr, "Unexpected raster MaxX (UpperLeft corner)\n");
+ return -32;
+ }
+
+ if (maxY != 106.5)
+ {
+ fprintf (stderr, "Unexpected raster MaxY (UpperLeft corner)\n");
+ return -33;
+ }
+
+ img = rl2_create_section ("mono", RL2_COMPRESSION_NONE, 256, 256, raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create a Monochrome image\n");
+ return -34;
+ }
+ if (rl2_section_to_gif (img, "./raster_mono.gif") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: raster_mono.gif\n");
+ return -35;
+ }
+ unlink ("./raster_mono.gif");
+
+ if (rl2_section_to_png (img, "./raster_mono.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: raster_mono.png\n");
+ return -36;
+ }
+ unlink ("./raster_mono.png");
+
+ if (rl2_section_to_jpeg (img, "./raster_mono.jpg", 60) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: raster_mono.jpg\n");
+ return -37;
+ }
+ unlink ("./raster_mono.jpg");
+
+ rl2_destroy_section (img);
+
+ bufpix = malloc (256 * 256);
+ memset (bufpix, 3, 256 * 256);
+ memset (bufpix + (256 * 120), 2, 256);
+ memset (bufpix + (256 * 121), 2, 256);
+ memset (bufpix + (256 * 122), 2, 256);
+ memset (bufpix + (256 * 123), 2, 256);
+ memset (bufpix + (256 * 124), 1, 256);
+ memset (bufpix + (256 * 125), 1, 256);
+ memset (bufpix + (256 * 126), 1, 256);
+ memset (bufpix + (256 * 127), 1, 256);
+ memset (bufpix + (256 * 128), 0, 256);
+ memset (bufpix + (256 * 129), 0, 256);
+ memset (bufpix + (256 * 130), 0, 256);
+ memset (bufpix + (256 * 131), 0, 256);
+ memset (bufpix + (256 * 132), 1, 256);
+ memset (bufpix + (256 * 133), 1, 256);
+ memset (bufpix + (256 * 134), 1, 256);
+ memset (bufpix + (256 * 135), 1, 256);
+ memset (bufpix + (256 * 136), 2, 256);
+ memset (bufpix + (256 * 137), 2, 256);
+ memset (bufpix + (256 * 138), 2, 256);
+ memset (bufpix + (256 * 139), 2, 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_2_BIT, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRAYSCALE/4 raster\n");
+ return -38;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster sample GRAYSCALE/4\n");
+ return -39;
+ }
+
+ if (sample_type != RL2_SAMPLE_2_BIT)
+ {
+ fprintf (stderr, "Unexpected raster sample GRAYSCALE/4\n");
+ return -40;
+ }
+
+ if (pixel_type != RL2_PIXEL_GRAYSCALE)
+ {
+ fprintf (stderr, "Unexpected raster pixel GRAYSCALE/4\n");
+ return -41;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands GRAYSCALE/4\n");
+ return -42;
+ }
+
+ if (rl2_raster_georeference_lower_left
+ (raster, 4326, 0.5, 0.5, -52.5, -21.5) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to georeference a raster (LowerLeft corner)\n");
+ return -43;
+ }
+
+ if (rl2_get_raster_extent (raster, &minX, &minY, &maxX, &maxY) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster extent (LowerLeft corner)\n");
+ return -44;
+ }
+
+ if (minX != -52.5)
+ {
+ fprintf (stderr, "Unexpected raster MinX (LowerLeft corner)\n");
+ return -45;
+ }
+
+ if (minY != -21.5)
+ {
+ fprintf (stderr, "Unexpected raster MinY (LowerLeft corner)\n");
+ return -46;
+ }
+
+ if (maxX != 75.5)
+ {
+ fprintf (stderr, "Unexpected raster MaxX (LowerLeft corner)\n");
+ return -47;
+ }
+
+ if (maxY != 106.5)
+ {
+ fprintf (stderr, "Unexpected raster MaxY (LowerLeft corner)\n");
+ return -48;
+ }
+
+ img = rl2_create_section ("gray4", RL2_COMPRESSION_NONE, 256, 256, raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to creat a Grayscale/4 image\n");
+ return -49;
+ }
+
+ if (rl2_section_to_gif (img, "./raster_gray4.gif") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: raster_gray4.gif\n");
+ return -50;
+ }
+ unlink ("./raster_gray4.gif");
+
+ if (rl2_section_to_png (img, "./raster_gray4.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: raster_gray4.png\n");
+ return -51;
+ }
+ unlink ("./raster_gray4.png");
+
+ if (rl2_section_to_jpeg (img, "./raster_gray4.jpg", 60) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: raster_gray4.jpg\n");
+ return -52;
+ }
+ unlink ("./raster_gray4.jpg");
+
+ rl2_destroy_section (img);
+
+ bufpix = malloc (256 * 256);
+ memset (bufpix, 15, 256 * 256);
+ memset (bufpix + (256 * 120), 0, 256);
+ memset (bufpix + (256 * 122), 0, 256);
+ memset (bufpix + (256 * 123), 1, 256);
+ memset (bufpix + (256 * 124), 2, 256);
+ memset (bufpix + (256 * 125), 3, 256);
+ memset (bufpix + (256 * 126), 4, 256);
+ memset (bufpix + (256 * 127), 5, 256);
+ memset (bufpix + (256 * 128), 6, 256);
+ memset (bufpix + (256 * 129), 7, 256);
+ memset (bufpix + (256 * 130), 8, 256);
+ memset (bufpix + (256 * 131), 9, 256);
+ memset (bufpix + (256 * 132), 10, 256);
+ memset (bufpix + (256 * 133), 10, 256);
+ memset (bufpix + (256 * 134), 12, 256);
+ memset (bufpix + (256 * 135), 13, 256);
+ memset (bufpix + (256 * 136), 14, 256);
+ memset (bufpix + (256 * 137), 15, 256);
+ memset (bufpix + (256 * 139), 0, 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_4_BIT, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRAYSCALE/16 raster\n");
+ return -53;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type GRAYSCALE/16\n");
+ return -54;
+ }
+
+ if (sample_type != RL2_SAMPLE_4_BIT)
+ {
+ fprintf (stderr, "Unexpected raster sample GRAYSCALE/16\n");
+ return -55;
+ }
+
+ if (pixel_type != RL2_PIXEL_GRAYSCALE)
+ {
+ fprintf (stderr, "Unexpected raster pixel GRAYSCALE/16\n");
+ return -56;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands GRAYSCALE/16\n");
+ return -57;
+ }
+
+ if (rl2_raster_georeference_lower_right
+ (raster, 4326, 0.5, 0.5, 75.5, -21.5) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to georeference a raster (LowerRight corner)\n");
+ return -58;
+ }
+
+ if (rl2_get_raster_extent (raster, &minX, &minY, &maxX, &maxY) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster extent (LowerRight corner)\n");
+ return -59;
+ }
+
+ if (minX != -52.5)
+ {
+ fprintf (stderr, "Unexpected raster MinX (LowerRight corner)\n");
+ return -60;
+ }
+
+ if (minY != -21.5)
+ {
+ fprintf (stderr, "Unexpected raster MinY (LowerRight corner)\n");
+ return -61;
+ }
+
+ if (maxX != 75.5)
+ {
+ fprintf (stderr, "Unexpected raster MaxX (LowerRight corner)\n");
+ return -62;
+ }
+
+ if (maxY != 106.5)
+ {
+ fprintf (stderr, "Unexpected raster MaxY (LowerRight corner)\n");
+ return -63;
+ }
+
+ img = rl2_create_section ("gray16", RL2_COMPRESSION_NONE, 256, 256, raster);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to creat a Grayscale/16 image\n");
+ return -64;
+ }
+
+ if (rl2_section_to_gif (img, "./raster_gray16.gif") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: raster_gray16.gif\n");
+ return -65;
+ }
+ unlink ("./raster_gray16.gif");
+
+ if (rl2_section_to_png (img, "./raster_gray16.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: raster_gray16.png\n");
+ return -66;
+ }
+ unlink ("./raster_gray16.png");
+
+ if (rl2_section_to_jpeg (img, "./raster_gray16.jpg", 60) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: raster_gray16.jpg\n");
+ return -67;
+ }
+ unlink ("./raster_gray16.jpg");
+
+ rl2_destroy_section (img);
+
+ bufpix = malloc (3 * 256 * 256);
+ memset (bufpix, 255, 3 * 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ bufpix, 3 * 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a RGB raster\n");
+ return -68;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type RGB\n");
+ return -69;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected raster sample RGB\n");
+ return -70;
+ }
+
+ if (pixel_type != RL2_PIXEL_RGB)
+ {
+ fprintf (stderr, "Unexpected raster pixel RGB\n");
+ return -71;
+ }
+
+ if (num_bands != 3)
+ {
+ fprintf (stderr, "Unexpected raster # bands RGB\n");
+ return -72;
+ }
+
+ if (rl2_raster_georeference_upper_right
+ (raster, 4326, 0.5, 0.5, 75.5, 106.5) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to georeference a raster (UpperRight corner)\n");
+ return -73;
+ }
+
+ if (rl2_get_raster_extent (raster, &minX, &minY, &maxX, &maxY) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster extent (UpperRight corner)\n");
+ return -74;
+ }
+
+ if (minX != -52.5)
+ {
+ fprintf (stderr, "Unexpected raster MinX (UpperRight corner)\n");
+ return -75;
+ }
+
+ if (minY != -21.5)
+ {
+ fprintf (stderr, "Unexpected raster MinY (UpperRight corner)\n");
+ return -76;
+ }
+
+ if (maxX != 75.5)
+ {
+ fprintf (stderr, "Unexpected raster MaxX (UpperRight corner)\n");
+ return -77;
+ }
+
+ if (maxY != 106.5)
+ {
+ fprintf (stderr, "Unexpected raster MaxY (UpperRight corner)\n");
+ return -78;
+ }
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (2 * 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT16, RL2_PIXEL_DATAGRID, 1,
+ bufpix, 2 * 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRID/U16 raster\n");
+ return -79;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type GRID/U16\n");
+ return -80;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT16)
+ {
+ fprintf (stderr, "Unexpected raster sample GRID/U16\n");
+ return -81;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected raster pixel GRID/U16\n");
+ return -82;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands GRID/U16\n");
+ return -83;
+ }
+
+ if (rl2_raster_georeference_frame (raster, 4326, -52.5, -21.5, 75.5, 106.5)
+ != RL2_OK)
+ {
+ fprintf (stderr, "Unable to georeference a raster (frame)\n");
+ return -84;
+ }
+
+ if (rl2_raster_georeference_frame (raster, 4326, 82.5, -21.5, 75.5, 106.5)
+ != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected: georeference a raster (invalid frame)\n");
+ return -85;
+ }
+
+ if (rl2_raster_georeference_frame (raster, 4326, -52.5, 121.5, 75.5, 106.5)
+ != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected: georeference a raster (invalid frame)\n");
+ return -86;
+ }
+
+ if (rl2_get_raster_resolution (raster, &hResolution, &vResolution) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster resolution (frame)\n");
+ return -87;
+ }
+
+ if (hResolution != 0.5)
+ {
+ fprintf (stderr, "Unexpected raster horizontal resolution (frame)\n");
+ return -88;
+ }
+
+ if (vResolution != 0.5)
+ {
+ fprintf (stderr, "Unexpected raster vertical resolution (frame)\n");
+ return -89;
+ }
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (4 * 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_INT32, RL2_PIXEL_DATAGRID, 1,
+ bufpix, 4 * 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRID/32 raster\n");
+ return -90;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type GRID/32\n");
+ return -91;
+ }
+
+ if (sample_type != RL2_SAMPLE_INT32)
+ {
+ fprintf (stderr, "Unexpected raster sample GRID/32\n");
+ return -92;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected raster pixel GRID/32\n");
+ return -93;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands GRID/32\n");
+ return -94;
+ }
+
+ if (rl2_get_raster_resolution (raster, &hResolution, &vResolution) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected raster resolution (GRID/32)\n");
+ return -95;
+ }
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (2 * 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_INT16, RL2_PIXEL_DATAGRID, 1,
+ bufpix, 2 * 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRID/16 raster\n");
+ return -96;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type GRID/16\n");
+ return -97;
+ }
+
+ if (sample_type != RL2_SAMPLE_INT16)
+ {
+ fprintf (stderr, "Unexpected raster sample GRID/16\n");
+ return -98;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected raster pixel GRID/16\n");
+ return -99;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands GRID/16\n");
+ return -100;
+ }
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_INT8, RL2_PIXEL_DATAGRID, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRID/8 raster\n");
+ return -101;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type GRID/8\n");
+ return -102;
+ }
+
+ if (sample_type != RL2_SAMPLE_INT8)
+ {
+ fprintf (stderr, "Unexpected raster sample GRID/8\n");
+ return -103;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected raster pixel GRID/8\n");
+ return -104;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands GRID/8\n");
+ return -105;
+ }
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRID/U8 raster\n");
+ return -106;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type GRID/U8\n");
+ return -107;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected raster sample GRID/U8\n");
+ return -108;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected raster pixel GRID/U8\n");
+ return -109;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands GRID/U8\n");
+ return -110;
+ }
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (4 * 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT32, RL2_PIXEL_DATAGRID, 1,
+ bufpix, 4 * 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRID/U32 raster\n");
+ return -111;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type GRID/U32\n");
+ return -112;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT32)
+ {
+ fprintf (stderr, "Unexpected raster sample GRID/U32\n");
+ return -113;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected raster pixel GRID/U32\n");
+ return -114;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands GRID/U32\n");
+ return -115;
+ }
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (4 * 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_FLOAT, RL2_PIXEL_DATAGRID, 1,
+ bufpix, 4 * 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRID/FLT raster\n");
+ return -116;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type GRID/FLT\n");
+ return -117;
+ }
+
+ if (sample_type != RL2_SAMPLE_FLOAT)
+ {
+ fprintf (stderr, "Unexpected raster sample GRID/FLT\n");
+ return -118;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected raster pixel GRID/FLT\n");
+ return -119;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands GRID/FLT\n");
+ return -120;
+ }
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (8 * 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_DOUBLE, RL2_PIXEL_DATAGRID, 1,
+ bufpix, 8 * 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRID/DBL raster\n");
+ return -121;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type GRID/DBL\n");
+ return -122;
+ }
+
+ if (sample_type != RL2_SAMPLE_DOUBLE)
+ {
+ fprintf (stderr, "Unexpected raster sample GRID/DBL\n");
+ return -123;
+ }
+
+ if (pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected raster pixel GRID/DBL\n");
+ return -124;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands GRID/DBL\n");
+ return -125;
+ }
+ rl2_destroy_raster (raster);
+
+ palette = build_palette (2);
+ bufpix = malloc (256 * 256);
+ memset (bufpix, 1, 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_1_BIT, RL2_PIXEL_PALETTE, 1,
+ bufpix, 256 * 256, palette, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a PALETTE/1 raster\n");
+ return -126;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type PALETTE/1\n");
+ return -127;
+ }
+
+ if (sample_type != RL2_SAMPLE_1_BIT)
+ {
+ fprintf (stderr, "Unexpected raster sample PALETTE/1\n");
+ return -128;
+ }
+
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr, "Unexpected raster pixel PALETTE/1\n");
+ return -129;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands PALETTE/1\n");
+ return -130;
+ }
+ rl2_destroy_raster (raster);
+
+ palette = build_palette (4);
+ bufpix = malloc (256 * 256);
+ memset (bufpix, 3, 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_2_BIT, RL2_PIXEL_PALETTE, 1,
+ bufpix, 256 * 256, palette, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a PALETTE/2 raster\n");
+ return -131;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type PALETTE/2\n");
+ return -132;
+ }
+
+ if (sample_type != RL2_SAMPLE_2_BIT)
+ {
+ fprintf (stderr, "Unexpected raster sample PALETTE/2\n");
+ return -133;
+ }
+
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr, "Unexpected raster pixel PALETTE/2\n");
+ return -134;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands PALETTE/2\n");
+ return -135;
+ }
+ rl2_destroy_raster (raster);
+
+ palette = build_palette (16);
+ bufpix = malloc (256 * 256);
+ memset (bufpix, 15, 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_4_BIT, RL2_PIXEL_PALETTE, 1,
+ bufpix, 256 * 256, palette, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a PALETTE/4 raster\n");
+ return -136;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type PALETTE/4\n");
+ return -137;
+ }
+
+ if (sample_type != RL2_SAMPLE_4_BIT)
+ {
+ fprintf (stderr, "Unexpected raster sample PALETTE/4\n");
+ return -138;
+ }
+
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr, "Unexpected raster pixel PALETTE/4\n");
+ return -139;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands PALETTE/4\n");
+ return -140;
+ }
+ rl2_destroy_raster (raster);
+
+ palette = build_palette (256);
+ bufpix = malloc (256 * 256);
+ memset (bufpix, 255, 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_PALETTE, 1,
+ bufpix, 256 * 256, palette, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a PALETTE/8 raster\n");
+ return -141;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type PALETTE/8\n");
+ return -142;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected raster sample PALETTE/8\n");
+ return -143;
+ }
+
+ if (pixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr, "Unexpected raster pixel PALETTE/8\n");
+ return -144;
+ }
+
+ if (num_bands != 1)
+ {
+ fprintf (stderr, "Unexpected raster # bands PALETTE/8\n");
+ return -145;
+ }
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (5 * 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 5,
+ bufpix, 5 * 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a MULTIBAND/5 raster\n");
+ return -146;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type MULTIBAND/5\n");
+ return -147;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected raster sample MULTIBAND/5\n");
+ return -148;
+ }
+
+ if (pixel_type != RL2_PIXEL_MULTIBAND)
+ {
+ fprintf (stderr, "Unexpected raster pixel MULTIBAND/5\n");
+ return -149;
+ }
+
+ if (num_bands != 5)
+ {
+ fprintf (stderr, "Unexpected raster # bands MULTIBAND/5\n");
+ return -150;
+ }
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (6 * 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT16, RL2_PIXEL_MULTIBAND, 3,
+ bufpix, 6 * 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a MULTIBAND/16 raster\n");
+ return -151;
+ }
+
+ if (rl2_get_raster_type (raster, &sample_type, &pixel_type, &num_bands) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raster type MULTIBAND/16\n");
+ return -152;
+ }
+
+ if (sample_type != RL2_SAMPLE_UINT16)
+ {
+ fprintf (stderr, "Unexpected raster sample MULTIBAND/16\n");
+ return -153;
+ }
+
+ if (pixel_type != RL2_PIXEL_MULTIBAND)
+ {
+ fprintf (stderr, "Unexpected raster pixel MULTIBAND/16\n");
+ return -154;
+ }
+
+ if (num_bands != 3)
+ {
+ fprintf (stderr, "Unexpected raster # bands MULTIBAND/16\n");
+ return -155;
+ }
+ rl2_destroy_raster (raster);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel\n");
+ return -156;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_RED_BAND, 0) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Red NoData #1\n");
+ return -157;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, 255) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Green NoData #1\n");
+ return -158;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, 0) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Blue NoData #1\n");
+ return -159;
+ }
+
+ bufpix = malloc (256 * 256 * 3);
+ memset (bufpix, 255, 256 * 256 * 3);
+
+ raster = rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ bufpix, 256 * 256 * 3, NULL, NULL, 0, no_data);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a valid raster\n");
+ return -160;
+ }
+
+ no_data = rl2_get_raster_no_data (raster);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to get NoData from raster #1\n");
+ return -161;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_RED_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RED NoData from raster #1\n");
+ return -162;
+ }
+
+ if (sample != 0)
+ {
+ fprintf (stderr, "Unexpected RED NoData from raster #1\n");
+ return -162;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get GREEN NoData from raster #1\n");
+ return -162;
+ }
+
+ if (sample != 255)
+ {
+ fprintf (stderr, "Unexpected GREEN NoData from raster #1\n");
+ return -165;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BLUE NoData from raster #1\n");
+ return -166;
+ }
+
+ if (sample != 0)
+ {
+ fprintf (stderr, "Unexpected BLUE NoData from raster #1\n");
+ return -167;
+ }
+
+ no_data = rl2_create_raster_pixel (raster);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a pixel for raster #1\n");
+ return -168;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_RED_BAND, 255) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Red NoData #2\n");
+ return -169;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, 0) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Green NoData #2\n");
+ return -170;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, 255) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Blue NoData #2\n");
+ return -171;
+ }
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_get_raster_no_data (raster);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to get NoData from raster #2\n");
+ return -172;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_RED_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RED NoData from raster #2\n");
+ return -173;
+ }
+
+ if (sample != 0)
+ {
+ fprintf (stderr, "Unexpected RED NoData from raster #2\n");
+ return -174;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get GREEN NoData from raster #2\n");
+ return -175;
+ }
+
+ if (sample != 255)
+ {
+ fprintf (stderr, "Unexpected GREEN NoData from raster #2\n");
+ return -176;
+ }
+
+ if (rl2_get_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, &sample) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BLUE NoData from raster #2\n");
+ return -177;
+ }
+
+ if (sample != 0)
+ {
+ fprintf (stderr, "Unexpected BLUE NoData from raster #2\n");
+ return -178;
+ }
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel\n");
+ return -179;
+ }
+
+ bufpix = malloc (256 * 256 * 3);
+ memset (bufpix, 255, 256 * 256 * 3);
+
+ if (rl2_create_raster (1024, 1024, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ bufpix, 256 * 256 * 3, NULL, NULL, 0,
+ no_data) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create raster (invalid NoData)\n");
+ return -180;
+ }
+ free (bufpix);
+
+ rl2_destroy_pixel (no_data);
+
+ rl2_destroy_raster (raster);
+
+ if (rl2_get_raster_no_data (NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: get NoData (NULL raster)\n");
+ return -181;
+ }
+
+ if (rl2_create_raster_pixel (NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: get pixel (NULL raster)\n");
+ return -182;
+ }
+
+ bufpix = malloc (256 * 256);
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 2,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Unable to create a MONOCHROME raster\n");
+ return -183;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_2_BIT, RL2_PIXEL_MONOCHROME, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL))
+ {
+ fprintf (stderr, "Unexpected result: create a MONOCHROME raster\n");
+ return -184;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_4_BIT, RL2_PIXEL_PALETTE, 2,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL))
+ {
+ fprintf (stderr, "Unexpected result: create a MONOCHROME raster\n");
+ return -185;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_INT8, RL2_PIXEL_PALETTE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: create a MONOCHROME raster\n");
+ return -186;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_4_BIT, RL2_PIXEL_GRAYSCALE, 2,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: create a GRAYSCALE raster\n");
+ return -187;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_INT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: create a GRAYSCALE raster\n");
+ return -188;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 2,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: create a DATAGRID raster\n");
+ return -189;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_4_BIT, RL2_PIXEL_DATAGRID, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: create a DATAGRID raster\n");
+ return -190;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_4_BIT, RL2_PIXEL_MULTIBAND, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: create a MULTIBAND raster\n");
+ return -191;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: create a MULTIBAND raster\n");
+ return -192;
+ }
+ free (bufpix);
+
+ bufpix = malloc (256 * 256 * 3);
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_FLOAT, RL2_PIXEL_MULTIBAND, 3,
+ bufpix, 256 * 256 * 3, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: create a MULTIBAND raster\n");
+ return -193;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_FLOAT, RL2_PIXEL_RGB, 3,
+ bufpix, 256 * 256 * 3, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: create a MULTIBAND raster\n");
+ return -194;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 2,
+ bufpix, 256 * 256 * 3, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: create a MULTIBAND raster\n");
+ return -195;
+ }
+ free (bufpix);
+
+ bufpix = malloc (256 * 256 * 2);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 2,
+ bufpix, 256 * 256 * 2, NULL, NULL, 0, NULL);
+
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create raster (2 Bands)\n");
+ return -196;
+ }
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT16, RL2_PIXEL_MULTIBAND, 2);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel\n");
+ return -197;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, no_data) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a Gray/16 raster with NoData\n");
+ return -198;
+ }
+
+ rl2_destroy_pixel (no_data);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 3);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel\n");
+ return -199;
+ }
+
+ rl2_destroy_pixel (no_data);
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (256 * 256);
+ mask = malloc (256 * 256);
+ memset (bufpix, 21, 256 * 256);
+ memset (mask, 0, 256 * 256);
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1,
+ bufpix, 256 * 256, NULL, mask, 256 * 256,
+ NULL) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a MONOCHROME raster with mask\n");
+ return -200;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_4_BIT, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, mask, 256 * 256,
+ NULL) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a Gray/16 raster with mask\n");
+ return -201;
+ }
+
+ palette = build_palette (2);
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_1_BIT, RL2_PIXEL_PALETTE, 1,
+ bufpix, 256 * 256, palette, mask, 256 * 256,
+ NULL) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a Palette raster with mask\n");
+ return -202;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_1_BIT, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, palette, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a Grayscale raster with palette\n");
+ return -203;
+ }
+
+ *bufpix = 2;
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_1_BIT, RL2_PIXEL_PALETTE, 1,
+ bufpix, 256 * 256, palette, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a Palette raster [invalid buffer]\n");
+ return -204;
+ }
+ rl2_destroy_palette (palette);
+
+ *bufpix = 2;
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a MONOCHROME raster [invalid buffer]\n");
+ return -205;
+ }
+
+ *bufpix = 4;
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_2_BIT, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a Gray/4 raster [invalid buffer]\n");
+ return -206;
+ }
+
+ *bufpix = 16;
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_4_BIT, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a Gray/16 raster [invalid buffer]\n");
+ return -207;
+ }
+
+ *mask = 2;
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, mask, 256 * 256,
+ NULL) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a Gray/16 raster [invalid mask]\n");
+ return -208;
+ }
+
+ if (rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, mask, 255 * 256,
+ NULL) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a Gray/16 raster with mask\n");
+ return -209;
+ }
+ free (bufpix);
+ free (mask);
+
+ if (rl2_get_raster_type (NULL, &sample_type, &pixel_type, &num_bands) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: Raster Sample (NULL)\n");
+ return -210;
+ }
+
+ if (rl2_get_raster_size (NULL, &width, &height) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: Raster Width (NULL)\n");
+ return -211;
+ }
+
+ if (rl2_get_raster_srid (NULL, &srid) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: Raster SRID (NULL)\n");
+ return -212;
+ }
+
+ if (rl2_get_raster_extent (NULL, &minX, &minY, &maxX, &maxY) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: Raster extent (NULL)\n");
+ return -213;
+ }
+
+ if (rl2_get_raster_resolution (NULL, &hResolution, &vResolution) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: Raster Resolution (NULL)\n");
+ return -214;
+ }
+
+ if (rl2_get_raster_palette (NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Raster Palette (NULL)\n");
+ return -215;
+ }
+
+ if (rl2_raster_georeference_center (NULL, 4326, 1, 1, 1, 1) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: Raster GeoRef Center (NULL)\n");
+ return -216;
+ }
+
+ if (rl2_raster_georeference_upper_left (NULL, 4326, 1, 1, 1, 1) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: Raster GeoRef UpperLeft (NULL)\n");
+ return -217;
+ }
+
+ if (rl2_raster_georeference_upper_right (NULL, 4326, 1, 1, 1, 1) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: Raster GeoRef UpperRight (NULL)\n");
+ return -218;
+ }
+
+ if (rl2_raster_georeference_lower_left (NULL, 4326, 1, 1, 1, 1) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: Raster GeoRef LowerLeft (NULL)\n");
+ return -219;
+ }
+
+ if (rl2_raster_georeference_lower_right (NULL, 4326, 1, 1, 1, 1) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected result: Raster GeoRef LowerRight (NULL)\n");
+ return -220;
+ }
+
+ if (rl2_raster_georeference_frame (NULL, 4326, 1, 1, 1, 1) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected result: Raster GeoRef Frame (NULL)\n");
+ return -221;
+ }
+
+ if (rl2_get_raster_bbox (NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: Raster BBOX (NULL)\n");
+ return -222;
+ }
+
+ rl2_destroy_raster (NULL);
+
+ bufpix = malloc (256 * 256);
+ memset (bufpix, 255, 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a GRAYSCALE/256\n");
+ return -223;
+ }
+
+ pixel = rl2_create_pixel (RL2_SAMPLE_UINT16, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create UINT16 pixels for testing\n");
+ return -224;
+ }
+
+ if (rl2_get_raster_pixel (NULL, NULL, 10, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to get raster pixel (NULL, NULL)\n");
+ return -225;
+ }
+
+ if (rl2_set_raster_pixel (NULL, NULL, 10, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set raster pixel (NULL, NULL)\n");
+ return -226;
+ }
+
+ if (rl2_get_raster_pixel (raster, NULL, 10, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to get raster pixel (valid, NULL)\n");
+ return -227;
+ }
+
+ if (rl2_set_raster_pixel (raster, NULL, 10, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set raster pixel (valid, NULL)\n");
+ return -228;
+ }
+
+ if (rl2_get_raster_pixel (NULL, pixel, 10, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to get raster pixel (NULL, valid)\n");
+ return -229;
+ }
+
+ if (rl2_set_raster_pixel (NULL, pixel, 10, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set raster pixel (NULL, valid)\n");
+ return -230;
+ }
+
+ if (rl2_get_raster_pixel (raster, pixel, 10, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to get raster pixel (mismatching sample)\n");
+ return -231;
+ }
+
+ if (rl2_set_raster_pixel (raster, pixel, 10, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set raster pixel (mismatching sample)\n");
+ return -232;
+ }
+ rl2_destroy_pixel (pixel);
+
+ pixel = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 1);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create UINT8 pixels for testing\n");
+ return -233;
+ }
+
+ if (rl2_get_raster_pixel (raster, pixel, 10, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to get raster pixel (mismatching pixel)\n");
+ return -234;
+ }
+
+ if (rl2_set_raster_pixel (raster, pixel, 10, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set raster pixel (mismatching pixel)\n");
+ return -235;
+ }
+ rl2_destroy_pixel (pixel);
+
+ pixel = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create Gray/256 pixels for testing\n");
+ return -236;
+ }
+
+ if (rl2_get_raster_pixel (raster, pixel, 2000, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to get raster pixel (invalid row)\n");
+ return -237;
+ }
+
+ if (rl2_set_raster_pixel (raster, pixel, 2000, 10) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set raster pixel (invalid row)\n");
+ return -238;
+ }
+
+ if (rl2_get_raster_pixel (raster, pixel, 10, 2000) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to get raster pixel (invalid col)\n");
+ return -239;
+ }
+
+ if (rl2_set_raster_pixel (raster, pixel, 10, 2000) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unable to set raster pixel (invalid col)\n");
+ return -240;
+ }
+ rl2_destroy_pixel (pixel);
+
+ rl2_destroy_raster (raster);
+
+ return 0;
+}
diff --git a/test/test_raster_symbolizer.c b/test/test_raster_symbolizer.c
new file mode 100644
index 0000000..825becf
--- /dev/null
+++ b/test/test_raster_symbolizer.c
@@ -0,0 +1,1643 @@
+/*
+
+ test_raster_symbolizer.c -- RasterLite-2 Test Case
+
+ Author: Sandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+
+*/
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+test_group_renderer (sqlite3 * sqlite, rl2GroupStylePtr style, int ind,
+ int *retcode)
+{
+/* testing GroupRendered */
+ rl2GroupRendererPtr renderer = rl2_create_group_renderer (sqlite, style);
+ if (renderer != NULL)
+ {
+ rl2_destroy_group_renderer (renderer);
+ fprintf (stderr, "Unexpected Valid GroupRenderer #%d\n", ind);
+ *retcode += 39;
+ return 0;
+ }
+ return 1;
+}
+
+static int
+test_group_style (sqlite3 * db_handle, int *retcode)
+{
+/* loading and testing Group Styles */
+ char *sql;
+ int ret;
+ int xret = 0;
+ sqlite3_stmt *stmt;
+ const char *group = "my_group";
+ const char *path1 = "group_style_1.xml";
+ const char *path2 = "group_style_2.xml";
+ const char *str;
+ rl2GroupStylePtr style;
+ int valid;
+ int count;
+
+/* loading the Group Stles */
+ sql = "SELECT RegisterGroupStyle(?, XB_Create(XB_LoadXML(?), 1, 1))";
+ ret = sqlite3_prepare_v2 (db_handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Unable to create the SQL statement\n");
+ *retcode += 1;
+ return 0;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, group, strlen (group), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path1, strlen (path1), SQLITE_STATIC);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ xret = 1;
+ }
+ if (xret != 1)
+ {
+ fprintf (stderr, "Unable to load \"%s\"\n", path2);
+ *retcode += 1;
+ return 0;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, group, strlen (group), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path2, strlen (path2), SQLITE_STATIC);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ xret = 1;
+ }
+ if (xret != 1)
+ {
+ fprintf (stderr, "Unable to load \"%s\"\n", path2);
+ *retcode += 2;
+ return 0;
+ }
+
+/* testing Group Style #1 */
+ style =
+ rl2_create_group_style_from_dbms (db_handle, "my_group",
+ "group_style_1");
+ if (style == NULL)
+ {
+ fprintf (stderr, "Unable to create Group Style #1\n");
+ *retcode += 3;
+ return 0;
+ }
+ str = rl2_get_group_style_name (style);
+ if (str == NULL)
+ {
+ fprintf (stderr, "Unable to get Group Style Name #1\n");
+ *retcode += 4;
+ return 0;
+ }
+ if (strcmp (str, "group_style_1") != 0)
+ {
+ fprintf (stderr, "Unexpected Group Style Name #1: %s\n", str);
+ *retcode += 5;
+ return 0;
+ }
+ str = rl2_get_group_style_title (style);
+ if (str == NULL)
+ {
+ fprintf (stderr, "Unable to get Group Style Title #1\n");
+ *retcode += 6;
+ return 0;
+ }
+ if (strcmp (str, "style-1 title") != 0)
+ {
+ fprintf (stderr, "Unexpected Group Style Title #1: %s\n", str);
+ *retcode += 7;
+ return 0;
+ }
+ str = rl2_get_group_style_abstract (style);
+ if (str == NULL)
+ {
+ fprintf (stderr, "Unable to get Group Style Abstract #1\n");
+ *retcode += 8;
+ return 0;
+ }
+ if (strcmp (str, "style-1 abstract") != 0)
+ {
+ fprintf (stderr, "Unexpected Group Style Abstract #1: %s\n", str);
+ *retcode += 9;
+ return 0;
+ }
+ if (rl2_is_valid_group_style (style, &valid) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Group Style Validity #1\n");
+ *retcode += 10;
+ return 0;
+ }
+ if (valid != 1)
+ {
+ fprintf (stderr, "Unexpected Group Style Validity #1: %d\n", valid);
+ *retcode += 11;
+ return 0;
+ }
+ if (rl2_get_group_style_count (style, &count) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Group Style Count #1\n");
+ *retcode += 12;
+ return 0;
+ }
+ if (count != 2)
+ {
+ fprintf (stderr, "Unexpected Group Style Count #1: %d\n", count);
+ *retcode += 13;
+ return 0;
+ }
+ str = rl2_get_group_named_layer (style, 1);
+ if (str == NULL)
+ {
+ fprintf (stderr, "Unable to get Group Style NamedLayer #1\n");
+ *retcode += 14;
+ return 0;
+ }
+ if (strcmp (str, "dumb1") != 0)
+ {
+ fprintf (stderr, "Unexpected Group Style NamedLayer #1: %s\n", str);
+ *retcode += 15;
+ return 0;
+ }
+ str = rl2_get_group_named_style (style, 0);
+ if (str == NULL)
+ {
+ fprintf (stderr, "Unable to get Group Style NamedLayer #1\n");
+ *retcode += 16;
+ return 0;
+ }
+ if (strcmp (str, "srtm_brightness") != 0)
+ {
+ fprintf (stderr, "Unexpected Group Style NamedStyle #1: %s\n", str);
+ *retcode += 17;
+ return 0;
+ }
+ if (rl2_is_valid_group_named_layer (style, 0, &valid) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Group NamedLayer Validity #1\n");
+ *retcode += 18;
+ return 0;
+ }
+ if (valid != 1)
+ {
+ fprintf (stderr, "Unexpected Group NamedLayer Validity #1: %d\n",
+ valid);
+ *retcode += 19;
+ return 0;
+ }
+ if (rl2_is_valid_group_named_style (style, 1, &valid) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Group NamedStyle Validity #1\n");
+ *retcode += 20;
+ return 0;
+ }
+ if (valid != 1)
+ {
+ fprintf (stderr, "Unexpected Group NamedStyle Validity #1: %d\n",
+ valid);
+ *retcode += 21;
+ return 0;
+ }
+ if (!test_group_renderer (db_handle, style, 1, retcode))
+ return 0;
+ rl2_destroy_group_style (style);
+
+/* testing Group Style #2 */
+ style =
+ rl2_create_group_style_from_dbms (db_handle, "my_group",
+ "group_style_2");
+ if (style == NULL)
+ {
+ fprintf (stderr, "Unable to create Group Style #2\n");
+ *retcode += 22;
+ return 0;
+ }
+ str = rl2_get_group_style_name (style);
+ if (str == NULL)
+ {
+ fprintf (stderr, "Unable to get Group Style Name #2\n");
+ *retcode += 23;
+ return 0;
+ }
+ if (strcmp (str, "group_style_2") != 0)
+ {
+ fprintf (stderr, "Unexpected Group Style Name #2: %s\n", str);
+ *retcode += 24;
+ return 0;
+ }
+ str = rl2_get_group_style_title (style);
+ if (str == NULL)
+ {
+ fprintf (stderr, "Unable to get Group Style Title #2\n");
+ *retcode += 25;
+ return 0;
+ }
+ if (strcmp (str, "style-2 title") != 0)
+ {
+ fprintf (stderr, "Unexpected Group Style Title #2: %s\n", str);
+ *retcode += 26;
+ return 0;
+ }
+ str = rl2_get_group_style_abstract (style);
+ if (str != NULL)
+ {
+ fprintf (stderr, "Unexpected Group Style Abstract #2: %s\n", str);
+ *retcode += 27;
+ return 0;
+ }
+ if (rl2_is_valid_group_style (style, &valid) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Group Style Validity #2\n");
+ *retcode += 28;
+ return 0;
+ }
+ if (valid != 0)
+ {
+ fprintf (stderr, "Unexpected Group Style Validity #2: %d\n", valid);
+ *retcode += 29;
+ return 0;
+ }
+ if (rl2_get_group_style_count (style, &count) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Group Style Count #2\n");
+ *retcode += 30;
+ return 0;
+ }
+ if (count != 2)
+ {
+ fprintf (stderr, "Unexpected Group Style Count #2: %d\n", count);
+ *retcode += 31;
+ return 0;
+ }
+ str = rl2_get_group_named_layer (style, 1);
+ if (str == NULL)
+ {
+ fprintf (stderr, "Unable to get Group Style NamedLayer #2\n");
+ *retcode += 32;
+ return 0;
+ }
+ if (strcmp (str, "dumb0") != 0)
+ {
+ fprintf (stderr, "Unexpected Group Style NamedLayer #2: %s\n", str);
+ *retcode += 33;
+ return 0;
+ }
+ str = rl2_get_group_named_style (style, 1);
+ if (str == NULL)
+ {
+ fprintf (stderr, "Unable to get Group Style NamedLayer #2\n");
+ *retcode += 34;
+ return 0;
+ }
+ if (strcmp (str, "style1") != 0)
+ {
+ fprintf (stderr, "Unexpected Group Style NamedStyle #2: %s\n", str);
+ *retcode += 35;
+ return 0;
+ }
+ if (rl2_is_valid_group_named_layer (style, 0, &valid) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Group NamedLayer Validity #2\n");
+ *retcode += 36;
+ return 0;
+ }
+ if (valid != 1)
+ {
+ fprintf (stderr, "Unexpected Group NamedLayer Validity #2: %d\n",
+ valid);
+ *retcode += 37;
+ return 0;
+ }
+ if (rl2_is_valid_group_named_style (style, 1, &valid) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Group NamedStyle Validity #2\n");
+ *retcode += 38;
+ return 0;
+ }
+ if (valid != 0)
+ {
+ fprintf (stderr, "Unexpected Group NamedStyle Validity #2: %d\n",
+ valid);
+ *retcode += 39;
+ return 0;
+ }
+ if (!test_group_renderer (db_handle, style, 2, retcode))
+ return 0;
+ rl2_destroy_group_style (style);
+
+/* testing NULL Group Style */
+ style = rl2_create_group_style_from_dbms (db_handle, "lolly", "poppy");
+ if (style != NULL)
+ {
+ fprintf (stderr, "Unexpected success create Group Style\n");
+ *retcode += 40;
+ return 0;
+ }
+ rl2_get_group_style_name (NULL);
+ rl2_get_group_style_title (NULL);
+ rl2_get_group_style_abstract (NULL);
+ rl2_is_valid_group_style (NULL, &valid);
+ rl2_get_group_style_count (NULL, &count);
+ rl2_get_group_named_layer (NULL, 1);
+ rl2_get_group_named_style (NULL, 1);
+ rl2_is_valid_group_named_layer (NULL, 0, &valid);
+ rl2_is_valid_group_named_style (NULL, 1, &valid);
+
+ return 1;
+}
+
+static int
+load_symbolizer (sqlite3 * db_handle, const char *coverage, const char *path,
+ int *retcode)
+{
+/* loading a RasterSymbolizer as a RasterStyle */
+ char *sql;
+ int ret;
+ int xret = 0;
+ sqlite3_stmt *stmt;
+
+ sql = "SELECT RegisterRasterStyledLayer(?, XB_Create(XB_LoadXML(?), 1, 1))";
+ ret = sqlite3_prepare_v2 (db_handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "Unable to create the SQL statement\n");
+ *retcode += 1;
+ return 0;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, coverage, strlen (coverage), SQLITE_STATIC);
+ sqlite3_bind_text (stmt, 2, path, strlen (path), SQLITE_STATIC);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_int (stmt, 0) == 1)
+ xret = 1;
+ }
+ if (xret == 1)
+ return 1;
+ *retcode += 1;
+ return 0;
+}
+
+static int
+test_symbolizer_1 (sqlite3 * db_handle, const char *coverage,
+ const char *style_name, int *retcode)
+{
+/* testing a RasterSymbolizer */
+ rl2RasterStylePtr style;
+ const char *string;
+ double value;
+ int intval;
+ unsigned char enhancement;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ style = rl2_create_raster_style_from_dbms (db_handle, coverage, style_name);
+ if (style == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve style '%s'\n", style_name);
+ *retcode += 1;
+ return 0;
+ }
+
+ if (strcmp (coverage, "dumb1") == 0)
+ {
+ string = rl2_get_raster_style_name (style);
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL style name (%s)\n",
+ style_name);
+ *retcode += 1;
+ return 0;
+ }
+ if (strcmp (string, "style1") != 0)
+ {
+ fprintf (stderr, "Unexpected style name \"%s\"\n", string);
+ *retcode += 2;
+ return 0;
+ }
+
+ string = rl2_get_raster_style_title (style);
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL style title (%s)\n",
+ style_name);
+ *retcode += 3;
+ return 0;
+ }
+ if (strcmp (string, "title: first style") != 0)
+ {
+ fprintf (stderr, "Unexpected style title \"%s\"\n", string);
+ *retcode += 4;
+ return 0;
+ }
+
+ string = rl2_get_raster_style_abstract (style);
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL style abstract (%s)\n",
+ style_name);
+ *retcode += 5;
+ return 0;
+ }
+ if (strcmp (string, "abstract: first style") != 0)
+ {
+ fprintf (stderr, "Unexpected style abstract \"%s\"\n", string);
+ *retcode += 6;
+ return 0;
+ }
+ }
+
+ if (rl2_get_raster_style_opacity (style, &value) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Opacity\n");
+ *retcode += 7;
+ return 0;
+ }
+ if (value != 1.0)
+ {
+ fprintf (stderr, "Unexpected Opacity %1.2f\n", value);
+ *retcode += 8;
+ return 0;
+ }
+
+ if (rl2_is_raster_style_mono_band_selected (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get IsMonoBandSelected\n");
+ *retcode += 9;
+ return 0;
+ }
+ if (intval != 1)
+ {
+ fprintf (stderr, "Unexpected IsMonoBandSelected %d\n", intval);
+ *retcode += 10;
+ return 0;
+ }
+
+ if (rl2_is_raster_style_triple_band_selected (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get IsTripleBandSelected\n");
+ *retcode += 11;
+ return 0;
+ }
+ if (intval != 0)
+ {
+ fprintf (stderr, "Unexpected IsTripleBandSelected %d\n", intval);
+ *retcode += 12;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_overall_contrast_enhancement
+ (style, &enhancement, &value) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get OverallContrastEnhancement\n");
+ *retcode += 13;
+ return 0;
+ }
+ if (enhancement != RL2_CONTRAST_ENHANCEMENT_NONE)
+ {
+ fprintf (stderr, "Unexpected OverallContrastEnhancement %02x\n",
+ enhancement);
+ *retcode += 14;
+ return 0;
+ }
+
+ if (rl2_has_raster_style_shaded_relief (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get HasShadedRelief\n");
+ *retcode += 15;
+ return 0;
+ }
+ if (intval != 1)
+ {
+ fprintf (stderr, "Unexpected HasShadedRelief %d\n", intval);
+ *retcode += 16;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_shaded_relief (style, &intval, &value) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ShadedRelief BrightnessOnly\n");
+ *retcode += 17;
+ return 0;
+ }
+ if (strcmp (coverage, "dumb1") == 0)
+ {
+ if (intval != 0)
+ {
+ fprintf (stderr, "Unexpected ShadedRelief BrightnessOnly %d\n",
+ intval);
+ *retcode += 18;
+ return 0;
+ }
+ if (value != 55.0)
+ {
+ fprintf (stderr, "Unexpected ShadedRelief ReliefFactor %1.2f\n",
+ value);
+ *retcode += 18;
+ return 0;
+ }
+ }
+ else
+ {
+ if (intval != 0)
+ {
+ fprintf (stderr, "Unexpected ShadedRelief BrightnessOnly %d\n",
+ intval);
+ *retcode += 18;
+ return 0;
+ }
+ if (value != 33.5)
+ {
+ fprintf (stderr, "Unexpected ShadedRelief ReliefFactor %1.2f\n",
+ value);
+ *retcode += 18;
+ return 0;
+ }
+ }
+
+ if (rl2_has_raster_style_color_map_interpolated (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get HasColorMapInterpolated\n");
+ *retcode += 19;
+ return 0;
+ }
+ if (intval != 0)
+ {
+ fprintf (stderr, "Unexpected HasColorMapInterpolated %d\n", intval);
+ *retcode += 20;
+ return 0;
+ }
+
+ if (rl2_has_raster_style_color_map_categorized (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get HasColorMapCategorized\n");
+ *retcode += 21;
+ return 0;
+ }
+ if (intval != 1)
+ {
+ fprintf (stderr, "Unexpected HasColorMapCategorized %d\n", intval);
+ *retcode += 22;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_default (style, &red, &green, &blue) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ColorMapDefault\n");
+ *retcode += 23;
+ return 0;
+ }
+ if (red != 0x78 || green != 0xc8 || blue != 0x18)
+ {
+ fprintf (stderr, "Unexpected ColorMapDefault #%02x%02x%02x\n", red,
+ green, blue);
+ *retcode += 24;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_category_base
+ (style, &red, &green, &blue) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ColorMapCategoryBase\n");
+ *retcode += 25;
+ return 0;
+ }
+ if (red != 0x00 || green != 0xff || blue != 0x00)
+ {
+ fprintf (stderr, "Unexpected ColorMapCategoryBase #%02x%02x%02x\n",
+ red, green, blue);
+ *retcode += 26;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_count (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ColorMapCount\n");
+ *retcode += 27;
+ return 0;
+ }
+ if (intval != 19)
+ {
+ fprintf (stderr, "Unexpected ColorMapCount %d\n", intval);
+ *retcode += 28;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_entry
+ (style, 3, &value, &red, &green, &blue) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ColorMapEntry (3)\n");
+ *retcode += 29;
+ return 0;
+ }
+ if (value != -167)
+ {
+ fprintf (stderr, "Unexpected ColorMapEntry (3) %1.2f\n", value);
+ *retcode += 30;
+ return 0;
+ }
+ if (red != 0x3c || green != 0xf5 || blue != 0x05)
+ {
+ fprintf (stderr, "Unexpected ColorMapEntry (3) #%02x%02x%02x\n", red,
+ green, blue);
+ *retcode += 30;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_entry
+ (style, 13, &value, &red, &green, &blue) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ColorMapEntry (13)\n");
+ *retcode += 31;
+ return 0;
+ }
+ if (value != 1400)
+ {
+ fprintf (stderr, "Unexpected ColorMapEntry (13) %1.2f\n", value);
+ *retcode += 32;
+ return 0;
+ }
+ if (red != 0xc8 || green != 0x50 || blue != 0x00)
+ {
+ fprintf (stderr, "Unexpected ColorMapEntry (13) #%02x%02x%02x\n", red,
+ green, blue);
+ *retcode += 33;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_entry
+ (style, 30, &value, &red, &green, &blue) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: ColorMapEntry (30)\n");
+ *retcode += 34;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_triple_band_selection (style, &red, &green, &blue)
+ == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TripleBand selection\n");
+ *retcode += 35;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_mono_band_selection (style, &red) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get MonoBand selection\n");
+ *retcode += 36;
+ return 0;
+ }
+ if (red != 0)
+ {
+ fprintf (stderr, "Unexpected MonoBand selection: %d\n", intval);
+ *retcode += 36;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_count (NULL, &intval) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected ColorMapCount\n");
+ *retcode += 38;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_default (NULL, &red, &green, &blue) ==
+ RL2_OK)
+ {
+ fprintf (stderr, "Unexpected ColorMapDefault\n");
+ *retcode += 39;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_gray_band_contrast_enhancement
+ (style, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected GrayBandContrastEnhancement\n");
+ *retcode += 40;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_red_band_contrast_enhancement
+ (style, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected RedBandContrastEnhancement\n");
+ *retcode += 41;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_green_band_contrast_enhancement
+ (style, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected GreenBandContrastEnhancement\n");
+ *retcode += 42;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_blue_band_contrast_enhancement
+ (style, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected BlueBandContrastEnhancement\n");
+ *retcode += 43;
+ return 0;
+ }
+
+ rl2_destroy_raster_style (style);
+ return 1;
+}
+
+static int
+test_symbolizer_2 (sqlite3 * db_handle, const char *coverage,
+ const char *style_name, int *retcode)
+{
+/* testing a RasterSymbolizer */
+ rl2RasterStylePtr style;
+ const char *string;
+ double value;
+ int intval;
+ unsigned char enhancement;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ style = rl2_create_raster_style_from_dbms (db_handle, coverage, style_name);
+ if (style == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve style '%s'\n", style_name);
+ *retcode += 1;
+ return 0;
+ }
+
+ if (strcmp (coverage, "dumb1") == 0)
+ {
+ string = rl2_get_raster_style_name (style);
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL style name (%s)\n",
+ style_name);
+ *retcode += 1;
+ return 0;
+ }
+ if (strcmp (string, "style2") != 0)
+ {
+ fprintf (stderr, "Unexpected style name \"%s\"\n", string);
+ *retcode += 2;
+ return 0;
+ }
+
+ string = rl2_get_raster_style_title (style);
+ if (string == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL style title (%s)\n",
+ style_name);
+ *retcode += 3;
+ return 0;
+ }
+ if (strcmp (string, "title: second style") != 0)
+ {
+ fprintf (stderr, "Unexpected style title \"%s\"\n", string);
+ *retcode += 4;
+ return 0;
+ }
+
+ string = rl2_get_raster_style_abstract (style);
+ if (string != NULL)
+ {
+ fprintf (stderr, "Unexpected NOT NULL style abstract (%s)\n",
+ style_name);
+ *retcode += 5;
+ return 0;
+ }
+ }
+
+ if (rl2_get_raster_style_opacity (style, &value) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Opacity\n");
+ *retcode += 6;
+ return 0;
+ }
+ if (value != 0.8)
+ {
+ fprintf (stderr, "Unexpected Opacity %1.2f\n", value);
+ *retcode += 7;
+ return 0;
+ }
+
+ if (rl2_is_raster_style_triple_band_selected (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get IsTripleBandSelected\n");
+ *retcode += 8;
+ return 0;
+ }
+ if (intval != 1)
+ {
+ fprintf (stderr, "Unexpected IsTripleBandSelected %d\n", intval);
+ *retcode += 9;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_red_band_contrast_enhancement
+ (style, &enhancement, &value) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get RedBandContrastEnhancement\n");
+ *retcode += 10;
+ return 0;
+ }
+ if (enhancement != RL2_CONTRAST_ENHANCEMENT_HISTOGRAM)
+ {
+ fprintf (stderr, "Unexpected RedBandContrastEnhancement %02x\n",
+ enhancement);
+ *retcode += 11;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_green_band_contrast_enhancement
+ (style, &enhancement, &value) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get GreenBandContrastEnhancement\n");
+ *retcode += 12;
+ return 0;
+ }
+ if (enhancement != RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ fprintf (stderr, "Unexpected GreenBandContrastEnhancement %02x\n",
+ enhancement);
+ *retcode += 13;
+ return 0;
+ }
+ if (value != 2.5)
+ {
+ fprintf (stderr, "Unexpected GreenBandContrastEnhancement %1.2f\n",
+ value);
+ *retcode += 14;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_blue_band_contrast_enhancement
+ (style, &enhancement, &value) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get BlueBandContrastEnhancement\n");
+ *retcode += 15;
+ return 0;
+ }
+ if (enhancement != RL2_CONTRAST_ENHANCEMENT_NORMALIZE)
+ {
+ fprintf (stderr, "Unexpected BlueBandContrastEnhancement %02x\n",
+ enhancement);
+ *retcode += 16;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_overall_contrast_enhancement
+ (style, &enhancement, &value) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get OverallContrastEnhancement\n");
+ *retcode += 17;
+ return 0;
+ }
+ if (enhancement != RL2_CONTRAST_ENHANCEMENT_GAMMA)
+ {
+ fprintf (stderr, "Unexpected OverallContrastEnhancement %02x\n",
+ enhancement);
+ *retcode += 18;
+ return 0;
+ }
+ if (value != 1.2)
+ {
+ fprintf (stderr, "Unexpected OverallContrastEnhancement %1.2f\n",
+ value);
+ *retcode += 19;
+ return 0;
+ }
+
+ if (rl2_has_raster_style_shaded_relief (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get HasShadedRelief\n");
+ *retcode += 20;
+ return 0;
+ }
+ if (intval != 0)
+ {
+ fprintf (stderr, "Unexpected HasShadedRelief %d\n", intval);
+ *retcode += 21;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_shaded_relief (style, &intval, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: ShadedRelief\n");
+ *retcode += 22;
+ return 0;
+ }
+
+ if (rl2_has_raster_style_color_map_interpolated (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get HasColorMapInterpolated\n");
+ *retcode += 23;
+ return 0;
+ }
+ if (intval != 1)
+ {
+ fprintf (stderr, "Unexpected HasColorMapInterpolated %d\n", intval);
+ *retcode += 24;
+ return 0;
+ }
+
+ if (rl2_has_raster_style_color_map_categorized (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get HasColorMapCategorized\n");
+ *retcode += 25;
+ return 0;
+ }
+ if (intval != 0)
+ {
+ fprintf (stderr, "Unexpected HasColorMapCategorized %d\n", intval);
+ *retcode += 26;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_default (style, &red, &green, &blue) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ColorMapDefault\n");
+ *retcode += 27;
+ return 0;
+ }
+ if (red != 0xdd || green != 0xdd || blue != 0xdd)
+ {
+ fprintf (stderr, "Unexpected ColorMapDefault #%02x%02x%02x\n", red,
+ green, blue);
+ *retcode += 28;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_category_base
+ (style, &red, &green, &blue) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: get ColorMapCategoryBase\n");
+ *retcode += 29;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_count (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ColorMapCount\n");
+ *retcode += 30;
+ return 0;
+ }
+ if (intval != 2)
+ {
+ fprintf (stderr, "Unexpected ColorMapCount %d\n", intval);
+ *retcode += 31;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_entry
+ (style, 0, &value, &red, &green, &blue) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ColorMapEntry (0)\n");
+ *retcode += 32;
+ return 0;
+ }
+ if (value != 0)
+ {
+ fprintf (stderr, "Unexpected ColorMapEntry (0) %1.2f\n", value);
+ *retcode += 33;
+ return 0;
+ }
+ if (red != 0x00 || green != 0x00 || blue != 0x00)
+ {
+ fprintf (stderr, "Unexpected ColorMapEntry (0) #%02x%02x%02x\n", red,
+ green, blue);
+ *retcode += 34;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_entry
+ (style, 1, &value, &red, &green, &blue) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get ColorMapEntry (1)\n");
+ *retcode += 35;
+ return 0;
+ }
+ if (value != 255)
+ {
+ fprintf (stderr, "Unexpected ColorMapEntry (1) %1.2f\n", value);
+ *retcode += 36;
+ return 0;
+ }
+ if (red != 0xff || green != 0xff || blue != 0xff)
+ {
+ fprintf (stderr, "Unexpected ColorMapEntry (1) #%02x%02x%02x\n", red,
+ green, blue);
+ *retcode += 37;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_entry
+ (style, 2, &value, &red, &green, &blue) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: ColorMapEntry (2)\n");
+ *retcode += 38;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_triple_band_selection (style, &red, &green, &blue)
+ != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get TripleBand selection\n");
+ *retcode += 35;
+ return 0;
+ }
+ if (red == 0 && green == 1 && blue == 2)
+ ;
+ else
+ {
+ fprintf (stderr, "Unexpected TripleBand %d,%d,%d\n", red, green,
+ blue);
+ *retcode += 36;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_mono_band_selection (style, &red) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: MonoBand selection\n");
+ *retcode += 36;
+ return 0;
+ }
+
+ if (rl2_is_raster_style_mono_band_selected (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get IsMonoBandSelected\n");
+ *retcode += 37;
+ return 0;
+ }
+ if (intval != 0)
+ {
+ fprintf (stderr, "Unexpected IsMonoBandSelected %d\n", intval);
+ *retcode += 38;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_gray_band_contrast_enhancement
+ (style, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected GrayBandContrastEnhancement\n");
+ *retcode += 39;
+ return 0;
+ }
+
+ rl2_destroy_raster_style (style);
+ return 1;
+}
+
+static int
+test_symbolizer_3 (sqlite3 * db_handle, const char *coverage,
+ const char *style_name, int *retcode)
+{
+/* testing a RasterSymbolizer */
+ rl2RasterStylePtr style;
+ unsigned char enhancement;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ int intval;
+ double value;
+ style = rl2_create_raster_style_from_dbms (db_handle, coverage, style_name);
+ if (style == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve style '%s'\n", style_name);
+ *retcode += 1;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_triple_band_selection (style, &red, &green, &blue)
+ == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TripleBand selection\n");
+ *retcode += 2;
+ return 0;
+ }
+
+ if (rl2_is_raster_style_mono_band_selected (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get IsMonoBandSelected\n");
+ *retcode += 3;
+ return 0;
+ }
+ if (intval != 1)
+ {
+ fprintf (stderr, "Unexpected IsMonoBandSelected %d\n", intval);
+ *retcode += 4;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_mono_band_selection (style, &red) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get MonoBand selection\n");
+ *retcode += 5;
+ return 0;
+ }
+ if (red != 0)
+ {
+ fprintf (stderr, "Unexpected MonoBand %d\n", red);
+ *retcode += 4;
+ return 0;
+ }
+
+ if (rl2_is_raster_style_triple_band_selected (style, &intval) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get IsTripleBandSelected\n");
+ *retcode += 5;
+ return 0;
+ }
+ if (intval != 0)
+ {
+ fprintf (stderr, "Unexpected IsMonoBandSelected %d\n", intval);
+ *retcode += 6;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_gray_band_contrast_enhancement
+ (style, &enhancement, &value) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get GrayBandContrastEnhancement\n");
+ *retcode += 7;
+ return 0;
+ }
+ if (enhancement != RL2_CONTRAST_ENHANCEMENT_NONE)
+ {
+ fprintf (stderr, "Unexpected GrayBandContrastEnhancement %02x\n",
+ enhancement);
+ *retcode += 8;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_green_band_contrast_enhancement
+ (style, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected GreenBandContrastEnhancement\n");
+ *retcode += 9;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_blue_band_contrast_enhancement
+ (style, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected BlueBandContrastEnhancement\n");
+ *retcode += 10;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_red_band_contrast_enhancement
+ (style, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected RedBandContrastEnhancement\n");
+ *retcode += 11;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_green_band_contrast_enhancement
+ (style, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected GreenBandContrastEnhancement\n");
+ *retcode += 12;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_blue_band_contrast_enhancement
+ (style, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected BlueBandContrastEnhancement\n");
+ *retcode += 13;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_count (style, &intval) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected ColorMapCount\n");
+ *retcode += 14;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_default (style, &red, &green, &blue) ==
+ RL2_OK)
+ {
+ fprintf (stderr, "Unexpected ColorMapDefault\n");
+ *retcode += 15;
+ return 0;
+ }
+
+ rl2_destroy_raster_style (style);
+ return 1;
+}
+
+static int
+test_symbolizer_null (int *retcode)
+{
+/* testing a NULL RasterSymbolizer */
+ const char *string;
+ double value;
+ int intval;
+ unsigned char enhancement;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+
+ string = rl2_get_raster_style_name (NULL);
+ if (string != NULL)
+ {
+ fprintf (stderr, "Unexpected style name\n");
+ *retcode += 1;
+ return 0;
+ }
+
+ string = rl2_get_raster_style_title (NULL);
+ if (string != NULL)
+ {
+ fprintf (stderr, "Unexpected style title\n");
+ *retcode += 2;
+ return 0;
+ }
+
+ string = rl2_get_raster_style_abstract (NULL);
+ if (string != NULL)
+ {
+ fprintf (stderr, "Unexpected style abstract\n");
+ *retcode += 3;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_opacity (NULL, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected Opacity\n");
+ *retcode += 4;
+ return 0;
+ }
+
+ if (rl2_is_raster_style_mono_band_selected (NULL, &intval) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected IsMonoBandSelected\n");
+ *retcode += 5;
+ return 0;
+ }
+
+ if (rl2_is_raster_style_triple_band_selected (NULL, &intval) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected IsTripleBandSelected\n");
+ *retcode += 6;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_overall_contrast_enhancement
+ (NULL, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected OverallContrastEnhancement\n");
+ *retcode += 7;
+ return 0;
+ }
+
+ if (rl2_has_raster_style_shaded_relief (NULL, &intval) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected HasShadedRelief\n");
+ *retcode += 8;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_shaded_relief (NULL, &intval, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected ShadedRelief BrightnessOnly\n");
+ *retcode += 9;
+ return 0;
+ }
+
+ if (rl2_has_raster_style_color_map_interpolated (NULL, &intval) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected HasColorMapInterpolated\n");
+ *retcode += 10;
+ return 0;
+ }
+
+ if (rl2_has_raster_style_color_map_categorized (NULL, &intval) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected HasColorMapCategorized\n");
+ *retcode += 11;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_default (NULL, &red, &green, &blue) ==
+ RL2_OK)
+ {
+ fprintf (stderr, "Unexpected ColorMapDefault\n");
+ *retcode += 12;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_category_base
+ (NULL, &red, &green, &blue) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected ColorMapCategoryBase\n");
+ *retcode += 13;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_count (NULL, &intval) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected ColorMapCount\n");
+ *retcode += 14;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_color_map_entry
+ (NULL, 3, &value, &red, &green, &blue) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected ColorMapEntry\n");
+ *retcode += 15;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_triple_band_selection (NULL, &red, &green, &blue)
+ == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TripleBand selection\n");
+ *retcode += 16;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_mono_band_selection (NULL, &red) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: MonoBand selection\n");
+ *retcode += 17;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_red_band_contrast_enhancement
+ (NULL, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected RedBandContrastEnhancement\n");
+ *retcode += 18;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_green_band_contrast_enhancement
+ (NULL, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected GreenBandContrastEnhancement\n");
+ *retcode += 19;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_blue_band_contrast_enhancement
+ (NULL, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected BlueBandContrastEnhancement\n");
+ *retcode += 20;
+ return 0;
+ }
+
+ if (rl2_get_raster_style_gray_band_contrast_enhancement
+ (NULL, &enhancement, &value) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected GrayBandContrastEnhancement\n");
+ *retcode += 21;
+ return 0;
+ }
+
+ rl2_destroy_raster_style (NULL);
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ int ret;
+ char *err_msg = NULL;
+ sqlite3 *db_handle;
+ void *cache = spatialite_alloc_connection ();
+ char *old_SPATIALITE_SECURITY_ENV = NULL;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ old_SPATIALITE_SECURITY_ENV = getenv ("SPATIALITE_SECURITY");
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=relaxed");
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", "relaxed", 1);
+#endif
+
+/* opening and initializing the "memory" test DB */
+ ret = sqlite3_open_v2 (":memory:", &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_open_v2() error: %s\n",
+ sqlite3_errmsg (db_handle));
+ return -1;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+ ret =
+ sqlite3_exec (db_handle, "SELECT InitSpatialMetadata(1)", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -2;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateRasterCoveragesTable()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -3;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT RL2_CreateCoverage('dumb1', 'UINT8', "
+ "'GRAYSCALE', 1, 'NONE', 100, 256, 256, 4326, 1.0)", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -4;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT RL2_CreateCoverage('dumb2', 'UINT8', "
+ "'GRAYSCALE', 1, 'NONE', 100, 256, 256, 4326, 1.0)", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -5;
+ }
+ ret =
+ sqlite3_exec (db_handle,
+ "SELECT RL2_CreateCoverage('dumb_dem', 'INT16', "
+ "'DATAGRID', 1, 'NONE', 100, 256, 256, 4326, 1.0)", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateCoverage() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -6;
+ }
+ ret =
+ sqlite3_exec (db_handle, "SELECT CreateStylingTables()", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateStylingTables() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -7;
+ }
+ ret =
+ sqlite3_exec (db_handle,
+ "SELECT RegisterStyledGroup('my_group', 'dumb1')", NULL,
+ NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterStyledGroup() #1 error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -8;
+ }
+ ret =
+ sqlite3_exec (db_handle,
+ "SELECT RegisterStyledGroup('my_group', 'dumb_dem')",
+ NULL, NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "RegisterStyledGroup() #2 error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return -9;
+ }
+
+/* tests */
+ ret = -100;
+ if (!load_symbolizer (db_handle, "dumb1", "raster_symbolizer_1.xml", &ret))
+ return ret;
+ ret = -200;
+ if (!load_symbolizer (db_handle, "dumb1", "raster_symbolizer_2.xml", &ret))
+ return ret;
+ ret = -300;
+ if (!load_symbolizer (db_handle, "dumb1", "raster_symbolizer_3.xml", &ret))
+ return ret;
+ ret = -400;
+ if (!load_symbolizer (db_handle, "dumb2", "raster_symbolizer_4.xml", &ret))
+ return ret;
+ ret = -500;
+ if (!load_symbolizer (db_handle, "dumb2", "raster_symbolizer_5.xml", &ret))
+ return ret;
+ ret = -600;
+ if (!load_symbolizer (db_handle, "dumb2", "raster_symbolizer_6.xml", &ret))
+ return ret;
+ ret = -800;
+ if (!load_symbolizer (db_handle, "dumb_dem", "srtm_brightness.xml", &ret))
+ return ret;
+ ret = -110;
+ if (!test_symbolizer_1 (db_handle, "dumb1", "style1", &ret))
+ return ret;
+ ret = -210;
+ if (!test_symbolizer_2 (db_handle, "dumb1", "style2", &ret))
+ return ret;
+ ret = -310;
+ if (!test_symbolizer_3 (db_handle, "dumb1", "style3", &ret))
+ return ret;
+ ret = -410;
+ if (!test_symbolizer_1 (db_handle, "dumb2", "style1", &ret))
+ return ret;
+ ret = -510;
+ if (!test_symbolizer_2 (db_handle, "dumb2", "style2", &ret))
+ return ret;
+ ret = -610;
+ if (!test_symbolizer_3 (db_handle, "dumb2", "style3", &ret))
+ return ret;
+ ret = -710;
+ if (!test_symbolizer_null (&ret))
+ return ret;
+ ret = -810;
+ if (!test_group_style (db_handle, &ret))
+ return -ret;
+
+/* closing the DB */
+ sqlite3_close (db_handle);
+ spatialite_shutdown ();
+ if (old_SPATIALITE_SECURITY_ENV)
+ {
+#ifdef _WIN32
+ char *env = sqlite3_mprintf ("SPATIALITE_SECURITY=%s",
+ old_SPATIALITE_SECURITY_ENV);
+ putenv (env);
+ sqlite3_free (env);
+#else /* not WIN32 */
+ setenv ("SPATIALITE_SECURITY", old_SPATIALITE_SECURITY_ENV, 1);
+#endif
+ }
+ else
+ {
+#ifdef _WIN32
+ putenv ("SPATIALITE_SECURITY=");
+#else /* not WIN32 */
+ unsetenv ("SPATIALITE_SECURITY");
+#endif
+ }
+ return result;
+}
diff --git a/test/test_section.c b/test/test_section.c
new file mode 100644
index 0000000..037205b
--- /dev/null
+++ b/test/test_section.c
@@ -0,0 +1,340 @@
+/*
+
+ test_section.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+int
+main (int argc, char *argv[])
+{
+ rl2RasterPtr raster;
+ rl2SectionPtr section;
+ unsigned char compression;
+ int is_compressed;
+ unsigned int tile_width;
+ unsigned int tile_height;
+ unsigned char *bufpix = malloc (256 * 256);
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a raster\n");
+ return -1;
+ }
+
+ if (rl2_create_section (NULL, RL2_COMPRESSION_NONE, 1024, 1024, raster) !=
+ NULL)
+ {
+ fprintf (stderr, "Invalid section - NULL name\n");
+ return -2;
+ }
+
+ if (rl2_create_section ("alpha", 0xff, 1024, 1024, raster) != NULL)
+ {
+ fprintf (stderr, "Invalid section - invalid compression\n");
+ return -3;
+ }
+
+ if (rl2_create_section ("alpha", RL2_COMPRESSION_NONE, 1025, 1024, raster)
+ != NULL)
+ {
+ fprintf (stderr, "Invalid section - invalid tile width\n");
+ return -4;
+ }
+
+ if (rl2_create_section ("alpha", RL2_COMPRESSION_NONE, 1024, 255, raster) !=
+ NULL)
+ {
+ fprintf (stderr, "Invalid section - invalid tile height\n");
+ return -5;
+ }
+
+ if (rl2_create_section ("alpha", RL2_COMPRESSION_NONE, 256, 510, raster) !=
+ NULL)
+ {
+ fprintf (stderr, "Invalid section - invalid tile width (x8)\n");
+ return -6;
+ }
+
+ if (rl2_create_section ("alpha", RL2_COMPRESSION_NONE, 510, 256, raster) !=
+ NULL)
+ {
+ fprintf (stderr, "Invalid section - invalid tile height (x8)\n");
+ return -7;
+ }
+
+ if (rl2_create_section ("alpha", RL2_COMPRESSION_NONE, 256, 256, NULL) !=
+ NULL)
+ {
+ fprintf (stderr, "Invalid section - NULL raster\n");
+ return -8;
+ }
+
+ section =
+ rl2_create_section ("alpha", RL2_COMPRESSION_NONE, 256, 512, raster);
+ if (section == NULL)
+ {
+ fprintf (stderr, "Unable to create a valid section (256x512)\n");
+ return -9;
+ }
+
+ if (rl2_get_section_tile_size (section, &tile_width, &tile_height) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get Section Tile Size\n");
+ return -10;
+ }
+
+ if (tile_width != 256)
+ {
+ fprintf (stderr, "Unexpected section tile width (256)\n");
+ return -11;
+ }
+
+ if (tile_height != 512)
+ {
+ fprintf (stderr, "Unexpected section tile height (512)\n");
+ return -12;
+ }
+
+ rl2_destroy_section (section);
+
+/* re-creating another raster */
+ bufpix = malloc (256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a raster (take two)\n");
+ return -13;
+ }
+
+ section =
+ rl2_create_section ("alpha", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (section == NULL)
+ {
+ fprintf (stderr, "Unable to create a valid section (untiled)\n");
+ return -14;
+ }
+
+ if (rl2_get_section_name (section) == NULL)
+ {
+ fprintf (stderr, "Unable to retrieve the section name\n");
+ return -15;
+ }
+
+ if (rl2_get_section_compression (section, &compression) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get section compression\n");
+ return -16;
+ }
+
+ if (compression != RL2_COMPRESSION_NONE)
+ {
+ fprintf (stderr, "Unexpected section compression\n");
+ return -17;
+ }
+
+ if (rl2_is_section_uncompressed (section, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get section not compressed\n");
+ return -18;
+ }
+
+ if (is_compressed != RL2_TRUE)
+ {
+ fprintf (stderr, "Unexpected section not compressed\n");
+ return -19;
+ }
+
+ if (rl2_is_section_compression_lossless (section, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get section compression lossless\n");
+ return -20;
+ }
+
+ if (is_compressed != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected section compression lossless\n");
+ return -21;
+ }
+
+ if (rl2_is_section_compression_lossy (section, &is_compressed) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get section compression lossy\n");
+ return -22;
+ }
+
+ if (is_compressed != RL2_FALSE)
+ {
+ fprintf (stderr, "Unexpected section compression lossy\n");
+ return -23;
+ }
+
+ if (rl2_get_section_tile_size (section, &tile_width, &tile_height) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to get tile size (untiled)\n");
+ return -24;
+ }
+ if (tile_width != RL2_TILESIZE_UNDEFINED)
+ {
+ fprintf (stderr, "Unexpected section tile width (untiled)\n");
+ return -25;
+ }
+ if (tile_height != RL2_TILESIZE_UNDEFINED)
+ {
+ fprintf (stderr, "Unexpected section tile width (untiled)\n");
+ return -26;
+ }
+
+ rl2_destroy_section (section);
+
+ if (rl2_get_section_name (NULL) != NULL)
+ {
+ fprintf (stderr, "ERROR: NULL section name\n");
+ return -27;
+ }
+
+ if (rl2_get_section_compression (NULL, &compression) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL section compression\n");
+ return -28;
+ }
+
+ if (rl2_is_section_uncompressed (NULL, &is_compressed) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL section not compressed\n");
+ return -29;
+ }
+
+ if (rl2_is_section_compression_lossless (NULL, &is_compressed) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL section compression lossless\n");
+ return -30;
+ }
+
+ if (rl2_is_section_compression_lossy (NULL, &is_compressed) != RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL section compression lossy\n");
+ return -31;
+ }
+
+ if (rl2_get_section_tile_size (NULL, &tile_width, &tile_height) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr, "ERROR: NULL section tile size\n");
+ return -32;
+ }
+
+/* re-creating another raster */
+ bufpix = malloc (256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create a raster (take three)\n");
+ return -33;
+ }
+
+ if (rl2_create_section ("alpha", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, 1204, raster) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a valid section (bad tile width)\n");
+ return -34;
+ }
+
+ if (rl2_create_section ("alpha", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, 1204, raster) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a valid section (bad tile height)\n");
+ return -35;
+ }
+
+ if (rl2_create_section ("alpha", RL2_COMPRESSION_NONE,
+ 1205, 1204, raster) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a valid section (bad tile width)\n");
+ return -36;
+ }
+
+ if (rl2_create_section ("alpha", RL2_COMPRESSION_NONE,
+ 1204, 1205, raster) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a valid section (bad tile height)\n");
+ return -37;
+ }
+
+ if (rl2_create_section ("alpha", RL2_COMPRESSION_NONE,
+ 64, 1204, raster) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a valid section (bad tile width)\n");
+ return -38;
+ }
+
+ if (rl2_create_section ("alpha", RL2_COMPRESSION_NONE,
+ 1204, 64, raster) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected result: create a valid section (bad tile height)\n");
+ return -39;
+ }
+
+ rl2_destroy_raster (raster);
+
+ return 0;
+}
diff --git a/test/test_svg.c b/test/test_svg.c
new file mode 100644
index 0000000..eb4fbc8
--- /dev/null
+++ b/test/test_svg.c
@@ -0,0 +1,282 @@
+/*
+
+ test_svg.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <libxml/parser.h>
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2svg.h"
+
+static int
+test_svg_null ()
+{
+/* testing NULL / invalid */
+ double width;
+ double height;
+ if (rl2_create_svg (NULL, 100) != NULL)
+ {
+ fprintf (stderr, "Unexpected success: Create SVG from NULL\n");
+ return 0;
+ }
+ if (rl2_create_svg ((unsigned char *) "abcdefghijkhlmnoprqst", 15) != NULL)
+ {
+ fprintf (stderr, "Unexpected success: Create SVG from invalid XML\n");
+ return 0;
+ }
+ if (rl2_get_svg_size (NULL, &width, &height) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: SVG size from NULL\n");
+ return 0;
+ }
+ if (rl2_raster_from_svg (NULL, 100.0) != NULL)
+ {
+ fprintf (stderr, "Unexpected success: raster from NULL SVG\n");
+ return 0;
+ }
+ return 1;
+}
+
+static int
+test_svg (const char *path, int size, double w, double h)
+{
+/* rendering an SVG sample */
+ char out_path[1024];
+ unsigned char *svg_doc = NULL;
+ int n_bytes;
+ int rd;
+ FILE *in = NULL;
+ char *msg;
+ rl2SvgPtr svg = NULL;
+ double width;
+ double height;
+ double sz;
+ rl2SectionPtr section = NULL;
+ rl2RasterPtr raster = NULL;
+
+/* loading the SVG in-memory */
+ msg = sqlite3_mprintf ("Unable to load \"%s\" in-memory\n", path);
+ in = fopen (path, "rb");
+ if (in == NULL)
+ goto error;
+ if (fseek (in, 0, SEEK_END) < 0)
+ goto error;
+ n_bytes = ftell (in);
+ rewind (in);
+ svg_doc = malloc (n_bytes);
+ rd = fread (svg_doc, 1, n_bytes, in);
+ fclose (in);
+ in = NULL;
+ if (rd != n_bytes)
+ goto error;
+
+/* parsing the SVG document */
+ sqlite3_free (msg);
+ msg = sqlite3_mprintf ("Unable to parse \"%s\"\n", path);
+ svg = rl2_create_svg (svg_doc, n_bytes);
+ if (svg == NULL)
+ goto error;
+
+/* checking width and height */
+ if (rl2_get_svg_size (svg, &width, &height) != RL2_OK)
+ {
+ sqlite3_free (msg);
+ msg =
+ sqlite3_mprintf
+ ("Unable to retrieve width and height from \"%s\"\n", path);
+ goto error;
+ }
+ if (width != w)
+ {
+ sqlite3_free (msg);
+ msg =
+ sqlite3_mprintf ("\"%s\" got unexpected width: %1.4f\n", path,
+ width);
+ goto error;
+ }
+ if (height != h)
+ {
+ sqlite3_free (msg);
+ msg =
+ sqlite3_mprintf ("\"%s\" got unexpected height: %1.4f\n", path,
+ height);
+ goto error;
+ }
+
+/* rendering a PNG image */
+ if (size == 0)
+ sz = 24.0;
+ else if (size == 1)
+ sz = 64.0;
+ else if (size == 2)
+ sz = 128.0;
+ else if (size == 3)
+ sz = 256.0;
+ else
+ sz = 1024.0;
+ raster = rl2_raster_from_svg (svg, sz);
+ if (raster == NULL)
+ {
+ sqlite3_free (msg);
+ msg =
+ sqlite3_mprintf
+ ("\"%s\" (%1.0f) unable to render a raster image\n", sz, path);
+ goto error;
+ }
+ section =
+ rl2_create_section ("svg-test", RL2_COMPRESSION_PNG,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ raster);
+ if (section == NULL)
+ {
+ sqlite3_free (msg);
+ msg =
+ sqlite3_mprintf ("\"%s\" (%1.0f) unable to create a Section\n",
+ sz, path);
+ goto error;
+ }
+ raster = NULL;
+ sprintf (out_path, "./%s_%1.0f.png", path, sz);
+ if (rl2_section_to_png (section, out_path) != RL2_OK)
+ {
+ sqlite3_free (msg);
+ msg = sqlite3_mprintf ("Unable to export \"%s\"\n", out_path);
+ unlink (out_path);
+ goto error;
+ }
+
+ free (svg_doc);
+ rl2_destroy_svg (svg);
+ sqlite3_free (msg);
+ rl2_destroy_section (section);
+ unlink (out_path);
+ return 1;
+
+ error:
+ if (section != NULL)
+ rl2_destroy_section (section);
+ if (raster != NULL)
+ rl2_destroy_raster (raster);
+ if (svg_doc != NULL)
+ free (svg_doc);
+ if (svg != NULL)
+ rl2_destroy_svg (svg);
+ if (in != NULL)
+ fclose (in);
+ fprintf (stderr, "%s", msg);
+ sqlite3_free (msg);
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int size;
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ for (size = 0; size < 5; size++)
+ {
+ if (!test_svg ("./bicycle.svg", size, 580.0, 580.0))
+ return -1;
+ if (!test_svg ("./fastfood.svg", size, 580.0, 580.0))
+ return -2;
+ if (!test_svg ("./motorcycle.svg", size, 580.0, 580.0))
+ return -3;
+ if (!test_svg ("./restaurant.svg", size, 580.0, 580.0))
+ return -4;
+ if (!test_svg ("./car_repair.svg", size, 580.0, 580.0))
+ return -5;
+ if (!test_svg ("./hospital.svg", size, 580.0, 580.0))
+ return -6;
+ if (!test_svg ("./pharmacy.svg", size, 580.0, 580.0))
+ return -7;
+ if (!test_svg ("./supermarket.svg", size, 580.0, 580.0))
+ return -8;
+ if (!test_svg ("./doctors.svg", size, 580.0, 580.0))
+ return -9;
+ if (!test_svg ("./jewelry.svg", size, 580.0, 580.0))
+ return -10;
+ if (!test_svg ("./photo.svg", size, 580.0, 580.0))
+ return -11;
+ if (!test_svg ("./tobacco.svg", size, 580.0, 580.0))
+ return -12;
+ if (!test_svg ("./Car_Yellow.svg", size, 900.0, 600.0))
+ return -15;
+ if (!test_svg
+ ("./Royal_Coat_of_Arms_of_the_United_Kingdom.svg", size, 1550.0,
+ 1500.0))
+ return -16;
+ if (!test_svg
+ ("./Flag_of_the_United_Kingdom.svg", size, 1200.0, 600.0))
+ return -17;
+ if (!test_svg
+ ("./Flag_of_the_United_States.svg", size, 1235.0, 650.0))
+ return -18;
+ if (!test_svg
+ ("./Roundel_of_the_Royal_Canadian_Air_Force_(1946-1965).svg",
+ size, 600.0, 600.0))
+ return -19;
+ if (!test_svg
+ ("./Roundel_of_the_Syrian_Air_Force.svg", size, 600.0, 600.0))
+ return -20;
+ if (!test_svg ("./Netherlands_roundel.svg", size, 600.0, 600.0))
+ return -21;
+ if (!test_svg ("./Coat_of_arms_Holy_See.svg", size, 1160.0, 1300.0))
+ return -22;
+ if (!test_svg
+ ("./Circle_and_quadratic_bezier.svg", size, 256.0, 256.0))
+ return -23;
+ if (!test_svg
+ ("./Negative_and_positive_skew_diagrams_(English).svg", size,
+ 445.6460, 158.541990))
+ return -24;
+ }
+ if (!test_svg_null ())
+ return -25;
+
+ xmlCleanupParser ();
+
+ return 0;
+}
diff --git a/test/test_tifin.c b/test/test_tifin.c
new file mode 100644
index 0000000..6c2ebd0
--- /dev/null
+++ b/test/test_tifin.c
@@ -0,0 +1,618 @@
+/*
+
+ test_tifin.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2tiff.h"
+
+static int
+test_mem_tiff (const char *name)
+{
+/* testing a simple MEM-TIFF source */
+ char path[1024];
+ unsigned char *p_blob = NULL;
+ int n_bytes;
+ int rd;
+ FILE *in = NULL;
+ rl2RasterPtr rst = NULL;
+ char *msg;
+
+/* loading the image in-memory */
+ sprintf (path, "./%s.tif", name);
+ msg = sqlite3_mprintf ("Unable to load \"%s\" in-memory\n", path);
+ in = fopen (path, "rb");
+ if (in == NULL)
+ goto error;
+ if (fseek (in, 0, SEEK_END) < 0)
+ goto error;
+ n_bytes = ftell (in);
+ rewind (in);
+ p_blob = malloc (n_bytes);
+ rd = fread (p_blob, 1, n_bytes, in);
+ fclose (in);
+ in = NULL;
+ if (rd != n_bytes)
+ goto error;
+/* decoding */
+ sqlite3_free (msg);
+ msg = sqlite3_mprintf ("Unable to decode in-memory \"%s\"\n", path);
+ rst = rl2_raster_from_tiff (p_blob, n_bytes);
+ if (rst == NULL)
+ goto error;
+ free (p_blob);
+ rl2_destroy_raster (rst);
+ sqlite3_free (msg);
+ return 0;
+
+ error:
+ if (p_blob != NULL)
+ free (p_blob);
+ if (in != NULL)
+ fclose (in);
+ fprintf (stderr, "%s", msg);
+ sqlite3_free (msg);
+ return -100;
+}
+
+static int
+test_tiff (const char *name, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char nBands)
+{
+/* testing a TIFF source */
+ rl2TiffOriginPtr origin = NULL;
+ rl2CoveragePtr coverage = NULL;
+ rl2RasterPtr raster = NULL;
+ rl2SectionPtr img = NULL;
+ unsigned int row;
+ unsigned int col;
+ unsigned int width;
+ unsigned int height;
+ unsigned char compression;
+ char tile_name[256];
+ char path[1024];
+ int is_geotiff;
+ int is_tfw;
+ const char *tiff_path;
+ const char *tfw_path;
+
+ coverage =
+ rl2_create_coverage (name, sample_type, pixel_type, nBands,
+ RL2_COMPRESSION_PNG, 0, 432, 432, NULL);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to create the Coverage\n");
+ return -1;
+ }
+
+ sprintf (path, "./%s.tif", name);
+ origin =
+ rl2_create_tiff_origin (path, RL2_TIFF_GEOTIFF, -1, RL2_SAMPLE_UNKNOWN,
+ RL2_PIXEL_UNKNOWN, RL2_BANDS_UNKNOWN);
+ if (origin == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to open %s\n", path);
+ return -2;
+ }
+
+ if (rl2_eval_tiff_origin_compatibility (coverage, origin, -1) != RL2_TRUE)
+ {
+ fprintf (stderr, "Coverage/TIFF mismatch: %s\n", name);
+ return -3;
+ }
+
+ if (rl2_get_tile_from_tiff_origin (coverage, origin, 1, 0, -1) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: startRow mismatch\n");
+ return -4;
+ }
+
+ if (rl2_get_tile_from_tiff_origin (coverage, origin, 0, 1, -1) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: startCol mismatch\n");
+ return -5;
+ }
+
+ if (rl2_get_tile_from_tiff_origin (coverage, origin, 22000, 0, -1) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: startRow too big\n");
+ return -6;
+ }
+
+ if (rl2_get_tile_from_tiff_origin (coverage, origin, 0, 22000, -1) != NULL)
+ {
+ fprintf (stderr, "Unexpected result: startCol too big\n");
+ return -7;
+ }
+
+ if (rl2_get_tiff_origin_compression (origin, &compression) != RL2_OK)
+ {
+ fprintf (stderr, "Error - TIFF compression\n");
+ return -8;
+ }
+
+ if (rl2_get_tiff_origin_size (origin, &width, &height) != RL2_OK)
+ {
+ fprintf (stderr, "Error - TIFF size\n");
+ return -9;
+ }
+ if (rl2_is_geotiff_origin (origin, &is_geotiff) != RL2_OK)
+ {
+ fprintf (stderr, "Error - IsGeoTIFF\n");
+ return -10;
+ }
+ if (is_geotiff != 0)
+ {
+ fprintf (stderr, "Unexpected IsGeoTIFF %d\n", is_geotiff);
+ return -11;
+ }
+ if (rl2_is_tiff_worldfile_origin (origin, &is_tfw) != RL2_OK)
+ {
+ fprintf (stderr, "Error - TIFF IsWorldFile\n");
+ return -12;
+ }
+ if (is_tfw != 0)
+ {
+ fprintf (stderr, "Unexpected IsWorldFile %d\n", is_tfw);
+ return -13;
+ }
+ tiff_path = rl2_get_tiff_origin_path (origin);
+ if (tiff_path == NULL)
+ {
+ fprintf (stderr, "Error - NULL TIFF Path\n");
+ return -14;
+ }
+ if (strcmp (tiff_path, path) != 0)
+ {
+ fprintf (stderr, "Error - mismatching TIFF Path \"%s\"\n", tiff_path);
+ return -15;
+ }
+ tfw_path = rl2_get_tiff_origin_worldfile_path (origin);
+ if (tfw_path != NULL)
+ {
+ fprintf (stderr, "Error - TIFF TFW Path\n");
+ return -16;
+ }
+
+ for (row = 0; row < height; row += 432)
+ {
+ for (col = 0; col < width; col += 432)
+ {
+ sprintf (tile_name, "%s_%04d_%04d", name, row, col);
+ raster =
+ rl2_get_tile_from_tiff_origin (coverage, origin, row, col,
+ -1);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "ERROR: unable to get tile [Row=%d Col=%d] from %s\n",
+ row, col, name);
+ return -17;
+ }
+ img =
+ rl2_create_section (name, RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED,
+ RL2_TILESIZE_UNDEFINED, raster);
+ if (img == NULL)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "ERROR: unable to create a Section [%s]\n",
+ name);
+ return -18;
+ }
+ sprintf (path, "./%s.png", tile_name);
+ if (rl2_section_to_png (img, path) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: %s\n", path);
+ return -19;
+ }
+ rl2_destroy_section (img);
+ unlink (path);
+ }
+ }
+
+ rl2_destroy_coverage (coverage);
+ rl2_destroy_tiff_origin (origin);
+ return 0;
+}
+
+static int
+test_null ()
+{
+/* testing null/invalid arguments */
+ rl2TiffOriginPtr origin;
+ rl2RasterPtr raster;
+ rl2CoveragePtr coverage;
+ unsigned int width;
+ unsigned int height;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char num_bands;
+ unsigned char compression;
+ unsigned int tile_width;
+ unsigned int tile_height;
+ unsigned int strip_size;
+ int is_tiled;
+ int srid;
+ double minX;
+ double minY;
+ double maxX;
+ double maxY;
+ double hResolution;
+ double vResolution;
+
+ origin =
+ rl2_create_tiff_origin (NULL, RL2_TIFF_NO_GEOREF, -1,
+ RL2_SAMPLE_UNKNOWN, RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ if (origin != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create TIFF Origin - NULL path\n");
+ return -30;
+ }
+ origin =
+ rl2_create_tiff_origin ("not_existing_tiff.tif", RL2_TIFF_NO_GEOREF, -1,
+ RL2_SAMPLE_UNKNOWN, RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ if (origin != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create TIFF Origin - no georef\n");
+ return -31;
+ }
+ origin =
+ rl2_create_tiff_origin ("not_existing_tiff.tif", RL2_TIFF_GEOTIFF, -1,
+ RL2_SAMPLE_UNKNOWN, RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ if (origin != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create TIFF Origin - GeoTiff\n");
+ return -32;
+ }
+ origin =
+ rl2_create_tiff_origin ("not_existing_tiff.tif", RL2_TIFF_WORLDFILE, -1,
+ RL2_SAMPLE_UNKNOWN, RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ if (origin != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create TIFF Origin - Worldfile\n");
+ return -33;
+ }
+ origin =
+ rl2_create_tiff_origin ("gray-striped.tif", RL2_TIFF_NO_GEOREF, -1,
+ RL2_SAMPLE_UNKNOWN, RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ if (origin == NULL)
+ {
+ fprintf (stderr, "Unexpected fail: Create TIFF Origin - no georef\n");
+ return -34;
+ }
+ if (rl2_get_tiff_origin_srid (origin, &srid) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Get SRID - no georef\n");
+ return -35;
+ }
+ if (rl2_get_tiff_origin_extent (origin, &minX, &minY, &maxX, &maxY) ==
+ RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Get Extent - no georef\n");
+ return -36;
+ }
+ if (rl2_get_tiff_origin_resolution (origin, &hResolution, &vResolution) ==
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Get Resolution - no georef\n");
+ return -37;
+ }
+ rl2_destroy_tiff_origin (origin);
+ origin =
+ rl2_create_tiff_origin ("gray-striped.tif", RL2_TIFF_WORLDFILE, -1,
+ RL2_SAMPLE_UNKNOWN, RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ if (origin == NULL)
+ {
+ fprintf (stderr, "Unexpected fail: Create TIFF Origin - Worldfile\n");
+ return -38;
+ }
+ if (rl2_get_tiff_origin_worldfile_path (origin) != NULL)
+ {
+ fprintf (stderr, "Unexpected success: TFW Path (not existing)\n");
+ return -39;
+ }
+ if (rl2_get_tiff_origin_tile_size (origin, &tile_width, &tile_height) ==
+ RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Tile Size\n");
+ return -40;
+ }
+ rl2_destroy_tiff_origin (origin);
+ origin =
+ rl2_create_tiff_origin ("gray-tiled.tif", RL2_TIFF_GEOTIFF, -1,
+ RL2_SAMPLE_UNKNOWN, RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ if (origin == NULL)
+ {
+ fprintf (stderr, "Unexpected fail: Create TIFF Origin - Worldfile\n");
+ return -41;
+ }
+ if (rl2_get_tiff_origin_strip_size (origin, &strip_size) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Strip Size\n");
+ return -42;
+ }
+ coverage =
+ rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1,
+ RL2_COMPRESSION_PNG, 0, 432, 432, NULL);
+ raster = rl2_get_tile_from_tiff_origin (NULL, origin, 0, 0, -1);
+ if (raster != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Get Tile - NULL coverage\n");
+ return -43;
+ }
+ raster = rl2_get_tile_from_tiff_origin (coverage, NULL, 0, 0, -1);
+ if (raster != NULL)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Get Tile - NULL origin\n");
+ return -44;
+ }
+ raster = rl2_get_tile_from_tiff_origin (coverage, origin, 3, 0, -1);
+ if (raster != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Get Tile - invalid tile row\n");
+ return -45;
+ }
+ raster = rl2_get_tile_from_tiff_origin (coverage, origin, 0, 3, -1);
+ if (raster != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Get Tile - invalid tile col\n");
+ return -46;
+ }
+ rl2_destroy_coverage (coverage);
+ rl2_destroy_tiff_origin (origin);
+ origin =
+ rl2_create_geotiff_origin ("not_existing_tiff.tif", -1,
+ RL2_SAMPLE_UNKNOWN, RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ if (origin != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Origin - not existing\n");
+ return -47;
+ }
+ origin =
+ rl2_create_geotiff_origin ("gray-striped.tif", -1, RL2_SAMPLE_UNKNOWN,
+ RL2_PIXEL_UNKNOWN, RL2_BANDS_UNKNOWN);
+ if (origin != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Origin - not a GeoTIFF\n");
+ return -48;
+ }
+ origin =
+ rl2_create_tiff_worldfile_origin ("not_existing_tiff.tif", 4326,
+ RL2_SAMPLE_UNKNOWN, RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ if (origin != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create TIFF+TFW Origin - not existing\n");
+ return -49;
+ }
+ origin =
+ rl2_create_tiff_worldfile_origin ("gray-striped.tif", 4326,
+ RL2_SAMPLE_UNKNOWN, RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ if (origin != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create TIFF+TFW Origin - missing TFW\n");
+ return -50;
+ }
+ if (rl2_get_tiff_origin_worldfile_path (NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected success: TFW Path (NULL origin)\n");
+ return -51;
+ }
+ if (rl2_get_tiff_origin_path (NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Path (NULL origin)\n");
+ return -52;
+ }
+ if (rl2_get_tiff_origin_size (NULL, &width, &height) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Size (NULL origin)\n");
+ return -53;
+ }
+ if (rl2_get_tiff_origin_type
+ (NULL, &sample_type, &pixel_type, &alias_pixel_type,
+ &num_bands) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Type (NULL origin)\n");
+ return -54;
+ }
+ if (rl2_get_tiff_origin_compression (NULL, &compression) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Compression (NULL origin)\n");
+ return -55;
+ }
+ if (rl2_is_tiled_tiff_origin (NULL, &is_tiled) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF IsTiled - NULL origin\n");
+ return -56;
+ }
+ if (rl2_get_tiff_origin_tile_size (NULL, &tile_width, &tile_height) ==
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Tile Size - NULL origin\n");
+ return -57;
+ }
+ if (rl2_get_tiff_origin_strip_size (NULL, &strip_size) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Strip Size - NULL origin\n");
+ return -58;
+ }
+ if (rl2_get_tiff_origin_srid (NULL, &srid) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Get SRID - NULL origin\n");
+ return -59;
+ }
+ if (rl2_get_tiff_origin_extent (NULL, &minX, &minY, &maxX, &maxY) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Get Extent - NULL origin\n");
+ return -60;
+ }
+ if (rl2_get_tiff_origin_resolution (NULL, &hResolution, &vResolution) ==
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Get Resolution - NULL origin\n");
+ return -61;
+ }
+
+ origin =
+ rl2_create_tiff_origin ("rgb-tiled.tif", RL2_TIFF_NO_GEOREF, -1,
+ RL2_SAMPLE_UNKNOWN, RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ coverage =
+ rl2_create_coverage ("alpha", RL2_SAMPLE_4_BIT, RL2_PIXEL_PALETTE, 1,
+ RL2_COMPRESSION_PNG, 0, 432, 432, NULL);
+ if (rl2_eval_tiff_origin_compatibility (NULL, origin, -1) == RL2_TRUE)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Compatibility - NULL Coverage\n");
+ return -62;
+ }
+ if (rl2_eval_tiff_origin_compatibility (coverage, NULL, -1) == RL2_TRUE)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Compatibility - NULL origin\n");
+ return -63;
+ }
+ if (rl2_eval_tiff_origin_compatibility (coverage, origin, -1) == RL2_TRUE)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Compatibility - mismatching sample\n");
+ return -64;
+ }
+ rl2_destroy_coverage (coverage);
+ coverage =
+ rl2_create_coverage ("alpha", RL2_SAMPLE_UINT8, RL2_PIXEL_PALETTE, 1,
+ RL2_COMPRESSION_PNG, 0, 432, 432, NULL);
+ if (rl2_eval_tiff_origin_compatibility (coverage, origin, -1) == RL2_TRUE)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Compatibility - mismatching pixel\n");
+ return -65;
+ }
+ rl2_destroy_coverage (coverage);
+ rl2_destroy_tiff_origin (origin);
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ if (test_tiff ("gray-striped", RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1) !=
+ 0)
+ return -1;
+ if (test_tiff ("gray-tiled", RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1) != 0)
+ return -2;
+ if (test_tiff ("plt-striped", RL2_SAMPLE_UINT8, RL2_PIXEL_PALETTE, 1) != 0)
+ return -3;
+ if (test_tiff ("plt-tiled", RL2_SAMPLE_UINT8, RL2_PIXEL_PALETTE, 1) != 0)
+ return -4;
+ if (test_tiff ("rgb-striped", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3) != 0)
+ return -5;
+ if (test_tiff ("rgb-tiled", RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3) != 0)
+ return -6;
+ if (test_tiff ("mono3s", RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1) != 0)
+ return -7;
+ if (test_tiff ("mono4s", RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1) != 0)
+ return -8;
+ if (test_tiff ("mono3t", RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1) != 0)
+ return -9;
+ if (test_tiff ("mono4t", RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1) != 0)
+ return -10;
+ if (test_null () != 0)
+ return -11;
+ if (test_mem_tiff ("gray-striped") != 0)
+ return -12;
+ if (test_mem_tiff ("gray-tiled") != 0)
+ return -13;
+ if (test_mem_tiff ("plt-striped") != 0)
+ return -14;
+ if (test_mem_tiff ("plt-tiled") != 0)
+ return -15;
+ if (test_mem_tiff ("rgb-striped") != 0)
+ return -16;
+ if (test_mem_tiff ("rgb-tiled") != 0)
+ return -17;
+ if (test_mem_tiff ("mono3s") != 0)
+ return -18;
+ if (test_mem_tiff ("mono4s") != 0)
+ return -18;
+ if (test_mem_tiff ("mono3t") != 0)
+ return -20;
+ if (test_mem_tiff ("mono4t") != 0)
+ return -21;
+
+ return 0;
+}
diff --git a/test/test_under_valgrind.sh b/test/test_under_valgrind.sh
new file mode 100644
index 0000000..50e792c
--- /dev/null
+++ b/test/test_under_valgrind.sh
@@ -0,0 +1,6 @@
+#! /bin/bash
+for i in *; do
+if test -x $i -a -f $i -a $i != "test_under_valgrind.sh"; then
+ libtool --mode=execute valgrind --track-origins=yes --tool=memcheck --num-callers=20 --leak-check=full --show-reachable=yes $i
+fi;
+done;
diff --git a/test/test_webp.c b/test/test_webp.c
new file mode 100644
index 0000000..48ba8f9
--- /dev/null
+++ b/test/test_webp.c
@@ -0,0 +1,641 @@
+/*
+
+ test_webp.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <memory.h>
+
+#include "rasterlite2/rasterlite2.h"
+
+static int
+test_no_alpha_webp (const char *path)
+{
+ rl2RasterPtr rst;
+ unsigned int width;
+ unsigned int height;
+ unsigned int row;
+ unsigned int col;
+ unsigned char *rgbbuf;
+ int rgbbuf_sz;
+ unsigned char *mskbuf;
+ int mskbuf_sz;
+ unsigned char *p_mask;
+ rl2RasterPtr raster;
+ rl2PixelPtr no_data;
+ unsigned char *bufpix;
+
+ rl2SectionPtr img = rl2_section_from_webp (path);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_section_to_png (img, "./from_webp_no_alpha.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_webp_no_alpha.png\n");
+ return 0;
+ }
+ unlink ("./from_webp_no_alpha.png");
+
+ rst = rl2_get_section_raster (img);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to get the raster: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_get_raster_size (rst, &width, &height) != RL2_OK)
+ {
+ fprintf (stderr, "Invalid width/height: %s\n", path);
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGB (rst, &rgbbuf, &rgbbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw buffer: %s\n", path);
+ return 0;
+ }
+ rl2_destroy_section (img);
+
+ mskbuf_sz = width * height;
+ mskbuf = malloc (mskbuf_sz);
+ if (mskbuf == NULL)
+ {
+ fprintf (stderr, "Unable to create a mask for: %s\n", path);
+ return 0;
+ }
+ p_mask = mskbuf;
+
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (row >= 64 && row <= 96 && col >= 32 && col <= 64)
+ *p_mask++ = 0;
+ else
+ *p_mask++ = 1;
+ }
+ }
+
+ rst = rl2_create_raster (width, height, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ rgbbuf, rgbbuf_sz, NULL, mskbuf, mskbuf_sz, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to create the output raster+mask\n");
+ return 0;
+ }
+
+ img =
+ rl2_create_section ("beta", RL2_COMPRESSION_JPEG,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create the output section+mask\n");
+ return 0;
+ }
+
+ if (rl2_section_to_lossless_webp (img, "./webp_alpha.webp") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: webp_alpha.webp\n");
+ return 0;
+ }
+
+ rl2_destroy_section (img);
+
+ img = rl2_section_from_webp ("./webp_alpha.webp");
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to read: %s\n", "./webp_alpha.webp");
+ return 0;
+ }
+
+ if (rl2_section_to_png (img, "./from_webp_alpha.png") != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: from_webp_alpha.png\n");
+ return 0;
+ }
+ unlink ("./from_webp_alpha.png");
+ unlink ("./webp_alpha.webp");
+
+ rl2_destroy_section (img);
+
+ if (rl2_raster_data_to_RGB (NULL, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw RGB buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (NULL, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw RGBA buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_ARGB (NULL, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw ARGB buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGR (NULL, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw BGR buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_BGRA (NULL, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw BGRA buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_int8 (NULL, (char **) (&rgbbuf), &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw INT8 buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_uint8 (NULL, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw UINT8 buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_int16 (NULL, (short **) (&rgbbuf), &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw INT16 buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_uint16
+ (NULL, (unsigned short **) (&rgbbuf), &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw UINT16 buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_int32 (NULL, (int **) (&rgbbuf), &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw INT32 buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_uint32
+ (NULL, (unsigned int **) (&rgbbuf), &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw UINT32 buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_float (NULL, (float **) (&rgbbuf), &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw FLOAT buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_double (NULL, (double **) (&rgbbuf), &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw DOUBLE buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_1bit (NULL, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw 1-BIT buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_2bit (NULL, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw 2-BIT buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_4bit (NULL, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw 4-BIT buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint8 (NULL, 0, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw band UINT8 buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint16
+ (NULL, 0, (unsigned short **) (&rgbbuf), &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw band UINT16 buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ if (rl2_raster_bands_to_RGB (NULL, 0, 1, 2, &rgbbuf, &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw BandsAsRGB buffer: (NULL raster)\n");
+ return 0;
+ }
+
+ bufpix = malloc (256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create raster (UINT8 Grid)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_int8 (raster, (char **) (&rgbbuf), &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw INT8 buffer: (UINT8 Grid)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_int16 (raster, (short **) (&rgbbuf), &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw INT16 buffer: (UINT8 Grid)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_uint16
+ (raster, (unsigned short **) (&rgbbuf), &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw INT16 buffer: (UINT8 Grid)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_int32 (raster, (int **) (&rgbbuf), &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw INT32 buffer: (UINT8 Grid)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_uint32
+ (raster, (unsigned int **) (&rgbbuf), &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw INT32 buffer: (UINT8 Grid)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_float (raster, (float **) (&rgbbuf), &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw FLOAT buffer: (UINT8 Grid)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_double (raster, (double **) (&rgbbuf), &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw DOUBLE buffer: (UINT8 Grid)\n");
+ return 0;
+ }
+
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_INT8, RL2_PIXEL_DATAGRID, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, NULL);
+
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create raster (INT8 Grid)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_uint8 (raster, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw UINT8 buffer: (INT8 Grid)\n");
+ return 0;
+ }
+
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (256 * 256 * 3);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, 3,
+ bufpix, 256 * 256 * 3, NULL, NULL, 0, NULL);
+
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create raster (MultiBand)\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint16
+ (raster, 0, (unsigned short **) (&rgbbuf), &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw UINT16 buffer: (MultiBand)\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint8 (raster, -1, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw UINT8 buffer: (invalid Band #1)\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint8 (raster, 3, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw UINT8 buffer: (invalid Band #2)\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint8 (raster, -1, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw UINT8 buffer: (invalid Band #1)\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint8 (raster, 3, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw UINT8 buffer: (invalid Band #2)\n");
+ return 0;
+ }
+
+ if (rl2_raster_bands_to_RGB (raster, 0, -1, 2, &rgbbuf, &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw BandsAsRGB buffer: (invalid GREEN Band #1)\n");
+ return 0;
+ }
+
+ if (rl2_raster_bands_to_RGB (raster, 0, 3, 2, &rgbbuf, &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw BandsAsRGB buffer: (invalid GREEN Band #2)\n");
+ return 0;
+ }
+
+ if (rl2_raster_bands_to_RGB (raster, 0, 1, -1, &rgbbuf, &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw BandsAsRGB buffer: (invalid BLUE Band #1)\n");
+ return 0;
+ }
+
+ if (rl2_raster_bands_to_RGB (raster, 0, 1, 3, &rgbbuf, &rgbbuf_sz) !=
+ RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw BandsAsRGB buffer: (invalid BLUE Band #2)\n");
+ return 0;
+ }
+
+ rl2_destroy_raster (raster);
+
+ bufpix = malloc (256 * 256 * 6);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT16, RL2_PIXEL_MULTIBAND, 3,
+ bufpix, 256 * 256 * 6, NULL, NULL, 0, NULL);
+
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create raster (MultiBand16)\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint8 (raster, 0, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr,
+ "Unexpected resut: get raw UINT8 buffer: (MultiBand16)\n");
+ return 0;
+ }
+
+ rl2_destroy_raster (raster);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel (RGB)\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_RED_BAND, 0) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Red NoData (RGB)\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_GREEN_BAND, 0) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Green NoData (RGB)\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_uint8 (no_data, RL2_BLUE_BAND, 255) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set Blue NoData (RGB)\n");
+ return 0;
+ }
+
+ bufpix = malloc (256 * 256 * 3);
+ memset (bufpix, 0, 256 * 256 * 3);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ bufpix, 256 * 256 * 3, NULL, NULL, 0, no_data);
+
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create raster (RGB)\n");
+ return 0;
+ }
+
+ if (rl2_raster_band_to_uint16
+ (raster, 0, (unsigned short **) (&rgbbuf), &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected resut: get raw UINT16 buffer: (RGB)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (raster, &rgbbuf, &rgbbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw RGBA buffer (RGB)\n");
+ return 0;
+ }
+ free (rgbbuf);
+
+ if (rl2_raster_data_to_ARGB (raster, &rgbbuf, &rgbbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw ARGB buffer (RGB)\n");
+ return 0;
+ }
+ free (rgbbuf);
+
+ if (rl2_raster_data_to_BGRA (raster, &rgbbuf, &rgbbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw BGRA buffer (RGB)\n");
+ return 0;
+ }
+ free (rgbbuf);
+
+ if (rl2_raster_data_to_1bit (raster, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected resut: get raw 1-BIT buffer: (RGB)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_2bit (raster, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected resut: get raw 2-BIT buffer: (RGB)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_4bit (raster, &rgbbuf, &rgbbuf_sz) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected resut: get raw 4-BIT buffer: (RGB)\n");
+ return 0;
+ }
+
+ rl2_destroy_raster (raster);
+
+ no_data = rl2_create_pixel (RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1);
+ if (no_data == NULL)
+ {
+ fprintf (stderr, "Unable to create a NoData pixel (MONOCHROME)\n");
+ return 0;
+ }
+
+ if (rl2_set_pixel_sample_1bit (no_data, 1) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to set NoData (MONOCHROME)\n");
+ return 0;
+ }
+
+ bufpix = malloc (256 * 256);
+ memset (bufpix, 0, 256 * 256);
+ raster =
+ rl2_create_raster (256, 256, RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1,
+ bufpix, 256 * 256, NULL, NULL, 0, no_data);
+
+ if (raster == NULL)
+ {
+ fprintf (stderr, "Unable to create raster (MONOCHROME)\n");
+ return 0;
+ }
+
+ if (rl2_raster_data_to_RGBA (raster, &rgbbuf, &rgbbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw RGBA buffer (MONOCHROME)\n");
+ return 0;
+ }
+ free (rgbbuf);
+
+ if (rl2_raster_data_to_ARGB (raster, &rgbbuf, &rgbbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw ARGB buffer (MONOCHROME)\n");
+ return 0;
+ }
+ free (rgbbuf);
+
+ if (rl2_raster_data_to_BGRA (raster, &rgbbuf, &rgbbuf_sz) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to get raw BGRA buffer (MONOCHROME)\n");
+ return 0;
+ }
+ free (rgbbuf);
+
+ rl2_destroy_raster (raster);
+
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ if (!test_no_alpha_webp ("./webp_no_alpha.webp"))
+ return -1;
+
+ return 0;
+}
diff --git a/test/test_wms1.c b/test/test_wms1.c
new file mode 100644
index 0000000..6885c2b
--- /dev/null
+++ b/test/test_wms1.c
@@ -0,0 +1,1811 @@
+/*
+
+ test_wms1.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+#include <float.h>
+#include <string.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2wms.h"
+
+static int
+test_GetCapabilities_tuscany (rl2WmsCachePtr cache)
+{
+/* testing GetCapabilities and friends [Tuscany] */
+ rl2WmsCatalogPtr catalog;
+ rl2WmsLayerPtr layer;
+ rl2WmsLayerPtr child;
+ char *err_msg = NULL;
+ const char *url;
+ int count;
+ const char *str;
+ int len;
+ int int_res;
+ double dbl_res;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+
+/* WMS GetCapabilities (valid) */
+ url =
+ "http://web.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsambamm&service=WMS&request=GetCapabilities";
+ catalog = create_wms_catalog (cache, url, NULL, &err_msg);
+ if (catalog == NULL)
+ {
+ fprintf (stderr, "Unable to create a WMS Catalog\n");
+ return -2;
+ }
+
+/* testing Layer */
+ count = get_wms_catalog_count (catalog);
+ if (count != 1)
+ {
+ fprintf (stderr, "CatalogCount: unexpected result %d\n", count);
+ return -3;
+ }
+ layer = get_wms_catalog_layer (catalog, 0);
+ if (layer == NULL)
+ {
+ fprintf (stderr, "GetWmsCatalogLayer: unexpected NULL\n");
+ return -4;
+ }
+ str = get_wms_layer_name (layer);
+ if (strcmp (str, "rt_ambamm") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerName: unexpected result \"%s\"\n", str);
+ return -5;
+ }
+ str = get_wms_layer_title (layer);
+ if (strcmp (str, "Geoscopio_wms AMBITI_AMMINISTRATIVI") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerTitle: unexpected result \"%s\"\n", str);
+ return -6;
+ }
+ str = get_wms_layer_abstract (layer);
+ len = strlen (str);
+ if (len != 435)
+ {
+ fprintf (stderr, "GetWmsLayerAbstract: unexpected result %d\n", len);
+ return -7;
+ }
+ int_res = is_wms_layer_opaque (layer);
+ if (int_res == 0)
+ {
+ fprintf (stderr, "IsWmsLayerOpaque: unexpected result %d\n", int_res);
+ return -8;
+ }
+ int_res = is_wms_layer_queryable (layer);
+ if (int_res == 0)
+ {
+ fprintf (stderr, "IsWmsLayerQueryable: unexpected result %d\n",
+ int_res);
+ return -9;
+ }
+ dbl_res = get_wms_layer_min_scale_denominator (layer);
+ if (dbl_res != 1.0)
+ {
+ fprintf (stderr,
+ "GetWmsLayerMinScaleDenominator: unexpected result %1.6f\n",
+ dbl_res);
+ return -10;
+ }
+ dbl_res = get_wms_layer_max_scale_denominator (layer);
+ if (dbl_res != 5000000.0)
+ {
+ fprintf (stderr,
+ "GetWmsLayerMaxScaleDenominator: unexpected result %1.6f\n",
+ dbl_res);
+ return -11;
+ }
+ if (get_wms_layer_geo_bbox (layer, &minx, &miny, &maxx, &maxy) != 1)
+ {
+ fprintf (stderr, "GetWmsLayerGeoBBox: unexpected result FALSE\n");
+ return -12;
+ }
+ else
+ {
+ if (maxx != 42.20980)
+ {
+ fprintf (stderr,
+ "GetWmsLayerGeoBBox (MaxX): unexpected result %1.8f\n",
+ maxx);
+ return -13;
+ }
+ }
+ count = get_wms_layer_crs_count (layer);
+ if (count != 5)
+ {
+ fprintf (stderr, "GetWmsLayerCrsCount: unexpected result %d\n",
+ count);
+ return -14;
+ }
+ str = get_wms_layer_crs (layer, 0);
+ if (strcmp (str, "EPSG:25832") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerCRS: unexpected result \"%s\"\n", str);
+ return -15;
+ }
+ if (get_wms_layer_bbox (layer, "EPSG:3003", &minx, &miny, &maxx, &maxy) !=
+ 1)
+ {
+ fprintf (stderr, "GetWmsLayerBBox: unexpected result FALSE\n");
+ return -16;
+ }
+ else
+ {
+ if (maxx != 4678330.0)
+ {
+ fprintf (stderr,
+ "GetWmsLayerBBox (MaxX): unexpected result %1.8f\n",
+ maxx);
+ return -17;
+ }
+ }
+ count = get_wms_layer_style_count (layer);
+ if (count != 0)
+ {
+ fprintf (stderr, "GetWmsLayerStyleCount: unexpected result %d\n",
+ count);
+ return -18;
+ }
+ str = get_wms_layer_style_name (layer, 0);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsLayerStyleName: unexpected result \"%s\"\n",
+ str);
+ return -19;
+ }
+ str = get_wms_layer_style_title (layer, 0);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsLayerStyleTitle: unexpected result \"%s\"\n",
+ str);
+ return -20;
+ }
+ str = get_wms_layer_style_abstract (layer, 0);
+ if (str != NULL)
+ {
+ fprintf (stderr,
+ "GetWmsLayerStyleAbstract: unexpected result \"%s\"\n", str);
+ return -21;
+ }
+ int_res = wms_layer_has_children (layer);
+ if (int_res != 1)
+ {
+ fprintf (stderr, "WmsLayerHasChildren: unexpected result %d\n",
+ int_res);
+ return -22;
+ }
+
+/* testing Child Layer */
+ count = get_wms_layer_children_count (layer);
+ if (count != 12)
+ {
+ fprintf (stderr, "GetWmsLayerChildrenCount: unexpected result %d\n",
+ count);
+ return -23;
+ }
+ child = get_wms_child_layer (layer, 0);
+ if (child == NULL)
+ {
+ fprintf (stderr, "GetWmsChildLayer: unexpected NULL\n");
+ return -24;
+ }
+ str = get_wms_layer_name (child);
+ if (strcmp (str, "rt_ambamm.idcomuni.rt.poly") != 0)
+ {
+ fprintf (stderr,
+ "GetWmsLayerTitle (Child): unexpected result \"%s\"\n", str);
+ return -25;
+ }
+ int_res = is_wms_layer_opaque (child);
+ if (int_res != 0)
+ {
+ fprintf (stderr, "IsWmsLayerOpaque (Child): unexpected result %d\n",
+ int_res);
+ return -26;
+ }
+ int_res = is_wms_layer_queryable (child);
+ if (int_res == 0)
+ {
+ fprintf (stderr,
+ "IsWmsLayerQueryable (Child): unexpected result %d\n",
+ int_res);
+ return -27;
+ }
+ if (get_wms_layer_geo_bbox (child, &minx, &miny, &maxx, &maxy) != 1)
+ {
+ fprintf (stderr,
+ "GetWmsLayerGeoBBox (Child): unexpected result FALSE\n");
+ return -28;
+ }
+ else
+ {
+ if (maxx != 42.20980)
+ {
+ fprintf (stderr,
+ "GetWmsLayerGeoBBox (Child-MaxX): unexpected result %1.8f\n",
+ maxx);
+ return -29;
+ }
+ }
+ count = get_wms_layer_crs_count (child);
+ if (count != 6)
+ {
+ fprintf (stderr,
+ "GetWmsLayerCrsCount (Child): unexpected result %d\n",
+ count);
+ return -30;
+ }
+ str = get_wms_layer_crs (child, 3);
+ if (strcmp (str, "EPSG:4326") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerCRS (Child): unexpected result \"%s\"\n",
+ str);
+ return -31;
+ }
+ count = get_wms_layer_style_count (child);
+ if (count != 9)
+ {
+ fprintf (stderr,
+ "GetWmsLayerStyleCount (Child): unexpected result %d\n",
+ count);
+ return -32;
+ }
+ str = get_wms_layer_style_name (child, 5);
+ if (strcmp (str, "contorno_avorio_con_etichette") != 0)
+ {
+ fprintf (stderr,
+ "GetWmsLayerStyleName (Child): unexpected result \"%s\"\n",
+ str);
+ return -33;
+ }
+
+/* testing Service */
+ str = get_wms_version (catalog);
+ if (strcmp (str, "1.3.0") != 0)
+ {
+ fprintf (stderr, "GetWmsVersion: unexpected result \"%s\"\n", str);
+ return -34;
+ }
+ str = get_wms_name (catalog);
+ if (strcmp (str, "WMS") != 0)
+ {
+ fprintf (stderr, "GetWmsName: unexpected result \"%s\"\n", str);
+ return -35;
+ }
+ str = get_wms_title (catalog);
+ if (strcmp (str, "Geoscopio_wms AMBITI_AMMINISTRATIVI") != 0)
+ {
+ fprintf (stderr, "GetWmsTitle: unexpected result \"%s\"\n", str);
+ return -36;
+ }
+ str = get_wms_abstract (catalog);
+ len = strlen (str);
+ if (len != 435)
+ {
+ fprintf (stderr, "GetWmsAbstract: unexpected result %d\n", len);
+ return -37;
+ }
+ str = get_wms_url_GetMap_get (catalog);
+ if (strcmp
+ (str,
+ "http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsambamm&map_resolution=91&")
+ != 0)
+ {
+ fprintf (stderr, "GetWmsGetMapGet: unexpected result \"%s\"\n", str);
+ return -38;
+ }
+ str = get_wms_url_GetMap_post (catalog);
+ if (strcmp
+ (str,
+ "http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsambamm&map_resolution=91&")
+ != 0)
+ {
+ fprintf (stderr, "GetWmsGetMapPost: unexpected result \"%s\"\n", str);
+ return -39;
+ }
+ str = get_wms_url_GetFeatureInfo_get (catalog);
+ if (strcmp
+ (str,
+ "http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsambamm&map_resolution=91&")
+ != 0)
+ {
+ fprintf (stderr,
+ "GetWmsGetFeatureInfoGet: unexpected result \"%s\"\n", str);
+ return -40;
+ }
+ str = get_wms_url_GetFeatureInfo_post (catalog);
+ if (strcmp
+ (str,
+ "http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsambamm&map_resolution=91&")
+ != 0)
+ {
+ fprintf (stderr,
+ "GetWmsGetFeatureInfoPost: unexpected result \"%s\"\n", str);
+ return -41;
+ }
+ str = get_wms_gml_mime_type (catalog);
+ if (strcmp (str, "application/vnd.ogc.gml") != 0)
+ {
+ fprintf (stderr, "GetWmsGmlMimeType: unexpected result \"%s\"\n",
+ str);
+ return -42;
+ }
+ str = get_wms_xml_mime_type (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsXmlMimeType: unexpected result \"%s\"\n",
+ str);
+ return -43;
+ }
+ str = get_wms_contact_person (catalog);
+ if (strcmp (str, "Sistema Informativo Territoriale ed Ambientale") != 0)
+ {
+ fprintf (stderr, "GetContactPerson: unexpected result \"%s\"\n", str);
+ return -44;
+ }
+ str = get_wms_contact_organization (catalog);
+ if (strcmp
+ (str,
+ "Regione Toscana - Direzione Generale Governo del territorio") != 0)
+ {
+ fprintf (stderr, "GetContactOrganization: unexpected result \"%s\"\n",
+ str);
+ return -45;
+ }
+ str = get_wms_contact_position (catalog);
+ if (strcmp (str, "custodian") != 0)
+ {
+ fprintf (stderr, "GetContactPosition: unexpected result \"%s\"\n",
+ str);
+ return -46;
+ }
+ str = get_wms_contact_postal_address (catalog);
+ if (strcmp (str, "Via di Novoli, 26") != 0)
+ {
+ fprintf (stderr,
+ "GetContactPostalAddress: unexpected result \"%s\"\n", str);
+ return -47;
+ }
+ str = get_wms_contact_city (catalog);
+ if (strcmp (str, "Firenze") != 0)
+ {
+ fprintf (stderr, "GetContactCity: unexpected result \"%s\"\n", str);
+ return -48;
+ }
+ str = get_wms_contact_state_province (catalog);
+ if (strcmp (str, "Regione Toscana") != 0)
+ {
+ fprintf (stderr,
+ "GetContactStateProvince: unexpected result \"%s\"\n", str);
+ return -49;
+ }
+ str = get_wms_contact_post_code (catalog);
+ if (strcmp (str, "50127") != 0)
+ {
+ fprintf (stderr, "GetContactPostCode: unexpected result \"%s\"\n",
+ str);
+ return -50;
+ }
+ str = get_wms_contact_country (catalog);
+ if (strcmp (str, "English") != 0)
+ {
+ fprintf (stderr, "GetContactCountry: unexpected result \"%s\"\n",
+ str);
+ return -51;
+ }
+ str = get_wms_contact_voice_telephone (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr,
+ "GetContactVoiceTelephone: unexpected result \"%s\"\n", str);
+ return -52;
+ }
+ str = get_wms_contact_fax_telephone (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetContactFaxTelephone: unexpected result \"%s\"\n",
+ str);
+ return -53;
+ }
+ str = get_wms_contact_email_address (catalog);
+ if (strcmp (str, "servizio.geografico at regione.toscana.it") != 0)
+ {
+ fprintf (stderr, "GetContactEMailAddress: unexpected result \"%s\"\n",
+ str);
+ return -54;
+ }
+ str = get_wms_fees (catalog);
+ if (strcmp (str, "none") != 0)
+ {
+ fprintf (stderr, "GetFees: unexpected result \"%s\"\n", str);
+ return -55;
+ }
+ str = get_wms_access_constraints (catalog);
+ if (strcmp (str, "none") != 0)
+ {
+ fprintf (stderr, "GetAccessConstraints: unexpected result \"%s\"\n",
+ str);
+ return -56;
+ }
+ int_res = get_wms_layer_limit (catalog);
+ if (int_res != 20)
+ {
+ fprintf (stderr, "GetLayerLimit: unexpected result %d\n", int_res);
+ return -57;
+ }
+ int_res = get_wms_max_width (catalog);
+ if (int_res != 4096)
+ {
+ fprintf (stderr, "GetMaxWidth: unexpected result %d\n", int_res);
+ return -58;
+ }
+ int_res = get_wms_max_height (catalog);
+ if (int_res != 4096)
+ {
+ fprintf (stderr, "GetMaxHeight: unexpected result %d\n", int_res);
+ return -59;
+ }
+ int_res = get_wms_format_count (catalog, 0);
+ if (int_res != 8)
+ {
+ fprintf (stderr, "GetWmsFormatCount: unexpected result %d\n",
+ int_res);
+ return -60;
+ }
+ str = get_wms_format (catalog, 2, 0);
+ if (strcmp (str, "image/jpeg") != 0)
+ {
+ fprintf (stderr, "GetWmsFormat: unexpected result \"%s\"\n", str);
+ return -61;
+ }
+
+/* destroying the WMS-Catalog */
+ destroy_wms_catalog (catalog);
+
+ return 0;
+}
+
+static int
+test_GetCapabilities_arizona (rl2WmsCachePtr cache)
+{
+/* testing GetCapabilities and friends [USGS Arizona] */
+ rl2WmsCatalogPtr catalog;
+ rl2WmsLayerPtr layer;
+ rl2WmsLayerPtr child;
+ char *err_msg = NULL;
+ const char *url;
+ int count;
+ const char *str;
+ int int_res;
+ double dbl_res;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+
+/* WMS GetCapabilities (valid) */
+ url =
+ "http://mrdata.usgs.gov/services/az?request=getcapabilities&service=WMS&version=1.1.1";
+ catalog = create_wms_catalog (cache, url, NULL, &err_msg);
+ if (catalog == NULL)
+ {
+ fprintf (stderr, "Unable to create a WMS Catalog\n");
+ return -102;
+ }
+
+/* testing Layer */ ;
+ count = get_wms_catalog_count (catalog);
+ if (count != 1)
+ {
+ fprintf (stderr, "CatalogCount: unexpected result %d\n", count);
+ return -103;
+ }
+ layer = get_wms_catalog_layer (catalog, 0);
+ if (layer == NULL)
+ {
+ fprintf (stderr, "GetWmsCatalogLayer: unexpected NULL\n");
+ return -104;
+ }
+ str = get_wms_layer_name (layer);
+ if (strcmp (str, "Arizona_Geology") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerName: unexpected result \"%s\"\n", str);
+ return -105;
+ }
+ str = get_wms_layer_title (layer);
+ if (strcmp (str, "Arizona_Geology") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerTitle: unexpected result \"%s\"\n", str);
+ return -106;
+ }
+ str = get_wms_layer_abstract (layer);
+ if (strcmp (str, "Arizona_Geology") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerAbstract: unexpected result \"%s\"\n",
+ str);
+ return -107;
+ }
+ int_res = is_wms_layer_opaque (layer);
+ if (int_res == 0)
+ {
+ fprintf (stderr, "IsWmsLayerOpaque: unexpected result %d\n", int_res);
+ return -108;
+ }
+ int_res = is_wms_layer_queryable (layer);
+ if (int_res == 0)
+ {
+ fprintf (stderr, "IsWmsLayerQueryable: unexpected result %d\n",
+ int_res);
+ return -109;
+ }
+ dbl_res = get_wms_layer_min_scale_denominator (layer);
+ if (dbl_res != DBL_MAX)
+ {
+ fprintf (stderr,
+ "GetWmsLayerMinScaleDenominator: unexpected result %1.6f\n",
+ dbl_res);
+ return -110;
+ }
+ dbl_res = get_wms_layer_max_scale_denominator (layer);
+ if (dbl_res != DBL_MAX)
+ {
+ fprintf (stderr,
+ "GetWmsLayerMaxScaleDenominator: unexpected result %1.6f\n",
+ dbl_res);
+ return -111;
+ }
+ if (get_wms_layer_geo_bbox (layer, &minx, &miny, &maxx, &maxy) != 1)
+ {
+ fprintf (stderr, "GetWmsLayerGeoBBox: unexpected result FALSE\n");
+ return -112;
+ }
+ count = get_wms_layer_crs_count (layer);
+ if (count != 6)
+ {
+ fprintf (stderr, "GetWmsLayerCrsCount: unexpected result %d\n",
+ count);
+ return -114;
+ }
+ str = get_wms_layer_crs (layer, 0);
+ if (strcmp (str, "EPSG:4267") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerCRS: unexpected result \"%s\"\n", str);
+ return -115;
+ }
+ if (get_wms_layer_bbox (layer, "EPSG:3003", &minx, &miny, &maxx, &maxy) ==
+ 1)
+ {
+ fprintf (stderr, "GetWmsLayerBBox: unexpected result TRUE\n");
+ return -116;
+ }
+ count = get_wms_layer_style_count (layer);
+ if (count != 0)
+ {
+ fprintf (stderr, "GetWmsLayerStyleCount: unexpected result %d\n",
+ count);
+ return -118;
+ }
+ str = get_wms_layer_style_name (layer, 0);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsLayerStyleName: unexpected result \"%s\"\n",
+ str);
+ return -119;
+ }
+ str = get_wms_layer_style_title (layer, 0);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsLayerStyleTitle: unexpected result \"%s\"\n",
+ str);
+ return -120;
+ }
+ str = get_wms_layer_style_abstract (layer, 0);
+ if (str != NULL)
+ {
+ fprintf (stderr,
+ "GetWmsLayerStyleAbstract: unexpected result \"%s\"\n", str);
+ return -121;
+ }
+ int_res = wms_layer_has_children (layer);
+ if (int_res != 1)
+ {
+ fprintf (stderr, "WmsLayerHasChildren: unexpected result %d\n",
+ int_res);
+ return -122;
+ }
+
+/* testing Child Layer */
+ count = get_wms_layer_children_count (layer);
+ if (count != 4)
+ {
+ fprintf (stderr, "GetWmsLayerChildrenCount: unexpected result %d\n",
+ count);
+ return -123;
+ }
+ child = get_wms_child_layer (layer, 0);
+ if (child == NULL)
+ {
+ fprintf (stderr, "GetWmsChildLayer: unexpected NULL\n");
+ return -124;
+ }
+ str = get_wms_layer_name (child);
+ if (strcmp (str, "Arizona_Lithology") != 0)
+ {
+ fprintf (stderr,
+ "GetWmsLayerTitle (Child): unexpected result \"%s\"\n", str);
+ return -125;
+ }
+ int_res = is_wms_layer_opaque (child);
+ if (int_res != -1)
+ {
+ fprintf (stderr, "IsWmsLayerOpaque (Child): unexpected result %d\n",
+ int_res);
+ return -126;
+ }
+ int_res = is_wms_layer_queryable (child);
+ if (int_res == 0)
+ {
+ fprintf (stderr,
+ "IsWmsLayerQueryable (Child): unexpected result %d\n",
+ int_res);
+ return -127;
+ }
+ if (get_wms_layer_geo_bbox (child, &minx, &miny, &maxx, &maxy) != 1)
+ {
+ fprintf (stderr,
+ "GetWmsLayerGeoBBox (Child): unexpected result FALSE\n");
+ return -128;
+ }
+ count = get_wms_layer_crs_count (child);
+ if (count != 6)
+ {
+ fprintf (stderr,
+ "GetWmsLayerCrsCount (Child): unexpected result %d\n",
+ count);
+ return -130;
+ }
+ str = get_wms_layer_crs (child, 3);
+ if (strcmp (str, "EPSG:3857") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerCRS (Child): unexpected result \"%s\"\n",
+ str);
+ return -131;
+ }
+ count = get_wms_layer_style_count (child);
+ if (count != 1)
+ {
+ fprintf (stderr,
+ "GetWmsLayerStyleCount (Child): unexpected result %d\n",
+ count);
+ return -132;
+ }
+ str = get_wms_layer_style_name (child, 0);
+ if (strcmp (str, "default") != 0)
+ {
+ fprintf (stderr,
+ "GetWmsLayerStyleName (Child): unexpected result \"%s\"\n",
+ str);
+ return -133;
+ }
+
+/* testing Service */
+ str = get_wms_version (catalog);
+ if (strcmp (str, "1.1.1") != 0)
+ {
+ fprintf (stderr, "GetWmsVersion: unexpected result \"%s\"\n", str);
+ return -134;
+ }
+ str = get_wms_name (catalog);
+ if (strcmp (str, "OGC:WMS") != 0)
+ {
+ fprintf (stderr, "GetWmsName: unexpected result \"%s\"\n", str);
+ return -135;
+ }
+ str = get_wms_title (catalog);
+ if (strcmp (str, "Arizona_Geology") != 0)
+ {
+ fprintf (stderr, "GetWmsTitle: unexpected result \"%s\"\n", str);
+ return -136;
+ }
+ str = get_wms_abstract (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsAbstract: unexpected result \"%s\"\n", str);
+ return -137;
+ }
+ str = get_wms_url_GetMap_get (catalog);
+ if (strcmp (str, "http://mrdata.usgs.gov/services/az?") != 0)
+ {
+ fprintf (stderr, "GetWmsGetMapGet: unexpected result \"%s\"\n", str);
+ return -138;
+ }
+ str = get_wms_url_GetMap_post (catalog);
+ if (strcmp (str, "http://mrdata.usgs.gov/services/az?") != 0)
+ {
+ fprintf (stderr, "GetWmsGetMapPost: unexpected result \"%s\"\n", str);
+ return -139;
+ }
+ str = get_wms_url_GetFeatureInfo_get (catalog);
+ if (strcmp (str, "http://mrdata.usgs.gov/services/az?") != 0)
+ {
+ fprintf (stderr,
+ "GetWmsGetFeatureInfoGet: unexpected result \"%s\"\n", str);
+ return -140;
+ }
+ str = get_wms_url_GetFeatureInfo_post (catalog);
+ if (strcmp (str, "http://mrdata.usgs.gov/services/az?") != 0)
+ {
+ fprintf (stderr,
+ "GetWmsGetFeatureInfoPost: unexpected result \"%s\"\n", str);
+ return -141;
+ }
+ str = get_wms_gml_mime_type (catalog);
+ if (strcmp (str, "application/vnd.ogc.gml") != 0)
+ {
+ fprintf (stderr, "GetWmsGmlMimeType: unexpected result \"%s\"\n",
+ str);
+ return -142;
+ }
+ str = get_wms_xml_mime_type (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsXmlMimeType: unexpected result \"%s\"\n",
+ str);
+ return -143;
+ }
+ str = get_wms_contact_person (catalog);
+ if (strcmp (str, "Peter N. Schweitzer") != 0)
+ {
+ fprintf (stderr, "GetContactPerson: unexpected result \"%s\"\n", str);
+ return -144;
+ }
+ str = get_wms_contact_organization (catalog);
+ if (strcmp (str, "U.S. Geological Survey Mineral Resources Program") != 0)
+ {
+ fprintf (stderr, "GetContactOrganization: unexpected result \"%s\"\n",
+ str);
+ return -145;
+ }
+ str = get_wms_contact_position (catalog);
+ if (strcmp (str, "Geologist") != 0)
+ {
+ fprintf (stderr, "GetContactPosition: unexpected result \"%s\"\n",
+ str);
+ return -146;
+ }
+ str = get_wms_contact_postal_address (catalog);
+ if (strcmp (str, "Mail Stop 954 USGS National Center") != 0)
+ {
+ fprintf (stderr,
+ "GetContactPostalAddress: unexpected result \"%s\"\n", str);
+ return -147;
+ }
+ str = get_wms_contact_city (catalog);
+ if (strcmp (str, "Reston") != 0)
+ {
+ fprintf (stderr, "GetContactCity: unexpected result \"%s\"\n", str);
+ return -148;
+ }
+ str = get_wms_contact_state_province (catalog);
+ if (strcmp (str, "VA") != 0)
+ {
+ fprintf (stderr,
+ "GetContactStateProvince: unexpected result \"%s\"\n", str);
+ return -149;
+ }
+ str = get_wms_contact_post_code (catalog);
+ if (strcmp (str, "20192") != 0)
+ {
+ fprintf (stderr, "GetContactPostCode: unexpected result \"%s\"\n",
+ str);
+ return -150;
+ }
+ str = get_wms_contact_country (catalog);
+ if (strcmp (str, "USA") != 0)
+ {
+ fprintf (stderr, "GetContactCountry: unexpected result \"%s\"\n",
+ str);
+ return -151;
+ }
+ str = get_wms_contact_voice_telephone (catalog);
+ if (strcmp (str, "703-648-6533") != 0)
+ {
+ fprintf (stderr,
+ "GetContactVoiceTelephone: unexpected result \"%s\"\n", str);
+ return -152;
+ }
+ str = get_wms_contact_fax_telephone (catalog);
+ if (strcmp (str, "703-648-6252") != 0)
+ {
+ fprintf (stderr, "GetContactFaxTelephone: unexpected result \"%s\"\n",
+ str);
+ return -153;
+ }
+ str = get_wms_contact_email_address (catalog);
+ if (strcmp (str, "pschweitzer at usgs.gov") != 0)
+ {
+ fprintf (stderr, "GetContactEMailAddress: unexpected result \"%s\"\n",
+ str);
+ return -154;
+ }
+ str = get_wms_fees (catalog);
+ if (strcmp (str, "none") != 0)
+ {
+ fprintf (stderr, "GetFees: unexpected result \"%s\"\n", str);
+ return -155;
+ }
+ str = get_wms_access_constraints (catalog);
+ if (strcmp (str, "none") != 0)
+ {
+ fprintf (stderr, "GetAccessConstraints: unexpected result \"%s\"\n",
+ str);
+ return -156;
+ }
+ int_res = get_wms_layer_limit (catalog);
+ if (int_res != -1)
+ {
+ fprintf (stderr, "GetLayerLimit: unexpected result %d\n", int_res);
+ return -157;
+ }
+ int_res = get_wms_max_width (catalog);
+ if (int_res != -1)
+ {
+ fprintf (stderr, "GetMaxWidth: unexpected result %d\n", int_res);
+ return -158;
+ }
+ int_res = get_wms_max_height (catalog);
+ if (int_res != -1)
+ {
+ fprintf (stderr, "GetMaxHeight: unexpected result %d\n", int_res);
+ return -159;
+ }
+ int_res = get_wms_format_count (catalog, 0);
+ if (int_res != 9)
+ {
+ fprintf (stderr, "GetWmsFormatCount: unexpected result %d\n",
+ int_res);
+ return -160;
+ }
+ str = get_wms_format (catalog, 2, 0);
+ if (strcmp (str, "image/gif") != 0)
+ {
+ fprintf (stderr, "GetWmsFormat: unexpected result \"%s\"\n", str);
+ return -161;
+ }
+
+/* destroying the WMS-Catalog */
+ destroy_wms_catalog (catalog);
+
+ return 0;
+}
+
+static int
+test_GetCapabilities_rer (rl2WmsCachePtr cache)
+{
+/* testing GetCapabilities and friends [RER] */
+ rl2WmsCatalogPtr catalog;
+ rl2WmsLayerPtr layer;
+ rl2WmsLayerPtr child;
+ char *err_msg = NULL;
+ const char *url;
+ int count;
+ const char *str;
+ int int_res;
+ double dbl_res;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+
+/* WMS GetCapabilities (valid) */
+ url =
+ "http://mrdata.usgs.gov/services/az?request=getcapabilities&service=WMS&version=1.1.1";
+ catalog = create_wms_catalog (cache, url, NULL, &err_msg);
+ if (catalog == NULL)
+ {
+ fprintf (stderr, "Unable to create a WMS Catalog\n");
+ return -102;
+ }
+
+/* testing Layer */ ;
+ count = get_wms_catalog_count (catalog);
+ if (count != 1)
+ {
+ fprintf (stderr, "CatalogCount: unexpected result %d\n", count);
+ return -103;
+ }
+ layer = get_wms_catalog_layer (catalog, 0);
+ if (layer == NULL)
+ {
+ fprintf (stderr, "GetWmsCatalogLayer: unexpected NULL\n");
+ return -104;
+ }
+ str = get_wms_layer_name (layer);
+ if (strcmp (str, "Arizona_Geology") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerName: unexpected result \"%s\"\n", str);
+ return -105;
+ }
+ str = get_wms_layer_title (layer);
+ if (strcmp (str, "Arizona_Geology") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerTitle: unexpected result \"%s\"\n", str);
+ return -106;
+ }
+ str = get_wms_layer_abstract (layer);
+ if (strcmp (str, "Arizona_Geology") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerAbstract: unexpected result \"%s\"\n",
+ str);
+ return -107;
+ }
+ int_res = is_wms_layer_opaque (layer);
+ if (int_res == 0)
+ {
+ fprintf (stderr, "IsWmsLayerOpaque: unexpected result %d\n", int_res);
+ return -108;
+ }
+ int_res = is_wms_layer_queryable (layer);
+ if (int_res == 0)
+ {
+ fprintf (stderr, "IsWmsLayerQueryable: unexpected result %d\n",
+ int_res);
+ return -109;
+ }
+ dbl_res = get_wms_layer_min_scale_denominator (layer);
+ if (dbl_res != DBL_MAX)
+ {
+ fprintf (stderr,
+ "GetWmsLayerMinScaleDenominator: unexpected result %1.6f\n",
+ dbl_res);
+ return -110;
+ }
+ dbl_res = get_wms_layer_max_scale_denominator (layer);
+ if (dbl_res != DBL_MAX)
+ {
+ fprintf (stderr,
+ "GetWmsLayerMaxScaleDenominator: unexpected result %1.6f\n",
+ dbl_res);
+ return -111;
+ }
+ if (get_wms_layer_geo_bbox (layer, &minx, &miny, &maxx, &maxy) != 1)
+ {
+ fprintf (stderr, "GetWmsLayerGeoBBox: unexpected result FALSE\n");
+ return -112;
+ }
+ count = get_wms_layer_crs_count (layer);
+ if (count != 6)
+ {
+ fprintf (stderr, "GetWmsLayerCrsCount: unexpected result %d\n",
+ count);
+ return -114;
+ }
+ str = get_wms_layer_crs (layer, 0);
+ if (strcmp (str, "EPSG:4267") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerCRS: unexpected result \"%s\"\n", str);
+ return -115;
+ }
+ if (get_wms_layer_bbox (layer, "EPSG:3003", &minx, &miny, &maxx, &maxy) ==
+ 1)
+ {
+ fprintf (stderr, "GetWmsLayerBBox: unexpected result TRUE\n");
+ return -116;
+ }
+ count = get_wms_layer_style_count (layer);
+ if (count != 0)
+ {
+ fprintf (stderr, "GetWmsLayerStyleCount: unexpected result %d\n",
+ count);
+ return -118;
+ }
+ str = get_wms_layer_style_name (layer, 0);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsLayerStyleName: unexpected result \"%s\"\n",
+ str);
+ return -119;
+ }
+ str = get_wms_layer_style_title (layer, 0);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsLayerStyleTitle: unexpected result \"%s\"\n",
+ str);
+ return -120;
+ }
+ str = get_wms_layer_style_abstract (layer, 0);
+ if (str != NULL)
+ {
+ fprintf (stderr,
+ "GetWmsLayerStyleAbstract: unexpected result \"%s\"\n", str);
+ return -121;
+ }
+ int_res = wms_layer_has_children (layer);
+ if (int_res != 1)
+ {
+ fprintf (stderr, "WmsLayerHasChildren: unexpected result %d\n",
+ int_res);
+ return -122;
+ }
+
+/* testing Child Layer */
+ count = get_wms_layer_children_count (layer);
+ if (count != 4)
+ {
+ fprintf (stderr, "GetWmsLayerChildrenCount: unexpected result %d\n",
+ count);
+ return -123;
+ }
+ child = get_wms_child_layer (layer, 0);
+ if (child == NULL)
+ {
+ fprintf (stderr, "GetWmsChildLayer: unexpected NULL\n");
+ return -124;
+ }
+ str = get_wms_layer_name (child);
+ if (strcmp (str, "Arizona_Lithology") != 0)
+ {
+ fprintf (stderr,
+ "GetWmsLayerTitle (Child): unexpected result \"%s\"\n", str);
+ return -125;
+ }
+ int_res = is_wms_layer_opaque (child);
+ if (int_res != -1)
+ {
+ fprintf (stderr, "IsWmsLayerOpaque (Child): unexpected result %d\n",
+ int_res);
+ return -126;
+ }
+ int_res = is_wms_layer_queryable (child);
+ if (int_res == 0)
+ {
+ fprintf (stderr,
+ "IsWmsLayerQueryable (Child): unexpected result %d\n",
+ int_res);
+ return -127;
+ }
+ if (get_wms_layer_geo_bbox (child, &minx, &miny, &maxx, &maxy) != 1)
+ {
+ fprintf (stderr,
+ "GetWmsLayerGeoBBox (Child): unexpected result FALSE\n");
+ return -128;
+ }
+ count = get_wms_layer_crs_count (child);
+ if (count != 6)
+ {
+ fprintf (stderr,
+ "GetWmsLayerCrsCount (Child): unexpected result %d\n",
+ count);
+ return -130;
+ }
+ str = get_wms_layer_crs (child, 3);
+ if (strcmp (str, "EPSG:3857") != 0)
+ {
+ fprintf (stderr, "GetWmsLayerCRS (Child): unexpected result \"%s\"\n",
+ str);
+ return -131;
+ }
+ count = get_wms_layer_style_count (child);
+ if (count != 1)
+ {
+ fprintf (stderr,
+ "GetWmsLayerStyleCount (Child): unexpected result %d\n",
+ count);
+ return -132;
+ }
+ str = get_wms_layer_style_name (child, 0);
+ if (strcmp (str, "default") != 0)
+ {
+ fprintf (stderr,
+ "GetWmsLayerStyleName (Child): unexpected result \"%s\"\n",
+ str);
+ return -133;
+ }
+
+/* testing Service */
+ str = get_wms_version (catalog);
+ if (strcmp (str, "1.1.1") != 0)
+ {
+ fprintf (stderr, "GetWmsVersion: unexpected result \"%s\"\n", str);
+ return -134;
+ }
+ str = get_wms_name (catalog);
+ if (strcmp (str, "OGC:WMS") != 0)
+ {
+ fprintf (stderr, "GetWmsName: unexpected result \"%s\"\n", str);
+ return -135;
+ }
+ str = get_wms_title (catalog);
+ if (strcmp (str, "Arizona_Geology") != 0)
+ {
+ fprintf (stderr, "GetWmsTitle: unexpected result \"%s\"\n", str);
+ return -136;
+ }
+ str = get_wms_abstract (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsAbstract: unexpected result \"%s\"\n", str);
+ return -137;
+ }
+ str = get_wms_url_GetMap_get (catalog);
+ if (strcmp (str, "http://mrdata.usgs.gov/services/az?") != 0)
+ {
+ fprintf (stderr, "GetWmsGetMapGet: unexpected result \"%s\"\n", str);
+ return -138;
+ }
+ str = get_wms_url_GetMap_post (catalog);
+ if (strcmp (str, "http://mrdata.usgs.gov/services/az?") != 0)
+ {
+ fprintf (stderr, "GetWmsGetMapPost: unexpected result \"%s\"\n", str);
+ return -139;
+ }
+ str = get_wms_url_GetFeatureInfo_get (catalog);
+ if (strcmp (str, "http://mrdata.usgs.gov/services/az?") != 0)
+ {
+ fprintf (stderr,
+ "GetWmsGetFeatureInfoGet: unexpected result \"%s\"\n", str);
+ return -140;
+ }
+ str = get_wms_url_GetFeatureInfo_post (catalog);
+ if (strcmp (str, "http://mrdata.usgs.gov/services/az?") != 0)
+ {
+ fprintf (stderr,
+ "GetWmsGetFeatureInfoPost: unexpected result \"%s\"\n", str);
+ return -141;
+ }
+ str = get_wms_gml_mime_type (catalog);
+ if (strcmp (str, "application/vnd.ogc.gml") != 0)
+ {
+ fprintf (stderr, "GetWmsGmlMimeType: unexpected result \"%s\"\n",
+ str);
+ return -142;
+ }
+ str = get_wms_xml_mime_type (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsXmlMimeType: unexpected result \"%s\"\n",
+ str);
+ return -143;
+ }
+ str = get_wms_contact_person (catalog);
+ if (strcmp (str, "Peter N. Schweitzer") != 0)
+ {
+ fprintf (stderr, "GetContactPerson: unexpected result \"%s\"\n", str);
+ return -144;
+ }
+ str = get_wms_contact_organization (catalog);
+ if (strcmp (str, "U.S. Geological Survey Mineral Resources Program") != 0)
+ {
+ fprintf (stderr, "GetContactOrganization: unexpected result \"%s\"\n",
+ str);
+ return -145;
+ }
+ str = get_wms_contact_position (catalog);
+ if (strcmp (str, "Geologist") != 0)
+ {
+ fprintf (stderr, "GetContactPosition: unexpected result \"%s\"\n",
+ str);
+ return -146;
+ }
+ str = get_wms_contact_postal_address (catalog);
+ if (strcmp (str, "Mail Stop 954 USGS National Center") != 0)
+ {
+ fprintf (stderr,
+ "GetContactPostalAddress: unexpected result \"%s\"\n", str);
+ return -147;
+ }
+ str = get_wms_contact_city (catalog);
+ if (strcmp (str, "Reston") != 0)
+ {
+ fprintf (stderr, "GetContactCity: unexpected result \"%s\"\n", str);
+ return -148;
+ }
+ str = get_wms_contact_state_province (catalog);
+ if (strcmp (str, "VA") != 0)
+ {
+ fprintf (stderr,
+ "GetContactStateProvince: unexpected result \"%s\"\n", str);
+ return -149;
+ }
+ str = get_wms_contact_post_code (catalog);
+ if (strcmp (str, "20192") != 0)
+ {
+ fprintf (stderr, "GetContactPostCode: unexpected result \"%s\"\n",
+ str);
+ return -150;
+ }
+ str = get_wms_contact_country (catalog);
+ if (strcmp (str, "USA") != 0)
+ {
+ fprintf (stderr, "GetContactCountry: unexpected result \"%s\"\n",
+ str);
+ return -151;
+ }
+ str = get_wms_contact_voice_telephone (catalog);
+ if (strcmp (str, "703-648-6533") != 0)
+ {
+ fprintf (stderr,
+ "GetContactVoiceTelephone: unexpected result \"%s\"\n", str);
+ return -152;
+ }
+ str = get_wms_contact_fax_telephone (catalog);
+ if (strcmp (str, "703-648-6252") != 0)
+ {
+ fprintf (stderr, "GetContactFaxTelephone: unexpected result \"%s\"\n",
+ str);
+ return -153;
+ }
+ str = get_wms_contact_email_address (catalog);
+ if (strcmp (str, "pschweitzer at usgs.gov") != 0)
+ {
+ fprintf (stderr, "GetContactEMailAddress: unexpected result \"%s\"\n",
+ str);
+ return -154;
+ }
+ str = get_wms_fees (catalog);
+ if (strcmp (str, "none") != 0)
+ {
+ fprintf (stderr, "GetFees: unexpected result \"%s\"\n", str);
+ return -155;
+ }
+ str = get_wms_access_constraints (catalog);
+ if (strcmp (str, "none") != 0)
+ {
+ fprintf (stderr, "GetAccessConstraints: unexpected result \"%s\"\n",
+ str);
+ return -156;
+ }
+ int_res = get_wms_layer_limit (catalog);
+ if (int_res != -1)
+ {
+ fprintf (stderr, "GetLayerLimit: unexpected result %d\n", int_res);
+ return -157;
+ }
+ int_res = get_wms_max_width (catalog);
+ if (int_res != -1)
+ {
+ fprintf (stderr, "GetMaxWidth: unexpected result %d\n", int_res);
+ return -158;
+ }
+ int_res = get_wms_max_height (catalog);
+ if (int_res != -1)
+ {
+ fprintf (stderr, "GetMaxHeight: unexpected result %d\n", int_res);
+ return -159;
+ }
+ int_res = get_wms_format_count (catalog, 0);
+ if (int_res != 9)
+ {
+ fprintf (stderr, "GetWmsFormatCount: unexpected result %d\n",
+ int_res);
+ return -160;
+ }
+ str = get_wms_format (catalog, 2, 0);
+ if (strcmp (str, "image/gif") != 0)
+ {
+ fprintf (stderr, "GetWmsFormat: unexpected result \"%s\"\n", str);
+ return -161;
+ }
+
+/* destroying the WMS-Catalog */
+ destroy_wms_catalog (catalog);
+
+ return 0;
+}
+
+static int
+test_GetFeatureInfo_gml ()
+{
+/* testing GetFeatureInfo and friends [GML] */
+ rl2WmsFeatureCollectionPtr coll;
+ rl2WmsFeatureMemberPtr ftr;
+ const char *url;
+ char *err_msg = NULL;
+ int count;
+ const char *str;
+ int ret;
+ double mx;
+ double my;
+ double ratio;
+ sqlite3 *sqlite;
+ gaiaGeomCollPtr geom;
+ void *cache = spatialite_alloc_connection ();
+
+ ret =
+ sqlite3_open_v2 (":memory:", &sqlite,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "cannot open in-memory db: %s\n",
+ sqlite3_errmsg (sqlite));
+ sqlite3_close (sqlite);
+ return -200;
+ }
+
+ spatialite_init_ex (sqlite, cache, 0);
+
+ url =
+ "http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsambamm&map_resolution=91&";
+ coll =
+ do_wms_GetFeatureInfo_get (url, NULL, "1.3.0", "text/gml",
+ "rt_ambamm.idcomuni.rt.poly", "EPSG:3003", 0,
+ 1590122.238032, 4727226.777078,
+ 1618469.603808, 4752914.550184, 437, 396,
+ 257, 219, &err_msg);
+ if (coll == NULL)
+ {
+ fprintf (stderr, "GetFeatureInfo (GML): unexpected NULL\n");
+ return -201;
+ }
+/* preparing Geometries */
+ ratio = (1618469.603808 - 1590122.238032) / (double) 437;
+ mx = 1590122.238032 + ((double) 396 * ratio);
+ my = 4752914.550184 - ((double) 219 * ratio);
+ wms_feature_collection_parse_geometries (coll, 3003, mx, my, sqlite);
+
+/* testing Feature Member */
+ count = get_wms_feature_members_count (coll);
+ if (count != 1)
+ {
+ fprintf (stderr,
+ "GetFeatureMembersCount (GML): unexpected result %d\n",
+ count);
+ return -202;
+ }
+ ftr = get_wms_feature_member (coll, 0);
+ if (ftr == NULL)
+ {
+ fprintf (stderr, "GetFeatureMember (GML): unexpected NULL\n");
+ return -203;
+ }
+ count = get_wms_feature_attributes_count (ftr);
+ if (count != 7)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeCount (GML): unexpected result %d\n",
+ count);
+ return -204;
+ }
+ str = get_wms_feature_attribute_name (ftr, 0);
+ if (strcmp (str, "geometryProperty") != 0)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeName (GML-Geom): unexpected result \"%s\"\n",
+ str);
+ return -205;
+ }
+ str = get_wms_feature_attribute_value (ftr, 0);
+ count = strlen (str);
+ if (count != 501788)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeValue (GML-Geom): unexpected lenght %d\n",
+ count);
+ return -206;
+ }
+ geom = get_wms_feature_attribute_geometry (ftr, 0);
+ if (geom == NULL)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeValue (GML-Geom): unexpected NULL\n");
+ return -207;
+ }
+ else if (geom->Srid != 3003)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeValue (GML-Geom): unexpected SRID %d\n",
+ geom->Srid);
+ return -208;
+ }
+ str = get_wms_feature_attribute_name (ftr, 4);
+ if (strcmp (str, "CODCOM") != 0)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeName (GML): unexpected result \"%s\"\n",
+ str);
+ return -209;
+ }
+ str = get_wms_feature_attribute_value (ftr, 4);
+ if (strcmp (str, "049014") != 0)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeValue (GML): unexpected result \"%s\"\n",
+ str);
+ return -210;
+ }
+ geom = get_wms_feature_attribute_geometry (ftr, 4);
+ if (geom != NULL)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeValue (GML-Geom): unexpected result\n");
+ return -211;
+ }
+
+/* destroying the Feature Collection */
+ destroy_wms_feature_collection (coll);
+
+/* closing SQLite/SpatiaLite */
+ ret = sqlite3_close (sqlite);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_close() error: %s\n",
+ sqlite3_errmsg (sqlite));
+ return -212;
+ }
+ spatialite_cleanup_ex (cache);
+
+ return 0;
+}
+
+static int
+test_GetFeatureInfo_xml ()
+{
+/* testing GetFeatureInfo and friends [XML] */
+ rl2WmsFeatureCollectionPtr coll;
+ rl2WmsFeatureMemberPtr ftr;
+ const char *url;
+ char *err_msg = NULL;
+ int count;
+ const char *str;
+ int ret;
+ double mx;
+ double my;
+ double ratio;
+ sqlite3 *sqlite;
+ gaiaGeomCollPtr geom;
+ void *cache = spatialite_alloc_connection ();
+
+ ret =
+ sqlite3_open_v2 (":memory:", &sqlite,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "cannot open in-memory db: %s\n",
+ sqlite3_errmsg (sqlite));
+ sqlite3_close (sqlite);
+ return -300;
+ }
+
+ spatialite_init_ex (sqlite, cache, 0);
+
+ url = "http://servizigis.regione.emilia-romagna.it/wms/dbtr2008?";
+ coll =
+ do_wms_GetFeatureInfo_get (url, NULL, "1.3.0", "text/xml",
+ "PRV_Provincia", "CRS:84", 0, 9.018668,
+ 42.615796, 13.015085, 46.237264, 437, 396,
+ 254, 184, &err_msg);
+ if (coll == NULL)
+ {
+ fprintf (stderr, "GetFeatureInfo (XML): unexpected NULL\n");
+ return -301;
+ }
+/* preparing Geometries */
+ ratio = (13.015085 - 9.018668) / (double) 437;
+ mx = 9.018668 + ((double) 254 * ratio);
+ my = 46.237264 - ((double) 182 * ratio);
+ wms_feature_collection_parse_geometries (coll, 4326, mx, my, sqlite);
+
+/* testing Feature Member */
+ count = get_wms_feature_members_count (coll);
+ if (count != 1)
+ {
+ fprintf (stderr,
+ "GetFeatureMembersCount (XML): unexpected result %d\n",
+ count);
+ return -302;
+ }
+ ftr = get_wms_feature_member (coll, 0);
+ if (ftr == NULL)
+ {
+ fprintf (stderr, "GetFeatureMember (XML): unexpected NULL\n");
+ return -303;
+ }
+ count = get_wms_feature_attributes_count (ftr);
+ if (count != 26)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeCount (XML): unexpected result %d\n",
+ count);
+ return -304;
+ }
+ str = get_wms_feature_attribute_name (ftr, 0);
+ if (strcmp (str, "Objectid") != 0)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeName (XML-Geom): unexpected result \"%s\"\n",
+ str);
+ return -305;
+ }
+ str = get_wms_feature_attribute_value (ftr, 0);
+ if (strcmp (str, "5") != 0)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeValue (XML): unexpected result \"%s\"\n",
+ str);
+ return -306;
+ }
+ geom = get_wms_feature_attribute_geometry (ftr, 0);
+ if (geom != NULL)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeValue (XML-Geom): unexpected value\n");
+ return -307;
+ }
+ str = get_wms_feature_attribute_name (ftr, 2);
+ if (strcmp (str, "Istat") != 0)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeName (XML): unexpected result \"%s\"\n",
+ str);
+ return -309;
+ }
+ str = get_wms_feature_attribute_value (ftr, 2);
+ if (strcmp (str, "37") != 0)
+ {
+ fprintf (stderr,
+ "GetFeatureAttributeValue (XML): unexpected result \"%s\"\n",
+ str);
+ return -310;
+ }
+
+/* destroying the Feature Collection */
+ destroy_wms_feature_collection (coll);
+
+/* closing SQLite/SpatiaLite */
+ ret = sqlite3_close (sqlite);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "sqlite3_close() error: %s\n",
+ sqlite3_errmsg (sqlite));
+ return -311;
+ }
+ spatialite_cleanup_ex (cache);
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int ret;
+ int val;
+ double dblval;
+ const char *url;
+ char *err_msg = NULL;
+ unsigned char *rgba;
+ rl2WmsCachePtr cache;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+/* creating a WMS-Cache */
+ cache = create_wms_cache ();
+ if (cache == NULL)
+ {
+ fprintf (stderr, "Unable to create a WMS Cache\n");
+ return -1;
+ }
+
+/* GetCapabilities - basic USGS Arizona */
+ ret = test_GetCapabilities_arizona (cache);
+ if (ret != 0)
+ return ret;
+
+/* GetCapabilities - basic Regione Emilia Romagna */
+ ret = test_GetCapabilities_rer (cache);
+ if (ret != 0)
+ return ret;
+
+/* testing the cache */
+ set_wms_cache_max_size (cache, 5000000);
+ val = get_wms_cache_max_size (cache);
+ if (val != 5000000)
+ {
+ fprintf (stderr, "GetWmsCacheMaxSize: unexpected result %d\n", val);
+ return -80;
+ }
+ val = get_wms_cache_items_count (cache);
+ if (val != 0)
+ {
+ fprintf (stderr, "GetWmsCacheItemsCount: unexpected result %d\n",
+ val);
+ return -81;
+ }
+ val = get_wms_cache_current_size (cache);
+ if (val != 0)
+ {
+ fprintf (stderr, "GetWmsCacheCurrentSize: unexpected result %d\n",
+ val);
+ return -82;
+ }
+ val = get_wms_cache_hit_count (cache);
+ if (val != 0)
+ {
+ fprintf (stderr, "GetWmsCacheHitCount: unexpected result %d\n", val);
+ return -83;
+ }
+ val = get_wms_cache_miss_count (cache);
+ if (val != 0)
+ {
+ fprintf (stderr, "GetWmsCacheMissCount: unexpected result %d\n", val);
+ return -84;
+ }
+ val = get_wms_cache_flushed_count (cache);
+ if (val != 0)
+ {
+ fprintf (stderr, "GetWmsCacheFlushedCount: unexpected result %d\n",
+ val);
+ return -85;
+ }
+ dblval = get_wms_total_download_size (cache);
+ if (dblval != 21544)
+ {
+ fprintf (stderr, "GetWmsTotalDownloadSize: unexpected result %1.2f\n",
+ dblval);
+ return -86;
+ }
+ reset_wms_cache (cache);
+
+/* GetCapabilities - Pass I [not cached] */
+ ret = test_GetCapabilities_tuscany (cache);
+ if (ret != 0)
+ return ret;
+/* GetMap - Pass I [not cached] */
+ url =
+ "http://www502.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmsambamm&map_resolution=91&";
+ rgba =
+ do_wms_GetMap_get (cache, url, NULL, "1.3.0",
+ "rt_ambamm.idcomuni.rt.poly", "EPSG:3003", 0,
+ 1583097.365776, 4704017.773106, 1611444.731553,
+ 4729705.546213, 437, 396, "contorno_con_etichette",
+ "image/png", 0, 1, &err_msg);
+ if (rgba != NULL)
+ {
+ fprintf (stderr, "GetMap (not cached): unexpected result\n");
+ return -87;
+ }
+ rgba = do_wms_GetMap_get (cache, url, NULL, "1.3.0",
+ "rt_ambamm.idcomuni.rt.poly", "EPSG:3003", 0,
+ 1583097.365776, 4704017.773106, 1611444.731553,
+ 4729705.546213, 437, 396,
+ "contorno_con_etichette", "image/png", 0, 0,
+ &err_msg);
+ if (rgba == NULL)
+ {
+ fprintf (stderr, "GetMap (not cached): unexpected NULL\n");
+ return -88;
+ }
+ free (rgba);
+
+/* GetCapabilities - Pass II [already cached] */
+ ret = test_GetCapabilities_tuscany (cache);
+ if (ret != 0)
+ return ret;
+/* GetMap - Pass II [already cached] */
+ rgba = do_wms_GetMap_get (cache, url, NULL, "1.3.0",
+ "rt_ambamm.idcomuni.rt.poly", "EPSG:3003", 0,
+ 1583097.365776, 4704017.773106, 1611444.731553,
+ 4729705.546213, 437, 396,
+ "contorno_con_etichette", "image/png", 0, 1,
+ &err_msg);
+ if (rgba == NULL)
+ {
+ fprintf (stderr, "GetMap (cached): unexpected result\n");
+ return -89;
+ }
+ free (rgba);
+ rgba = do_wms_GetMap_get (cache, url, NULL, "1.3.0",
+ "rt_ambamm.idcomuni.rt.poly", "EPSG:3003", 0,
+ 1583097.365776, 4704017.773106, 1611444.731553,
+ 4729705.546213, 437, 396,
+ "contorno_con_etichette", "image/png", 0, 0,
+ &err_msg);
+ if (rgba == NULL)
+ {
+ fprintf (stderr, "GetMap (cached): unexpected NULL\n");
+ return -90;
+ }
+ free (rgba);
+
+/* testing GetFeatureInfo - GML */
+ ret = test_GetFeatureInfo_gml ();
+ if (ret != 0)
+ return ret;
+
+/* testing GetFeatureInfo - XML */
+ ret = test_GetFeatureInfo_xml ();
+ if (ret != 0)
+ return ret;
+
+/* re-testing the cache */
+ val = get_wms_cache_items_count (cache);
+ if (val != 1)
+ {
+ fprintf (stderr, "GetWmsCacheItemsCount: unexpected result %d\n",
+ val);
+ return -91;
+ }
+ val = get_wms_cache_current_size (cache);
+ if (val != 4526)
+ {
+ fprintf (stderr, "GetWmsCacheCurrentSize: unexpected result %d\n",
+ val);
+ return -92;
+ }
+ val = get_wms_cache_hit_count (cache);
+ if (val != 2)
+ {
+ fprintf (stderr, "GetWmsCacheHitCount: unexpected result %d\n", val);
+ return -93;
+ }
+ val = get_wms_cache_miss_count (cache);
+ if (val != 0)
+ {
+ fprintf (stderr, "GetWmsCacheMissCount: unexpected result %d\n", val);
+ return -94;
+ }
+ val = get_wms_cache_flushed_count (cache);
+ if (val != 0)
+ {
+ fprintf (stderr, "GetWmsCacheFlushedCount: unexpected result %d\n",
+ val);
+ return -95;
+ }
+ dblval = get_wms_total_download_size (cache);
+ if (dblval != 50030.00)
+ {
+ fprintf (stderr, "GetWmsTotalDownloadSize: unexpected result %1.2f\n",
+ dblval);
+ return -96;
+ }
+
+/* destroying the WMS-Cache */
+ destroy_wms_cache (cache);
+
+ return 0;
+}
diff --git a/test/test_wms2.c b/test/test_wms2.c
new file mode 100644
index 0000000..6ca4b8d
--- /dev/null
+++ b/test/test_wms2.c
@@ -0,0 +1,664 @@
+/*
+
+ test_wms2.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+#include <float.h>
+#include <string.h>
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2wms.h"
+
+static int
+test_GetCapabilities (rl2WmsCachePtr cache)
+{
+/* testing GetCapabilities and friends [TileService] */
+ rl2WmsCatalogPtr catalog;
+ rl2WmsTiledLayerPtr layer;
+ rl2WmsTiledLayerPtr child;
+ rl2WmsTilePatternPtr pattern;
+ rl2WmsTilePatternPtr clone;
+ char *err_msg = NULL;
+ const char *url;
+ char *xurl;
+ const char *str;
+ int len;
+ int int_res;
+ double dbl_res;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ int width;
+ int height;
+
+/* WMS GetCapabilities (valid) */
+ url =
+ "http://wms.jpl.nasa.gov/wms.cgi?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1";
+ catalog = create_wms_catalog (cache, url, NULL, &err_msg);
+ if (catalog == NULL)
+ {
+ fprintf (stderr, "Unable to create a WMS Catalog\n");
+ return -2;
+ }
+
+/* testing Service */
+ str = get_wms_version (catalog);
+ if (strcmp (str, "1.1.1") != 0)
+ {
+ fprintf (stderr, "GetWmsVersion: unexpected result \"%s\"\n", str);
+ return -3;
+ }
+ str = get_wms_name (catalog);
+ if (strcmp (str, "OGC:WMS") != 0)
+ {
+ fprintf (stderr, "GetWmsName: unexpected result \"%s\"\n", str);
+ return -4;
+ }
+ str = get_wms_title (catalog);
+ if (strcmp (str, "JPL Global Imagery Service") != 0)
+ {
+ fprintf (stderr, "GetWmsTitle: unexpected result \"%s\"\n", str);
+ return -5;
+ }
+ str = get_wms_abstract (catalog);
+ if (strcmp
+ (str,
+ "WMS Server maintained by JPL, worldwide satellite imagery.") != 0)
+ {
+ fprintf (stderr, "GetWmsAbstract: unexpected result \"%s\"\n", str);
+ return -6;
+ }
+ str = get_wms_url_GetMap_get (catalog);
+ if (strcmp (str, "http://wms.jpl.nasa.gov/wms.cgi?") != 0)
+ {
+ fprintf (stderr, "GetWmsGetMapGet: unexpected result %s\n", str);
+ return -7;
+ }
+ str = get_wms_url_GetMap_post (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsGetMapPost: unexpected result %s\n", str);
+ return -8;
+ }
+ str = get_wms_url_GetFeatureInfo_get (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsGetFeatureInfoGet: unexpected result %s\n",
+ str);
+ return -9;
+ }
+ str = get_wms_url_GetFeatureInfo_post (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsGetFeatureInfoPost: unexpected result %s\n",
+ str);
+ return -10;
+ }
+ str = get_wms_url_GetTileService_get (catalog);
+ if (strcmp (str, "http://wms.jpl.nasa.gov/wms.cgi?") != 0)
+ {
+ fprintf (stderr, "GetWmsGetMapGet: unexpected result %s\n", str);
+ return -11;
+ }
+ str = get_wms_url_GetTileService_post (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsGetMapPost: unexpected result %s\n", str);
+ return -12;
+ }
+ str = get_wms_gml_mime_type (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsGmlMimeType: unexpected result %s\n", str);
+ return -13;
+ }
+ str = get_wms_xml_mime_type (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsXmlMimeType: unexpected result %s\n", str);
+ return -14;
+ }
+ str = get_wms_contact_person (catalog);
+ if (strcmp (str, "Lucian Plesea") != 0)
+ {
+ fprintf (stderr, "GetContactPerson: unexpected result %s\n", str);
+ return -15;
+ }
+ str = get_wms_contact_organization (catalog);
+ if (strcmp (str, "JPL") != 0)
+ {
+ fprintf (stderr, "GetContactOrganization: unexpected result %s\n",
+ str);
+ return -16;
+ }
+ str = get_wms_contact_position (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetContactPosition: unexpected result %s\n", str);
+ return -17;
+ }
+ str = get_wms_contact_postal_address (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetContactPostalAddress: unexpected result %s\n",
+ str);
+ return -18;
+ }
+ str = get_wms_contact_city (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetContactCity: unexpected result %s\n", str);
+ return -19;
+ }
+ str = get_wms_contact_state_province (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetContactStateProvince: unexpected result %s\n",
+ str);
+ return -20;
+ }
+ str = get_wms_contact_post_code (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetContactPostCode: unexpected result %s\n", str);
+ return -21;
+ }
+ str = get_wms_contact_country (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetContactCountry: unexpected result %s\n", str);
+ return -22;
+ }
+ str = get_wms_contact_voice_telephone (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetContactVoiceTelephone: unexpected result %s\n",
+ str);
+ return -23;
+ }
+ str = get_wms_contact_fax_telephone (catalog);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetContactFaxTelephone: unexpected result %s\n",
+ str);
+ return -24;
+ }
+ str = get_wms_contact_email_address (catalog);
+ if (strcmp (str, "lucian.plesea at jpl.nasa.gov") != 0)
+ {
+ fprintf (stderr, "GetContactEMailAddress: unexpected result %s\n",
+ str);
+ return -25;
+ }
+ str = get_wms_fees (catalog);
+ if (strcmp (str, "none") != 0)
+ {
+ fprintf (stderr, "GetFees: unexpected result %s\n", str);
+ return -26;
+ }
+ str = get_wms_access_constraints (catalog);
+ if (strcmp (str, "Server is load limited") != 0)
+ {
+ fprintf (stderr, "GetAccessConstraints: unexpected result %s\n", str);
+ return -27;
+ }
+ int_res = get_wms_layer_limit (catalog);
+ if (int_res != -1)
+ {
+ fprintf (stderr, "GetLayerLimit: unexpected result %d\n", int_res);
+ return -28;
+ }
+ int_res = get_wms_max_width (catalog);
+ if (int_res != -1)
+ {
+ fprintf (stderr, "GetMaxWidth: unexpected result %d\n", int_res);
+ return -29;
+ }
+ int_res = get_wms_max_height (catalog);
+ if (int_res != -1)
+ {
+ fprintf (stderr, "GetMaxHeight: unexpected result %d\n", int_res);
+ return -30;
+ }
+
+/* testing TileService */
+ int_res = is_wms_tile_service (catalog);
+ if (int_res != 1)
+ {
+ fprintf (stderr, "IsTileService: unexpected result %d\n", int_res);
+ return -31;
+ }
+ str = get_wms_tile_service_name (catalog);
+ if (strcmp (str, "OnEarth:WMS:Tile") != 0)
+ {
+ fprintf (stderr, "GetTileServiceName: unexpected result \"%s\"\n",
+ str);
+ return -32;
+ }
+ str = get_wms_tile_service_title (catalog);
+ if (strcmp (str, "WMS Tile service") != 0)
+ {
+ fprintf (stderr, "GetTileServiceTitle: unexpected result \"%s\"\n",
+ str);
+ return -33;
+ }
+ str = get_wms_tile_service_abstract (catalog);
+ len = strlen (str);
+ if (len != 822)
+ {
+ fprintf (stderr, "GetTileServiceAbstract: unexpected length %d\n",
+ len);
+ return -34;
+ }
+ int_res = get_wms_tile_service_count (catalog);
+ if (int_res != 17)
+ {
+ fprintf (stderr, "GetTileServiceCount: unexpected result %d\n",
+ int_res);
+ return -35;
+ }
+
+/* testing TileService layer */
+ layer = get_wms_catalog_tiled_layer (catalog, 0);
+ if (layer == NULL)
+ {
+ fprintf (stderr, "GetTiledLayer: unexpected NULL\n");
+ return -36;
+ }
+ str = get_wms_tiled_layer_name (layer);
+ if (strcmp (str, "Global Mosaic, pan sharpened visual") != 0)
+ {
+ fprintf (stderr, "GetWmsTiledLayerName: unexpected result \"%s\"\n",
+ str);
+ return -37;
+ }
+ str = get_wms_tiled_layer_title (layer);
+ if (strcmp (str, "Global Mosaic, pan sharpened visual") != 0)
+ {
+ fprintf (stderr, "GetWmsTiledLayerTitle: unexpected result \"%s\"\n",
+ str);
+ return -38;
+ }
+ str = get_wms_tiled_layer_abstract (layer);
+ len = strlen (str);
+ if (len != 498)
+ {
+ fprintf (stderr, "GetWmsTiledLayerAbstract: unexpected result %d\n",
+ len);
+ return -39;
+ }
+ str = get_wms_tiled_layer_pad (layer);
+ if (strcmp (str, "0") != 0)
+ {
+ fprintf (stderr, "GetWmsTiledLayerPad: unexpected result \"%s\"\n",
+ str);
+ return -40;
+ }
+ str = get_wms_tiled_layer_bands (layer);
+ if (strcmp (str, "3") != 0)
+ {
+ fprintf (stderr, "GetWmsTiledLayerBands: unexpected result \"%s\"\n",
+ str);
+ return -38;
+ }
+ str = get_wms_tiled_layer_data_type (layer);
+ if (str != NULL)
+ {
+ fprintf (stderr, "GetWmsTiledLayerDataType: unexpected result %s\n",
+ str);
+ return -39;
+ }
+ if (get_wms_tiled_layer_bbox (layer, &minx, &miny, &maxx, &maxy) != 1)
+ {
+ fprintf (stderr, "GetWmsTiledLayerBBox: unexpected result FALSE\n");
+ return -40;
+ }
+ else
+ {
+ if (maxx != 180.0)
+ {
+ fprintf (stderr,
+ "GetWmsTiledLayerBBox (MaxX): unexpected result %1.8f\n",
+ maxx);
+ return -41;
+ }
+ }
+ if (get_wms_tiled_layer_tile_size (layer, &width, &height) != 1)
+ {
+ fprintf (stderr,
+ "GetWmsTiledLayerTileSize: unexpected result FALSE\n");
+ return -42;
+ }
+ else
+ {
+ if (width != 512)
+ {
+ fprintf (stderr,
+ "GetWmsTiledLayerTileSize (Width): unexpected result %d\n",
+ width);
+ return -43;
+ }
+ }
+ str = get_wms_tiled_layer_crs (layer);
+ if (strcmp (str, "EPSG:4326") != 0)
+ {
+ fprintf (stderr, "GetWmsTiledLayerCrs: unexpected result \"%s\"\n",
+ str);
+ return -44;
+ }
+ str = get_wms_tiled_layer_format (layer);
+ if (strcmp (str, "image/jpeg") != 0)
+ {
+ fprintf (stderr, "GetWmsTiledLayerFormat: unexpected result \"%s\"\n",
+ str);
+ return -45;
+ }
+ str = get_wms_tiled_layer_style (layer);
+ if (strcmp (str, "visual") != 0)
+ {
+ fprintf (stderr, "GetWmsTiledLayerStyle: unexpected result %s\n",
+ str);
+ return -46;
+ }
+ int_res = get_wms_tile_pattern_count (layer);
+ if (int_res != 13)
+ {
+ fprintf (stderr, "GetTilePatternCount: unexpected result %d\n",
+ int_res);
+ return -47;
+ }
+ pattern = get_wms_tile_pattern_handle (layer, 3);
+ if (pattern == NULL)
+ {
+ fprintf (stderr, "GetTilePatternHandle: unexpected NULL\n");
+ return -48;
+ }
+ str = get_wms_tile_pattern_srs (layer, 0);
+ if (strcmp (str, "EPSG:4326") != 0)
+ {
+ fprintf (stderr, "GetWmsTilePatternCrs: unexpected result \"%s\"\n",
+ str);
+ return -49;
+ }
+ str = get_wms_tile_pattern_sample_url (pattern);
+ if (strcmp
+ (str,
+ "request=GetMap&layers=global_mosaic&srs=EPSG:4326&format=image/jpeg&styles=visual&width=512&height=512&bbox=-180,58,-148,90")
+ != 0)
+ {
+ fprintf (stderr,
+ "GetWmsTilePatternSampleURL: unexpected result \"%s\"\n",
+ str);
+ return -50;
+ }
+ int_res = get_wms_tile_pattern_tile_width (layer, 0);
+ if (int_res != 512)
+ {
+ fprintf (stderr, "GetTilePatternTileWidth: unexpected result %d\n",
+ int_res);
+ return -51;
+ }
+ int_res = get_wms_tile_pattern_tile_height (layer, 0);
+ if (int_res != 512)
+ {
+ fprintf (stderr, "GetTilePatternTileHeight: unexpected result %d\n",
+ int_res);
+ return -52;
+ }
+ dbl_res = get_wms_tile_pattern_base_x (layer, 0);
+ if (dbl_res != -180.0)
+ {
+ fprintf (stderr, "GetTilePatternTileBaseX: unexpected result %1.8f\n",
+ dbl_res);
+ return -53;
+ }
+ dbl_res = get_wms_tile_pattern_base_y (layer, 0);
+ if (dbl_res != 90.0)
+ {
+ fprintf (stderr, "GetTilePatternTileBaseY: unexpected result %1.8f\n",
+ dbl_res);
+ return -54;
+ }
+ dbl_res = get_wms_tile_pattern_extent_x (layer, 0);
+ if (dbl_res != 256.0)
+ {
+ fprintf (stderr,
+ "GetTilePatternTileExtentX: unexpected result %1.8f\n",
+ dbl_res);
+ return -55;
+ }
+ dbl_res = get_wms_tile_pattern_extent_y (layer, 0);
+ if (dbl_res != 256.0)
+ {
+ fprintf (stderr,
+ "GetTilePatternTileExtentY: unexpected result %1.8f\n",
+ dbl_res);
+ return -56;
+ }
+ clone = clone_wms_tile_pattern (pattern);
+ if (clone == NULL)
+ {
+ fprintf (stderr, "CloneTilePattern: unexpected NULL\n");
+ return -57;
+ }
+ destroy_wms_tile_pattern (clone);
+ xurl =
+ get_wms_tile_pattern_request_url (pattern,
+ "http://wms.jpl.nasa.gov/wms.cgi?",
+ -180.0, 90.0);
+ if (strcmp
+ (xurl,
+ "http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&layers=global_mosaic&srs=EPSG:4326&format=image/jpeg&styles=visual&width=512&height=512&bbox=-180.000000,90.000000,-148.000000,122.000000")
+ != 0)
+ {
+ fprintf (stderr,
+ "GetWmsTilePatternRequestURL: unexpected result %s\n", xurl);
+ return -58;
+ }
+ sqlite3_free (xurl);
+ int_res = wms_tiled_layer_has_children (layer);
+ if (int_res != 0)
+ {
+ fprintf (stderr, "GetTiledLayerHasChildren: unexpected result %d\n",
+ int_res);
+ return -59;
+ }
+
+/* testing TileService Child Layer */
+ layer = get_wms_catalog_tiled_layer (catalog, 12);
+ if (layer == NULL)
+ {
+ fprintf (stderr, "GetTiledLayer: unexpected NULL\n");
+ return -60;
+ }
+ int_res = wms_tiled_layer_has_children (layer);
+ if (int_res == 0)
+ {
+ fprintf (stderr, "GetTiledLayerHasChildren: unexpected result %d\n",
+ int_res);
+ return -61;
+ }
+ int_res = get_wms_tiled_layer_children_count (layer);
+ if (int_res != 4)
+ {
+ fprintf (stderr, "GetTiledLayerChildrenCount: unexpected result %d\n",
+ int_res);
+ return -62;
+ }
+ child = get_wms_child_tiled_layer (layer, 2);
+ if (child == NULL)
+ {
+ fprintf (stderr, "GetChildTiledLayer: unexpected NULL\n");
+ return -63;
+ }
+ str = get_wms_tiled_layer_title (child);
+ if (strcmp (str, "The full resolution BMNG in jpeg tiled format") != 0)
+ {
+ fprintf (stderr,
+ "GetWmsTiledLayerTitle Child: unexpected result \"%s\"\n",
+ str);
+ return -64;
+ }
+ str = get_wms_tiled_layer_abstract (child);
+ if (strcmp
+ (str,
+ "There are twelve styles of this dataset, each one corresponding to a given month of the year, with 960x960 pixel tiles")
+ != 0)
+ {
+ fprintf (stderr,
+ "GetWmsTiledLayerAbstract Child: unexpected result \"%s\"\n",
+ str);
+ return -65;
+ }
+ str = get_wms_tiled_layer_pad (child);
+ if (str != NULL)
+ {
+ fprintf (stderr,
+ "GetWmsTiledLayerPad Child: unexpected result \"%s\"\n",
+ str);
+ return -66;
+ }
+ str = get_wms_tiled_layer_bands (child);
+ if (str != NULL)
+ {
+ fprintf (stderr,
+ "GetWmsTiledLayerBands Child: unexpected result \"%s\"\n",
+ str);
+ return -67;
+ }
+ str = get_wms_tiled_layer_data_type (child);
+ if (str != NULL)
+ {
+ fprintf (stderr,
+ "GetWmsTiledLayerDataType Child: unexpected result %s\n",
+ str);
+ return -68;
+ }
+ if (get_wms_tiled_layer_bbox (child, &minx, &miny, &maxx, &maxy) != 1)
+ {
+ fprintf (stderr,
+ "GetWmsTiledLayerBBox Child: unexpected result FALSE\n");
+ return -69;
+ }
+ else
+ {
+ if (maxx != DBL_MAX)
+ {
+ fprintf (stderr,
+ "GetWmsTiledLayerBBox (Child MaxX): unexpected result %1.8f\n",
+ maxx);
+ return -70;
+ }
+ }
+ if (get_wms_tiled_layer_tile_size (child, &width, &height) != 0)
+ {
+ fprintf (stderr,
+ "GetWmsTiledLayerTileSize Child: unexpected result TRUE\n");
+ return -71;
+ }
+
+/* destroying the WMS-Catalog */
+ destroy_wms_catalog (catalog);
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int ret;
+ const char *url;
+ char *err_msg = NULL;
+ unsigned char *rgba;
+ rl2WmsCachePtr cache;
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+/* creating a WMS-Cache */
+ cache = create_wms_cache ();
+ if (cache == NULL)
+ {
+ fprintf (stderr, "Unable to create a WMS Cache\n");
+ return -1;
+ }
+
+/* GetCapabilities - TileService */
+ ret = test_GetCapabilities (cache);
+ if (ret != 0)
+ return ret;
+
+/* GetCapabilities - Pass I [not cached] */
+ ret = test_GetCapabilities (cache);
+ if (ret != 0)
+ return ret;
+/* GetMap - Pass I [not cached] */
+ url =
+ "http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&layers=global_mosaic&srs=EPSG:4326&format=image/jpeg&styles=visual&width=512&height=512&bbox=10.312500,42.812500,10.375000,42.875000";
+ rgba =
+ do_wms_GetMap_TileService_get (cache, url, NULL, 512, 512, 1, &err_msg);
+ if (rgba != NULL)
+ {
+ fprintf (stderr,
+ "GetMap TileService (not cached): unexpected result\n");
+ return -87;
+ }
+ rgba =
+ do_wms_GetMap_TileService_get (cache, url, NULL, 512, 512, 0, &err_msg);
+ if (rgba == NULL)
+ {
+ fprintf (stderr,
+ "GetMap TileService (not cached): unexpected NULL\n");
+ return -88;
+ }
+ free (rgba);
+
+/* GetCapabilities - Pass II [already cached] */
+ ret = test_GetCapabilities (cache);
+ if (ret != 0)
+ return ret;
+
+/* destroying the WMS-Cache */
+ destroy_wms_cache (cache);
+
+ return 0;
+}
diff --git a/test/test_wr_tiff.c b/test/test_wr_tiff.c
new file mode 100644
index 0000000..0071bb7
--- /dev/null
+++ b/test/test_wr_tiff.c
@@ -0,0 +1,6051 @@
+/*
+
+ test_wr_tiff.c -- RasterLite2 Test Case
+
+ Author: Alessandro Furieri <a.furieri at lqt.it>
+
+ ------------------------------------------------------------------------------
+
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the
+License.
+
+The Original Code is the SpatiaLite library
+
+The Initial Developer of the Original Code is Alessandro Furieri
+
+Portions created by the Initial Developer are Copyright (C) 2013
+the Initial Developer. All Rights Reserved.
+
+Contributor(s):
+
+Alternatively, the contents of this file may be used under the terms of
+either the GNU General Public License Version 2 or later (the "GPL"), or
+the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+in which case the provisions of the GPL or the LGPL are applicable instead
+of those above. If you wish to allow use of your version of this file only
+under the terms of either the GPL or the LGPL, and not to allow others to
+use your version of this file under the terms of the MPL, indicate your
+decision by deleting the provisions above and replace them with the notice
+and other provisions required by the GPL or the LGPL. If you do not delete
+the provisions above, a recipient may use your version of this file under
+the terms of any one of the MPL, the GPL or the LGPL.
+*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#include "sqlite3.h"
+#include "spatialite.h"
+
+#include "rasterlite2/rasterlite2.h"
+#include "rasterlite2/rl2tiff.h"
+
+static unsigned char *
+create_rainbow ()
+{
+/* creating a synthetic "rainbow" RGB buffer */
+ int row;
+ int col;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ int bufsize = 1024 * 1024 * 3;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ red = 0;
+ for (row = 0; row < 256; row++)
+ {
+ green = 0;
+ blue = 255;
+ for (col = 0; col < 256; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = blue;
+ green++;
+ blue--;
+ }
+ for (col = 256; col < 512; col++)
+ {
+ *p++ = red;
+ *p++ = 127;
+ *p++ = 127;
+ }
+ green = 255;
+ blue = 0;
+ for (col = 512; col < 768; col++)
+ {
+ *p++ = 255 - red;
+ *p++ = green;
+ *p++ = blue;
+ green--;
+ blue++;
+ }
+ for (col = 768; col < 1024; col++)
+ {
+ *p++ = 127;
+ *p++ = red;
+ *p++ = red;
+ }
+ red++;
+ }
+
+ green = 0;
+ for (row = 256; row < 512; row++)
+ {
+ red = 0;
+ blue = 255;
+ for (col = 0; col < 256; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = blue;
+ red++;
+ blue--;
+ }
+ for (col = 256; col < 512; col++)
+ {
+ *p++ = 127;
+ *p++ = green;
+ *p++ = 127;
+ }
+ red = 255;
+ blue = 0;
+ for (col = 512; col < 768; col++)
+ {
+ *p++ = red;
+ *p++ = 255 - green;
+ *p++ = blue;
+ red--;
+ blue++;
+ }
+ for (col = 768; col < 1024; col++)
+ {
+ *p++ = green;
+ *p++ = 127;
+ *p++ = green;
+ }
+ green++;
+ }
+
+ blue = 0;
+ for (row = 512; row < 768; row++)
+ {
+ red = 0;
+ green = 255;
+ for (col = 0; col < 256; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = blue;
+ red++;
+ green--;
+ }
+ for (col = 256; col < 512; col++)
+ {
+ *p++ = 127;
+ *p++ = 127;
+ *p++ = blue;
+ }
+ red = 255;
+ green = 0;
+ for (col = 512; col < 768; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = 255 - blue;
+ red--;
+ green++;
+ }
+ for (col = 768; col < 1024; col++)
+ {
+ *p++ = blue;
+ *p++ = blue;
+ *p++ = 127;
+ }
+ blue++;
+ }
+
+ red = 0;
+ for (row = 768; row < 1024; row++)
+ {
+ for (col = 0; col < 256; col++)
+ {
+ *p++ = 0;
+ *p++ = 0;
+ *p++ = 0;
+ }
+ for (col = 256; col < 512; col++)
+ {
+ *p++ = red;
+ *p++ = red;
+ *p++ = red;
+ }
+ green = 255;
+ blue = 0;
+ for (col = 512; col < 768; col++)
+ {
+ *p++ = 255 - red;
+ *p++ = 255 - red;
+ *p++ = 255 - red;
+ }
+ for (col = 768; col < 1024; col++)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ }
+ red++;
+ }
+ return bufpix;
+}
+
+static unsigned char *
+create_grayband ()
+{
+/* creating a synthetic "grayband" RGB buffer */
+ int row;
+ int col;
+ unsigned char gray;
+ int bufsize = 1024 * 1024 * 3;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ gray = 0;
+ for (row = 0; row < 256; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = gray;
+ *p++ = gray;
+ *p++ = gray;
+ }
+ gray++;
+ }
+
+ gray = 255;
+ for (row = 256; row < 512; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = gray;
+ *p++ = gray;
+ *p++ = gray;
+ }
+ gray--;
+ }
+
+ gray = 0;
+ for (row = 512; row < 768; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = gray;
+ *p++ = gray;
+ *p++ = gray;
+ }
+ gray++;
+ }
+
+ gray = 255;
+ for (row = 768; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = gray;
+ *p++ = gray;
+ *p++ = gray;
+ }
+ gray--;
+ }
+ return bufpix;
+}
+
+static unsigned char *
+create_palette ()
+{
+/* creating a synthetic "palette" RGB buffer */
+ int row;
+ int col;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ int bufsize = 1024 * 1024 * 3;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ red = 0;
+ for (row = 0; row < 256; row++)
+ {
+ green = 0;
+ blue = 255;
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = blue;
+ }
+ if (red > 247)
+ red = 0;
+ else
+ red += 8;
+ }
+
+ red = 255;
+ for (row = 256; row < 512; row++)
+ {
+ green = 255;
+ blue = 192;
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = blue;
+ }
+ if (red < 9)
+ red = 255;
+ else
+ red -= 8;
+ }
+
+ red = 0;
+ for (row = 512; row < 768; row++)
+ {
+ green = 0;
+ blue = 128;
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = blue;
+ }
+ if (red > 247)
+ red = 0;
+ else
+ red += 8;
+ }
+
+ red = 255;
+ for (row = 768; row < 1024; row++)
+ {
+ green = 128;
+ blue = 0;
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = red;
+ *p++ = green;
+ *p++ = blue;
+ }
+ if (red < 9)
+ red = 255;
+ else
+ red -= 8;
+ }
+ return bufpix;
+}
+
+static unsigned char *
+create_monochrome ()
+{
+/* creating a synthetic "monochrome" RGB buffer */
+ int row;
+ int col;
+ int mode = 0;
+ int bufsize = 1024 * 1024 * 3;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+
+ if (bufpix == NULL)
+ return NULL;
+
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ *p++ = 0;
+ *p++ = 0;
+ *p++ = 0;
+ }
+ }
+ p = bufpix;
+
+ for (row = 0; row < 256; row += 4)
+ {
+ int mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 12;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 12;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 4;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 4)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 4;
+ mode2 = 1;
+ }
+ }
+ if (mode)
+ mode = 0;
+ else
+ mode = 1;
+ }
+
+ for (row = 256; row < 512; row += 8)
+ {
+ int mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 24;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 24;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 24;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 24;
+ mode2 = 1;
+ }
+ }
+ mode2 = mode;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 24;
+ mode2 = 1;
+ }
+ }
+ if (mode)
+ mode = 0;
+ else
+ mode = 1;
+ }
+
+ for (row = 512; row < 768; row++)
+ {
+ int mode2 = 1;
+ for (col = 0; col < 1024; col += 8)
+ {
+ if (mode2)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ mode2 = 0;
+ }
+ else
+ {
+ p += 8;
+ mode2 = 1;
+ }
+ }
+ }
+
+ mode = 1;
+ for (row = 768; row < 1024; row += 8)
+ {
+ int x;
+ for (x = 0; x < 8; x++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ if (mode)
+ {
+ *p++ = 255;
+ *p++ = 255;
+ *p++ = 255;
+ }
+ else
+ p += 3;
+ }
+ }
+ if (mode)
+ mode = 0;
+ else
+ mode = 1;
+ }
+
+ return bufpix;
+}
+
+static unsigned char *
+create_grid_8 ()
+{
+/* creating a synthetic "grid_8" RGB buffer */
+ int row;
+ int col;
+ int bufsize = 1024 * 1024;
+ unsigned char *bufpix = malloc (bufsize);
+ char *p = (char *) bufpix;
+ char sample = -128;
+
+ if (bufpix == NULL)
+ return NULL;
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ if (row == 24 && col == 28)
+ *p++ = (char) -17;
+ else if (row == 822 && col == 932)
+ *p++ = (char) -117;
+ else
+ *p++ = sample;
+ if (sample == 127)
+ sample = -128;
+ else
+ sample++;
+ }
+ }
+
+ return bufpix;
+}
+
+static unsigned char *
+create_grid_u8 ()
+{
+/* creating a synthetic "grid_u8" RGB buffer */
+ int row;
+ int col;
+ int bufsize = 1024 * 1024;
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned char *p = bufpix;
+ unsigned char sample = 0;
+
+ if (bufpix == NULL)
+ return NULL;
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ if (row == 24 && col == 28)
+ *p++ = (unsigned char) 17;
+ else if (row == 822 && col == 932)
+ *p++ = (unsigned char) 117;
+ else
+ *p++ = sample;
+ if (sample == 255)
+ sample = 0;
+ else
+ sample++;
+ }
+ }
+
+ return bufpix;
+}
+
+static unsigned char *
+create_grid_16 ()
+{
+/* creating a synthetic "grid_16" RGB buffer */
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (short);
+ unsigned char *bufpix = malloc (bufsize);
+ short *p = (short *) bufpix;
+ short sample = -32768;
+
+ if (bufpix == NULL)
+ return NULL;
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ if (row == 24 && col == 28)
+ *p++ = (short) -1347;
+ else if (row == 822 && col == 932)
+ *p++ = (short) -11347;
+ else
+ *p++ = sample;
+ if (sample == 32767)
+ sample = -32768;
+ else
+ sample++;
+ }
+ }
+
+ return bufpix;
+}
+
+static unsigned char *
+create_grid_u16 ()
+{
+/* creating a synthetic "grid_u16" RGB buffer */
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (unsigned short);
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned short *p = (unsigned short *) bufpix;
+ unsigned short sample = 0;
+
+ if (bufpix == NULL)
+ return NULL;
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ if (row == 24 && col == 28)
+ *p++ = (unsigned short) 1347;
+ else if (row == 822 && col == 932)
+ *p++ = (unsigned short) 11347;
+ else
+ *p++ = sample;
+ if (sample == 65535)
+ sample = 0;
+ else
+ sample++;
+ }
+ }
+
+ return bufpix;
+}
+
+static unsigned char *
+create_grid_32 ()
+{
+/* creating a synthetic "grid_32" RGB buffer */
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (int);
+ unsigned char *bufpix = malloc (bufsize);
+ int *p = (int *) bufpix;
+ int sample = -50000;
+
+ if (bufpix == NULL)
+ return NULL;
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ if (row == 24 && col == 28)
+ *p++ = (int) -1000347;
+ else if (row == 822 && col == 932)
+ *p++ = (int) -10001347;
+ else
+ *p++ = sample++;
+ }
+ }
+
+ return bufpix;
+}
+
+static unsigned char *
+create_grid_u32 ()
+{
+/* creating a synthetic "grid_u32" RGB buffer */
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (unsigned int);
+ unsigned char *bufpix = malloc (bufsize);
+ unsigned int *p = (unsigned int *) bufpix;
+ unsigned int sample = 124346;
+
+ if (bufpix == NULL)
+ return NULL;
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ if (row == 24 && col == 28)
+ *p++ = (unsigned int) 1000347;
+ else if (row == 822 && col == 932)
+ *p++ = (unsigned int) 10001347;
+ else
+ *p++ = sample++;
+ }
+ }
+
+ return bufpix;
+}
+
+static unsigned char *
+create_grid_float ()
+{
+/* creating a synthetic "grid_float" RGB buffer */
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (float);
+ unsigned char *bufpix = malloc (bufsize);
+ float *p = (float *) bufpix;
+ float sample = -1000.5;
+
+ if (bufpix == NULL)
+ return NULL;
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ if (row == 24 && col == 28)
+ *p++ = (float) 10347.25;
+ else if (row == 822 && col == 932)
+ *p++ = (float) -101347.75;
+ else
+ *p++ = sample;
+ sample += 0.5;
+ }
+ }
+
+ return bufpix;
+}
+
+static unsigned char *
+create_grid_double ()
+{
+/* creating a synthetic "grid_double" RGB buffer */
+ int row;
+ int col;
+ int bufsize = 1024 * 1024 * sizeof (double);
+ unsigned char *bufpix = malloc (bufsize);
+ double *p = (double *) bufpix;
+ double sample = -12000.5;
+
+ if (bufpix == NULL)
+ return NULL;
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ if (row == 24 && col == 28)
+ *p++ = (double) 2000347.25;
+ else if (row == 822 && col == 932)
+ *p++ = (double) -20001347.75;
+ else
+ *p++ = sample;
+ sample += 0.5;
+ }
+ }
+
+ return bufpix;
+}
+
+static int
+do_one_rgb_test (const unsigned char *rgb, const char *path, int tiled,
+ unsigned char compression)
+{
+/* performing a single RGB test */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ const char *xpath;
+ unsigned int xwidth;
+ unsigned int xheight;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ unsigned char xcompression;
+ if (tiled == 0)
+ tile_size = 1;
+ tiff = rl2_create_tiff_destination (path, 1024, 1024, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_RGB, 3, NULL, compression,
+ tiled, tile_size);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create TIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ xpath = rl2_get_tiff_destination_path (tiff);
+ if (xpath == NULL)
+ {
+ fprintf (stderr, "Get destination path: unexpected NULL\n");
+ goto error;
+ }
+ if (strcmp (xpath, path) != 0)
+ {
+ fprintf (stderr, "Mismatching destination path \"%s\"\n", xpath);
+ goto error;
+ }
+ if (rl2_get_tiff_destination_size (tiff, &xwidth, &xheight) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination size error\n");
+ goto error;
+ }
+ if (xwidth != 1024)
+ {
+ fprintf (stderr, "Unexpected Width %d\n", xwidth);
+ goto error;
+ }
+ if (xheight != 1024)
+ {
+ fprintf (stderr, "Unexpected Height %d\n", xheight);
+ goto error;
+ }
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type error\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (xpixel_type != RL2_PIXEL_RGB)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 3)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+ if (rl2_get_tiff_destination_compression (tiff, &xcompression) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination compression error\n");
+ goto error;
+ }
+ if (xcompression != compression)
+ {
+ fprintf (stderr, "Unexpected compression %02x\n", xcompression);
+ goto error;
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size * 3;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ {
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ }
+ }
+ p_in = rgb + ((row + y) * 1024 * 3) + (col * 3);
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_UINT8,
+ RL2_PIXEL_RGB, 3, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024 * 3;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = rgb + (row * 1024 * 3);
+ p_out = bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ bufpix, bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ return -1;
+}
+
+static int
+check_origin (const char *path, const char *tfw_path, int srid, double minx,
+ double miny, double maxx, double maxy, double hres, double vres,
+ unsigned char compression, unsigned char sample_type,
+ unsigned char pixel_type, int mode)
+{
+/* checking a georeferenced TIFF origin */
+ rl2TiffOriginPtr origin = NULL;
+ unsigned char xcompression;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ unsigned int xwidth;
+ unsigned int xheight;
+ int xsrid;
+ double minX;
+ double minY;
+ double maxX;
+ double maxY;
+ double horzRes;
+ double vertRes;
+ double diff;
+ int num_bands = 1;
+ rl2CoveragePtr coverage = NULL;
+ rl2RasterPtr raster = NULL;
+ rl2PixelPtr pixel = NULL;
+ char v8;
+ unsigned char vu8;
+ short v16;
+ unsigned short vu16;
+ int v32;
+ unsigned int vu32;
+ float vflt;
+ double vdbl;
+ int is_tiled;
+ unsigned int tileWidth;
+ unsigned int tileHeight;
+ unsigned int rowsPerStrip;
+
+ if (pixel_type == RL2_PIXEL_RGB)
+ num_bands = 3;
+
+ if (mode == RL2_TIFF_GEOTIFF)
+ {
+ origin =
+ rl2_create_geotiff_origin (path, -1, RL2_SAMPLE_UNKNOWN,
+ RL2_PIXEL_UNKNOWN, RL2_BANDS_UNKNOWN);
+ if (origin == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to open %s as GeoTIFF\n", path);
+ goto error;
+ }
+ }
+ else if (mode == RL2_TIFF_WORLDFILE)
+ {
+ origin =
+ rl2_create_tiff_worldfile_origin (path, 4326, RL2_SAMPLE_UNKNOWN,
+ RL2_PIXEL_UNKNOWN,
+ RL2_BANDS_UNKNOWN);
+ if (origin == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to open %s as TIFF+TFW\n",
+ path);
+ goto error;
+ }
+ }
+
+ if (rl2_get_tiff_origin_size (origin, &xwidth, &xheight) != RL2_OK)
+ {
+ fprintf (stderr, "CheckOrigin - Get TIFF size error\n");
+ goto error;
+ }
+ if (xwidth != 1024)
+ {
+ fprintf (stderr, "CheckOrigin - unexpected TIFF width %u\n", xwidth);
+ goto error;
+ }
+ if (xheight != 1024)
+ {
+ fprintf (stderr, "CheckOrigin - unexpected TIFF height %u\n",
+ xheight);
+ goto error;
+ }
+ if (rl2_get_tiff_origin_compression (origin, &xcompression) != RL2_OK)
+ {
+ fprintf (stderr, "CheckOrigin - Get TIFF compression error\n");
+ goto error;
+ }
+ if (compression != xcompression)
+ {
+ fprintf (stderr, "CheckOrigin - unexpected TIFF compression %02x\n",
+ xcompression);
+ goto error;
+ }
+ if (rl2_get_tiff_origin_type
+ (origin, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "CheckOrigin - Get TIFF type error\n");
+ goto error;
+ }
+ if (xsample_type != sample_type)
+ {
+ fprintf (stderr, "CheckOrigin - unexpected TIFF sample type %02x\n",
+ xsample_type);
+ goto error;
+ }
+ if (xpixel_type != pixel_type && alias_pixel_type != pixel_type)
+ {
+ fprintf (stderr,
+ "CheckOrigin - unexpected TIFF pixel type %02x alias %02x\n",
+ pixel_type, alias_pixel_type);
+ goto error;
+ }
+ if (xnum_bands != num_bands)
+ {
+ fprintf (stderr, "CheckOrigin - unexpected TIFF numBands %02x\n",
+ xnum_bands);
+ goto error;
+ }
+ if (rl2_get_tiff_origin_srid (origin, &xsrid) != RL2_OK)
+ {
+ fprintf (stderr, "CheckOrigin - Get TIFF SRID error\n");
+ goto error;
+ }
+ if (xsrid != srid)
+ {
+ fprintf (stderr, "CheckOrigin - unexpected TIFF SRID %02x\n", xsrid);
+ goto error;
+ }
+ if (rl2_get_tiff_origin_extent (origin, &minX, &minY, &maxX, &maxY) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "CheckOrigin - Get TIFF Extent error\n");
+ goto error;
+ }
+ diff = fabs (minX - minx);
+ if (diff > 0.0000001)
+ {
+ fprintf (stderr, "CheckOrigin - unexpected TIFF MinX %1.8f\n", minX);
+ goto error;
+ }
+ diff = fabs (minY - miny);
+ if (diff > 0.0000001)
+ {
+ fprintf (stderr, "CheckOrigin - unexpected TIFF MinY %1.8f\n", minY);
+ goto error;
+ }
+ diff = fabs (maxX - maxx);
+ if (diff > 0.0000001)
+ {
+ fprintf (stderr, "CheckOrigin - unexpected TIFF MaxX %1.8f\n", maxX);
+ goto error;
+ }
+ diff = fabs (maxY - maxy);
+ if (diff > 0.0000001)
+ {
+ fprintf (stderr, "CheckOrigin - unexpected TIFF MaxY %1.8f\n", maxY);
+ goto error;
+ }
+ if (rl2_get_tiff_origin_resolution (origin, &horzRes, &vertRes) != RL2_OK)
+ {
+ fprintf (stderr, "CheckOrigin - Get TIFF Resolution error\n");
+ goto error;
+ }
+ diff = fabs (horzRes - hres);
+ if (diff > 0.0000001)
+ {
+ fprintf (stderr,
+ "CheckOrigin - unexpected TIFF Horizontal Resolution %1.8f\n",
+ horzRes);
+ goto error;
+ }
+ diff = fabs (vertRes - vres);
+ if (diff > 0.0000001)
+ {
+ fprintf (stderr,
+ "CheckOrigin - unexpected TIFF Vertical Resolution %1.8f\n",
+ vertRes);
+ goto error;
+ }
+ if (rl2_is_tiled_tiff_origin (origin, &is_tiled) != RL2_OK)
+ {
+ fprintf (stderr, "CheckOrigin - Is Tile TIFF error\n");
+ goto error;
+ }
+ if (is_tiled)
+ {
+ if (rl2_get_tiff_origin_tile_size (origin, &tileWidth, &tileHeight) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "CheckOrigin - Get Tile Size error\n");
+ goto error;
+ }
+ if (tileWidth != 128)
+ {
+ fprintf (stderr, "CheckOrigin - unexpected TIFF tileWidth %d\n",
+ tileWidth);
+ goto error;
+ }
+ if (tileHeight != 128)
+ {
+ fprintf (stderr,
+ "CheckOrigin - unexpected TIFF tileHeight %d\n",
+ tileHeight);
+ goto error;
+ }
+ }
+ else
+ {
+ if (rl2_get_tiff_origin_strip_size (origin, &rowsPerStrip) != RL2_OK)
+ {
+ fprintf (stderr, "CheckOrigin - Get Strip Size error\n");
+ goto error;
+ }
+ if (rowsPerStrip != 1 && rowsPerStrip != 8)
+ {
+ fprintf (stderr,
+ "CheckOrigin - unexpected TIFF rowsPerStrip %d\n",
+ rowsPerStrip);
+ goto error;
+ }
+ }
+
+ if (pixel_type == RL2_PIXEL_DATAGRID)
+ {
+ /* testing few pixels */
+ coverage =
+ rl2_create_coverage ("test", sample_type, pixel_type, num_bands,
+ RL2_COMPRESSION_NONE, 0, 512, 512, NULL);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to create the Coverage\n");
+ goto error_pix;
+ }
+ pixel = rl2_create_pixel (sample_type, RL2_PIXEL_DATAGRID, 1);
+ if (pixel == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to create a Pixel\n");
+ }
+ raster = rl2_get_tile_from_tiff_origin (coverage, origin, 0, 0, -1);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to retrieve a TIFF tile (1)\n");
+ goto error_pix;
+ }
+ if (rl2_get_raster_pixel (raster, pixel, 24, 28) != RL2_OK)
+ {
+ fprintf (stderr,
+ "ERROR: unable to get pixel (24,28) from tile (0,0)\n");
+ goto error_pix;
+ }
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ if (rl2_get_pixel_sample_int8 (pixel, &v8) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (24,28) from tile (0,0)\n");
+ goto error_pix;
+ }
+ if (v8 != -17)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected INT8 pixel (24,28) from tile (0,0) %d\n",
+ v8);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_UINT8:
+ if (rl2_get_pixel_sample_uint8 (pixel, RL2_DATAGRID_BAND, &vu8)
+ != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (24,28) from tile (0,0)\n");
+ goto error_pix;
+ }
+ if (vu8 != 17)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected UINT8 pixel (24,28) from tile (0,0) %d\n",
+ vu8);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_INT16:
+ if (rl2_get_pixel_sample_int16 (pixel, &v16) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (24,28) from tile (0,0)\n");
+ goto error_pix;
+ }
+ if (v16 != -1347)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected INT16 pixel (24,28) from tile (0,0) %d\n",
+ v16);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_UINT16:
+ if (rl2_get_pixel_sample_uint16
+ (pixel, RL2_DATAGRID_BAND, &vu16) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (24,28) from tile (0,0)\n");
+ goto error_pix;
+ }
+ if (vu16 != 1347)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected UINT16 pixel (24,28) from tile (0,0) %d\n",
+ vu16);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_INT32:
+ if (rl2_get_pixel_sample_int32 (pixel, &v32) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (24,28) from tile (0,0)\n");
+ goto error_pix;
+ }
+ if (v32 != -1000347)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected INT32 pixel (24,28) from tile (0,0) %d\n",
+ v32);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_UINT32:
+ if (rl2_get_pixel_sample_uint32 (pixel, &vu32) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (24,28) from tile (0,0)\n");
+ goto error_pix;
+ }
+ if (vu32 != 1000347)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected UINT32 pixel (24,28) from tile (0,0) %d\n",
+ vu32);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_FLOAT:
+ if (rl2_get_pixel_sample_float (pixel, &vflt) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (24,28) from tile (0,0)\n");
+ goto error_pix;
+ }
+ if (vflt != 10347.250000)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected FLOAT pixel (24,28) from tile (0,0) %1.6f\n",
+ vflt);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ if (rl2_get_pixel_sample_double (pixel, &vdbl) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (24,28) from tile (0,0)\n");
+ goto error_pix;
+ }
+ if (vdbl != 2000347.250000)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected DOUBLE pixel (24,28) from tile (0,0) %1.6f\n",
+ vdbl);
+ goto error_pix;
+ }
+ break;
+ };
+ rl2_destroy_raster (raster);
+ raster =
+ rl2_get_tile_from_tiff_origin (coverage, origin, 512, 512, -1);
+ if (raster == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to retrieve a TIFF tile (2)\n");
+ goto error_pix;
+ }
+ if (rl2_get_raster_pixel (raster, pixel, 310, 420) != RL2_OK)
+ {
+ fprintf (stderr,
+ "ERROR: unable to get pixel (310,420) from tile (512,512)\n");
+ goto error_pix;
+ }
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_INT8:
+ if (rl2_get_pixel_sample_int8 (pixel, &v8) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (310,420) from tile (512,512)\n");
+ goto error_pix;
+ }
+ if (v8 != -117)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected INT8 pixel (310,420) from tile (512,512) %d\n",
+ v8);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_UINT8:
+ if (rl2_get_pixel_sample_uint8 (pixel, RL2_DATAGRID_BAND, &vu8)
+ != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (310,420) from tile (512,512)\n");
+ goto error_pix;
+ }
+ if (vu8 != 117)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected UINT8 pixel (310,420) from tile (512,512) %d\n",
+ vu8);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_INT16:
+ if (rl2_get_pixel_sample_int16 (pixel, &v16) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (310,420) from tile (512,512)\n");
+ goto error_pix;
+ }
+ if (v16 != -11347)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected INT16 pixel (310,420) from tile (512,512) %d\n",
+ v16);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_UINT16:
+ if (rl2_get_pixel_sample_uint16
+ (pixel, RL2_DATAGRID_BAND, &vu16) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (310,420) from tile (512,512)\n");
+ goto error_pix;
+ }
+ if (vu16 != 11347)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected UINT16 pixel (310,420) from tile (512,512) %d\n",
+ vu16);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_INT32:
+ if (rl2_get_pixel_sample_int32 (pixel, &v32) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (310,420) from tile (512,512)\n");
+ goto error_pix;
+ }
+ if (v32 != -10001347)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected INT32 pixel (310,420) from tile (512,512) %d\n",
+ v32);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_UINT32:
+ if (rl2_get_pixel_sample_uint32 (pixel, &vu32) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (310,420) from tile (512,512)\n");
+ goto error_pix;
+ }
+ if (vu32 != 10001347)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected UINT32 pixel (310,420) from tile (512,512) %d\n",
+ vu32);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_FLOAT:
+ if (rl2_get_pixel_sample_float (pixel, &vflt) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (310,420) from tile (512,512)\n");
+ goto error_pix;
+ }
+ if (vflt != -101347.75)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected FLOAT pixel (310,420) from tile (512,512) %1.6f\n",
+ vflt);
+ goto error_pix;
+ }
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ if (rl2_get_pixel_sample_double (pixel, &vdbl) != RL2_OK)
+ {
+ fprintf (stderr,
+ "invalid pixel (310,420) from tile (512,512)\n");
+ goto error_pix;
+ }
+ if (vdbl != -20001347.75)
+ {
+ fprintf (stderr,
+ "ERROR: unexpected DOUBLE pixel (310,420) from tile (512,512) %1.6f\n",
+ vdbl);
+ goto error_pix;
+ }
+ break;
+ };
+ rl2_destroy_raster (raster);
+ rl2_destroy_pixel (pixel);
+ rl2_destroy_coverage (coverage);
+ }
+
+ rl2_destroy_tiff_origin (origin);
+ unlink (path);
+ if (tfw_path != NULL)
+ unlink (tfw_path);
+ return 1;
+
+ error_pix:
+ rl2_destroy_raster (raster);
+ rl2_destroy_pixel (pixel);
+ rl2_destroy_coverage (coverage);
+
+ error:
+ if (origin != NULL)
+ rl2_destroy_tiff_origin (origin);
+ unlink (path);
+ if (tfw_path != NULL)
+ unlink (tfw_path);
+ return 0;
+}
+
+static int
+do_one_rgb_test_geotiff1 (const unsigned char *rgb, sqlite3 * handle,
+ const char *path, int tiled,
+ unsigned char compression)
+{
+/* performing a single RGB test - GeoTIFF (1) */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ double res = 180.0 / 1024.0;
+ int xsrid;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ double hres;
+ double vres;
+ int is_geotiff;
+ int is_tfw;
+ const char *tfw_path;
+ int is_tiled;
+ unsigned int tileWidth;
+ unsigned int tileHeight;
+ unsigned int rowsPerStrip;
+ if (tiled == 0)
+ tile_size = 1;
+
+ tiff =
+ rl2_create_geotiff_destination (path, handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ NULL, compression, tiled, tile_size,
+ 4326, 0.0, -90.0, 180.0, 90.0, res, res,
+ 0);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create GeoTIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_is_tiled_tiff_destination (tiff, &is_tiled) != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to test if the destination is Tiled or Striped\n");
+ goto error;
+ }
+ if (is_tiled)
+ {
+ if (rl2_get_tiff_destination_tile_size (tiff, &tileWidth, &tileHeight)
+ != RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to retrieve the destination Tile Size\n");
+ goto error;
+ }
+ if (tileWidth != 128)
+ {
+ fprintf (stderr, "Unexpected destination tileWidth %d\n",
+ tileWidth);
+ goto error;
+ }
+ if (tileHeight != 128)
+ {
+ fprintf (stderr, "Unexpected destination tileHeight %d\n",
+ tileHeight);
+ goto error;
+ }
+ }
+ else
+ {
+ if (rl2_get_tiff_destination_strip_size (tiff, &rowsPerStrip) !=
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Unable to retrieve the destination RowsPerStrip\n");
+ goto error;
+ }
+ if (rowsPerStrip != 1 && rowsPerStrip != 8)
+ {
+ fprintf (stderr, "Unexpected destination rowsPerStrip %d\n",
+ rowsPerStrip);
+ goto error;
+ }
+ }
+ if (rl2_get_tiff_destination_srid (tiff, &xsrid) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to retrieve the destination SRID\n");
+ goto error;
+ }
+ if (xsrid != 4326)
+ {
+ fprintf (stderr, "Unexpected destination SRID %d\n", xsrid);
+ goto error;
+ }
+ if (rl2_get_tiff_destination_extent (tiff, &minx, &miny, &maxx, &maxy) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to retrieve the destination Extent\n");
+ goto error;
+ }
+ if (minx != 0.0)
+ {
+ fprintf (stderr, "Unexpected Extent MinX %1.8f\n", minx);
+ goto error;
+ }
+ if (miny != -90.0)
+ {
+ fprintf (stderr, "Unexpected Extent MinY %1.8f\n", miny);
+ goto error;
+ }
+ if (maxx != 180.0)
+ {
+ fprintf (stderr, "Unexpected Extent MaxX %1.8f\n", maxx);
+ goto error;
+ }
+ if (maxy != 90.0)
+ {
+ fprintf (stderr, "Unexpected Extent MaxY %1.8f\n", maxy);
+ goto error;
+ }
+ if (rl2_get_tiff_destination_resolution (tiff, &hres, &vres) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to retrieve the destination Resolution\n");
+ goto error;
+ }
+ if (hres >= 0.17578126 || hres < 0.17578125)
+ {
+ fprintf (stderr, "Unexpected Horizontal Resolution %1.8f\n", hres);
+ goto error;
+ }
+ if (vres >= 0.17578126 || vres < 0.17578125)
+ {
+ fprintf (stderr, "Unexpected Vertical Resolution %1.8f\n", vres);
+ goto error;
+ }
+ if (rl2_is_geotiff_destination (tiff, &is_geotiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to test IsGeoTIFF\n");
+ goto error;
+ }
+ if (is_geotiff != 1)
+ {
+ fprintf (stderr, "Unexpected IsGeoTIFF %d\n", is_geotiff);
+ goto error;
+ }
+ if (rl2_is_tiff_worldfile_destination (tiff, &is_tfw) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to test IsWorldFile\n");
+ goto error;
+ }
+ if (is_tfw != 0)
+ {
+ fprintf (stderr, "Unexpected IsWorldFile %d\n", is_tfw);
+ goto error;
+ }
+ tfw_path = rl2_get_tiff_destination_worldfile_path (tiff);
+ if (tfw_path != NULL)
+ {
+ fprintf (stderr, "Unexpected NOT NULL TFW Path\n");
+ goto error;
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size * 3;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ {
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ }
+ }
+ p_in = rgb + ((row + y) * 1024 * 3) + (col * 3);
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_UINT8,
+ RL2_PIXEL_RGB, 3, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024 * 3;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = rgb + (row * 1024 * 3);
+ p_out = bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ bufpix, bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+
+/* writing a TFW (error expected) */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_ERROR)
+ {
+ fprintf (stderr, "Unexpected success TIFF TFW\n");
+ goto error;
+ }
+
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ tiff = NULL;
+ if (!check_origin
+ (path, tfw_path, 4326, 0.0, -90.0, 180.0, 90.0, res, res, compression,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, RL2_TIFF_GEOTIFF))
+ goto error;
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ return -1;
+}
+
+static int
+do_one_rgb_test_geotiff2 (const unsigned char *rgb, sqlite3 * handle,
+ const char *path, int tiled,
+ unsigned char compression)
+{
+/* performing a single RGB test - GeoTIFF (2) */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ int xsrid;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ double hres;
+ double vres;
+ int is_geotiff;
+ int is_tfw;
+ const char *tfw_path;
+ char *tfw = NULL;
+ if (tiled == 0)
+ tile_size = 1;
+
+ tiff =
+ rl2_create_geotiff_destination (path, handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ NULL, compression, tiled, tile_size,
+ 32632, 100000.0, 1000000.0, 101024.0,
+ 1001024.0, 1.0, 1.0, 1);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create GeoTIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_srid (tiff, &xsrid) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to retrieve the destination SRID\n");
+ goto error;
+ }
+ if (xsrid != 32632)
+ {
+ fprintf (stderr, "Unexpected destination SRID %d\n", xsrid);
+ goto error;
+ }
+ if (rl2_get_tiff_destination_extent (tiff, &minx, &miny, &maxx, &maxy) !=
+ RL2_OK)
+ {
+ fprintf (stderr, "Unable to retrieve the destination Extent\n");
+ goto error;
+ }
+ if (minx != 100000.0)
+ {
+ fprintf (stderr, "Unexpected Extent MinX %1.8f\n", minx);
+ goto error;
+ }
+ if (miny != 1000000.0)
+ {
+ fprintf (stderr, "Unexpected Extent MinY %1.8f\n", miny);
+ goto error;
+ }
+ if (maxx != 101024.0)
+ {
+ fprintf (stderr, "Unexpected Extent MaxX %1.8f\n", maxx);
+ goto error;
+ }
+ if (maxy != 1001024.0)
+ {
+ fprintf (stderr, "Unexpected Extent MaxY %1.8f\n", maxy);
+ goto error;
+ }
+ if (rl2_get_tiff_destination_resolution (tiff, &hres, &vres) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to retrieve the destination Resolution\n");
+ goto error;
+ }
+ if (hres >= 1.00000001 || hres < 1.00000000)
+ {
+ fprintf (stderr, "Unexpected Horizontal Resolution %1.8f\n", hres);
+ goto error;
+ }
+ if (vres >= 1.00000001 || vres < 1.00000000)
+ {
+ fprintf (stderr, "Unexpected Vertical Resolution %1.8f\n", vres);
+ goto error;
+ }
+ if (rl2_is_geotiff_destination (tiff, &is_geotiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to test IsGeoTIFF\n");
+ goto error;
+ }
+ if (is_geotiff != 1)
+ {
+ fprintf (stderr, "Unexpected IsGeoTIFF %d\n", is_geotiff);
+ goto error;
+ }
+ if (rl2_is_tiff_worldfile_destination (tiff, &is_tfw) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to test IsWorldFile\n");
+ goto error;
+ }
+ if (is_tfw != 1)
+ {
+ fprintf (stderr, "Unexpected IsWorldFile %d\n", is_tfw);
+ goto error;
+ }
+ tfw_path = rl2_get_tiff_destination_worldfile_path (tiff);
+ if (tfw_path == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL TFW Path\n");
+ goto error;
+ }
+
+ if (tfw_path != NULL)
+ {
+ int len = strlen (tfw_path);
+ tfw = malloc (len + 1);
+ strcpy (tfw, tfw_path);
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size * 3;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ {
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ }
+ }
+ p_in = rgb + ((row + y) * 1024 * 3) + (col * 3);
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_UINT8,
+ RL2_PIXEL_RGB, 3, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024 * 3;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = rgb + (row * 1024 * 3);
+ p_out = bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ bufpix, bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+
+/* writing a TFW */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write a TFW\n");
+ goto error;
+ }
+
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ tiff = NULL;
+ if (!check_origin
+ (path, tfw, 32632, 100000.0, 1000000.0, 101024.0, 1001024.0, 1.0, 1.0,
+ compression, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, RL2_TIFF_GEOTIFF))
+ goto error;
+ if (tfw != NULL)
+ free (tfw);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ if (tfw != NULL)
+ {
+ unlink (tfw);
+ free (tfw);
+ }
+ return -1;
+}
+
+static int
+do_one_rgb_test_tfw (const unsigned char *rgb, const char *path, int tiled,
+ unsigned char compression)
+{
+/* performing a single RGB test - TFW */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ double res = 180.0 / 1024.0;
+ int is_geotiff;
+ int is_tfw;
+ const char *tfw_path;
+ char *tfw = NULL;
+ if (tiled == 0)
+ tile_size = 1;
+ tiff =
+ rl2_create_tiff_worldfile_destination (path, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB,
+ 3, NULL, compression, tiled,
+ tile_size, 4326, 0.0, -90.0,
+ 180.0, 90.0, res, res);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create TIFF+TFW \"%s\"\n", path);
+ goto error;
+ }
+ if (rl2_is_geotiff_destination (tiff, &is_geotiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to test IsGeoTIFF\n");
+ goto error;
+ }
+ if (is_geotiff != 0)
+ {
+ fprintf (stderr, "Unexpected IsGeoTIFF %d\n", is_geotiff);
+ goto error;
+ }
+ if (rl2_is_tiff_worldfile_destination (tiff, &is_tfw) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to test IsWorldFile\n");
+ goto error;
+ }
+ if (is_tfw != 1)
+ {
+ fprintf (stderr, "Unexpected IsWorldFile %d\n", is_tfw);
+ goto error;
+ }
+ tfw_path = rl2_get_tiff_destination_worldfile_path (tiff);
+ if (tfw_path == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL TFW Path\n");
+ goto error;
+ }
+
+ if (tfw_path != NULL)
+ {
+ int len = strlen (tfw_path);
+ tfw = malloc (len + 1);
+ strcpy (tfw, tfw_path);
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size * 3;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ {
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ }
+ }
+ p_in = rgb + ((row + y) * 1024 * 3) + (col * 3);
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ *p_out++ = 0;
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_UINT8,
+ RL2_PIXEL_RGB, 3, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024 * 3;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = rgb + (row * 1024 * 3);
+ p_out = bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ bufpix, bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+
+/* writing a TFW */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write a TFW\n");
+ goto error;
+ }
+
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ tiff = NULL;
+ if (!check_origin
+ (path, tfw, 4326, 0.0, -90.0, 180.0, 90.0, res, res, compression,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, RL2_TIFF_WORLDFILE))
+ goto error;
+ if (tfw != NULL)
+ free (tfw);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ if (tfw != NULL)
+ {
+ unlink (tfw);
+ free (tfw);
+ }
+ return -1;
+}
+
+static int
+do_one_gray_test (const unsigned char *rgb, const char *path, int tiled,
+ unsigned char compression)
+{
+/* performing a single GrayBand test */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ unsigned char xcompression;
+ if (tiled == 0)
+ tile_size = 1;
+ tiff = rl2_create_tiff_destination (path, 1024, 1024, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_GRAYSCALE, 1, NULL,
+ compression, tiled, tile_size);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create TIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (xpixel_type != RL2_PIXEL_GRAYSCALE)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 1)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+ if (rl2_get_tiff_destination_compression (tiff, &xcompression) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination compression error\n");
+ goto error;
+ }
+ if (xcompression != compression)
+ {
+ fprintf (stderr, "Unexpected compression %02x\n", xcompression);
+ goto error;
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ *p_out++ = 0;
+ }
+ p_in = rgb + ((row + y) * 1024 * 3) + (col * 3);
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ p_in += 2;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ p_in += 2;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_UINT8,
+ RL2_PIXEL_GRAYSCALE, 1,
+ bufpix, bufpix_size, NULL,
+ NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = rgb + (row * 1024 * 3);
+ p_out = bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ p_in += 2;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_UINT8,
+ RL2_PIXEL_GRAYSCALE, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ return -1;
+}
+
+static void
+add_palette_color (int *r, int *g, int *b, unsigned char red,
+ unsigned char green, unsigned char blue)
+{
+/* inserting a new color into the Palette */
+ int i;
+ for (i = 0; i < 255; i++)
+ {
+ if (*(r + i) == red && *(g + i) == green && *(b + i) == blue)
+ return;
+ }
+ for (i = 0; i < 255; i++)
+ {
+ if (*(r + i) == -1 && *(g + i) == -1 && *(b + i) == -1)
+ {
+ *(r + i) = red;
+ *(g + i) = green;
+ *(b + i) = blue;
+ return;
+ }
+ }
+}
+
+static rl2PalettePtr
+build_palette (const unsigned char *rgb, int *r, int *g, int *b)
+{
+/* building a Palette matching the RGB pix-buffer */
+ int row;
+ int col;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ const unsigned char *p_in = rgb;
+ rl2PalettePtr palette;
+ if (rgb != NULL)
+ {
+ for (row = 0; row < 1024; row++)
+ {
+ for (col = 0; col < 1024; col++)
+ {
+ red = *p_in++;
+ green = *p_in++;
+ blue = *p_in++;
+ add_palette_color (r, g, b, red, green, blue);
+ }
+ }
+ }
+ palette = rl2_create_palette (256);
+ for (row = 0; row < 256; row++)
+ rl2_set_palette_color (palette, row, *(r + row), *(g + row),
+ *(b + row));
+ return palette;
+}
+
+static int
+do_one_palette_test (const unsigned char *rgb, const char *path, int tiled,
+ unsigned char compression)
+{
+/* performing a single Palette test */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ unsigned char index;
+ int r[256];
+ int g[256];
+ int b[256];
+ unsigned char *bufpix;
+ int bufpix_size;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ rl2PalettePtr palette;
+ rl2PalettePtr palette2;
+ int tile_size = 128;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ unsigned char xcompression;
+ if (tiled == 0)
+ tile_size = 1;
+
+ for (row = 0; row < 256; row++)
+ {
+ r[row] = -1;
+ g[row] = -1;
+ b[row] = -1;
+ }
+ palette = build_palette (rgb, r, g, b);
+ tiff = rl2_create_tiff_destination (path, 1024, 1024, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_PALETTE, 1, palette,
+ compression, tiled, tile_size);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create TIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (xpixel_type != RL2_PIXEL_PALETTE)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 1)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+ if (rl2_get_tiff_destination_compression (tiff, &xcompression) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination compression error\n");
+ goto error;
+ }
+ if (xcompression != compression)
+ {
+ fprintf (stderr, "Unexpected compression %02x\n", xcompression);
+ goto error;
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ palette2 = build_palette (NULL, r, g, b);
+ bufpix_size = tile_size * tile_size;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ *p_out++ = 0;
+ }
+ p_in = rgb + ((row + y) * 1024 * 3) + (col * 3);
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ p_in += 2;
+ continue;
+ }
+ red = *p_in++;
+ green = *p_in++;
+ blue = *p_in++;
+ rl2_get_palette_index (palette2, &index, red,
+ green, blue);
+ *p_out++ = index;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_UINT8,
+ RL2_PIXEL_PALETTE, 1, bufpix,
+ bufpix_size, palette2, NULL,
+ 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ palette2 = build_palette (NULL, r, g, b);
+ bufpix_size = 1024;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = rgb + (row * 1024 * 3);
+ p_out = bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ red = *p_in++;
+ green = *p_in++;
+ blue = *p_in++;
+ rl2_get_palette_index (palette2, &index, red, green,
+ blue);
+ *p_out++ = index;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_PALETTE,
+ 1, bufpix, bufpix_size, palette2,
+ NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+/* destroying the TIFF destination */
+ rl2_destroy_palette (palette);
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ return 0;
+
+ error:
+ rl2_destroy_palette (palette);
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ return -1;
+}
+
+static int
+do_one_monochrome_test (const unsigned char *rgb, const char *path, int tiled,
+ unsigned char compression)
+{
+/* performing a single Monochrome test */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ unsigned char xcompression;
+ if (tiled == 0)
+ tile_size = 1;
+ tiff = rl2_create_tiff_destination (path, 1024, 1024, RL2_SAMPLE_1_BIT,
+ RL2_PIXEL_MONOCHROME, 1, NULL,
+ compression, tiled, tile_size);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create TIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_1_BIT)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (xpixel_type != RL2_PIXEL_MONOCHROME)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 1)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+ if (rl2_get_tiff_destination_compression (tiff, &xcompression) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination compression error\n");
+ goto error;
+ }
+ if (xcompression != compression)
+ {
+ fprintf (stderr, "Unexpected compression %02x\n", xcompression);
+ goto error;
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ *p_out++ = 0;
+ }
+ p_in = rgb + ((row + y) * 1024 * 3) + (col * 3);
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ p_in += 2;
+ continue;
+ }
+ if (*p_in++ < 128)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ p_in += 2;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_1_BIT,
+ RL2_PIXEL_MONOCHROME, 1,
+ bufpix, bufpix_size, NULL,
+ NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = rgb + (row * 1024 * 3);
+ p_out = bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ if (*p_in++ < 128)
+ *p_out++ = 1;
+ else
+ *p_out++ = 0;
+ p_in += 2;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_1_BIT,
+ RL2_PIXEL_MONOCHROME, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ return -1;
+}
+
+static int
+do_one_grid_8_test (const unsigned char *rgb, sqlite3 * handle,
+ const char *path, int tiled, unsigned char compression)
+{
+/* performing a single Grid Int8 test - GeoTIFF */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const char *p_in;
+ char *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ const char *tfw_path;
+ char *tfw = NULL;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ if (tiled == 0)
+ tile_size = 1;
+
+ tiff =
+ rl2_create_geotiff_destination (path, handle, 1024, 1024,
+ RL2_SAMPLE_INT8, RL2_PIXEL_DATAGRID, 1,
+ NULL, compression, tiled, tile_size,
+ 32632, 100000.0, 1000000.0, 101024.0,
+ 1001024.0, 1.0, 1.0, 1);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create GeoTIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type error\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_INT8)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (xpixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 1)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+
+ tfw_path = rl2_get_tiff_destination_worldfile_path (tiff);
+ if (tfw_path == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL TFW Path\n");
+ goto error;
+ }
+
+ if (tfw_path != NULL)
+ {
+ int len = strlen (tfw_path);
+ tfw = malloc (len + 1);
+ strcpy (tfw, tfw_path);
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = (char *) bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ *p_out++ = 0;
+ }
+ p_in = (char *) (rgb + ((row + y) * 1024) + col);
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_INT8,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = (char *) (rgb + (row * 1024));
+ p_out = (char *) bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_INT8, RL2_PIXEL_DATAGRID,
+ 1, bufpix, bufpix_size, NULL, NULL,
+ 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+
+/* writing a TFW */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write a TFW\n");
+ goto error;
+ }
+
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ tiff = NULL;
+ if (!check_origin
+ (path, tfw, 32632, 100000.0, 1000000.0, 101024.0, 1001024.0, 1.0, 1.0,
+ compression, RL2_SAMPLE_INT8, RL2_PIXEL_DATAGRID, RL2_TIFF_GEOTIFF))
+ goto error;
+ if (tfw != NULL)
+ free (tfw);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ if (tfw != NULL)
+ {
+ unlink (tfw);
+ free (tfw);
+ }
+ return -1;
+}
+
+static int
+do_one_grid_u8_test (const unsigned char *rgb, sqlite3 * handle,
+ const char *path, int tiled, unsigned char compression)
+{
+/* performing a single Grid UInt8 test - GeoTIFF */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const unsigned char *p_in;
+ unsigned char *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ const char *tfw_path;
+ char *tfw = NULL;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ if (tiled == 0)
+ tile_size = 1;
+
+ tiff =
+ rl2_create_geotiff_destination (path, handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 1,
+ NULL, compression, tiled, tile_size,
+ 32632, 100000.0, 1000000.0, 101024.0,
+ 1001024.0, 1.0, 1.0, 1);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create GeoTIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type error\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_UINT8)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (alias_pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 1)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+
+ tfw_path = rl2_get_tiff_destination_worldfile_path (tiff);
+ if (tfw_path == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL TFW Path\n");
+ goto error;
+ }
+
+ if (tfw_path != NULL)
+ {
+ int len = strlen (tfw_path);
+ tfw = malloc (len + 1);
+ strcpy (tfw, tfw_path);
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = (unsigned char *) bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ *p_out++ = 0;
+ }
+ p_in =
+ (unsigned char *) (rgb + ((row + y) * 1024) +
+ col);
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_UINT8,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024;
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = (unsigned char *) (rgb + (row * 1024));
+ p_out = (unsigned char *) bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_UINT8,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+
+/* writing a TFW */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write a TFW\n");
+ goto error;
+ }
+
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ tiff = NULL;
+ if (!check_origin
+ (path, tfw, 32632, 100000.0, 1000000.0, 101024.0, 1001024.0, 1.0, 1.0,
+ compression, RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, RL2_TIFF_GEOTIFF))
+ goto error;
+ if (tfw != NULL)
+ free (tfw);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ if (tfw != NULL)
+ {
+ unlink (tfw);
+ free (tfw);
+ }
+ return -1;
+}
+
+static int
+do_one_grid_16_test (const unsigned char *rgb, sqlite3 * handle,
+ const char *path, int tiled, unsigned char compression)
+{
+/* performing a single Grid Int16 test - GeoTIFF */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const short *p_in;
+ short *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ const char *tfw_path;
+ char *tfw = NULL;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ if (tiled == 0)
+ tile_size = 1;
+
+ tiff =
+ rl2_create_geotiff_destination (path, handle, 1024, 1024,
+ RL2_SAMPLE_INT16, RL2_PIXEL_DATAGRID, 1,
+ NULL, compression, tiled, tile_size,
+ 32632, 100000.0, 1000000.0, 101024.0,
+ 1001024.0, 1.0, 1.0, 1);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create GeoTIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type error\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_INT16)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (xpixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 1)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+
+ tfw_path = rl2_get_tiff_destination_worldfile_path (tiff);
+ if (tfw_path == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL TFW Path\n");
+ goto error;
+ }
+
+ if (tfw_path != NULL)
+ {
+ int len = strlen (tfw_path);
+ tfw = malloc (len + 1);
+ strcpy (tfw, tfw_path);
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size * sizeof (short);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = (short *) bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ *p_out++ = 0;
+ }
+ p_in = (short *) rgb;
+ p_in += ((row + y) * 1024) + col;
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_INT16,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024 * sizeof (short);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = (short *) rgb;
+ p_in += row * 1024;
+ p_out = (short *) bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_INT16,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+
+/* writing a TFW */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write a TFW\n");
+ goto error;
+ }
+
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ tiff = NULL;
+ if (!check_origin
+ (path, tfw, 32632, 100000.0, 1000000.0, 101024.0, 1001024.0, 1.0, 1.0,
+ compression, RL2_SAMPLE_INT16, RL2_PIXEL_DATAGRID, RL2_TIFF_GEOTIFF))
+ goto error;
+ if (tfw != NULL)
+ free (tfw);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ if (tfw != NULL)
+ {
+ unlink (tfw);
+ free (tfw);
+ }
+ return -1;
+}
+
+static int
+do_one_grid_u16_test (const unsigned char *rgb, sqlite3 * handle,
+ const char *path, int tiled, unsigned char compression)
+{
+/* performing a single Grid UInt16 test - GeoTIFF */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const unsigned short *p_in;
+ unsigned short *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ const char *tfw_path;
+ char *tfw = NULL;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ if (tiled == 0)
+ tile_size = 1;
+
+ tiff =
+ rl2_create_geotiff_destination (path, handle, 1024, 1024,
+ RL2_SAMPLE_UINT16, RL2_PIXEL_DATAGRID,
+ 1, NULL, compression, tiled, tile_size,
+ 32632, 100000.0, 1000000.0, 101024.0,
+ 1001024.0, 1.0, 1.0, 1);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create GeoTIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type error\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_UINT16)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (alias_pixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 1)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+
+ tfw_path = rl2_get_tiff_destination_worldfile_path (tiff);
+ if (tfw_path == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL TFW Path\n");
+ goto error;
+ }
+
+ if (tfw_path != NULL)
+ {
+ int len = strlen (tfw_path);
+ tfw = malloc (len + 1);
+ strcpy (tfw, tfw_path);
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size =
+ tile_size * tile_size * sizeof (unsigned short);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = (unsigned short *) bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ *p_out++ = 0;
+ }
+ p_in = (unsigned short *) rgb;
+ p_in += ((row + y) * 1024) + col;
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_UINT16,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024 * sizeof (unsigned short);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = (unsigned short *) rgb;
+ p_in += row * 1024;
+ p_out = (unsigned short *) bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_UINT16,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+
+/* writing a TFW */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write a TFW\n");
+ goto error;
+ }
+
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ tiff = NULL;
+ if (!check_origin
+ (path, tfw, 32632, 100000.0, 1000000.0, 101024.0, 1001024.0, 1.0, 1.0,
+ compression, RL2_SAMPLE_UINT16, RL2_PIXEL_DATAGRID, RL2_TIFF_GEOTIFF))
+ goto error;
+ if (tfw != NULL)
+ free (tfw);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ if (tfw != NULL)
+ {
+ unlink (tfw);
+ free (tfw);
+ }
+ return -1;
+}
+
+static int
+do_one_grid_32_test (const unsigned char *rgb, sqlite3 * handle,
+ const char *path, int tiled, unsigned char compression)
+{
+/* performing a single Grid Int32 test - GeoTIFF */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const int *p_in;
+ int *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ const char *tfw_path;
+ char *tfw = NULL;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ if (tiled == 0)
+ tile_size = 1;
+
+ tiff =
+ rl2_create_geotiff_destination (path, handle, 1024, 1024,
+ RL2_SAMPLE_INT32, RL2_PIXEL_DATAGRID, 1,
+ NULL, compression, tiled, tile_size,
+ 32632, 100000.0, 1000000.0, 101024.0,
+ 1001024.0, 1.0, 1.0, 1);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create GeoTIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type error\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_INT32)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (xpixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 1)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+
+ tfw_path = rl2_get_tiff_destination_worldfile_path (tiff);
+ if (tfw_path == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL TFW Path\n");
+ goto error;
+ }
+
+ if (tfw_path != NULL)
+ {
+ int len = strlen (tfw_path);
+ tfw = malloc (len + 1);
+ strcpy (tfw, tfw_path);
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size * sizeof (int);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = (int *) bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ *p_out++ = 0;
+ }
+ p_in = (int *) rgb;
+ p_in += ((row + y) * 1024) + col;
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_INT32,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024 * sizeof (int);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = (int *) rgb;
+ p_in += row * 1024;
+ p_out = (int *) bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_INT32,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+
+/* writing a TFW */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write a TFW\n");
+ goto error;
+ }
+
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ tiff = NULL;
+ if (!check_origin
+ (path, tfw, 32632, 100000.0, 1000000.0, 101024.0, 1001024.0, 1.0, 1.0,
+ compression, RL2_SAMPLE_INT32, RL2_PIXEL_DATAGRID, RL2_TIFF_GEOTIFF))
+ goto error;
+ if (tfw != NULL)
+ free (tfw);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ if (tfw != NULL)
+ {
+ unlink (tfw);
+ free (tfw);
+ }
+ return -1;
+}
+
+static int
+do_one_grid_u32_test (const unsigned char *rgb, sqlite3 * handle,
+ const char *path, int tiled, unsigned char compression)
+{
+/* performing a single Grid UInt32 test - GeoTIFF */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const unsigned int *p_in;
+ unsigned int *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ const char *tfw_path;
+ char *tfw = NULL;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ if (tiled == 0)
+ tile_size = 1;
+
+ tiff =
+ rl2_create_geotiff_destination (path, handle, 1024, 1024,
+ RL2_SAMPLE_UINT32, RL2_PIXEL_DATAGRID,
+ 1, NULL, compression, tiled, tile_size,
+ 32632, 100000.0, 1000000.0, 101024.0,
+ 1001024.0, 1.0, 1.0, 1);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create GeoTIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type error\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_UINT32)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (xpixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 1)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+
+ tfw_path = rl2_get_tiff_destination_worldfile_path (tiff);
+ if (tfw_path == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL TFW Path\n");
+ goto error;
+ }
+
+ if (tfw_path != NULL)
+ {
+ int len = strlen (tfw_path);
+ tfw = malloc (len + 1);
+ strcpy (tfw, tfw_path);
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size =
+ tile_size * tile_size * sizeof (unsigned int);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = (unsigned int *) bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ *p_out++ = 0;
+ }
+ p_in = (unsigned int *) rgb;
+ p_in += ((row + y) * 1024) + col;
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_UINT32,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024 * sizeof (unsigned int);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = (unsigned int *) rgb;
+ p_in += row * 1024;
+ p_out = (unsigned int *) bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_UINT32,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+
+/* writing a TFW */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write a TFW\n");
+ goto error;
+ }
+
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ tiff = NULL;
+ if (!check_origin
+ (path, tfw, 32632, 100000.0, 1000000.0, 101024.0, 1001024.0, 1.0, 1.0,
+ compression, RL2_SAMPLE_UINT32, RL2_PIXEL_DATAGRID, RL2_TIFF_GEOTIFF))
+ goto error;
+ if (tfw != NULL)
+ free (tfw);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ if (tfw != NULL)
+ {
+ unlink (tfw);
+ free (tfw);
+ }
+ return -1;
+}
+
+static int
+do_one_grid_float_test (const unsigned char *rgb, sqlite3 * handle,
+ const char *path, int tiled, unsigned char compression)
+{
+/* performing a single Grid Float test - GeoTIFF */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const float *p_in;
+ float *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ const char *tfw_path;
+ char *tfw = NULL;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ if (tiled == 0)
+ tile_size = 1;
+
+ tiff =
+ rl2_create_geotiff_destination (path, handle, 1024, 1024,
+ RL2_SAMPLE_FLOAT, RL2_PIXEL_DATAGRID, 1,
+ NULL, compression, tiled, tile_size,
+ 32632, 100000.0, 1000000.0, 101024.0,
+ 1001024.0, 1.0, 1.0, 1);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create GeoTIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type error\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_FLOAT)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (xpixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 1)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+
+ tfw_path = rl2_get_tiff_destination_worldfile_path (tiff);
+ if (tfw_path == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL TFW Path\n");
+ goto error;
+ }
+
+ if (tfw_path != NULL)
+ {
+ int len = strlen (tfw_path);
+ tfw = malloc (len + 1);
+ strcpy (tfw, tfw_path);
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size * sizeof (float);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = (float *) bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ *p_out++ = 0;
+ }
+ p_in = (float *) rgb;
+ p_in += ((row + y) * 1024) + col;
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_FLOAT,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024 * sizeof (float);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = (float *) rgb;
+ p_in += row * 1024;
+ p_out = (float *) bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_FLOAT,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+
+/* writing a TFW */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write a TFW\n");
+ goto error;
+ }
+
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ tiff = NULL;
+ if (!check_origin
+ (path, tfw, 32632, 100000.0, 1000000.0, 101024.0, 1001024.0, 1.0, 1.0,
+ compression, RL2_SAMPLE_FLOAT, RL2_PIXEL_DATAGRID, RL2_TIFF_GEOTIFF))
+ goto error;
+ if (tfw != NULL)
+ free (tfw);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ if (tfw != NULL)
+ {
+ unlink (tfw);
+ free (tfw);
+ }
+ return -1;
+}
+
+static int
+do_one_grid_double_test (const unsigned char *rgb, sqlite3 * handle,
+ const char *path, int tiled, unsigned char compression)
+{
+/* performing a single Grid Double test - GeoTIFF */
+ int row;
+ int col;
+ int x;
+ int y;
+ unsigned char *bufpix;
+ int bufpix_size;
+ const double *p_in;
+ double *p_out;
+ rl2TiffDestinationPtr tiff = NULL;
+ rl2RasterPtr raster;
+ int tile_size = 128;
+ const char *tfw_path;
+ char *tfw;
+ unsigned char xsample_type;
+ unsigned char xpixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char xnum_bands;
+ if (tiled == 0)
+ tile_size = 1;
+
+ tiff =
+ rl2_create_geotiff_destination (path, handle, 1024, 1024,
+ RL2_SAMPLE_DOUBLE, RL2_PIXEL_DATAGRID,
+ 1, NULL, compression, tiled, tile_size,
+ 32632, 100000.0, 1000000.0, 101024.0,
+ 1001024.0, 1.0, 1.0, 1);
+ if (tiff == NULL)
+ {
+ fprintf (stderr, "Unable to create GeoTIFF \"%s\"\n", path);
+ goto error;
+ }
+
+ if (rl2_get_tiff_destination_type
+ (tiff, &xsample_type, &xpixel_type, &alias_pixel_type,
+ &xnum_bands) != RL2_OK)
+ {
+ fprintf (stderr, "Get destination type error\n");
+ goto error;
+ }
+ if (xsample_type != RL2_SAMPLE_DOUBLE)
+ {
+ fprintf (stderr, "Unexpected Sample Type %02x\n", xsample_type);
+ goto error;
+ }
+ if (xpixel_type != RL2_PIXEL_DATAGRID)
+ {
+ fprintf (stderr, "Unexpected Pixel Type %02x\n", xpixel_type);
+ goto error;
+ }
+ if (xnum_bands != 1)
+ {
+ fprintf (stderr, "Unexpected num_bands %d\n", xnum_bands);
+ goto error;
+ }
+
+ tfw_path = rl2_get_tiff_destination_worldfile_path (tiff);
+ if (tfw_path == NULL)
+ {
+ fprintf (stderr, "Unexpected NULL TFW Path\n");
+ goto error;
+ }
+
+ if (tfw_path != NULL)
+ {
+ int len = strlen (tfw_path);
+ tfw = malloc (len + 1);
+ strcpy (tfw, tfw_path);
+ }
+
+ if (tiled)
+ {
+ /* Tiled TIFF */
+ for (row = 0; row < 1024; row += tile_size)
+ {
+ for (col = 0; col < 1024; col += tile_size)
+ {
+ /* inserting a TIFF tile */
+ bufpix_size = tile_size * tile_size * sizeof (double);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_out = (double *) bufpix;
+ for (y = 0; y < tile_size; y++)
+ {
+ if (row + y >= 1024)
+ {
+ for (x = 0; x < tile_size; x++)
+ *p_out++ = 0;
+ }
+ p_in = (double *) rgb;
+ p_in += ((row + y) * 1024) + col;
+ for (x = 0; x < tile_size; x++)
+ {
+ if (col + x >= 1024)
+ {
+ *p_out++ = 0;
+ continue;
+ }
+ *p_out++ = *p_in++;
+ }
+ }
+ raster = rl2_create_raster (tile_size, tile_size,
+ RL2_SAMPLE_DOUBLE,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0,
+ NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ if (rl2_write_tiff_tile (tiff, raster, row, col) !=
+ RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a tile \"%s\" row=%d col=%d\n",
+ path, row, col);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+ }
+ else
+ {
+ /* Striped TIFF */
+ for (row = 0; row < 1024; row++)
+ {
+ /* inserting a TIFF strip */
+ bufpix_size = 1024 * sizeof (double);
+ bufpix = (unsigned char *) malloc (bufpix_size);
+ p_in = (double *) rgb;
+ p_in += row * 1024;
+ p_out = (double *) bufpix;
+ for (x = 0; x < 1024; x++)
+ {
+ /* feeding the scanline buffer */
+ *p_out++ = *p_in++;
+ }
+ raster = rl2_create_raster (1024, 1,
+ RL2_SAMPLE_DOUBLE,
+ RL2_PIXEL_DATAGRID, 1, bufpix,
+ bufpix_size, NULL, NULL, 0, NULL);
+ if (raster == NULL)
+ {
+ fprintf (stderr,
+ "Unable to encode a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ if (rl2_write_tiff_scanline (tiff, raster, row) != RL2_OK)
+ {
+ rl2_destroy_raster (raster);
+ fprintf (stderr,
+ "Unable to write a scanline \"%s\" row=%d\n",
+ path, row);
+ goto error;
+ }
+ rl2_destroy_raster (raster);
+ }
+ }
+
+/* writing a TFW */
+ if (rl2_write_tiff_worldfile (tiff) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write a TFW\n");
+ goto error;
+ }
+
+/* destroying the TIFF destination */
+ rl2_destroy_tiff_destination (tiff);
+ tiff = NULL;
+ if (!check_origin
+ (path, tfw, 32632, 100000.0, 1000000.0, 101024.0, 1001024.0, 1.0, 1.0,
+ compression, RL2_SAMPLE_DOUBLE, RL2_PIXEL_DATAGRID, RL2_TIFF_GEOTIFF))
+ goto error;
+ if (tfw != NULL)
+ free (tfw);
+ return 0;
+
+ error:
+ if (tiff != NULL)
+ rl2_destroy_tiff_destination (tiff);
+ unlink (path);
+ if (tfw != NULL)
+ {
+ unlink (tfw);
+ free (tfw);
+ }
+ return -1;
+}
+
+static int
+do_test_rgb (const unsigned char *rgb)
+{
+/* testing RGB flavours */
+ int ret =
+ do_one_rgb_test (rgb, "./rgb_strip_none.tif", 0, RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret = do_one_rgb_test (rgb, "./rgb_strip_lzw.tif", 0, RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test (rgb, "./rgb_strip_deflate.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test (rgb, "./rgb_strip_jpeg.tif", 0, RL2_COMPRESSION_JPEG);
+ if (ret < 0)
+ return ret;
+ ret = do_one_rgb_test (rgb, "./rgb_tile_none.tif", 1, RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret = do_one_rgb_test (rgb, "./rgb_tile_lzw.tif", 1, RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test (rgb, "./rgb_tile_deflate.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret = do_one_rgb_test (rgb, "./rgb_tile_jpeg.tif", 1, RL2_COMPRESSION_JPEG);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_rgb_geotiff1 (const unsigned char *rgb, sqlite3 * handle)
+{
+/* testing RGB flavours - GeoTIFF (1) */
+ int ret =
+ do_one_rgb_test_geotiff1 (rgb, handle, "./rgb_strip_none_geotiff1.tif",
+ 0, RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff1 (rgb, handle, "./rgb_strip_lzw_geotiff1.tif",
+ 0, RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff1 (rgb, handle,
+ "./rgb_strip_deflate_geotiff1.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff1 (rgb, handle, "./rgb_strip_jpeg_geotiff1.tif",
+ 0, RL2_COMPRESSION_JPEG);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff1 (rgb, handle, "./rgb_tile_none_geotiff1.tif",
+ 1, RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff1 (rgb, handle, "./rgb_tile_lzw_geotiff1.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff1 (rgb, handle,
+ "./rgb_tile_deflate_geotiff1.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff1 (rgb, handle, "./rgb_tile_jpeg_geotiff1.tif",
+ 1, RL2_COMPRESSION_JPEG);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_rgb_geotiff2 (const unsigned char *rgb, sqlite3 * handle)
+{
+/* testing RGB flavours - GeoTIFF (2) */
+ int ret =
+ do_one_rgb_test_geotiff2 (rgb, handle, "./rgb_strip_none_geotiff2.tif",
+ 0, RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff2 (rgb, handle, "./rgb_strip_lzw_geotiff2.tif",
+ 0, RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff2 (rgb, handle,
+ "./rgb_strip_deflate_geotiff2.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff2 (rgb, handle, "./rgb_strip_jpeg_geotiff2.tif",
+ 0, RL2_COMPRESSION_JPEG);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff2 (rgb, handle, "./rgb_tile_none_geotiff2.tif",
+ 1, RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff2 (rgb, handle, "./rgb_tile_lzw_geotiff2.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff2 (rgb, handle,
+ "./rgb_tile_deflate_geotiff2.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_geotiff2 (rgb, handle, "./rgb_tile_jpeg_geotiff2.tif",
+ 1, RL2_COMPRESSION_JPEG);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_rgb_tfw (const unsigned char *rgb)
+{
+/* testing RGB flavours - TFW */
+ int ret = do_one_rgb_test_tfw (rgb, "./rgb_strip_none_tfw.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_tfw (rgb, "./rgb_strip_lzw_tfw.tif", 0,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_tfw (rgb, "./rgb_strip_deflate_tfw.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_tfw (rgb, "./rgb_strip_jpeg_tfw.tif", 0,
+ RL2_COMPRESSION_JPEG);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_tfw (rgb, "./rgb_tile_none_tfw.tif", 1,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_tfw (rgb, "./rgb_tile_lzw_tfw.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_tfw (rgb, "./rgb_tile_deflate_tfw.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_rgb_test_tfw (rgb, "./rgb_tile_jpeg_tfw.tif", 1,
+ RL2_COMPRESSION_JPEG);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_grayband (const unsigned char *rgb)
+{
+/* testing GrayBand flavours */
+ int ret = do_one_gray_test (rgb, "./gray_strip_none.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_gray_test (rgb, "./gray_strip_lzw.tif", 0, RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_gray_test (rgb, "./gray_strip_deflate.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_gray_test (rgb, "./gray_strip_jpeg.tif", 0,
+ RL2_COMPRESSION_JPEG);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_gray_test (rgb, "./gray_tile_none.tif", 1, RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret = do_one_gray_test (rgb, "./gray_tile_lzw.tif", 1, RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_gray_test (rgb, "./gray_tile_deflate.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_gray_test (rgb, "./gray_tile_jpeg.tif", 1, RL2_COMPRESSION_JPEG);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_palette (const unsigned char *rgb)
+{
+/* testing Palette flavours */
+ int ret = do_one_palette_test (rgb, "./palette_strip_none.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_palette_test (rgb, "./palette_strip_lzw.tif", 0,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_palette_test (rgb, "./palette_strip_deflate.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_palette_test (rgb, "./palette_tile_none.tif", 1,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_palette_test (rgb, "./palette_tile_lzw.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_palette_test (rgb, "./palette_tile_deflate.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_monochrome (const unsigned char *rgb)
+{
+/* testing Monochrome flavours */
+ int ret = do_one_monochrome_test (rgb, "./monochrome_strip_none.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_monochrome_test (rgb, "./monochrome_strip_fax3.tif", 0,
+ RL2_COMPRESSION_CCITTFAX3);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_monochrome_test (rgb, "./monochrome_strip_fax4.tif", 0,
+ RL2_COMPRESSION_CCITTFAX4);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_monochrome_test (rgb, "./monochrome_tile_none.tif", 1,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_monochrome_test (rgb, "./monochrome_tile_fax3.tif", 1,
+ RL2_COMPRESSION_CCITTFAX3);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_monochrome_test (rgb, "./monochrome_tile_fax4.tif", 1,
+ RL2_COMPRESSION_CCITTFAX4);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_grid_8 (const unsigned char *rgb, sqlite3 * handle)
+{
+/* testing "grid int8" flavours */
+ int ret = do_one_grid_8_test (rgb, handle, "./grid_8_strip_none.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_8_test (rgb, handle, "./grid_8_strip_lzw.tif", 0,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_8_test (rgb, handle, "./grid_8_strip_deflate.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_8_test (rgb, handle, "./grid_8_tile_none.tif", 1,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_8_test (rgb, handle, "./grid_8_tile_lzw.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_8_test (rgb, handle, "./grid_8_tile_deflate.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_grid_u8 (const unsigned char *rgb, sqlite3 * handle)
+{
+/* testing "grid uint8" flavours */
+ int ret = do_one_grid_u8_test (rgb, handle, "./grid_u8_strip_none.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u8_test (rgb, handle, "./grid_u8_strip_lzw.tif", 0,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u8_test (rgb, handle, "./grid_u8_strip_deflate.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u8_test (rgb, handle, "./grid_u8_tile_none.tif", 1,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u8_test (rgb, handle, "./grid_u8_tile_lzw.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u8_test (rgb, handle, "./grid_u8_tile_deflate.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_grid_16 (const unsigned char *rgb, sqlite3 * handle)
+{
+/* testing "grid int16" flavours */
+ int ret = do_one_grid_16_test (rgb, handle, "./grid_16_strip_none.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_16_test (rgb, handle, "./grid_16_strip_lzw.tif", 0,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_16_test (rgb, handle, "./grid_16_strip_deflate.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_16_test (rgb, handle, "./grid_16_tile_none.tif", 1,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_16_test (rgb, handle, "./grid_16_tile_lzw.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_16_test (rgb, handle, "./grid_16_tile_deflate.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_grid_u16 (const unsigned char *rgb, sqlite3 * handle)
+{
+/* testing "grid uint16" flavours */
+ int ret = do_one_grid_u16_test (rgb, handle, "./grid_u16_strip_none.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u16_test (rgb, handle, "./grid_u16_strip_lzw.tif", 0,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u16_test (rgb, handle, "./grid_u16_strip_deflate.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u16_test (rgb, handle, "./grid_u16_tile_none.tif", 1,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u16_test (rgb, handle, "./grid_u16_tile_lzw.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u16_test (rgb, handle, "./grid_u16_tile_deflate.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_grid_32 (const unsigned char *rgb, sqlite3 * handle)
+{
+/* testing "grid int32" flavours */
+ int ret = do_one_grid_32_test (rgb, handle, "./grid_32_strip_none.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_32_test (rgb, handle, "./grid_32_strip_lzw.tif", 0,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_32_test (rgb, handle, "./grid_32_strip_deflate.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_32_test (rgb, handle, "./grid_32_tile_none.tif", 1,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_32_test (rgb, handle, "./grid_32_tile_lzw.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_32_test (rgb, handle, "./grid_32_tile_deflate.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_grid_u32 (const unsigned char *rgb, sqlite3 * handle)
+{
+/* testing "grid uint32" flavours */
+ int ret = do_one_grid_u32_test (rgb, handle, "./grid_u32_strip_none.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u32_test (rgb, handle, "./grid_u32_strip_lzw.tif", 0,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u32_test (rgb, handle, "./grid_u32_strip_deflate.tif", 0,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u32_test (rgb, handle, "./grid_u32_tile_none.tif", 1,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u32_test (rgb, handle, "./grid_u32_tile_lzw.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_u32_test (rgb, handle, "./grid_u32_tile_deflate.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_grid_float (const unsigned char *rgb, sqlite3 * handle)
+{
+/* testing "grid float" flavours */
+ int ret =
+ do_one_grid_float_test (rgb, handle, "./grid_float_strip_none.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_float_test (rgb, handle, "./grid_float_strip_lzw.tif", 0,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_float_test (rgb, handle, "./grid_float_strip_deflate.tif",
+ 0, RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_float_test (rgb, handle, "./grid_float_tile_none.tif", 1,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_float_test (rgb, handle, "./grid_float_tile_lzw.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_float_test (rgb, handle, "./grid_float_tile_deflate.tif", 1,
+ RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+do_test_grid_double (const unsigned char *rgb, sqlite3 * handle)
+{
+/* testing "grid double" flavours */
+ int ret =
+ do_one_grid_double_test (rgb, handle, "./grid_double_strip_none.tif", 0,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_double_test (rgb, handle, "./grid_double_strip_lzw.tif", 0,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_double_test (rgb, handle, "./grid_double_strip_deflate.tif",
+ 0, RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_double_test (rgb, handle, "./grid_double_tile_none.tif", 1,
+ RL2_COMPRESSION_NONE);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_double_test (rgb, handle, "./grid_double_tile_lzw.tif", 1,
+ RL2_COMPRESSION_LZW);
+ if (ret < 0)
+ return ret;
+ ret =
+ do_one_grid_double_test (rgb, handle, "./grid_double_tile_deflate.tif",
+ 1, RL2_COMPRESSION_DEFLATE);
+ if (ret < 0)
+ return ret;
+ return 0;
+}
+
+static int
+test_null (sqlite3 * handle)
+{
+/* testing null/invalid arguments */
+ rl2TiffDestinationPtr destination;
+ rl2PalettePtr palette;
+ unsigned int width;
+ unsigned int height;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char alias_pixel_type;
+ unsigned char num_bands;
+ unsigned char compression;
+ unsigned int tile_width;
+ unsigned int tile_height;
+ unsigned int strip_size;
+ int is_tiled;
+ int srid;
+ double minX;
+ double minY;
+ double maxX;
+ double maxY;
+ double hResolution;
+ double vResolution;
+ int is_geotiff;
+ int is_worldfile;
+
+ destination =
+ rl2_create_tiff_destination (NULL, 1024, 1024, RL2_SAMPLE_UINT8,
+ RL2_PIXEL_RGB, 3, NULL,
+ RL2_COMPRESSION_NONE, 0, 0);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create TIFF Destination - NULL path\n");
+ return -30;
+ }
+ destination =
+ rl2_create_geotiff_destination (NULL, handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ NULL, RL2_COMPRESSION_NONE, 0, 0, 4326,
+ 1000.0, 1000.0, 2000.0, 2000.0, 1.0,
+ 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - NULL path\n");
+ return -31;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", NULL, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ NULL, RL2_COMPRESSION_NONE, 0, 0, 4326,
+ 1000.0, 1000.0, 2000.0, 2000.0, 1.0,
+ 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - NULL SQLite handle\n");
+ return -32;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT32, RL2_PIXEL_RGB, 3,
+ NULL, RL2_COMPRESSION_NONE, 0, 0, 4326,
+ 1000.0, 1000.0, 2000.0, 2000.0, 1.0,
+ 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid RGB (1)\n");
+ return -33;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 2,
+ NULL, RL2_COMPRESSION_NONE, 0, 0, 4326,
+ 1000.0, 1000.0, 2000.0, 2000.0, 1.0,
+ 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid RGB (2)\n");
+ return -34;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ NULL, RL2_COMPRESSION_CCITTFAX3, 0, 0,
+ 4326, 1000.0, 1000.0, 2000.0, 2000.0,
+ 1.0, 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid RGB (3)\n");
+ return -35;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT32, RL2_PIXEL_GRAYSCALE,
+ 1, NULL, RL2_COMPRESSION_NONE, 0, 0,
+ 4326, 1000.0, 1000.0, 2000.0, 2000.0,
+ 1.0, 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Grayscale (1)\n");
+ return -36;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE,
+ 2, NULL, RL2_COMPRESSION_NONE, 0, 0,
+ 4326, 1000.0, 1000.0, 2000.0, 2000.0,
+ 1.0, 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Grayscale (2)\n");
+ return -37;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE,
+ 1, NULL, RL2_COMPRESSION_CCITTFAX3, 0,
+ 0, 4326, 1000.0, 1000.0, 2000.0, 2000.0,
+ 1.0, 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Grayscale (3)\n");
+ return -38;
+ }
+ palette = rl2_create_palette (256);
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_INT8, RL2_PIXEL_PALETTE, 1,
+ palette, RL2_COMPRESSION_NONE, 0, 0,
+ 4326, 1000.0, 1000.0, 2000.0, 2000.0,
+ 1.0, 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Palette (1)\n");
+ return -39;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_PALETTE, 2,
+ palette, RL2_COMPRESSION_NONE, 0, 0,
+ 4326, 1000.0, 1000.0, 2000.0, 2000.0,
+ 1.0, 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Palette (2)\n");
+ return -40;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_PALETTE, 1,
+ palette, RL2_COMPRESSION_CCITTFAX3, 0,
+ 0, 4326, 1000.0, 1000.0, 2000.0, 2000.0,
+ 1.0, 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Palette (3)\n");
+ return -41;
+ }
+ rl2_destroy_palette (palette);
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_PALETTE, 1,
+ NULL, RL2_COMPRESSION_NONE, 0, 0, 4326,
+ 1000.0, 1000.0, 2000.0, 2000.0, 1.0,
+ 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Palette (4)\n");
+ return -42;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_MONOCHROME,
+ 1, NULL, RL2_COMPRESSION_NONE, 0, 0,
+ 4326, 1000.0, 1000.0, 2000.0, 2000.0,
+ 1.0, 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Monochrome (1)\n");
+ return -43;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME,
+ 2, NULL, RL2_COMPRESSION_NONE, 0, 0,
+ 4326, 1000.0, 1000.0, 2000.0, 2000.0,
+ 1.0, 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Monochrome (2)\n");
+ return -44;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME,
+ 1, NULL, RL2_COMPRESSION_JPEG, 0, 0,
+ 4326, 1000.0, 1000.0, 2000.0, 2000.0,
+ 1.0, 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Monochrome (3)\n");
+ return -45;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_1_BIT, RL2_PIXEL_DATAGRID, 1,
+ NULL, RL2_COMPRESSION_NONE, 0, 0, 4326,
+ 1000.0, 1000.0, 2000.0, 2000.0, 1.0,
+ 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Grid (1)\n");
+ return -46;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 2,
+ NULL, RL2_COMPRESSION_NONE, 0, 0, 4326,
+ 1000.0, 1000.0, 2000.0, 2000.0, 1.0,
+ 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Grid (2)\n");
+ return -47;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 1,
+ NULL, RL2_COMPRESSION_JPEG, 0, 0, 4326,
+ 1000.0, 1000.0, 2000.0, 2000.0, 1.0,
+ 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid Grid (3)\n");
+ return -48;
+ }
+ destination =
+ rl2_create_geotiff_destination ("test.tif", handle, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 1,
+ NULL, RL2_COMPRESSION_NONE, 0, 0,
+ 999999, 1000.0, 1000.0, 2000.0, 2000.0,
+ 1.0, 1.0, 1);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - invalid SRID\n");
+ return -49;
+ }
+ destination =
+ rl2_create_tiff_worldfile_destination (NULL, 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB,
+ 3, NULL, RL2_COMPRESSION_NONE, 0,
+ 0, 4326, 1000.0, 1000.0, 2000.0,
+ 2000.0, 1.0, 1.0);
+ if (destination != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: Create GeoTIFF Destination - NULL path\n");
+ return -50;
+ }
+ destination =
+ rl2_create_tiff_destination ("test-null.tif", 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3, NULL,
+ RL2_COMPRESSION_NONE, 0, 0);
+ if (destination == NULL)
+ {
+ fprintf (stderr,
+ "Unexpected fail: Create TIFF destination - no georef striped\n");
+ return -51;
+ }
+ if (rl2_get_tiff_destination_srid (destination, &srid) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Get SRID - no georef\n");
+ return -52;
+ }
+ if (rl2_get_tiff_destination_extent
+ (destination, &minX, &minY, &maxX, &maxY) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Get Extent - no georef\n");
+ return -53;
+ }
+ if (rl2_get_tiff_destination_resolution
+ (destination, &hResolution, &vResolution) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Get Resolution - no georef\n");
+ return -54;
+ }
+ if (rl2_get_tiff_destination_worldfile_path (destination) != NULL)
+ {
+ fprintf (stderr, "Unexpected success: TFW Path (not existing)\n");
+ return -55;
+ }
+ if (rl2_get_tiff_destination_tile_size
+ (destination, &tile_width, &tile_height) == RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Tile Size\n");
+ return -56;
+ }
+ rl2_destroy_tiff_destination (destination);
+ unlink ("test-null.tif");
+ destination =
+ rl2_create_tiff_destination ("test-null.tif", 1024, 1024,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3, NULL,
+ RL2_COMPRESSION_NONE, 1, 256);
+ if (destination == NULL)
+ {
+ fprintf (stderr,
+ "Unexpected fail: Create TIFF destination - no georef tiled\n");
+ return -57;
+ }
+ if (rl2_get_tiff_destination_strip_size (destination, &strip_size) ==
+ RL2_OK)
+ {
+ fprintf (stderr, "Unexpected success: TIFF Strip Size\n");
+ return -58;
+ }
+ rl2_destroy_tiff_destination (destination);
+ unlink ("test-null.tif");
+
+ if (rl2_get_tiff_destination_worldfile_path (NULL) != NULL)
+ {
+ fprintf (stderr, "Unexpected success: TFW Path (NULL destination)\n");
+ return -59;
+ }
+ if (rl2_get_tiff_destination_path (NULL) != NULL)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Path (NULL destination)\n");
+ return -60;
+ }
+ if (rl2_get_tiff_destination_size (NULL, &width, &height) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Size (NULL destination)\n");
+ return -61;
+ }
+ if (rl2_get_tiff_destination_type
+ (NULL, &sample_type, &pixel_type, &alias_pixel_type,
+ &num_bands) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Type (NULL destination)\n");
+ return -62;
+ }
+ if (rl2_get_tiff_destination_compression (NULL, &compression) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Compression (NULL destination)\n");
+ return -63;
+ }
+ if (rl2_is_tiled_tiff_destination (NULL, &is_tiled) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF IsTiled - NULL destination\n");
+ return -64;
+ }
+ if (rl2_get_tiff_destination_tile_size (NULL, &tile_width, &tile_height) ==
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Tile Size - NULL destination\n");
+ return -65;
+ }
+ if (rl2_get_tiff_destination_strip_size (NULL, &strip_size) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Strip Size - NULL destination\n");
+ return -66;
+ }
+ if (rl2_get_tiff_destination_srid (NULL, &srid) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Get SRID - NULL destination\n");
+ return -67;
+ }
+ if (rl2_get_tiff_destination_extent (NULL, &minX, &minY, &maxX, &maxY) ==
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Get Extent - NULL destination\n");
+ return -68;
+ }
+ if (rl2_get_tiff_destination_resolution (NULL, &hResolution, &vResolution)
+ == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Get Resolution - NULL destination\n");
+ return -69;
+ }
+ if (rl2_is_geotiff_destination (NULL, &is_geotiff) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF IsGeoTIFF - NULL destination\n");
+ return -70;
+ }
+ if (rl2_is_tiff_worldfile_destination (NULL, &is_worldfile) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF IsWorldfile - NULL destination\n");
+ return -71;
+ }
+ if (rl2_write_tiff_worldfile (NULL) == RL2_OK)
+ {
+ fprintf (stderr,
+ "Unexpected success: TIFF Write Worldfile - NULL destination\n");
+ return -72;
+ }
+ unlink ("test.tif");
+
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int ret;
+ unsigned char *rgb;
+ sqlite3 *handle = NULL;
+ char *err_msg = NULL;
+ void *cache = spatialite_alloc_connection ();
+
+ if (argc > 1 || argv[0] == NULL)
+ argc = 1; /* silencing stupid compiler warnings */
+
+ ret =
+ sqlite3_open_v2 (":memory:", &handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "cannot open in-memory db: %s\n",
+ sqlite3_errmsg (handle));
+ return -2;
+ }
+ spatialite_init_ex (handle, cache, 0);
+
+ ret =
+ sqlite3_exec (handle, "SELECT InitSpatialMetadata()", NULL, NULL,
+ &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ sqlite3_close (handle);
+ return -3;
+ }
+
+/* testing an RGB image */
+ rgb = create_rainbow ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: rainbow\n");
+ return -1;
+ }
+/* testing RGB flavours */
+ ret = do_test_rgb (rgb);
+ if (ret < 0)
+ return ret;
+/* testing RGB flavours - GeoTIFF (1) */
+ ret = do_test_rgb_geotiff1 (rgb, handle);
+ if (ret < 0)
+ return ret;
+/* testing RGB flavours - GeoTIFF (3) */
+ ret = do_test_rgb_geotiff2 (rgb, handle);
+ if (ret < 0)
+ return ret;
+/* testing RGB flavours - TIFF+TFW */
+ ret = do_test_rgb_tfw (rgb);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing GrayBand image */
+ rgb = create_grayband ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: grayband\n");
+ return -1;
+ }
+/* testing GrayBand flavours */
+ ret = do_test_grayband (rgb);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing Palette image */
+ rgb = create_palette ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: palette\n");
+ return -1;
+ }
+/* testing Palete flavours */
+ ret = do_test_palette (rgb);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing Monochrome image */
+ rgb = create_monochrome ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: monochrome\n");
+ return -1;
+ }
+/* testing Monochrome flavours */
+ ret = do_test_monochrome (rgb);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing INT8 Grid */
+ rgb = create_grid_8 ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: GridInt8\n");
+ return -1;
+ }
+/* testing GRID INT8 flavours */
+ ret = do_test_grid_8 (rgb, handle);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing UINT8 Grid */
+ rgb = create_grid_u8 ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: GridUInt8\n");
+ return -1;
+ }
+/* testing GRID UINT8 flavours */
+ ret = do_test_grid_u8 (rgb, handle);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing INT16 Grid */
+ rgb = create_grid_16 ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: GridInt16\n");
+ return -1;
+ }
+/* testing GRID INT16 flavours */
+ ret = do_test_grid_16 (rgb, handle);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing UINT16 Grid */
+ rgb = create_grid_u16 ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: GridUInt16\n");
+ return -1;
+ }
+/* testing GRID UINT16 flavours */
+ ret = do_test_grid_u16 (rgb, handle);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing INT32 Grid */
+ rgb = create_grid_32 ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: GridInt32\n");
+ return -1;
+ }
+/* testing GRID INT32 flavours */
+ ret = do_test_grid_32 (rgb, handle);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing UINT16 Grid */
+ rgb = create_grid_u32 ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: GridUInt32\n");
+ return -1;
+ }
+/* testing GRID UINT16 flavours */
+ ret = do_test_grid_u32 (rgb, handle);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing FLOAT Grid */
+ rgb = create_grid_float ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: GridFloat\n");
+ return -1;
+ }
+/* testing GRID FLOAT flavours */
+ ret = do_test_grid_float (rgb, handle);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing DOUBLE Grid */
+ rgb = create_grid_double ();
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "Unable to create image: GridDouble\n");
+ return -1;
+ }
+/* testing GRID DOUBLE flavours */
+ ret = do_test_grid_double (rgb, handle);
+/* freeing the RGB buffer */
+ free (rgb);
+ if (ret < 0)
+ return ret;
+
+/* testing null/invalid args */
+ ret = test_null (handle);
+ if (ret < 0)
+ return ret;
+
+ sqlite3_close (handle);
+ spatialite_cleanup_ex (cache);
+
+ spatialite_shutdown ();
+ return 0;
+}
diff --git a/test/tobacco.svg b/test/tobacco.svg
new file mode 100644
index 0000000..fa44b53
--- /dev/null
+++ b/test/tobacco.svg
@@ -0,0 +1,382 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="580"
+ height="580"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.48.0 r9654"
+ sodipodi:docname="poi_tower_lookout.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata2975">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="1002"
+ inkscape:window-width="1278"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.9216771"
+ inkscape:cx="196.664"
+ inkscape:cy="179.42334"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
+ inkscape:current-layer="svg2"
+ showgrid="false"
+ inkscape:window-maximized="0"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="6.1230318e-14 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ id="perspective2441" />
+ <inkscape:perspective
+ id="perspective3452"
+ inkscape:persp3d-origin="30 : 20 : 1"
+ inkscape:vp_z="60 : 30 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 30 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <symbol
+ viewBox="244.5 110 489 219.9"
+ id="symbol-university">
+ <path
+ id="path4460"
+ d="M79,43l57,119c0,0,21-96,104-96s124,106,124,106l43-133l82-17L0,17L79,43z" />
+ <path
+ id="path4462"
+ d="M94,176l-21,39"
+ stroke-width="20"
+ stroke="#000000"
+ fill="none" />
+ <path
+ id="path4464"
+ d="M300,19c0,10.5-22.6,19-50.5,19S199,29.5,199,19s22.6-19,50.5-19S300,8.5,300,19z" />
+ <path
+ id="path4466"
+ d="M112,216l-16-38L64,88c0,0-9-8-4-35s16-24,16-24"
+ stroke-width="20"
+ stroke="#000000"
+ ill="none" />
+ </symbol>
+ <inkscape:perspective
+ id="perspective4471"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4668"
+ inkscape:persp3d-origin="6 : 4 : 1"
+ inkscape:vp_z="12 : 6 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 6 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3826"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3855"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3909"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3950"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3972"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3994"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4016"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4837"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective4971"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective6216"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective6764"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective6817"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.79354273,1.2601716)"
+ xlink:href="#linearGradient829"
+ id="radialGradient874"
+ cx="180.2453"
+ cy="198.41902"
+ r="101.58017"
+ fx="180.2453"
+ fy="198.41902" />
+ <linearGradient
+ id="linearGradient829">
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0.341667;"
+ offset="0.0000000"
+ id="stop830" />
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
+ offset="1.0000000"
+ id="stop831" />
+ </linearGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.007004,0.99304475)"
+ xlink:href="#linearGradient829"
+ id="radialGradient832"
+ cx="360.85146"
+ cy="167.47372"
+ r="46.394721"
+ fx="360.85146"
+ fy="167.47372" />
+ <linearGradient
+ id="linearGradient6826">
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0.341667;"
+ offset="0.0000000"
+ id="stop6828" />
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
+ offset="1.0000000"
+ id="stop6830" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.74491357,1.3424376)"
+ xlink:href="#linearGradient855"
+ id="linearGradient850"
+ x1="465.29425"
+ y1="248.24467"
+ x2="463.27056"
+ y2="405.7687"
+ spreadMethod="pad" />
+ <linearGradient
+ id="linearGradient855">
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
+ offset="0.0000000"
+ id="stop856" />
+ <stop
+ style="stop-color: rgb(255, 166, 23); stop-opacity: 0.733333;"
+ offset="1.0000000"
+ id="stop857" />
+ </linearGradient>
+ <linearGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(1.4586159,0.68558144)"
+ xlink:href="#linearGradient855"
+ id="linearGradient854"
+ x1="157.80581"
+ y1="120.96176"
+ x2="155.40575"
+ y2="231.63491" />
+ <linearGradient
+ id="linearGradient6837">
+ <stop
+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
+ offset="0.0000000"
+ id="stop6839" />
+ <stop
+ style="stop-color: rgb(255, 166, 23); stop-opacity: 0.733333;"
+ offset="1.0000000"
+ id="stop6841" />
+ </linearGradient>
+ <inkscape:perspective
+ id="perspective6928"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective10781"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective10806"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective10878"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective10919"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <clipPath
+ id="clipoutline2"
+ clipPathUnits="userSpaceOnUse">
+ <path
+ inkscape:connector-curvature="0"
+ d="m 55.8,12 0.76,0.16 c 8.84,-2.94 28.68,8.64 24.26,18.96 -1.12,1.62 -0.93,4.5 0.42,6.31 L 56.43,62.25 c -1.39,-1.39 -4.48,-1.36 -5.9,0 L 9.5,101.63 c -3.74,3.59 -0.8,6.64 0.78,8.25 l 7.36,7.36 c 1.61,1.6 5.86,3.76 8.88,0.56 L 65.24,76.99 c 1.35,-1.42 1.36,-4.47 0,-5.87 0,0 0.01,-0.02 0,-0.02 L 90.15,46.2 c 2.63,2.37 5.113827,2.574854 7.47,1.93 4.55057,-1.245432 7.08725,3.206643 9.81,6.46 l -1.23,1.21 c -1.82,1.84 -1.65,4.94 0.39,6.98 2.04,2.04 5.15,2.21 6.97,0.39 l 8.14,-8.13 [...]
+ id="outline2" />
+ </clipPath>
+ </defs>
+ <g
+ id="g1327">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 L 1.704,516.927 C 1.704,557.771 22.599,579.156 63.896,579.156 L 515.92,579.156 C 557.227,579.156 578.149,558.841 578.149,516.927 L 578.149,66.804 C 578.149,24.203 557.227,1.768 514.628,1.768 C 514.624,1.768 66.133,1.625 66.275,1.768 z "
+ style="fill:#111;stroke:#eee;stroke-width:3.40799999"
+ id="path1329" />
+ </g>
+ <g
+ id="layer3"
+ inkscape:label="Layout"
+ style="display:none;stroke:#757575;stroke-opacity:1"
+ transform="matrix(48.14969,0,0,48.14969,-536.27327,-33.306752)">
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4134"
+ width="10"
+ height="10"
+ x="1"
+ y="1" />
+ <rect
+ style="fill:none;stroke:#757575;stroke-width:0.10000000000000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect4136"
+ width="8"
+ height="8"
+ x="2"
+ y="2" />
+ </g>
+ <g
+ id="g3338"
+ transform="matrix(1.3973279,-0.2437849,0.2437849,1.3973279,-185.07402,-56.183307)" />
+ <rect
+ id="rect2227"
+ height="63.906197"
+ width="361.10565"
+ y="358.9368"
+ x="77.050842"
+ style="fill:#ffffff" />
+ <rect
+ id="rect2229"
+ height="63.668633"
+ width="18.233461"
+ y="359.17606"
+ x="455.20215"
+ style="fill:#ffffff" />
+ <rect
+ id="rect2231"
+ height="63.668633"
+ width="18.233461"
+ y="359.17606"
+ x="489.29333"
+ style="fill:#ffffff" />
+ <path
+ id="path2233"
+ d="m 363.08452,275.19514 c -27.49867,0 -49.88959,-22.27214 -49.88959,-49.77081 0,-5.22653 0.83149,-10.21549 2.3163,-14.96688 -34.09123,-0.59392 -61.47111,-28.44895 -61.47111,-62.65896 0,-34.44758 27.61745,-62.302603 61.94625,-62.777742 v 18.114672 c -24.35088,0.35636 -43.95036,20.19341 -43.95036,44.66307 0,24.58845 20.07462,44.66307 44.66307,44.66307 3.14779,0 6.05802,-0.35635 8.90885,-0.95028 0.8315,-0.23757 1.72238,-0.35635 2.55388,-0.35635 5.82045,0 10.57184,4.75139 10.57184,10.5 [...]
+ inkscape:connector-curvature="0"
+ style="fill:#ffffff" />
+ <path
+ id="path2235"
+ d="m 377.57626,205.94363 c 6.71134,-8.67129 10.69063,-19.4807 10.69063,-31.29978 0,-28.50834 -23.10363,-51.61198 -51.61197,-51.61198 h -4.03869 v -18.23346 h 4.03869 c 38.48626,0 69.84543,31.29978 69.84543,69.84544 0,10.33427 -2.3163,20.19341 -6.35498,28.98348 l 12.76936,-0.11879 c 52.32468,0 94.67145,42.46555 94.67145,94.67145 v 39.43654 h -18.23346 v -39.43654 c 0,-42.22798 -34.21001,-76.43799 -76.43799,-76.43799 h -26.72657 c -5.58288,0 -10.21549,-4.6326 -10.21549,-10.33427 0,-2. [...]
+ inkscape:connector-curvature="0"
+ style="fill:#ffffff" />
+</svg>
diff --git a/test/webp_no_alpha.webp b/test/webp_no_alpha.webp
new file mode 100644
index 0000000..1ed03ca
Binary files /dev/null and b/test/webp_no_alpha.webp differ
diff --git a/tools/Makefile.am b/tools/Makefile.am
new file mode 100644
index 0000000..94c2150
--- /dev/null
+++ b/tools/Makefile.am
@@ -0,0 +1,32 @@
+AM_CFLAGS = @LIBPNG_CFLAGS@ @LIBWEBP_CFLAGS@ @LIBLZMA_CFLAGS@ \
+ @LIBSPATIALITE_CFLAGS@ @LIBCAIRO_CFLAGS@ @LIBCURL_CFLAGS@ \
+ @LIBXML2_CFLAGS@
+AM_LDFLAGS = -L../src
+
+bin_PROGRAMS = rl2tool wmslite
+
+AM_CPPFLAGS = @CFLAGS@
+AM_CPPFLAGS += -I$(top_srcdir)/headers
+
+rl2tool_SOURCES = rl2tool.c
+
+wmslite_SOURCES = wmslite.c
+
+rl2tool_LDADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ @LIBLZMA_LIBS@ \
+ @LIBSPATIALITE_LIBS@ @LIBCAIRO_LIBS@ @LIBCURL_LIBS@ \
+ @LIBXML2_LIBS@ \
+ -lrasterlite2
+
+if MINGW
+wmslite_LDADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ @LIBLZMA_LIBS@ \
+ @LIBSPATIALITE_LIBS@ @LIBCAIRO_LIBS@ @LIBCURL_LIBS@ \
+ @LIBXML2_LIBS@ \
+ -lrasterlite2 -lws2_32
+else
+wmslite_LDADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ @LIBLZMA_LIBS@ \
+ @LIBSPATIALITE_LIBS@ @LIBCAIRO_LIBS@ @LIBCURL_LIBS@ \
+ @LIBXML2_LIBS@ \
+ -lrasterlite2
+endif
+
+
diff --git a/tools/Makefile.in b/tools/Makefile.in
new file mode 100644
index 0000000..496f7c0
--- /dev/null
+++ b/tools/Makefile.in
@@ -0,0 +1,666 @@
+# Makefile.in generated by automake 1.13.4 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.
+
+ at 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@
+pkgincludedir = $(includedir)/@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@
+bin_PROGRAMS = rl2tool$(EXEEXT) wmslite$(EXEEXT)
+subdir = tools
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(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)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_rl2tool_OBJECTS = rl2tool.$(OBJEXT)
+rl2tool_OBJECTS = $(am_rl2tool_OBJECTS)
+rl2tool_DEPENDENCIES =
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+am_wmslite_OBJECTS = wmslite.$(OBJEXT)
+wmslite_OBJECTS = $(am_wmslite_OBJECTS)
+wmslite_DEPENDENCIES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(rl2tool_SOURCES) $(wmslite_SOURCES)
+DIST_SOURCES = $(rl2tool_SOURCES) $(wmslite_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# 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)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAIRO_CFLAGS = @LIBCAIRO_CFLAGS@
+LIBCAIRO_LIBS = @LIBCAIRO_LIBS@
+LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
+LIBCURL_LIBS = @LIBCURL_LIBS@
+LIBLZMA_CFLAGS = @LIBLZMA_CFLAGS@
+LIBLZMA_LIBS = @LIBLZMA_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_CFLAGS = @LIBPNG_CFLAGS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@
+LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@
+LIBTOOL = @LIBTOOL@
+LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@
+LIBWEBP_LIBS = @LIBWEBP_LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+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@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+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_CXX = @ac_ct_CXX@
+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@
+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@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = @LIBPNG_CFLAGS@ @LIBWEBP_CFLAGS@ @LIBLZMA_CFLAGS@ \
+ @LIBSPATIALITE_CFLAGS@ @LIBCAIRO_CFLAGS@ @LIBCURL_CFLAGS@ \
+ @LIBXML2_CFLAGS@
+
+AM_LDFLAGS = -L../src
+AM_CPPFLAGS = @CFLAGS@ -I$(top_srcdir)/headers
+rl2tool_SOURCES = rl2tool.c
+wmslite_SOURCES = wmslite.c
+rl2tool_LDADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ @LIBLZMA_LIBS@ \
+ @LIBSPATIALITE_LIBS@ @LIBCAIRO_LIBS@ @LIBCURL_LIBS@ \
+ @LIBXML2_LIBS@ \
+ -lrasterlite2
+
+ at MINGW_FALSE@wmslite_LDADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ @LIBLZMA_LIBS@ \
+ at MINGW_FALSE@ @LIBSPATIALITE_LIBS@ @LIBCAIRO_LIBS@ @LIBCURL_LIBS@ \
+ at MINGW_FALSE@ @LIBXML2_LIBS@ \
+ at MINGW_FALSE@ -lrasterlite2
+
+ at MINGW_TRUE@wmslite_LDADD = @LIBPNG_LIBS@ @LIBWEBP_LIBS@ @LIBLZMA_LIBS@ \
+ at MINGW_TRUE@ @LIBSPATIALITE_LIBS@ @LIBCAIRO_LIBS@ @LIBCURL_LIBS@ \
+ at MINGW_TRUE@ @LIBXML2_LIBS@ \
+ at MINGW_TRUE@ -lrasterlite2 -lws2_32
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(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) --gnu tools/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tools/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):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ || test -f $$p1 \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+rl2tool$(EXEEXT): $(rl2tool_OBJECTS) $(rl2tool_DEPENDENCIES) $(EXTRA_rl2tool_DEPENDENCIES)
+ @rm -f rl2tool$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(rl2tool_OBJECTS) $(rl2tool_LDADD) $(LIBS)
+
+wmslite$(EXEEXT): $(wmslite_OBJECTS) $(wmslite_DEPENDENCIES) $(EXTRA_wmslite_DEPENDENCIES)
+ @rm -f wmslite$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(wmslite_OBJECTS) $(wmslite_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rl2tool.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wmslite.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+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
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; 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)
+
+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-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+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 -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ 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-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
+
+
+# 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:
diff --git a/tools/rl2tool.c b/tools/rl2tool.c
new file mode 100644
index 0000000..0dbc1ed
--- /dev/null
+++ b/tools/rl2tool.c
@@ -0,0 +1,4241 @@
+/*
+/ rl2_tool
+/
+/ a generic tool supporting RasterLite2 DataSources
+/
+/ version 1.0, 2013 June 7
+/
+/ Author: Sandro Furieri a.furieri at lqt.it
+/
+/ Copyright (C) 2013 Alessandro Furieri
+/
+/ This program is free software: you can redistribute it and/or modify
+/ it under the terms of the GNU General Public License as published by
+/ the Free Software Foundation, either version 3 of the License, or
+/ (at your option) any later version.
+/
+/ This program is distributed in the hope that it will be useful,
+/ but WITHOUT ANY WARRANTY; without even the implied warranty of
+/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+/ GNU General Public License for more details.
+/
+/ You should have received a copy of the GNU General Public License
+/ along with this program. If not, see <http://www.gnu.org/licenses/>.
+/
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+#include <limits.h>
+
+#include <sys/types.h>
+#if defined(_WIN32) && !defined(__MINGW32__)
+#include <io.h>
+#include <direct.h>
+#else
+#include <dirent.h>
+#endif
+
+#include <rasterlite2/rasterlite2.h>
+#include <rasterlite2/rl2tiff.h>
+#include <rasterlite2/rl2graphics.h>
+
+#include <spatialite/gaiaaux.h>
+#include <spatialite.h>
+
+#define ARG_NONE 0
+#define ARG_MODE_CREATE 1
+#define ARG_MODE_DROP 2
+#define ARG_MODE_IMPORT 3
+#define ARG_MODE_EXPORT 4
+#define ARG_MODE_DELETE 5
+#define ARG_MODE_PYRAMIDIZE 6
+#define ARG_MODE_PYRMONO 7
+#define ARG_MODE_DE_PYRAMIDIZE 8
+#define ARG_MODE_LIST 9
+#define ARG_MODE_CATALOG 10
+#define ARG_MODE_MAP 11
+#define ARG_MODE_HISTOGRAM 12
+
+#define ARG_DB_PATH 10
+#define ARG_SRC_PATH 11
+#define ARG_DST_PATH 12
+#define ARG_DIR_PATH 13
+#define ARG_FILE_EXT 14
+#define ARG_COVERAGE 15
+#define ARG_SECTION 16
+#define ARG_SAMPLE 17
+#define ARG_PIXEL 18
+#define ARG_NUM_BANDS 19
+#define ARG_COMPRESSION 20
+#define ARG_QUALITY 21
+#define ARG_TILE_WIDTH 22
+#define ARG_TILE_HEIGHT 23
+#define ARG_BAND_INDEX 24
+#define ARG_IMG_WIDTH 25
+#define ARG_IMG_HEIGHT 26
+#define ARG_SRID 27
+#define ARG_RESOLUTION 28
+#define ARG_X_RESOLUTION 29
+#define ARG_Y_RESOLUTION 30
+#define ARG_MINX 31
+#define ARG_MINY 32
+#define ARG_MAXX 33
+#define ARG_MAXY 34
+#define ARG_CX 35
+#define ARG_CY 36
+#define ARG_NO_DATA 37
+#define ARG_VIRT_LEVELS 38
+
+#define ARG_CACHE_SIZE 99
+
+#ifdef _WIN32
+#define strcasecmp _stricmp
+#endif /* not WIN32 */
+
+struct pyramid_params
+{
+/* a struct used to pass Pyramidization params */
+ const char *coverage;
+ sqlite3_int64 section_id;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char bands;
+ unsigned char compression;
+ int quality;
+ int tile_width;
+ int tile_height;
+ int srid;
+ double x_res;
+ double y_res;
+ const char *name;
+ int width;
+ int height;
+ double min_x;
+ double min_y;
+ double max_x;
+ double max_y;
+ double tile_minx;
+ double tile_miny;
+ double tile_maxx;
+ double tile_maxy;
+ unsigned char *bufpix;
+ int bufpix_size;
+ unsigned char *mask;
+ int mask_size;
+ sqlite3_stmt *query_stmt;
+ sqlite3_stmt *tiles_stmt;
+ sqlite3_stmt *data_stmt;
+};
+
+struct pyramid_virtual
+{
+ double h_res;
+ double v_res;
+ struct pyramid_virtual *next;
+};
+
+struct pyramid_level
+{
+ int level_id;
+ double h_res;
+ double v_res;
+ double tiles_count;
+ double blob_bytes;
+ struct pyramid_virtual *first;
+ struct pyramid_virtual *last;
+ struct pyramid_level *next;
+};
+
+struct pyramid_infos
+{
+ struct pyramid_level *first;
+ struct pyramid_level *last;
+};
+
+static char *
+formatFloat (double value)
+{
+/* nicely formatting a float value */
+ int i;
+ int len;
+ char *fmt = sqlite3_mprintf ("%1.24f", value);
+ len = strlen (fmt);
+ for (i = len - 1; i >= 0; i--)
+ {
+ if (fmt[i] == '0')
+ fmt[i] = '\0';
+ else
+ break;
+ }
+ len = strlen (fmt);
+ if (fmt[len - 1] == '.')
+ fmt[len] = '0';
+ return fmt;
+}
+
+static char *
+formatFloat2 (double value)
+{
+/* nicely formatting a float value (2 decimals) */
+ char *fmt = sqlite3_mprintf ("%1.2f", value);
+ return fmt;
+}
+
+static char *
+formatFloat6 (double value)
+{
+/* nicely formatting a float value (6 decimals) */
+ char *fmt = sqlite3_mprintf ("%1.2f", value);
+ return fmt;
+}
+
+static char *
+formatLong (double value)
+{
+/* nicely formatting a Longitude */
+ if (value >= -180.0 && value <= 180.0)
+ return formatFloat6 (value);
+ return formatFloat2 (value);
+}
+
+static char *
+formatLat (double value)
+{
+/* nicely formatting a Latitude */
+ if (value >= -90.0 && value <= 90.0)
+ return formatFloat6 (value);
+ return formatFloat2 (value);
+}
+
+static int
+set_connection (sqlite3 * handle, int journal_off)
+{
+/* properly setting up the connection */
+ int ret;
+ char *sql_err = NULL;
+
+ if (journal_off)
+ {
+ /* disabling the journal: unsafe but faster */
+ ret =
+ sqlite3_exec (handle, "PRAGMA journal_mode = OFF",
+ NULL, NULL, &sql_err);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "PRAGMA journal_mode=OFF error: %s\n",
+ sql_err);
+ sqlite3_free (sql_err);
+ return 0;
+ }
+ }
+
+/* enabling foreign key constraints */
+ ret =
+ sqlite3_exec (handle, "PRAGMA foreign_keys = 1", NULL, NULL, &sql_err);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "PRAGMA foreign_keys = 1 error: %s\n", sql_err);
+ sqlite3_free (sql_err);
+ return 0;
+ }
+
+ return 1;
+}
+
+static rl2PixelPtr
+default_nodata (unsigned char sample, unsigned char pixel,
+ unsigned char num_bands)
+{
+/* creating a default NO-DATA value */
+ int nb;
+ rl2PixelPtr pxl = rl2_create_pixel (sample, pixel, num_bands);
+ if (pxl == NULL)
+ return NULL;
+ switch (pixel)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ rl2_set_pixel_sample_1bit (pxl, 0);
+ break;
+ case RL2_PIXEL_PALETTE:
+ switch (sample)
+ {
+ case RL2_SAMPLE_1_BIT:
+ rl2_set_pixel_sample_1bit (pxl, 0);
+ break;
+ case RL2_SAMPLE_2_BIT:
+ rl2_set_pixel_sample_2bit (pxl, 0);
+ break;
+ case RL2_SAMPLE_4_BIT:
+ rl2_set_pixel_sample_4bit (pxl, 0);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_set_pixel_sample_uint8 (pxl, 0, 0);
+ break;
+ };
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ switch (sample)
+ {
+ case RL2_SAMPLE_1_BIT:
+ rl2_set_pixel_sample_1bit (pxl, 1);
+ break;
+ case RL2_SAMPLE_2_BIT:
+ rl2_set_pixel_sample_2bit (pxl, 3);
+ break;
+ case RL2_SAMPLE_4_BIT:
+ rl2_set_pixel_sample_4bit (pxl, 15);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_set_pixel_sample_uint8 (pxl, 0, 255);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rl2_set_pixel_sample_uint16 (pxl, 0, 0);
+ break;
+ };
+ break;
+ case RL2_PIXEL_RGB:
+ switch (sample)
+ {
+ case RL2_SAMPLE_UINT8:
+ rl2_set_pixel_sample_uint8 (pxl, 0, 255);
+ rl2_set_pixel_sample_uint8 (pxl, 1, 255);
+ rl2_set_pixel_sample_uint8 (pxl, 2, 255);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rl2_set_pixel_sample_uint16 (pxl, 0, 0);
+ rl2_set_pixel_sample_uint16 (pxl, 1, 0);
+ rl2_set_pixel_sample_uint16 (pxl, 2, 0);
+ break;
+ };
+ break;
+ case RL2_PIXEL_DATAGRID:
+ switch (sample)
+ {
+ case RL2_SAMPLE_INT8:
+ rl2_set_pixel_sample_int8 (pxl, 0);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_set_pixel_sample_uint8 (pxl, 0, 0);
+ break;
+ case RL2_SAMPLE_INT16:
+ rl2_set_pixel_sample_int16 (pxl, 0);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rl2_set_pixel_sample_uint16 (pxl, 0, 0);
+ break;
+ case RL2_SAMPLE_INT32:
+ rl2_set_pixel_sample_int32 (pxl, 0);
+ break;
+ case RL2_SAMPLE_UINT32:
+ rl2_set_pixel_sample_uint32 (pxl, 0);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ rl2_set_pixel_sample_float (pxl, 0.0);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ rl2_set_pixel_sample_double (pxl, 0.0);
+ break;
+ };
+ break;
+ case RL2_PIXEL_MULTIBAND:
+ switch (sample)
+ {
+ case RL2_SAMPLE_UINT8:
+ for (nb = 0; nb < num_bands; nb++)
+ rl2_set_pixel_sample_uint8 (pxl, nb, 255);
+ break;
+ case RL2_SAMPLE_UINT16:
+ for (nb = 0; nb < num_bands; nb++)
+ rl2_set_pixel_sample_uint16 (pxl, nb, 0);
+ break;
+ };
+ break;
+ };
+ return pxl;
+}
+
+static int
+exec_create (sqlite3 * handle, const char *coverage,
+ unsigned char sample, unsigned char pixel, unsigned char num_bands,
+ unsigned char compression, int quality, unsigned short tile_width,
+ unsigned short tile_height, int srid, double x_res, double y_res,
+ rl2PixelPtr no_data)
+{
+/* performing CREATE */
+ rl2PalettePtr palette = NULL;
+
+ if (no_data == NULL)
+ {
+ /* creating a default NO-DATA value */
+ no_data = default_nodata (sample, pixel, num_bands);
+ }
+ if (pixel == RL2_PIXEL_PALETTE)
+ {
+/* creating a default PALETTE */
+ palette = rl2_create_palette (1);
+ rl2_set_palette_color (palette, 0, 255, 255, 255);
+ }
+ if (srid == -1)
+ {
+ x_res = 1.0;
+ y_res = 1.0;
+ }
+
+ if (rl2_create_dbms_coverage
+ (handle, coverage, sample, pixel, num_bands, compression, quality,
+ tile_width, tile_height, srid, x_res, y_res, no_data,
+ palette) != RL2_OK)
+ return 0;
+
+ printf ("\rRaster Coverage \"%s\" successfully created\n", coverage);
+ return 1;
+}
+
+static int
+exec_import (sqlite3 * handle, const char *src_path, const char *dir_path,
+ const char *file_ext, const char *coverage,
+ int worldfile, int force_srid, int pyramidize)
+{
+/* performing IMPORT */
+ int ret;
+ rl2CoveragePtr cvg = NULL;
+
+ cvg = rl2_create_coverage_from_dbms (handle, coverage);
+ if (cvg == NULL)
+ {
+ rl2_destroy_coverage (cvg);
+ return 0;
+ }
+
+ if (src_path != NULL)
+ ret =
+ rl2_load_raster_into_dbms (handle, src_path, cvg, worldfile,
+ force_srid, pyramidize);
+ else
+ ret =
+ rl2_load_mrasters_into_dbms (handle, dir_path, file_ext, cvg,
+ worldfile, force_srid, pyramidize);
+ rl2_destroy_coverage (cvg);
+ if (ret == RL2_OK)
+ return 1;
+ return 0;
+}
+
+static int
+is_ascii_grid (const char *path)
+{
+/* testing for an ASCII Grid */
+ int len = strlen (path);
+ if (len > 4)
+ {
+ if (strcasecmp (path + len - 4, ".asc") == 0)
+ return 1;
+ }
+ return 0;
+}
+
+static int
+is_jpeg_image (const char *path)
+{
+/* testing for a JPEG Image */
+ int len = strlen (path);
+ if (len > 4)
+ {
+ if (strcasecmp (path + len - 4, ".jpg") == 0)
+ return 1;
+ }
+ return 0;
+}
+
+static int
+exec_export (sqlite3 * handle, const char *dst_path, const char *coverage,
+ double x_res, double y_res, double minx, double miny, double maxx,
+ double maxy, unsigned short width, unsigned short height)
+{
+/* performing EXPORT */
+ rl2CoveragePtr cvg = rl2_create_coverage_from_dbms (handle, coverage);
+ if (cvg == NULL)
+ return 0;
+ if (is_ascii_grid (dst_path))
+ {
+ /* export an ASCII Grid */
+ if (rl2_export_ascii_grid_from_dbms
+ (handle, dst_path, cvg, x_res, minx, miny, maxx, maxy, width,
+ height, 0, 4) != RL2_OK)
+ goto error;
+ }
+ else if (is_jpeg_image (dst_path))
+ {
+ /* export a JPEG Image (with possible WorldFile) */
+ int srid;
+ int with_worldfile = 0;
+ if (rl2_get_coverage_srid (cvg, &srid) == RL2_OK)
+ {
+ if (srid > 0)
+ with_worldfile = 1;
+ }
+ if (rl2_export_jpeg_from_dbms
+ (handle, dst_path, cvg, x_res, y_res, minx, miny, maxx, maxy,
+ width, height, 85, with_worldfile) != RL2_OK)
+ goto error;
+ }
+ else
+ {
+ /* export a GeoTIFF */
+ if (rl2_export_geotiff_from_dbms
+ (handle, dst_path, cvg, x_res, y_res, minx, miny, maxx, maxy,
+ width, height, RL2_COMPRESSION_NONE, 256, 0) != RL2_OK)
+ goto error;
+ }
+ rl2_destroy_coverage (cvg);
+ return 1;
+ error:
+ rl2_destroy_coverage (cvg);
+ return 0;
+}
+
+static int
+exec_drop (sqlite3 * handle, const char *coverage)
+{
+/* performing DROP */
+ rl2CoveragePtr cvg = NULL;
+
+ cvg = rl2_create_coverage_from_dbms (handle, coverage);
+ if (cvg == NULL)
+ goto error;
+
+ if (rl2_drop_dbms_coverage (handle, coverage) != RL2_OK)
+ goto error;
+
+ rl2_destroy_coverage (cvg);
+ return 1;
+
+ error:
+ if (cvg != NULL)
+ rl2_destroy_coverage (cvg);
+ return 0;
+}
+
+static int
+exec_delete (sqlite3 * handle, const char *coverage, const char *section)
+{
+/* deleting a Raster Section */
+ rl2CoveragePtr cvg = NULL;
+ sqlite3_int64 section_id;
+
+ cvg = rl2_create_coverage_from_dbms (handle, coverage);
+ if (cvg == NULL)
+ goto error;
+
+ if (rl2_get_dbms_section_id (handle, coverage, section, §ion_id) !=
+ RL2_OK)
+ {
+ fprintf (stderr,
+ "Section \"%s\" does not exists in Coverage \"%s\"\n",
+ section, coverage);
+ goto error;
+ }
+
+ if (rl2_delete_dbms_section (handle, coverage, section_id) != RL2_OK)
+ goto error;
+
+ rl2_destroy_coverage (cvg);
+ return 1;
+
+ error:
+ if (cvg != NULL)
+ rl2_destroy_coverage (cvg);
+ return 0;
+}
+
+static int
+exec_pyramidize (sqlite3 * handle, const char *coverage, const char *section,
+ int force_pyramid)
+{
+/* building Pyramid levels */
+ int ret;
+ if (section == NULL)
+ ret = rl2_build_all_section_pyramids (handle, coverage, force_pyramid);
+ else
+ ret =
+ rl2_build_section_pyramid (handle, coverage, section,
+ force_pyramid);
+ if (ret == RL2_OK)
+ return 1;
+ return 0;
+}
+
+static int
+exec_pyramidize_monolithic (sqlite3 * handle, const char *coverage,
+ int virt_levels)
+{
+/* building Pyramid levels (Monolithic) */
+ int ret = rl2_build_monolithic_pyramid (handle, coverage, virt_levels);
+ if (ret == RL2_OK)
+ return 1;
+ return 0;
+}
+
+static int
+exec_de_pyramidize (sqlite3 * handle, const char *coverage, const char *section)
+{
+/* deleting Pyramid levels */
+ int ret;
+ if (section == NULL)
+ ret = rl2_delete_all_pyramids (handle, coverage);
+ else
+ ret = rl2_delete_section_pyramid (handle, coverage, section);
+ if (ret == RL2_OK)
+ return 1;
+ return 0;
+}
+
+static void
+add_pyramid_level (struct pyramid_infos *pyramid, int level_id, double h_res,
+ double v_res)
+{
+/* inserting a physical Pyramid Level into the list */
+ struct pyramid_level *lvl = malloc (sizeof (struct pyramid_level));
+ lvl->level_id = level_id;
+ lvl->h_res = h_res;
+ lvl->v_res = v_res;
+ lvl->tiles_count = 0;
+ lvl->blob_bytes = 0;
+ lvl->first = NULL;
+ lvl->last = NULL;
+ lvl->next = NULL;
+ if (pyramid->first == NULL)
+ pyramid->first = lvl;
+ if (pyramid->last != NULL)
+ pyramid->last->next = lvl;
+ pyramid->last = lvl;
+}
+
+static void
+set_pyramid_level (struct pyramid_infos *pyramid, int level_id,
+ sqlite3_int64 count, sqlite3_int64 size_odd,
+ sqlite3_int64 size_even)
+{
+/* setting up values for a physical Pyramid Level */
+ struct pyramid_level *lvl = pyramid->first;
+ while (lvl != NULL)
+ {
+ if (lvl->level_id == level_id)
+ {
+ lvl->tiles_count = count;
+ lvl->blob_bytes = size_odd;
+ lvl->blob_bytes += size_even;
+ return;
+ }
+ lvl = lvl->next;
+ }
+}
+
+static void
+add_pyramid_virtual (struct pyramid_infos *pyramid, int level_id, double h_res,
+ double v_res)
+{
+/* inserting a virtual Pyramid Level into the list */
+ struct pyramid_level *lvl = pyramid->first;
+ while (lvl != NULL)
+ {
+ if (lvl->level_id == level_id)
+ {
+ struct pyramid_virtual *vrt =
+ malloc (sizeof (struct pyramid_virtual));
+ vrt->h_res = h_res;
+ vrt->v_res = v_res;
+ vrt->next = NULL;
+ if (lvl->first == NULL)
+ lvl->first = vrt;
+ if (lvl->last != NULL)
+ lvl->last->next = vrt;
+ lvl->last = vrt;
+ return;
+ }
+ lvl = lvl->next;
+ }
+}
+
+static void
+free_pyramid_level (struct pyramid_level *level)
+{
+/* memory cleanup - destroying a Pyramid Level object */
+ struct pyramid_virtual *lev;
+ struct pyramid_virtual *n_lev;
+ if (level == NULL)
+ return;
+ lev = level->first;
+ while (lev)
+ {
+ n_lev = lev->next;
+ free (lev);
+ lev = n_lev;
+ }
+ free (level);
+}
+
+static void
+free_pyramid_infos (struct pyramid_infos *pyramid)
+{
+/* memory cleanup - destroying a Pyramid Infos object */
+ struct pyramid_level *lev;
+ struct pyramid_level *n_lev;
+ if (pyramid == NULL)
+ return;
+ lev = pyramid->first;
+ while (lev)
+ {
+ n_lev = lev->next;
+ free_pyramid_level (lev);
+ lev = n_lev;
+ }
+ free (pyramid);
+}
+
+static struct pyramid_infos *
+get_pyramid_infos (sqlite3 * handle, const char *coverage)
+{
+ char *sql;
+ char *xtable;
+ char *xxtable;
+ char *xtable2;
+ char *xxtable2;
+ int ret;
+ sqlite3_stmt *stmt = NULL;
+ struct pyramid_infos *pyramid = malloc (sizeof (struct pyramid_infos));
+ pyramid->first = NULL;
+ pyramid->last = NULL;
+
+ xtable = sqlite3_mprintf ("%s_levels", coverage);
+ xxtable = gaiaDoubleQuotedSql (xtable);
+ sqlite3_free (xtable);
+ sql =
+ sqlite3_mprintf
+ ("SELECT pyramid_level, x_resolution_1_1, y_resolution_1_1, "
+ "x_resolution_1_2, y_resolution_1_2, x_resolution_1_4, y_resolution_1_4, "
+ "x_resolution_1_8, y_resolution_1_8 "
+ "FROM \"%s\" ORDER BY pyramid_level", xxtable);
+ free (xxtable);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("Levels SQL error: %s\n", sqlite3_errmsg (handle));
+ goto error;
+ }
+ while (1)
+ {
+ /* querying the Pyramid Levels */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ int level_id = sqlite3_column_int (stmt, 0);
+ double h_res = sqlite3_column_double (stmt, 1);
+ double v_res = sqlite3_column_double (stmt, 2);
+ add_pyramid_level (pyramid, level_id, h_res, v_res);
+ if (sqlite3_column_type (stmt, 3) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 4) == SQLITE_FLOAT)
+ {
+ h_res = sqlite3_column_double (stmt, 3);
+ v_res = sqlite3_column_double (stmt, 4);
+ add_pyramid_virtual (pyramid, level_id, h_res, v_res);
+ }
+ if (sqlite3_column_type (stmt, 5) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 6) == SQLITE_FLOAT)
+ {
+ h_res = sqlite3_column_double (stmt, 5);
+ v_res = sqlite3_column_double (stmt, 6);
+ add_pyramid_virtual (pyramid, level_id, h_res, v_res);
+ }
+ if (sqlite3_column_type (stmt, 7) == SQLITE_FLOAT
+ && sqlite3_column_type (stmt, 8) == SQLITE_FLOAT)
+ {
+ h_res = sqlite3_column_double (stmt, 7);
+ v_res = sqlite3_column_double (stmt, 8);
+ add_pyramid_virtual (pyramid, level_id, h_res, v_res);
+ }
+ }
+ else
+ {
+ fprintf (stderr,
+ "Levels sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ stmt = NULL;
+ if (pyramid->first == NULL)
+ goto error;
+
+ xtable = sqlite3_mprintf ("%s_tiles", coverage);
+ xxtable = gaiaDoubleQuotedSql (xtable);
+ sqlite3_free (xtable);
+ xtable2 = sqlite3_mprintf ("%s_tile_data", coverage);
+ xxtable2 = gaiaDoubleQuotedSql (xtable2);
+ sqlite3_free (xtable2);
+ sql =
+ sqlite3_mprintf
+ ("SELECT t.pyramid_level, Count(*), Sum(Length(d.tile_data_odd)), "
+ "Sum(Length(d.tile_data_even)) FROM \"%s\" AS t "
+ "JOIN \"%s\" AS d ON (d.tile_id = t.tile_id) "
+ "GROUP BY t.pyramid_level", xxtable, xxtable2);
+ free (xxtable);
+ free (xxtable2);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("Tiles SQL error: %s\n", sqlite3_errmsg (handle));
+ goto error;
+ }
+ while (1)
+ {
+ /* querying the Pyramid Tiles */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ int level_id = sqlite3_column_int (stmt, 0);
+ sqlite3_int64 count = sqlite3_column_int (stmt, 1);
+ sqlite3_int64 size_odd = sqlite3_column_int (stmt, 2);
+ sqlite3_int64 size_even = 0;
+ if (sqlite3_column_type (stmt, 3) != SQLITE_NULL)
+ size_even = sqlite3_column_int (stmt, 3);
+ set_pyramid_level (pyramid, level_id, count, size_odd,
+ size_even);
+ }
+ else
+ {
+ fprintf (stderr,
+ "Tiles sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ stmt = NULL;
+ return pyramid;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (pyramid != NULL)
+ free_pyramid_infos (pyramid);
+ return NULL;
+}
+
+static int
+exec_catalog (sqlite3 * handle)
+{
+/* Rasterlite-2 datasources Catalog */
+ const char *sql;
+ int ret;
+ int count = 0;
+ char *hres;
+ char *vres;
+ sqlite3_stmt *stmt = NULL;
+ rl2PixelPtr no_data = NULL;
+ rl2PalettePtr palette = NULL;
+ rl2RasterStatisticsPtr statistics = NULL;
+ struct pyramid_infos *pyramid = NULL;
+
+ sql =
+ "SELECT coverage_name, title, abstract, sample_type, pixel_type, "
+ "num_bands, compression, quality, tile_width, tile_height, "
+ "horz_resolution, vert_resolution, srid, auth_name, auth_srid, "
+ "ref_sys_name, extent_minx, extent_miny, extent_maxx, extent_maxy, "
+ "nodata_pixel, palette, statistics "
+ "FROM raster_coverages_ref_sys ORDER BY coverage_name";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ goto stop;
+
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ const char *name = (const char *) sqlite3_column_text (stmt, 0);
+ const char *title =
+ (const char *) sqlite3_column_text (stmt, 1);
+ const char *abstract =
+ (const char *) sqlite3_column_text (stmt, 2);
+ const char *sample =
+ (const char *) sqlite3_column_text (stmt, 3);
+ const char *pixel =
+ (const char *) sqlite3_column_text (stmt, 4);
+ int bands = sqlite3_column_int (stmt, 5);
+ const char *compression =
+ (const char *) sqlite3_column_text (stmt, 6);
+ int quality = sqlite3_column_int (stmt, 7);
+ int tileW = sqlite3_column_int (stmt, 8);
+ int tileH = sqlite3_column_int (stmt, 9);
+ double x_res = sqlite3_column_double (stmt, 10);
+ double y_res = sqlite3_column_double (stmt, 11);
+ int srid = sqlite3_column_int (stmt, 12);
+ const char *authName =
+ (const char *) sqlite3_column_text (stmt, 13);
+ int authSrid = sqlite3_column_int (stmt, 14);
+ const char *crsName =
+ (const char *) sqlite3_column_text (stmt, 15);
+ char *minx = NULL;
+ char *miny = NULL;
+ char *maxx = NULL;
+ char *maxy = NULL;
+ int horz = -1;
+ int vert = -1;
+ double mnx = DBL_MAX;
+ double mny = DBL_MAX;
+ double mxx = DBL_MAX;
+ double mxy = DBL_MAX;
+ const unsigned char *blob;
+ int blob_sz;
+ if (sqlite3_column_type (stmt, 16) == SQLITE_FLOAT)
+ {
+ mnx = sqlite3_column_double (stmt, 16);
+ minx = formatFloat (mnx);
+ }
+ if (sqlite3_column_type (stmt, 17) == SQLITE_FLOAT)
+ {
+ mny = sqlite3_column_double (stmt, 17);
+ miny = formatFloat (mny);
+ }
+ if (sqlite3_column_type (stmt, 18) == SQLITE_FLOAT)
+ {
+ mxx = sqlite3_column_double (stmt, 18);
+ maxx = formatFloat (mxx);
+ }
+ if (sqlite3_column_type (stmt, 19) == SQLITE_FLOAT)
+ {
+ mxy = sqlite3_column_double (stmt, 19);
+ maxy = formatFloat (mxy);
+ }
+ if (mnx != DBL_MAX && mny != DBL_MAX && mxx != DBL_MAX
+ && mxy != DBL_MAX)
+ {
+ double ext_x = mxx - mnx;
+ double ext_y = mxy - mny;
+ horz = (int) (ext_x / x_res);
+ vert = (int) (ext_y / y_res);
+ }
+ if (sqlite3_column_type (stmt, 20) == SQLITE_BLOB)
+ {
+ blob = sqlite3_column_blob (stmt, 20);
+ blob_sz = sqlite3_column_bytes (stmt, 20);
+ no_data = rl2_deserialize_dbms_pixel (blob, blob_sz);
+ }
+ if (sqlite3_column_type (stmt, 21) == SQLITE_BLOB)
+ {
+ blob = sqlite3_column_blob (stmt, 21);
+ blob_sz = sqlite3_column_bytes (stmt, 21);
+ palette = rl2_deserialize_dbms_palette (blob, blob_sz);
+ }
+ if (sqlite3_column_type (stmt, 22) == SQLITE_BLOB)
+ {
+ blob = sqlite3_column_blob (stmt, 22);
+ blob_sz = sqlite3_column_bytes (stmt, 22);
+ statistics =
+ rl2_deserialize_dbms_raster_statistics (blob,
+ blob_sz);
+ }
+ pyramid = get_pyramid_infos (handle, name);
+ count++;
+ printf
+ ("===============================================================================\n");
+ printf (" Coverage: %s\n", name);
+ printf (" Title: %s\n", title);
+ printf (" Abstract: %s\n", abstract);
+ printf
+ ("-------------------------------------------------------------------------------\n");
+ printf (" Sample Type: %s\n", sample);
+ printf (" Pixel Type: %s\n", pixel);
+ printf (" Number of Bands: %d\n", bands);
+ if (strcmp (compression, "NONE") == 0)
+ printf (" Compression: NONE (uncompressed)\n");
+ else if (strcmp (compression, "DEFLATE") == 0)
+ printf (" Compression: DEFLATE (zip, lossless)\n");
+ else if (strcmp (compression, "LZMA") == 0)
+ printf (" Compression: LZMA (7-zip, lossless)\n");
+ else if (strcmp (compression, "PNG") == 0)
+ printf (" Compression: PNG, lossless\n");
+ else if (strcmp (compression, "JPEG") == 0)
+ printf (" Compression: JPEG (lossy)\n");
+ else if (strcmp (compression, "WEBP") == 0)
+ printf (" Compression: WEBP (lossy)\n");
+ else if (strcmp (compression, "LL_WEBP") == 0)
+ printf (" Compression: WEBP, lossless\n");
+ else if (strcmp (compression, "FAX4") == 0)
+ printf (" Compression: CCITT-FAX4 lossless\n");
+ if (strcmp (compression, "JPEG") == 0
+ || strcmp (compression, "WEBP") == 0)
+ printf (" Compression Quality: %d\n", quality);
+ printf (" Tile Size (pixels): %d x %d\n", tileW, tileH);
+ hres = formatFloat (x_res);
+ vres = formatFloat (y_res);
+ printf ("Pixel base resolution: X=%s Y=%s\n", hres, vres);
+ printf
+ ("-------------------------------------------------------------------------------\n");
+ sqlite3_free (hres);
+ sqlite3_free (vres);
+ if (horz >= 0 && vert >= 0)
+ printf ("Overall Size (pixels): %d x %d\n", horz, vert);
+ else
+ printf ("Overall Size (pixels): *** undefined ***\n");
+ printf (" Srid: %d (%s,%d) %s\n", srid,
+ authName, authSrid, crsName);
+ if (minx == NULL || miny == NULL)
+ printf (" LowerLeftCorner: *** undefined ***\n");
+ else
+ printf (" LowerLeftCorner: X=%s Y=%s\n", minx, miny);
+ if (minx == NULL || miny == NULL)
+ printf (" UpperRightCorner: *** undefined ***\n");
+ else
+ printf (" UpperRightCorner: X=%s Y=%s\n", maxx, maxy);
+ printf
+ ("-------------------------------------------------------------------------------\n");
+ if (no_data == NULL)
+ printf (" NO-DATA Pixel: *** undefined ***\n");
+ else
+ {
+ unsigned char i;
+ unsigned char sample_type;
+ unsigned char pixel_type;
+ unsigned char num_bands;
+ rl2_get_pixel_type (no_data, &sample_type, &pixel_type,
+ &num_bands);
+ printf (" NO-DATA Pixel: ");
+ for (i = 0; i < num_bands; i++)
+ {
+ char *val;
+ char val_int8;
+ short val_int16;
+ int val_int32;
+ unsigned char val_uint8;
+ unsigned short val_uint16;
+ unsigned int val_uint32;
+ float val_float;
+ double val_double;
+ if (i > 0)
+ printf (", ");
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ rl2_get_pixel_sample_1bit (no_data,
+ &val_uint8);
+ printf ("%u", val_uint8);
+ break;
+ case RL2_SAMPLE_2_BIT:
+ rl2_get_pixel_sample_2bit (no_data,
+ &val_uint8);
+ printf ("%u", val_uint8);
+ break;
+ case RL2_SAMPLE_4_BIT:
+ rl2_get_pixel_sample_4bit (no_data,
+ &val_uint8);
+ printf ("%u", val_uint8);
+ break;
+ case RL2_SAMPLE_INT8:
+ rl2_get_pixel_sample_int8 (no_data,
+ &val_int8);
+ printf ("%d", val_int8);
+ break;
+ case RL2_SAMPLE_INT16:
+ rl2_get_pixel_sample_int16 (no_data,
+ &val_int16);
+ printf ("%d", val_int16);
+ break;
+ case RL2_SAMPLE_INT32:
+ rl2_get_pixel_sample_int32 (no_data,
+ &val_int32);
+ printf ("%d", val_int32);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_get_pixel_sample_uint8 (no_data, i,
+ &val_uint8);
+ printf ("%u", val_uint8);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rl2_get_pixel_sample_uint16 (no_data, i,
+ &val_uint16);
+ printf ("%u", val_uint16);
+ break;
+ case RL2_SAMPLE_UINT32:
+ rl2_get_pixel_sample_uint32 (no_data,
+ &val_uint32);
+ printf ("%u", val_uint32);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ rl2_get_pixel_sample_float (no_data,
+ &val_float);
+ val = formatFloat (val_float);
+ printf ("%s", val);
+ sqlite3_free (val);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ rl2_get_pixel_sample_double (no_data,
+ &val_double);
+ val = formatFloat (val_double);
+ printf ("%s", val);
+ sqlite3_free (val);
+ break;
+ }
+ }
+ printf ("\n");
+
+ }
+ if (palette != NULL)
+ {
+ /* printing an eventual Palette */
+ unsigned char i;
+ unsigned short num_entries;
+ unsigned char *red = NULL;
+ unsigned char *green = NULL;
+ unsigned char *blue = NULL;
+ rl2_get_palette_colors (palette, &num_entries, &red,
+ &green, &blue);
+ for (i = 0; i < num_entries; i++)
+ {
+ if (i == 0)
+ printf
+ (" Color Palette %3d: #%02x%02x%02x\n",
+ i, *(red + i), *(green + i), *(blue + i));
+ else
+ printf
+ (" %3d: #%02x%02x%02x\n",
+ i, *(red + i), *(green + i), *(blue + i));
+ }
+ }
+ if (statistics != NULL)
+ {
+ /* printing the Statistics summary (if any) */
+ unsigned char i;
+ double no_data;
+ double count;
+ unsigned char sample_type;
+ unsigned char num_bands;
+ rl2_get_raster_statistics_summary (statistics, &no_data,
+ &count, &sample_type,
+ &num_bands);
+ printf
+ ("-------------------------------------------------------------------------------\n");
+ printf (" NO-DATA Pixels Count: %1.0f\n", no_data);
+ printf (" Valid Pixels Count: %1.0f\n", count);
+ for (i = 0; i < num_bands; i++)
+ {
+ /* band summary */
+ double min;
+ double max;
+ double mean;
+ double var;
+ double stddev;
+ char *val;
+ printf
+ (" =========== Band #%u Summary ==========\n",
+ i);
+ rl2_get_band_statistics (statistics, i, &min, &max,
+ &mean, &var, &stddev);
+ if (sample_type == RL2_SAMPLE_FLOAT
+ || sample_type == RL2_SAMPLE_DOUBLE)
+ {
+ val = formatFloat (min);
+ printf (" Min Value: %s\n", val);
+ sqlite3_free (val);
+ val = formatFloat (max);
+ printf (" Max Value: %s\n", val);
+ sqlite3_free (val);
+ }
+ else
+ {
+ printf (" Min Value: %1.0f\n",
+ min);
+ printf (" Max Value: %1.0f\n",
+ max);
+ }
+ val = formatFloat (mean);
+ printf (" Mean Value: %s\n", val);
+ sqlite3_free (val);
+ val = formatFloat (var);
+ printf (" Variance: %s\n", val);
+ sqlite3_free (val);
+ val = formatFloat (stddev);
+ printf (" Standard Deviation: %s\n", val);
+ sqlite3_free (val);
+ }
+ }
+ if (pyramid != NULL)
+ {
+ /* printing Pyramid Level Infos */
+ struct pyramid_level *lvl;
+ struct pyramid_virtual *vrt;
+ printf
+ ("-------------------------------------------------------------------------------\n");
+ lvl = pyramid->first;
+ while (lvl != NULL)
+ {
+ printf
+ (" === Pyramid Level: %d ==========================\n",
+ lvl->level_id);
+ hres = formatFloat (lvl->h_res);
+ vres = formatFloat (lvl->v_res);
+ printf (" Physical resolution: X=%s Y=%s\n", hres,
+ vres);
+ sqlite3_free (hres);
+ sqlite3_free (vres);
+ vrt = lvl->first;
+ while (vrt != NULL)
+ {
+ hres = formatFloat (vrt->h_res);
+ vres = formatFloat (vrt->v_res);
+ printf (" Virtual resolution: X=%s Y=%s\n",
+ hres, vres);
+ sqlite3_free (hres);
+ sqlite3_free (vres);
+ vrt = vrt->next;
+ }
+ printf (" Tiles Count: %1.0f\n",
+ lvl->tiles_count);
+ printf (" BLOB Bytes: %1.0f\n",
+ lvl->blob_bytes);
+ lvl = lvl->next;
+ }
+ }
+ if (minx != NULL)
+ sqlite3_free (minx);
+ if (miny != NULL)
+ sqlite3_free (miny);
+ if (maxx != NULL)
+ sqlite3_free (maxx);
+ if (maxy != NULL)
+ sqlite3_free (maxy);
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ if (statistics != NULL)
+ rl2_destroy_raster_statistics (statistics);
+ no_data = NULL;
+ palette = NULL;
+ statistics = NULL;
+ if (pyramid != NULL)
+ free_pyramid_infos (pyramid);
+ pyramid = NULL;
+ printf
+ ("===============================================================================\n\n\n");
+ }
+ else
+ {
+ fprintf (stderr,
+ "CATALOG; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto stop;
+ }
+ }
+
+ sqlite3_finalize (stmt);
+ if (count == 0)
+ printf ("no Rasterlite-2 datasources found\n");
+ return 1;
+
+ stop:
+ if (no_data != NULL)
+ rl2_destroy_pixel (no_data);
+ if (palette != NULL)
+ rl2_destroy_palette (palette);
+ if (statistics != NULL)
+ rl2_destroy_raster_statistics (statistics);
+ if (pyramid != NULL)
+ free_pyramid_infos (pyramid);
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ printf ("no Rasterlite-2 datasources found\n");
+ return 0;
+}
+
+static int
+exec_list (sqlite3 * handle, const char *coverage, const char *section)
+{
+/* Rasterlite-2 datasource Sections list */
+ char *sql;
+ int ret;
+ sqlite3_stmt *stmt = NULL;
+ char *dumb1;
+ char *dumb2;
+ char *xsections;
+ char *xxsections;
+ char *xtiles;
+ char *xxtiles;
+ char *xdata;
+ char *xxdata;
+ rl2RasterStatisticsPtr statistics = NULL;
+ int last_id;
+ int first;
+
+ if (section == NULL)
+ {
+ /* all sections */
+ xsections = sqlite3_mprintf ("%s_sections", coverage);
+ xxsections = gaiaDoubleQuotedSql (xsections);
+ sqlite3_free (xsections);
+ xtiles = sqlite3_mprintf ("%s_tiles", coverage);
+ xxtiles = gaiaDoubleQuotedSql (xtiles);
+ sqlite3_free (xtiles);
+ xdata = sqlite3_mprintf ("%s_tile_data", coverage);
+ xxdata = gaiaDoubleQuotedSql (xdata);
+ sqlite3_free (xdata);
+ sql =
+ sqlite3_mprintf
+ ("SELECT s.section_id, s.section_name, s.width, s.height, "
+ "s.file_path, MbrMinX(s.geometry), MbrMinY(s.geometry), MbrMaxX(s.geometry), "
+ "MbrMaxY(s.geometry), s.statistics, t.pyramid_level, Count(*), "
+ "Sum(Length(d.tile_data_odd)), Sum(Length(d.tile_data_even)) "
+ "FROM \"%s\" AS s "
+ "JOIN \"%s\" AS t ON (s.section_id = t.section_id) "
+ "JOIN \"%s\" AS d ON (d.tile_id = t.tile_id) "
+ "GROUP BY s.section_id, t.pyramid_level", xxsections, xxtiles,
+ xxdata);
+ free (xxsections);
+ free (xxtiles);
+ free (xxdata);
+ }
+ else
+ {
+ /* single section */
+ xsections = sqlite3_mprintf ("%s_sections", coverage);
+ xxsections = gaiaDoubleQuotedSql (xsections);
+ sqlite3_free (xsections);
+ xtiles = sqlite3_mprintf ("%s_tiles", coverage);
+ xxtiles = gaiaDoubleQuotedSql (xtiles);
+ sqlite3_free (xtiles);
+ xdata = sqlite3_mprintf ("%s_tile_data", coverage);
+ xxdata = gaiaDoubleQuotedSql (xdata);
+ sqlite3_free (xdata);
+ sql =
+ sqlite3_mprintf
+ ("SELECT s.section_id, s.section_name, s.width, s.height, "
+ "s.file_path, MbrMinX(s.geometry), MbrMinY(s.geometry), MbrMaxX(s.geometry), "
+ "MbrMaxY(s.geometry), s.statistics, t.pyramid_level, Count(*), "
+ "Sum(Length(d.tile_data_odd)), Sum(Length(d.tile_data_even)) "
+ "FROM \"%s\" AS s "
+ "JOIN \"%s\" AS t ON (s.section_id = t.section_id) "
+ "JOIN \"%s\" AS d ON (d.tile_id = t.tile_id) "
+ "WHERE s.section_name = %Q "
+ "GROUP BY s.section_id, t.pyramid_level", xxsections,
+ xxtiles, xxdata, section);
+ free (xxsections);
+ free (xxtiles);
+ free (xxdata);
+ }
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ goto stop;
+
+ printf
+ ("===============================================================================\n");
+ printf (" Coverage: %s\n", coverage);
+ printf
+ ("===============================================================================\n\n");
+ last_id = -1;
+ first = 1;
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ int id = sqlite3_column_int (stmt, 0);
+ const char *name = (const char *) sqlite3_column_text (stmt, 1);
+ int width = sqlite3_column_int (stmt, 2);
+ int height = sqlite3_column_int (stmt, 3);
+ const char *path = NULL;
+ double minx = DBL_MAX;
+ double miny = DBL_MAX;
+ double maxx = DBL_MAX;
+ double maxy = DBL_MAX;
+ int level = 0;
+ int tiles = 0;
+ int blob_bytes = 0;
+ if (sqlite3_column_type (stmt, 4) == SQLITE_TEXT)
+ path = (const char *) sqlite3_column_text (stmt, 4);
+ if (sqlite3_column_type (stmt, 5) == SQLITE_FLOAT)
+ minx = sqlite3_column_double (stmt, 5);
+ if (sqlite3_column_type (stmt, 6) == SQLITE_FLOAT)
+ miny = sqlite3_column_double (stmt, 6);
+ if (sqlite3_column_type (stmt, 7) == SQLITE_FLOAT)
+ maxx = sqlite3_column_double (stmt, 7);
+ if (sqlite3_column_type (stmt, 8) == SQLITE_FLOAT)
+ maxy = sqlite3_column_double (stmt, 8);
+ if (sqlite3_column_type (stmt, 9) == SQLITE_BLOB)
+ {
+ const unsigned char *blob = sqlite3_column_blob (stmt, 9);
+ int blob_sz = sqlite3_column_bytes (stmt, 9);
+ statistics =
+ rl2_deserialize_dbms_raster_statistics (blob,
+ blob_sz);
+ }
+ level = sqlite3_column_int (stmt, 10);
+ tiles = sqlite3_column_int (stmt, 11);
+ blob_bytes = sqlite3_column_int (stmt, 12);
+ if (sqlite3_column_type (stmt, 13) == SQLITE_INTEGER)
+ blob_bytes += sqlite3_column_int (stmt, 13);
+ if (last_id != id)
+ {
+ if (!first)
+ {
+ printf
+ ("-------------------------------------------------------------------------------\n");
+ printf ("\n\n\n");
+ }
+ else
+ first = 0;
+ printf
+ ("-------------------------------------------------------------------------------\n");
+ printf (" Section: (%d) %s\n", id, name);
+ printf
+ ("-------------------------------------------------------------------------------\n");
+ printf (" Size (pixels): %d x %d\n", width,
+ height);
+ if (path == NULL)
+ printf (" Input Path: *** unknowon ***\n");
+ else
+ printf (" Input Path: %s\n", path);
+ if (minx == DBL_MAX || miny == DBL_MAX)
+ printf (" LowerLeft corner: *** unknown ***\n");
+ else
+ {
+ dumb1 = formatLong (minx);
+ dumb2 = formatLat (miny);
+ printf (" LowerLeft corner: X=%s Y=%s\n", dumb1,
+ dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ }
+ if (maxx == DBL_MAX || maxy == DBL_MAX)
+ printf (" UpperRight corner: *** unknown ***\n");
+ else
+ {
+ dumb1 = formatLong (maxx);
+ dumb2 = formatLat (maxy);
+ printf (" UpperRight corner: X=%s Y=%s\n", dumb1,
+ dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ }
+ if (minx == DBL_MAX || miny == DBL_MAX || maxx == DBL_MAX
+ || maxy == DBL_MAX)
+ printf (" Center Point: *** unknown ***\n");
+ else
+ {
+ dumb1 = formatLong (minx + ((maxx - minx) / 2.0));
+ dumb2 = formatLat (miny + ((maxy - miny) / 2.0));
+ printf (" Center Point: X=%s Y=%s\n", dumb1,
+ dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ }
+ if (statistics != NULL)
+ {
+ /* printing the Statistics summary (if any) */
+ unsigned char i;
+ double no_data;
+ double count;
+ unsigned char sample_type;
+ unsigned char num_bands;
+ rl2_get_raster_statistics_summary (statistics,
+ &no_data, &count,
+ &sample_type,
+ &num_bands);
+ printf
+ ("-------------------------------------------------------------------------------\n");
+ printf (" NO-DATA Pixels Count: %1.0f\n", no_data);
+ printf (" Valid Pixels Count: %1.0f\n", count);
+ for (i = 0; i < num_bands; i++)
+ {
+ /* band summary */
+ double min;
+ double max;
+ double mean;
+ double var;
+ double stddev;
+ char *val;
+ printf
+ (" =========== Band #%u Summary ==========\n",
+ i);
+ rl2_get_band_statistics (statistics, i, &min,
+ &max, &mean, &var,
+ &stddev);
+ if (sample_type == RL2_SAMPLE_FLOAT
+ || sample_type == RL2_SAMPLE_DOUBLE)
+ {
+ val = formatFloat (min);
+ printf (" Min Value: %s\n",
+ val);
+ sqlite3_free (val);
+ val = formatFloat (max);
+ printf (" Max Value: %s\n",
+ val);
+ sqlite3_free (val);
+ }
+ else
+ {
+ printf
+ (" Min Value: %1.0f\n",
+ min);
+ printf
+ (" Max Value: %1.0f\n",
+ max);
+ }
+ val = formatFloat (mean);
+ printf (" Mean Value: %s\n", val);
+ sqlite3_free (val);
+ val = formatFloat (var);
+ printf (" Variance: %s\n", val);
+ sqlite3_free (val);
+ val = formatFloat (stddev);
+ printf (" Standard Deviation: %s\n", val);
+ sqlite3_free (val);
+ }
+ printf
+ ("-------------------------------------------------------------------------------\n");
+ }
+ }
+ last_id = id;
+ printf (" ========== Level: %d ==========\n", level);
+ printf (" Tiles Count: %d\n", tiles);
+ printf (" BLOB Bytes: %d\n", blob_bytes);
+ if (statistics != NULL)
+ rl2_destroy_raster_statistics (statistics);
+ }
+ else
+ {
+ fprintf (stderr,
+ "LIST; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto stop;
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (!first)
+ printf
+ ("-------------------------------------------------------------------------------\n");
+ return 1;
+
+ stop:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (statistics != NULL)
+ rl2_destroy_raster_statistics (statistics);
+ printf ("not existing or empty Rasterlite-2 datasource\n");
+ return 0;
+}
+
+static int
+exec_map (sqlite3 * handle, const char *coverage, const char *dst_path,
+ unsigned short width, unsigned short height)
+{
+/* Rasterlite-2 datasource Map */
+ char *sql;
+ int ret;
+ char *xsections;
+ char *xxsections;
+ sqlite3_stmt *stmt = NULL;
+ int found = 0;
+ double minx = 0.0;
+ double maxx = 0.0;
+ double miny = 0.0;
+ double maxy = 0.0;
+ double ext_x;
+ double ext_y;
+ double ratio_x;
+ double ratio_y;
+ double ratio;
+ double cx;
+ double cy;
+ double base_x;
+ double base_y;
+ int row;
+ int col;
+ unsigned char *p_alpha;
+ rl2GraphicsContextPtr ctx = NULL;
+ rl2RasterPtr rst = NULL;
+ rl2SectionPtr img = NULL;
+ unsigned char *rgb = NULL;
+ unsigned char *alpha = NULL;
+ rl2GraphicsFontPtr font = NULL;
+
+/* full extent */
+ xsections = sqlite3_mprintf ("%s_sections", coverage);
+ xxsections = gaiaDoubleQuotedSql (xsections);
+ sqlite3_free (xsections);
+ sql =
+ sqlite3_mprintf
+ ("SELECT Min(MbrMinX(geometry)), Max(MbrMaxX(geometry)), "
+ "Min(MbrMinY(geometry)), Max(MbrMaxY(geometry)) "
+ "FROM \"%s\"", xxsections);
+ free (xxsections);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT Coverage full Extent SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ minx = sqlite3_column_double (stmt, 0);
+ maxx = sqlite3_column_double (stmt, 1);
+ miny = sqlite3_column_double (stmt, 2);
+ maxy = sqlite3_column_double (stmt, 3);
+ found++;
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT Coverage full Extent; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ stmt = NULL;
+ if (!found)
+ goto error;
+
+/* computing the reproduction ratio */
+ ext_x = maxx - minx;
+ ext_y = maxy - miny;
+ ratio_x = (ext_x / 2.0) / (double) width;
+ ratio_y = (ext_y / 2.0) / (double) height;
+ if (ratio_x < ratio_y)
+ ratio = ratio_x;
+ else
+ ratio = ratio_y;
+ while (1)
+ {
+ double w = ext_x / ratio;
+ double h = ext_y / ratio;
+ if (w < (double) (width - 20) && h < (double) (height - 20))
+ break;
+ ratio *= 1.001;
+ }
+ cx = minx + (ext_x / 2.0);
+ cy = miny + (ext_y / 2.0);
+ base_x = cx - ((double) (width / 2) * ratio);
+ base_y = cy + ((double) (height / 2) * ratio);
+
+/* creating a graphics context */
+ ctx = rl2_graph_create_context (width, height);
+ if (ctx == NULL)
+ {
+ fprintf (stderr, "Unable to create a graphics backend\n");
+ goto error;
+ }
+/* setting up a black Font */
+ font =
+ rl2_graph_create_font (16, RL2_FONTSTYLE_ITALIC, RL2_FONTWEIGHT_BOLD);
+ if (font == NULL)
+ {
+ fprintf (stderr, "Unable to create a Font\n");
+ goto error;
+ }
+ if (!rl2_graph_font_set_color (font, 0, 0, 0, 255))
+ {
+ fprintf (stderr, "Unable to set the font color\n");
+ goto error;
+ }
+ if (!rl2_graph_set_font (ctx, font))
+ {
+ fprintf (stderr, "Unable to set up a font\n");
+ goto error;
+ }
+
+/* querying Sections */
+ xsections = sqlite3_mprintf ("%s_sections", coverage);
+ xxsections = gaiaDoubleQuotedSql (xsections);
+ sqlite3_free (xsections);
+ sql =
+ sqlite3_mprintf
+ ("SELECT section_name, geometry " "FROM \"%s\"", xxsections);
+ free (xxsections);
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT Coverage full Extent SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ const char *section_name =
+ (const char *) sqlite3_column_text (stmt, 0);
+ const unsigned char *blob = sqlite3_column_blob (stmt, 1);
+ int blob_sz = sqlite3_column_bytes (stmt, 1);
+ gaiaGeomCollPtr geom =
+ gaiaFromSpatiaLiteBlobWkb (blob, blob_sz);
+ if (geom != NULL)
+ {
+ double pre_x;
+ double pre_y;
+ double t_width;
+ double t_height;
+ double post_x;
+ double post_y;
+ double x = (geom->MinX - base_x) / ratio;
+ double y = (base_y - geom->MaxY) / ratio;
+ double w = (geom->MaxX - geom->MinX) / ratio;
+ double h = (geom->MaxY - geom->MinY) / ratio;
+ double cx = x + (w / 2.0);
+ double cy = y + (h / 2.0);
+ gaiaFreeGeomColl (geom);
+ /* setting up a RED pen */
+ rl2_graph_set_pen (ctx, 255, 0, 0, 255, 2.0,
+ RL2_PENSTYLE_SOLID);
+ /* setting up a Gray solid semi-transparent Brush */
+ rl2_graph_set_brush (ctx, 255, 255, 255, 204);
+ rl2_graph_draw_rectangle (ctx, x, y, w, h);
+ rl2_graph_get_text_extent (ctx, section_name, &pre_x,
+ &pre_y, &t_width, &t_height,
+ &post_x, &post_y);
+ /* setting up a white pen */
+ rl2_graph_set_pen (ctx, 255, 255, 255, 255, 2.0,
+ RL2_PENSTYLE_SOLID);
+ /* setting up a white solid semi-transparent Brush */
+ rl2_graph_set_brush (ctx, 255, 255, 255, 255);
+ rl2_graph_draw_rectangle (ctx, cx - (t_width / 2.0),
+ cy - (t_height / 2.0),
+ t_width, t_height);
+ rl2_graph_draw_text (ctx, section_name,
+ cx - (t_width / 2.0),
+ cy + (t_height / 2.0), 0.0);
+ }
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT Coverage full Extent; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+
+/* exporting the Map as a PNG image */
+ rgb = rl2_graph_get_context_rgb_array (ctx);
+ if (rgb == NULL)
+ {
+ fprintf (stderr, "invalid RGB buffer from Graphics Context\n");
+ goto error;
+ }
+ alpha = rl2_graph_get_context_alpha_array (ctx);
+ if (alpha == NULL)
+ {
+ fprintf (stderr, "invalid Alpha buffer from Graphics Context\n");
+ goto error;
+ }
+ rl2_graph_destroy_context (ctx);
+ ctx = NULL;
+
+/* transforming ALPHA into a transparency mask */
+ p_alpha = alpha;
+ for (row = 0; row < height; row++)
+ {
+ for (col = 0; col < width; col++)
+ {
+ if (*p_alpha > 128)
+ *p_alpha++ = 1;
+ else
+ *p_alpha++ = 0;
+ }
+ }
+ rst = rl2_create_raster (width, height, RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3,
+ rgb, width * height * 3, NULL, alpha,
+ width * height, NULL);
+ if (rst == NULL)
+ {
+ fprintf (stderr, "Unable to create the output raster+mask\n");
+ goto error;
+ }
+ rgb = NULL;
+ alpha = NULL;
+ img =
+ rl2_create_section ("beta", RL2_COMPRESSION_NONE,
+ RL2_TILESIZE_UNDEFINED, RL2_TILESIZE_UNDEFINED,
+ rst);
+ if (img == NULL)
+ {
+ fprintf (stderr, "Unable to create the output section+mask\n");
+ goto error;
+ }
+ if (rl2_section_to_png (img, dst_path) != RL2_OK)
+ {
+ fprintf (stderr, "Unable to write: test_paint.png\n");
+ goto error;
+ }
+ rl2_destroy_section (img);
+ rl2_graph_destroy_font (font);
+ return 1;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ if (ctx != NULL)
+ rl2_graph_destroy_context (ctx);
+ if (font != NULL)
+ rl2_graph_destroy_font (font);
+ if (rgb != NULL)
+ free (rgb);
+ if (alpha != NULL)
+ free (alpha);
+ printf ("not existing or empty Rasterlite-2 datasource\n");
+ return 0;
+}
+
+static int
+exec_histogram (sqlite3 * handle, const char *coverage, const char *section,
+ unsigned char band_index, const char *dst_path)
+{
+/* Rasterlite-2 PNG Histogram */
+ char *sql;
+ int ret;
+ char *xsections;
+ char *xxsections;
+ sqlite3_stmt *stmt = NULL;
+
+ if (section != NULL)
+ {
+ /* Histogram from Section-level Statistics */
+ xsections = sqlite3_mprintf ("%s_sections", coverage);
+ xxsections = gaiaDoubleQuotedSql (xsections);
+ sqlite3_free (xsections);
+ sql =
+ sqlite3_mprintf
+ ("SELECT RL2_GetBandStatistics_Histogram(statistics, ?) "
+ "FROM \"%s\"", xxsections);
+ free (xxsections);
+ }
+ else
+ {
+ /* Histogram from Coverage-level Statistics */
+ sql = sqlite3_mprintf
+ ("SELECT RL2_GetBandStatistics_Histogram(statistics, ?) "
+ "FROM raster_coverages "
+ "WHERE Lower(coverage_name) = Lower(%Q)", coverage);
+ }
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ {
+ printf ("SELECT BandStatistics Histogram SQL error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_int64 (stmt, 1, band_index);
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ FILE *out;
+ const unsigned char *blob = NULL;
+ int blob_sz;
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ blob = sqlite3_column_blob (stmt, 0);
+ blob_sz = sqlite3_column_bytes (stmt, 0);
+ }
+ if (blob == NULL)
+ goto error;
+/* exporting the PNG */
+ out = fopen (dst_path, "wb");
+ if (out == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to create/open %s\n",
+ dst_path);
+ return 0;
+ }
+ fwrite (blob, 1, blob_sz, out);
+ fclose (out);
+ }
+ else
+ {
+ fprintf (stderr,
+ "SELECT BandStatistics Histogram; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ }
+ sqlite3_finalize (stmt);
+ stmt = NULL;
+ return 1;
+
+ error:
+ if (stmt != NULL)
+ sqlite3_finalize (stmt);
+ printf
+ ("not existing or empty Rasterlite-2 datasource or invalid band index\n");
+ return 0;
+}
+
+static void
+spatialite_autocreate (sqlite3 * db)
+{
+/* attempting to perform self-initialization for a newly created DB */
+ int ret;
+ char sql[1024];
+ char *err_msg = NULL;
+ int count;
+ int i;
+ char **results;
+ int rows;
+ int columns;
+
+/* checking if this DB is really empty */
+ strcpy (sql, "SELECT Count(*) from sqlite_master");
+ ret = sqlite3_get_table (db, sql, &results, &rows, &columns, NULL);
+ if (ret != SQLITE_OK)
+ return;
+ if (rows < 1)
+ ;
+ else
+ {
+ for (i = 1; i <= rows; i++)
+ count = atoi (results[(i * columns) + 0]);
+ }
+ sqlite3_free_table (results);
+
+ if (count > 0)
+ return;
+
+/* all right, it's empty: proceding to initialize */
+ strcpy (sql, "SELECT InitSpatialMetadata(1)");
+ ret = sqlite3_exec (db, sql, NULL, NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return;
+ }
+ strcpy (sql, "SELECT CreateRasterCoveragesTable()");
+ ret = sqlite3_exec (db, sql, NULL, NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateRasterCoveragesTable() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return;
+ }
+ strcpy (sql, "SELECT CreateStylingTables()");
+ ret = sqlite3_exec (db, sql, NULL, NULL, &err_msg);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "CreateStylingTables() error: %s\n", err_msg);
+ sqlite3_free (err_msg);
+ return;
+ }
+}
+
+static void
+open_db (const char *path, sqlite3 ** handle, int cache_size, void *cache)
+{
+/* opening the DB */
+ sqlite3 *db_handle;
+ int ret;
+ char sql[1024];
+ int spatialite_rs = 0;
+ int spatialite_gc = 0;
+ int rs_srid = 0;
+ int auth_name = 0;
+ int auth_srid = 0;
+ int ref_sys_name = 0;
+ int proj4text = 0;
+ int f_table_name = 0;
+ int f_geometry_column = 0;
+ int coord_dimension = 0;
+ int gc_srid = 0;
+ int type = 0;
+ int geometry_type = 0;
+ int spatial_index_enabled = 0;
+ const char *name;
+ int i;
+ char **results;
+ int rows;
+ int columns;
+
+ *handle = NULL;
+ printf (" SQLite version: %s\n", sqlite3_libversion ());
+ printf (" SpatiaLite version: %s\n", spatialite_version ());
+ printf ("RasterLite2 version: %s\n\n", rl2_version ());
+
+ ret =
+ sqlite3_open_v2 (path, &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "cannot open '%s': %s\n", path,
+ sqlite3_errmsg (db_handle));
+ sqlite3_close (db_handle);
+ return;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ spatialite_autocreate (db_handle);
+ if (cache_size > 0)
+ {
+ /* setting the CACHE-SIZE */
+ sprintf (sql, "PRAGMA cache_size=%d", cache_size);
+ sqlite3_exec (db_handle, sql, NULL, NULL, NULL);
+ }
+ rl2_init (db_handle, 0);
+
+/* checking the GEOMETRY_COLUMNS table */
+ strcpy (sql, "PRAGMA table_info(geometry_columns)");
+ ret = sqlite3_get_table (db_handle, sql, &results, &rows, &columns, NULL);
+ if (ret != SQLITE_OK)
+ goto unknown;
+ if (rows < 1)
+ ;
+ else
+ {
+ for (i = 1; i <= rows; i++)
+ {
+ name = results[(i * columns) + 1];
+ if (strcasecmp (name, "f_table_name") == 0)
+ f_table_name = 1;
+ if (strcasecmp (name, "f_geometry_column") == 0)
+ f_geometry_column = 1;
+ if (strcasecmp (name, "coord_dimension") == 0)
+ coord_dimension = 1;
+ if (strcasecmp (name, "srid") == 0)
+ gc_srid = 1;
+ if (strcasecmp (name, "type") == 0)
+ type = 1;
+ if (strcasecmp (name, "geometry_type") == 0)
+ geometry_type = 1;
+ if (strcasecmp (name, "spatial_index_enabled") == 0)
+ spatial_index_enabled = 1;
+ }
+ }
+ sqlite3_free_table (results);
+ if (f_table_name && f_geometry_column && type && coord_dimension
+ && gc_srid && spatial_index_enabled)
+ spatialite_gc = 1;
+ if (f_table_name && f_geometry_column && geometry_type && coord_dimension
+ && gc_srid && spatial_index_enabled)
+ spatialite_gc = 3;
+
+/* checking the SPATIAL_REF_SYS table */
+ strcpy (sql, "PRAGMA table_info(spatial_ref_sys)");
+ ret = sqlite3_get_table (db_handle, sql, &results, &rows, &columns, NULL);
+ if (ret != SQLITE_OK)
+ goto unknown;
+ if (rows < 1)
+ ;
+ else
+ {
+ for (i = 1; i <= rows; i++)
+ {
+ name = results[(i * columns) + 1];
+ if (strcasecmp (name, "srid") == 0)
+ rs_srid = 1;
+ if (strcasecmp (name, "auth_name") == 0)
+ auth_name = 1;
+ if (strcasecmp (name, "auth_srid") == 0)
+ auth_srid = 1;
+ if (strcasecmp (name, "ref_sys_name") == 0)
+ ref_sys_name = 1;
+ if (strcasecmp (name, "proj4text") == 0)
+ proj4text = 1;
+ }
+ }
+ sqlite3_free_table (results);
+ if (rs_srid && auth_name && auth_srid && ref_sys_name && proj4text)
+ spatialite_rs = 1;
+/* verifying the MetaData format */
+ if (spatialite_gc && spatialite_rs)
+ ;
+ else
+ goto unknown;
+ *handle = db_handle;
+ return;
+
+ unknown:
+ if (db_handle)
+ sqlite3_close (db_handle);
+ fprintf (stderr, "DB '%s'\n", path);
+ fprintf (stderr, "doesn't seems to contain valid Spatial Metadata ...\n\n");
+ fprintf (stderr, "Please, initialize Spatial Metadata\n\n");
+ return;
+}
+
+static int
+check_create_args (const char *db_path, const char *coverage, int sample,
+ int pixel, int num_bands, int compression, int *quality,
+ int tile_width, int tile_height, int srid, double x_res,
+ double y_res, rl2PixelPtr pxl)
+{
+/* checking/printing CREATE args */
+ int err = 0;
+ int res_error = 0;
+ printf ("\n\nrl2_tool: request is CREATE\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf (" DB path: %s\n", db_path);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Coverage's name was specified\n");
+ err = 1;
+ }
+ else
+ printf (" Coverage: %s\n", coverage);
+ switch (sample)
+ {
+ case RL2_SAMPLE_1_BIT:
+ printf (" Sample Type: 1-BIT\n");
+ break;
+ case RL2_SAMPLE_2_BIT:
+ printf (" Sample Type: 2-BIT\n");
+ break;
+ case RL2_SAMPLE_4_BIT:
+ printf (" Sample Type: 4-BIT\n");
+ break;
+ case RL2_SAMPLE_INT8:
+ printf (" Sample Type: INT8\n");
+ break;
+ case RL2_SAMPLE_UINT8:
+ printf (" Sample Type: UINT8\n");
+ break;
+ case RL2_SAMPLE_INT16:
+ printf (" Sample Type: INT16\n");
+ break;
+ case RL2_SAMPLE_UINT16:
+ printf (" Sample Type: UINT16\n");
+ break;
+ case RL2_SAMPLE_INT32:
+ printf (" Sample Type: INT32\n");
+ break;
+ case RL2_SAMPLE_UINT32:
+ printf (" Sample Type: UINT32\n");
+ break;
+ case RL2_SAMPLE_FLOAT:
+ printf (" Sample Type: FLOAT\n");
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ printf (" Sample Type: DOUBLE\n");
+ break;
+ default:
+ fprintf (stderr, "*** ERROR *** unknown sample type\n");
+ err = 1;
+ break;
+ };
+ switch (pixel)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ printf (" Pixel Type: MONOCHROME\n");
+ num_bands = 1;
+ break;
+ case RL2_PIXEL_PALETTE:
+ printf (" Pixel Type: PALETTE\n");
+ num_bands = 1;
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ printf (" Pixel Type: GRAYSCALE\n");
+ num_bands = 1;
+ break;
+ case RL2_PIXEL_RGB:
+ printf (" Pixel Type: RGB\n");
+ num_bands = 3;
+ break;
+ case RL2_PIXEL_MULTIBAND:
+ printf (" Pixel Type: MULTIBAND\n");
+ break;
+ case RL2_PIXEL_DATAGRID:
+ printf (" Pixel Type: DATAGRID\n");
+ num_bands = 1;
+ break;
+ default:
+ fprintf (stderr, "*** ERROR *** unknown pixel type\n");
+ err = 1;
+ break;
+ };
+ if (num_bands == RL2_BANDS_UNKNOWN)
+ fprintf (stderr, "*** ERROR *** unknown number of Bands\n");
+ else
+ printf (" Number of Bands: %d\n", num_bands);
+ if (pxl != NULL)
+ {
+ unsigned char xsample;
+ unsigned char xpixel;
+ unsigned char xbands;
+ int band_idx;
+ if (rl2_get_pixel_type (pxl, &xsample, &xpixel, &xbands) != RL2_OK)
+ fprintf (stderr, "*** ERROR *** invalid NO-DATA pixel\n");
+ else
+ {
+ printf (" NO-DATA pixel: ");
+ for (band_idx = 0; band_idx < xbands; band_idx++)
+ {
+ char int8_value;
+ unsigned char uint8_value;
+ short int16_value;
+ unsigned short uint16_value;
+ int int32_value;
+ unsigned int uint32_value;
+ float flt_value;
+ double dbl_value;
+ char *dummy;
+ switch (xsample)
+ {
+ case RL2_SAMPLE_1_BIT:
+ rl2_get_pixel_sample_1bit (pxl, &uint8_value);
+ printf ("%u", uint8_value);
+ break;
+ case RL2_SAMPLE_2_BIT:
+ rl2_get_pixel_sample_2bit (pxl, &uint8_value);
+ printf ("%u", uint8_value);
+ break;
+ case RL2_SAMPLE_4_BIT:
+ rl2_get_pixel_sample_4bit (pxl, &uint8_value);
+ printf ("%u", uint8_value);
+ break;
+ case RL2_SAMPLE_INT8:
+ rl2_get_pixel_sample_int8 (pxl, &int8_value);
+ printf ("%d", int8_value);
+ break;
+ case RL2_SAMPLE_UINT8:
+ rl2_get_pixel_sample_uint8 (pxl, band_idx,
+ &uint8_value);
+ if (band_idx > 0)
+ printf (",%u", uint8_value);
+ else
+ printf ("%u", uint8_value);
+ break;
+ case RL2_SAMPLE_INT16:
+ rl2_get_pixel_sample_int16 (pxl, &int16_value);
+ printf ("%d", int16_value);
+ break;
+ case RL2_SAMPLE_UINT16:
+ rl2_get_pixel_sample_uint16 (pxl, band_idx,
+ &uint16_value);
+ if (band_idx > 0)
+ printf (",%u", uint16_value);
+ else
+ printf ("%u", uint16_value);
+ break;
+ case RL2_SAMPLE_INT32:
+ rl2_get_pixel_sample_int32 (pxl, &int32_value);
+ printf ("%u", uint32_value);
+ break;
+ case RL2_SAMPLE_UINT32:
+ rl2_get_pixel_sample_uint32 (pxl, &uint32_value);
+ printf ("%u", uint32_value);
+ break;
+ case RL2_SAMPLE_FLOAT:
+ rl2_get_pixel_sample_float (pxl, &flt_value);
+ dummy = formatFloat (flt_value);
+ printf ("%s", dummy);
+ free (dummy);
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ rl2_get_pixel_sample_double (pxl, &dbl_value);
+ dummy = formatFloat (dbl_value);
+ printf ("%s", dummy);
+ free (dummy);
+ break;
+ };
+ }
+ fprintf (stderr, "\n");
+ }
+ }
+ switch (compression)
+ {
+ case RL2_COMPRESSION_NONE:
+ printf (" Compression: NONE (uncompressed)\n");
+ *quality = 100;
+ break;
+ case RL2_COMPRESSION_DEFLATE:
+ printf (" Compression: DEFLATE (zip, lossless)\n");
+ *quality = 100;
+ break;
+ case RL2_COMPRESSION_LZMA:
+ printf (" Compression: LZMA (7-zip, lossless)\n");
+ *quality = 100;
+ break;
+ case RL2_COMPRESSION_GIF:
+ printf (" Compression: GIF, lossless\n");
+ *quality = 100;
+ break;
+ case RL2_COMPRESSION_PNG:
+ printf (" Compression: PNG, lossless\n");
+ *quality = 100;
+ break;
+ case RL2_COMPRESSION_JPEG:
+ printf (" Compression: JPEG (lossy)\n");
+ if (*quality < 0)
+ *quality = 80;
+ if (*quality > 100)
+ *quality = 100;
+ printf (" Compression Quality: %d\n", *quality);
+ break;
+ case RL2_COMPRESSION_LOSSY_WEBP:
+ printf (" Compression: WEBP (lossy)\n");
+ if (*quality < 0)
+ *quality = 80;
+ if (*quality > 100)
+ *quality = 100;
+ printf (" Compression Quality: %d\n", *quality);
+ break;
+ case RL2_COMPRESSION_LOSSLESS_WEBP:
+ printf (" Compression: WEBP, lossless\n");
+ *quality = 100;
+ break;
+ case RL2_COMPRESSION_CCITTFAX4:
+ printf (" Compression: CCITT FAX4, lossless\n");
+ *quality = 100;
+ break;
+ default:
+ fprintf (stderr, "*** ERROR *** unknown compression\n");
+ err = 1;
+ break;
+ };
+ printf (" Tile size (pixels): %d x %d\n", tile_width, tile_height);
+ if (srid < -1)
+ {
+ fprintf (stderr, "*** ERROR *** undefined SRID\n");
+ err = 1;
+ }
+ else if (srid == -1)
+ {
+ x_res = 1.0;
+ y_res = 1.0;
+ printf (" Not Georeferenced:\n");
+ }
+ else
+ printf (" Srid: %d\n", srid);
+ if (x_res == DBL_MAX || y_res <= 0.0)
+ {
+ fprintf (stderr, "*** ERROR *** invalid X pixel size\n");
+ err = 1;
+ res_error = 1;
+ }
+ if (y_res == DBL_MAX || y_res <= 0.0)
+ {
+ fprintf (stderr, "*** ERROR *** invalid Y pixel size\n");
+ err = 1;
+ res_error = 1;
+ }
+ if (x_res > 0.0 && y_res > 0.0 && !res_error)
+ {
+ char *hres = formatFloat (x_res);
+ char *vres = formatFloat (y_res);
+ printf ("Pixel base resolution: X=%s Y=%s\n", hres, vres);
+ sqlite3_free (hres);
+ sqlite3_free (vres);
+ }
+ printf ("===========================================================\n\n");
+ return err;
+}
+
+static int
+check_import_args (const char *db_path, const char *src_path,
+ const char *dir_path, const char *file_ext,
+ const char *coverage, const char *section, int worldfile,
+ int srid, int pyramidize)
+{
+/* checking/printing IMPORT args */
+ int err = 0;
+ printf ("\n\nrl2_tool; request is IMPORT\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf (" DB path: %s\n", db_path);
+
+ if (src_path != NULL && dir_path == NULL)
+ printf (" Input Source path: %s\n", src_path);
+ else if (src_path == NULL && dir_path != NULL && file_ext != NULL)
+ {
+ printf (" Input Directory path: %s\n", dir_path);
+ printf (" File Extension: %s\n", file_ext);
+ }
+ else
+ {
+ if (src_path == NULL && dir_path == NULL)
+ {
+ fprintf (stderr,
+ "*** ERROR *** no input Source path was specified\n");
+ fprintf (stderr,
+ "*** ERROR *** no input Directory path was specified\n");
+ err = 1;
+ }
+ if (dir_path != NULL && src_path != NULL)
+ {
+ fprintf (stderr,
+ "*** ERROR *** both input Source and Directory were specified (mutually exclusive)\n");
+ err = 1;
+ }
+ if (dir_path != NULL && file_ext == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no File Extension specified\n");
+ err = 1;
+ }
+ }
+
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Coverage's name was specified\n");
+ err = 1;
+ }
+ else
+ printf (" Coverage: %s\n", coverage);
+ if (section == NULL)
+ printf (" Section: from file name\n");
+ else
+ printf (" Section: %s\n", section);
+ if (worldfile)
+ {
+ if (srid <= 0)
+ fprintf (stderr,
+ "*** ERROR *** WorldFile requires specifying some SRID\n");
+ else
+ printf ("Using the WorldFile\n");
+ }
+ if (srid > 0)
+ printf (" Forced SRID: %d\n", srid);
+ if (pyramidize)
+ printf ("Immediately building Pyramid Levels\n");
+ else
+ printf ("Ignoring Pyramid Levels for now\n");
+ printf ("===========================================================\n\n");
+ return err;
+}
+
+static int
+check_export_args (const char *db_path, const char *dst_path,
+ const char *coverage, double x_res, double y_res,
+ double *minx, double *miny, double *maxx, double *maxy,
+ double *cx, double *cy, unsigned short *width,
+ unsigned short *height)
+{
+/* checking/printing EXPORT args */
+ double ext_x;
+ double ext_y;
+ char *dumb1;
+ char *dumb2;
+ int err = 0;
+ int err_bbox = 0;
+ printf ("\n\nrl2_tool; request is EXPORT\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf (" DB path: %s\n", db_path);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Coverage's name was specified\n");
+ err = 1;
+ }
+ else
+ printf (" Coverage: %s\n", coverage);
+ if (x_res == DBL_MAX || y_res <= 0.0)
+ {
+ fprintf (stderr, "*** ERROR *** invalid X pixel size\n");
+ err = 1;
+ }
+ if (y_res == DBL_MAX || y_res <= 0.0)
+ {
+ fprintf (stderr, "*** ERROR *** invalid Y pixel size\n");
+ err = 1;
+ }
+ if (x_res > 0.0 && y_res > 0.0)
+ {
+ dumb1 = formatFloat (x_res);
+ dumb2 = formatFloat (y_res);
+ printf (" Pixel size: X=%s Y=%s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ }
+ if (*width == 0)
+ {
+ fprintf (stderr, "*** ERROR *** NULL/ZERO image Width\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (*height == 0)
+ {
+ fprintf (stderr, "*** ERROR *** NULL/ZERO image Height\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (!err)
+ printf (" Image Size: %u x %u\n", *width, *height);
+ if (dst_path == NULL)
+ {
+ fprintf (stderr,
+ "*** ERROR *** no output Destination path was specified\n");
+ err = 1;
+ }
+ if (*minx == DBL_MAX && *miny == DBL_MAX && *maxx == DBL_MAX
+ && *maxy == DBL_MAX)
+ {
+ /* tie-point: Center Point */
+ if (*cx == DBL_MAX)
+ {
+ fprintf (stderr, "*** ERROR *** undeclared Center-X\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (*cy == DBL_MAX)
+ {
+ fprintf (stderr, "*** ERROR *** undeclared Center-Y\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (err_bbox)
+ goto error;
+ ext_x = (double) (*width) * x_res;
+ ext_y = (double) (*height) * y_res;
+ *minx = *cx - (ext_x / 2.0);
+ *maxx = *minx + ext_x;
+ *miny = *cy - (ext_y / 2.0);
+ *maxy = *miny + ext_y;
+ }
+ else if (*cx == DBL_MAX && *cy == DBL_MAX && *maxx == DBL_MAX
+ && *maxy == DBL_MAX)
+ {
+ /* tie-point: LowerLeft Corner */
+ if (*minx == DBL_MAX)
+ {
+ fprintf (stderr, "*** ERROR *** undeclared Min-X\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (*miny == DBL_MAX)
+ {
+ fprintf (stderr, "*** ERROR *** undeclared Min-Y\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (err_bbox)
+ goto error;
+ ext_x = (double) (*width) * x_res;
+ ext_y = (double) (*height) * y_res;
+ *maxx = *minx + ext_x;
+ *maxy = *miny + ext_y;
+ *cx = *minx + (ext_x / 2.0);
+ *cy = *miny + (ext_y / 2.0);
+ }
+ else if (*cx == DBL_MAX && *cy == DBL_MAX && *minx == DBL_MAX
+ && *maxy == DBL_MAX)
+ {
+ /* tie-point: LowerRight Corner */
+ if (*maxx == DBL_MAX)
+ {
+ fprintf (stderr, "*** ERROR *** undeclared Max-X\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (*miny == DBL_MAX)
+ {
+ fprintf (stderr, "*** ERROR *** undeclared Min-Y\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (err_bbox)
+ goto error;
+ ext_x = (double) (*width) * x_res;
+ ext_y = (double) (*height) * y_res;
+ *minx = *maxx - ext_x;
+ *maxy = *miny + ext_y;
+ *cx = *maxx - (ext_x / 2.0);
+ *cy = *miny + (ext_y / 2.0);
+ }
+ else if (*cx == DBL_MAX && *cy == DBL_MAX && *maxx == DBL_MAX
+ && *miny == DBL_MAX)
+ {
+ /* tie-point: UpperLeft Corner */
+ if (*minx == DBL_MAX)
+ {
+ fprintf (stderr, "*** ERROR *** undeclared Min-X\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (*maxy == DBL_MAX)
+ {
+ fprintf (stderr, "*** ERROR *** undeclared Max-Y\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (err_bbox)
+ goto error;
+ ext_x = (double) (*width) * x_res;
+ ext_y = (double) (*height) * y_res;
+ *maxx = *minx + ext_x;
+ *miny = *maxy - ext_y;
+ *cx = *minx + (ext_x / 2.0);
+ *cy = *maxy - (ext_y / 2.0);
+ }
+ else if (*cx == DBL_MAX && *cy == DBL_MAX && *minx == DBL_MAX
+ && *miny == DBL_MAX)
+ {
+ /* tie-point: UpperRight Corner */
+ if (*maxx == DBL_MAX)
+ {
+ fprintf (stderr, "*** ERROR *** undeclared Max-X\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (*maxy == DBL_MAX)
+ {
+ fprintf (stderr, "*** ERROR *** undeclared Max-Y\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ if (err_bbox)
+ goto error;
+ ext_x = (double) (*width) * x_res;
+ ext_y = (double) (*height) * y_res;
+ *minx = *maxx - ext_x;
+ *miny = *maxy - ext_y;
+ *cx = *maxx - (ext_x / 2.0);
+ *cy = *maxy - (ext_y / 2.0);
+ }
+ else
+ {
+ /* invalid tie-point */
+ fprintf (stderr, "*** ERROR *** invalid output image tie-point\n");
+ err = 1;
+ err_bbox = 1;
+ }
+ error:
+ if (err_bbox)
+ {
+ fprintf (stderr,
+ "*** ERROR *** unable to determine the BBOX of output image\n");
+ err = 1;
+ }
+ else
+ {
+ dumb1 = formatLong (*minx);
+ dumb2 = formatLat (*miny);
+ printf (" Lower-Left Corner: %s %s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ dumb1 = formatLong (*maxx);
+ dumb2 = formatLat (*maxy);
+ printf ("Upper-Right Corner: %s %s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ dumb1 = formatLong (*cx);
+ dumb2 = formatLat (*cy);
+ printf (" Center: %s %s\n", dumb1, dumb2);
+ sqlite3_free (dumb1);
+ sqlite3_free (dumb2);
+ }
+ fprintf (stderr,
+ "===========================================================\n\n");
+ return err;
+}
+
+static int
+check_drop_args (const char *db_path, const char *coverage)
+{
+/* checking/printing DROP args */
+ int err = 0;
+ printf ("\n\nrl2_tool; request is DROP\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf ("DB path: %s\n", db_path);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Coverage's name was specified\n");
+ err = 1;
+ }
+ else
+ printf ("Coverage: %s\n", coverage);
+ printf ("===========================================================\n\n");
+ return err;
+}
+
+static int
+check_delete_args (const char *db_path, const char *coverage,
+ const char *section)
+{
+/* checking/printing DELETE args */
+ int err = 0;
+ printf ("\n\nrl2_tool; request is DELETE\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf ("DB path: %s\n", db_path);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Coverage's name was specified\n");
+ err = 1;
+ }
+ else
+ printf ("Coverage: %s\n", coverage);
+ if (section == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Section's name was specified\n");
+ err = 1;
+ }
+ else
+ printf ("Section: %s\n", section);
+ printf ("===========================================================\n\n");
+ return err;
+}
+
+static int
+check_pyramidize_args (const char *db_path, const char *coverage,
+ const char *section, int force)
+{
+/* checking/printing PYRAMIDIZE args */
+ int err = 0;
+ printf ("\n\nrl2_tool; request is PYRAMIDIZE\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf ("DB path: %s\n", db_path);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Coverage's name was specified\n");
+ err = 1;
+ }
+ else
+ printf ("Coverage: %s\n", coverage);
+ if (section == NULL)
+ printf ("Section: All Sections\n");
+ else
+ printf ("Section: %s\n", section);
+ if (force)
+ printf ("Unconditionally rebuilding all Pyramid Levels\n");
+ else
+ printf ("Only building missing Pyramid Levels\n");
+ printf ("===========================================================\n\n");
+ return err;
+}
+
+static int
+check_pyramidize_monolithic_args (const char *db_path, const char *coverage,
+ int virt_levels)
+{
+/* checking/printing PYRAMIDIZE-MONOLITHIC args */
+ int err = 0;
+ printf ("\n\nrl2_tool; request is PYRAMIDIZE-MONOLITHIC\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf ("DB path: %s\n", db_path);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Coverage's name was specified\n");
+ err = 1;
+ }
+ else
+ printf ("Coverage: %s\n", coverage);
+ if (virt_levels == 1 || virt_levels == 2 || virt_levels == 3)
+ printf ("Pyramid Virtual Levels: %d\n", virt_levels);
+ else
+ printf ("Pyramid Virtual Levels: default\n");
+ printf ("===========================================================\n\n");
+ return err;
+}
+
+static int
+check_de_pyramidize_args (const char *db_path, const char *coverage,
+ const char *section)
+{
+/* checking/printing DE-PYRAMIDIZE args */
+ int err = 0;
+ printf ("\n\nrl2_tool; request is DE-PYRAMIDIZE\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf ("DB path: %s\n", db_path);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Coverage's name was specified\n");
+ err = 1;
+ }
+ else
+ printf ("Coverage: %s\n", coverage);
+ if (section == NULL)
+ printf ("Section: All Sections\n");
+ else
+ printf ("Section: %s\n", section);
+ printf ("===========================================================\n\n");
+ return err;
+}
+
+static int
+check_histogram_args (const char *db_path, const char *coverage,
+ const char *section, unsigned char band_index,
+ const char *dst_path)
+{
+/* checking/printing HISTOGRAM args */
+ int err = 0;
+ printf ("\n\nrl2_tool; request is HISTOGRAM\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf (" DB path: %s\n", db_path);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Coverage's name was specified\n");
+ err = 1;
+ }
+ else
+ printf (" Coverage: %s\n", coverage);
+ if (section == NULL)
+ printf (" Histogram from Coverage-level Statistics\n");
+ else
+ {
+ printf (" Section: %s\n", section);
+ printf (" Histogram from Section-level Statistics\n");
+ }
+ printf (" Band Index: %d\n", band_index);
+ if (dst_path == NULL)
+ {
+ fprintf (stderr,
+ "*** ERROR *** no output Destination path was specified\n");
+ err = 1;
+ }
+ else
+ printf ("Destination: %s\n", dst_path);
+ printf ("===========================================================\n\n");
+ return err;
+}
+
+static int
+check_list_args (const char *db_path, const char *coverage, const char *section)
+{
+/* checking/printing LIST args */
+ int err = 0;
+ printf ("\n\nrl2_tool; request is LIST\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf (" DB path: %s\n", db_path);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Coverage's name was specified\n");
+ err = 1;
+ }
+ else
+ printf ("Coverage: %s\n", coverage);
+ if (section == NULL)
+ printf (" Section: All Sections\n");
+ else
+ printf (" Section: %s\n", section);
+ printf ("===========================================================\n\n");
+ return err;
+}
+
+static int
+check_map_args (const char *db_path, const char *coverage, const char *dst_path,
+ unsigned short *width, unsigned short *height)
+{
+/* checking/printing MAP args */
+ int err = 0;
+ printf ("\n\nrl2_tool; request is MAP\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf (" DB path: %s\n", db_path);
+ if (coverage == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no Coverage's name was specified\n");
+ err = 1;
+ }
+ else
+ printf (" Coverage: %s\n", coverage);
+ if (dst_path == NULL)
+ {
+ fprintf (stderr,
+ "*** ERROR *** no output Destination path was specified\n");
+ err = 1;
+ }
+ else
+ printf (" Destination Path: %s\n", dst_path);
+ if (*width < 512)
+ *width = 512;
+ if (*width > 4092)
+ *width = 4092;
+ if (*height < 512)
+ *height = 512;
+ if (*height > 4096)
+ *height = 4096;
+ printf (" Image Size: %u x %u\n", *width, *height);
+ printf ("===========================================================\n\n");
+ return err;
+}
+
+static int
+check_catalog_args (const char *db_path)
+{
+/* checking/printing CATALOG args */
+ int err = 0;
+ printf ("\n\nrl2_tool; request is CATALOG\n");
+ printf ("===========================================================\n");
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "*** ERROR *** no DB path was specified\n");
+ err = 1;
+ }
+ else
+ printf ("DB path: %s\n", db_path);
+ printf ("===========================================================\n\n");
+ return err;
+}
+
+static char *
+get_num (const char *start, const char *end)
+{
+/* extracting a token */
+ char *buf;
+ int len = end - start;
+ if (len <= 0)
+ return NULL;
+ buf = malloc (len + 1);
+ memcpy (buf, start, len);
+ *(buf + len) = '\0';
+ return buf;
+}
+
+static rl2PixelPtr
+parse_no_data (const char *in, unsigned char sample_type,
+ unsigned char pixel_type, unsigned char num_bands)
+{
+/* attempting to parse a NO-DATA pixel value */
+ int band = 0;
+ char *num = NULL;
+ const char *p;
+ const char *start;
+ const char *end;
+ char int8_value;
+ unsigned char uint8_value;
+ short int16_value;
+ unsigned short uint16_value;
+ int int32_value;
+ unsigned int uint32_value;
+ float flt_value;
+ double dbl_value;
+ rl2PixelPtr pixel = NULL;
+
+ switch (pixel_type)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ num_bands = 1;
+ break;
+ case RL2_PIXEL_PALETTE:
+ num_bands = 1;
+ break;
+ case RL2_PIXEL_GRAYSCALE:
+ num_bands = 1;
+ break;
+ case RL2_PIXEL_RGB:
+ num_bands = 3;
+ break;
+ case RL2_PIXEL_DATAGRID:
+ num_bands = 1;
+ break;
+ };
+ pixel = rl2_create_pixel (sample_type, pixel_type, num_bands);
+ if (pixel == NULL)
+ return NULL;
+
+ start = in;
+ p = in;
+ while (1)
+ {
+ if (*p == ',' || *p == '\0')
+ {
+ end = p;
+ switch (sample_type)
+ {
+ case RL2_SAMPLE_1_BIT:
+ num = get_num (start, end);
+ if (num == NULL)
+ goto error;
+ uint8_value = atoi (num);
+ free (num);
+ num = NULL;
+ if (rl2_set_pixel_sample_1bit (pixel, int8_value) !=
+ RL2_OK)
+ goto error;
+ break;
+ case RL2_SAMPLE_2_BIT:
+ num = get_num (start, end);
+ if (num == NULL)
+ goto error;
+ uint8_value = atoi (num);
+ free (num);
+ num = NULL;
+ if (rl2_set_pixel_sample_2bit (pixel, int8_value) !=
+ RL2_OK)
+ goto error;
+ break;
+ case RL2_SAMPLE_4_BIT:
+ num = get_num (start, end);
+ if (num == NULL)
+ goto error;
+ uint8_value = atoi (num);
+ free (num);
+ num = NULL;
+ if (rl2_set_pixel_sample_4bit (pixel, int8_value) !=
+ RL2_OK)
+ goto error;
+ break;
+ case RL2_SAMPLE_INT8:
+ num = get_num (start, end);
+ if (num == NULL)
+ goto error;
+ int8_value = atoi (num);
+ free (num);
+ num = NULL;
+ if (rl2_set_pixel_sample_int8 (pixel, int8_value) !=
+ RL2_OK)
+ goto error;
+ break;
+ case RL2_SAMPLE_UINT8:
+ num = get_num (start, end);
+ if (num == NULL)
+ goto error;
+ uint8_value = atoi (num);
+ free (num);
+ num = NULL;
+ if (rl2_set_pixel_sample_uint8 (pixel, band, uint8_value)
+ != RL2_OK)
+ goto error;
+ break;
+ case RL2_SAMPLE_INT16:
+ num = get_num (start, end);
+ if (num == NULL)
+ goto error;
+ int16_value = atoi (num);
+ free (num);
+ num = NULL;
+ if (rl2_set_pixel_sample_int16 (pixel, int16_value) !=
+ RL2_OK)
+ goto error;
+ break;
+ case RL2_SAMPLE_UINT16:
+ num = get_num (start, end);
+ if (num == NULL)
+ goto error;
+ uint16_value = atoi (num);
+ free (num);
+ num = NULL;
+ if (rl2_set_pixel_sample_uint16
+ (pixel, band, uint16_value) != RL2_OK)
+ goto error;
+ break;
+ case RL2_SAMPLE_INT32:
+ num = get_num (start, end);
+ if (num == NULL)
+ goto error;
+ int32_value = atoi (num);
+ free (num);
+ num = NULL;
+ if (rl2_set_pixel_sample_int32 (pixel, int32_value) !=
+ RL2_OK)
+ goto error;
+ break;
+ case RL2_SAMPLE_UINT32:
+ num = get_num (start, end);
+ if (num == NULL)
+ goto error;
+ uint32_value = atoi (num);
+ free (num);
+ num = NULL;
+ if (rl2_set_pixel_sample_uint32 (pixel, uint32_value) !=
+ RL2_OK)
+ goto error;
+ break;
+ case RL2_SAMPLE_FLOAT:
+ num = get_num (start, end);
+ if (num == NULL)
+ goto error;
+ flt_value = atof (num);
+ free (num);
+ num = NULL;
+ if (rl2_set_pixel_sample_float (pixel, flt_value) !=
+ RL2_OK)
+ goto error;
+ break;
+ case RL2_SAMPLE_DOUBLE:
+ num = get_num (start, end);
+ if (num == NULL)
+ goto error;
+ dbl_value = atof (num);
+ free (num);
+ num = NULL;
+ if (rl2_set_pixel_sample_double (pixel, dbl_value) !=
+ RL2_OK)
+ goto error;
+ break;
+ };
+ if (*p == '\0')
+ break;
+ start = p + 1;
+ band++;
+ }
+ p++;
+ }
+ return pixel;
+
+ error:
+ if (num != NULL)
+ free (num);
+ if (pixel != NULL)
+ rl2_destroy_pixel (pixel);
+ return NULL;
+}
+
+static void
+do_help (int mode)
+{
+/* printing the argument list */
+ fprintf (stderr, "\n\nusage: rl2_tool MODE [ ARGLIST ]\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-h or --help print this help message\n");
+ if (mode == ARG_NONE || mode == ARG_MODE_CREATE)
+ {
+ /* MODE = CREATE */
+ fprintf (stderr, "\nmode: CREATE\n");
+ fprintf (stderr, "will create a new RasterLite2 Raster Coverage\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr, "-cov or --coverage string Coverage's name\n");
+ fprintf (stderr,
+ "-smp or --sample-type keyword Sample Type keyword (see list)\n");
+ fprintf (stderr,
+ "-pxl or --pixel-type keyword Pixel Type keyword (see list)\n");
+ fprintf (stderr, "-bds or --num-bands integer Number of Bands\n");
+ fprintf (stderr,
+ "-cpr or --compression keyword Compression keyword (see list)\n");
+ fprintf (stderr,
+ "-qty or --quality integer Compression Quality [0-100]\n");
+ fprintf (stderr,
+ "-tlw or --tile-width integer Tile Width [pixels]\n");
+ fprintf (stderr,
+ "-tlh or --tile-height integer Tile Height [pixels]\n");
+ fprintf (stderr, "-srid or --srid integer SRID value\n");
+ fprintf (stderr, " or\n");
+ fprintf (stderr, "-nosrid or --no-srid\n");
+ fprintf (stderr,
+ "-res or --resolution number pixel resolution(X and Y)\n");
+ fprintf (stderr,
+ "-xres or --x-resol number pixel resolution(X specific)\n");
+ fprintf (stderr,
+ "-yres or --y-resol number pixel resolution(Y specific)\n\n");
+ fprintf (stderr,
+ "-nd or --no-data pixel NO-DATA pixel value\n\n");
+ fprintf (stderr, "SampleType Keywords:\n");
+ fprintf (stderr, "----------------------------------\n");
+ fprintf (stderr,
+ "1-BIT 2-BIT 4-BIT INT8 UINT8 INT16 UINT16\n"
+ " INT32 UINT32 FLOAT DOUBLE\n\n");
+ fprintf (stderr, "PixelType Keywords:\n");
+ fprintf (stderr, "----------------------------------\n");
+ fprintf (stderr,
+ "MONOCHROME PALETTE GRAYSCALE RGB MULTIBAND DATAGRID\n\n");
+ fprintf (stderr, "Compression Keywords:\n");
+ fprintf (stderr, "----------------------------------\n");
+ fprintf (stderr,
+ "NONE DEFLATE LZMA GIF PNG JPEG WEBP LL_WEBP FAX3 FAX4\n\n");
+ }
+ if (mode == ARG_NONE || mode == ARG_MODE_DROP)
+ {
+ /* MODE = DROP */
+ fprintf (stderr, "\nmode: DROP\n");
+ fprintf (stderr,
+ "will drop an existing RasterLite2 Raster Coverage\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr,
+ "-cov or --coverage string Coverage's name\n\n");
+ }
+ if (mode == ARG_NONE || mode == ARG_MODE_IMPORT)
+ {
+ /* MODE = IMPORT */
+ fprintf (stderr, "\nmode: IMPORT\n");
+ fprintf (stderr,
+ "will create a new Raster Section by importing an\n");
+ fprintf (stderr, "external image or raster file\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr,
+ "-src or --src-path pathname input Image/Raster path\n");
+ fprintf (stderr,
+ "-dir or --dir-path pathname input directory path\n");
+ fprintf (stderr,
+ "-ext or --file-ext extension file extension (e.g. .tif)\n");
+ fprintf (stderr, "-cov or --coverage string Coverage's name\n");
+ fprintf (stderr,
+ "-srid or --srid integer optional: force SRID value\n");
+ fprintf (stderr,
+ "-wf or --worldfile requires a Worldfile\n");
+ fprintf (stderr,
+ "-pyr or --pyramidize immediately build Pyramid levels\n\n");
+ }
+ if (mode == ARG_NONE || mode == ARG_MODE_EXPORT)
+ {
+ /* MODE = EXPORT */
+ fprintf (stderr, "\nmode: EXPORT\n");
+ fprintf (stderr, "will export an external image from a Coverage\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr,
+ "-dst or --dst-path pathname output Image/Raster path\n");
+ fprintf (stderr, "-cov or --coverage string Coverage's name\n");
+ fprintf (stderr,
+ "-res or --resolution number pixel resolution(X and Y)\n");
+ fprintf (stderr,
+ "-xres or --x-resol number pixel resolution(X specific)\n");
+ fprintf (stderr,
+ "-yres or --y-resol number pixel resolution(Y specific)\n");
+ fprintf (stderr,
+ "-minx or --min-x number X coordinate (lower-left corner)\n");
+ fprintf (stderr,
+ "-miny or --min-y number Y coordinate (lower-left corner)\n");
+ fprintf (stderr,
+ "-maxx or --max-x number X coordinate (upper-right corner)\n");
+ fprintf (stderr,
+ "-maxy or --max-y number Y coordinate (upper-left corner)\n");
+ fprintf (stderr,
+ "-cx or --center-x number X coordinate (center)\n");
+ fprintf (stderr,
+ "-cy or --center-y number Y coordinate (center)\n");
+ fprintf (stderr,
+ "-outw or --out-width number image width (in pixels)\n");
+ fprintf (stderr,
+ "-outh or --out-height number image height (in pixels)\n\n");
+ fprintf (stderr,
+ "In order to export a raster you are expected to specify:\n");
+ fprintf (stderr,
+ "\t- the intended resolution (-res OR -xres AND -yres)\n");
+ fprintf (stderr, "\t- the output image size (-outw AND -outh)\n");
+ fprintf (stderr, "\t- a single tie-point, defined as one of:\n");
+ fprintf (stderr, "\t\t- Output Image Center point: -cx AND -cy\n");
+ fprintf (stderr,
+ "\t\t- Output Image LowerLeft corner: -minx AND -miny\n");
+ fprintf (stderr,
+ "\t\t- Output Image LowerRight corner: -maxx AND -miny\n");
+ fprintf (stderr,
+ "\t\t- Output Image UpperLeft corner: -minx AND -maxy\n");
+ fprintf (stderr,
+ "\t\t- Output Image UpperRight corner: -maxx AND -maxy\n\n");
+ }
+ if (mode == ARG_NONE || mode == ARG_MODE_DELETE)
+ {
+ /* MODE = DELETE */
+ fprintf (stderr, "\nmode: DELETE\n");
+ fprintf (stderr, "will delete a Raster Section\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr, "-cov or --coverage string Coverage's name\n");
+ fprintf (stderr,
+ "-sec or --section string Section's name\n\n");
+ }
+ if (mode == ARG_NONE || mode == ARG_MODE_PYRAMIDIZE)
+ {
+ /* MODE = PYRAMIDIZE */
+ fprintf (stderr, "\nmode: PYRAMIDIZE\n");
+ fprintf (stderr,
+ "will (re)build all Pyramid levels supporting a Coverage\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr, "-cov or --coverage string Coverage's name\n");
+ fprintf (stderr,
+ "-sec or --section string optional: Section's name\n");
+ fprintf (stderr,
+ " default is \"All Sections\"\n");
+ fprintf (stderr,
+ "-f or --force optional: rebuilds from scratch\n\n");
+ }
+ if (mode == ARG_NONE || mode == ARG_MODE_PYRMONO)
+ {
+ /* MODE = PYRAMIDIZE MONOLITHIC */
+ fprintf (stderr, "\nmode: PYRAMIDIZE-MONOLITHIC\n");
+ fprintf (stderr,
+ "will (re)build all Pyramid levels (Monolithic) supporting a Coverage\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr, "-cov or --coverage string Coverage's name\n");
+ fprintf (stderr,
+ "-lev or --virt-levels number number of virt-levels\n");
+ fprintf (stderr,
+ " could be one of: 1, 2 or 3\n");
+ }
+ if (mode == ARG_NONE || mode == ARG_MODE_DE_PYRAMIDIZE)
+ {
+ /* MODE = DE-PYRAMIDIZE */
+ fprintf (stderr, "\nmode: DE-PYRAMIDIZE\n");
+ fprintf (stderr, "will delete Pyramid levels\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr, "-cov or --coverage string Coverage's name\n");
+ fprintf (stderr,
+ "-sec or --section string optional: Section's name\n");
+ fprintf (stderr,
+ " default is \"All Sections\"\n");
+ }
+ if (mode == ARG_NONE || mode == ARG_MODE_LIST)
+ {
+ /* MODE = LIST */
+ fprintf (stderr, "\nmode: LIST\n");
+ fprintf (stderr, "will list Raster Sections within a Coverage\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr, "-cov or --coverage string Coverage's name\n");
+ fprintf (stderr,
+ "-sec or --section string optional: Section's name\n");
+ fprintf (stderr,
+ " default is \"All Sections\"\n");
+ }
+ if (mode == ARG_NONE || mode == ARG_MODE_MAP)
+ {
+ /* MODE = MAP */
+ fprintf (stderr, "\nmode: MAP\n");
+ fprintf (stderr,
+ "will output a PNG Map representing all Raster Sections\nwithin a Coverage\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr, "-cov or --coverage string Coverage's name\n");
+ fprintf (stderr,
+ "-dst or --dst-path pathname output Image/Raster path\n");
+ fprintf (stderr,
+ "-outw or --out-width number image width (in pixels)\n");
+ fprintf (stderr,
+ "-outh or --out-height number image height (in pixels)\n\n");
+ }
+ if (mode == ARG_NONE || mode == ARG_MODE_CATALOG)
+ {
+ /* MODE = CATALOG */
+ fprintf (stderr, "\nmode: CATALOG\n");
+ fprintf (stderr,
+ "will list all Coverages from within a RasterLite2 DB\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n\n");
+ }
+ if (mode == ARG_NONE || mode == ARG_MODE_HISTOGRAM)
+ {
+ /* MODE = HISTOGRAM */
+ fprintf (stderr, "\nmode: HISTOGRAM\n");
+ fprintf (stderr, "will create a PNG showing a band Histogram\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr, "-cov or --coverage string Coverage's name\n");
+ fprintf (stderr,
+ "-sec or --section string optional: Section's name\n");
+ fprintf (stderr,
+ " default is \"Coverage statistics\"\n");
+ fprintf (stderr,
+ "-bnd or --band-index integer a valid band index\n");
+ fprintf (stderr,
+ " default is band index 0\n");
+ fprintf (stderr, "-dst or --dst-path pathname output PNG path\n");
+ fprintf (stderr,
+ " default is ./hist_cov_sec_idx.png\n");
+ }
+ if (mode == ARG_NONE)
+ {
+ /* DB options */
+ fprintf (stderr, "\noptional DB specific settings:\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr,
+ "-cs or --cache-size num DB cache size (how many pages)\n");
+ fprintf (stderr,
+ "-m or --in-memory using IN-MEMORY database\n");
+ fprintf (stderr,
+ "-jo or --journal-off unsafe [but faster] mode\n");
+ }
+}
+
+int
+main (int argc, char *argv[])
+{
+/* the MAIN function simply perform arguments checking */
+ sqlite3 *handle;
+ int ret;
+ char *sql_err = NULL;
+ int i;
+ int next_arg = ARG_NONE;
+ const char *db_path = NULL;
+ const char *src_path = NULL;
+ const char *dst_path = NULL;
+ const char *dir_path = NULL;
+ const char *file_ext = ".tif";
+ const char *coverage = NULL;
+ const char *section = NULL;
+ unsigned char sample = RL2_SAMPLE_UNKNOWN;
+ unsigned char pixel = RL2_PIXEL_UNKNOWN;
+ unsigned char compression = RL2_COMPRESSION_NONE;
+ unsigned char num_bands = RL2_BANDS_UNKNOWN;
+ unsigned char band_index = 0;
+ int quality = -1;
+ unsigned short tile_width = 512;
+ unsigned short tile_height = 512;
+ double x_res = DBL_MAX;
+ double y_res = DBL_MAX;
+ double minx = DBL_MAX;
+ double miny = DBL_MAX;
+ double maxx = DBL_MAX;
+ double maxy = DBL_MAX;
+ double cx = DBL_MAX;
+ double cy = DBL_MAX;
+ unsigned short width = 0;
+ unsigned short height = 0;
+ int srid = -2;
+ int virt_levels = 0;
+ const char *no_data_str = NULL;
+ rl2PixelPtr no_data = NULL;
+ int worldfile = 0;
+ int pyramidize = 0;
+ int force_pyramid = 0;
+ int in_memory = 0;
+ int cache_size = 0;
+ int journal_off = 0;
+ int error = 0;
+ int mode = ARG_NONE;
+ void *cache;
+ void *cache_mem;
+ char *hist_path = NULL;
+
+ if (argc >= 2)
+ {
+ /* extracting the MODE */
+ if (strcasecmp (argv[1], "CREATE") == 0)
+ mode = ARG_MODE_CREATE;
+ if (strcasecmp (argv[1], "DROP") == 0)
+ mode = ARG_MODE_DROP;
+ if (strcasecmp (argv[1], "IMPORT") == 0)
+ mode = ARG_MODE_IMPORT;
+ if (strcasecmp (argv[1], "EXPORT") == 0)
+ mode = ARG_MODE_EXPORT;
+ if (strcasecmp (argv[1], "DELETE") == 0)
+ mode = ARG_MODE_DELETE;
+ if (strcasecmp (argv[1], "PYRAMIDIZE") == 0)
+ mode = ARG_MODE_PYRAMIDIZE;
+ if (strcasecmp (argv[1], "PYRAMIDIZE-MONOLITHIC") == 0)
+ mode = ARG_MODE_PYRMONO;
+ if (strcasecmp (argv[1], "DE-PYRAMIDIZE") == 0)
+ mode = ARG_MODE_DE_PYRAMIDIZE;
+ if (strcasecmp (argv[1], "LIST") == 0)
+ mode = ARG_MODE_LIST;
+ if (strcasecmp (argv[1], "MAP") == 0)
+ mode = ARG_MODE_MAP;
+ if (strcasecmp (argv[1], "CATALOG") == 0)
+ mode = ARG_MODE_CATALOG;
+ if (strcasecmp (argv[1], "HISTOGRAM") == 0)
+ mode = ARG_MODE_HISTOGRAM;
+ }
+
+ for (i = 2; i < argc; i++)
+ {
+ /* parsing the invocation arguments */
+ if (next_arg != ARG_NONE)
+ {
+ switch (next_arg)
+ {
+ case ARG_DB_PATH:
+ db_path = argv[i];
+ break;
+ case ARG_SRC_PATH:
+ src_path = argv[i];
+ break;
+ case ARG_DST_PATH:
+ dst_path = argv[i];
+ break;
+ case ARG_DIR_PATH:
+ dir_path = argv[i];
+ break;
+ case ARG_FILE_EXT:
+ file_ext = argv[i];
+ break;
+ case ARG_COVERAGE:
+ coverage = argv[i];
+ break;
+ case ARG_SECTION:
+ section = argv[i];
+ break;
+ case ARG_SAMPLE:
+ if (strcasecmp (argv[i], "1-BIT") == 0)
+ sample = RL2_SAMPLE_1_BIT;
+ if (strcasecmp (argv[i], "2-BIT") == 0)
+ sample = RL2_SAMPLE_2_BIT;
+ if (strcasecmp (argv[i], "4-BIT") == 0)
+ sample = RL2_SAMPLE_4_BIT;
+ if (strcasecmp (argv[i], "INT8") == 0)
+ sample = RL2_SAMPLE_INT8;
+ if (strcasecmp (argv[i], "UINT8") == 0)
+ sample = RL2_SAMPLE_UINT8;
+ if (strcasecmp (argv[i], "INT16") == 0)
+ sample = RL2_SAMPLE_INT16;
+ if (strcasecmp (argv[i], "UINT16") == 0)
+ sample = RL2_SAMPLE_UINT16;
+ if (strcasecmp (argv[i], "INT32") == 0)
+ sample = RL2_SAMPLE_INT32;
+ if (strcasecmp (argv[i], "UINT32") == 0)
+ sample = RL2_SAMPLE_UINT32;
+ if (strcasecmp (argv[i], "INT8") == 0)
+ sample = RL2_SAMPLE_INT8;
+ if (strcasecmp (argv[i], "UINT8") == 0)
+ sample = RL2_SAMPLE_UINT8;
+ if (strcasecmp (argv[i], "FLOAT") == 0)
+ sample = RL2_SAMPLE_FLOAT;
+ if (strcasecmp (argv[i], "DOUBLE") == 0)
+ sample = RL2_SAMPLE_DOUBLE;
+ break;
+ case ARG_PIXEL:
+ if (strcasecmp (argv[i], "MONOCHROME") == 0)
+ pixel = RL2_PIXEL_MONOCHROME;
+ if (strcasecmp (argv[i], "PALETTE") == 0)
+ pixel = RL2_PIXEL_PALETTE;
+ if (strcasecmp (argv[i], "GRAYSCALE") == 0)
+ pixel = RL2_PIXEL_GRAYSCALE;
+ if (strcasecmp (argv[i], "RGB") == 0)
+ pixel = RL2_PIXEL_RGB;
+ if (strcasecmp (argv[i], "MULTIBAND") == 0)
+ pixel = RL2_PIXEL_MULTIBAND;
+ if (strcasecmp (argv[i], "DATAGRID") == 0)
+ pixel = RL2_PIXEL_DATAGRID;
+ break;
+ case ARG_NUM_BANDS:
+ num_bands = atoi (argv[i]);
+ break;
+ case ARG_COMPRESSION:
+ if (strcasecmp (argv[i], "NONE") == 0)
+ compression = RL2_COMPRESSION_NONE;
+ if (strcasecmp (argv[i], "DEFLATE") == 0)
+ compression = RL2_COMPRESSION_DEFLATE;
+ if (strcasecmp (argv[i], "LZMA") == 0)
+ compression = RL2_COMPRESSION_LZMA;
+ if (strcasecmp (argv[i], "GIF") == 0)
+ compression = RL2_COMPRESSION_GIF;
+ if (strcasecmp (argv[i], "PNG") == 0)
+ compression = RL2_COMPRESSION_PNG;
+ if (strcasecmp (argv[i], "JPEG") == 0)
+ compression = RL2_COMPRESSION_JPEG;
+ if (strcasecmp (argv[i], "WEBP") == 0)
+ compression = RL2_COMPRESSION_LOSSY_WEBP;
+ if (strcasecmp (argv[i], "LL_WEBP") == 0)
+ compression = RL2_COMPRESSION_LOSSLESS_WEBP;
+ if (strcasecmp (argv[i], "FAX3") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX3;
+ if (strcasecmp (argv[i], "FAX4") == 0)
+ compression = RL2_COMPRESSION_CCITTFAX4;
+ break;
+ case ARG_QUALITY:
+ quality = atoi (argv[i]);
+ break;
+ case ARG_TILE_WIDTH:
+ tile_width = atoi (argv[i]);
+ break;
+ case ARG_TILE_HEIGHT:
+ tile_height = atoi (argv[i]);
+ break;
+ case ARG_BAND_INDEX:
+ band_index = atoi (argv[i]);
+ break;
+ case ARG_SRID:
+ srid = atoi (argv[i]);
+ break;
+ case ARG_RESOLUTION:
+ x_res = atof (argv[i]);
+ y_res = x_res;
+ break;
+ case ARG_X_RESOLUTION:
+ x_res = atof (argv[i]);
+ break;
+ case ARG_Y_RESOLUTION:
+ y_res = atof (argv[i]);
+ break;
+ case ARG_MINX:
+ minx = atof (argv[i]);
+ break;
+ case ARG_MINY:
+ miny = atof (argv[i]);
+ break;
+ case ARG_MAXX:
+ maxx = atof (argv[i]);
+ break;
+ case ARG_MAXY:
+ maxy = atof (argv[i]);
+ break;
+ case ARG_CX:
+ cx = atof (argv[i]);
+ break;
+ case ARG_CY:
+ cy = atof (argv[i]);
+ break;
+ case ARG_VIRT_LEVELS:
+ virt_levels = atoi (argv[i]);
+ break;
+ case ARG_NO_DATA:
+ no_data_str = argv[i];
+ break;
+ case ARG_IMG_WIDTH:
+ width = atoi (argv[i]);
+ break;
+ case ARG_IMG_HEIGHT:
+ height = atoi (argv[i]);
+ break;
+ case ARG_CACHE_SIZE:
+ cache_size = atoi (argv[i]);
+ break;
+ };
+ next_arg = ARG_NONE;
+ continue;
+ }
+
+ if (strcasecmp (argv[i], "--help") == 0
+ || strcmp (argv[i], "-h") == 0)
+ {
+ do_help (mode);
+ return -1;
+ }
+ if (strcmp (argv[i], "-db") == 0
+ || strcasecmp (argv[i], "--db-path") == 0)
+ {
+ next_arg = ARG_DB_PATH;
+ continue;
+ }
+ if (strcmp (argv[i], "-src") == 0
+ || strcasecmp (argv[i], "--src-path") == 0)
+ {
+ next_arg = ARG_SRC_PATH;
+ continue;
+ }
+ if (strcmp (argv[i], "-dst") == 0
+ || strcasecmp (argv[i], "--dst-path") == 0)
+ {
+ next_arg = ARG_DST_PATH;
+ continue;
+ }
+ if (strcmp (argv[i], "-dir") == 0
+ || strcasecmp (argv[i], "--dir-path") == 0)
+ {
+ next_arg = ARG_DIR_PATH;
+ continue;
+ }
+ if (strcmp (argv[i], "-ext") == 0
+ || strcasecmp (argv[i], "--file-ext") == 0)
+ {
+ next_arg = ARG_FILE_EXT;
+ continue;
+ }
+ if (strcmp (argv[i], "-cov") == 0
+ || strcasecmp (argv[i], "--coverage") == 0)
+ {
+ next_arg = ARG_COVERAGE;
+ continue;
+ }
+ if (strcmp (argv[i], "-sec") == 0
+ || strcasecmp (argv[i], "--section") == 0)
+ {
+ next_arg = ARG_SECTION;
+ continue;
+ }
+ if (strcmp (argv[i], "-lev") == 0
+ || strcasecmp (argv[i], "--virt-levels") == 0)
+ {
+ next_arg = ARG_VIRT_LEVELS;
+ continue;
+ }
+ if (strcmp (argv[i], "-smp") == 0
+ || strcasecmp (argv[i], "--sample-type") == 0)
+ {
+ next_arg = ARG_SAMPLE;
+ continue;
+ }
+ if (strcmp (argv[i], "-pxl") == 0
+ || strcasecmp (argv[i], "--pixel-type") == 0)
+ {
+ next_arg = ARG_PIXEL;
+ continue;
+ }
+ if (strcmp (argv[i], "-bds") == 0
+ || strcasecmp (argv[i], "--num-bands") == 0)
+ {
+ next_arg = ARG_NUM_BANDS;
+ continue;
+ }
+ if (strcmp (argv[i], "-cpr") == 0
+ || strcasecmp (argv[i], "--compression") == 0)
+ {
+ next_arg = ARG_COMPRESSION;
+ continue;
+ }
+ if (strcmp (argv[i], "-qty") == 0
+ || strcasecmp (argv[i], "--quality") == 0)
+ {
+ next_arg = ARG_QUALITY;
+ continue;
+ }
+ if (strcmp (argv[i], "-tlw") == 0
+ || strcasecmp (argv[i], "--tile-width") == 0)
+ {
+ next_arg = ARG_TILE_WIDTH;
+ continue;
+ }
+ if (strcmp (argv[i], "-tlh") == 0
+ || strcasecmp (argv[i], "--tile-height") == 0)
+ {
+ next_arg = ARG_TILE_HEIGHT;
+ continue;
+ }
+ if (strcmp (argv[i], "-bnd") == 0
+ || strcasecmp (argv[i], "--band-index") == 0)
+ {
+ next_arg = ARG_BAND_INDEX;
+ continue;
+ }
+ if (strcmp (argv[i], "-outw") == 0
+ || strcasecmp (argv[i], "--out-width") == 0)
+ {
+ next_arg = ARG_IMG_WIDTH;
+ continue;
+ }
+ if (strcmp (argv[i], "-outh") == 0
+ || strcasecmp (argv[i], "--out-height") == 0)
+ {
+ next_arg = ARG_IMG_HEIGHT;
+ continue;
+ }
+ if (strcmp (argv[i], "-srid") == 0
+ || strcasecmp (argv[i], "--srid") == 0)
+ {
+ next_arg = ARG_SRID;
+ continue;
+ }
+ if (strcmp (argv[i], "-nosrid") == 0
+ || strcasecmp (argv[i], "--no-srid") == 0)
+ {
+ srid = -1;
+ continue;
+ }
+ if (strcmp (argv[i], "-res") == 0
+ || strcasecmp (argv[i], "--resolution") == 0)
+ {
+ next_arg = ARG_RESOLUTION;
+ continue;
+ }
+ if (strcmp (argv[i], "-xres") == 0
+ || strcasecmp (argv[i], "--x-resol") == 0)
+ {
+ next_arg = ARG_X_RESOLUTION;
+ continue;
+ }
+ if (strcmp (argv[i], "-yres") == 0
+ || strcasecmp (argv[i], "--y-resol") == 0)
+ {
+ next_arg = ARG_Y_RESOLUTION;
+ continue;
+ }
+ if (strcmp (argv[i], "-minx") == 0
+ || strcasecmp (argv[i], "--min-x") == 0)
+ {
+ next_arg = ARG_MINX;
+ continue;
+ }
+ if (strcmp (argv[i], "-miny") == 0
+ || strcasecmp (argv[i], "--min-y") == 0)
+ {
+ next_arg = ARG_MINY;
+ continue;
+ }
+ if (strcmp (argv[i], "-maxx") == 0
+ || strcasecmp (argv[i], "--max-x") == 0)
+ {
+ next_arg = ARG_MAXX;
+ continue;
+ }
+ if (strcmp (argv[i], "-maxy") == 0
+ || strcasecmp (argv[i], "--max-y") == 0)
+ {
+ next_arg = ARG_MAXY;
+ continue;
+ }
+ if (strcmp (argv[i], "-cx") == 0
+ || strcasecmp (argv[i], "--center-x") == 0)
+ {
+ next_arg = ARG_CX;
+ continue;
+ }
+ if (strcmp (argv[i], "-cy") == 0
+ || strcasecmp (argv[i], "--center-y") == 0)
+ {
+ next_arg = ARG_CY;
+ continue;
+ }
+ if (strcmp (argv[i], "-nd") == 0
+ || strcasecmp (argv[i], "--no-data") == 0)
+ {
+ next_arg = ARG_NO_DATA;
+ continue;
+ }
+ if (strcmp (argv[i], "-f") == 0
+ || strcasecmp (argv[i], "--force") == 0)
+ {
+ force_pyramid = 1;
+ continue;
+ }
+ if (strcmp (argv[i], "-pyr") == 0
+ || strcasecmp (argv[i], "--pyramidize") == 0)
+ {
+ pyramidize = 1;
+ continue;
+ }
+ if (strcmp (argv[i], "-wf") == 0
+ || strcasecmp (argv[i], "--worldfile") == 0)
+ {
+ worldfile = 1;
+ continue;
+ }
+ if (strcasecmp (argv[i], "--cache-size") == 0
+ || strcmp (argv[i], "-cs") == 0)
+ {
+ next_arg = ARG_CACHE_SIZE;
+ continue;
+ }
+ if (strcmp (argv[i], "-m") == 0
+ || strcasecmp (argv[i], "--in-memory") == 0)
+ {
+ in_memory = 1;
+ next_arg = ARG_NONE;
+ continue;
+ }
+ if (strcmp (argv[i], "-jo") == 0
+ || strcasecmp (argv[i], "--journal-off") == 0)
+ {
+ journal_off = 1;
+ next_arg = ARG_NONE;
+ continue;
+ }
+ fprintf (stderr, "unknown argument: %s\n", argv[i]);
+ error = 1;
+ }
+ if (error)
+ {
+ do_help (mode);
+ return -1;
+ }
+
+/* checking the arguments */
+ switch (mode)
+ {
+ case ARG_MODE_CREATE:
+ if (no_data_str != NULL)
+ {
+ no_data = parse_no_data (no_data_str, sample, pixel, num_bands);
+ if (no_data == NULL)
+ {
+ fprintf (stderr,
+ "Unable to parse the NO-DATA pixel !!!\n");
+ error = 1;
+ break;
+ }
+ }
+ switch (pixel)
+ {
+ case RL2_PIXEL_MONOCHROME:
+ case RL2_PIXEL_PALETTE:
+ case RL2_PIXEL_GRAYSCALE:
+ case RL2_PIXEL_DATAGRID:
+ if (num_bands == RL2_BANDS_UNKNOWN)
+ num_bands = 1;
+ break;
+ case RL2_PIXEL_RGB:
+ if (num_bands == RL2_BANDS_UNKNOWN)
+ num_bands = 3;
+ break;
+ };
+ error =
+ check_create_args (db_path, coverage, sample, pixel, num_bands,
+ compression, &quality, tile_width, tile_height,
+ srid, x_res, y_res, no_data);
+ break;
+ case ARG_MODE_DROP:
+ error = check_drop_args (db_path, coverage);
+ break;
+ case ARG_MODE_IMPORT:
+ error =
+ check_import_args (db_path, src_path, dir_path, file_ext,
+ coverage, section, worldfile, srid,
+ pyramidize);
+ break;
+ case ARG_MODE_EXPORT:
+ error =
+ check_export_args (db_path, dst_path, coverage, x_res, y_res,
+ &minx, &miny, &maxx, &maxy, &cx, &cy, &width,
+ &height);
+ break;
+ case ARG_MODE_DELETE:
+ error = check_delete_args (db_path, coverage, section);
+ break;
+ case ARG_MODE_PYRAMIDIZE:
+ error =
+ check_pyramidize_args (db_path, coverage, section, force_pyramid);
+ break;
+ case ARG_MODE_PYRMONO:
+ error =
+ check_pyramidize_monolithic_args (db_path, coverage, virt_levels);
+ break;
+ case ARG_MODE_DE_PYRAMIDIZE:
+ error = check_de_pyramidize_args (db_path, coverage, section);
+ break;
+ case ARG_MODE_LIST:
+ error = check_list_args (db_path, coverage, section);
+ break;
+ case ARG_MODE_MAP:
+ error = check_map_args (db_path, coverage, dst_path, &width, &height);
+ break;
+ case ARG_MODE_CATALOG:
+ error = check_catalog_args (db_path);
+ break;
+ case ARG_MODE_HISTOGRAM:
+ if (dst_path == NULL)
+ {
+ if (section == NULL)
+ hist_path =
+ sqlite3_mprintf ("./hist_%s_%d.png", coverage,
+ band_index);
+ else
+ hist_path =
+ sqlite3_mprintf ("./hist_%s_%s_%d.png", coverage,
+ section, band_index);
+ dst_path = hist_path;
+ }
+ error =
+ check_histogram_args (db_path, coverage, section, band_index,
+ dst_path);
+ break;
+ default:
+ fprintf (stderr, "did you forget setting some request MODE ?\n");
+ error = 1;
+ break;
+ };
+
+ if (error)
+ {
+ do_help (mode);
+ return -1;
+ }
+
+/* opening the DB */
+ if (in_memory)
+ cache_size = 0;
+ cache = spatialite_alloc_connection ();
+ open_db (db_path, &handle, cache_size, cache);
+ if (!handle)
+ return -1;
+ if (in_memory)
+ {
+ /* loading the DB in-memory */
+ sqlite3 *mem_db_handle;
+ sqlite3_backup *backup;
+ int ret;
+ ret =
+ sqlite3_open_v2 (":memory:", &mem_db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
+ NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "cannot open 'MEMORY-DB': %s\n",
+ sqlite3_errmsg (mem_db_handle));
+ sqlite3_close (mem_db_handle);
+ return -1;
+ }
+ backup = sqlite3_backup_init (mem_db_handle, "main", handle, "main");
+ if (!backup)
+ {
+ fprintf (stderr, "cannot load 'MEMORY-DB'\n");
+ sqlite3_close (handle);
+ sqlite3_close (mem_db_handle);
+ return -1;
+ }
+ while (1)
+ {
+ ret = sqlite3_backup_step (backup, 1024);
+ if (ret == SQLITE_DONE)
+ break;
+ }
+ ret = sqlite3_backup_finish (backup);
+ sqlite3_close (handle);
+ handle = mem_db_handle;
+ printf ("\nusing IN-MEMORY database\n");
+ spatialite_cleanup_ex (cache);
+ cache_mem = spatialite_alloc_connection ();
+ spatialite_init_ex (handle, cache_mem, 0);
+ }
+
+/* properly setting up the connection */
+ if (!set_connection (handle, journal_off))
+ goto stop;
+
+/* the complete operation is handled as an unique SQL Transaction */
+ ret = sqlite3_exec (handle, "BEGIN", NULL, NULL, &sql_err);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "BEGIN TRANSACTION error: %s\n", sql_err);
+ sqlite3_free (sql_err);
+ goto stop;
+ }
+
+/* executing the required command */
+ switch (mode)
+ {
+ case ARG_MODE_CREATE:
+ ret =
+ exec_create (handle, coverage, sample, pixel,
+ num_bands, compression, quality, tile_width,
+ tile_height, srid, x_res, y_res, no_data);
+ break;
+ case ARG_MODE_DROP:
+ ret = exec_drop (handle, coverage);
+ break;
+ case ARG_MODE_IMPORT:
+ ret =
+ exec_import (handle, src_path, dir_path, file_ext, coverage,
+ worldfile, srid, pyramidize);
+ break;
+ case ARG_MODE_EXPORT:
+ ret =
+ exec_export (handle, dst_path, coverage, x_res, y_res, minx, miny,
+ maxx, maxy, width, height);
+ break;
+ case ARG_MODE_DELETE:
+ ret = exec_delete (handle, coverage, section);
+ break;
+ case ARG_MODE_PYRAMIDIZE:
+ ret = exec_pyramidize (handle, coverage, section, force_pyramid);
+ break;
+ case ARG_MODE_PYRMONO:
+ ret = exec_pyramidize_monolithic (handle, coverage, virt_levels);
+ break;
+ case ARG_MODE_DE_PYRAMIDIZE:
+ ret = exec_de_pyramidize (handle, coverage, section);
+ break;
+ case ARG_MODE_CATALOG:
+ ret = exec_catalog (handle);
+ break;
+ case ARG_MODE_LIST:
+ ret = exec_list (handle, coverage, section);
+ break;
+ case ARG_MODE_MAP:
+ ret = exec_map (handle, coverage, dst_path, width, height);
+ break;
+ case ARG_MODE_HISTOGRAM:
+ ret =
+ exec_histogram (handle, coverage, section, band_index, dst_path);
+ break;
+ };
+
+ if (ret)
+ {
+ /* committing the still pending SQL Transaction */
+ const char *op_name = "UNKNOWN";
+ ret = sqlite3_exec (handle, "COMMIT", NULL, NULL, &sql_err);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "COMMIT TRANSACTION error: %s\n", sql_err);
+ sqlite3_free (sql_err);
+ }
+ switch (mode)
+ {
+ case ARG_MODE_CREATE:
+ op_name = "CREATE";
+ break;
+ case ARG_MODE_DROP:
+ op_name = "DROP";
+ break;
+ case ARG_MODE_IMPORT:
+ op_name = "IMPORT";
+ break;
+ case ARG_MODE_EXPORT:
+ op_name = "EXPORT";
+ break;
+ case ARG_MODE_DELETE:
+ op_name = "DELETE";
+ break;
+ case ARG_MODE_PYRAMIDIZE:
+ op_name = "PYRAMIDIZE";
+ break;
+ case ARG_MODE_PYRMONO:
+ op_name = "PYRAMIDIZE-MONOLITHIC";
+ break;
+ case ARG_MODE_DE_PYRAMIDIZE:
+ op_name = "DE-PYRAMIDIZE";
+ break;
+ case ARG_MODE_LIST:
+ op_name = "LIST";
+ break;
+ case ARG_MODE_MAP:
+ op_name = "MAP";
+ break;
+ case ARG_MODE_CATALOG:
+ op_name = "CATALOG";
+ break;
+ case ARG_MODE_HISTOGRAM:
+ op_name = "HISTOGRAM";
+ break;
+ };
+ printf ("\nOperation %s successfully completed\n", op_name);
+ }
+ else
+ {
+ /* invalidating the still pending SQL Transaction */
+ fprintf (stderr,
+ "\nrestoring the DB to its previous state (ROLLBACK)\n");
+ ret = sqlite3_exec (handle, "ROLLBACK", NULL, NULL, &sql_err);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "ROLLBACK TRANSACTION error: %s\n", sql_err);
+ sqlite3_free (sql_err);
+ }
+ }
+
+ if (in_memory)
+ {
+ /* exporting the in-memory DB to filesystem */
+ sqlite3 *disk_db_handle;
+ sqlite3_backup *backup;
+ int ret;
+ printf ("\nexporting IN_MEMORY database ... wait please ...\n");
+ ret =
+ sqlite3_open_v2 (db_path, &disk_db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
+ NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "cannot open '%s': %s\n", db_path,
+ sqlite3_errmsg (disk_db_handle));
+ sqlite3_close (disk_db_handle);
+ return -1;
+ }
+ backup = sqlite3_backup_init (disk_db_handle, "main", handle, "main");
+ if (!backup)
+ {
+ fprintf (stderr, "Backup failure: 'MEMORY-DB' wasn't saved\n");
+ sqlite3_close (handle);
+ sqlite3_close (disk_db_handle);
+ return -1;
+ }
+ while (1)
+ {
+ ret = sqlite3_backup_step (backup, 1024);
+ if (ret == SQLITE_DONE)
+ break;
+ }
+ ret = sqlite3_backup_finish (backup);
+ sqlite3_close (handle);
+ spatialite_cleanup_ex (cache_mem);
+ handle = disk_db_handle;
+ printf ("\tIN_MEMORY database successfully exported\n");
+ }
+
+ stop:
+ if (hist_path != NULL)
+ sqlite3_free (hist_path);
+ sqlite3_close (handle);
+ spatialite_cleanup_ex (cache);
+ spatialite_shutdown ();
+ return 0;
+}
diff --git a/tools/wmslite.c b/tools/wmslite.c
new file mode 100644
index 0000000..0572c6b
--- /dev/null
+++ b/tools/wmslite.c
@@ -0,0 +1,4228 @@
+/*
+/ wmslite
+/
+/ a light-weight WMS server supporting RasterLite2 DataSources
+/
+/ version 1.0, 2014 January 29
+/
+/ Author: Sandro Furieri a.furieri at lqt.it
+/
+/ Copyright (C) 2014 Alessandro Furieri
+/
+/ This program is free software: you can redistribute it and/or modify
+/ it under the terms of the GNU General Public License as published by
+/ the Free Software Foundation, either version 3 of the License, or
+/ (at your option) any later version.
+/
+/ This program is distributed in the hope that it will be useful,
+/ but WITHOUT ANY WARRANTY; without even the implied warranty of
+/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+/ GNU General Public License for more details.
+/
+/ You should have received a copy of the GNU General Public License
+/ along with this program. If not, see <http://www.gnu.org/licenses/>.
+/
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <sys/time.h>
+#include <inttypes.h>
+#include <float.h>
+
+#ifdef _WIN32
+/* This code is for win32 only */
+#include <windows.h>
+#include <process.h>
+#else
+/* this code is for any sane minded system (*nix) */
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <signal.h>
+#endif
+
+#include <rasterlite2/rasterlite2.h>
+#include <spatialite.h>
+
+#define ARG_NONE 0
+#define ARG_DB_PATH 1
+#define ARG_IP_PORT 2
+#define ARG_CACHE_SIZE 3
+
+#define WMS_ILLEGAL_REQUEST 0
+#define WMS_GET_CAPABILITIES 1
+#define WMS_GET_MAP 2
+
+#define WMS_UNKNOWN -1
+#define WMS_TRANSPARENT 10
+#define WMS_OPAQUE 11
+
+#define WMS_INVALID_CRS 101
+#define WMS_INVALID_DIMENSION 102
+#define WMS_INVALID_BBOX 103
+#define WMS_INVALID_LAYER 104
+#define WMS_INVALID_GROUP 105
+#define WMS_INVALID_BGCOLOR 106
+#define WMS_INVALID_STYLE 107
+#define WMS_INVALID_FORMAT 108
+#define WMS_INVALID_TRANSPARENT 109
+#define WMS_NOT_EXISTING_LAYER 110
+#define WMS_LAYER_OUT_OF_BBOX 111
+#define WMS_MISMATCHING_SRID 112
+
+#define WMS_VERSION_UNKNOWN 0
+#define WMS_VERSION_100 100
+#define WMS_VERSION_110 110
+#define WMS_VERSION_111 111
+#define WMS_VERSION_130 130
+
+#define CONNECTION_INVALID 0
+#define CONNECTION_AVAILABLE 1
+#define CONNECTION_BUSY 2
+
+#define LOG_SLOT_AVAILABLE -100
+#define LOG_SLOT_BUSY -200
+#define LOG_SLOT_READY -300
+
+#define SEND_BLOK_SZ 8192
+#define MAX_CONN 8
+#define MAX_LOG 256
+
+#ifndef timersub
+#define timersub(a, b, result) \
+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ if ((result)->tv_usec < 0) { \
+ --(result)->tv_sec; \
+ (result)->tv_usec += 1000000; \
+ } \
+
+#endif
+
+int debug_mode = 0;
+
+struct glob_var
+{
+/* global objects */
+ sqlite3 *handle;
+ sqlite3_stmt *stmt_log;
+ char *cached_capabilities;
+ struct server_log *log;
+ struct wms_list *list;
+ struct connections_pool *pool;
+ void *cache;
+} glob;
+
+struct neutral_socket
+{
+#ifdef _WIN32
+ SOCKET socket;
+#else
+ int socket;
+#endif
+};
+
+struct wms_style
+{
+/* a struct wrapping a WMS style */
+ int valid;
+ char *name;
+ char *title;
+ char *abstract;
+ struct wms_style *next;
+};
+
+struct wms_layer
+{
+/* a struct wrapping a WMS layer */
+ int valid;
+ char *layer_name;
+ char *title;
+ char *abstract;
+ int srid;
+ int is_geographic;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ double geo_minx;
+ double geo_miny;
+ double geo_maxx;
+ double geo_maxy;
+ unsigned char sample;
+ unsigned char pixel;
+ unsigned char num_bands;
+ int jpeg;
+ int png;
+ int child_layer;
+ struct wms_style *first_style;
+ struct wms_style *last_style;
+ struct wms_layer *next;
+};
+
+struct read_connection
+{
+ void *cache;
+ sqlite3 *handle;
+ sqlite3_stmt *stmt_get_map;
+ int status;
+};
+
+struct connections_pool
+{
+ struct read_connection connections[MAX_CONN];
+};
+
+struct wms_layer_ref
+{
+/* a struct wrapping a WMS layer reference */
+ struct wms_layer *layer_ref;
+ struct wms_layer_ref *next;
+};
+
+struct wms_group
+{
+/* a struct wrapping a WMS group of layers */
+ int valid;
+ char *group_name;
+ char *title;
+ char *abstract;
+ int srid;
+ int is_geographic;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ double geo_minx;
+ double geo_miny;
+ double geo_maxx;
+ double geo_maxy;
+ struct wms_style *first_style;
+ struct wms_style *last_style;
+ struct wms_layer_ref *first_child;
+ struct wms_layer_ref *last_child;
+ struct wms_group *next;
+};
+
+struct wms_list
+{
+/* a struct wrapping a list of WMS layers */
+ struct wms_layer *first_layer;
+ struct wms_layer *last_layer;
+ struct wms_group *first_group;
+ struct wms_group *last_group;
+};
+
+struct wms_argument
+{
+/* a struct wrapping a single WMS arg */
+ char *arg_name;
+ char *arg_value;
+ struct wms_argument *next;
+};
+
+struct wms_args
+{
+/* a struct wrapping a WMS request URL */
+ sqlite3 *db_handle;
+ sqlite3_stmt *stmt_get_map;
+ char *service_name;
+ struct wms_argument *first;
+ struct wms_argument *last;
+ int request_type;
+ int wms_version;
+ int error;
+ const char *layer;
+ int srid;
+ int swap_xy;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ unsigned short width;
+ unsigned short height;
+ char *style;
+ unsigned char format;
+ int transparent;
+ int has_bgcolor;
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+};
+
+struct http_request
+{
+/* a struct wrapping an HTTP request */
+ unsigned int id; /* request ID */
+ int port_no;
+#ifdef _WIN32
+ SOCKET socket; /* Socket on which to receive data */
+#else
+ int socket; /* Socket on which to receive data */
+#endif
+ struct wms_list *list;
+ struct read_connection *conn;
+ sqlite3 *log_handle;
+ char *cached_capabilities;
+ int cached_capabilities_len;
+ struct server_log_item *log;
+};
+
+struct server_log_item
+{
+/* a struct supporting log infos */
+ char *client_ip_addr;
+ unsigned short client_ip_port;
+ char *timestamp;
+ char *http_method;
+ char *request_url;
+ int http_status;
+ int response_length;
+ int wms_request;
+ int wms_version;
+ const char *wms_layer;
+ int wms_srid;
+ double wms_bbox_minx;
+ double wms_bbox_miny;
+ double wms_bbox_maxx;
+ double wms_bbox_maxy;
+ unsigned short wms_width;
+ unsigned short wms_height;
+ char *wms_style;
+ unsigned char wms_format;
+ int wms_transparent;
+ int has_bgcolor;
+ unsigned char wms_bgcolor_red;
+ unsigned char wms_bgcolor_green;
+ unsigned char wms_bgcolor_blue;
+ struct timeval begin_time;
+ int milliseconds;
+ int status;
+};
+
+struct server_log
+{
+/* log container */
+ struct server_log_item items[MAX_LOG];
+ int next_item;
+ time_t last_update;
+};
+
+static struct wms_style *
+alloc_wms_style (const char *name, const char *title, const char *abstract)
+{
+/* creating a WMS Raster Style */
+ int len;
+ struct wms_style *style = malloc (sizeof (struct wms_style));
+ style->valid = 1;
+ len = strlen (name);
+ style->name = malloc (len + 1);
+ strcpy (style->name, name);
+ if (title == NULL)
+ style->title = NULL;
+ else
+ {
+ len = strlen (title);
+ style->title = malloc (len + 1);
+ strcpy (style->title, title);
+ }
+ if (abstract == NULL)
+ style->abstract = NULL;
+ else
+ {
+ len = strlen (abstract);
+ style->abstract = malloc (len + 1);
+ strcpy (style->abstract, abstract);
+ }
+ style->next = NULL;
+ return style;
+}
+
+static void
+destroy_wms_style (struct wms_style *style)
+{
+/* memory cleanup - destroying a Raster Style */
+ if (style == NULL)
+ return;
+ if (style->name != NULL)
+ free (style->name);
+ if (style->title != NULL)
+ free (style->title);
+ if (style->abstract != NULL)
+ free (style->abstract);
+ free (style);
+}
+
+static struct wms_layer *
+alloc_wms_layer (const char *layer, const char *title, const char *abstract,
+ int srid, int is_geographic, double minx, double miny,
+ double maxx, double maxy, unsigned char sample,
+ unsigned char pixel, unsigned char num_bands)
+{
+/* creating a WMS layer item */
+ int len;
+ struct wms_layer *lyr = malloc (sizeof (struct wms_layer));
+ lyr->valid = 1;
+ len = strlen (layer);
+ lyr->layer_name = malloc (len + 1);
+ strcpy (lyr->layer_name, layer);
+ len = strlen (title);
+ lyr->title = malloc (len + 1);
+ strcpy (lyr->title, title);
+ len = strlen (abstract);
+ lyr->abstract = malloc (len + 1);
+ strcpy (lyr->abstract, abstract);
+ lyr->srid = srid;
+ lyr->is_geographic = is_geographic;
+ lyr->minx = minx;
+ lyr->miny = miny;
+ lyr->maxx = maxx;
+ lyr->maxy = maxy;
+ lyr->sample = sample;
+ lyr->pixel = pixel;
+ lyr->num_bands = num_bands;
+ if (pixel == RL2_PIXEL_MONOCHROME || pixel == RL2_PIXEL_PALETTE)
+ {
+ lyr->png = 1;
+ lyr->jpeg = 0;
+ }
+ else
+ {
+ lyr->png = 1;
+ lyr->jpeg = 1;
+ }
+ lyr->child_layer = 0;
+ lyr->first_style = NULL;
+ lyr->last_style = NULL;
+ lyr->next = NULL;
+ return lyr;
+}
+
+static void
+destroy_wms_layer (struct wms_layer *lyr)
+{
+/* memory cleanup - freeing a WMS layer item */
+ struct wms_style *style;
+ struct wms_style *style_n;
+ if (lyr == NULL)
+ return;
+ if (lyr->layer_name != NULL)
+ free (lyr->layer_name);
+ if (lyr->title != NULL)
+ free (lyr->title);
+ if (lyr->abstract != NULL)
+ free (lyr->abstract);
+ style = lyr->first_style;
+ while (style != NULL)
+ {
+ style_n = style->next;
+ destroy_wms_style (style);
+ style = style_n;
+ }
+ free (lyr);
+}
+
+static struct wms_layer_ref *
+alloc_wms_layer_ref (struct wms_layer *layer_ref)
+{
+/* creating a WMS layer_ref item */
+ struct wms_layer_ref *ref = malloc (sizeof (struct wms_layer_ref));
+ ref->layer_ref = layer_ref;
+ ref->next = NULL;
+ return ref;
+}
+
+static void
+destroy_wms_layer_ref (struct wms_layer_ref *ref)
+{
+/* memory cleanup - freeing a WMS layer_ref item */
+ if (ref == NULL)
+ return;
+ free (ref);
+}
+
+static struct wms_group *
+alloc_wms_group (const char *name, const char *title, const char *abstract)
+{
+/* creating a WMS group item */
+ int len;
+ struct wms_group *grp = malloc (sizeof (struct wms_group));
+ grp->valid = 1;
+ len = strlen (name);
+ grp->group_name = malloc (len + 1);
+ strcpy (grp->group_name, name);
+ len = strlen (title);
+ grp->title = malloc (len + 1);
+ strcpy (grp->title, title);
+ len = strlen (abstract);
+ grp->abstract = malloc (len + 1);
+ strcpy (grp->abstract, abstract);
+ grp->first_style = NULL;
+ grp->last_style = NULL;
+ grp->first_child = NULL;
+ grp->last_child = NULL;
+ grp->next = NULL;
+ return grp;
+}
+
+static void
+destroy_wms_group (struct wms_group *grp)
+{
+/* memory cleanup - freeing a WMS group item */
+ struct wms_style *style;
+ struct wms_style *style_n;
+ struct wms_layer_ref *child;
+ struct wms_layer_ref *child_n;
+ if (grp == NULL)
+ return;
+ if (grp->group_name != NULL)
+ free (grp->group_name);
+ if (grp->title != NULL)
+ free (grp->title);
+ if (grp->abstract != NULL)
+ free (grp->abstract);
+ style = grp->first_style;
+ while (style != NULL)
+ {
+ style_n = style->next;
+ destroy_wms_style (style);
+ style = style_n;
+ }
+ child = grp->first_child;
+ while (child != NULL)
+ {
+ child_n = child->next;
+ destroy_wms_layer_ref (child);
+ child = child_n;
+ }
+ free (grp);
+}
+
+static struct wms_list *
+alloc_wms_list ()
+{
+/* allocating a list of WMS layers */
+ struct wms_list *list = malloc (sizeof (struct wms_list));
+ list->first_layer = NULL;
+ list->last_layer = NULL;
+ list->first_group = NULL;
+ list->last_group = NULL;
+ return list;
+}
+
+static void
+destroy_wms_list (struct wms_list *list)
+{
+/* memory cleanup - destroying a list of WMS layers */
+ struct wms_layer *pl;
+ struct wms_layer *pln;
+ struct wms_group *pg;
+ struct wms_group *pgn;
+ if (list == NULL)
+ return;
+ pl = list->first_layer;
+ while (pl != NULL)
+ {
+ pln = pl->next;
+ destroy_wms_layer (pl);
+ pl = pln;
+ }
+ pg = list->first_group;
+ while (pg != NULL)
+ {
+ pgn = pg->next;
+ destroy_wms_group (pg);
+ pg = pgn;
+ }
+ free (list);
+}
+
+static void
+add_style_to_wms_layer (struct wms_list *list, const char *coverage_name,
+ const char *name, const char *title,
+ const char *abstract)
+{
+/* appending a Raster Style to a WMS Layer */
+ struct wms_layer *lyr;
+ if (list == NULL)
+ return;
+ lyr = list->first_layer;
+ while (lyr != NULL)
+ {
+ if (strcmp (lyr->layer_name, coverage_name) == 0)
+ {
+ struct wms_style *style =
+ alloc_wms_style (name, title, abstract);
+ if (lyr->first_style == NULL)
+ lyr->first_style = style;
+ if (lyr->last_style != NULL)
+ lyr->last_style->next = style;
+ lyr->last_style = style;
+ return;
+ }
+ lyr = lyr->next;
+ }
+}
+
+static void
+add_default_styles (struct wms_list *list)
+{
+/* appending an implicit Default Style to each WMS Layer */
+ struct wms_layer *lyr;
+ if (list == NULL)
+ return;
+ lyr = list->first_layer;
+ while (lyr != NULL)
+ {
+ struct wms_style *style;
+ int has_default = 0;
+ int count = 0;
+ style = lyr->first_style;
+ while (style != NULL)
+ {
+ if (strcasecmp (style->name, "default") == 0)
+ has_default = 1;
+ count++;
+ style = style->next;
+ }
+ if (count && !has_default)
+ {
+ /* appending a Default style */
+ struct wms_style *style =
+ alloc_wms_style ("default", NULL, NULL);
+ if (lyr->first_style == NULL)
+ lyr->first_style = style;
+ if (lyr->last_style != NULL)
+ lyr->last_style->next = style;
+ lyr->last_style = style;
+ }
+ lyr = lyr->next;
+ }
+}
+
+static void
+add_style_to_wms_group (struct wms_list *list, const char *group_name,
+ const char *name, const char *title,
+ const char *abstract)
+{
+/* appending a Style to a WMS Group */
+ struct wms_group *grp;
+ if (list == NULL)
+ return;
+ grp = list->first_group;
+ while (grp != NULL)
+ {
+ if (strcmp (grp->group_name, group_name) == 0)
+ {
+ struct wms_style *style =
+ alloc_wms_style (name, title, abstract);
+ if (grp->first_style == NULL)
+ grp->first_style = style;
+ if (grp->last_style != NULL)
+ grp->last_style->next = style;
+ grp->last_style = style;
+ return;
+ }
+ grp = grp->next;
+ }
+}
+
+static void
+add_default_group_styles (struct wms_list *list)
+{
+/* appending an implicit Default Style to each WMS Group */
+ struct wms_group *grp;
+ if (list == NULL)
+ return;
+ grp = list->first_group;
+ while (grp != NULL)
+ {
+ struct wms_style *style;
+ int has_default = 0;
+ int count = 0;
+ style = grp->first_style;
+ while (style != NULL)
+ {
+ if (strcasecmp (style->name, "default") == 0)
+ has_default = 1;
+ count++;
+ style = style->next;
+ }
+ if (count && !has_default)
+ {
+ /* appending a Default style */
+ struct wms_style *style =
+ alloc_wms_style ("default", NULL, NULL);
+ if (grp->first_style == NULL)
+ grp->first_style = style;
+ if (grp->last_style != NULL)
+ grp->last_style->next = style;
+ grp->last_style = style;
+ }
+ grp = grp->next;
+ }
+}
+
+static struct wms_argument *
+alloc_wms_argument (char *name, char *value)
+{
+/* allocating a WMS argument */
+ struct wms_argument *arg;
+ arg = malloc (sizeof (struct wms_argument));
+ arg->arg_name = name;
+ arg->arg_value = value;
+ arg->next = NULL;
+ return arg;
+}
+
+static void
+destroy_wms_argument (struct wms_argument *arg)
+{
+/* memory cleanup - destroying a WMS arg struct */
+ if (arg == NULL)
+ return;
+ if (arg->arg_name != NULL)
+ free (arg->arg_name);
+ if (arg->arg_value != NULL)
+ free (arg->arg_value);
+ free (arg);
+}
+
+static void
+close_connection (struct read_connection *conn)
+{
+/* closing a connection */
+ if (conn == NULL)
+ return;
+ if (conn->stmt_get_map != NULL)
+ sqlite3_finalize (conn->stmt_get_map);
+ if (conn->handle != NULL)
+ sqlite3_close (conn->handle);
+ if (conn->cache != NULL)
+ spatialite_cleanup_ex (conn->cache);
+ conn->status = CONNECTION_INVALID;
+}
+
+static void
+destroy_connections_pool (struct connections_pool *pool)
+{
+/* memory clean-up: destroying a connections pool */
+ int i;
+ struct read_connection *conn;
+
+ if (pool == NULL)
+ return;
+ for (i = 0; i < MAX_CONN; i++)
+ {
+ /* closing all connections */
+ conn = &(pool->connections[i]);
+ close_connection (conn);
+ }
+ free (pool);
+}
+
+static void
+connection_init (struct read_connection *conn, const char *path)
+{
+/* creating a read connection */
+ int ret;
+ sqlite3 *db_handle;
+ sqlite3_stmt *stmt;
+ void *cache;
+ const char *sql;
+
+ ret =
+ sqlite3_open_v2 (path, &db_handle,
+ SQLITE_OPEN_READONLY | SQLITE_OPEN_FULLMUTEX |
+ SQLITE_OPEN_SHAREDCACHE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "cannot open '%s': %s\n", path,
+ sqlite3_errmsg (db_handle));
+ sqlite3_close (db_handle);
+ return;
+ }
+ cache = spatialite_alloc_connection ();
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+
+/* creating the GetMap SQL statement */
+ sql =
+ "SELECT RL2_GetMapImage(?, BuildMbr(?, ?, ?, ?), ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (db_handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ sqlite3_close (db_handle);
+ spatialite_cleanup_ex (cache);
+ }
+ conn->handle = db_handle;
+ conn->stmt_get_map = stmt;
+ conn->cache = cache;
+ conn->status = CONNECTION_AVAILABLE;
+}
+
+static struct connections_pool *
+alloc_connections_pool (const char *path)
+{
+/* creating and initializing the connections pool */
+ int i;
+ int count;
+ struct read_connection *conn;
+ struct connections_pool *pool =
+ malloc (sizeof (struct read_connection) * MAX_CONN);
+ if (pool == NULL)
+ return NULL;
+ for (i = 0; i < MAX_CONN; i++)
+ {
+ /* initializing empty connections */
+ conn = &(pool->connections[i]);
+ conn->handle = NULL;
+ conn->stmt_get_map = NULL;
+ conn->cache = NULL;
+ conn->status = CONNECTION_INVALID;
+ }
+ for (i = 0; i < MAX_CONN; i++)
+ {
+ /* creating the connections */
+ conn = &(pool->connections[i]);
+ connection_init (conn, path);
+ }
+ count = 0;
+ for (i = 0; i < MAX_CONN; i++)
+ {
+ /* final validity check */
+ conn = &(pool->connections[i]);
+ if (conn->status == CONNECTION_AVAILABLE)
+ count++;
+ }
+ if (count == 0)
+ {
+ /* invalid pool ... sorry ... */
+ destroy_connections_pool (pool);
+ return NULL;
+ }
+ return pool;
+}
+
+static void
+log_cleanup (struct server_log_item *log)
+{
+/* memory cleanup - resetting a log slot */
+ if (log == NULL)
+ return;
+ if (log->client_ip_addr != NULL)
+ free (log->client_ip_addr);
+ if (log->timestamp != NULL)
+ sqlite3_free (log->timestamp);
+ if (log->http_method != NULL)
+ free (log->http_method);
+ if (log->request_url != NULL)
+ free (log->request_url);
+ if (log->wms_style != NULL)
+ free (log->wms_style);
+ log->client_ip_addr = NULL;
+ log->timestamp = NULL;
+ log->http_method = NULL;
+ log->request_url = NULL;
+ log->wms_layer = NULL;
+ log->wms_style = NULL;
+ log->status = LOG_SLOT_AVAILABLE;
+}
+
+static struct server_log *
+alloc_server_log ()
+{
+/* allocating an empty server log helper struct */
+ int i;
+ struct server_log *log = malloc (sizeof (struct server_log));
+ if (log == NULL)
+ return NULL;
+ for (i = 0; i < MAX_LOG; i++)
+ {
+ struct server_log_item *item = &(log->items[i]);
+ item->client_ip_addr = NULL;
+ item->timestamp = NULL;
+ item->http_method = NULL;
+ item->request_url = NULL;
+ item->wms_layer = NULL;
+ item->wms_style = NULL;
+ item->status = LOG_SLOT_AVAILABLE;
+ }
+ log->next_item = 0;
+ time (&(log->last_update));
+ return log;
+}
+
+static void
+destroy_server_log (struct server_log *log)
+{
+/* memory cleanup - destroying the server log helper struct */
+ int i;
+ if (log == NULL)
+ return;
+ for (i = 0; i < MAX_LOG; i++)
+ {
+ struct server_log_item *item = &(log->items[i]);
+ log_cleanup (item);
+ }
+ free (log);
+}
+
+static void
+log_error (struct server_log_item *log, char *timestamp, int status,
+ char *method, char *url, int size)
+{
+/* logging an ERROR event */
+ struct timeval stop_time;
+ struct timeval res;
+ if (log == NULL)
+ return;
+ log->timestamp = timestamp;
+ log->http_status = status;
+ log->http_method = method;
+ log->request_url = url;
+ log->response_length = size;
+ log->wms_request = WMS_ILLEGAL_REQUEST;
+ log->wms_version = WMS_VERSION_UNKNOWN;
+ log->status = LOG_SLOT_READY;
+ gettimeofday (&stop_time, NULL);
+ timersub (&(log->begin_time), &stop_time, &res);
+ log->milliseconds = res.tv_usec / 1000;
+}
+
+static void
+log_get_capabilities_1 (struct server_log_item *log, char *timestamp,
+ int status, char *method, char *url)
+{
+/* logging a GetCapabilities event (take #1) */
+ if (log == NULL)
+ return;
+ log->timestamp = timestamp;
+ log->http_status = status;
+ log->http_method = method;
+ log->request_url = url;
+ log->wms_request = WMS_GET_CAPABILITIES;
+ log->wms_version = WMS_VERSION_UNKNOWN;
+}
+
+static void
+log_get_capabilities_2 (struct server_log_item *log, int size)
+{
+/* logging a GetCapabilities event (take #2) */
+ struct timeval stop_time;
+ struct timeval res;
+ if (log == NULL)
+ return;
+ log->response_length = size;
+ log->status = LOG_SLOT_READY;
+ gettimeofday (&stop_time, NULL);
+ timersub (&(log->begin_time), &stop_time, &res);
+ log->milliseconds = res.tv_usec / 1000;
+}
+
+static void
+log_get_map_1 (struct server_log_item *log, char *timestamp, int status,
+ char *method, char *url, struct wms_args *args)
+{
+/* logging a GetMap event (take #1) */
+ int len;
+ if (log == NULL)
+ return;
+ log->timestamp = timestamp;
+ log->http_status = status;
+ log->http_method = method;
+ log->request_url = url;
+ log->wms_request = WMS_GET_MAP;
+ log->wms_version = args->wms_version;
+ log->wms_layer = args->layer;
+ log->wms_srid = args->srid;
+ log->wms_bbox_minx = args->minx;
+ log->wms_bbox_miny = args->miny;
+ log->wms_bbox_maxx = args->maxx;
+ log->wms_bbox_maxy = args->maxy;
+ log->wms_width = args->width;
+ log->wms_height = args->height;
+ if (args->style == NULL)
+ log->wms_style = NULL;
+ else
+ {
+ len = strlen (args->style);
+ log->wms_style = malloc (len + 1);
+ strcpy (log->wms_style, args->style);
+ }
+ log->wms_format = args->format;
+ log->wms_transparent = args->transparent;
+ log->has_bgcolor = args->has_bgcolor;
+ log->wms_bgcolor_red = args->red;
+ log->wms_bgcolor_green = args->green;
+ log->wms_bgcolor_blue = args->blue;
+}
+
+static void
+log_get_map_2 (struct server_log_item *log, int size)
+{
+/* logging a GetMap event (take #2) */
+ struct timeval stop_time;
+ struct timeval res;
+ if (log == NULL)
+ return;
+ log->response_length = size;
+ log->status = LOG_SLOT_READY;
+ gettimeofday (&stop_time, NULL);
+ timersub (&(log->begin_time), &stop_time, &res);
+ log->milliseconds = res.tv_usec / 1000;
+}
+
+static void
+flush_log (sqlite3 * handle, sqlite3_stmt * stmt, struct server_log *log)
+{
+/* flushing the LOG */
+ int ret;
+ int i;
+ char dummy[32];
+ if (handle == NULL || stmt == NULL || log == NULL)
+ return;
+
+ while (1)
+ {
+ /* looping until all Log slots are ready */
+ int wait = 0;
+ for (i = 0; i < MAX_LOG; i++)
+ {
+ struct server_log_item *item = &(log->items[i]);
+ if (item->status == LOG_SLOT_BUSY)
+ wait = 1;
+ }
+ if (wait)
+ usleep (50);
+ else
+ break;
+ }
+
+/* starting a DBMS Transaction */
+ ret = sqlite3_exec (handle, "BEGIN", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ goto error;
+
+ for (i = 0; i < MAX_LOG; i++)
+ {
+ struct server_log_item *item = &(log->items[i]);
+ if (item->status != LOG_SLOT_READY)
+ continue;
+ /* binding the INSERT values */
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ if (item->timestamp == NULL)
+ sqlite3_bind_null (stmt, 1);
+ else
+ sqlite3_bind_text (stmt, 1, item->timestamp,
+ strlen (item->timestamp), SQLITE_STATIC);
+ if (item->client_ip_addr == NULL)
+ sqlite3_bind_null (stmt, 2);
+ else
+ sqlite3_bind_text (stmt, 2, item->client_ip_addr,
+ strlen (item->client_ip_addr), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 3, item->client_ip_port);
+ if (item->http_method == NULL)
+ sqlite3_bind_null (stmt, 4);
+ else
+ sqlite3_bind_text (stmt, 4, item->http_method,
+ strlen (item->http_method), SQLITE_STATIC);
+ if (item->request_url == NULL)
+ sqlite3_bind_null (stmt, 5);
+ else
+ sqlite3_bind_text (stmt, 5, item->request_url,
+ strlen (item->request_url), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 6, item->http_status);
+ sqlite3_bind_int (stmt, 7, item->response_length);
+ switch (item->wms_request)
+ {
+ case WMS_GET_CAPABILITIES:
+ sqlite3_bind_text (stmt, 8, "GetCapabilities", 17,
+ SQLITE_STATIC);
+ break;
+ case WMS_GET_MAP:
+ sqlite3_bind_text (stmt, 8, "GetMap", 8, SQLITE_STATIC);
+ break;
+ default:
+ sqlite3_bind_null (stmt, 8);
+ };
+ switch (item->wms_version)
+ {
+ case WMS_VERSION_100:
+ sqlite3_bind_text (stmt, 9, "1.0.0", 5, SQLITE_TRANSIENT);
+ break;
+ case WMS_VERSION_110:
+ sqlite3_bind_text (stmt, 9, "1.1.0", 5, SQLITE_TRANSIENT);
+ break;
+ case WMS_VERSION_111:
+ sqlite3_bind_text (stmt, 9, "1.1.1", 5, SQLITE_TRANSIENT);
+ break;
+ case WMS_VERSION_130:
+ sqlite3_bind_text (stmt, 9, "1.3.0", 5, SQLITE_TRANSIENT);
+ break;
+ default:
+ sqlite3_bind_null (stmt, 9);
+ };
+ if (item->wms_request == WMS_GET_MAP)
+ {
+ if (item->wms_layer == NULL)
+ sqlite3_bind_null (stmt, 10);
+ else
+ sqlite3_bind_text (stmt, 10, item->wms_layer,
+ strlen (item->wms_layer), SQLITE_STATIC);
+ sqlite3_bind_int (stmt, 11, item->wms_srid);
+ sqlite3_bind_double (stmt, 12, item->wms_bbox_minx);
+ sqlite3_bind_double (stmt, 13, item->wms_bbox_miny);
+ sqlite3_bind_double (stmt, 14, item->wms_bbox_maxx);
+ sqlite3_bind_double (stmt, 15, item->wms_bbox_maxy);
+ sqlite3_bind_int (stmt, 16, item->wms_width);
+ sqlite3_bind_int (stmt, 17, item->wms_height);
+ if (item->wms_style == NULL)
+ sqlite3_bind_null (stmt, 18);
+ else
+ sqlite3_bind_text (stmt, 18, item->wms_style,
+ strlen (item->wms_style), SQLITE_STATIC);
+ switch (item->wms_format)
+ {
+ case RL2_OUTPUT_FORMAT_JPEG:
+ sqlite3_bind_text (stmt, 19, "image/jpeg", 10,
+ SQLITE_TRANSIENT);
+ break;
+ case RL2_OUTPUT_FORMAT_PNG:
+ sqlite3_bind_text (stmt, 19, "image/png", 9,
+ SQLITE_TRANSIENT);
+ break;
+ case RL2_OUTPUT_FORMAT_TIFF:
+ sqlite3_bind_text (stmt, 19, "image/tiff", 10,
+ SQLITE_TRANSIENT);
+ break;
+ case RL2_OUTPUT_FORMAT_PDF:
+ sqlite3_bind_text (stmt, 19, "application/x-pdf", 9,
+ SQLITE_TRANSIENT);
+ break;
+ default:
+ sqlite3_bind_null (stmt, 19);
+ };
+ switch (item->wms_transparent)
+ {
+ case WMS_TRANSPARENT:
+ sqlite3_bind_int (stmt, 20, 1);
+ break;
+ case WMS_OPAQUE:
+ sqlite3_bind_int (stmt, 20, 0);
+ break;
+ default:
+ sqlite3_bind_null (stmt, 20);
+ break;
+ };
+ if (item->has_bgcolor == 0)
+ sqlite3_bind_null (stmt, 21);
+ else
+ {
+ sprintf (dummy, "#%02x%02x%02x\n", item->wms_bgcolor_red,
+ item->wms_bgcolor_green, item->wms_bgcolor_blue);
+ sqlite3_bind_text (stmt, 21, dummy, strlen (dummy),
+ SQLITE_TRANSIENT);
+ }
+ }
+ else
+ {
+ sqlite3_bind_null (stmt, 10);
+ sqlite3_bind_null (stmt, 11);
+ sqlite3_bind_null (stmt, 12);
+ sqlite3_bind_null (stmt, 13);
+ sqlite3_bind_null (stmt, 14);
+ sqlite3_bind_null (stmt, 15);
+ sqlite3_bind_null (stmt, 16);
+ sqlite3_bind_null (stmt, 17);
+ sqlite3_bind_null (stmt, 18);
+ sqlite3_bind_null (stmt, 19);
+ sqlite3_bind_null (stmt, 20);
+ sqlite3_bind_null (stmt, 21);
+ }
+ sqlite3_bind_int (stmt, 22, item->milliseconds);
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE || ret == SQLITE_ROW)
+ ;
+ else
+ {
+ fprintf (stderr,
+ "INSERT INTO WMS-LOG; sqlite3_step() error: %s\n",
+ sqlite3_errmsg (handle));
+ goto error;
+ }
+ log_cleanup (item);
+ }
+
+/* committing the still pending transaction */
+ ret = sqlite3_exec (handle, "COMMIT", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ goto error;
+ log->next_item = 0;
+ time (&(log->last_update));
+ return;
+
+ error:
+ sqlite3_exec (handle, "ROLLBACK", NULL, NULL, NULL);
+ fprintf (stderr, "ERROR: unable to update the server log\n");
+}
+
+static void
+clean_shutdown ()
+{
+/* performing a clean shutdown */
+ fprintf (stderr, "wmslite server shutdown in progress\n");
+ flush_log (glob.handle, glob.stmt_log, glob.log);
+ if (glob.stmt_log != NULL)
+ sqlite3_finalize (glob.stmt_log);
+ if (glob.cached_capabilities != NULL)
+ free (glob.cached_capabilities);
+ if (glob.list != NULL)
+ destroy_wms_list (glob.list);
+ if (glob.log != NULL)
+ destroy_server_log (glob.log);
+ if (glob.pool != NULL)
+ destroy_connections_pool (glob.pool);
+ if (glob.handle != NULL)
+ sqlite3_close (glob.handle);
+ if (glob.cache != NULL)
+ spatialite_cleanup_ex (glob.cache);
+ spatialite_shutdown ();
+ fprintf (stderr, "wmslite shutdown completed ... bye bye\n\n");
+}
+
+#ifdef _WIN32
+BOOL WINAPI
+signal_handler (DWORD dwCtrlType)
+{
+/* intercepting some Windows signal */
+ clean_shutdown ();
+ return FALSE;
+}
+#else
+static void
+signal_handler (int signo)
+{
+/* intercepting some signal */
+ if (signo == SIGINT)
+ signo = SIGINT; /* suppressing compiler warnings */
+ clean_shutdown ();
+ exit (0);
+}
+#endif
+
+static struct wms_args *
+alloc_wms_args (const char *service_name)
+{
+/* allocating an empty WMS args struct */
+ int len;
+ struct wms_args *args;
+ if (service_name == NULL)
+ return NULL;
+ args = malloc (sizeof (struct wms_args));
+ args->db_handle = NULL;
+ args->stmt_get_map = NULL;
+ len = strlen (service_name);
+ args->service_name = malloc (len + 1);
+ strcpy (args->service_name, service_name);
+ args->first = NULL;
+ args->last = NULL;
+ args->style = NULL;
+ args->request_type = WMS_ILLEGAL_REQUEST;
+ args->error = WMS_UNKNOWN;
+ return args;
+}
+
+static void
+destroy_wms_args (struct wms_args *args)
+{
+/* memory cleanup - destroying a WMS args struct */
+ struct wms_argument *pa;
+ struct wms_argument *pan;
+ if (args == NULL)
+ return;
+ if (args->service_name != NULL)
+ free (args->service_name);
+ if (args->style != NULL)
+ free (args->style);
+ pa = args->first;
+ while (pa != NULL)
+ {
+ pan = pa->next;
+ destroy_wms_argument (pa);
+ pa = pan;
+ }
+ free (args);
+}
+
+static int
+add_wms_argument (struct wms_args *args, const char *token)
+{
+/* attempting to add a WMS argument */
+ int len;
+ struct wms_argument *arg;
+ char *name;
+ char *value;
+ const char *ptr = strstr (token, "=");
+ if (ptr == NULL)
+ return 0;
+ len = strlen (ptr + 1);
+ value = malloc (len + 1);
+ strcpy (value, ptr + 1);
+ len = ptr - token;
+ name = malloc (len + 1);
+ memcpy (name, token, len);
+ *(name + len) = '\0';
+ arg = alloc_wms_argument (name, value);
+ if (args->first == NULL)
+ args->first = arg;
+ if (args->last != NULL)
+ args->last->next = arg;
+ args->last = arg;
+ return 1;
+}
+
+static int
+parse_srs (const char *srs)
+{
+/* parsing the EPSG:x item */
+ int srid;
+ if (strlen (srs) < 6)
+ return -1;
+ if (strncmp (srs, "EPSG:", 4) != 0)
+ return -1;
+ srid = atoi (srs + 5);
+ return srid;
+}
+
+static const char *
+parse_layers (const char *layers)
+{
+/* only a single layer for each request is supported */
+ int comma = 0;
+ const char *p = layers;
+ while (*p != '\0')
+ {
+ if (*p++ == ',')
+ comma++;
+ }
+ if (!comma)
+ return layers;
+ return NULL;
+}
+
+static int
+parse_dim (const char *dim, unsigned short *value)
+{
+/* parsing the Width / Height items */
+ int x;
+ for (x = 0; x < (int) strlen (dim); x++)
+ {
+ if (*(dim + x) < '0' || *(dim + x) > '9')
+ return 0;
+ }
+ x = atoi (dim);
+ if (x <= 0 || x > UINT16_MAX)
+ return 0;
+ *value = x;
+ return 1;
+}
+
+static char *
+parse_style (const char *style)
+{
+/* parsing the current style */
+ char *out_style = NULL;
+ if (strlen (style) == 0)
+ style = "default";
+ out_style = malloc (strlen (style) + 1);
+ strcpy (out_style, style);
+ return out_style;
+}
+
+static int
+parse_format (const char *format)
+{
+/* parsing the output format */
+ if (strcasecmp (format, "image/png") == 0)
+ return RL2_OUTPUT_FORMAT_PNG;
+ if (strcasecmp (format, "image/jpeg") == 0)
+ return RL2_OUTPUT_FORMAT_JPEG;
+ if (strcasecmp (format, "image/tiff") == 0)
+ return RL2_OUTPUT_FORMAT_TIFF;
+ if (strcasecmp (format, "application/x-pdf") == 0)
+ return RL2_OUTPUT_FORMAT_PDF;
+ return WMS_UNKNOWN;
+}
+
+static int
+parse_transparent (const char *str)
+{
+/* parsing the Transparent value */
+ if (strcasecmp (str, "TRUE") == 0)
+ return WMS_TRANSPARENT;
+ if (strcasecmp (str, "FALSE") == 0)
+ return WMS_OPAQUE;
+ return WMS_UNKNOWN;
+}
+
+static int
+parse_bbox (const char *bbox, double *minx, double *miny, double *maxx,
+ double *maxy)
+{
+/* attempting to parse the BBOX */
+ char buf[2000];
+ int count = 0;
+ char *out = buf;
+ const char *in = bbox;
+ while (1)
+ {
+ if (*in == '\0')
+ {
+ if (count == 3)
+ {
+ *maxy = atof (buf);
+ }
+ else
+ return 0;
+ break;
+ }
+ if (*in == ',')
+ {
+ *out = '\0';
+ switch (count)
+ {
+ case 0:
+ *minx = atof (buf);
+ break;
+ case 1:
+ *miny = atof (buf);
+ break;
+ case 2:
+ *maxx = atof (buf);
+ break;
+ default:
+ return 0;
+ };
+ out = buf;
+ in++;
+ count++;
+ continue;
+ }
+ *out++ = *in++;
+ }
+ return 1;
+}
+
+static int
+parse_hex (char hi, char lo, unsigned char *value)
+{
+/* parsing an Hex byte */
+ unsigned char x;
+ switch (hi)
+ {
+ case '0':
+ x = 0;
+ break;
+ case '1':
+ x = 1 * 16;
+ break;
+ case '2':
+ x = 2 * 16;
+ break;
+ case '3':
+ x = 3 * 16;
+ break;
+ case '4':
+ x = 4 * 16;
+ break;
+ case '5':
+ x = 5 * 16;
+ break;
+ case '6':
+ x = 6 * 16;
+ break;
+ case '7':
+ x = 7 * 16;
+ break;
+ case '8':
+ x = 8 * 16;
+ break;
+ case '9':
+ x = 9 * 16;
+ break;
+ case 'a':
+ case 'A':
+ x = 10 * 16;
+ break;
+ case 'b':
+ case 'B':
+ x = 11 * 16;
+ break;
+ case 'c':
+ case 'C':
+ x = 12 * 16;
+ break;
+ case 'd':
+ case 'D':
+ x = 13 * 16;
+ break;
+ case 'e':
+ case 'E':
+ x = 14 * 16;
+ break;
+ case 'f':
+ case 'F':
+ x = 15 * 16;
+ break;
+ default:
+ return 0;
+ };
+ switch (lo)
+ {
+ case '0':
+ x += 0;
+ break;
+ case '1':
+ x += 1;
+ break;
+ case '2':
+ x += 2;
+ break;
+ case '3':
+ x += 3;
+ break;
+ case '4':
+ x += 4;
+ break;
+ case '5':
+ x += 5;
+ break;
+ case '6':
+ x += 6;
+ break;
+ case '7':
+ x += 7;
+ break;
+ case '8':
+ x += 8;
+ break;
+ case '9':
+ x += 9;
+ break;
+ case 'a':
+ case 'A':
+ x += 10;
+ break;
+ case 'b':
+ case 'B':
+ x += 11;
+ break;
+ case 'c':
+ case 'C':
+ x += 12;
+ break;
+ case 'd':
+ case 'D':
+ x += 13;
+ break;
+ case 'e':
+ case 'E':
+ x += 14;
+ break;
+ case 'f':
+ case 'F':
+ x += 15;
+ break;
+ default:
+ return 0;
+ };
+ *value = x;
+ return 1;
+}
+
+static int
+parse_bgcolor (const char *bgcolor, unsigned char *red, unsigned char *green,
+ unsigned char *blue)
+{
+/* attempting to parse an RGB color */
+ if (strlen (bgcolor) != 8)
+ return 0;
+ if (bgcolor[0] != '0')
+ return 0;
+ if (bgcolor[1] == 'x' || bgcolor[1] == 'X')
+ ;
+ else
+ return 0;
+ if (!parse_hex (bgcolor[2], bgcolor[3], red))
+ return 0;
+ if (!parse_hex (bgcolor[4], bgcolor[5], green))
+ return 0;
+ if (!parse_hex (bgcolor[6], bgcolor[7], blue))
+ return 0;
+ return 1;
+}
+
+static int
+exists_layer (struct wms_list *list, const char *layer, int srid,
+ int wms_version, int *swap_xy, double minx, double miny,
+ double maxx, double maxy, const char **layer_name)
+{
+/* checking a required layer for validity */
+ struct wms_group *grp;
+ struct wms_layer *lyr = list->first_layer;
+ while (lyr != NULL)
+ {
+ /* searching a genuine Layer */
+ if (strcmp (lyr->layer_name, layer) == 0)
+ {
+ if (lyr->srid != srid)
+ return WMS_MISMATCHING_SRID;
+ if (wms_version == WMS_VERSION_130 && lyr->is_geographic)
+ *swap_xy = 1;
+ else
+ *swap_xy = 0;
+ if (*swap_xy)
+ {
+ if (lyr->minx > maxy)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (lyr->maxx < miny)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (lyr->miny > maxx)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (lyr->maxy < minx)
+ return WMS_LAYER_OUT_OF_BBOX;
+ }
+ else
+ {
+ if (lyr->minx > maxx)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (lyr->maxx < minx)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (lyr->miny > maxy)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (lyr->maxy < miny)
+ return WMS_LAYER_OUT_OF_BBOX;
+ }
+ *layer_name = lyr->layer_name;
+ return 0;
+ }
+ lyr = lyr->next;
+ }
+ grp = list->first_group;
+ while (grp != NULL)
+ {
+ /* fallback case: searching a Group of Layers */
+ if (strcmp (grp->group_name, layer) == 0)
+ {
+ if (grp->valid == 0)
+ return WMS_INVALID_GROUP;
+ if (grp->srid != srid)
+ return WMS_MISMATCHING_SRID;
+ if (wms_version == WMS_VERSION_130 && grp->is_geographic)
+ *swap_xy = 1;
+ else
+ *swap_xy = 0;
+ if (*swap_xy)
+ {
+ if (grp->minx > maxy)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (grp->maxx < miny)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (grp->miny > maxx)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (grp->maxy < minx)
+ return WMS_LAYER_OUT_OF_BBOX;
+ }
+ else
+ {
+ if (grp->minx > maxx)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (grp->maxx < minx)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (grp->miny > maxy)
+ return WMS_LAYER_OUT_OF_BBOX;
+ if (grp->maxy < miny)
+ return WMS_LAYER_OUT_OF_BBOX;
+ }
+ *layer_name = grp->group_name;
+ return 0;
+ }
+ grp = grp->next;
+ }
+ return WMS_NOT_EXISTING_LAYER;
+}
+
+static int
+check_wms_request (struct wms_list *list, struct wms_args *args)
+{
+/* checking for a valid WMS request */
+ struct wms_argument *arg;
+ int wms_version = WMS_VERSION_130;
+ int ok_wms = 0;
+ int ok_version = 0;
+ int is_get_capabilities = 0;
+ int is_get_map = 0;
+ const char *p_layers = NULL;
+ const char *p_srs = NULL;
+ const char *p_bbox = NULL;
+ const char *p_width = NULL;
+ const char *p_height = NULL;
+ const char *p_styles = NULL;
+ const char *p_format = NULL;
+ const char *p_bgcolor = NULL;
+ const char *p_transparent = NULL;
+
+ if (strcasecmp (args->service_name, "GET /wmslite") != 0)
+ return 400;
+ arg = args->first;
+ while (arg != NULL)
+ {
+ if (strcasecmp (arg->arg_name, "SERVICE") == 0)
+ {
+ if (strcasecmp (arg->arg_value, "WMS") == 0)
+ ok_wms = 1;
+ }
+ if (strcasecmp (arg->arg_name, "VERSION") == 0)
+ {
+ wms_version = WMS_VERSION_UNKNOWN;
+ if (strcasecmp (arg->arg_value, "1.3.0") == 0)
+ {
+ wms_version = WMS_VERSION_130;
+ ok_version = 1;
+ }
+ if (strcasecmp (arg->arg_value, "1.1.1") == 0)
+ {
+ wms_version = WMS_VERSION_111;
+ ok_version = 1;
+ }
+ if (strcasecmp (arg->arg_value, "1.1.0") == 0)
+ {
+ wms_version = WMS_VERSION_110;
+ ok_version = 1;
+ }
+ if (strcasecmp (arg->arg_value, "1.0.0") == 0)
+ {
+ wms_version = WMS_VERSION_100;
+ ok_version = 1;
+ }
+ }
+ if (strcasecmp (arg->arg_name, "REQUEST") == 0)
+ {
+ if (strcasecmp (arg->arg_value, "GetCapabilities") == 0)
+ is_get_capabilities = 1;
+ if (strcasecmp (arg->arg_value, "GetMap") == 0)
+ is_get_map = 1;
+ }
+ if (strcasecmp (arg->arg_name, "LAYERS") == 0)
+ p_layers = arg->arg_value;
+ if (strcasecmp (arg->arg_name, "SRS") == 0
+ || strcasecmp (arg->arg_name, "CRS") == 0)
+ p_srs = arg->arg_value;
+ if (strcasecmp (arg->arg_name, "BBOX") == 0)
+ p_bbox = arg->arg_value;
+ if (strcasecmp (arg->arg_name, "WIDTH") == 0)
+ p_width = arg->arg_value;
+ if (strcasecmp (arg->arg_name, "HEIGHT") == 0)
+ p_height = arg->arg_value;
+ if (strcasecmp (arg->arg_name, "STYLES") == 0)
+ p_styles = arg->arg_value;
+ if (strcasecmp (arg->arg_name, "FORMAT") == 0)
+ p_format = arg->arg_value;
+ if (strcasecmp (arg->arg_name, "BGCOLOR") == 0)
+ p_bgcolor = arg->arg_value;
+ if (strcasecmp (arg->arg_name, "TRANSPARENT") == 0)
+ p_transparent = arg->arg_value;
+ arg = arg->next;
+ }
+ if (is_get_capabilities && !is_get_map
+ && wms_version != WMS_VERSION_UNKNOWN)
+ {
+ /* testing for valid GetCapabilities */
+ if (ok_wms)
+ {
+ args->request_type = WMS_GET_CAPABILITIES;
+ args->wms_version = wms_version;
+ return 200;
+ }
+ }
+ if (is_get_map && !is_get_capabilities
+ && wms_version != WMS_VERSION_UNKNOWN)
+ {
+ /* testing for valid GetMap */
+ if (ok_wms && ok_version && p_layers && p_srs && p_bbox && p_width
+ && p_height && p_styles && p_format)
+ {
+ int ret;
+ int srid;
+ const char *layer;
+ const char *layer_name;
+ int swap_xy = 0;
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+ unsigned short width;
+ unsigned short height;
+ char *style = NULL;
+ int format;
+ int transparent = WMS_OPAQUE;
+ unsigned char red = 255;
+ unsigned char green = 255;
+ unsigned char blue = 255;
+ srid = parse_srs (p_srs);
+ if (srid < -1)
+ {
+ args->error = WMS_INVALID_CRS;
+ return 200;
+ }
+ layer = parse_layers (p_layers);
+ if (layer == NULL)
+ {
+ args->error = WMS_INVALID_LAYER;
+ return 200;
+ }
+ if (!parse_bbox (p_bbox, &minx, &miny, &maxx, &maxy))
+ {
+ args->error = WMS_INVALID_BBOX;
+ return 200;
+ }
+ if (!parse_dim (p_width, &width))
+ {
+ args->error = WMS_INVALID_DIMENSION;
+ return 200;
+ }
+ if (!parse_dim (p_height, &height))
+ {
+ args->error = WMS_INVALID_DIMENSION;
+ return 200;
+ }
+ style = parse_style (p_styles);
+ if (style == NULL)
+ {
+ args->error = WMS_INVALID_STYLE;
+ return 200;
+ }
+ args->style = style;
+ format = parse_format (p_format);
+ if (format == WMS_UNKNOWN)
+ {
+ args->error = WMS_INVALID_FORMAT;
+ return 200;
+ }
+ if (p_transparent != NULL)
+ {
+ transparent = parse_transparent (p_transparent);
+ if (transparent == WMS_UNKNOWN)
+ {
+ args->error = WMS_INVALID_TRANSPARENT;
+ return 200;
+ }
+ }
+ args->has_bgcolor = 0;
+ if (p_bgcolor != NULL)
+ {
+ if (!parse_bgcolor (p_bgcolor, &red, &green, &blue))
+ {
+ args->error = WMS_INVALID_BGCOLOR;
+ return 200;
+ }
+ args->has_bgcolor = 1;
+ }
+ ret =
+ exists_layer (list, layer, srid, wms_version, &swap_xy,
+ minx, miny, maxx, maxy, &layer_name);
+ if (ret == WMS_NOT_EXISTING_LAYER || ret == WMS_INVALID_GROUP
+ || ret == WMS_LAYER_OUT_OF_BBOX
+ || ret == WMS_MISMATCHING_SRID)
+ {
+ args->error = ret;
+ return 200;
+ }
+ args->request_type = WMS_GET_MAP;
+ args->wms_version = wms_version;
+ args->layer = layer_name;
+ args->srid = srid;
+ args->swap_xy = swap_xy;
+ if (wms_version == WMS_VERSION_130 && swap_xy)
+ {
+ /* swapping X and Y axis */
+ args->minx = miny;
+ args->miny = minx;
+ args->maxx = maxy;
+ args->maxy = maxx;
+ }
+ else
+ {
+ /* normal XY axis ordering */
+ args->minx = minx;
+ args->miny = miny;
+ args->maxx = maxx;
+ args->maxy = maxy;
+ }
+ args->width = width;
+ args->height = height;
+ args->format = format;
+ args->transparent = transparent;
+ args->red = red;
+ args->green = green;
+ args->blue = blue;
+ }
+ }
+ return 200;
+}
+
+static struct wms_args *
+parse_http_request (const char *http_hdr, char **method, char **url)
+{
+/* attempting to parse an HTTP Request */
+ int ok = 1;
+ int len;
+ struct wms_args *args = NULL;
+ char token[2000];
+ char *out;
+ const char *p;
+ const char *start = strstr (http_hdr, "GET ");
+ const char *end = NULL;
+ *url = NULL;
+ if (start == NULL)
+ ok = 0;
+ if (ok)
+ {
+ end = strstr (start, " HTTP/1.1");
+ if (end == NULL)
+ end = strstr (start, " HTTP/1.0");
+ if (end == NULL)
+ return NULL;
+ }
+
+ if (ok)
+ {
+ *method = malloc (4);
+ strcpy (*method, "GET");
+ len = end - start;
+ len -= 4;
+ len++;
+ *url = malloc (end - start);
+ memcpy (*url, start + 4, len);
+ *(*url + len) = '\0';
+ }
+ else
+ {
+ start = strstr (http_hdr, "POST ");
+ if (start != NULL)
+ {
+ end = strstr (start, " HTTP/1.1");
+ if (end == NULL)
+ end = strstr (start, " HTTP/1.0");
+ if (end == NULL)
+ return NULL;
+ }
+ *method = malloc (5);
+ strcpy (*method, "POST");
+ len = end - start;
+ len -= 5;
+ len++;
+ *url = malloc (end - start);
+ memcpy (*url, start + 5, len);
+ *(*url + len) = '\0';
+ }
+
+ p = start;
+ out = token;
+ while (p < end)
+ {
+ if (*p == '?')
+ {
+ /* the service name */
+ *out = '\0';
+ if (args != NULL)
+ goto error;
+ args = alloc_wms_args (token);
+ out = token;
+ p++;
+ continue;
+ }
+ if (*p == '&')
+ {
+ /* a key-value pair ends here */
+ *out = '\0';
+ if (args == NULL)
+ goto error;
+ if (!add_wms_argument (args, token))
+ goto error;
+ out = token;
+ p++;
+ continue;
+ }
+ *out++ = *p++;
+ }
+ if (out > token)
+ {
+ /* processing the last arg */
+ *out = '\0';
+ if (args == NULL)
+ goto error;
+ if (!add_wms_argument (args, token))
+ goto error;
+ }
+ if (debug_mode)
+ printf ("%s\n", *url);
+ return args;
+
+ error:
+ if (args != NULL)
+ destroy_wms_args (args);
+ return NULL;
+}
+
+static char *
+get_current_timestamp ()
+{
+/* formatting the current timestamp */
+ char *dummy;
+ struct tm *xtm;
+ time_t now;
+ const char *day;
+ const char *month;
+ time (&now);
+ xtm = gmtime (&now);
+ switch (xtm->tm_wday)
+ {
+ case 0:
+ day = "Sun";
+ break;
+ case 1:
+ day = "Mon";
+ break;
+ case 2:
+ day = "Tue";
+ break;
+ case 3:
+ day = "Wed";
+ break;
+ case 4:
+ day = "Thu";
+ break;
+ case 5:
+ day = "Fri";
+ break;
+ case 6:
+ day = "Sat";
+ break;
+ };
+ switch (xtm->tm_mon)
+ {
+ case 0:
+ month = "Jan";
+ break;
+ case 1:
+ month = "Feb";
+ break;
+ case 2:
+ month = "Mar";
+ break;
+ case 3:
+ month = "Apr";
+ break;
+ case 4:
+ month = "May";
+ break;
+ case 5:
+ month = "Jun";
+ break;
+ case 6:
+ month = "Jul";
+ break;
+ case 7:
+ month = "Aug";
+ break;
+ case 8:
+ month = "Sep";
+ break;
+ case 9:
+ month = "Oct";
+ break;
+ case 10:
+ month = "Nov";
+ break;
+ case 11:
+ month = "Dec";
+ break;
+ };
+ dummy =
+ sqlite3_mprintf ("Date: %s, %02d %s %04d %02d:%02d:%02d GMT\r\n", day,
+ xtm->tm_mday, month, xtm->tm_year + 1900, xtm->tm_hour,
+ xtm->tm_min, xtm->tm_sec);
+ return dummy;
+}
+
+static char *
+get_sql_timestamp ()
+{
+/* formatting the current SQL timestamp */
+ char *dummy;
+ struct tm *xtm;
+ time_t now;
+ time (&now);
+ xtm = gmtime (&now);
+ dummy =
+ sqlite3_mprintf ("%04d-%02d-%02dT%02d:%02d:%02d", xtm->tm_year + 1900,
+ xtm->tm_mon + 1, xtm->tm_mday, xtm->tm_hour,
+ xtm->tm_min, xtm->tm_sec);
+ return dummy;
+}
+
+static void
+build_wms_exception (struct wms_args *args, gaiaOutBufferPtr xml_response)
+{
+/* preparing an XML exception */
+ char *dummy;
+ gaiaOutBuffer xml_text;
+ gaiaOutBufferInitialize (&xml_text);
+ gaiaAppendToOutBuffer (&xml_text,
+ "<?xml version='1.0' encoding=\"UTF-8\" standalone=\"no\" ?>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<ServiceExceptionReport version=\"1.3.0\" ");
+ gaiaAppendToOutBuffer (&xml_text, "xmlns=\"http://www.opengis.net/ogc\" ");
+ gaiaAppendToOutBuffer (&xml_text,
+ "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ");
+ gaiaAppendToOutBuffer (&xml_text,
+ "xsi:schemaLocation=\"http://www.opengis.net/ogc ");
+ gaiaAppendToOutBuffer (&xml_text,
+ "http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd\">\r\n");
+ if (args == NULL)
+ {
+ gaiaAppendToOutBuffer (&xml_text, "<ServiceException>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "General error.\r\n");
+ }
+ else
+ {
+ switch (args->error)
+ {
+ case WMS_INVALID_DIMENSION:
+ gaiaAppendToOutBuffer (&xml_text,
+ "<ServiceException code=\"InvalidDimensionValue\">\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "Request is for a Layer not offered by the service instance.\r\n");
+ break;
+ case WMS_INVALID_BBOX:
+ gaiaAppendToOutBuffer (&xml_text, "<ServiceException>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "Invalid BBOX parameter.\r\n");
+ break;
+ case WMS_NOT_EXISTING_LAYER:
+ case WMS_INVALID_GROUP:
+ case WMS_INVALID_LAYER:
+ gaiaAppendToOutBuffer (&xml_text,
+ "<ServiceException code=\"LayerNotDefined\">\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "Request is for a Layer not offered by the service instance.\r\n");
+ break;
+ case WMS_INVALID_BGCOLOR:
+ gaiaAppendToOutBuffer (&xml_text, "<ServiceException>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "Invalid BGCOLOR parameter.\r\n");
+ break;
+ case WMS_INVALID_STYLE:
+ gaiaAppendToOutBuffer (&xml_text,
+ "<ServiceException code=\"StyleNotDefined\">\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "Request is for a Layer in a Style not offered by the service instance.\r\n");
+ break;
+ case WMS_INVALID_FORMAT:
+ gaiaAppendToOutBuffer (&xml_text,
+ "<ServiceException code=\"InvalidFormat\">\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "Request contains a Format not offered by the service instance.\r\n");
+ break;
+ case WMS_INVALID_TRANSPARENT:
+ gaiaAppendToOutBuffer (&xml_text, "<ServiceException>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "Invalid TRANSPARENT parameter.\r\n");
+ break;
+ case WMS_LAYER_OUT_OF_BBOX:
+ gaiaAppendToOutBuffer (&xml_text, "<ServiceException>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "The BBOX parameter is outside the layer's extent.\r\n");
+ break;
+ case WMS_INVALID_CRS:
+ gaiaAppendToOutBuffer (&xml_text,
+ "<ServiceException code=\"InvalidSRS\">\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "Request contains a malformed SRS.\r\n");
+ break;
+ case WMS_MISMATCHING_SRID:
+ gaiaAppendToOutBuffer (&xml_text,
+ "<ServiceException code=\"InvalidSRS\">\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "Request contains an SRS not offered by the service ");
+ gaiaAppendToOutBuffer (&xml_text,
+ "instance for one or more of the Layers in the request.\r\n");
+ break;
+ default:
+ gaiaAppendToOutBuffer (&xml_text, "<ServiceException>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "Malformed request.\r\n");
+ break;
+ }
+ }
+ gaiaAppendToOutBuffer (&xml_text,
+ "</ServiceException>\r\n</ServiceExceptionReport>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "");
+ gaiaAppendToOutBuffer (xml_response, "HTTP/1.1 200 OK\r\n");
+ dummy = get_current_timestamp ();
+ gaiaAppendToOutBuffer (xml_response, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (xml_response,
+ "Content-Type: text/xml;charset=UTF-8\r\n");
+ dummy = sqlite3_mprintf ("Content-Length: %d\r\n", xml_text.WriteOffset);
+ gaiaAppendToOutBuffer (xml_response, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (xml_response, "Connection: close\r\n\r\n");
+ gaiaAppendToOutBuffer (xml_response, xml_text.Buffer);
+ gaiaOutBufferReset (&xml_text);
+}
+
+static void
+build_http_error (int http_status, gaiaOutBufferPtr xml_response, int port_no)
+{
+/* preparing an HTTP error */
+ char *dummy;
+ gaiaOutBuffer http_text;
+ gaiaOutBufferInitialize (&http_text);
+ gaiaAppendToOutBuffer (&http_text,
+ "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n");
+ gaiaAppendToOutBuffer (&http_text, "<html><head>\r\n");
+ if (http_status == 400)
+ {
+ gaiaAppendToOutBuffer (xml_response, "HTTP/1.1 400 Bad Request\r\n");
+ gaiaAppendToOutBuffer (&http_text,
+ "<title>400 Bad Request</title>\r\n");
+ gaiaAppendToOutBuffer (&http_text, "</head><body>\r\n");
+ gaiaAppendToOutBuffer (&http_text, "<h1>Bad Request</h1>\n");
+ }
+ else
+ {
+ gaiaAppendToOutBuffer (xml_response,
+ "HTTP/1.1 500 Internal Server Error\r\n");
+ gaiaAppendToOutBuffer (&http_text,
+ "<title>500 Internal Server Error</title>\r\n");
+ gaiaAppendToOutBuffer (&http_text, "</head><body>\r\n");
+ gaiaAppendToOutBuffer (&http_text,
+ "<h1>Internal Server Error</h1>\n");
+ }
+ dummy =
+ sqlite3_mprintf
+ ("<address>WmsLite/%s [%s] at localhost (127.0.0.1) Port %d</address>\r\n",
+ rl2_version (), rl2_target_cpu (), port_no);
+ gaiaAppendToOutBuffer (&http_text, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (&http_text, "</body></html>\r\n");
+ gaiaAppendToOutBuffer (&http_text, "");
+ dummy = get_current_timestamp ();
+ gaiaAppendToOutBuffer (xml_response, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (xml_response,
+ "Content-Type: text/html;charset=UTF-8\r\n");
+ dummy = sqlite3_mprintf ("Content-Length: %d\r\n", http_text.WriteOffset);
+ gaiaAppendToOutBuffer (xml_response, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (xml_response, "Connection: close\r\n\r\n");
+ gaiaAppendToOutBuffer (xml_response, http_text.Buffer);
+ gaiaOutBufferReset (&http_text);
+}
+
+static void
+build_get_capabilities (struct wms_list *list, char **cached, int *cached_len)
+{
+/* preparing the WMS GetCapabilities XML document */
+ struct wms_layer *lyr;
+ struct wms_group *grp;
+ struct wms_style *style;
+ char *dummy;
+ gaiaOutBuffer xml_text;
+ gaiaOutBufferInitialize (&xml_text);
+ gaiaAppendToOutBuffer (&xml_text,
+ "<?xml version='1.0' encoding=\"UTF-8\" standalone=\"no\" ?>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<WMS_Capabilities version=\"1.3.0\" ");
+ gaiaAppendToOutBuffer (&xml_text, "xmlns=\"http://www.opengis.net/wms\" ");
+ gaiaAppendToOutBuffer (&xml_text,
+ "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ");
+ gaiaAppendToOutBuffer (&xml_text,
+ "xsi:schemaLocation=\"http://www.opengis.net/wms ");
+ gaiaAppendToOutBuffer (&xml_text,
+ "http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd\">\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<Service>\r\n<Name>WMS</Name>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<Title>WmsLite test server</Title>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<Abstract>A simple light-weight WMS server for testing RasterLite2 Coverages.</Abstract>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<KeywordList>\r\n<Keyword>maps</Keyword>\r\n</KeywordList>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<OnlineResource xlink:href=\"http://127.0.0.1:8080/wmslite?\" ");
+ gaiaAppendToOutBuffer (&xml_text,
+ "xlink:type=\"simple\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<ContactInformation>\r\n<ContactPersonPrimary>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<ContactPerson>James T. Kirk</ContactPerson>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<ContactOrganization>United Federation of Planets, Starfleet</ContactOrganization>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "</ContactPersonPrimary>\r\n<ContactPosition>Starship Captain.</ContactPosition>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<ContactAddress>\r\n<AddressType>stellar</AddressType>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<Address>USS Enterprise</Address>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<City>Planet Earth</City>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<StateOrProvince>Solar System</StateOrProvince>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<PostCode>12345#WYZ47NL at 512</PostCode>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<Country>Milky Way Galaxy</Country>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "</ContactAddress>\r\n</ContactInformation>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<Fees>none</Fees>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<AccessConstraints>none</AccessConstraints>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<LayerLimit>1</LayerLimit>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<MaxWidth>5000</MaxWidth>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<MaxHeight>5000</MaxHeight>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "</Service>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<Capability>\r\n<Request>\r\n<GetCapabilities>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<Format>text/xml</Format>\r\n<DCPType>\r\n<HTTP>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<Get><OnlineResource xlink:href=\"http://127.0.0.1:8080/wmslite?\" ");
+ gaiaAppendToOutBuffer (&xml_text,
+ "xlink:type=\"simple\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/></Get>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "</HTTP>\r\n</DCPType>\r\n</GetCapabilities>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<GetMap>\r\n<Format>image/png</Format>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<Format>image/jpeg</Format>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<Format>application/x-pdf</Format>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<Format>image/tiff</Format>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "<DCPType>\r\n<HTTP>\r\n<Get>");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<OnlineResource xlink:href=\"http://127.0.0.1:8080/wmslite?\" ");
+ gaiaAppendToOutBuffer (&xml_text,
+ "xlink:type=\"simple\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"/></Get>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "</HTTP>\r\n</DCPType>\r\n</GetMap>\r\n</Request>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<Exception>\r\n<Format>XML</Format>\r\n</Exception>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<Layer>\r\n<Title>RasterLite2 Coverages</Title>\r\n");
+ gaiaAppendToOutBuffer (&xml_text,
+ "<Abstract>OGC WMS compliant Service</Abstract>\r\n");
+
+/* publishing any valid first-level Layer */
+ lyr = list->first_layer;
+ while (lyr != NULL)
+ {
+ /* available Coverages */
+ if (lyr->valid == 0)
+ {
+ /* skipping any invalid Layer */
+ lyr = lyr->next;
+ continue;
+ }
+ if (lyr->child_layer == 1)
+ {
+ /* skipping any child layer */
+ lyr = lyr->next;
+ continue;
+ }
+ gaiaAppendToOutBuffer (&xml_text,
+ "<Layer queryable=\"0\" opaque=\"0\" cascaded=\"0\">\r\n");
+ dummy = sqlite3_mprintf ("<Name>%s</Name>\r\n", lyr->layer_name);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy = sqlite3_mprintf ("<Title>%s</Title>\r\n", lyr->title);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<Abstract>%s</Abstract>\r\n", lyr->abstract);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy = sqlite3_mprintf ("<CRS>EPSG:%d</CRS>\r\n", lyr->srid);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (&xml_text, "<EX_GeographicBoundingBox>");
+ dummy =
+ sqlite3_mprintf ("<westBoundLongitude>%1.6f</westBoundLongitude>",
+ lyr->geo_minx);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<eastBoundLongitude>%1.6f</eastBoundLongitude>",
+ lyr->geo_maxx);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<southBoundLatitude>%1.6f</southBoundLatitude>",
+ lyr->geo_miny);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<northBoundLatitude>%1.6f</northBoundLatitude>",
+ lyr->geo_maxy);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (&xml_text, "</EX_GeographicBoundingBox>\r\n");
+ if (lyr->is_geographic)
+ dummy = sqlite3_mprintf ("<BoundingBox CRS=\"EPSG:%d\" "
+ "minx=\"%1.6f\" miny=\"%1.6f\" maxx=\"%1.6f\" maxy=\"%1.6f\"/>\r\n",
+ lyr->srid, lyr->miny, lyr->minx,
+ lyr->maxy, lyr->maxx);
+ else
+ dummy = sqlite3_mprintf ("<BoundingBox CRS=\"EPSG:%d\" "
+ "minx=\"%1.6f\" miny=\"%1.6f\" maxx=\"%1.6f\" maxy=\"%1.6f\"/>\r\n",
+ lyr->srid, lyr->minx, lyr->miny,
+ lyr->maxx, lyr->maxy);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ style = lyr->first_style;
+ while (style != NULL)
+ {
+ if (style->valid == 0)
+ {
+ style = style->next;
+ continue;
+ }
+ dummy =
+ sqlite3_mprintf ("<Style>\r\n<Name>%s</Name>\r\n",
+ style->name);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<Title>%s</Title>\r\n",
+ (style->title ==
+ NULL) ? style->name : style->title);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ if (style->abstract != NULL)
+ {
+ dummy =
+ sqlite3_mprintf ("<Abstract>%s</Abstract>\r\n",
+ style->abstract);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ }
+ gaiaAppendToOutBuffer (&xml_text, "</Style>\r\n");
+ style = style->next;
+ }
+ gaiaAppendToOutBuffer (&xml_text, "</Layer>\r\n");
+ lyr = lyr->next;
+ }
+
+/* publishing any valid Layer Group */
+ grp = list->first_group;
+ while (grp != NULL)
+ {
+ /* available Groups */
+ struct wms_layer_ref *ref;
+ if (grp->valid == 0)
+ {
+ /* skipping any invalid Layer */
+ grp = grp->next;
+ continue;
+ }
+ gaiaAppendToOutBuffer (&xml_text,
+ "<Layer queryable=\"0\" opaque=\"0\" cascaded=\"0\">\r\n");
+ dummy = sqlite3_mprintf ("<Name>%s</Name>\r\n", grp->group_name);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy = sqlite3_mprintf ("<Title>%s</Title>\r\n", grp->title);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<Abstract>%s</Abstract>\r\n", grp->abstract);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy = sqlite3_mprintf ("<CRS>EPSG:%d</CRS>\r\n", grp->srid);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (&xml_text, "<EX_GeographicBoundingBox>");
+ dummy =
+ sqlite3_mprintf ("<westBoundLongitude>%1.6f</westBoundLongitude>",
+ grp->geo_minx);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<eastBoundLongitude>%1.6f</eastBoundLongitude>",
+ grp->geo_maxx);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<southBoundLatitude>%1.6f</southBoundLatitude>",
+ grp->geo_miny);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<northBoundLatitude>%1.6f</northBoundLatitude>",
+ grp->geo_maxy);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (&xml_text, "</EX_GeographicBoundingBox>\r\n");
+ if (grp->is_geographic)
+ dummy = sqlite3_mprintf ("<BoundingBox CRS=\"EPSG:%d\" "
+ "minx=\"%1.6f\" miny=\"%1.6f\" maxx=\"%1.6f\" maxy=\"%1.6f\"/>\r\n",
+ grp->srid, grp->miny, grp->minx,
+ grp->maxy, grp->maxx);
+ else
+ dummy = sqlite3_mprintf ("<BoundingBox CRS=\"EPSG:%d\" "
+ "minx=\"%1.6f\" miny=\"%1.6f\" maxx=\"%1.6f\" maxy=\"%1.6f\"/>\r\n",
+ grp->srid, grp->minx, grp->miny,
+ grp->maxx, grp->maxy);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ style = grp->first_style;
+ while (style != NULL)
+ {
+ if (style->valid == 0)
+ {
+ style = style->next;
+ continue;
+ }
+ dummy =
+ sqlite3_mprintf ("<Style>\r\n<Name>%s</Name>\r\n",
+ style->name);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<Title>%s</Title>\r\n",
+ (style->title ==
+ NULL) ? style->name : style->title);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ if (style->abstract != NULL)
+ {
+ dummy =
+ sqlite3_mprintf ("<Abstract>%s</Abstract>\r\n",
+ style->abstract);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ }
+ gaiaAppendToOutBuffer (&xml_text, "</Style>\r\n");
+ style = style->next;
+ }
+ /* publishing all valid children Layers */
+ ref = grp->first_child;
+ while (ref != NULL)
+ {
+ /* available Coverages */
+ if (ref->layer_ref->valid == 0)
+ {
+ /* skipping any invalid Child */
+ ref = ref->next;
+ continue;
+ }
+ lyr = ref->layer_ref;
+ gaiaAppendToOutBuffer (&xml_text,
+ "<Layer queryable=\"0\" opaque=\"0\" cascaded=\"0\">\r\n");
+ dummy =
+ sqlite3_mprintf ("<Name>%s</Name>\r\n", lyr->layer_name);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy = sqlite3_mprintf ("<Title>%s</Title>\r\n", lyr->title);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<Abstract>%s</Abstract>\r\n",
+ lyr->abstract);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy = sqlite3_mprintf ("<CRS>EPSG:%d</CRS>\r\n", lyr->srid);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (&xml_text, "<EX_GeographicBoundingBox>");
+ dummy =
+ sqlite3_mprintf
+ ("<westBoundLongitude>%1.6f</westBoundLongitude>",
+ lyr->geo_minx);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf
+ ("<eastBoundLongitude>%1.6f</eastBoundLongitude>",
+ lyr->geo_maxx);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf
+ ("<southBoundLatitude>%1.6f</southBoundLatitude>",
+ lyr->geo_miny);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf
+ ("<northBoundLatitude>%1.6f</northBoundLatitude>",
+ lyr->geo_maxy);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (&xml_text,
+ "</EX_GeographicBoundingBox>\r\n");
+ if (lyr->is_geographic)
+ dummy = sqlite3_mprintf ("<BoundingBox CRS=\"EPSG:%d\" "
+ "minx=\"%1.6f\" miny=\"%1.6f\" maxx=\"%1.6f\" maxy=\"%1.6f\"/>\r\n",
+ lyr->srid, lyr->miny, lyr->minx,
+ lyr->maxy, lyr->maxx);
+ else
+ dummy = sqlite3_mprintf ("<BoundingBox CRS=\"EPSG:%d\" "
+ "minx=\"%1.6f\" miny=\"%1.6f\" maxx=\"%1.6f\" maxy=\"%1.6f\"/>\r\n",
+ lyr->srid, lyr->minx, lyr->miny,
+ lyr->maxx, lyr->maxy);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ style = lyr->first_style;
+ while (style != NULL)
+ {
+ if (style->valid == 0)
+ {
+ style = style->next;
+ continue;
+ }
+ dummy =
+ sqlite3_mprintf ("<Style>\r\n<Name>%s</Name>\r\n",
+ style->name);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ dummy =
+ sqlite3_mprintf ("<Title>%s</Title>\r\n",
+ (style->title ==
+ NULL) ? style->name : style->title);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ if (style->abstract != NULL)
+ {
+ dummy =
+ sqlite3_mprintf ("<Abstract>%s</Abstract>\r\n",
+ style->abstract);
+ gaiaAppendToOutBuffer (&xml_text, dummy);
+ sqlite3_free (dummy);
+ }
+ gaiaAppendToOutBuffer (&xml_text, "</Style>\r\n");
+ style = style->next;
+ }
+ gaiaAppendToOutBuffer (&xml_text, "</Layer>\r\n");
+ ref = ref->next;
+ }
+ gaiaAppendToOutBuffer (&xml_text, "</Layer>\r\n");
+ grp = grp->next;
+ }
+
+ gaiaAppendToOutBuffer (&xml_text,
+ "</Layer>\r\n</Capability>\r\n</WMS_Capabilities>\r\n");
+ gaiaAppendToOutBuffer (&xml_text, "");
+ *cached = xml_text.Buffer;
+ *cached_len = xml_text.WriteOffset;
+ xml_text.Buffer = NULL;
+ gaiaOutBufferReset (&xml_text);
+}
+
+static int
+get_xml_bytes (gaiaOutBufferPtr xml_response, int curr, int block_sz)
+{
+/* determining how many bytes will be sent on the output socket */
+ int wr = block_sz;
+ if (xml_response->Buffer == NULL || xml_response->Error)
+ return 0;
+ if (curr + wr > xml_response->WriteOffset)
+ wr = xml_response->WriteOffset - curr;
+ return wr;
+}
+
+static int
+get_payload_bytes (int total, int curr, int block_sz)
+{
+/* determining how many bytes will be sent on the output socket */
+ int wr = block_sz;
+ if (curr + wr > total)
+ wr = total - curr;
+ return wr;
+}
+
+static void
+#ifdef _WIN32
+wms_get_capabilities (SOCKET socket, const char *cached,
+ int cached_len, struct server_log_item *log)
+#else
+wms_get_capabilities (int socket, const char *cached,
+ int cached_len, struct server_log_item *log)
+#endif
+{
+/* preparing the WMS GetCapabilities XML document */
+ gaiaOutBuffer xml_response;
+ char *dummy;
+ int curr;
+ int rd;
+ int wr;
+
+ gaiaOutBufferInitialize (&xml_response);
+ gaiaAppendToOutBuffer (&xml_response, "HTTP/1.1 200 OK\r\n");
+ dummy = get_current_timestamp ();
+ gaiaAppendToOutBuffer (&xml_response, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (&xml_response,
+ "Content-Type: text/xml;charset=UTF-8\r\n");
+ dummy = sqlite3_mprintf ("Content-Length: %d\r\n", cached_len);
+ gaiaAppendToOutBuffer (&xml_response, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (&xml_response, "Connection: close\r\n\r\n");
+ gaiaAppendToOutBuffer (&xml_response, cached);
+
+/* uploading the HTTP response */
+ curr = 0;
+ while (1)
+ {
+ rd = get_xml_bytes (&xml_response, curr, SEND_BLOK_SZ);
+ if (rd == 0)
+ break;
+ wr = send (socket, xml_response.Buffer + curr, rd, 0);
+ if (wr < 0)
+ break;
+ curr += wr;
+ }
+ log_get_capabilities_2 (log, xml_response.WriteOffset);
+ gaiaOutBufferReset (&xml_response);
+}
+
+static void
+#ifdef _WIN32
+wms_get_map (struct wms_args *args, SOCKET socket, struct server_log_item *log)
+#else
+wms_get_map (struct wms_args *args, int socket, struct server_log_item *log)
+#endif
+{
+/* preparing the WMS GetMap payload */
+ int ret;
+ char *dummy;
+ int curr;
+ int rd;
+ int wr;
+ int save_sz;
+ sqlite3_stmt *stmt = NULL;
+ gaiaOutBuffer http_response;
+ unsigned char *payload;
+ int payload_size;
+ unsigned char *black;
+ int black_sz;
+ char bgcolor[16];
+
+ stmt = args->stmt_get_map;
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_text (stmt, 1, args->layer, strlen (args->layer),
+ SQLITE_STATIC);
+ sqlite3_bind_double (stmt, 2, args->minx);
+ sqlite3_bind_double (stmt, 3, args->miny);
+ sqlite3_bind_double (stmt, 4, args->maxx);
+ sqlite3_bind_double (stmt, 5, args->maxy);
+ sqlite3_bind_int (stmt, 6, args->width);
+ sqlite3_bind_int (stmt, 7, args->height);
+ sqlite3_bind_text (stmt, 8, args->style, strlen (args->style),
+ SQLITE_STATIC);
+ if (args->format == RL2_OUTPUT_FORMAT_TIFF)
+ sqlite3_bind_text (stmt, 9, "image/tiff", strlen ("image/tiff"),
+ SQLITE_TRANSIENT);
+ else if (args->format == RL2_OUTPUT_FORMAT_PDF)
+ sqlite3_bind_text (stmt, 9, "application/x-pdf",
+ strlen ("application/x-pdf"), SQLITE_TRANSIENT);
+ else if (args->format == RL2_OUTPUT_FORMAT_JPEG)
+ sqlite3_bind_text (stmt, 9, "image/jpeg", strlen ("image/jpeg"),
+ SQLITE_TRANSIENT);
+ else
+ sqlite3_bind_text (stmt, 9, "image/png", strlen ("image/png"),
+ SQLITE_TRANSIENT);
+ if (args->has_bgcolor)
+ sprintf (bgcolor, "#%02x%02x%02x", args->red, args->green, args->blue);
+ else
+ strcpy (bgcolor, "#ffffff");
+ sqlite3_bind_text (stmt, 10, bgcolor, strlen (bgcolor), SQLITE_TRANSIENT);
+ sqlite3_bind_int (stmt, 11, args->transparent);
+ if (args->format == RL2_OUTPUT_FORMAT_JPEG)
+ sqlite3_bind_int (stmt, 12, 80);
+ else
+ sqlite3_bind_int (stmt, 12, 100);
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ if (sqlite3_column_type (stmt, 0) == SQLITE_BLOB)
+ {
+ payload = (unsigned char *) sqlite3_column_blob (stmt, 0);
+ payload_size = sqlite3_column_bytes (stmt, 0);
+ /* preparing the HTTP response */
+ gaiaOutBufferInitialize (&http_response);
+ gaiaAppendToOutBuffer (&http_response,
+ "HTTP/1.1 200 OK\r\n");
+ dummy = get_current_timestamp ();
+ gaiaAppendToOutBuffer (&http_response, dummy);
+ sqlite3_free (dummy);
+ if (args->format == RL2_OUTPUT_FORMAT_JPEG)
+ gaiaAppendToOutBuffer (&http_response,
+ "Content-Type: image/jpeg\r\n");
+ if (args->format == RL2_OUTPUT_FORMAT_PNG)
+ gaiaAppendToOutBuffer (&http_response,
+ "Content-Type: image/png\r\n");
+ if (args->format == RL2_OUTPUT_FORMAT_TIFF)
+ gaiaAppendToOutBuffer (&http_response,
+ "Content-Type: image/tiff\r\n");
+ if (args->format == RL2_OUTPUT_FORMAT_PDF)
+ gaiaAppendToOutBuffer (&http_response,
+ "Content-Type: application/x-pdf\r\n");
+ dummy =
+ sqlite3_mprintf ("Content-Length: %d\r\n",
+ payload_size);
+ gaiaAppendToOutBuffer (&http_response, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (&http_response,
+ "Connection: close\r\n\r\n");
+ /* uploading the HTTP response header */
+ curr = 0;
+ while (1)
+ {
+ rd = get_xml_bytes (&http_response, curr,
+ SEND_BLOK_SZ);
+ if (rd == 0)
+ break;
+ wr = send (socket, http_response.Buffer + curr, rd,
+ 0);
+ if (wr < 0)
+ break;
+ curr += wr;
+ }
+ save_sz = http_response.WriteOffset;
+ gaiaOutBufferReset (&http_response);
+ /* uploading the image payload */
+ curr = 0;
+ while (1)
+ {
+ rd = get_payload_bytes (payload_size, curr,
+ SEND_BLOK_SZ);
+ if (rd == 0)
+ break;
+ wr = send (socket, payload + curr, rd, 0);
+ if (wr < 0)
+ break;
+ curr += wr;
+ }
+ log_get_map_2 (log, save_sz + payload_size);
+ return;
+ }
+ }
+ }
+
+/* preparing a default black image */
+ black_sz = args->width * args->height;
+ black = malloc (black_sz);
+ memset (black, 0, black_sz);
+ if (args->format == RL2_OUTPUT_FORMAT_JPEG)
+ rl2_gray_to_jpeg (args->width, args->height, black, 80, &payload,
+ &payload_size);
+ if (args->format == RL2_OUTPUT_FORMAT_PNG)
+ rl2_gray_to_png (args->width, args->height, black, &payload,
+ &payload_size);
+ if (args->format == RL2_OUTPUT_FORMAT_TIFF)
+ rl2_gray_to_tiff (args->width, args->height, black, &payload,
+ &payload_size);
+ if (args->format == RL2_OUTPUT_FORMAT_PDF)
+ rl2_gray_pdf (args->width, args->height, &payload, &payload_size);
+ free (black);
+ /* preparing the HTTP response */
+ gaiaOutBufferInitialize (&http_response);
+ gaiaAppendToOutBuffer (&http_response, "HTTP/1.1 200 OK\r\n");
+ dummy = get_current_timestamp ();
+ gaiaAppendToOutBuffer (&http_response, dummy);
+ sqlite3_free (dummy);
+ if (args->format == RL2_OUTPUT_FORMAT_JPEG)
+ gaiaAppendToOutBuffer (&http_response, "Content-Type: image/jpeg\r\n");
+ if (args->format == RL2_OUTPUT_FORMAT_PNG)
+ gaiaAppendToOutBuffer (&http_response, "Content-Type: image/png\r\n");
+ if (args->format == RL2_OUTPUT_FORMAT_TIFF)
+ gaiaAppendToOutBuffer (&http_response, "Content-Type: image/tiff\r\n");
+ if (args->format == RL2_OUTPUT_FORMAT_TIFF)
+ gaiaAppendToOutBuffer (&http_response,
+ "Content-Type: application/x-pdf\r\n");
+ dummy = sqlite3_mprintf ("Content-Length: %d\r\n", payload_size);
+ gaiaAppendToOutBuffer (&http_response, dummy);
+ sqlite3_free (dummy);
+ gaiaAppendToOutBuffer (&http_response, "Connection: close\r\n\r\n");
+ /* uploading the HTTP response header */
+ curr = 0;
+ while (1)
+ {
+ rd = get_xml_bytes (&http_response, curr, SEND_BLOK_SZ);
+ if (rd == 0)
+ break;
+ wr = send (socket, http_response.Buffer + curr, rd, 0);
+ if (wr < 0)
+ break;
+ curr += wr;
+ }
+ save_sz = http_response.WriteOffset;
+ gaiaOutBufferReset (&http_response);
+ /* uploading the image payload */
+ curr = 0;
+ while (1)
+ {
+ rd = get_payload_bytes (payload_size, curr, SEND_BLOK_SZ);
+ if (rd == 0)
+ break;
+ wr = send (socket, payload + curr, rd, 0);
+ if (wr < 0)
+ break;
+ curr += wr;
+ }
+ free (payload);
+ log_get_map_2 (log, save_sz + payload_size);
+}
+
+#ifdef _WIN32
+/* Winsockets - some king of Windows */
+static void
+win32_http_request (void *data)
+{
+/* Processing an incoming HTTP request */
+ gaiaOutBuffer xml_response;
+ struct http_request *req = (struct http_request *) data;
+ struct wms_args *args = NULL;
+ int curr;
+ int rd;
+ int wr;
+ char *ptr;
+ char http_hdr[2000]; /* The HTTP request header */
+ int http_status;
+ char *method = NULL;
+ char *url = NULL;
+ char *timestamp = get_sql_timestamp ();
+
+ curr = 0;
+ while ((unsigned int) curr < sizeof (http_hdr))
+ {
+ rd = recv (req->socket, &http_hdr[curr], sizeof (http_hdr) - 1 - curr,
+ 0);
+ if (rd == SOCKET_ERROR)
+ goto end_request;
+ if (rd == 0)
+ break;
+ curr += rd;
+ http_hdr[curr] = '\0';
+ ptr = strstr (http_hdr, "\r\n\r\n");
+ if (ptr)
+ break;
+ }
+ if ((unsigned int) curr >= sizeof (http_hdr))
+ {
+ http_status = 400;
+ goto http_error;
+ }
+
+ args = parse_http_request (http_hdr, &method, &url);
+ if (args == NULL)
+ {
+ http_status = 400;
+ goto http_error;
+ }
+
+ http_status = check_wms_request (req->list, args);
+ if (http_status != 200)
+ goto http_error;
+ if (args->request_type == WMS_ILLEGAL_REQUEST)
+ goto illegal_request;
+ if (args->request_type == WMS_GET_CAPABILITIES)
+ {
+ /* preparing the XML WMS GetCapabilities */
+ log_get_capabilities_1 (req->log, timestamp, http_status, method,
+ url);
+ wms_get_capabilities (req->socket, req->cached_capabilities,
+ req->cached_capabilities_len, req->log);
+ }
+ if (args->request_type == WMS_GET_MAP)
+ {
+ /* preparing the WMS GetMap payload */
+ args->db_handle = req->conn->handle;
+ args->stmt_get_map = req->conn->stmt_get_map;
+ log_get_map_1 (req->log, timestamp, http_status, method, url, args);
+ wms_get_map (args, req->socket, req->log);
+ }
+ goto end_request;
+
+/* preparing an HTTP error code */
+ http_error:
+ gaiaOutBufferInitialize (&xml_response);
+ build_http_error (http_status, &xml_response, req->port_no);
+ curr = 0;
+ while (1)
+ {
+ rd = get_xml_bytes (&xml_response, curr, SEND_BLOK_SZ);
+ if (rd == 0)
+ break;
+ send (req->socket, xml_response.Buffer + curr, rd, 0);
+ curr += rd;
+ }
+ log_error (req->log, timestamp, http_status, method, url,
+ xml_response.WriteOffset);
+ gaiaOutBufferReset (&xml_response);
+ goto end_request;
+
+/* preparing an XML WMS Exception message */
+ illegal_request:
+ gaiaOutBufferInitialize (&xml_response);
+ build_wms_exception (args, &xml_response);
+ curr = 0;
+ while (1)
+ {
+ rd = get_xml_bytes (&xml_response, curr, SEND_BLOK_SZ);
+ if (rd == 0)
+ break;
+ send (req->socket, xml_response.Buffer + curr, rd, 0);
+ curr += rd;
+ }
+ log_error (req->log, timestamp, http_status, method, url,
+ xml_response.WriteOffset);
+ gaiaOutBufferReset (&xml_response);
+
+ end_request:
+ if (args != NULL)
+ destroy_wms_args (args);
+ closesocket (req->socket);
+ req->conn->status = CONNECTION_AVAILABLE;
+ free (req);
+}
+#else
+/* standard Berkeley Sockets - may be Linux or *nix */
+static void *
+berkeley_http_request (void *data)
+{
+/* Processing an incoming HTTP request */
+ gaiaOutBuffer xml_response;
+ struct http_request *req = (struct http_request *) data;
+ struct wms_args *args = NULL;
+ int curr;
+ int rd;
+ char *ptr;
+ char http_hdr[2000]; /* The HTTP request header */
+ int http_status;
+ char *method = NULL;
+ char *url = NULL;
+ char *timestamp = get_sql_timestamp ();
+
+ curr = 0;
+ while ((unsigned int) curr < sizeof (http_hdr))
+ {
+ rd = recv (req->socket, &http_hdr[curr], sizeof (http_hdr) - 1 - curr,
+ 0);
+ if (rd == -1)
+ goto end_request;
+ if (rd == 0)
+ break;
+ curr += rd;
+ http_hdr[curr] = '\0';
+ ptr = strstr (http_hdr, "\r\n\r\n");
+ if (ptr)
+ break;
+ }
+ if ((unsigned int) curr >= sizeof (http_hdr))
+ {
+ http_status = 400;
+ goto http_error;
+ }
+
+ args = parse_http_request (http_hdr, &method, &url);
+ if (args == NULL)
+ {
+ http_status = 400;
+ goto http_error;
+ }
+
+ http_status = check_wms_request (req->list, args);
+ if (http_status != 200)
+ goto http_error;
+ if (args->request_type == WMS_ILLEGAL_REQUEST)
+ goto illegal_request;
+ if (args->request_type == WMS_GET_CAPABILITIES)
+ {
+ /* uploading the XML WMS GetCapabilities */
+ log_get_capabilities_1 (req->log, timestamp, http_status, method,
+ url);
+ wms_get_capabilities (req->socket, req->cached_capabilities,
+ req->cached_capabilities_len, req->log);
+ }
+ if (args->request_type == WMS_GET_MAP)
+ {
+ /* preparing the WMS GetMap payload */
+ args->db_handle = req->conn->handle;
+ args->stmt_get_map = req->conn->stmt_get_map;
+ log_get_map_1 (req->log, timestamp, http_status, method, url, args);
+ wms_get_map (args, req->socket, req->log);
+ }
+ goto end_request;
+
+/* preparing an HTTP error code */
+ http_error:
+ gaiaOutBufferInitialize (&xml_response);
+ build_http_error (http_status, &xml_response, req->port_no);
+ curr = 0;
+ while (1)
+ {
+ rd = get_xml_bytes (&xml_response, curr, SEND_BLOK_SZ);
+ if (rd == 0)
+ break;
+ send (req->socket, xml_response.Buffer + curr, rd, 0);
+ curr += rd;
+ }
+ log_error (req->log, timestamp, http_status, method, url,
+ xml_response.WriteOffset);
+ gaiaOutBufferReset (&xml_response);
+ goto end_request;
+
+/* preparing an XML WMS Exception message */
+ illegal_request:
+ gaiaOutBufferInitialize (&xml_response);
+ build_wms_exception (args, &xml_response);
+ curr = 0;
+ while (1)
+ {
+ rd = get_xml_bytes (&xml_response, curr, SEND_BLOK_SZ);
+ if (rd == 0)
+ break;
+ send (req->socket, xml_response.Buffer + curr, rd, 0);
+ curr += rd;
+ }
+ log_error (req->log, timestamp, http_status, method, url,
+ xml_response.WriteOffset);
+ gaiaOutBufferReset (&xml_response);
+
+ end_request:
+ if (args != NULL)
+ destroy_wms_args (args);
+ close (req->socket);
+ req->conn->status = CONNECTION_AVAILABLE;
+ free (req);
+ pthread_exit (NULL);
+}
+#endif
+
+static void
+do_accept_loop (struct neutral_socket *skt, struct wms_list *list, int port_no,
+ sqlite3 * db_handle, sqlite3_stmt * stmt_log,
+ struct connections_pool *pool, struct server_log *log,
+ char *cached_capab, int cached_capab_len)
+{
+/* implementing the ACCEPT loop */
+ unsigned int id = 0;
+ struct read_connection *conn;
+ int ic;
+ time_t diff;
+ time_t now;
+ char *ip_addr;
+ char *ip_addr2;
+#ifdef _WIN32
+ SOCKET socket = skt->socket;
+ SOCKET client;
+ SOCKADDR_IN client_addr;
+ int len = sizeof (client_addr);
+ int wsaError;
+ struct http_request *req;
+
+ while (1)
+ {
+ /* never ending loop */
+ client = accept (socket, (struct sockaddr *) &client_addr, &len);
+ if (client == INVALID_SOCKET)
+ {
+ wsaError = WSAGetLastError ();
+ if (wsaError == WSAEINTR || wsaError == WSAENOTSOCK)
+ {
+ WSACleanup ();
+ fprintf (stderr, "accept error: %d\n", wsaError);
+ return;
+ }
+ else
+ {
+ closesocket (socket);
+ WSACleanup ();
+ fprintf (stderr, "error from accept()\n");
+ return;
+ }
+ }
+ req = malloc (sizeof (struct http_request));
+ req->id = id++;
+ req->port_no = port_no;
+ req->socket = client;
+ req->list = list;
+ req->cached_capabilities = cached_capab;
+ req->cached_capabilities_len = cached_capab_len;
+ while (1)
+ {
+ /* looping until an available read connection is found */
+ for (ic = 0; ic < MAX_CONN; ic++)
+ {
+ /* selecting an available connection (if any) */
+ struct read_connection *ptr = &(pool->connections[ic]);
+ if (ptr->status == CONNECTION_AVAILABLE)
+ {
+ conn = ptr;
+ conn->status = CONNECTION_BUSY;
+ goto conn_found;
+ }
+ }
+ Sleep (50);
+ }
+ conn_found:
+ req->conn = conn;
+ req->log_handle = db_handle;
+ time (&now);
+ diff = now - log->last_update;
+ if (log->next_item < MAX_LOG && diff < 30)
+ {
+ /* reserving a free log slot */
+ req->log = &(log->items[log->next_item++]);
+ req->log->status = LOG_SLOT_BUSY;
+ ip_addr = inet_ntoa (client_addr.sin_addr);
+ ip_addr2 = NULL;
+ if (ip_addr != NULL)
+ {
+ int len = strlen (ip_addr);
+ ip_addr2 = malloc (len + 1);
+ strcpy (ip_addr2, ip_addr);
+ }
+ req->log->client_ip_addr = ip_addr2;
+ req->log->client_ip_port = client_addr.sin_port;
+ gettimeofday (&(req->log->begin_time), NULL);
+ }
+ else
+ {
+ /* flushing the log */
+ flush_log (db_handle, stmt_log, log);
+ /* reserving a free log slot */
+ req->log = &(log->items[log->next_item++]);
+ req->log->status = LOG_SLOT_BUSY;
+ ip_addr = inet_ntoa (client_addr.sin_addr);
+ ip_addr2 = NULL;
+ if (ip_addr != NULL)
+ {
+ int len = strlen (ip_addr);
+ ip_addr2 = malloc (len + 1);
+ strcpy (ip_addr2, ip_addr);
+ }
+ req->log->client_ip_addr = ip_addr2;
+ req->log->client_ip_port = client_addr.sin_port;
+ gettimeofday (&(req->log->begin_time), NULL);
+ }
+ _beginthread (win32_http_request, 0, (void *) req);
+ }
+ return;
+#else
+ pthread_t thread_id;
+ int socket = skt->socket;
+ int client;
+ struct sockaddr_in client_addr;
+ socklen_t len = sizeof (struct sockaddr_in);
+ struct http_request *req;
+
+ while (1)
+ {
+ /* never ending loop */
+ client = accept (socket, (struct sockaddr *) &client_addr, &len);
+ if (client == -1)
+ {
+ close (socket);
+ fprintf (stderr, "error from accept()\n");
+ return;
+ }
+ req = malloc (sizeof (struct http_request));
+ req->id = id++;
+ req->port_no = port_no;
+ req->socket = client;
+ req->list = list;
+ req->cached_capabilities = cached_capab;
+ req->cached_capabilities_len = cached_capab_len;
+ while (1)
+ {
+ /* looping until an available read connection is found */
+ for (ic = 0; ic < MAX_CONN; ic++)
+ {
+ /* selecting an available connection (if any) */
+ struct read_connection *ptr = &(pool->connections[ic]);
+ if (ptr->status == CONNECTION_AVAILABLE)
+ {
+ conn = ptr;
+ conn->status = CONNECTION_BUSY;
+ goto conn_found;
+ }
+ }
+ usleep (50);
+ }
+ conn_found:
+ req->conn = conn;
+ req->log_handle = db_handle;
+ time (&now);
+ diff = now - log->last_update;
+ if (log->next_item < MAX_LOG && diff < 30)
+ {
+ /* reserving a free log slot */
+ req->log = &(log->items[log->next_item++]);
+ req->log->status = LOG_SLOT_BUSY;
+ ip_addr = inet_ntoa (client_addr.sin_addr);
+ ip_addr2 = NULL;
+ if (ip_addr != NULL)
+ {
+ int len = strlen (ip_addr);
+ ip_addr2 = malloc (len + 1);
+ strcpy (ip_addr2, ip_addr);
+ }
+ req->log->client_ip_addr = ip_addr2;
+ req->log->client_ip_port = client_addr.sin_port;
+ gettimeofday (&(req->log->begin_time), NULL);
+ }
+ else
+ {
+ /* flushing the log */
+ flush_log (db_handle, stmt_log, log);
+ /* reserving a free log slot */
+ req->log = &(log->items[log->next_item++]);
+ req->log->status = LOG_SLOT_BUSY;
+ ip_addr = inet_ntoa (client_addr.sin_addr);
+ ip_addr2 = NULL;
+ if (ip_addr != NULL)
+ {
+ int len = strlen (ip_addr);
+ ip_addr2 = malloc (len + 1);
+ strcpy (ip_addr2, ip_addr);
+ }
+ req->log->client_ip_addr = ip_addr2;
+ req->log->client_ip_port = client_addr.sin_port;
+ gettimeofday (&(req->log->begin_time), NULL);
+ }
+ pthread_create (&thread_id, NULL, berkeley_http_request,
+ (void *) req);
+ }
+#endif
+}
+
+static int
+do_start_http (int port_no, struct neutral_socket *srv_skt)
+{
+/* starting the HTTP server */
+#ifdef _WIN32
+/* Winsockets */
+ WSADATA wd;
+ SOCKET skt = INVALID_SOCKET;
+ SOCKADDR_IN addr;
+
+ if (WSAStartup (MAKEWORD (1, 1), &wd))
+ {
+ fprintf (stderr, "unable to initialize winsock\n");
+ return 0;
+ }
+ skt = socket (AF_INET, SOCK_STREAM, 0);
+ if (skt == INVALID_SOCKET)
+ {
+ fprintf (stderr, "unable to create a socket\n");
+ return 0;
+ }
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons (port_no);
+ addr.sin_addr.s_addr = inet_addr ("127.0.0.1");
+ if (bind (skt, (struct sockaddr *) &addr, sizeof (addr)) == SOCKET_ERROR)
+ {
+ fprintf (stderr, "unable to bind the socket\n");
+ closesocket (skt);
+ return 0;
+ }
+ if (listen (skt, SOMAXCONN) == SOCKET_ERROR)
+ {
+ fprintf (stderr, "unable to listen on the socket\n");
+ closesocket (skt);
+ return 0;
+ }
+ srv_skt->socket = skt;
+#else
+/* standard Berkeley sockets */
+ int skt = -1;
+ struct sockaddr_in addr;
+
+ skt = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
+ if (skt == -1)
+ {
+ fprintf (stderr, "unable to create a socket\n");
+ return 0;
+ }
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons (port_no);
+ addr.sin_addr.s_addr = htonl (INADDR_ANY);
+ if (bind (skt, (struct sockaddr *) &addr, sizeof (addr)) == -1)
+ {
+ fprintf (stderr, "unable to bind the socket\n");
+ close (skt);
+ return 0;
+ }
+ if (listen (skt, SOMAXCONN) == -1)
+ {
+ fprintf (stderr, "unable to listen on the socket\n");
+ close (skt);
+ return 0;
+ }
+ srv_skt->socket = skt;
+#endif
+ fprintf (stderr,
+ "======================================================\n");
+ fprintf (stderr, " HTTP micro-server listening on port: %d\n", port_no);
+ fprintf (stderr,
+ "======================================================\n");
+ return 1;
+}
+
+static int
+get_geographic_extent (sqlite3 * handle, struct wms_layer *lyr)
+{
+/* computing the Geographic Bounding Box for some WMS layer */
+ int retcode = 0;
+ const char *sql;
+ sqlite3_stmt *stmt = NULL;
+ int ret;
+ sql = "SELECT MbrMinX(g.g), MbrMinY(g.g), MbrMaxX(g.g), MbrMaxY(g.g) "
+ "FROM (SELECT ST_Transform(BuildMbr(?, ?, ?, ?, ?), 4326) AS g) AS g";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ {
+ lyr->geo_minx = -180.0;
+ lyr->geo_miny = -90.0;
+ lyr->geo_maxx = 180.0;
+ lyr->geo_maxy = 90.0;
+ return 0;
+ }
+ sqlite3_reset (stmt);
+ sqlite3_clear_bindings (stmt);
+ sqlite3_bind_double (stmt, 1, lyr->minx);
+ sqlite3_bind_double (stmt, 2, lyr->miny);
+ sqlite3_bind_double (stmt, 3, lyr->maxx);
+ sqlite3_bind_double (stmt, 4, lyr->maxy);
+ sqlite3_bind_int (stmt, 5, lyr->srid);
+ while (1)
+ {
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break;
+ if (ret == SQLITE_ROW)
+ {
+ lyr->geo_minx = sqlite3_column_double (stmt, 0);
+ lyr->geo_miny = sqlite3_column_double (stmt, 1);
+ lyr->geo_maxx = sqlite3_column_double (stmt, 2);
+ lyr->geo_maxy = sqlite3_column_double (stmt, 3);
+ retcode = 1;
+ }
+ }
+ sqlite3_finalize (stmt);
+ return retcode;
+}
+
+static void
+compute_geographic_extents (sqlite3 * handle, struct wms_list *list)
+{
+/* computing the Geographic Bounding Box for every WMS layer */
+ struct wms_group *grp;
+ struct wms_layer *lyr;
+
+/* first level layers */
+ lyr = list->first_layer;
+ while (lyr != NULL)
+ {
+ if (get_geographic_extent (handle, lyr))
+ fprintf (stderr, "Publishing layer \"%s\"\n", lyr->layer_name);
+ else
+ lyr->valid = 0;
+ lyr = lyr->next;
+ }
+
+ grp = list->first_group;
+ while (grp != NULL)
+ {
+ /* validating layer groups */
+ int valid;
+ int count;
+ int srid;
+ struct wms_style *style;
+ struct wms_layer_ref *ref;
+ ref = grp->first_child;
+ valid = 1;
+ count = 0;
+ if (ref != NULL)
+ srid = ref->layer_ref->srid;
+ while (ref != NULL)
+ {
+ /* preliminary check */
+ if (ref->layer_ref->valid == 0)
+ valid = 0;
+ if (ref->layer_ref->srid != srid)
+ valid = 0;
+ count++;
+ ref = ref->next;
+ }
+ if (count < 1 || valid == 0)
+ {
+ /* reporting an error condition */
+ fprintf (stderr,
+ "ERROR: layer group \"%s\" has mismatching SRIDs !!!\n"
+ "\t... will not be published\n", grp->group_name);
+ grp->valid = 0;
+ }
+ else
+ {
+ /* final refinement pass */
+ double minx = DBL_MAX;
+ double maxx = 0.0 - DBL_MAX;
+ double miny = DBL_MAX;
+ double maxy = 0.0 - DBL_MAX;
+ double geo_minx = DBL_MAX;
+ double geo_maxx = 0.0 - DBL_MAX;
+ double geo_miny = DBL_MAX;
+ double geo_maxy = 0.0 - DBL_MAX;
+ ref = grp->first_child;
+ while (ref != NULL)
+ {
+ struct wms_layer *l = ref->layer_ref;
+ if (ref == grp->first_child)
+ {
+ grp->srid = l->srid;
+ grp->is_geographic = l->is_geographic;
+ if (l->minx < minx)
+ minx = l->minx;
+ if (l->maxx > maxx)
+ maxx = l->maxx;
+ if (l->miny < miny)
+ miny = l->miny;
+ if (l->maxy > maxy)
+ maxy = l->maxy;
+ if (l->geo_minx < geo_minx)
+ geo_minx = l->geo_minx;
+ if (l->geo_maxx > geo_maxx)
+ geo_maxx = l->geo_maxx;
+ if (l->geo_miny < geo_miny)
+ geo_miny = l->geo_miny;
+ if (l->geo_maxy > geo_maxy)
+ geo_maxy = l->geo_maxy;
+ }
+ ref = ref->next;
+ }
+ grp->minx = minx;
+ grp->maxx = maxx;
+ grp->miny = miny;
+ grp->maxy = maxy;
+ grp->geo_minx = geo_minx;
+ grp->geo_maxx = geo_maxx;
+ grp->geo_miny = geo_miny;
+ grp->geo_maxy = geo_maxy;
+
+ /* validating Group Styles */
+ style = grp->first_style;
+ while (style != NULL)
+ {
+ int valid;
+ rl2GroupStylePtr stl;
+ if (strcmp (style->name, "default") == 0)
+ {
+ /* ignoring default styles */
+ style->valid = 0;
+ style = style->next;
+ continue;
+ }
+ stl = rl2_create_group_style_from_dbms (handle,
+ grp->group_name,
+ style->name);
+ if (stl == NULL)
+ {
+ /* reporting an error condition */
+ fprintf (stderr,
+ "ERROR: layer group \"%s\" NULL style !!!\n"
+ "\t... will be ignored\n",
+ grp->group_name);
+ style->valid = 0;
+ style = style->next;
+ continue;
+ }
+ rl2_is_valid_group_style (stl, &valid);
+ if (!valid)
+ {
+ /* reporting an error condition */
+ int count;
+ int idx;
+ fprintf (stderr,
+ "ERROR: layer group \"%s\" invalid style \"%s\" !!!\n"
+ "\t... will be ignored\n", grp->group_name,
+ rl2_get_group_style_name (stl));
+ rl2_get_group_style_count (stl, &count);
+ for (idx = 0; idx < count; idx++)
+ {
+ rl2_is_valid_group_named_layer (stl, idx,
+ &valid);
+ if (!valid)
+ fprintf (stderr,
+ "\t%d/%d\tNamedLayer \"%s\" does not exists !!!\n",
+ idx, count,
+ rl2_get_group_named_layer (stl,
+ idx));
+ rl2_is_valid_group_named_style (stl, idx,
+ &valid);
+ if (!valid)
+ fprintf (stderr,
+ "\t\tNamedStyle \"%s\" does not exists !!!\n",
+ rl2_get_group_named_style (stl,
+ idx));
+ }
+ style->valid = 0;
+ style = style->next;
+ continue;
+ }
+ rl2_destroy_group_style (stl);
+ style = style->next;
+ }
+ if (grp->valid)
+ fprintf (stderr, "Publishing Layer Group \"%s\"\n",
+ grp->group_name);
+ grp = grp->next;
+ }
+ }
+}
+
+static int
+check_geographic_srid (sqlite3 * handle, int srid)
+{
+/* testing if some SRID is of the Geographic type */
+ int ret;
+ char *sql;
+ char **results;
+ int rows;
+ int columns;
+ int i;
+ int geo = -1;
+
+ sql = sqlite3_mprintf ("SELECT Count(*) FROM spatial_ref_sys "
+ "WHERE srid = %d AND proj4text LIKE '%%+proj=longlat%%'",
+ srid);
+ ret = sqlite3_get_table (handle, sql, &results, &rows, &columns, NULL);
+ sqlite3_free (sql);
+ if (ret != SQLITE_OK)
+ goto skip;
+
+ for (i = 1; i <= rows; i++)
+ geo = atoi (results[(i * columns) + 0]);
+ sqlite3_free_table (results);
+ skip:
+ if (geo > 0)
+ return 1;
+ return 0;
+}
+
+static struct wms_layer *
+load_layer (sqlite3 * handle, sqlite3_stmt * stmt)
+{
+/* creating a WMS layer from the resultset */
+ struct wms_layer *lyr = NULL;
+ const char *coverage_name = (const char *) sqlite3_column_text (stmt, 0);
+ const char *title = (const char *) sqlite3_column_text (stmt, 1);
+ const char *abstract = (const char *) sqlite3_column_text (stmt, 2);
+ const char *sample_type = (const char *) sqlite3_column_text (stmt, 3);
+ const char *pixel_type = (const char *) sqlite3_column_text (stmt, 4);
+ int num_bands = sqlite3_column_int (stmt, 5);
+ int srid = sqlite3_column_int (stmt, 6);
+ double minx = sqlite3_column_double (stmt, 7);
+ double miny = sqlite3_column_double (stmt, 8);
+ double maxx = sqlite3_column_double (stmt, 9);
+ double maxy = sqlite3_column_double (stmt, 10);
+ int is_geographic = check_geographic_srid (handle, srid);
+ if (strcmp (sample_type, "1-BIT") == 0
+ && strcmp (pixel_type, "MONOCHROME") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_1_BIT, RL2_PIXEL_MONOCHROME, 1);
+ if (strcmp (sample_type, "1-BIT") == 0
+ && strcmp (pixel_type, "PALETTE") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_1_BIT, RL2_PIXEL_PALETTE, 1);
+ if (strcmp (sample_type, "2-BIT") == 0
+ && strcmp (pixel_type, "PALETTE") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_2_BIT, RL2_PIXEL_PALETTE, 1);
+ if (strcmp (sample_type, "4-BIT") == 0
+ && strcmp (pixel_type, "PALETTE") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_4_BIT, RL2_PIXEL_PALETTE, 1);
+ if (strcmp (sample_type, "UINT8") == 0
+ && strcmp (pixel_type, "PALETTE") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_PALETTE, 1);
+ if (strcmp (sample_type, "UINT8") == 0
+ && strcmp (pixel_type, "GRAYSCALE") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_GRAYSCALE, 1);
+ if (strcmp (sample_type, "UINT8") == 0
+ && strcmp (pixel_type, "RGB") == 0 && num_bands == 3)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_RGB, 3);
+ if (strcmp (sample_type, "UINT16") == 0
+ && strcmp (pixel_type, "RGB") == 0 && num_bands == 3)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_UINT16, RL2_PIXEL_RGB, 3);
+ if (strcmp (sample_type, "UINT8") == 0
+ && strcmp (pixel_type, "MULTIBAND") == 0 && num_bands >= 2
+ && num_bands < 255)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_MULTIBAND, num_bands);
+ if (strcmp (sample_type, "UINT16") == 0
+ && strcmp (pixel_type, "MULTIBAND") == 0 && num_bands >= 2
+ && num_bands < 255)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_UINT16, RL2_PIXEL_MULTIBAND, num_bands);
+ if (strcmp (sample_type, "INT8") == 0
+ && strcmp (pixel_type, "DATAGRID") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_INT8, RL2_PIXEL_DATAGRID, 1);
+ if (strcmp (sample_type, "UINT8") == 0
+ && strcmp (pixel_type, "DATAGRID") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_UINT8, RL2_PIXEL_DATAGRID, 1);
+ if (strcmp (sample_type, "INT16") == 0
+ && strcmp (pixel_type, "DATAGRID") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_INT16, RL2_PIXEL_DATAGRID, 1);
+ if (strcmp (sample_type, "UINT16") == 0
+ && strcmp (pixel_type, "DATAGRID") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_UINT16, RL2_PIXEL_DATAGRID, 1);
+ if (strcmp (sample_type, "INT32") == 0
+ && strcmp (pixel_type, "DATAGRID") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_INT32, RL2_PIXEL_DATAGRID, 1);
+ if (strcmp (sample_type, "UINT32") == 0
+ && strcmp (pixel_type, "DATAGRID") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_UINT32, RL2_PIXEL_DATAGRID, 1);
+ if (strcmp (sample_type, "FLOAT") == 0
+ && strcmp (pixel_type, "DATAGRID") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_FLOAT, RL2_PIXEL_DATAGRID, 1);
+ if (strcmp (sample_type, "DOUBLE") == 0
+ && strcmp (pixel_type, "DATAGRID") == 0 && num_bands == 1)
+ lyr =
+ alloc_wms_layer (coverage_name, title, abstract, srid,
+ is_geographic, minx, miny, maxx, maxy,
+ RL2_SAMPLE_DOUBLE, RL2_PIXEL_DATAGRID, 1);
+ return lyr;
+}
+
+static struct wms_list *
+get_raster_coverages (sqlite3 * handle)
+{
+/* preparing a list of available Raster Coverages */
+ struct wms_list *list = NULL;
+ int ret;
+ sqlite3_stmt *stmt;
+ const char *sql;
+
+/* loading all layers */
+ sql = "SELECT coverage_name, title, abstract, sample_type, "
+ "pixel_type, num_bands, srid, extent_minx, extent_miny, extent_maxx, extent_maxy "
+ "FROM raster_coverages "
+ "WHERE extent_minx IS NOT NULL AND extent_miny IS NOT NULL "
+ "AND extent_maxx IS NOT NULL AND extent_maxy IS NOT NULL";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return NULL;
+ list = alloc_wms_list ();
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ struct wms_layer *lyr = load_layer (handle, stmt);
+ if (lyr != NULL)
+ {
+ if (list->first_layer == NULL)
+ list->first_layer = lyr;
+ if (list->last_layer != NULL)
+ list->last_layer->next = lyr;
+ list->last_layer = lyr;
+ }
+ }
+ }
+ sqlite3_finalize (stmt);
+
+/* loading layer groups */
+ sql = "SELECT g.group_name, g.title, g.abstract, c.coverage_name "
+ "FROM SE_styled_groups AS g "
+ "LEFT JOIN SE_styled_group_refs AS c ON (g.group_name = c.group_name) "
+ "ORDER BY c.paint_order";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ goto error;
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ struct wms_group *grp = NULL;
+ struct wms_layer_ref *ref = NULL;
+ struct wms_layer *lyr = NULL;
+ const char *group_name =
+ (const char *) sqlite3_column_text (stmt, 0);
+ const char *title =
+ (const char *) sqlite3_column_text (stmt, 1);
+ const char *abstract =
+ (const char *) sqlite3_column_text (stmt, 2);
+ const char *coverage_name =
+ (const char *) sqlite3_column_text (stmt, 3);
+ grp = list->first_group;
+ while (grp != NULL)
+ {
+ if (strcmp (grp->group_name, group_name) == 0)
+ goto group_found;
+ grp = grp->next;
+ }
+ grp = alloc_wms_group (group_name, title, abstract);
+ if (list->first_group == NULL)
+ list->first_group = grp;
+ if (list->last_group != NULL)
+ list->last_group->next = grp;
+ list->last_group = grp;
+ group_found:
+ lyr = list->first_layer;
+ while (lyr != NULL)
+ {
+ if (strcmp (lyr->layer_name, coverage_name) == 0)
+ {
+ /* child layer match */
+ lyr->child_layer = 1;
+ ref = alloc_wms_layer_ref (lyr);
+ break;
+ }
+ lyr = lyr->next;
+ }
+ if (ref != NULL)
+ {
+ if (grp->first_child == NULL)
+ grp->first_child = ref;
+ if (grp->last_child != NULL)
+ grp->last_child->next = ref;
+ grp->last_child = ref;
+ }
+ }
+ }
+ sqlite3_finalize (stmt);
+ if (list->first_layer == NULL && list->first_group == NULL)
+ goto error;
+
+ return list;
+
+ error:
+ if (list != NULL)
+ destroy_wms_list (list);
+ return NULL;
+}
+
+static void
+get_raster_styles (sqlite3 * handle, struct wms_list *list)
+{
+/* retrieving all declared Raster Styles */
+ int ret;
+ sqlite3_stmt *stmt;
+ const char *sql = "SELECT coverage_name, name, title, abstract "
+ "FROM SE_raster_styled_layers_view " "ORDER BY coverage_name, style_id";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return;
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const char *title = NULL;
+ const char *abstract = NULL;
+ const char *coverage_name =
+ (const char *) sqlite3_column_text (stmt, 0);
+ const char *name = (const char *) sqlite3_column_text (stmt, 1);
+ if (sqlite3_column_type (stmt, 2) == SQLITE_TEXT)
+ title = (const char *) sqlite3_column_text (stmt, 2);
+ if (sqlite3_column_type (stmt, 3) == SQLITE_TEXT)
+ abstract = (const char *) sqlite3_column_text (stmt, 3);
+ add_style_to_wms_layer (list, coverage_name, name, title,
+ abstract);
+ }
+ }
+ sqlite3_finalize (stmt);
+ add_default_styles (list);
+}
+
+static void
+get_group_styles (sqlite3 * handle, struct wms_list *list)
+{
+/* retrieving all declared Group Styles */
+ int ret;
+ sqlite3_stmt *stmt;
+ const char *sql = "SELECT group_name, name, title, abstract "
+ "FROM SE_group_styles_view " "ORDER BY group_name, style_id";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt, NULL);
+ if (ret != SQLITE_OK)
+ return;
+ while (1)
+ {
+ /* scrolling the result set rows */
+ ret = sqlite3_step (stmt);
+ if (ret == SQLITE_DONE)
+ break; /* end of result set */
+ if (ret == SQLITE_ROW)
+ {
+ const char *title = NULL;
+ const char *abstract = NULL;
+ const char *group_name =
+ (const char *) sqlite3_column_text (stmt, 0);
+ const char *name = (const char *) sqlite3_column_text (stmt, 1);
+ if (sqlite3_column_type (stmt, 2) == SQLITE_TEXT)
+ title = (const char *) sqlite3_column_text (stmt, 2);
+ if (sqlite3_column_type (stmt, 3) == SQLITE_TEXT)
+ abstract = (const char *) sqlite3_column_text (stmt, 3);
+ add_style_to_wms_group (list, group_name, name, title,
+ abstract);
+ }
+ }
+ sqlite3_finalize (stmt);
+ add_default_group_styles (list);
+}
+
+static void
+open_db (const char *path, sqlite3 ** handle, int cache_size, void *cache)
+{
+/* opening the DB */
+ sqlite3 *db_handle;
+ int ret;
+ char sql[1024];
+
+ *handle = NULL;
+ fprintf (stderr,
+ "\n======================================================\n");
+ fprintf (stderr, " WmsLite server startup\n");
+ fprintf (stderr,
+ "======================================================\n");
+ fprintf (stderr, " SQLite version: %s\n", sqlite3_libversion ());
+ fprintf (stderr, " SpatiaLite version: %s\n", spatialite_version ());
+ fprintf (stderr, " RasterLite2 version: %s\n", rl2_version ());
+ fprintf (stderr,
+ "======================================================\n");
+/* enabling the SQLite's shared cache */
+ ret = sqlite3_enable_shared_cache (1);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "unable to enable SQLite's shared cache: ERROR %d\n",
+ ret);
+ sqlite3_close (db_handle);
+ return;
+ }
+
+/* opening the main READ-WRITE connection */
+ ret =
+ sqlite3_open_v2 (path, &db_handle,
+ SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX |
+ SQLITE_OPEN_SHAREDCACHE, NULL);
+ if (ret != SQLITE_OK)
+ {
+ fprintf (stderr, "cannot open '%s': %s\n", path,
+ sqlite3_errmsg (db_handle));
+ sqlite3_close (db_handle);
+ return;
+ }
+ spatialite_init_ex (db_handle, cache, 0);
+ rl2_init (db_handle, 0);
+/* enabling WAL journaling */
+ sprintf (sql, "PRAGMA journal_mode=WAL");
+ sqlite3_exec (db_handle, sql, NULL, NULL, NULL);
+ if (cache_size > 0)
+ {
+ /* setting the CACHE-SIZE */
+ sprintf (sql, "PRAGMA cache_size=%d", cache_size);
+ sqlite3_exec (db_handle, sql, NULL, NULL, NULL);
+ }
+
+ *handle = db_handle;
+ return;
+}
+
+static void
+do_help ()
+{
+/* printing the argument list */
+ fprintf (stderr, "\n\nusage: wmslite ARGLIST ]\n");
+ fprintf (stderr,
+ "==============================================================\n");
+ fprintf (stderr, "-db or --db-path pathname RasterLite2 DB path\n");
+ fprintf (stderr,
+ "-p or --ip-port number IP port number [default: 8080]\n\n");
+ fprintf (stderr,
+ "-cs or --cache-size num DB cache size (how many pages)\n");
+ fprintf (stderr,
+ "-dbg or --debug verbose debugginh mode\n");
+}
+
+int
+main (int argc, char *argv[])
+{
+/* the MAIN function simply perform arguments checking */
+ struct neutral_socket skt_ptr;
+ sqlite3 *handle;
+ sqlite3_stmt *stmt_log = NULL;
+ const char *sql;
+ int ret;
+ int i;
+ int error = 0;
+ int next_arg = ARG_NONE;
+ const char *db_path = NULL;
+ int port_no = 8080;
+ int cache_size = 0;
+ void *cache;
+ struct wms_list *list = NULL;
+ struct connections_pool *pool;
+ struct server_log *log;
+ char *cached_capabilities = NULL;
+ int cached_capabilities_len = 0;
+
+/* installing the signal handlers */
+ glob.handle = NULL;
+ glob.stmt_log = NULL;
+ glob.cached_capabilities = NULL;
+ glob.log = NULL;
+ glob.list = NULL;
+ glob.pool = NULL;
+ glob.cache = NULL;
+#ifdef _WIN32
+ SetConsoleCtrlHandler (signal_handler, TRUE);
+#else
+ signal (SIGINT, signal_handler);
+ signal (SIGTERM, signal_handler);
+#endif
+
+ for (i = 1; i < argc; i++)
+ {
+ /* parsing the invocation arguments */
+ if (next_arg != ARG_NONE)
+ {
+ switch (next_arg)
+ {
+ case ARG_DB_PATH:
+ db_path = argv[i];
+ break;
+ case ARG_IP_PORT:
+ port_no = atoi (argv[i]);
+ break;
+ case ARG_CACHE_SIZE:
+ cache_size = atoi (argv[i]);
+ break;
+ };
+ next_arg = ARG_NONE;
+ continue;
+ }
+
+ if (strcasecmp (argv[i], "--help") == 0
+ || strcmp (argv[i], "-h") == 0)
+ {
+ do_help ();
+ return -1;
+ }
+ if (strcmp (argv[i], "-db") == 0
+ || strcasecmp (argv[i], "--db-path") == 0)
+ {
+ next_arg = ARG_DB_PATH;
+ continue;
+ }
+ if (strcmp (argv[i], "-p") == 0
+ || strcasecmp (argv[i], "--ip-port") == 0)
+ {
+ next_arg = ARG_IP_PORT;
+ continue;
+ }
+ if (strcasecmp (argv[i], "--cache-size") == 0
+ || strcmp (argv[i], "-cs") == 0)
+ {
+ next_arg = ARG_CACHE_SIZE;
+ continue;
+ }
+ if (strcasecmp (argv[i], "--debug") == 0
+ || strcmp (argv[i], "-dbg") == 0)
+ {
+ debug_mode = 1;
+ continue;
+ }
+ fprintf (stderr, "unknown argument: %s\n", argv[i]);
+ error = 1;
+ }
+ if (error)
+ {
+ do_help ();
+ return -1;
+ }
+
+/* checking the arguments */
+ if (db_path == NULL)
+ {
+ fprintf (stderr, "did you forget to specify the --db-path arg ?\n");
+ error = 1;
+ }
+ if (error)
+ {
+ do_help ();
+ return -1;
+ }
+
+/* opening the DB */
+ cache = spatialite_alloc_connection ();
+ glob.cache = cache;
+ open_db (db_path, &handle, cache_size, cache);
+ if (!handle)
+ return -1;
+ glob.handle = handle;
+
+ list = get_raster_coverages (handle);
+ if (list == NULL)
+ {
+ fprintf (stderr,
+ "the DB \"%s\" doesn't contain any valid Raster Coverage\n",
+ db_path);
+ goto stop;
+ }
+
+ get_raster_styles (handle, list);
+ get_group_styles (handle, list);
+ glob.list = list;
+ compute_geographic_extents (handle, list);
+ build_get_capabilities (list, &cached_capabilities,
+ &cached_capabilities_len);
+ glob.cached_capabilities = cached_capabilities;
+
+/* creating the read connections pool */
+ pool = alloc_connections_pool (db_path);
+ if (pool == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to initialize a connections pool\n");
+ goto stop;
+ }
+ glob.pool = pool;
+
+/* creating the server log helper struct */
+ log = alloc_server_log ();
+ if (log == NULL)
+ {
+ fprintf (stderr, "ERROR: unable to initialize the server log\n");
+ goto stop;
+ }
+ glob.log = log;
+
+/* starting the HTTP server */
+ if (!do_start_http (port_no, &skt_ptr))
+ goto stop;
+
+/* starting the logging facility */
+ sql = "CREATE TABLE IF NOT EXISTS wms_server_log (\n"
+ "\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n"
+ "\ttimestamp TEXT NOT NULL,\n"
+ "\tclient_ip_addr TEXT NOT NULL,\n"
+ "\tclient_ip_port INTEGER NOT NULL,\n"
+ "\thttp_method TEXT NOT NULL,\n"
+ "\trequest_url TEXT NOT NULL,\n"
+ "\thttp_status INTEGER NOT NULL,\n"
+ "\tresponse_length INTEGER NOT NULL,\n"
+ "\twms_request TEXT,\n"
+ "\twms_version TEXT,\n"
+ "\twms_layer TEXT,\n"
+ "\twms_srid INTEGER,\n"
+ "\twms_bbox_minx DOUBLE,\n"
+ "\twms_bbox_miny DOUBLE,\n"
+ "\twms_bbox_maxx DOUBLE,\n"
+ "\twms_bbox_maxy DOUBLE,\n"
+ "\twms_width INTEGER,\n"
+ "\twms_height INTEGER,\n"
+ "\twms_style TEXT,\n"
+ "\twms_format TEXT,\n"
+ "\twms_transparent INTEGER,\n"
+ "\twms_bgcolor TEXT,\n" "\tmilliseconds INTEGER)";
+ sqlite3_exec (handle, sql, NULL, NULL, NULL);
+
+ sql = "INSERT INTO wms_server_log (id, timestamp, client_ip_addr, "
+ "client_ip_port, http_method, request_url, http_status, "
+ "response_length, wms_request, wms_version, wms_layer, "
+ "wms_srid, wms_bbox_minx, wms_bbox_miny, wms_bbox_maxx, "
+ "wms_bbox_maxy, wms_width, wms_height, wms_style, "
+ "wms_format, wms_transparent, wms_bgcolor, milliseconds) "
+ "VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ ret = sqlite3_prepare_v2 (handle, sql, strlen (sql), &stmt_log, NULL);
+ if (ret != SQLITE_OK)
+ {
+ printf ("INSERT INTO LOG error: %s\n", sqlite3_errmsg (handle));
+ goto stop;
+ }
+ glob.stmt_log = stmt_log;
+
+/* looping on requests */
+ do_accept_loop (&skt_ptr, list, port_no, handle, stmt_log, pool, log,
+ cached_capabilities, cached_capabilities_len);
+
+ stop:
+ destroy_wms_list (list);
+ list = NULL;
+ glob.list = NULL;
+ clean_shutdown ();
+ return 0;
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/librasterlite2.git
More information about the Pkg-grass-devel
mailing list